diff --git a/playwright/components/textarea/index.ts b/playwright/components/textarea/index.ts deleted file mode 100644 index 3f514425a9..0000000000 --- a/playwright/components/textarea/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Page } from "@playwright/test"; -import { TEXTAREA } from "./locators"; - -// component preview locators -export const textarea = (page: Page) => page.locator(TEXTAREA); - -export const textareaChildren = (page: Page) => - page.locator(TEXTAREA).locator("textarea"); diff --git a/playwright/components/textarea/locators.ts b/playwright/components/textarea/locators.ts deleted file mode 100644 index 477b78d62d..0000000000 --- a/playwright/components/textarea/locators.ts +++ /dev/null @@ -1,4 +0,0 @@ -// component preview locators -export const TEXTAREA = 'div[role="presentation"]'; - -export const FORM_CONTENT = 'div[data-element="form-content"]'; diff --git a/skills/carbon-react/components/textarea.md b/skills/carbon-react/components/textarea.md index 87feaaa46a..3b07098eaa 100644 --- a/skills/carbon-react/components/textarea.md +++ b/skills/carbon-react/components/textarea.md @@ -16,7 +16,7 @@ description: Carbon Textarea component props and usage examples. | Name | Type | Required | Literals | Deprecated | Deprecation reason | Description | Default | | --- | --- | --- | --- | --- | --- | --- | --- | | onChange | (ev: React.ChangeEvent) => void | Yes | | | | Callback fired when the user types in the Textarea | | -| value | string | Yes | | | | The value of the Textbox | | +| value | string | Yes | | | | The value of the Textarea | | | about | string \| undefined | No | | | | | | | accessKey | string \| undefined | No | | | | | | | autoCapitalize | (string & {}) \| "none" \| "off" \| "on" \| "sentences" \| "words" \| "characters" \| undefined | No | | | | | | @@ -25,7 +25,6 @@ description: Carbon Textarea component props and usage examples. | autoFocus | boolean \| undefined | No | | | | Automatically focus the input on component mount | | | autoSave | string \| undefined | No | | | | | | | characterLimit | number \| undefined | No | | | | Character limit of the textarea | | -| children | React.ReactNode | No | | | | Type of the icon that will be rendered next to the input | | | className | string \| undefined | No | | | | | | | color | string \| undefined | No | | | | | | | cols | number \| undefined | No | | | | | | @@ -41,8 +40,8 @@ description: Carbon Textarea component props and usage examples. | disabled | boolean \| undefined | No | | | | If true, the component will be disabled | false | | draggable | Booleanish \| undefined | No | | | | | | | enterKeyHint | "go" \| "send" \| "search" \| "enter" \| "done" \| "next" \| "previous" \| undefined | No | go \| send \| search \| enter \| done \| next \| previous | | | | | -| error | string \| boolean \| undefined | No | | | | Indicate that error has occurred. Pass string to display icon, tooltip and red border. Pass true boolean to only display red border. | | -| expandable | boolean \| undefined | No | | | | Allows the Textareas Height to change based on user input | false | +| error | string \| boolean \| undefined | No | | | | Indicates that an error has occurred. | | +| expandable | boolean \| undefined | No | | | | Allows the textarea's height to change based on user input | false | | exportparts | string \| undefined | No | | | | | | | form | string \| undefined | No | | | | | | | hidden | boolean \| undefined | No | | | | | | @@ -51,6 +50,7 @@ description: Carbon Textarea component props and usage examples. | inputHint | string \| undefined | No | | | | A hint string rendered before the input but after the label. Intended to describe the purpose or content of the input. | | | inputIcon | IconType \| undefined | No | target \| filter \| reset \| accessibility_web \| add \| admin \| airplay \| alert \| alert_on \| analysis \| app_facebook \| app_instagram \| app_tiktok \| app_twitter \| app_youtube \| apps \| arrow \| arrow_bottom_right_circle \| arrow_down \| arrow_left \| arrow_left_boxed \| arrow_left_right_small \| arrow_left_small \| arrow_right \| arrow_right_small \| arrow_top_left_circle \| arrow_top_right_circle \| arrow_up \| arrows_left_right \| at_sign \| attach \| bank \| bank_with_card \| basket \| basket_with_squares \| batch \| bed \| bill_paid \| bill_unpaid \| bin \| biometric \| blocked \| blocked_square \| block_arrow_right \| bold \| box_arrow_left \| box_arrow_right \| boxed_shapes \| bulk_destroy \| bullet_list \| bullet_list_dotted \| bullet_list_numbers \| business \| calendar \| calendar_pay_date \| calendar_today \| call \| camera \| car_lock \| car_money \| car_repair \| card_wallet \| card_view \| caret_down \| caret_left \| caret_right \| caret_up \| caret_up_down \| caret_large_down \| caret_large_left \| caret_large_right \| caret_large_up \| cart \| cash \| chat \| chart_bar \| chart_bar_arrow_up \| chart_line \| chart_pie \| chat_notes \| check_all \| check_none \| chevron_down \| chevron_first \| chevron_first_pagination \| chevron_last \| chevron_last_pagination \| chevron_left \| chevron_right \| chevron_up \| chevron_down_thick \| chevron_left_thick \| chevron_right_thick \| chevron_up_thick \| chromecast \| circle_with_dots \| circles_connection \| clear \| clock \| clock_add \| close \| code \| cloud_co2 \| coins \| collaborate \| color_picker \| computer_clock \| connect \| connect_circle \| connect_off \| construction \| contacts \| contact_card \| copy \| create \| credit_card \| credit_card_slash \| cross \| cross_circle \| csv \| dashboard \| delete \| delivery \| diagonal_arrows_up \| disputed \| disconnect \| document_right_align \| document_tick \| document_vertical_lines \| download \| double_tick \| drag \| drag_hover \| drag_vertical \| draft \| drill \| dropdown \| duplicate \| edit \| edited \| email \| email_switch \| entry \| envelope_dollar \| envelope_euro \| ellipsis_horizontal \| ellipsis_vertical \| error \| error_square \| euro \| expand \| export \| factory \| favourite \| favourite_lined \| fax \| feedback \| file_excel \| file_generic \| file_image \| file_pdf \| file_word \| files_leaning \| filter_new \| fit_height \| fit_width \| flag \| flash \| folder \| form_refresh \| framerate \| fullscreen \| get_quote \| gift \| go \| graduation_hat \| graph \| graphql \| grid \| heart \| hand_cash_coins \| hand_cash_note \| heart_pulse \| help \| hide \| hierarchy \| home \| image \| import \| in_progress \| in_transit \| individual \| info \| intranet \| ipad \| italic \| job_seeked \| key \| laptop \| leaf \| ledger \| ledger_arrow_left \| ledger_arrow_right \| like \| like_no \| link \| lightbulb_off \| lightbulb_on \| link_card \| link_cloud \| link_on \| list_view \| locked \| login \| location \| logout \| lookup \| marker \| marker_off \| message \| microphone \| minimise \| minus \| minus_large \| mobile \| money_bag \| mute \| none \| normalscreen \| old_warning \| page \| palm_tree \| palette \| pause \| pause_circle \| pdf \| pin \| people \| people_switch \| percentage_boxed \| person \| person_add \| person_info \| person_tick \| petrol_pump \| phone \| picture_in_picture \| piggy_bank \| placeholder \| plane \| play \| play_circle \| plus \| plus_circle \| plus_large \| pound \| print \| progress \| progressed \| protect \| question \| question_hollow \| question_mark \| recruiting \| refresh \| refresh_clock \| remove \| replay \| sage_coin \| save \| scan \| send \| search \| services \| settings \| settings_old \| share \| shield_with_tick \| shield_with_tick_outline \| shop \| sort_down \| sort_up \| source_code \| spanner \| speaker \| split \| split_container \| squares_nine \| stacked_boxes \| stacked_squares \| stop \| stop_circle \| submitted \| subtitles \| support_online \| system_Android \| system_iOS \| sync \| tag \| talk \| target_man \| theatre_masks \| three_boxes \| tick \| tick_circle \| tick_thick \| time_zone \| true_tick \| u_turn_left \| u_turn_right \| underline \| undo \| unlocked \| upload \| uploaded \| user_groups \| video \| view \| volume_high \| volume_low \| volume_medium \| volunteering \| warning \| website \| welfare \| worldwide_location | | | List of supported icons Icon to display inside of the Textarea | | | inputMode | "email" \| "none" \| "search" \| "text" \| "tel" \| "url" \| "numeric" \| "decimal" \| undefined | No | email \| none \| search \| text \| tel \| url \| numeric \| decimal | | | Hints at the type of data that might be entered by the user while editing the element or its contents | | +| inputWidth | number \| undefined | No | | | | The width of the input as a percentage | | | is | string \| undefined | No | | | | Specify that a standard HTML element should behave like a defined custom built-in element | | | itemID | string \| undefined | No | | | | | | | itemProp | string \| undefined | No | | | | | | @@ -58,7 +58,7 @@ description: Carbon Textarea component props and usage examples. | itemScope | boolean \| undefined | No | | | | | | | itemType | string \| undefined | No | | | | | | | label | string \| undefined | No | | | | The content of the label for the input | | -| labelInline | boolean \| undefined | No | | | | When true, label is placed in line an input | | +| labelInline | boolean \| undefined | No | | | | When true, the label is placed inline with the textarea | false | | lang | string \| undefined | No | | | | | | | m | ResponsiveValue \| undefined | No | | | | Margin on top, left, bottom and right | | | margin | ResponsiveValue \| undefined | No | | | | Margin on top, left, bottom and right | | @@ -69,7 +69,7 @@ description: Carbon Textarea component props and usage examples. | marginX | ResponsiveValue \| undefined | No | | | | Margin on left and right | | | marginY | ResponsiveValue \| undefined | No | | | | Margin on top and bottom | | | maxLength | number \| undefined | No | | | | | | -| maxRows | number \| undefined | No | | | | Specifies the number of visible text lines. When set, the textarea expands up to this maximum height. | | +| maxRows | number \| undefined | No | | | | Specifies the maximum number of visible text lines. When set, the textarea expands with its content up to this height. The textarea is never smaller than 3 rows. | | | maxWidth | string \| undefined | No | | | | Prop for specifying the max width of the input. Leaving the `maxWidth` prop with no value will default the width to '100%' | | | mb | ResponsiveValue \| undefined | No | | | | Margin on bottom | | | minHeight | number \| undefined | No | | | | Specify the minimum height. This property is only applied if rows is not set. | | @@ -262,9 +262,9 @@ description: Carbon Textarea component props and usage examples. | translate | "yes" \| "no" \| undefined | No | yes \| no | | | | | | typeof | string \| undefined | No | | | | | | | unselectable | "off" \| "on" \| undefined | No | off \| on | | | | | -| validationMessagePositionTop | boolean \| undefined | No | | | | Render the ValidationMessage above the Textarea when validationRedesignOptIn flag is set | true | +| validationMessagePositionTop | boolean \| undefined | No | | | | Set to false if the validation message should be rendered below the textarea. | true | | vocab | string \| undefined | No | | | | | | -| warning | string \| boolean \| undefined | No | | | | Indicate that warning has occurred. Pass string to display icon, tooltip and orange border. Pass true boolean to only display orange border. | | +| warning | string \| boolean \| undefined | No | | | | Indicates that a warning has occurred. | | | wrap | string \| undefined | No | | | | | | | data-element | string \| undefined | No | | | | Identifier used for testing purposes, applied to the root element of the component. | | | data-role | string \| undefined | No | | | | Identifier used for testing purposes, applied to the root element of the component. | | @@ -319,547 +319,423 @@ description: Carbon Textarea component props and usage examples. | aria-valuemin | number \| undefined | No | | | | Defines the minimum allowed value for a range widget. | | | aria-valuenow | number \| undefined | No | | | | Defines the current value for a range widget. | | | aria-valuetext | string \| undefined | No | | | | Defines the human readable text alternative of aria-valuenow for a range widget. | | -| adaptiveLabelBreakpoint | number \| undefined | No | | Yes | Breakpoint for adaptive label (inline labels change to top aligned). This prop no longer has any effect - responsive label behaviour should be handled by the implementing team. It is retained for backwards compatibility and will be removed in future versions. | | | -| align | "left" \| "right" \| undefined | No | left \| right | Yes | [Legacy] The default value alignment on the input. This property is deprecated and will be removed in future versions. | | | -| as | React.ElementType \| undefined | No | | Yes | Override the variant component. This property is deprecated and will be removed in future versions. | | | -| borderRadius | BorderRadiusType \| BorderRadiusType[] \| undefined | No | | Yes | Specify a custom border radius for the component. Any valid border-radius design token, or an array of border-radius design tokens. This property is deprecated and will be removed in future versions. | | | -| fieldHelp | React.ReactNode | No | | Yes | [Legacy] Help content to be displayed under an input. This property is deprecated and will be removed in future versions. | | | -| helpAriaLabel | string \| undefined | No | | Yes | [Legacy] Aria label for rendered help component. This property is deprecated and will be removed in future versions. | | | -| hideBorders | boolean \| undefined | No | | Yes | Hides the borders for the component. Please note that validation and focus styling will still be applied. This property is deprecated and will be removed in future versions. | | false | -| info | string \| boolean \| undefined | No | | Yes | [Legacy] Indicate additional information. Pass string to display icon, tooltip and blue border. Pass true boolean to only display blue border. This property is deprecated and will be removed in future versions. | | | -| inputBorderRadius | BorderRadiusType \| BorderRadiusType[] \| undefined | No | | Yes | [Legacy] Specify a custom border radius for the input. This prop is retained for backwards compatibility but no longer has any effect (use `borderRadius` instead). This property is deprecated and will be removed in future versions. | | | -| inputWidth | number \| undefined | No | | Yes | [Legacy] Width of an input in percentage. Works only when labelInline is true. This property is deprecated and will be removed in future versions. | | | -| isOptional | boolean \| undefined | No | | Yes | [Legacy] Flag to configure component as optional. If the value of this component is not required, use the `required` prop and set it to false instead. This property is deprecated and will be removed in future versions. | | | -| labelAlign | "left" \| "right" \| undefined | No | left \| right | Yes | Label alignment. This property is deprecated and will be removed in future versions. | | | -| labelHelp | React.ReactNode | No | | Yes | [Legacy] Text applied to label help tooltip. When opted into new design validations it will render as a hint above the input, unless an `inputHint` prop is also passed. This property is deprecated and will be removed in future versions. | | | -| labelSpacing | 1 \| 2 \| undefined | No | 1 \| 2 | Yes | [Legacy] Spacing between label and a field for inline label, given number will be multiplied by base spacing unit (8). This property is deprecated and will be removed in future versions. | | | -| labelWidth | number \| undefined | No | | Yes | [Legacy] Width of a label in percentage. Works only when labelInline is true. This property is deprecated and will be removed in future versions. | | 30 | +| adaptiveLabelBreakpoint | number \| undefined | No | | Yes | This prop is no longer supported. Implement responsive label behavior in the consuming application. | Breakpoint for adaptive label (inline labels change to top aligned). | | +| align | "left" \| "right" \| undefined | No | left \| right | Yes | This prop is no longer supported. | [Legacy] The default value alignment on the input. | | +| as | React.ElementType \| undefined | No | | Yes | This prop is no longer supported. | Override the variant component. | | +| borderRadius | BorderRadiusType \| BorderRadiusType[] \| undefined | No | | Yes | This prop is no longer supported. | Specify a custom border radius for the component. | | +| children | React.ReactNode | No | | Yes | This prop is no longer supported. | Type of the icon that will be rendered next to the input. | | +| fieldHelp | React.ReactNode | No | | Yes | This prop is no longer supported. Use `inputHint` instead. | [Legacy] Help content to be displayed under an input. | | +| helpAriaLabel | string \| undefined | No | | Yes | This prop is no longer supported. | [Legacy] Aria label for rendered help component. | | +| hideBorders | boolean \| undefined | No | | Yes | This prop is no longer supported. | Hides the borders for the component. | | +| info | string \| boolean \| undefined | No | | Yes | This prop is no longer supported. | [Legacy] Indicate additional information. | | +| inputBorderRadius | BorderRadiusType \| BorderRadiusType[] \| undefined | No | | Yes | This prop is no longer supported. | [Legacy] Specify a custom border radius for the input. | | +| isOptional | boolean \| undefined | No | | Yes | This prop is no longer supported. | [Legacy] Flag to configure component as optional. | | +| labelAlign | "left" \| "right" \| undefined | No | left \| right | Yes | This prop is no longer supported. | Label alignment. | | +| labelHelp | React.ReactNode | No | | Yes | This prop is no longer supported. Use `inputHint` instead. | [Legacy] Text applied to label help tooltip. | | +| labelSpacing | 1 \| 2 \| undefined | No | 1 \| 2 | Yes | This prop is no longer supported. | [Legacy] Spacing between label and a field for inline label, given number will be multiplied by base spacing unit (8). | | +| labelWidth | number \| undefined | No | | Yes | This prop is no longer supported. | [Legacy] Width of a label in percentage. | | | onKeyPress | KeyboardEventHandler \| undefined | No | | Yes | Use `onKeyUp` or `onKeyDown` instead | | | | onKeyPressCapture | KeyboardEventHandler \| undefined | No | | Yes | Use `onKeyUpCapture` or `onKeyDownCapture` instead | | | -| tooltipPosition | "left" \| "right" \| "bottom" \| "top" \| undefined | No | left \| right \| bottom \| top | Yes | [Legacy] Overrides the default tooltip position. This property is deprecated and will be removed in future versions. | | | -| validationIconId | string \| undefined | No | | Yes | [Legacy] Id of the validation icon. This prop no longer has any effect as the legacy validation icon has been removed. This property is deprecated and will be removed in future versions. | | | -| validationOnLabel | boolean \| undefined | No | | Yes | [Legacy] When true, validation icon will be placed on label instead of being placed on the input. This property is deprecated and will be removed in future versions. | | false | +| tooltipPosition | "left" \| "right" \| "bottom" \| "top" \| undefined | No | left \| right \| bottom \| top | Yes | This prop is no longer supported. | [Legacy] Overrides the default tooltip position. | | +| validationIconId | string \| undefined | No | | Yes | This prop is no longer supported. | [Legacy] Id of the validation icon. | | +| validationOnLabel | boolean \| undefined | No | | Yes | This prop is no longer supported. | [Legacy] When true, validation icon will be placed on label instead of being placed on the input. | | | aria-dropeffect | "copy" \| "link" \| "none" \| "execute" \| "move" \| "popup" \| undefined | No | copy \| link \| none \| execute \| move \| popup | Yes | in ARIA 1.1 | Indicates what functions can be performed when a dragged object is released on the drop target. | | | aria-grabbed | Booleanish \| undefined | No | | Yes | in ARIA 1.1 | Indicates an element's "grabbed" state in a drag-and-drop operation. | | ## Examples -### Default +### ValidationError **Render** ```tsx -() => { - const [state, setState] = useState(""); - const setValue = ({ target }: React.ChangeEvent) => { - setState(target.value); - }; - return