import { r as registerInstance, h, H as Host, g as getElement } from './index-ClISz4NF.js';
import { g as govHost } from './template-CoD1xawt.js';
import { v as validateProp } from './props-CJZgTDla.js';
import { B as ButtonColors, a as ButtonSizes } from './constants-BNBB_29K.js';
import { p as pick } from './utils-CQvUntGY.js';
import { S as Sizes } from './sizes-BcQO4NH2.js';
import { p as prepareIconFormat } from './helpers-GYov8gU1.js';
import './gov.log-BtqD9K8d.js';
import './colors-U40vKHrs.js';

const TagSizes = pick(Sizes, ['_XS', '_S', '_M']);
var TagType;
(function (TagType) {
    TagType["BOLD"] = "bold";
    TagType["SUBTLE"] = "subtle";
})(TagType || (TagType = {}));
const TagClass = {
    root: 'gov-tag',
};

const GovTag = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        /**
         * Tag’s size.
         */
        this.size = TagSizes._S;
        /**
         * Style variation of the tag.
         */
        this.color = ButtonColors.PRIMARY;
        /**
         * Expands the tag to fill 100% of the container width
         */
        this.expanded = false;
        this.h = govHost(this.host);
    }
    validateColor(newValue) {
        validateProp(ButtonColors, newValue, TagClass.root);
    }
    validateSize(newValue) {
        validateProp(ButtonSizes, newValue, TagClass.root);
    }
    componentWillLoad() {
        this.validateColor(this.color);
        this.validateSize(this.size);
    }
    render() {
        const iconStart = prepareIconFormat(this.iconStart);
        const iconEnd = prepareIconFormat(this.iconEnd);
        return (h(Host, { key: 'bb366b85a94d134d58766604e6410e17bed07adc', class: this.h.classes(TagClass.root), color: this.color, size: this.size, type: this.type }, h("span", { key: '963aa53926b6b65bbc155c349a119f46aabe59c8', class: "element" }, h("slot", { key: '3164cfa09970ac3e0f97df7265afd45a623b09aa', name: "icon-start" }, iconStart && h("gov-icon", { key: '335c0e5db0cb5a808c553bd4c9f6893d17a8fac9', type: iconStart.type, name: iconStart.name })), h("slot", { key: '9be29754dcefdaa37daee39befdc6a708e36324d' }), h("slot", { key: '6dffe882089838615e9fe451fc800b728885746a', name: "icon-end" }, iconEnd && h("gov-icon", { key: '415d8c03fefdf6281ae13668fb7b3aeaa572856e', type: iconEnd.type, name: iconEnd.name })))));
    }
    get host() { return getElement(this); }
    static get watchers() { return {
        "color": ["validateColor"],
        "size": ["validateSize"]
    }; }
};

export { GovTag as gov_tag };
//# sourceMappingURL=gov-tag.entry.js.map

//# sourceMappingURL=gov-tag.entry.js.map