{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "radio",
  "title": "Radio",
  "description": "One selection ring glides to the chosen option and the dot pops in.",
  "dependencies": [
    "@ui-sdk/core@0.1.0-beta.2",
    "@ui-sdk/react@0.1.0-beta.2"
  ],
  "registryDependencies": [
    "@keyframery/motion"
  ],
  "files": [
    {
      "path": "registry/components/keyframery/primitives/radio.tsx",
      "content": "\"use client\"\n\n/* Animated drop-in for `@ui-sdk/react/radio`: same parts, same props. Swap the import and keep your code.\n   This file adds motion only. Colours, radii, shadows and spacing stay yours. */\n\nimport {\n  Radio as RadioPart,\n  RadioGroup as RadioGroupPart,\n  RadioIndicator as RadioIndicatorPart,\n} from \"@ui-sdk/react/radio\"\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport * from \"@ui-sdk/react/radio\"\n\n/* UI SDK accepts a class name or a function of state; keep both working. */\nfunction withClass<S>(base: string, className: string | ((state: S) => string | undefined) | undefined) {\n  return typeof className === \"function\" ? (state: S) => cn(base, className(state)) : cn(base, className)\n}\n\n/* Glide: one selection ring follows the checked radio from option to option, positioned with\n   CSS anchors. By default it is a soft halo around the checked radio, `--kf-radio-pad` outside\n   it; restyle it with `before:` classes. To ring a whole row instead, give the row\n   `has-data-checked:[anchor-name:--kf-radio]` and the radio `data-checked:[anchor-name:none]`. */\nfunction RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPart>) {\n  return (\n    <RadioGroupPart\n      className={withClass(\n        cn(\n          \"relative isolate [anchor-scope:--kf-radio] [--kf-radio-pad:5px]\",\n          \"before:pointer-events-none before:absolute before:-z-10 before:rounded-full before:content-['']\",\n          \"before:bg-[color-mix(in_oklch,currentColor_9%,transparent)]\",\n          \"before:[position-anchor:--kf-radio]\",\n          \"before:top-[calc(anchor(top)-var(--kf-radio-pad))] before:right-[calc(anchor(right)-var(--kf-radio-pad))]\",\n          \"before:bottom-[calc(anchor(bottom)-var(--kf-radio-pad))] before:left-[calc(anchor(left)-var(--kf-radio-pad))]\",\n          \"before:transition-[top,right,bottom,left,opacity] before:duration-[calc(460ms*var(--kf-speed,1))] before:ease-spring\",\n          \"not-has-data-checked:before:opacity-0\",\n          \"motion-reduce:before:transition-none!\",\n        ),\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* Press: gives under the finger, springs back. The checked radio is the anchor the ring follows. */\nfunction Radio({ className, ...props }: React.ComponentProps<typeof RadioPart>) {\n  return (\n    <RadioPart\n      className={withClass(\n        cn(\n          \"data-checked:[anchor-name:--kf-radio]\",\n          \"transition-[scale] duration-[calc(200ms*var(--kf-speed,1))] ease-pop motion-reduce:transition-none!\",\n          \"not-data-disabled:not-data-readonly:active:scale-[0.86]\",\n        ),\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* The dot pops in from 0.3 with an overshoot and shrinks away on the way out. */\nfunction RadioIndicator({ className, ...props }: React.ComponentProps<typeof RadioIndicatorPart>) {\n  return (\n    <RadioIndicatorPart\n      className={withClass(\n        cn(\n          \"transition-[scale,opacity] duration-[calc(480ms*var(--kf-speed,1))] ease-pop\",\n          \"data-starting-style:scale-[0.3] data-starting-style:opacity-0\",\n          \"data-ending-style:scale-[0.4] data-ending-style:opacity-0 data-ending-style:duration-[calc(150ms*var(--kf-speed,1))] data-ending-style:ease-house\",\n          \"motion-reduce:transition-none!\",\n        ),\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nexport { Radio, RadioGroup, RadioIndicator }\n",
      "type": "registry:component",
      "target": "components/keyframery/primitives/radio.tsx"
    },
    {
      "path": "registry/components/keyframery/radio.tsx",
      "content": "\"use client\"\n\n/* Styled radio: the animated primitive plus the Keyframery look. */\n\nimport * as React from \"react\"\n\nimport {\n  Radio as RadioPrimitive,\n  RadioGroup as RadioGroupPrimitive,\n  RadioIndicator as RadioIndicatorPrimitive,\n} from \"@/components/keyframery/primitives/radio\"\nimport { cn } from \"@/lib/utils\"\n\n/* The gliding selection ring: a thin primary ring 4px outside the checked radio. */\nfunction RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive>) {\n  return (\n    <RadioGroupPrimitive\n      className={cn(\n        \"flex flex-col gap-2.5 outline-none [--kf-radio-pad:4px]\",\n        \"before:bg-transparent before:shadow-[inset_0_0_0_1.5px_color-mix(in_oklab,var(--primary)_28%,transparent)]\",\n        className as string,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction Radio({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof RadioPrimitive>) {\n  return (\n    <RadioPrimitive\n      className={cn(\n        \"relative inline-grid size-[18px] shrink-0 cursor-pointer place-items-center rounded-full outline-none select-none\",\n        /* A small round field; the primary key is the indicator, which pops in on top. */\n        \"bg-background shadow-[0_0_0_1px_rgb(0_0_0/0.14),0_1px_2px_rgb(0_0_0/0.05)]\",\n        \"dark:bg-accent/40 dark:shadow-[0_0_0_1px_rgb(255_255_255/0.14)]\",\n        \"not-data-disabled:not-data-readonly:hover:shadow-[0_0_0_1px_rgb(0_0_0/0.24),0_1px_2px_rgb(0_0_0/0.06)]\",\n        \"dark:not-data-disabled:not-data-readonly:hover:shadow-[0_0_0_1px_rgb(255_255_255/0.24)]\",\n        \"transition-[box-shadow,scale] motion-reduce:transition-none!\",\n        \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n        \"data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default\",\n        className as string,\n      )}\n      {...props}\n    >\n      {children ?? <RadioIndicator />}\n    </RadioPrimitive>\n  )\n}\n\n/* A primary disc holding a dot. */\nfunction RadioIndicator({ className, ...props }: React.ComponentProps<typeof RadioIndicatorPrimitive>) {\n  return (\n    <RadioIndicatorPrimitive\n      aria-hidden\n      className={cn(\n        \"pointer-events-none absolute inset-0 grid place-items-center rounded-full\",\n        \"bg-primary shadow-[inset_0_1px_0_rgb(255_255_255/0.14),0_1px_2px_rgb(0_0_0/0.25)]\",\n        \"dark:shadow-[inset_0_1px_0_rgb(255_255_255/0.7),0_1px_2px_rgb(0_0_0/0.5)]\",\n        \"after:size-[7px] after:rounded-full after:bg-primary-foreground after:content-['']\",\n        className as string,\n      )}\n      {...props}\n    />\n  )\n}\n\nexport { Radio, RadioGroup, RadioIndicator }\n",
      "type": "registry:component",
      "target": "components/keyframery/radio.tsx"
    }
  ],
  "type": "registry:component"
}