{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "checkbox",
  "dependencies": [
    "lucide-react",
    "react-aria-components",
    "tailwind-variants"
  ],
  "registryDependencies": [
    "https://taki-ui.com/r/field.json",
    "https://taki-ui.com/r/utils.json"
  ],
  "files": [
    {
      "path": "registry/new-york/ui/checkbox.tsx",
      "content": "\"use client\"\n\nimport React, { ReactNode } from \"react\"\nimport { Check, Minus } from \"lucide-react\"\nimport {\n  CheckboxProps,\n  composeRenderProps,\n  Checkbox as RACCheckbox,\n  CheckboxGroup as RACCheckboxGroup,\n  CheckboxGroupProps as RACCheckboxGroupProps,\n  ValidationResult,\n} from \"react-aria-components\"\nimport { tv } from \"tailwind-variants\"\n\nimport { cn, focusRing } from \"../lib/utils\"\nimport { FieldDescription, FieldError, FieldLabel } from \"./field\"\n\nexport interface CheckboxGroupProps\n  extends Omit<RACCheckboxGroupProps, \"children\"> {\n  label?: string\n  children?: ReactNode\n  description?: string\n  errorMessage?: string | ((validation: ValidationResult) => string)\n}\n\nexport function CheckboxGroup(props: CheckboxGroupProps) {\n  return (\n    <RACCheckboxGroup\n      {...props}\n      className={composeRenderProps(props.className, (className) =>\n        cn(\"flex flex-col gap-3\", className)\n      )}\n    >\n      <FieldLabel>{props.label}</FieldLabel>\n      {props.children}\n      {props.description && (\n        <FieldDescription>{props.description}</FieldDescription>\n      )}\n      <FieldError>{props.errorMessage}</FieldError>\n    </RACCheckboxGroup>\n  )\n}\n\nconst checkboxStyles = tv({\n  base: \"group flex items-center gap-3 text-sm transition leading-none font-medium\",\n  variants: {\n    isDisabled: {\n      false: \"text-foreground\",\n      true: \"cursor-not-allowed opacity-50\",\n    },\n  },\n})\n\nconst boxStyles = tv({\n  extend: focusRing,\n  base: \"peer grid size-4 shrink-0 place-content-center rounded-[4px] border shadow-xs transition-shadow outline-none\",\n  variants: {\n    isSelected: {\n      false: \"border-input bg-background dark:bg-input/30\",\n      true: \"border-primary bg-primary text-primary-foreground dark:bg-primary\",\n    },\n    isInvalid: {\n      true: \"border-destructive ring-destructive/20 ring-[3px] dark:ring-destructive/40\",\n    },\n    isDisabled: {\n      true: \"cursor-not-allowed opacity-50\",\n    },\n  },\n})\n\nconst iconStyles = \"size-3.5 text-current transition-none\"\n\nexport function Checkbox(props: CheckboxProps) {\n  return (\n    <RACCheckbox\n      {...props}\n      data-slot=\"checkbox\"\n      className={composeRenderProps(props.className, (className, renderProps) =>\n        checkboxStyles({ ...renderProps, className })\n      )}\n    >\n      {({ isSelected, isIndeterminate, ...renderProps }) => (\n        <>\n          <div\n            data-slot=\"checkbox-indicator\"\n            className={boxStyles({\n              isSelected: isSelected || isIndeterminate,\n              ...renderProps,\n            })}\n          >\n            {isIndeterminate ? (\n              <Minus aria-hidden className={iconStyles} />\n            ) : isSelected ? (\n              <Check aria-hidden className={iconStyles} />\n            ) : null}\n          </div>\n          {props.children}\n        </>\n      )}\n    </RACCheckbox>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}