UNPKG

@hashicorp/design-system-components

Version:
43 lines (40 loc) 1.51 kB
import Component from '@glimmer/component'; import { assert } from '@ember/debug'; import HdsTextBody from '../../text/body.js'; import HdsCopySnippet from '../../copy/snippet/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 HdsDropdownListItemCopyItem extends Component { get text() { const { text } = this.args; assert('@text for "Hds::Dropdown::ListItem::CopyItem" must have a valid value', text !== undefined); return text; } get isTruncated() { const { isTruncated = true } = this.args; return isTruncated; } get classNames() { const classes = ['hds-dropdown-list-item', 'hds-dropdown-list-item--variant-copy-item']; return classes.join(' '); } static { setComponentTemplate(precompileTemplate("<li class={{this.classNames}} ...attributes>\n {{#if @copyItemTitle}}\n <HdsTextBody class=\"hds-dropdown-list-item__copy-item-title\" @tag=\"div\" @size=\"100\" @weight=\"semibold\" @color=\"faint\">{{@copyItemTitle}}</HdsTextBody>\n {{/if}}\n <HdsCopySnippet @color=\"secondary\" @textToCopy={{this.text}} @isTruncated={{this.isTruncated}} />\n</li>", { strictMode: true, scope: () => ({ HdsTextBody, HdsCopySnippet }) }), this); } } export { HdsDropdownListItemCopyItem as default }; //# sourceMappingURL=copy-item.js.map