import React from "react"; import { PlusTextarea as PlusTextareaElement } from "../dist/components/textarea/index.js"; export type { PlusTextareaElement }; export interface PlusTextareaProps extends Pick< React.AllHTMLAttributes, | "children" | "dir" | "hidden" | "id" | "lang" | "slot" | "style" | "title" | "translate" | "onClick" | "onFocus" | "onBlur" > { /** Whether the textarea is disabled. */ disabled?: boolean; /** Whether the textarea is readonly. */ readonly?: boolean; /** Whether the textarea is required. */ required?: boolean; /** Whether the textarea should automatically get focus. */ autoFocus?: boolean | undefined; /** Whether the textarea is in an error state. */ error?: boolean; /** Whether the textarea should take up full width. */ fullWidth?: boolean; /** The textarea's name attribute. */ name?: PlusTextareaElement["name"]; /** The textarea's value attribute. */ value?: PlusTextareaElement["value"]; /** The textarea's placeholder text. */ placeholder?: PlusTextareaElement["placeholder"]; /** The size variant of the textarea. */ size?: PlusTextareaElement["size"]; /** The label for the textarea. */ label?: PlusTextareaElement["label"]; /** The minimum length of the value. */ minlength?: PlusTextareaElement["minlength"]; /** The maximum length of the value. */ maxlength?: PlusTextareaElement["maxlength"]; /** Caption text to display below the textarea. */ caption?: PlusTextareaElement["caption"]; /** The error message to display (overrides default validation messages). */ errorMessage?: PlusTextareaElement["errorMessage"]; /** Specifies the visible number of lines in a text area. */ rows?: PlusTextareaElement["rows"]; /** Controls how the textarea can be resized. */ resize?: PlusTextareaElement["resize"]; /** Specifies how the text in a text area is to be wrapped when submitted in a form. */ wrap?: PlusTextareaElement["wrap"]; /** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */ className?: string; /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */ exportparts?: string; /** Used for labels to link them with their inputs (using input id). */ htmlFor?: string; /** Used to help React identify which items have changed, are added, or are removed within a list. */ key?: number | string; /** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */ part?: string; /** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */ ref?: any; /** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */ tabIndex?: number; /** Emitted when the textarea value changes */ onPlusInput?: (event: CustomEvent) => void; /** Emitted when the textarea value changes and loses focus */ onPlusChange?: (event: CustomEvent) => void; /** Emitted when the textarea gains focus */ onPlusFocus?: (event: CustomEvent) => void; /** Emitted when the textarea loses focus */ onPlusBlur?: (event: CustomEvent) => void; /** Emitted when the textarea value is invalid */ onPlusInvalid?: (event: CustomEvent) => void; } /** * A form-associated textarea component with validation and styling. * --- * * * ### **Events:** * - **plus-input** - Emitted when the textarea value changes * - **plus-change** - Emitted when the textarea value changes and loses focus * - **plus-focus** - Emitted when the textarea gains focus * - **plus-blur** - Emitted when the textarea loses focus * - **plus-invalid** - Emitted when the textarea value is invalid * * ### **Methods:** * - **checkValidity(): _boolean_** - Checks the validity of the textarea against constraints. * - **reportValidity(): _boolean_** - Reports the validity state to the user. * - **setCustomValidity(message: _string_): _void_** - Sets a custom validation message. * * ### **CSS Properties:** * - **--focus-ring-color** - Color of the focus ring _(default: --primary-500)_ * - **--error-color** - Color used for error states _(default: --red-500)_ * * ### **CSS Parts:** * - **textarea** - The native textarea element * - **label** - The label element * - **caption** - The caption/error message container */ export const PlusTextarea: React.ForwardRefExoticComponent;