import { downSmall, remove } from "@pine-ds/icons/icons";
import { Host, h } from "@stencil/core";
export class PdsChip {
    constructor() {
        this.handleCloseClick = () => {
            this.pdsTagCloseClick.emit();
        };
        this.componentId = undefined;
        this.sentiment = 'neutral';
        this.dot = false;
        this.label = undefined;
        this.large = false;
        this.variant = 'text';
    }
    classNames() {
        const classNames = ['pds-chip'];
        if (this.large) {
            classNames.push('pds-chip--large');
        }
        if (this.variant) {
            classNames.push('pds-chip--' + this.variant);
        }
        if (this.sentiment) {
            classNames.push('pds-chip--' + this.sentiment);
        }
        return classNames.join('  ');
    }
    setChipContent() {
        const isDropdown = this.variant === 'dropdown';
        const chipContent = isDropdown ? (h("button", { class: "pds-chip__button", type: "button" }, this.dot && h("i", { class: "pds-chip__dot", "aria-hidden": "true" }), this.label, h("pds-icon", { icon: downSmall, size: "12px", "aria-hidden": "true" }))) : (h("span", { class: "pds-chip__label" }, this.dot && h("i", { class: "pds-chip__dot", "aria-hidden": "true" }), this.label));
        return chipContent;
    }
    render() {
        return (h(Host, { key: 'a2ad8c6a371ab1bead7715cdf7bbe684ce0d73a5', class: this.classNames(), id: this.componentId }, this.setChipContent(), this.variant === 'tag' && (h("button", { key: '83d2273a0785c4516a57ed618645d937ba33f9f5', class: "pds-chip__close", type: "button", onClick: this.handleCloseClick, "aria-label": "Remove" }, h("pds-icon", { key: '6ca04621d1acd134ce3352a034ea69ea7f794fbd', icon: remove, size: "12px" })))));
    }
    static get is() { return "pds-chip"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["pds-chip.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["pds-chip.css"]
        };
    }
    static get properties() {
        return {
            "componentId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "A unique identifier used for the underlying component `id` attribute."
                },
                "attribute": "component-id",
                "reflect": false
            },
            "sentiment": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'accent' | 'danger' | 'info' | 'neutral' | 'success' | 'warning'",
                    "resolved": "\"accent\" | \"danger\" | \"info\" | \"neutral\" | \"success\" | \"warning\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "defaultValue",
                            "text": "'neutral'"
                        }],
                    "text": "Sets the color scheme of the chip."
                },
                "attribute": "sentiment",
                "reflect": false,
                "defaultValue": "'neutral'"
            },
            "dot": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "defaultValue",
                            "text": "false"
                        }],
                    "text": "Determines whether a dot should be displayed on the chip."
                },
                "attribute": "dot",
                "reflect": false,
                "defaultValue": "false"
            },
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Sets the text label content of the chip."
                },
                "attribute": "label",
                "reflect": false
            },
            "large": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "defaultValue",
                            "text": "false"
                        }],
                    "text": "Determines whether the chip should be rendered in a larger size."
                },
                "attribute": "large",
                "reflect": false,
                "defaultValue": "false"
            },
            "variant": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'text' | 'tag' | 'dropdown'",
                    "resolved": "\"dropdown\" | \"tag\" | \"text\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "defaultValue",
                            "text": "'text'"
                        }],
                    "text": "Sets the style variant of the chip."
                },
                "attribute": "variant",
                "reflect": false,
                "defaultValue": "'text'"
            }
        };
    }
    static get events() {
        return [{
                "method": "pdsTagCloseClick",
                "name": "pdsTagCloseClick",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Event when close button is clicked on tag variant."
                },
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                }
            }];
    }
}
//# sourceMappingURL=pds-chip.js.map
