UNPKG

@hashicorp/design-system-components

Version:
41 lines (38 loc) 1.82 kB
import Component from '@glimmer/component'; import { hash } from '@ember/helper'; import HdsFormSectionHeader from './header.js'; import HdsFormSectionMultiFieldGroup from './multi-field-group/index.js'; import HdsFormHeaderTitle from '../header/title.js'; import HdsFormHeaderDescription from '../header/description.js'; import HdsFormSectionMultiFieldGroupItem from './multi-field-group/item.js'; import { precompileTemplate } from '@ember/template-compilation'; import { setComponentTemplate } from '@ember/component'; /** * Copyright IBM Corp. 2021, 2025 * SPDX-License-Identifier: MPL-2.0 */ class HdsFormSection extends Component { get classNames() { const classes = ['hds-form__section']; // 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("{{!-- IMPORTANT: we need to add \"squishies\" here (~) because otherwise the whitespace added by Ember causes the empty element to still occupy space - See https://handlebarsjs.com/guide/expressions.html#whitespace-control --}}\n<div class={{this.classNames}} ...attributes>\n {{~yield (hash Header=HdsFormSectionHeader HeaderTitle=(component HdsFormHeaderTitle size=\"300\") HeaderDescription=HdsFormHeaderDescription MultiFieldGroup=HdsFormSectionMultiFieldGroup MultiFieldGroupItem=HdsFormSectionMultiFieldGroupItem)~}}\n</div>", { strictMode: true, scope: () => ({ hash, HdsFormSectionHeader, HdsFormHeaderTitle, HdsFormHeaderDescription, HdsFormSectionMultiFieldGroup, HdsFormSectionMultiFieldGroupItem }) }), this); } } export { HdsFormSection as default }; //# sourceMappingURL=index.js.map