@hashicorp/design-system-components
Version:
Helios Design System Components
35 lines (32 loc) • 1.09 kB
JavaScript
import Component from '@glimmer/component';
import { hash } from '@ember/helper';
import HdsFormHeaderTitle from './title.js';
import HdsFormHeaderDescription from './description.js';
import { precompileTemplate } from '@ember/template-compilation';
import { setComponentTemplate } from '@ember/component';
/**
* Copyright IBM Corp. 2021, 2025
* SPDX-License-Identifier: MPL-2.0
*/
class HdsFormHeader extends Component {
get classNames() {
const classes = ['hds-form__header'];
// add a class based on the @isFullWidth argument
if (this.args.isFullWidth) {
classes.push('hds-form-content--is-full-width');
}
return classes.join(' ');
}
static {
setComponentTemplate(precompileTemplate("<div class={{this.classNames}} ...attributes>\n {{yield (hash Title=HdsFormHeaderTitle Description=HdsFormHeaderDescription)}}\n</div>", {
strictMode: true,
scope: () => ({
hash,
HdsFormHeaderTitle,
HdsFormHeaderDescription
})
}), this);
}
}
export { HdsFormHeader as default };
//# sourceMappingURL=index.js.map