{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "radio-group",
  "title": "Radio Group",
  "author": "@fma-ds/ds",
  "description": "A set of mutually-exclusive radio options.\n\nPair each `RadioGroupItem` with an external `Label` via `id`/`htmlFor` — its own children slot is for a custom indicator, not label text.\n\n- **`RadioCard`**: a choice card — the whole card is the radio, its children are the content (an `IconTile`, `FieldContent` with `FieldTitle` and `FieldDescription`) and a round indicator sits at the end. Selected cards take a `primary` tint, hovered ones `accent`.\n- **Layout**: lay several out with a `className` grid on the group.",
  "dependencies": [
    "cn@^0.5.0",
    "react-aria-components@^1.22.1"
  ],
  "registryDependencies": [
    "@fma-ds/field"
  ],
  "files": [
    {
      "path": "src/core/radio-group/radio-group.tsx",
      "content": "import { cn } from \"cn\";\nimport {\n  composeRenderProps,\n  RadioGroup as RadioGroupPrimitive,\n  type RadioGroupProps,\n  Radio as RadioPrimitive,\n  type RadioProps,\n} from \"react-aria-components\";\nimport { choiceCardClassName } from \"@/core/field/field\";\n\nfunction RadioGroup({ className, ...props }: RadioGroupProps) {\n  return (\n    <RadioGroupPrimitive\n      data-slot=\"radio-group\"\n      className={cn(\"grid w-full gap-2\", className)}\n      {...props}\n    />\n  );\n}\n\nfunction RadioGroupItem({ className, children, ...props }: RadioProps) {\n  return (\n    <RadioPrimitive\n      data-slot=\"radio-group-item\"\n      className={cn(\n        \"group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary data-focus-visible:border-ring data-focus-visible:ring-3 data-focus-visible:ring-ring/50 data-invalid:border-destructive data-invalid:ring-3 data-invalid:ring-destructive/20 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 dark:data-invalid:border-destructive/50 dark:data-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary data-selected:border-primary data-selected:bg-primary data-selected:text-primary-foreground data-invalid:data-selected:border-primary dark:data-selected:bg-primary\",\n        className,\n      )}\n      {...props}\n    >\n      {composeRenderProps(children, (children, { isSelected }) => (\n        <>\n          <span\n            data-slot=\"radio-group-indicator\"\n            className=\"flex size-4 items-center justify-center\"\n          >\n            {isSelected && (\n              <span className=\"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground\" />\n            )}\n          </span>\n          {children}\n        </>\n      ))}\n    </RadioPrimitive>\n  );\n}\n\n/**\n * A radio drawn as a card: the whole card selects it. Children are the card's\n * content (an `IconTile`, a `FieldContent` with `FieldTitle` and\n * `FieldDescription`); a round indicator sits at the end.\n */\nfunction RadioCard({ className, children, ...props }: RadioProps) {\n  return (\n    <RadioPrimitive\n      data-slot=\"radio-card\"\n      className={composeRenderProps(className, (className) => cn(choiceCardClassName, className))}\n      {...props}\n    >\n      {composeRenderProps(children, (children, { isSelected }) => (\n        <>\n          {children}\n          <span\n            data-slot=\"radio-card-indicator\"\n            className=\"relative mt-0.5 ml-auto flex size-4 shrink-0 rounded-full border border-input transition-colors group-data-selected/choice-card:border-primary group-data-selected/choice-card:bg-primary dark:bg-input/30\"\n          >\n            {isSelected && (\n              <span className=\"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground\" />\n            )}\n          </span>\n        </>\n      ))}\n    </RadioPrimitive>\n  );\n}\n\nexport { RadioCard, RadioGroup, RadioGroupItem };\n",
      "type": "registry:component",
      "target": "components/fma-ds/radio-group.tsx"
    }
  ],
  "meta": {
    "status": "stable",
    "source": "customized",
    "license": "MIT",
    "origin": "shadcn/ui, style: aria-nova (base: react-aria-components)",
    "tags": [
      "form",
      "selection",
      "react-aria"
    ],
    "contentHash": "9a6e0dbcbeb6"
  },
  "categories": [
    "forms"
  ],
  "type": "registry:ui"
}