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: 'ae8ab140a9ea7a04e71e8310649be6a643fee532', 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: '9e04f9b95cc8a7f9234636493f1fd0c718f7f38f', "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",
                "mutable": true,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "checked",
                "defaultValue": "false"
            },
            "theme": {
                "type": "string",
                "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,
                "attribute": "theme",
                "defaultValue": "'primary'"
            },
            "disabled": {
                "type": "boolean",
                "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,
                "attribute": "disabled",
                "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
