import { type JSX } from "react"; import type { BaseSchema } from "valibot"; import { type ValidationProps } from "../../../hook/useInputValidation"; /** * Props for the {@link Textarea} component. * * @remarks * Extends standard HTML textarea attributes and adds validation and auto-resizing properties. */ export type TextareaProps> = JSX.IntrinsicElements["textarea"] & ValidationProps & { /** * The maximum height of the textarea before it starts scrolling. * Can be a number (pixels) or a CSS string (e.g., "50vh"). * If null, it grows indefinitely. */ maxBlockSize?: number | string | null; /** * The minimum number of rows to display. * @defaultValue 1 */ minRows?: number; }; /** * A textarea component that automatically resizes based on its content. * * @remarks * This component integrates with `useInputValidation` for validation and `useResize` * to handle dynamic resizing. It expands vertically as the user types, up to a specified * `maxBlockSize`. * * @param props - The component props. * @returns The rendered textarea element. * * @example * ```tsx * import { string, maxLength } from 'valibot'; * import { Textarea } from './textarea'; * * const bioSchema = string([maxLength(500)]); * * function BioField() { * return ( *