import { type ComponentPropsWithoutRef } from 'react'; import { type TextBoxSlotRecipeVariant } from '../../styled-system/recipes'; /** * The props for the Textarea component. */ export type TextareaProps = { /** * Whether the textarea is invalid or not. * This will change the style of the text box. * * @default false */ invalid?: TextBoxSlotRecipeVariant['invalid']; /** * The size of the textarea. * * @default 'medium' */ size?: TextBoxSlotRecipeVariant['size']; /** * Whether the textarea is disabled or not. * If disabled, users cannot edit the content. * * @default false */ disabled?: TextBoxSlotRecipeVariant['disabled']; /** * Enables automatic resizing of the textarea height based on content. * The textarea will automatically adjust its height to fit the content. * * Note: When enabled, this disables manual resize handles to prevent conflicts. * Screen reader users will be notified of content changes through normal textarea behavior. * * @default false */ enableAutoResize?: boolean; /** * Controls the resize behavior of the textarea. * * - `'none'`: Disables manual resizing * - `'vertical'`: Allows vertical resizing only (requested feature) * - `'horizontal'`: Allows horizontal resizing only * - `'both'`: Allows resizing in both directions * * Note: Manual resizing is not supported on mobile browsers and will gracefully * fall back to non-resizable behavior. The component remains fully functional. * When `enableAutoResize` is true, this prop is overridden and set to `'none'`. * * @default 'both' */ resize?: 'none' | 'vertical' | 'horizontal' | 'both'; } & ComponentPropsWithoutRef<'textarea'>;