import { h } from "@stencil/core";
export class Progress {
    percentage = 0;
    status = '';
    strokeWidth = 6;
    showText = true;
    color;
    get barColor() {
        if (this.color)
            return this.color;
        if (this.status === 'success')
            return 'var(--hb-color-success)';
        if (this.status === 'warning')
            return 'var(--hb-color-warning)';
        if (this.status === 'danger')
            return 'var(--hb-color-danger)';
        return 'var(--hb-color-primary)';
    }
    render() {
        const clampedPct = Math.max(0, Math.min(100, this.percentage));
        return (h("div", { key: 'a3d0f5a70471f0114bbf8ddaf62bd18d274357cc', class: "hb-progress" }, h("div", { key: 'ba90d7643388c12d5188ca6b48b4e581f46f104b', class: "hb-progress__bar", style: { height: `${this.strokeWidth}px` } }, h("div", { key: '9dc3948579e45ff3f008f1b5078a247a32df8c91', class: "hb-progress__bar-inner", style: { width: `${clampedPct}%`, backgroundColor: this.barColor } })), this.showText && h("span", { key: '5cb06b3981e7d754e7dab7881341d75045284296', class: "hb-progress__text" }, clampedPct, "%")));
    }
    static get is() { return "hb-progress"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["progress.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["progress.css"]
        };
    }
    static get properties() {
        return {
            "percentage": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "percentage",
                "reflect": false,
                "defaultValue": "0"
            },
            "status": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'success' | 'warning' | 'danger' | ''",
                    "resolved": "\"\" | \"danger\" | \"success\" | \"warning\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "status",
                "reflect": false,
                "defaultValue": "''"
            },
            "strokeWidth": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "stroke-width",
                "reflect": false,
                "defaultValue": "6"
            },
            "showText": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "show-text",
                "reflect": false,
                "defaultValue": "true"
            },
            "color": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "color",
                "reflect": false
            }
        };
    }
}
//# sourceMappingURL=Progress.js.map
