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: 'deb87ba92583c69d4257c9b0ac2e288c5968dcec' }, h("div", { key: '6122cb2a4629aaff872b7aaa78d6c48e72a1c4a6', class: "labels" }, this.label && h("div", { key: '39d984b137bfccf228a397baf25eb94d918ba5a1', class: "label" }, this.label), this.showPercent && h("div", { key: '9e5e8d5b01fac6ad5ee539ed6ed979399e035798', class: "label" }, this.percent, "%")), h("div", { key: '5a2d126da3607ab523a795139741c3490cf0b27b', class: "bar" }, h("div", { key: 'f58d38908e994413826c740efc343e962ec4b50a', 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",
                "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,
                "attribute": "label",
                "defaultValue": "''"
            },
            "showPercent": {
                "type": "boolean",
                "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,
                "attribute": "show-percent",
                "defaultValue": "false"
            },
            "percent": {
                "type": "number",
                "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,
                "attribute": "percent",
                "defaultValue": "0"
            }
        };
    }
}
//# sourceMappingURL=verdocs-progress-bar.js.map
