{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "checkbox",
  "type": "registry:ui",
  "title": "Checkbox",
  "description": "A checkbox. `checked` can be true, false or \"indeterminate\". Pair it with a <Label htmlFor>.",
  "dependencies": [
    "@radix-ui/react-checkbox@^1.4.1",
    "tailwind-variants@^1.0.0"
  ],
  "registryDependencies": [
    "https://junco.madebytobi.com/r/field.json",
    "https://junco.madebytobi.com/r/icons.json",
    "https://junco.madebytobi.com/r/junco-theme.json",
    "https://junco.madebytobi.com/r/utils.json"
  ],
  "files": [
    {
      "path": "registry/junco/ui/checkbox.tsx",
      "type": "registry:ui",
      "content": "import * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\nimport { cn } from \"@/lib/utils\";\nimport { CheckIcon, MinusIcon } from \"@/lib/junco/icons\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { useFieldControl } from \"@/components/ui/field\";\n\nexport const checkboxVariants = tv({\n  base: [\n    \"peer inline-grid shrink-0 place-items-center rounded-xs border border-border-strong bg-surface text-primary-foreground\",\n    \"transition-colors duration-fast ease-standard\",\n    \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\",\n    \"disabled:cursor-not-allowed disabled:opacity-50\",\n    \"data-[state=checked]:border-primary data-[state=checked]:bg-primary\",\n    \"data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary\",\n    \"aria-invalid:border-destructive\",\n  ],\n  variants: {\n    size: {\n      sm: \"size-3.5 [&_svg]:size-2.5\",\n      md: \"size-4 [&_svg]:size-3\",\n      lg: \"size-5 [&_svg]:size-3.5\",\n    },\n  },\n  defaultVariants: { size: \"md\" },\n});\n\nexport interface CheckboxProps\n  extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,\n    VariantProps<typeof checkboxVariants> {\n  isInvalid?: boolean;\n}\n\n/** A checkbox. `checked` can be true, false or \"indeterminate\". Pair it with a <Label htmlFor>. */\nexport const Checkbox = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(\n  ({ className, size, isInvalid, ...rest }, ref) => {\n    const props = useFieldControl({ ...rest, \"aria-invalid\": isInvalid || rest[\"aria-invalid\"] || undefined });\n    return (\n      <CheckboxPrimitive.Root ref={ref} className={cn(checkboxVariants({ size }), className)} {...props}>\n        <CheckboxPrimitive.Indicator className=\"group grid place-items-center\">\n          <CheckIcon strokeWidth={3} className=\"group-data-[state=indeterminate]:hidden\" />\n          <MinusIcon strokeWidth={3} className=\"hidden group-data-[state=indeterminate]:block\" />\n        </CheckboxPrimitive.Indicator>\n      </CheckboxPrimitive.Root>\n    );\n  },\n);\nCheckbox.displayName = \"Checkbox\";\n"
    }
  ],
  "docs": "Docs and examples: https://junco.madebytobi.com/docs/components/checkbox",
  "meta": {
    "hash": "66f1ce48f8b59ae9",
    "source": "packages/react/src/components/checkbox.tsx",
    "exports": [
      "checkboxVariants",
      "CheckboxProps",
      "Checkbox"
    ],
    "props": {
      "Checkbox": {
        "extends": "React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, VariantProps<typeof checkboxVariants>",
        "props": [
          {
            "name": "isInvalid",
            "optional": true,
            "type": "boolean"
          }
        ]
      }
    },
    "variants": {
      "variants": {
        "size": [
          "sm",
          "md",
          "lg"
        ]
      },
      "defaultVariants": {
        "size": "md"
      }
    },
    "docsUrl": "https://junco.madebytobi.com/docs/components/checkbox"
  }
}
