import { h } from "@stencil/core";
import { trackComponent } from "../../global/utils/tracking";
import { isNestedInIfxComponent } from "../../global/utils/dom-utils";
import { detectFramework } from "../../global/utils/framework-detection";
export class Status {
    constructor() {
        this.border = false;
        this.color = 'orange-500';
    }
    async componentDidLoad() {
        if (!isNestedInIfxComponent(this.el)) {
            const framework = detectFramework();
            trackComponent('ifx-status', await framework);
        }
    }
    render() {
        var _a;
        const effectiveColor = ((_a = this.color) === null || _a === void 0 ? void 0 : _a.trim()) ? this.color : 'orange-500';
        const containerClass = this.border ? `container border-${effectiveColor}` : 'container no-border';
        return (h("div", { key: 'ecdf2793bf509776eead292175cd6f84a2078006', "aria-label": "a status indicator", "aria-value": this.label, class: containerClass }, h("span", { key: 'a91707311ce3e4e9b9aada3a255209a4b250b927', class: `dot ${effectiveColor}` }), h("p", { key: 'a17e374fe14f8ac50b5a2d045b6029b6fe39f678', 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",
                "attribute": "label",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "border": {
                "type": "boolean",
                "attribute": "border",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "color": {
                "type": "string",
                "attribute": "color",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'orange-500'"
            }
        };
    }
    static get elementRef() { return "el"; }
}
//# sourceMappingURL=status.js.map
