// // Copyright 2026 DXOS.org // import { Field as FieldPrimitive } from '@ark-ui/react/field'; import React, { type TextareaHTMLAttributes } from 'react'; import { recipes } from '../../recipes.ts'; import { composable, composableProps } from '../../util/slots.ts'; import * as Fieldset from '../Fieldset/Fieldset.tsx'; /** Fewest lines a textarea shows, so it never reads as a single-line Input; a `plain` one is page text, sized to it. */ const MIN_ROWS = 3; export type TextareaProps = TextareaHTMLAttributes & { /** Grow with the content from `rows` lines (at least 3) instead of scrolling. */ autoResize?: boolean; /** `subdued` drops the well, and `plain` the well and the inset, as Input's. */ variant?: 'default' | 'subdued' | 'plain'; }; /** Multi-line text at control width; inside a `Field.Root` it takes the field's id, label and description wiring. */ export const Textarea = composable( ({ rows = MIN_ROWS, autoResize = false, variant = 'default', disabled, ...props }, forwardedRef) => { const fieldsetDisabled = Fieldset.useFieldsetDisabled(disabled); const { className, ...rest } = composableProps(props, { classNames: recipes.textarea() }); return ( ); }, ); Textarea.displayName = 'Textarea';