import { h } from "@stencil/core";
import { isNestedInIfxComponent } from "../..//shared/utils/dom-utils";
import { detectFramework } from "../..//shared/utils/framework-detection";
import { trackComponent } from "../../shared/utils/tracking";
export class Status {
    el;
    /** Text label displayed inside the status component. */
    label;
    /** If true, shows a border around the status. */
    border = false;
    /** Color token used for the status (e.g. orange-500). */
    color = "orange-500";
    async componentDidLoad() {
        if (!isNestedInIfxComponent(this.el)) {
            const framework = detectFramework();
            trackComponent("ifx-status", await framework);
        }
    }
    render() {
        const effectiveColor = this.color?.trim() ? this.color : "orange-500";
        const containerClass = this.border
            ? `container border-${effectiveColor}`
            : "container no-border";
        return (h("div", { key: '2ce737c048d904356779a6edb818262a24060e6e', role: "status", class: containerClass }, h("span", { key: '4be997242edbcd867dd11eb6311e1308c5be150b', class: `dot ${effectiveColor}` }), h("p", { key: 'd61197a175edbf6f31206ea0448930472015227f', class: "text" }, this.label)));
    }
    static get is() { return "ifx-status"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["status.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["status.css"]
        };
    }
    static get properties() {
        return {
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Text label displayed inside the status component."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "label"
            },
            "border": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If true, shows a border around the status."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "border",
                "defaultValue": "false"
            },
            "color": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Color token used for the status (e.g. orange-500)."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "color",
                "defaultValue": "\"orange-500\""
            }
        };
    }
    static get elementRef() { return "el"; }
}
