"use client";

// src/components/ui/checkbox.tsx
import * as React2 from "react";
import { cva } from "class-variance-authority";
import { Checkbox as CheckboxPrimitive } from "radix-ui";

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

// src/components/ui/label.tsx
import * as React from "react";
import { Label as LabelPrimitive } from "radix-ui";
import { jsx } from "react/jsx-runtime";
var Label = React.forwardRef(function Label2({ className, ...props }, ref) {
  return /* @__PURE__ */ jsx(
    LabelPrimitive.Root,
    {
      ref,
      "data-slot": "label",
      className: cn(
        "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
        className
      ),
      ...props
    }
  );
});

// src/components/ui/checkbox.tsx
import { jsx as jsx2 } from "react/jsx-runtime";
var checkboxVariants = cva(
  [
    "peer relative box-border flex shrink-0 items-center justify-center self-center rounded-[4px] border border-input",
    "outline-none transition-[color,box-shadow,transform,background-color,border-color] duration-150",
    "motion-reduce:transition-none",
    "group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2",
    "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",
    "disabled:cursor-not-allowed disabled:opacity-50",
    "aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary",
    "dark:bg-input/15 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40"
  ].join(" "),
  {
    variants: {
      variant: {
        default: [
          "data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary",
          "data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground dark:data-[state=indeterminate]:bg-primary dark:data-[state=indeterminate]:text-primary-foreground"
        ].join(" "),
        outline: [
          "bg-background",
          "data-[state=checked]:border-primary data-[state=checked]:bg-background data-[state=checked]:text-primary data-[state=checked]:ring-2 data-[state=checked]:ring-primary/25",
          "data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-background data-[state=indeterminate]:text-primary data-[state=indeterminate]:ring-2 data-[state=indeterminate]:ring-primary/25"
        ].join(" "),
        secondary: [
          "data-[state=checked]:border-secondary data-[state=checked]:bg-secondary data-[state=checked]:text-secondary-foreground",
          "data-[state=indeterminate]:border-secondary data-[state=indeterminate]:bg-secondary data-[state=indeterminate]:text-secondary-foreground"
        ].join(" "),
        success: [
          "data-[state=checked]:border-chart-2 data-[state=checked]:bg-chart-2 data-[state=checked]:text-primary-foreground",
          "data-[state=indeterminate]:border-chart-2 data-[state=indeterminate]:bg-chart-2 data-[state=indeterminate]:text-primary-foreground"
        ].join(" "),
        destructive: [
          "data-[state=checked]:border-destructive data-[state=checked]:bg-destructive data-[state=checked]:text-destructive-foreground",
          "data-[state=indeterminate]:border-destructive data-[state=indeterminate]:bg-destructive data-[state=indeterminate]:text-destructive-foreground"
        ].join(" "),
        warning: [
          "data-[state=checked]:border-amber-500 data-[state=checked]:bg-amber-500 data-[state=checked]:text-amber-950",
          "data-[state=indeterminate]:border-amber-500 data-[state=indeterminate]:bg-amber-500 data-[state=indeterminate]:text-amber-950"
        ].join(" "),
        muted: [
          "data-[state=checked]:border-muted-foreground/50 data-[state=checked]:bg-muted data-[state=checked]:text-foreground",
          "data-[state=indeterminate]:border-muted-foreground/50 data-[state=indeterminate]:bg-muted data-[state=indeterminate]:text-foreground"
        ].join(" ")
      },
      size: {
        sm: "size-3.5 max-h-3.5 max-w-3.5 min-h-3.5 min-w-3.5 rounded-[3px] [&_[data-slot=checkbox-indicator]_i]:text-[10px]",
        default: "size-4 max-h-4 max-w-4 min-h-4 min-w-4 [&_[data-slot=checkbox-indicator]_i]:text-xs",
        lg: "size-5 max-h-5 max-w-5 min-h-5 min-w-5 rounded-[5px] [&_[data-slot=checkbox-indicator]_i]:text-sm"
      },
      motion: {
        none: "",
        pop: [
          "motion-safe:active:scale-95",
          "data-[state=checked]:motion-safe:scale-[1.04] data-[state=indeterminate]:motion-safe:scale-[1.04]"
        ].join(" "),
        glow: [
          "data-[state=checked]:shadow-[0_0_0_3px] data-[state=checked]:shadow-primary/35",
          "data-[state=indeterminate]:shadow-[0_0_0_3px] data-[state=indeterminate]:shadow-primary/35"
        ].join(" "),
        "pop-glow": [
          "motion-safe:active:scale-95",
          "data-[state=checked]:motion-safe:scale-[1.04] data-[state=indeterminate]:motion-safe:scale-[1.04]",
          "data-[state=checked]:shadow-[0_0_0_3px] data-[state=checked]:shadow-primary/35",
          "data-[state=indeterminate]:shadow-[0_0_0_3px] data-[state=indeterminate]:shadow-primary/35"
        ].join(" ")
      }
    },
    defaultVariants: {
      variant: "default",
      size: "default",
      motion: "none"
    }
  }
);
var checkboxIndicatorVariants = cva("grid place-content-center text-current", {
  variants: {
    motion: {
      none: "transition-none",
      pop: "motion-safe:animate-in motion-safe:fade-in-0 motion-safe:zoom-in-95 motion-safe:duration-150",
      glow: "",
      "pop-glow": "motion-safe:animate-in motion-safe:fade-in-0 motion-safe:zoom-in-95 motion-safe:duration-150"
    }
  },
  defaultVariants: {
    motion: "none"
  }
});
var Checkbox = React2.forwardRef(
  function Checkbox2({ className, variant, size, motion, checked, ...props }, ref) {
    const m = motion ?? "none";
    return /* @__PURE__ */ jsx2(
      CheckboxPrimitive.Root,
      {
        ref,
        "data-slot": "checkbox",
        "data-variant": variant ?? "default",
        "data-motion": m,
        checked,
        className: cn(checkboxVariants({ variant, size, motion: m }), className),
        ...props,
        children: /* @__PURE__ */ jsx2(
          CheckboxPrimitive.Indicator,
          {
            "data-slot": "checkbox-indicator",
            className: checkboxIndicatorVariants({ motion: m }),
            children: checked === "indeterminate" ? /* @__PURE__ */ jsx2("i", { className: "fa-solid fa-minus text-current", "aria-hidden": "true" }) : /* @__PURE__ */ jsx2("i", { className: "fa-solid fa-check text-current", "aria-hidden": "true" })
          }
        )
      }
    );
  }
);
function CheckboxLabel({ className, ...props }) {
  return /* @__PURE__ */ jsx2(
    Label,
    {
      "data-slot": "checkbox-label",
      className: cn(
        "inline-flex min-h-11 cursor-pointer select-none items-center gap-2 py-1 -my-1 text-sm font-medium leading-snug",
        "peer-disabled:cursor-not-allowed peer-disabled:opacity-60",
        className
      ),
      ...props
    }
  );
}
export {
  Checkbox,
  CheckboxLabel,
  checkboxVariants
};
//# sourceMappingURL=checkbox.js.map