'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-a0b63bee.js');

const DgaContentSwitcher = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.value = 0;
        this.onColor = false;
        this.size = 'md';
        this.items = [
            {
                label: 'Item 1',
                content: 'Content 1',
            },
            {
                label: 'Item 2',
                content: 'Content 2',
            },
            {
                label: 'Item 3',
                content: 'Content 3',
            },
        ];
        this.onChange = () => { };
        this.selected = this.value;
        this.handleSelect = (index) => {
            this.selected = index;
            this.onChange(index);
        };
    }
    render() {
        return (index.h("div", { key: '7007dbc0f059caf862c107e224c54b34fc308985', class: "content-switcher" }, index.h("div", { key: 'dbdf8d3c0ff2b11f7e4ef95c987dcb52ed5b9354', class: "content-switcher__items" }, this.items.map((item, index$1) => {
            const selected = index$1 === this.selected;
            const itemType = index$1 === 0 ? 'first' : index$1 === this.items.length - 1 ? 'last' : 'mid';
            const className = `content-switcher__item content-switcher__item--${itemType} ${this.onColor ? 'content-switcher__item--on-color' : ''} content-switcher__item--${this.size} ${selected ? 'content-switcher__item--selected' : ''}`;
            return (index.h("button", { key: index$1, type: "button", class: className, onClick: () => this.handleSelect(index$1) }, item.label));
        }))));
    }
};

const DgaContentSwitcherItem = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
    }
    render() {
        return index.h("slot", { key: '32eb727a5434d976cd072dfc245c95c6016ab079' });
    }
};

const DgaContentSwitcherPanel = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
    }
    render() {
        return (index.h("div", { key: '3cf45aa1f88ba9e667d2da5aca5f18a567684cc7', class: "content-switcher-panel", hidden: this.value !== this.index }, index.h("slot", { key: '9409f951351fa84dd13e714080f6d40ee454f508' })));
    }
};

exports.dga_content_switcher = DgaContentSwitcher;
exports.dga_content_switcher_item = DgaContentSwitcherItem;
exports.dga_content_switcher_panel = DgaContentSwitcherPanel;

//# sourceMappingURL=dga-content-switcher_3.cjs.entry.js.map