{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "checkbox",
  "type": "registry:ui",
  "title": "Checkbox",
  "description": "Checkbox is a native checkbox for independent or multi-select choices, including indeterminate group states.",
  "author": "Skrewww",
  "dependencies": [],
  "registryDependencies": [
    "@skrewww/foundation"
  ],
  "docs": "Host requirements (assumed already present, not installed by this command): react, react-dom.",
  "files": [
    {
      "path": "components/ui/Checkbox.tsx",
      "content": "/** @skrewww-component checkbox */\n\"use client\";\n\nimport {\n  forwardRef,\n  useEffect,\n  useImperativeHandle,\n  useRef,\n  type InputHTMLAttributes,\n} from \"react\";\nimport { cn } from \"@/lib/cn\";\nimport styles from \"@/components/ui/checkbox.module.css\";\n\nexport type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, \"type\"> & {\n  label: string;\n  indeterminate?: boolean;\n};\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n  { label, indeterminate = false, disabled, className, id, ...props },\n  forwardedRef,\n) {\n  const inputRef = useRef<HTMLInputElement>(null);\n\n  useImperativeHandle(forwardedRef, () => inputRef.current as HTMLInputElement);\n\n  useEffect(() => {\n    if (inputRef.current) {\n      inputRef.current.indeterminate = indeterminate;\n    }\n  }, [indeterminate]);\n\n  return (\n    <label\n      className={cn(styles.control, disabled && styles.controlDisabled, className)}\n    >\n      <input\n        ref={inputRef}\n        id={id}\n        type=\"checkbox\"\n        className={styles.input}\n        disabled={disabled}\n        {...props}\n      />\n      <span className={styles.labelText}>{label}</span>\n    </label>\n  );\n});\n",
      "type": "registry:ui",
      "target": "~/components/ui/Checkbox.tsx"
    },
    {
      "path": "components/ui/checkbox.module.css",
      "content": ".control {\n  display: inline-flex;\n  align-items: flex-start;\n  gap: 0.625rem;\n  cursor: pointer;\n  color: var(--semantic-text-primary);\n}\n\n.controlDisabled {\n  cursor: not-allowed;\n}\n\n.input {\n  /* Explicit, not assumed: the docs shell gets border-box from Tailwind's\n     Preflight, but Checkbox must not depend on that ambient reset — under\n     content-box the 1.5px boundary below would push the control to 19x19\n     instead of the canonical 16x16. Same reasoning as Button. */\n  box-sizing: border-box;\n  position: relative;\n  display: inline-grid;\n  place-content: center;\n  flex-shrink: 0;\n  width: var(--control-checkbox-size);\n  height: var(--control-checkbox-size);\n  margin: 0;\n  margin-top: 0.125rem;\n  appearance: none;\n  border: 1.5px solid var(--semantic-border-default);\n  /* Preserve checkbox affordance in Pill/Squircle global modes */\n  border-radius: min(var(--shape-radius-control), var(--control-checkbox-radius-max));\n  /* Same clamp as border-radius above, so the squircle curve never exceeds\n     the checkbox's own affordance limit at this small a size — baked into\n     the dedicated --squircle-clip-path-checkbox token itself. */\n  clip-path: var(--squircle-clip-path-checkbox, none);\n  backdrop-filter: var(--glass-backdrop-filter-sm, none);\n  background: var(--surface-fill-control);\n  transition:\n    border-color 0.15s ease,\n    background-color 0.15s ease,\n    box-shadow 0.15s ease;\n}\n\n/* Scoped away from :checked/:indeterminate on purpose. This rule's\n   specificity (0,3,0) otherwise beats the .input:checked rule below (0,2,0),\n   so hovering a selected control painted a grey border-strong ring around\n   the action-primary fill — a boundary Figma does not have on those states\n   at all. */\n.input:hover:not(:disabled):not(:checked):not(:indeterminate) {\n  border-color: var(--semantic-border-strong);\n}\n\n.input:focus {\n  outline: none;\n}\n\n.input:focus-visible {\n  outline: 2px solid var(--semantic-focus-ring);\n  outline-offset: 2px;\n}\n\n/* Same clip-path-clips-outline reasoning as Button — see button.module.css. */\n[data-skrewww-shape=\"squircle\"] .input:focus-visible {\n  outline-offset: 0;\n}\n\n.input:checked,\n.input:indeterminate {\n  border-color: var(--semantic-action-primary);\n  background: var(--semantic-action-primary);\n}\n\n.input:checked::after {\n  content: \"\";\n  position: absolute;\n  left: 50%;\n  top: 45%;\n  width: 0.3rem;\n  height: 0.55rem;\n  border: 2px solid var(--semantic-text-inverse);\n  border-top: 0;\n  border-left: 0;\n  transform: translate(-50%, -50%) rotate(45deg);\n}\n\n.input:indeterminate::after {\n  content: \"\";\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  width: 0.55rem;\n  height: 2px;\n  background: var(--semantic-text-inverse);\n  transform: translate(-50%, -50%);\n  border: 0;\n}\n\n.input:disabled {\n  cursor: not-allowed;\n  pointer-events: none;\n  border-color: var(--semantic-border-disabled);\n  background: var(--semantic-surface-disabled);\n  opacity: var(--opacity-disabled);\n}\n\n.input[aria-invalid=\"true\"] {\n  border-color: var(--semantic-action-danger);\n}\n\n.input[aria-invalid=\"true\"]:checked,\n.input[aria-invalid=\"true\"]:indeterminate {\n  background: var(--semantic-action-danger);\n  border-color: var(--semantic-action-danger);\n}\n\n.labelText {\n  font-size: 0.875rem;\n  line-height: 1.4;\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .input {\n    transition: none;\n  }\n}\n",
      "type": "registry:ui",
      "target": "~/components/ui/checkbox.module.css"
    },
    {
      "path": "lib/cn.ts",
      "content": "export function cn(...classes: Array<string | false | null | undefined>): string {\n  return classes.filter(Boolean).join(\" \");\n}\n",
      "type": "registry:lib",
      "target": "~/lib/cn.ts"
    }
  ]
}
