import {classMap} from "lit/directives/class-map.js"; import {type CSSResultGroup, html, unsafeCSS} from 'lit'; import {defaultValue} from "../../internal/default-value"; import {FormControlController} from "../../internal/form"; import {HasSlotController} from "../../internal/slot"; import {ifDefined} from "lit/directives/if-defined.js"; import {live} from "lit/directives/live.js"; import {property, query, state} from 'lit/decorators.js'; import {watch} from '../../internal/watch'; import ZincElement, {type ZincFormControl} from '../../internal/zinc-element'; import styles from './textarea.scss'; /** * @summary Textareas collect data from the user and allow multiple lines of text. * @documentation https://zinc.style/components/textarea * @status stable * @since 2.0 * * @slot label - The textareas label. Alternatively, you can use the `label` attribute. * @slot label-tooltip - Used to add text that is displayed in a tooltip next to the label. Alternatively, you can use the `label-tooltip` attribute. * @slot context-note - Used to add contextual text that is displayed above the textarea, on the right. Alternatively, you can use the `context-note` attribute. * @slot help-text - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute. * * @event zn-blur - Emitted when the control loses focus. * @event zn-change - Emitted when an alteration to the control's value is committed by the user. * @event zn-focus - Emitted when the control gains focus. * @event zn-input - Emitted when the control receives input. * @event zn-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied. * * @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}
`; } }