import { o as s } from "./rolldown-runtime.js";
import { i as n, t as c } from "./vendor/react.js";
import { t as m } from "./check.js";
import { t as b } from "./minus.js";
import { t as l } from "./utils.js";
import { n as u, t as p } from "./CheckboxIndicator.js";
var h = /* @__PURE__ */ s(n(), 1), e = c(), x = h.forwardRef(({ className: t, size: r = "sm", ...a }, i) => {
  const d = {
    sm: "size-4 rounded-[4px]",
    md: "size-5 rounded-[5px]",
    lg: "size-6 rounded-[6px]"
  }, o = {
    sm: "size-3",
    md: "size-3.5",
    lg: "size-4"
  };
  return /* @__PURE__ */ (0, e.jsx)(u, {
    ref: i,
    "data-slot": "checkbox",
    "data-size": r,
    className: l("relative flex shrink-0 items-center justify-center border shadow-xs bg-background transition-[border-color,background-color,color,box-shadow] duration-200 ease-out motion-reduce:transition-none", "border-border dark:border-border", "hover:border-primary hover:bg-primary/10 dark:hover:border-primary", "data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground", "data-checked:hover:border-primary-alt data-checked:hover:bg-primary/90", "data-indeterminate:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground", "data-indeterminate:hover:border-primary-alt data-indeterminate:hover:bg-primary/90", "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-bg-secondary focus-visible:shadow-[0_0_0_2px_var(--card),0_0_0_4px_var(--border)]", "dark:focus-visible:ring-bg-tertiary dark:focus-visible:shadow-[0_0_0_2px_var(--card),0_0_0_4px_var(--border)]", 'before:content-[""] before:absolute before:-inset-[4px] before:rounded-[inherit]', "disabled:cursor-not-allowed disabled:opacity-50", d[r], t),
    ...a,
    children: /* @__PURE__ */ (0, e.jsx)(p, {
      "data-slot": "checkbox-indicator",
      className: "flex items-center justify-center text-current transition-transform duration-150 ease-out scale-100 motion-reduce:transition-none",
      children: a.indeterminate ? /* @__PURE__ */ (0, e.jsx)(b, {
        className: o[r],
        strokeWidth: 3
      }) : /* @__PURE__ */ (0, e.jsx)(m, {
        className: o[r],
        strokeWidth: 3
      })
    })
  });
});
x.displayName = "Checkbox";
export {
  x as t
};

//# sourceMappingURL=checkbox2.js.map