import { h } from "@stencil/core";
/**
 * Displays a toggle switch
 *
 * ```ts
 * <verdocs-switch checked={sendReminders} onCheckedChange={setSendReminders} />
 * ```
 */
export class VerdocsSwitch {
    constructor() {
        this.checked = false;
        /**
         * Select purple or green treatments.
         */
        this.theme = 'primary';
        /**
         * Should the field be disabled?
         */
        this.disabled = false;
    }
    render() {
        return (h("button", { key: '11ab20da1c25f989b652778703eef832911a1d34', value: "on", type: "button", role: "switch", class: `switch ${this.theme} ${this.disabled ? 'disabled' : ''}`, "data-state": this.checked ? 'checked' : 'unchecked', "aria-checked": this.checked ? 'checked' : 'unchecked', onClick: () => {
                var _a;
                if (!this.disabled) {
                    this.checked = !this.checked;
                    (_a = this.checkedChange) === null || _a === void 0 ? void 0 : _a.emit(this.checked);
                }
            } }, h("span", { key: 'e9ecff307d7e9d122fc6772bb5f6d51eb2465e62', "data-state": this.checked ? 'checked' : 'unchecked', class: "slider" })));
    }
    static get is() { return "verdocs-switch"; }
    static get originalStyleUrls() {
        return {
            "$": ["verdocs-switch.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["verdocs-switch.css"]
        };
    }
    static get properties() {
        return {
            "checked": {
                "type": "boolean",
                "attribute": "checked",
                "mutable": true,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "theme": {
                "type": "string",
                "attribute": "theme",
                "mutable": false,
                "complexType": {
                    "original": "'primary' | 'secondary'",
                    "resolved": "\"primary\" | \"secondary\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Select purple or green treatments."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'primary'"
            },
            "disabled": {
                "type": "boolean",
                "attribute": "disabled",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Should the field be disabled?"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            }
        };
    }
    static get events() {
        return [{
                "method": "checkedChange",
                "name": "checkedChange",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                }
            }];
    }
}
//# sourceMappingURL=verdocs-switch.js.map
