import { n as cn } from "./utils-DXzSsU1e.js";
import { createBlock, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, renderSlot, unref, withCtx } from "vue";
import { reactiveOmit } from "@vueuse/core";
import { SwitchRoot, SwitchThumb, useForwardPropsEmits } from "reka-ui";
import { cva } from "class-variance-authority";
//#endregion
//#region src/components/ui/switch/Switch.vue
var Switch_default = /* @__PURE__ */ defineComponent({
	__name: "Switch",
	props: {
		size: {},
		class: { type: [
			Boolean,
			null,
			String,
			Object,
			Array
		] },
		defaultValue: {},
		modelValue: {},
		disabled: { type: Boolean },
		id: {},
		value: {},
		trueValue: {},
		falseValue: {},
		asChild: { type: Boolean },
		as: {},
		name: {},
		required: { type: Boolean }
	},
	emits: ["update:modelValue"],
	setup(__props, { emit: __emit }) {
		const props = __props;
		const emits = __emit;
		const forwarded = useForwardPropsEmits(reactiveOmit(props, "class", "size"), emits);
		return (_ctx, _cache) => {
			return openBlock(), createBlock(unref(SwitchRoot), mergeProps(unref(forwarded), { class: unref(cn)(unref(switchVariants)({ size: __props.size }), props.class) }), {
				default: withCtx(() => [createVNode(unref(SwitchThumb), { class: normalizeClass(unref(cn)(unref(switchThumbVariants)({ size: __props.size }))) }, {
					default: withCtx(() => [renderSlot(_ctx.$slots, "thumb")]),
					_: 3
				}, 8, ["class"])]),
				_: 3
			}, 16, ["class"]);
		};
	}
});
//#endregion
//#region src/components/ui/switch/index.ts
var switchVariants = cva("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", {
	variants: { size: {
		sm: "h-5 w-9",
		default: "h-6 w-11",
		lg: "h-7 w-14"
	} },
	defaultVariants: { size: "default" }
});
var switchThumbVariants = cva("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=unchecked]:translate-x-0", {
	variants: { size: {
		sm: "h-4 w-4 data-[state=checked]:translate-x-4",
		default: "h-5 w-5 data-[state=checked]:translate-x-5",
		lg: "h-6 w-6 data-[state=checked]:translate-x-7"
	} },
	defaultVariants: { size: "default" }
});
//#endregion
export { switchVariants as n, Switch_default as r, switchThumbVariants as t };

//# sourceMappingURL=switch-E1QdwZg_.js.map