import { ref, createVNode, mergeProps } from "vue";
import "./styles/switch.scss";
import { makeSelectionControlProps, SelectionControl } from "../selection-control/selection-control.mjs";
import { defineComponent } from "../../utils/define-component.mjs";
const Switch = defineComponent({
  name: "VeSwitch",
  props: makeSelectionControlProps({
    type: "checkbox",
    color: "primary"
  }),
  emits: {
    "update:modelValue": (_modelValue) => true
  },
  setup(props, {
    emit,
    slots
  }) {
    const control = ref();
    function onClick() {
      var _a, _b;
      (_b = (_a = control.value) == null ? void 0 : _a.inputRef) == null ? void 0 : _b.click();
    }
    return () => {
      return createVNode(SelectionControl, mergeProps({
        "ref": control,
        "class": "ve-switch"
      }, props, {
        "onUpdate:modelValue": (val) => emit("update:modelValue", val)
      }), {
        ...slots,
        default: ({
          textColorClasses,
          textColorStyles
        }) => createVNode("div", {
          "class": ["ve-switch__track", textColorClasses.value],
          "style": [textColorStyles.value],
          "onClick": onClick
        }, null),
        input: () => {
          return createVNode("div", {
            "class": "ve-switch__thumb"
          }, null);
        }
      });
    };
  }
});
export {
  Switch
};
//# sourceMappingURL=switch.mjs.map
