UNPKG

@hashicorp/design-system-components

Version:
34 lines (31 loc) 1.2 kB
import Component from '@glimmer/component'; import style from 'ember-style-modifier'; import { setComponentTemplate, Textarea } from '@ember/component'; import { precompileTemplate } from '@ember/template-compilation'; /** * Copyright IBM Corp. 2021, 2025 * SPDX-License-Identifier: MPL-2.0 */ class HdsFormTextareaBase extends Component { get classNames() { const classes = ['hds-form-textarea']; // add typographic classes classes.push('hds-typography-body-200', 'hds-font-weight-regular'); // add a class based on the @isInvalid argument if (this.args.isInvalid) { classes.push(`hds-form-textarea--is-invalid`); } return classes.join(' '); } static { setComponentTemplate(precompileTemplate("{{!-- Notice: this is not the native HTML <textarea> but the Ember component <Textarea> --}}\n<Textarea class={{this.classNames}} {{style width=@width height=@height}} rows=\"4\" id={{@id}} aria-describedby={{@ariaDescribedBy}} ...attributes @value={{@value}} />", { strictMode: true, scope: () => ({ Textarea, style }) }), this); } } export { HdsFormTextareaBase as default }; //# sourceMappingURL=base.js.map