{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "checkbox-2",
  "type": "registry:component",
  "title": "Checkbox 2",
  "description": "Checkbox 2. A checkbox component for selecting options.",
  "dependencies": [
    "@base-ui/react",
    "lucide-react"
  ],
  "registryDependencies": [
    "label"
  ],
  "files": [
    {
      "path": "components/watermelon/checkbox-2.tsx",
      "type": "registry:component",
      "content": "'use client'\n\nimport { useId, useState } from 'react'\n\nimport { CheckIcon, MinusIcon } from 'lucide-react'\n\nimport { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox'\n\nimport { Label } from '@/components/base-ui/label'\nimport { cn } from '@/lib/utils'\n\ntype CheckboxRootProps = CheckboxPrimitive.Root.Props\ntype CheckboxCopy = {\n  description: string\n  label: string\n}\n\ntype IndeterminateCheckboxProps = CheckboxRootProps & {\n  checked: boolean\n  indeterminate?: boolean\n}\n\nconst checkboxCopy: CheckboxCopy = {\n  label: 'Enable beta features',\n  description: 'This state is useful when only part of a selection is complete.'\n}\n\nconst Checkbox = ({\n  className,\n  checked,\n  indeterminate = false,\n  ...props\n}: IndeterminateCheckboxProps) => {\n  return (\n    <CheckboxPrimitive.Root\n      data-slot='checkbox'\n      className={cn(\n        'peer relative flex size-4 shrink-0 items-center justify-center rounded-[5px] border border-input bg-background text-muted-foreground outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30 dark:text-muted-foreground data-checked:border-sky-600 data-checked:bg-background data-checked:text-sky-600 data-indeterminate:border-input data-indeterminate:bg-background data-indeterminate:text-muted-foreground dark:data-checked:border-sky-500 dark:data-checked:bg-background dark:data-checked:text-sky-400 dark:data-indeterminate:border-input dark:data-indeterminate:bg-input/30 dark:data-indeterminate:text-muted-foreground aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40',\n        className\n      )}\n      checked={checked}\n      indeterminate={indeterminate}\n      {...props}\n    >\n      <CheckboxPrimitive.Indicator\n        data-slot='checkbox-indicator'\n        className='grid place-content-center text-current transition-none'\n      >\n        {indeterminate ? (\n          <MinusIcon className='size-2.5' />\n        ) : (\n          checked && <CheckIcon className='size-3.5' />\n        )}\n      </CheckboxPrimitive.Indicator>\n    </CheckboxPrimitive.Root>\n  )\n}\n\nconst Checkbox2 = () => {\n  const id = useId()\n  const [isChecked, setIsChecked] = useState<boolean>(false)\n  const [isIndeterminate, setIsIndeterminate] = useState<boolean>(true)\n\n  const handleCheckedChange = (checked: boolean) => {\n    setIsChecked(checked)\n    setIsIndeterminate(false)\n  }\n\n  return (\n    <div className='flex max-w-sm items-start gap-3'>\n      <Checkbox\n        id={id}\n        checked={isChecked}\n        indeterminate={isIndeterminate}\n        onCheckedChange={handleCheckedChange}\n        className='mt-0.5'\n      />\n      <div className='space-y-1'>\n        <Label htmlFor={id} className='text-sm font-medium'>\n          {checkboxCopy.label}\n        </Label>\n        <p className='text-muted-foreground text-xs'>\n          {checkboxCopy.description}\n        </p>\n      </div>\n    </div>\n  )\n}\n\nexport default Checkbox2\n"
    }
  ]
}
