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: '0fccebe012d4176accce818db93549436353a12b' }, h("div", { key: '866545106432fe477688dbcff60c0416fe7f6eeb', class: "labels" }, this.label && h("div", { key: '8449f4aed2d3071f285dccb88fd05ce1c13e89e2', class: "label" }, this.label), this.showPercent && h("div", { key: '62c472c07786bb1251743554e543b0e64639449d', class: "label" }, this.percent, "%")), h("div", { key: '2eb42e0ebfeab8596a0c08f79b87d8ac132ee243', class: "bar" }, h("div", { key: 'ad6f73e950a0244ebd6b0e91f1846cb490f41767', 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
