UNPKG

@hashicorp/design-system-components

Version:
34 lines (31 loc) 1.05 kB
import Component from '@glimmer/component'; import { service } from '@ember/service'; import HdsIcon from '../icon/index.js'; import { precompileTemplate } from '@ember/template-compilation'; import { setComponentTemplate } from '@ember/component'; import { g, i } from 'decorator-transforms/runtime'; /** * Copyright IBM Corp. 2021, 2025 * SPDX-License-Identifier: MPL-2.0 */ class HdsDismissButton extends Component { static { g(this.prototype, "hdsIntl", [service]); } #hdsIntl = (i(this, "hdsIntl"), void 0); get ariaLabel() { return this.args.ariaLabel ?? this.hdsIntl.t('hds.components.dismiss-button.aria-label', { default: 'Dismiss' }); } static { setComponentTemplate(precompileTemplate("<button class=\"hds-dismiss-button\" type=\"button\" aria-label={{this.ariaLabel}} ...attributes>\n <HdsIcon @name=\"x\" @size=\"16\" />\n</button>", { strictMode: true, scope: () => ({ HdsIcon }) }), this); } } export { HdsDismissButton as default }; //# sourceMappingURL=index.js.map