@hashicorp/design-system-components
Version:
Helios Design System Components
45 lines (42 loc) • 1.75 kB
JavaScript
import Component from '@glimmer/component';
import { assert } from '@ember/debug';
import HdsIcon from '../icon/index.js';
import HdsTextDisplay from '../text/display.js';
import HdsInteractive from '../interactive/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 HdsAppHeaderHomeLink extends Component {
get text() {
const {
text
} = this.args;
assert('@text for "Hds::AppHeader::HomeLink" must have a valid value', text !== undefined);
return text;
}
get icon() {
const {
icon
} = this.args;
assert('@icon name for "Hds::AppHeader::HomeLink" must be provided', icon !== undefined);
return icon;
}
get isIconOnly() {
return this.args.isIconOnly ?? true;
}
static {
setComponentTemplate(precompileTemplate("<HdsInteractive class=\"hds-app-header__home-link\" @current-when={{@current-when}} @models={{@models}} @model={{@model}} @query={{@query}} @replace={{@replace}} @route={{@route}} @isRouteExternal={{@isRouteExternal}} @href={{@href}} @isHrefExternal={{@isHrefExternal}} ...attributes aria-label={{if this.isIconOnly this.text null}}>\n <HdsIcon @name={{@icon}} @color={{@color}} @stretched={{true}} />\n {{#unless this.isIconOnly}}\n <HdsTextDisplay @size=\"100\" @color=\"foreground-high-contrast\">\n {{this.text}}\n </HdsTextDisplay>\n {{/unless}}\n</HdsInteractive>", {
strictMode: true,
scope: () => ({
HdsInteractive,
HdsIcon,
HdsTextDisplay
})
}), this);
}
}
export { HdsAppHeaderHomeLink as default };
//# sourceMappingURL=home-link.js.map