import { r as registerInstance, c as createEvent, h } from './index-PqnYwNKt.js';

const segmentCss = ":root{--ifx-font-family:\"Source Sans 3\", \"Arial, sans-serif\"}.segment{display:flex;align-items:center;justify-content:center;gap:8px;position:relative;border:1px solid #BFBBBB;border-radius:1px;padding:0 8px 0 8px;height:34px;background-color:#FFFFFF;transition:all 100ms ease;transition-property:color, background;font:600 0.875rem/1.25rem \"Source Sans 3\"}.segment:focus-visible{color:#FFFFFF;background-color:#0A8276}.segment:hover{color:#FFFFFF;background-color:#08665C;cursor:pointer}.segment:active{background-color:#06534B}.segment.segment--selected{color:#FFFFFF;background-color:#0A8276}.segment.segment--small{height:30px}.segment::after{position:absolute;top:0;left:0;width:100%;height:100%;outline:1px solid #BFBBBB;border-radius:1px;content:\"\"}";

const Segment = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.segmentSelect = createEvent(this, "segmentSelect", 5);
        this.selected = false;
    }
    handleSegmentClick() {
        if (this.selected)
            return;
        this.selected = true;
        this.segmentSelect.emit(this.segmentIndex);
    }
    handleSegmentKeyDown(event) {
        if (event.code === 'Enter' || event.code === 'Space') {
            if (this.selected)
                return;
            this.selected = true;
            this.segmentSelect.emit(this.segmentIndex);
        }
    }
    render() {
        return (h("div", { key: '7e3de00d0927c957e99a81faf334f096a1f3b4fc', class: `segment ${this.selected ? 'segment--selected' : ''}`, tabIndex: 0, onClick: () => { this.handleSegmentClick(); }, onKeyDown: (e) => { this.handleSegmentKeyDown(e); } }, h("ifx-icon", { key: '6d6d9d9d02bebbe45aa32250fe73ee4deac9876a', icon: this.icon }), " ", h("slot", { key: '2c860e35d492f81d846356e60bdcf04919cc6bc7' })));
    }
};
Segment.style = segmentCss;

export { Segment as ifx_segment };
//# sourceMappingURL=ifx-segment.entry.js.map

//# sourceMappingURL=ifx-segment.entry.js.map