import { type PropertyValues } from 'lit'; import { UiElement } from '../shared/element.js'; import { type CounterMode } from '../../core/field.js'; /** * Carbon-style text area (`TextArea`): a multi-line field with the same label / helper / warning / * error wiring as ui-text-input, an optional character counter (`max-count`) and vertical resize. * * Follows Carbon `_text-area.scss`: 11px / 16px padding, 40px minimum height, body-01 type, the * status icon in the top-right corner, `resize: vertical` (none while disabled). `rows` sets the * initial height like the native attribute (Carbon default 4). * * `counter-mode="word"` (Carbon `counterMode`) counts words instead of characters — Thai words * whole, by the browser's word segmenter (Carbon's letter runs split Thai apart) — and, like our * characters, a soft limit: going over is an error, nothing is blocked or cut. `auto-grow` (no * Carbon counterpart) sizes the field to its text, from `rows` up to `max-rows` lines (then it * scrolls), without the resize handle. * * Form-associated: submits under `name`, resets with the form, native constraint validation * (`required`, `minlength`, `maxlength`). Errors appear after the user leaves the field or tries * to submit, except "over the limit", which shows at once. * * State on the host for styling: `data-show-error` while the error shows (over the limit included), * `data-show-warn` while the warning shows. * * @cssstate show-error - While its error message shows (also `[data-show-error]`) * @cssstate show-warn - While its warning message shows (also `[data-show-warn]`) * @slot label - Label content with markup; the `label` attribute is the plain-text fallback * @slot helper-text - Helper text with markup (links, bold); overrides `helper-text` * @slot warn-text - Warning text shown while `warn`; overrides `warn-text` * @slot invalid-text - Error text shown while invalid; overrides `invalid-text` * @fires change - Re-dispatched from the native textarea (native change is not composed) * @fires input - Native input event (already composed, so it reaches the host) * @csspart base - The field box around the textarea * @csspart label - The label * @csspart input - The native textarea * @csspart counter - The character (or word) counter * @csspart status-icon - The error / warning icon * @csspart helper-text - The helper line * @csspart warning-text - The warning line * @csspart warn-text - Same line as `warning-text` (named after the `warn-text` attribute / slot) * @csspart error-text - The error line * @csspart invalid-text - Same line as `error-text` (named after the `invalid-text` attribute / slot) * @cssprop --ui-field-border - Border on every side of the box (default none: Carbon's underline only; Kanok: a 1px outline) * @cssprop --ui-field-disabled-border-color - Border colour when disabled (default: the underline transparent) * @cssprop --ui-field-readonly-border-color - Border colour when read-only (default: a hairline underline) * @cssprop --ui-field-radius - Corner radius of the box (default 0; Kanok: 6px) * @cssprop --ui-field-background - Fill of the box (default `--ui-surface-1`; Kanok: transparent) * @cssprop --ui-label-font - Font of the label (default `--ui-font-caption`; Kanok: 14px semibold) * @cssprop --ui-label-color - Colour of the label (default `--ui-ink-muted`; Kanok: `--ui-ink`) * @cssprop --ui-field-readonly-background - The box's fill when read-only (default transparent; Kanok: a faint ink tint, so read-only reads as set and never weaker than disabled) * @cssprop --ui-fluid-background / --ui-fluid-gap - A fluid box's fill and the space under it (default the layer's fill, 0: boxes that touch; Kanok: transparent, 8px) */ export declare class UiTextArea extends UiElement { static hostStates: readonly string[]; static readonly formAssociated = true; static readonly shadowRootOptions: ShadowRootInit; static readonly styles: import("lit").CSSResult[]; /** Visible label text; the `label` slot replaces it when markup is needed. */ label: string; private readonly localize; /** Keep the label for screen readers but don't show it. */ hideLabel: boolean; /** Helper text under the field, shown while there is no error or warning. */ helperText: string; /** Error text shown while `invalid` or while the field fails validation. */ invalidText: string; /** Forces the error state, e.g. after server-side validation. */ invalid: boolean; /** Non-blocking warning; shown when there is no error. */ warn: boolean; /** Text of the warning shown while `warn`. */ warnText: string; value: string; /** Reflected: form-associated elements submit under the `name` attribute. */ name: string; placeholder: string; /** Initial number of text rows (Carbon default 4); the user can still resize. */ rows: number; minlength?: number; maxlength?: number; /** Passed to the textarea (`off`, or an autofill token). */ autocomplete: string; /** Passed to the text box: the virtual keyboard to show (`numeric`, `decimal`, `email`, `tel`, `url`, `search`…). */ inputmode: string; /** Passed to the text box: the label of the virtual keyboard's Enter key (`search`, `send`, `next`, `done`…). */ enterkeyhint: string; /** Soft limit with a visible counter (unlike maxlength, extra text isn't blocked). */ maxCount?: number; /** What `max-count` counts: `character` (default) or `word` (Carbon `counterMode`). */ counterMode: CounterMode; /** Grows with the text from `rows` (no Carbon counterpart); `max-rows` caps it, then it scrolls. */ autoGrow: boolean; /** The most lines `auto-grow` shows before scrolling (default: no cap). */ maxRows?: number; /** Error when over `max-count`; `{max}` is replaced with the limit (default: the translation's, for characters or words). */ tooLongText: string; /** Announced once when what is left of the limit drops to 10% or less. */ nearLimitText: string; /** Disables the control; a disabled `