{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "glass-radio-group",
  "title": "Glass Radio Group",
  "description": "Options where exactly one is chosen, with a dot that pops in and shrinks away.",
  "dependencies": [
    "@radix-ui/react-radio-group",
    "clsx"
  ],
  "registryDependencies": [
    "@glassyui/glass-provider"
  ],
  "files": [
    {
      "path": "registry/glassyui/glass-radio-group.tsx",
      "content": "'use client';\n\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport clsx from 'clsx';\nimport { forwardRef, useId } from 'react';\nimport type { ReactNode } from 'react';\n\nexport type GlassRadioGroupProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>;\n\n/** A group of options where exactly one is chosen. Arrow keys move the choice, as Radix does. */\nexport const GlassRadioGroup = forwardRef<HTMLDivElement, GlassRadioGroupProps>(\n  ({ className, ...props }, forwardedRef) => (\n    <RadioGroupPrimitive.Root\n      {...props}\n      ref={forwardedRef}\n      className={clsx('lg-radio-group', className)}\n    />\n  ),\n);\n\nGlassRadioGroup.displayName = 'GlassRadioGroup';\n\nexport type GlassRadioGroupItemProps = Omit<\n  React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>,\n  'children'\n> & {\n  /** A line of muted text under the label. */\n  description?: ReactNode;\n  /** Text beside the button. Clicking it chooses the option. Without one, name the option with `aria-label`. */\n  label?: ReactNode;\n};\n\nexport const GlassRadioGroupItem = forwardRef<HTMLButtonElement, GlassRadioGroupItemProps>(\n  (\n    { className, description, id, label, 'aria-describedby': describedBy, ...props },\n    forwardedRef,\n  ) => {\n    const generatedId = useId();\n    const radioId = id ?? `lg-radio-${generatedId}`;\n    const descriptionId = `${radioId}-description`;\n    const described = [describedBy, description ? descriptionId : null].filter(Boolean).join(' ');\n\n    const button = (\n      <RadioGroupPrimitive.Item\n        {...props}\n        ref={forwardedRef}\n        id={radioId}\n        aria-describedby={described || undefined}\n        className={clsx('lg-radio', label === undefined && className)}\n      >\n        <RadioGroupPrimitive.Indicator forceMount className=\"lg-radio-indicator\">\n          <span aria-hidden className=\"lg-radio-dot\" />\n        </RadioGroupPrimitive.Indicator>\n      </RadioGroupPrimitive.Item>\n    );\n\n    if (label === undefined) return button;\n\n    return (\n      <div\n        className={clsx('lg-check-field', className)}\n        data-disabled={props.disabled ? '' : undefined}\n      >\n        {button}\n        <div className=\"lg-check-text\">\n          <label htmlFor={radioId}>{label}</label>\n          {description ? <span id={descriptionId}>{description}</span> : null}\n        </div>\n      </div>\n    );\n  },\n);\n\nGlassRadioGroupItem.displayName = 'GlassRadioGroupItem';\n",
      "type": "registry:ui",
      "target": "components/glassyui/glass-radio-group.tsx"
    }
  ],
  "meta": {
    "sourceModules": [
      "radio-group"
    ]
  },
  "type": "registry:ui"
}