import { mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
import "./styles/switch.css";
import { ref } from "vue";
import { defineComponent } from "../../utils";
import { SelectionControl } from "../selection-control";
import { makeSelectionControlProps } from "../selection-control/selection-control";
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() {
      control.value?.inputRef?.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
