UNPKG

@hashicorp/design-system-components

Version:
48 lines (45 loc) 1.34 kB
import Component from '@glimmer/component'; import didInsert from '@ember/render-modifiers/modifiers/did-insert'; import { precompileTemplate } from '@ember/template-compilation'; import { setComponentTemplate } from '@ember/component'; /** * Copyright IBM Corp. 2021, 2025 * SPDX-License-Identifier: MPL-2.0 */ const NOOP = () => {}; class HdsBreadcrumb extends Component { get didInsert() { const { didInsert } = this.args; if (typeof didInsert === 'function') { return didInsert; } else { return NOOP; } } get itemsCanWrap() { return this.args.itemsCanWrap ?? true; } get ariaLabel() { return this.args.ariaLabel ?? 'breadcrumbs'; } get classNames() { const classes = ['hds-breadcrumb']; // add a class based on the @itemsCanWrap argument if (this.itemsCanWrap) { classes.push('hds-breadcrumb--items-can-wrap'); } return classes.join(' '); } static { setComponentTemplate(precompileTemplate("<nav class={{this.classNames}} aria-label={{this.ariaLabel}} ...attributes>\n <ol class=\"hds-breadcrumb__list\" {{didInsert this.didInsert}}>\n {{yield}}\n </ol>\n</nav>", { strictMode: true, scope: () => ({ didInsert }) }), this); } } export { HdsBreadcrumb as default }; //# sourceMappingURL=index.js.map