import { Host, h } from "@stencil/core";
export class SpwTag {
    constructor() {
        /** Type de variante de tag */
        this.variant = 'default';
        /** Type de surface sur laquelle le tag est positionné */
        this.surface = 'light';
        /** Présence ou pas de l'icône */
        this.hasIcon = true;
        /** Attribut target, s'applique uniquement si href est rempli */
        this.target = '_self';
        /** Définit la taille du tag */
        this.size = 'medium';
        /** Permet de spécifier une variante de Font Awesome */
        this.iconVariant = 'fa-solid';
        /** Position de l'icône à l'intérieur du tag */
        this.iconPosition = 'left';
        this.getIcon = variant => {
            const icons = {
                default: 'fa-bell',
                grey: 'fa-ellipsis',
                blue: 'fa-loader',
                green: 'fa-check',
                orange: 'fa-triangle-exclamation',
                red: 'fa-octagon-xmark',
                purple: 'fa-sparkles',
            };
            return icons[variant] || icons['default'];
        };
    }
    get elementClass() {
        return {
            'spw-tag': true,
            'spw-tag--hoverable': !!this.href,
            'spw-tag--icon': this.hasIcon,
            [`spw-tag--${this.variant}`]: true,
            [`spw-tag--size-${this.size}`]: true,
            [`spw-tag--surface-${this.surface}`]: true,
        };
    }
    render() {
        const { href, target } = this;
        const TagType = this.href === undefined ? 'div' : 'a';
        const attrs = TagType === 'div'
            ? {}
            : {
                href,
                target,
            };
        const iconToDisplay = this.icon || this.getIcon(this.variant);
        const iconElement = this.hasIcon ? h("spw-icon", { variant: this.iconVariant, icon: iconToDisplay }) : null;
        return (h(Host, { key: '66fefcbc20cb9c4a48fc12a274db74e7eed9fe9e' }, h(TagType, Object.assign({ key: '0359073291695253e18cb626cfdd97de3b14ca37' }, attrs, { class: this.elementClass }), this.iconPosition === 'left' && iconElement, h("slot", { key: 'ed3d5252033a336f38eb9f9bf5e9a5417b857f18' }), this.iconPosition === 'right' && iconElement)));
    }
    static get is() { return "spw-tag"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["spw-tag.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["spw-tag.css"]
        };
    }
    static get properties() {
        return {
            "variant": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'grey' | 'blue' | 'green' | 'orange' | 'red' | 'purple' | 'default'",
                    "resolved": "\"blue\" | \"default\" | \"green\" | \"grey\" | \"orange\" | \"purple\" | \"red\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Type de variante de tag"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "variant",
                "defaultValue": "'default'"
            },
            "surface": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'dark' | 'light'",
                    "resolved": "\"dark\" | \"light\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Type de surface sur laquelle le tag est positionn\u00E9"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "surface",
                "defaultValue": "'light'"
            },
            "hasIcon": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Pr\u00E9sence ou pas de l'ic\u00F4ne"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "has-icon",
                "defaultValue": "true"
            },
            "icon": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Ic\u00F4ne personnalis\u00E9e (si non d\u00E9finie, utilise l'ic\u00F4ne par d\u00E9faut de la variante)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "icon"
            },
            "href": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Sp\u00E9cifie le lien si n\u00E9cessaire"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "href"
            },
            "target": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Attribut target, s'applique uniquement si href est rempli"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "target",
                "defaultValue": "'_self'"
            },
            "size": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'extra-small' | 'small' | 'medium' | 'large'",
                    "resolved": "\"extra-small\" | \"large\" | \"medium\" | \"small\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "D\u00E9finit la taille du tag"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "size",
                "defaultValue": "'medium'"
            },
            "iconVariant": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'fa-solid' | 'fa-brands' | 'fa-regular' | 'fa-light'",
                    "resolved": "\"fa-brands\" | \"fa-light\" | \"fa-regular\" | \"fa-solid\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Permet de sp\u00E9cifier une variante de Font Awesome"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "icon-variant",
                "defaultValue": "'fa-solid'"
            },
            "iconPosition": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'left' | 'right'",
                    "resolved": "\"left\" | \"right\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Position de l'ic\u00F4ne \u00E0 l'int\u00E9rieur du tag"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "icon-position",
                "defaultValue": "'left'"
            }
        };
    }
}
