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: 'cfccbd59016954d10782723bae6eb451ac8e3e30' }, h("div", { key: 'a0981e9257e56f6c1e207cda99c637bbff85227f', class: "labels" }, this.label && h("div", { key: '5d692917d2a9b0baf1802573e783fdae4efcc35b', class: "label" }, this.label), this.showPercent && h("div", { key: '14a507c2bc3a7474f1d9933fd87b52b8695a52a4', class: "label" }, this.percent, "%")), h("div", { key: '187e0efa73554e681d71bb1d26283e3ab226ca59', class: "bar" }, h("div", { key: '1ec5e3c55c52b0d88cc5da1cec57a24918d8e735', 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
