{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "checkbox",
  "type": "registry:ui",
  "title": "Checkbox",
  "description": "Single checkbox control with checked and indeterminate states.",
  "dependencies": [
    "@base-ui/react@^1.9.0"
  ],
  "registryDependencies": [
    "https://control-ui.dev/r/core.json"
  ],
  "files": [
    {
      "path": "src/registry/knob-contracts/choice-knobs.ts",
      "target": "@components/control-ui/knob-contracts/choice-knobs.ts",
      "type": "registry:component",
      "content": "// Generated from src/registry/sources/control-ui/recipes/choice.css by scripts/gen-knob-contracts.ts — run `bun run sync:knobs`.\nexport const choiceKnobs = [\n  \"--cui-choice-size\",\n  \"--cui-choice-indicator-size\",\n  \"--cui-choice-radius\",\n  \"--cui-choice-border-color\",\n  \"--cui-choice-border-width\",\n  \"--cui-choice-background\",\n  \"--cui-choice-checked-background\",\n  \"--cui-choice-checked-border-color\",\n  \"--cui-choice-shadow\",\n] as const;\nexport type ChoiceKnobStyle = Partial<Record<(typeof choiceKnobs)[number], string>>;\n"
    },
    {
      "path": "src/registry/sources/control-ui/recipes/choice.css",
      "target": "@components/control-ui/styles/recipes/choice.css",
      "type": "registry:file",
      "content": "@layer components {\n  :where([data-control-family=\"choice\"][data-choice-kind=\"checkbox\"][data-slot=\"root\"]),\n  :where([data-control-family=\"choice\"][data-choice-kind=\"radio-group\"][data-slot=\"item\"]) {\n    --cui-choice-size: calc(var(--spacing) * 4);\n    --cui-choice-indicator-size: calc(var(--cui-choice-size) * 0.75);\n    inline-size: var(--cui-choice-size);\n    block-size: var(--cui-choice-size);\n    --cui-choice-radius: var(--radius-sm);\n    --cui-choice-shadow: var(--shadow-sm);\n    --cui-choice-border-color: var(--control-boundary);\n    --cui-choice-border-width: var(--control-rim-width);\n    --cui-choice-checked-background: var(--primary);\n    --cui-choice-checked-border-color: var(--primary);\n    --cui-choice-background: var(--control-fill);\n    --_choice-background: var(--cui-choice-background);\n    --_choice-border-color: var(--cui-choice-border-color);\n    --_choice-ring: 0 0 transparent;\n    border-radius: var(--cui-choice-radius);\n    background: var(--_choice-background);\n    box-shadow:\n      inset 0 0 0 var(--cui-choice-border-width) var(--_choice-border-color),\n      var(--cui-choice-shadow),\n      var(--_choice-ring);\n    color: currentColor;\n    cursor: pointer;\n    transition-property: background-color, color;\n    transition-duration: var(--duration-fast);\n    transition-timing-function: var(--ease-standard);\n  }\n\n  :where([data-control-family=\"choice\"][data-choice-kind=\"radio-group\"][data-slot=\"item\"]) {\n    --cui-choice-radius: 9999px;\n    --cui-choice-indicator-size: calc(var(--cui-choice-size) * 0.375);\n  }\n\n  @media (hover: hover) {\n    :where(\n        [data-control-family=\"choice\"]:is(\n          [data-choice-kind=\"checkbox\"][data-slot=\"root\"],\n          [data-choice-kind=\"radio-group\"][data-slot=\"item\"]\n        ):hover:not([data-disabled], [data-readonly])\n      ) {\n      --_choice-border-color: color-mix(in oklch, var(--cui-choice-border-color), var(--foreground) 35%);\n    }\n  }\n\n  :where([data-control-family=\"choice\"][data-choice-kind=\"checkbox\"][data-slot=\"root\"]:is([data-checked], [data-indeterminate])),\n  :where([data-control-family=\"choice\"][data-choice-kind=\"radio-group\"][data-slot=\"item\"]:is([data-checked], [data-indeterminate])) {\n    --_choice-background: var(--cui-choice-checked-background);\n    --_choice-border-color: var(--cui-choice-checked-border-color);\n    color: var(--primary-foreground);\n  }\n\n  :where([data-control-family=\"choice\"][data-choice-kind=\"checkbox\"][data-slot=\"root\"][data-disabled]),\n  :where([data-control-family=\"choice\"][data-choice-kind=\"radio-group\"][data-slot=\"item\"][data-disabled]) {\n    opacity: var(--disabled-opacity);\n    cursor: not-allowed;\n  }\n\n  :where([data-control-family=\"choice\"][data-choice-kind=\"checkbox\"][data-slot=\"root\"]:is([data-invalid], [aria-invalid=\"true\"])),\n  :where([data-control-family=\"choice\"][data-choice-kind=\"radio-group\"][data-slot=\"item\"]:is([data-invalid], [aria-invalid=\"true\"])) {\n    --_choice-border-color: var(--destructive);\n    --_choice-ring: 0 0 0 1px var(--destructive);\n  }\n\n  :where([data-control-family=\"choice\"][data-choice-kind=\"checkbox\"][data-slot=\"root\"] [data-slot=\"indicator\"]),\n  :where([data-control-family=\"choice\"][data-choice-kind=\"radio-group\"][data-slot=\"item\"] [data-slot=\"indicator\"]) {\n    color: currentColor;\n  }\n\n  :where([data-control-family=\"choice\"][data-choice-kind=\"radio-group\"] [data-slot=\"indicator\"]) {\n    border-radius: 9999px;\n    background: var(--primary-foreground);\n  }\n\n  :where([data-control-family=\"checkbox-group\"][data-slot=\"root\"]),\n  :where([data-control-family=\"choice\"][data-choice-kind=\"radio-group\"][data-slot=\"root\"]) {\n    gap: calc(var(--spacing) * 2);\n  }\n\n  :where([data-control-family=\"checkbox-group\"][data-slot=\"root\"][data-orientation=\"horizontal\"]),\n  :where([data-control-family=\"choice\"][data-choice-kind=\"radio-group\"][data-slot=\"root\"][data-orientation=\"horizontal\"]) {\n    gap: calc(var(--spacing) * 4);\n  }\n\n  :where([data-control-family=\"checkbox-group\"][data-slot=\"root\"][data-track=\"hover\"]),\n  :where([data-control-family=\"choice\"][data-choice-kind=\"radio-group\"][data-slot=\"root\"][data-track=\"hover\"]) {\n    gap: 0;\n  }\n\n  :where([data-control-family=\"checkbox-group\"][data-slot=\"item\"]),\n  :where([data-control-family=\"choice\"][data-choice-kind=\"radio-group\"][data-slot=\"label\"]) {\n    gap: calc(var(--spacing) * 2.5);\n    padding: calc(var(--spacing) * 2);\n    border-radius: var(--radius-control);\n    font-size: var(--text-body);\n    line-height: var(--text-body--line-height);\n    cursor: pointer;\n  }\n\n  :where([data-control-family=\"checkbox-group\"][data-slot=\"item\"]:has([data-disabled])),\n  :where([data-control-family=\"choice\"][data-choice-kind=\"radio-group\"][data-slot=\"label\"]:has([data-disabled])) {\n    cursor: not-allowed;\n  }\n\n  :where([data-control-family=\"choice\"][data-slot=\"indicator\"]:is([data-choice-kind=\"radio-group\"], [data-choice-kind=\"checkbox\"])) {\n    inline-size: var(--cui-choice-indicator-size);\n    block-size: var(--cui-choice-indicator-size);\n  }\n\n  @media (pointer: coarse) {\n    :where([data-control-family=\"choice\"][data-choice-kind=\"checkbox\"][data-slot=\"root\"])::after,\n    :where([data-control-family=\"choice\"][data-choice-kind=\"radio-group\"][data-slot=\"item\"])::after {\n      content: \"\";\n      position: absolute;\n      inset: 50% auto auto 50%;\n      translate: -50% -50%;\n      inline-size: max(100%, var(--touch-target));\n      block-size: max(100%, var(--touch-target));\n    }\n  }\n\n  @media (forced-colors: active) {\n    :where([data-control-family=\"choice\"][data-choice-kind=\"checkbox\"][data-slot=\"root\"]:not(:focus-visible)),\n    :where([data-control-family=\"choice\"][data-choice-kind=\"radio-group\"][data-slot=\"item\"]:not(:focus-visible)) {\n      outline: 1px solid CanvasText;\n      outline-offset: -1px;\n    }\n\n    :where([data-control-family=\"choice\"][data-choice-kind=\"checkbox\"][data-slot=\"root\"]:is([data-checked], [data-indeterminate])),\n    :where([data-control-family=\"choice\"][data-choice-kind=\"radio-group\"][data-slot=\"item\"][data-checked]) {\n      background: Highlight;\n      color: HighlightText;\n    }\n\n    :where([data-control-family=\"choice\"][data-choice-kind=\"radio-group\"][data-slot=\"indicator\"]) {\n      background: HighlightText;\n    }\n  }\n}\n\n@property --cui-choice-size {\n  syntax: \"<length-percentage>\";\n  inherits: true;\n  initial-value: 0px;\n}\n\n@property --cui-choice-indicator-size {\n  syntax: \"<length-percentage>\";\n  inherits: true;\n  initial-value: 0px;\n}\n\n@property --cui-choice-radius {\n  syntax: \"<length-percentage>\";\n  inherits: true;\n  initial-value: 0px;\n}\n\n@property --cui-choice-border-color {\n  syntax: \"<color>\";\n  inherits: true;\n  initial-value: transparent;\n}\n\n@property --cui-choice-border-width {\n  syntax: \"<length>\";\n  inherits: true;\n  initial-value: 0px;\n}\n\n@property --cui-choice-background {\n  syntax: \"<color>\";\n  inherits: true;\n  initial-value: transparent;\n}\n\n@property --cui-choice-checked-background {\n  syntax: \"<color>\";\n  inherits: true;\n  initial-value: transparent;\n}\n\n@property --cui-choice-checked-border-color {\n  syntax: \"<color>\";\n  inherits: true;\n  initial-value: transparent;\n}\n\n@property --cui-choice-shadow {\n  syntax: \"*\";\n  inherits: true;\n}\n"
    },
    {
      "path": "src/registry/sources/control-ui/ui/checkbox.tsx",
      "target": "@components/control-ui/ui/checkbox.tsx",
      "type": "registry:ui",
      "content": "\"use client\";\n\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\";\nimport type { ComponentProps, CSSProperties } from \"react\";\nimport type { ChoiceKnobStyle } from \"@/components/control-ui/knob-contracts/choice-knobs\";\nimport { cn } from \"@/components/control-ui/lib/cn\";\n\nexport type CheckboxProps = Omit<ComponentProps<typeof CheckboxPrimitive.Root>, \"className\" | \"style\" | \"children\"> & {\n  className?: string;\n  style?: CSSProperties & ChoiceKnobStyle;\n};\n\n// tick and dash swap on Root's data-indeterminate in pure CSS.\nexport function Checkbox({ className, ...props }: CheckboxProps) {\n  return (\n    <CheckboxPrimitive.Root\n      data-control-ui=\"checkbox\"\n      data-choice-kind=\"checkbox\"\n      data-control-family=\"choice\"\n      data-slot=\"root\"\n      className={cn(\"group/checkbox relative inline-flex shrink-0 items-center justify-center\", className)}\n      {...props}\n    >\n      <CheckboxPrimitive.Indicator\n        data-control-ui=\"checkbox\"\n        data-control-family=\"choice\"\n        data-choice-kind=\"checkbox\"\n        data-slot=\"indicator\"\n        className=\"flex items-center justify-center data-[unchecked]:hidden\"\n      >\n        {/* tick (default) and dash (indeterminate) both mount; Root's data-indeterminate toggles which shows */}\n        <svg viewBox=\"0 0 12 12\" className=\"size-full group-data-[indeterminate]/checkbox:hidden\" aria-hidden=\"true\" fill=\"none\">\n          <path d=\"M2.5 6.5 5 9l4.5-5\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n        </svg>\n        <svg viewBox=\"0 0 12 12\" className=\"hidden size-full group-data-[indeterminate]/checkbox:block\" aria-hidden=\"true\" fill=\"none\">\n          <path d=\"M2.75 6h6.5\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" />\n        </svg>\n      </CheckboxPrimitive.Indicator>\n    </CheckboxPrimitive.Root>\n  );\n}\n"
    }
  ],
  "css": {
    "@import \"../components/control-ui/styles/recipes/choice.css\"": {}
  }
}
