@hashicorp/design-system-components
Version:
Helios Design System Components
37 lines (34 loc) • 1.18 kB
JavaScript
import Component from '@glimmer/component';
import { hash } from '@ember/helper';
import style from 'ember-style-modifier';
import HdsYield from '../../yield/index.js';
import { precompileTemplate } from '@ember/template-compilation';
import { setComponentTemplate } from '@ember/component';
/**
* Copyright IBM Corp. 2021, 2025
* SPDX-License-Identifier: MPL-2.0
*/
class HdsFormSelectBase extends Component {
get classNames() {
const classes = ['hds-form-select'];
// 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-select--is-invalid`);
}
return classes.join(' ');
}
static {
setComponentTemplate(precompileTemplate("<select class={{this.classNames}} {{style width=@width}} id={{@id}} aria-describedby={{@ariaDescribedBy}} ...attributes>\n {{yield (hash Options=HdsYield)}}\n</select>", {
strictMode: true,
scope: () => ({
style,
hash,
HdsYield
})
}), this);
}
}
export { HdsFormSelectBase as default };
//# sourceMappingURL=base.js.map