import { h, Host } from "@stencil/core";
/**
 * Display a simple progress bar in a style consistent with the design system.
 *
 * ```ts
 * <verdocs-progress-bar label="Uploading..." showPercent={true} percent={54} />
 * ```
 */
export class VerdocsProgressBar {
    constructor() {
        /**
         * Optional label to display above the bar
         */
        this.label = '';
        /**
         * If true, the progress percentage will be displayed above the bar.
         */
        this.showPercent = false;
        /**
         * The current progress value (0-100)
         */
        this.percent = 0;
    }
    render() {
        const widthPercent = Math.ceil((100 * Math.min(this.percent, 100)) / 100);
        console.log('Rendering progress bar', { widthPercent, label: this.label, showPercent: this.showPercent, percent: this.percent });
        return (h(Host, { key: '4fb4646e5feebaf8265fc8042af66d3dcf2426b6' }, h("div", { key: 'd2febb9e8a3b1e89d067324b40aa674287d0fef0', class: "labels" }, this.label && h("div", { key: 'e32eacce952b2ba7bd10819a535b6438c6ba52b4', class: "label" }, this.label), this.showPercent && h("div", { key: '485503902199bcb6752997bef3afcf333c5ce6aa', class: "label" }, this.percent, "%")), h("div", { key: 'ebdfa5c9362f136d7f3690ffeadae2be46a47bc1', class: "bar" }, h("div", { key: 'a72e9c81d14d8e7cc6c37cfcd6a9cb6a27d50a2e', class: "slider", style: { width: `${widthPercent}%` } }))));
    }
    static get is() { return "verdocs-progress-bar"; }
    static get originalStyleUrls() {
        return {
            "$": ["verdocs-progress-bar.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["verdocs-progress-bar.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": "Optional label to display above the bar"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "''"
            },
            "showPercent": {
                "type": "boolean",
                "attribute": "show-percent",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If true, the progress percentage will be displayed above the bar."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "percent": {
                "type": "number",
                "attribute": "percent",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The current progress value (0-100)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "0"
            }
        };
    }
}
//# sourceMappingURL=verdocs-progress-bar.js.map
