"use client";

// src/lib/utils.ts
import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";
function cn(...inputs) {
  return twMerge(clsx(inputs));
}

// src/components/ui/toggle-switch.tsx
import { jsx } from "react/jsx-runtime";
function ToggleSwitch({ checked, onChange, id }) {
  return /* @__PURE__ */ jsx(
    "button",
    {
      id,
      type: "button",
      role: "switch",
      "aria-checked": checked,
      "aria-label": checked ? "On" : "Off",
      onClick: () => onChange(!checked),
      className: cn(
        "relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-input transition-colors",
        "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
        checked ? "bg-[var(--switch-on)]" : "bg-input"
      ),
      children: /* @__PURE__ */ jsx("span", { className: cn(
        "pointer-events-none inline-block size-4 rounded-full bg-primary-foreground shadow-sm transition-transform",
        checked ? "translate-x-4" : "translate-x-0"
      ) })
    }
  );
}
export {
  ToggleSwitch
};
//# sourceMappingURL=toggle-switch.js.map