import type { ReactElement, HTMLAttributes, Ref } from "react"; import type SlTextareaElement from "@shoelace-style/shoelace/dist/components/textarea/textarea.js"; import { SlBlurEvent, SlChangeEvent, SlFocusEvent, SlInputEvent, SlInvalidEvent, } from "../events"; export type { SlTextareaElement }; export type SlTextareaBlurEvent = SlBlurEvent; export type SlTextareaChangeEvent = SlChangeEvent; export type SlTextareaFocusEvent = SlFocusEvent; export type SlTextareaInputEvent = SlInputEvent; export type SlTextareaInvalidEvent = SlInvalidEvent; export interface SlTextareaProps extends HTMLAttributes { ref?: Ref; /** * */ title?: string; /** * The name of the textarea, submitted as a name/value pair with form data. */ name?: string; /** * The current value of the textarea, submitted as a name/value pair with form data. */ value?: string; /** * The textarea's size. */ size?: "small" | "medium" | "large"; /** * Draws a filled textarea. */ filled?: boolean; /** * The textarea's label. If you need to display HTML, use the `label` slot instead. */ label?: string; /** * The textarea's help text. If you need to display HTML, use the `help-text` slot instead. */ helpText?: string; /** * Placeholder text to show as a hint when the input is empty. */ placeholder?: string; /** * The number of rows to display by default. */ rows?: number; /** * Controls how the textarea can be resized. */ resize?: "none" | "vertical" | "auto"; /** * Disables the textarea. */ disabled?: boolean; /** * Makes the textarea readonly. */ readonly?: boolean; /** * By default, form controls are associated with the nearest containing `
` element. This attribute allows you * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in * the same document or shadow root for this to work. */ form?: string; /** * Makes the textarea a required field. */ required?: boolean; /** * The minimum length of input that will be considered valid. */ minlength?: number; /** * The maximum length of input that will be considered valid. */ maxlength?: number; /** * Controls whether and how text input is automatically capitalized as it is entered by the user. */ autocapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters"; /** * Indicates whether the browser's autocorrect feature is on or off. */ autocorrect?: string; /** * Specifies what permission the browser has to provide assistance in filling out form field values. Refer to * [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values. */ autocomplete?: string; /** * Indicates that the input should receive focus on page load. */ autofocus?: boolean; /** * Used to customize the label or icon of the Enter key on virtual keyboards. */ enterkeyhint?: | "enter" | "done" | "go" | "next" | "previous" | "search" | "send"; /** * Enables spell checking on the textarea. */ spellcheck?: boolean; /** * Tells the browser what type of data will be entered by the user, allowing it to display the appropriate virtual * keyboard on supportive devices. */ inputmode?: | "none" | "text" | "decimal" | "numeric" | "tel" | "search" | "email" | "url"; /** * Emitted when the control loses focus. */ onSlBlur?: (event: SlTextareaBlurEvent) => void; /** * Emitted when the control loses focus. */ onSlBlurCapture?: (event: SlTextareaBlurEvent) => void; /** * Emitted when an alteration to the control's value is committed by the user. */ onSlChange?: (event: SlTextareaChangeEvent) => void; /** * Emitted when an alteration to the control's value is committed by the user. */ onSlChangeCapture?: (event: SlTextareaChangeEvent) => void; /** * Emitted when the control gains focus. */ onSlFocus?: (event: SlTextareaFocusEvent) => void; /** * Emitted when the control gains focus. */ onSlFocusCapture?: (event: SlTextareaFocusEvent) => void; /** * Emitted when the control receives input. */ onSlInput?: (event: SlTextareaInputEvent) => void; /** * Emitted when the control receives input. */ onSlInputCapture?: (event: SlTextareaInputEvent) => void; /** * Emitted when the form control has been checked for validity and its constraints aren't satisfied. */ onSlInvalid?: (event: SlTextareaInvalidEvent) => void; /** * Emitted when the form control has been checked for validity and its constraints aren't satisfied. */ onSlInvalidCapture?: (event: SlTextareaInvalidEvent) => void; } /** * Textareas collect data from the user and allow multiple lines of text. */ export default function SlTextarea( props: SlTextareaProps, ): ReactElement;