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.dot = false;
        this.label = undefined;
        this.large = false;
        this.sentiment = 'neutral';
        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: 'fac4e9beb31ba05d0c959fb53a9cd62caeacb219', class: this.classNames(), id: this.componentId }, this.setChipContent(), this.variant === 'tag' && (h("button", { key: '5f57c1cc76f6cffdebe6244f499b427e5f4c04e8', class: "pds-chip__close", type: "button", onClick: this.handleCloseClick, "aria-label": "Remove" }, h("pds-icon", { key: 'f4311271f68d700568dc51af9c1512fdfc7c262d', icon: remove, size: "12px" })))));
    }
    static get is() { return "pds-chip"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["../../global/styles/base.scss", "pds-chip.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["../../global/styles/base.css", "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
            },
            "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 displayed in a larger size."
                },
                "attribute": "large",
                "reflect": false,
                "defaultValue": "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": "Defines the color scheme of the chip."
                },
                "attribute": "sentiment",
                "reflect": false,
                "defaultValue": "'neutral'"
            },
            "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 emitted when the close button is clicked on a tag variant chip."
                },
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                }
            }];
    }
}
//# sourceMappingURL=pds-chip.js.map
