@scania/tegel
Version:
Tegel Design System
42 lines (38 loc) • 2.88 kB
JavaScript
import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
const headerDropdownListItemCss = ":host{display:block;box-sizing:border-box;height:var(--tds-header-list-item-md-height);width:100%}:host .component{height:100%}:host .component ::slotted(a),:host .component ::slotted(button){all:unset;box-sizing:border-box;border:none;display:flex;align-items:center;height:100%;padding:0 24px;width:100%;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);background-color:var(--tds-nav-dropdown-item-background);color:var(--tds-header-nav-item-dropdown-opened-color)}:host .component ::slotted(a:hover){background-color:var(--tds-nav-item-background-hover);cursor:pointer}:host .component ::slotted(a:focus-visible){outline:2px solid var(--tds-focus-outline-color);box-shadow:0 0 0 1px var(--tds-white);outline-offset:1px;z-index:1}:host .component-selected{background-color:var(--tds-nav-item-background-selected);padding-right:4px;border-left-width:4px;border-left-style:solid;border-left-color:var(--tds-nav-item-border-color-active)}:host .component-selected ::slotted(a),:host .component-selected ::slotted(button){background-color:var(--tds-nav-item-background-selected)}:host(:not(:last-child)){border-bottom:1px solid var(--tds-nav-dropdown-item-border-color)}:host([size=lg]){height:var(--tds-header-height)}:host([size=lg]) ::slotted(a),:host([size=lg]) ::slotted(button){padding:0 16px;color:var(--tds-header-app-launcher-item-color)}";
const TdsHeaderDropdownListItemStyle0 = headerDropdownListItemCss;
const TdsHeaderDropdownListItem = /*@__PURE__*/ proxyCustomElement(class TdsHeaderDropdownListItem extends H {
constructor() {
super();
this.__registerHost();
this.__attachShadow();
this.selected = false;
this.size = 'md';
}
render() {
return (h(Host, { key: '1dd37d8c57686fdde3bbf602cd2d327237ff9ee8' }, h("div", { key: 'ecbcceac23e94264aa3bfd253190c358d415492d', class: {
'component': true,
'component-selected': this.selected,
} }, h("slot", { key: '0e02564e017aaea2a0e9336e64fb853ecf4db367' }))));
}
get host() { return this; }
static get style() { return TdsHeaderDropdownListItemStyle0; }
}, [1, "tds-header-dropdown-list-item", {
"selected": [4],
"size": [513]
}]);
function defineCustomElement() {
if (typeof customElements === "undefined") {
return;
}
const components = ["tds-header-dropdown-list-item"];
components.forEach(tagName => { switch (tagName) {
case "tds-header-dropdown-list-item":
if (!customElements.get(tagName)) {
customElements.define(tagName, TdsHeaderDropdownListItem);
}
break;
} });
}
defineCustomElement();
export { TdsHeaderDropdownListItem as T, defineCustomElement as d };