Skip to content

Commit

Permalink
Merge branch 'main' into TheSonOfThomp-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSonOfThomp authored Feb 14, 2024
2 parents f80d93f + 36a8ded commit d9f64cf
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .changeset/tricky-cars-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@leafygreen-ui/text-area': minor
'@leafygreen-ui/combobox': minor
'@leafygreen-ui/select': minor
---

`description` prop can now be a `React.ReactNode` rather than a `string`
2 changes: 1 addition & 1 deletion packages/combobox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ import { Combobox, ComboboxOption } from '@leafygreen-ui/combobox';
| `overflow` | `'expand-y'`, `'expand-x'`, `'scroll-x'` | Defines the overflow behavior of a multiselect combobox. **expand-y**: Combobox has fixed width, and additional selections will cause the element to grow in the block direction. **expand-x**: Combobox has fixed height, and additional selections will cause the elemenet to grow in the inline direction. **scroll-x**: Combobox has fixed height and width, and additional selections will cause the element to be scrollable in the x (horizontal) direction. | `'expand-y'` |
| `label` | `string` | An accessible label for the input, rendered in a `<label>` to the DOM | |
| `aria-label` | `string` | An accessible label for the input, used only for screen-readers | |
| `description` | `string` | A description for the input | |
| `description` | `React.ReactNode` | A description for the input | |
| `placeholder` | `string` | A placeholder for the input element. Uses the native `placeholder` attribute. | 'Select' |
| `disabled` | `boolean` | Disables all interaction with the component | false |
| `size` | `'default'` | Defines the visual size of the component | 'default' |
Expand Down
4 changes: 2 additions & 2 deletions packages/combobox/src/Combobox/Combobox.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactNode } from 'react';
import React, { ReactNode } from 'react';

import { type ChipProps } from '@leafygreen-ui/chip';
import { Either, HTMLElementProps } from '@leafygreen-ui/lib';
Expand Down Expand Up @@ -80,7 +80,7 @@ export type BaseComboboxProps = Omit<HTMLElementProps<'div'>, 'onChange'> &
/**
* A description for the input
*/
description?: string;
description?: ReactNode;

/**
* A placeholder for the input element. Uses the native `placeholder` attribute.
Expand Down
2 changes: 1 addition & 1 deletion packages/select/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ import { Option, OptionGroup, Select, Size } from '@leafygreen-ui/select';
| `label` | `string` | Text shown in bold above the input element. | |
| `aria-labelledby` | `string` | Must be provided if and only if neither `label` nor `aria-label` is not provided. |
| `aria-label` | `string` | Must be provided if and only if neither `label` nor `aria-labelledby` is not provided. | |
| `description` | `string` | Text that gives more detail about the requirements for the input. | |
| `description` | `React.ReactNode` | Text that gives more detail about the requirements for the input. | |
| `placeholder` | `string` | The placeholder text shown in the input element when an option is not selected. | `'Select'` |
| `disabled` | `boolean` | Disables the component from being edited. | `false` |
| `value` | `string` | Sets the `<Option />` that will appear selected and makes the component a controlled component. | `''` |
Expand Down
9 changes: 8 additions & 1 deletion packages/select/src/Select/Select.types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import React from 'react';

import { ButtonProps } from '@leafygreen-ui/button';
import { Either, HTMLElementProps } from '@leafygreen-ui/lib';
import { PopoverProps } from '@leafygreen-ui/popover';
Expand Down Expand Up @@ -41,6 +43,11 @@ export interface BaseSelectProps
* HTML `id` property used to allow Javascript, form, or label to reference the input.
*/
id?: string;

/**
* Determines whether or not the component appears in dark theme.
* @default false
*/
darkMode?: boolean;
/**
* Determines the size in which the component will be rendered.
Expand All @@ -55,7 +62,7 @@ export interface BaseSelectProps
/**
* Secondary text rendered under the label to provide additional details about the select and its options.
*/
description?: string;
description?: React.ReactNode;
/**
* Text rendered in the Select component before a value is set.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/text-area/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ return (
| `id` | `string` | id to describe the `<textarea>` element | |
| `darkMode` | `boolean` | Determines whether or not the component will appear in dark mode. | `false` |
| `label` | `string` | Label for `<textarea>` | |
| `description` | `string` | Description below label | |
| `description` | `React.ReactNode` | Description below label | |
| `state` | `'none'`, `'valid'`, `'error'` | Determines the state of the `<textarea>` | `'none'` |
| `className` | `string` | className applied to the container element | |
| `disabled` | `boolean` | Determines if the component is disabled | `false` |
Expand Down
4 changes: 3 additions & 1 deletion packages/text-area/src/TextArea/TextArea.types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import React from 'react';

import { Either, HTMLElementProps } from '@leafygreen-ui/lib';
import { BaseFontSize } from '@leafygreen-ui/tokens';

Expand Down Expand Up @@ -31,7 +33,7 @@ export interface BaseTextAreaProps
/**
* Text that gives more detail about the requirements for the input.
*/
description?: string;
description?: React.ReactNode;

/**
* Whether or not the field is currently disabled.
Expand Down

0 comments on commit d9f64cf

Please sign in to comment.