import { classMap } from 'lit/directives/class-map.js'; import { customElement, property, query, state } from 'lit/decorators.js'; import { defaultValue } from '../../internal/default-value'; import { FormControlController } from '../../internal/form'; import { HasSlotController } from '../../internal/slot'; import { html } from 'lit'; import { ifDefined } from 'lit/directives/if-defined.js'; import { live } from 'lit/directives/live.js'; import { watch } from '../../internal/watch'; import ShoelaceElement from '../../internal/shoelace-element'; import styles from './textarea.styles'; import type { CSSResultGroup } from 'lit'; import type { ShoelaceFormControl } from '../../internal/shoelace-element'; /** * @summary Textareas collect data from the user and allow multiple lines of text. * @documentation https://shoelace.style/components/textarea * @status stable * @since 2.0 * * @slot label - The textarea's label. Alternatively, you can use the `label` attribute. * @slot help-text - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute. * * @event sl-blur - Emitted when the control loses focus. * @event sl-change - Emitted when an alteration to the control's value is committed by the user. * @event sl-focus - Emitted when the control gains focus. * @event sl-input - Emitted when the control receives input. * * @csspart form-control - The form control that wraps the label, input, and help text. * @csspart form-control-label - The label's wrapper. * @csspart form-control-input - The input's wrapper. * @csspart form-control-help-text - The help text's wrapper. * @csspart base - The component's base wrapper. * @csspart textarea - The internal ` ${this.helpText} `; } } declare global { interface HTMLElementTagNameMap { 'sl-textarea': SlTextarea; } }