{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "radio-cards",
  "title": "Radio Cards",
  "description": "Radio Cards from the Get IT Done design system.",
  "dependencies": [
    "@radix-ui/react-radio-group@^1.5.1"
  ],
  "registryDependencies": [
    "https://zero-design.itdone.de/r/labels-context.json",
    "https://zero-design.itdone.de/r/utils.json",
    "https://zero-design.itdone.de/r/theme.json"
  ],
  "files": [
    {
      "path": "registry/ui/radio-cards.tsx",
      "content": "'use client';\n\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\nimport { usePreset } from '@/components/ui/labels-context';\n\n// Figma Sheet block Type=Radio cards grid: options as cards in a 2 column wrap grid (one column below sm), optional 4th option.\nexport type RadioCardGroupProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> & {\n  // `2` is the Figma grid, `1` stacks the cards (Figma Type=Radio cards).\n  columns?: 1 | 2;\n};\n\nconst RadioCardGroup = React.forwardRef<React.ElementRef<typeof RadioGroupPrimitive.Root>, RadioCardGroupProps>(\n  ({ className, columns = 2, ...props }, ref) => (\n    <RadioGroupPrimitive.Root\n      ref={ref}\n      data-columns={columns}\n      className={cn('grid grid-cols-1 gap-3', columns === 2 && 'sm:grid-cols-2', className)}\n      {...props}\n    />\n  ),\n);\nRadioCardGroup.displayName = 'RadioCardGroup';\n\nexport interface RadioCardProps extends Omit<React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, 'children' | 'title'> {\n  title: React.ReactNode;\n  description?: React.ReactNode;\n  // Decorative leading icon or icon tile.\n  icon?: React.ReactNode;\n}\n\n// The whole card is the radio (role radio, arrow keys move between cards via the group).\nconst RadioCard = React.forwardRef<React.ElementRef<typeof RadioGroupPrimitive.Item>, RadioCardProps>(\n  ({ className, title, description, icon, ...props }, ref) => {\n    const zero = usePreset() === 'zero';\n    return (\n    <RadioGroupPrimitive.Item\n      ref={ref}\n      className={cn(\n        'group flex min-w-0 items-start gap-3 rounded-surface border border-solid border-border-default bg-background p-4 text-left transition-[color,background-color,border-color,box-shadow] duration-150',\n        'hover:border-border-bold hover:bg-background-neutral-subtle',\n        zero\n          ? 'data-[state=checked]:border-border-brand data-[state=checked]:ring-[3px] data-[state=checked]:ring-background-brand-subtle'\n          : 'data-[state=checked]:border-primary data-[state=checked]:bg-background-brand-subtle',\n        'focus-visible:outline-none focus-visible:ring-focus focus-visible:ring-offset-focus focus-visible:ring-offset-background focus-visible:ring-ring-default',\n        'disabled:cursor-not-allowed disabled:opacity-disabled',\n        className,\n      )}\n      {...props}\n    >\n      {icon ? (\n        <span\n          aria-hidden=\"true\"\n          className={cn(\n            'inline-flex shrink-0 items-center justify-center text-icon-subtle [&>svg]:h-icon-md [&>svg]:w-icon-md',\n            zero ? 'h-icon-tile w-icon-tile rounded-item bg-muted' : 'h-icon-md w-icon-md',\n          )}\n        >\n          {icon}\n        </span>\n      ) : null}\n      <span className=\"flex min-w-0 flex-1 flex-col gap-1\">\n        <span className=\"typography-ui-medium text-text-default\">{title}</span>\n        {description ? <span className={cn('typography-ui text-text-subtle', !zero && 'group-data-[state=checked]:text-general-brand-on-container')}>{description}</span> : null}\n      </span>\n      <span\n        aria-hidden=\"true\"\n        className=\"mt-1 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-solid border-checkbox-border-default bg-background group-data-[state=checked]:border-border-control-checked\"\n      >\n        <span className=\"hidden h-2 w-2 rounded-full bg-primary group-data-[state=checked]:block\" />\n      </span>\n    </RadioGroupPrimitive.Item>\n    );\n  },\n);\nRadioCard.displayName = 'RadioCard';\n\nexport { RadioCard, RadioCardGroup };\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}