import { Ref } from 'react'; import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types'; export type TextareaProps = Omit, 'disabled' | 'readOnly'> & { /** ClassName apply to textarea */ textareaClassName?: string; /** The react ref passed to textarea element. */ textareaRef?: Ref; /** Controls textarea CSS `resize` behavior with native `resize` values. */ resize?: 'none' | 'both' | 'horizontal' | 'vertical'; } & ({ /** Set visual style type of the textarea. */ type?: 'default'; /** Disabled state of the taxtarea, Only available on default type. */ disabled?: boolean; /** ReadOnly state of the textarea, Only available on default type. */ readOnly?: boolean; } | { /** 文字區域類型:警告或錯誤狀態。 */ type: 'warning' | 'error'; /** 警告/錯誤狀態下不適用。 */ disabled?: never; /** 警告/錯誤狀態下不適用。 */ readOnly?: never; }); /** * 多行文字輸入區域元件,支援禁用、唯讀、警告與錯誤等視覺狀態。 * * 以 `TextField` 作為外框容器,`type` 控制視覺樣式(`default`、`warning`、`error`), * `disabled` 與 `readOnly` 僅在 `type="default"` 時有效。`resize` prop 對應原生 CSS * `resize` 屬性,設為非 `none` 時會顯示右下角的調整大小拖曳圖示。 * * @example * ```tsx * import Textarea from '@mezzanine-ui/react/Textarea'; * * // 基本用法 *