import { h, Host } from "@stencil/core";
import { BEM } from "../../utils/bem";
export class Badge {
    constructor() {
        /**
         * Define the size of badge. Small is recommended for tabs.
         */
        this.size = '';
        /**
         * Define the color for the badge.
         */
        this.color = '';
        /**
         * If `true` the badge is added to the top right corner of the card.
         */
        this.position = '';
    }
    render() {
        const block = BEM.block('badge');
        const labelEl = block.element('label');
        const iconEl = block.element('icon');
        const color = this.color !== '';
        const size = this.size !== '';
        const position = this.position !== '';
        const labelHidden = !!this.icon || this.size === 'small';
        return (h(Host, { key: 'b705f8e38629cf8b549982aee4cdb37eaddd59de', class: Object.assign(Object.assign(Object.assign(Object.assign({}, block.class()), block.modifier(`background-${this.color}`).class(color)), block.modifier(`position-${this.position}`).class(position)), block.modifier(`size-${this.size}`).class(size)) }, h("span", { key: '8ce1e8ecef96a6fd74365fd28d825e40f1ca43a8', class: Object.assign(Object.assign(Object.assign({}, labelEl.class()), labelEl.modifier(`color-${this.color}`).class(color)), labelEl.modifier(`hidden`).class(labelHidden)), "data-testid": "bal-badge-label" }, h("slot", { key: '4153dcd8209ef3bfb88792110ca25bc2ff874395' })), this.size !== 'small' ? (h("bal-icon", { class: Object.assign(Object.assign({}, iconEl.class()), iconEl.modifier(`hidden`).class(!labelHidden)), size: this.size === '' ? 'small' : '', name: this.icon, color: this.color === 'grey' ? 'grey' : 'primary' })) : ('')));
    }
    static get is() { return "bal-badge"; }
    static get originalStyleUrls() {
        return {
            "$": ["bal-badge.sass"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bal-badge.css"]
        };
    }
    static get properties() {
        return {
            "icon": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Name of the icon to show. If a icon is present text should be hidden."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "icon"
            },
            "size": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "BalProps.BalBadgeSize",
                    "resolved": "\"\" | \"large\" | \"small\"",
                    "references": {
                        "BalProps": {
                            "location": "global",
                            "id": "global::BalProps"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Define the size of badge. Small is recommended for tabs."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "size",
                "defaultValue": "''"
            },
            "color": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "BalProps.BalBadgeColor",
                    "resolved": "\"\" | \"danger\" | \"green\" | \"grey\" | \"purple\" | \"red\" | \"success\" | \"warning\" | \"yellow\"",
                    "references": {
                        "BalProps": {
                            "location": "global",
                            "id": "global::BalProps"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Define the color for the badge."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "color",
                "defaultValue": "''"
            },
            "position": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "BalProps.BalBadgePosition",
                    "resolved": "\"\" | \"button\" | \"card\" | \"tabs\"",
                    "references": {
                        "BalProps": {
                            "location": "global",
                            "id": "global::BalProps"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true` the badge is added to the top right corner of the card."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "position",
                "defaultValue": "''"
            }
        };
    }
    static get elementRef() { return "el"; }
}
