{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "radio-group",
  "dependencies": [
    "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/radio-group.tsx",
      "content": "\"use client\"\n\nimport React, { ReactNode } from \"react\"\nimport {\n  composeRenderProps,\n  Radio as RACRadio,\n  RadioGroup as RACRadioGroup,\n  RadioGroupProps as RACRadioGroupProps,\n  RadioProps,\n  ValidationResult,\n} from \"react-aria-components\"\nimport { tv } from \"tailwind-variants\"\n\nimport { cn } from \"../lib/utils\"\nimport {\n  FieldDescription,\n  FieldError,\n  FieldLabel,\n  fieldVariants,\n} from \"./field\"\n\nexport interface RadioGroupProps extends Omit<RACRadioGroupProps, \"children\"> {\n  label?: string\n  children?: ReactNode\n  description?: string\n  errorMessage?: string | ((validation: ValidationResult) => string)\n}\n\nexport function RadioGroup(props: RadioGroupProps) {\n  const { orientation = \"vertical\", ...rest } = props\n\n  return (\n    <RACRadioGroup\n      {...rest}\n      className={cn(fieldVariants({ orientation }), props.className)}\n    >\n      <FieldLabel>{props.label}</FieldLabel>\n      <div className=\"grid gap-3\">{props.children}</div>\n      {props.description && (\n        <FieldDescription>{props.description}</FieldDescription>\n      )}\n      <FieldError>{props.errorMessage}</FieldError>\n    </RACRadioGroup>\n  )\n}\n\nconst radioVariants = tv({\n  base: \"border-input text-primary aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none relative flex items-center justify-center\",\n  variants: {\n    isFocusVisible: {\n      true: \"border-ring ring-ring/50 ring-[3px]\",\n    },\n    isInvalid: {\n      true: \"border-destructive ring-destructive/20\",\n    },\n    isDisabled: {\n      true: \"cursor-not-allowed opacity-50\",\n    },\n  },\n})\n\nconst radioIndicatorVariants = tv({\n  base: \"bg-primary size-2 rounded-full\",\n  variants: {\n    isSelected: {\n      true: \"scale-100\",\n      false: \"scale-0\",\n    },\n  },\n})\n\nexport function Radio(props: RadioProps) {\n  return (\n    <RACRadio\n      {...props}\n      className={composeRenderProps(props.className, (className) =>\n        cn(\n          \"group relative flex items-center gap-2 text-sm transition\",\n          className\n        )\n      )}\n    >\n      {(renderProps) => (\n        <>\n          <div className={radioVariants(renderProps)}>\n            <div className={radioIndicatorVariants(renderProps)} />\n          </div>\n          {props.children}\n        </>\n      )}\n    </RACRadio>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}