import { p as proxyCustomElement, H, c as createEvent, h } from './index.js';
import { d as defineCustomElement$2 } from './p-Bm-eGlq5.js';

const dropdownItemCss = ":root{--ifx-font-family:\"Source Sans 3\", 'Arial, sans-serif'}.dropdown-item{text-decoration:none;color:#1D1D1D;display:flex;align-items:center;padding:8px 16px;gap:8px;font-family:var(--ifx-font-family)}.dropdown-item:focus{outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #0A8276}.dropdown-item.hide{display:none}.dropdown-item span{color:#1D1D1D;font-size:16px;font-style:normal;font-weight:400;line-height:24px;}.dropdown-item.small span{font-size:14px}.dropdown-item:hover{cursor:pointer;background-color:#EEEDED}.dropdown-item:active{background-color:#BFBBBB}.icon{margin-right:4px}";

const DropdownItem = /*@__PURE__*/ proxyCustomElement(class DropdownItem extends H {
    constructor() {
        super();
        this.__registerHost();
        this.__attachShadow();
        this.ifxDropdownItem = createEvent(this, "ifxDropdownItem", 7);
        this.href = "";
        this.target = "_self";
        this.hide = false;
        this.size = 'l';
    }
    handleMenuSize(event) {
        this.size = event.detail;
    }
    handleEventEmission() {
        this.ifxDropdownItem.emit(this.el.textContent);
    }
    render() {
        const hasHref = this.href !== undefined && this.href !== null && this.href !== '';
        const common = {
            class: `dropdown-item ${this.size === 's' ? 'small' : ""} ${this.hide ? 'hide' : ""}`,
            onClick: () => this.handleEventEmission(),
            role: 'menuitem'
        };
        if (!hasHref)
            common.tabIndex = 0;
        return (h("a", Object.assign({ key: '0fa61b25ba8f7f8dec6828def32fca24c753970b' }, common, (hasHref ? { href: this.href, target: this.target } : {})), this.icon && h("ifx-icon", { key: '7676baff54e17a8ac7a3de6a47fb00e773b80718', class: "icon", icon: this.icon }), h("span", { key: 'a2b3213b15b3e0d0b40c12cf7863158f5233c400' }, h("slot", { key: 'b0c64b7c89c088900c65736450ebb366fcccad3c' }))));
    }
    get el() { return this; }
    static get style() { return dropdownItemCss; }
}, [257, "ifx-dropdown-item", {
        "icon": [1],
        "href": [1],
        "target": [1],
        "hide": [4],
        "size": [32]
    }, [[16, "menuSize", "handleMenuSize"]]]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["ifx-dropdown-item", "ifx-icon"];
    components.forEach(tagName => { switch (tagName) {
        case "ifx-dropdown-item":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, DropdownItem);
            }
            break;
        case "ifx-icon":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}

const IfxDropdownItem = DropdownItem;
const defineCustomElement = defineCustomElement$1;

export { IfxDropdownItem, defineCustomElement };
//# sourceMappingURL=ifx-dropdown-item.js.map

//# sourceMappingURL=ifx-dropdown-item.js.map