|
1 | | -import * as React from "react" |
2 | | -import * as RadioGroupPrimitive from "@radix-ui/react-radio-group" |
| 1 | +import * as RadioGroupPrimitive from '@radix-ui/react-radio-group' |
| 2 | +import * as React from 'react' |
3 | 3 | // import { Circle } from "lucide-react" |
4 | 4 |
|
5 | 5 | import { cn } from '#app/utils/misc.tsx' |
6 | | -import { Icon } from "./icon.tsx" |
| 6 | +import { Icon } from './icon.tsx' |
7 | 7 |
|
8 | 8 | const RadioGroup = React.forwardRef< |
9 | | - React.ElementRef<typeof RadioGroupPrimitive.Root>, |
10 | | - React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> |
| 9 | + React.ElementRef<typeof RadioGroupPrimitive.Root>, |
| 10 | + React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> |
11 | 11 | >(({ className, ...props }, ref) => { |
12 | | - return ( |
13 | | - <RadioGroupPrimitive.Root |
14 | | - className={cn("grid gap-2", className)} |
15 | | - {...props} |
16 | | - ref={ref} |
17 | | - /> |
18 | | - ) |
| 12 | + return ( |
| 13 | + <RadioGroupPrimitive.Root |
| 14 | + className={cn('grid gap-2', className)} |
| 15 | + {...props} |
| 16 | + ref={ref} |
| 17 | + /> |
| 18 | + ) |
19 | 19 | }) |
20 | 20 | RadioGroup.displayName = RadioGroupPrimitive.Root.displayName |
21 | 21 |
|
22 | 22 | const RadioGroupItem = React.forwardRef< |
23 | | - React.ElementRef<typeof RadioGroupPrimitive.Item>, |
24 | | - React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> |
| 23 | + React.ElementRef<typeof RadioGroupPrimitive.Item>, |
| 24 | + React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> |
25 | 25 | >(({ className, ...props }, ref) => { |
26 | | - return ( |
27 | | - <RadioGroupPrimitive.Item |
28 | | - ref={ref} |
29 | | - className={cn( |
30 | | - "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", |
31 | | - className |
32 | | - )} |
33 | | - {...props} |
34 | | - > |
35 | | - <RadioGroupPrimitive.Indicator className="flex items-center justify-center"> |
36 | | - <Icon name="chevron-right" size="sm" className="h-2.5 w-2.5 fill-current text-current" /> |
37 | | - {/* <Circle className="h-2.5 w-2.5 fill-current text-current" /> */} |
38 | | - </RadioGroupPrimitive.Indicator> |
39 | | - </RadioGroupPrimitive.Item> |
40 | | - ) |
| 26 | + return ( |
| 27 | + <RadioGroupPrimitive.Item |
| 28 | + ref={ref} |
| 29 | + className={cn( |
| 30 | + 'aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', |
| 31 | + className, |
| 32 | + )} |
| 33 | + {...props} |
| 34 | + > |
| 35 | + <RadioGroupPrimitive.Indicator className="flex items-center justify-center"> |
| 36 | + <Icon |
| 37 | + name="chevron-right" |
| 38 | + size="sm" |
| 39 | + className="h-2.5 w-2.5 fill-current text-current" |
| 40 | + /> |
| 41 | + {/* <Circle className="h-2.5 w-2.5 fill-current text-current" /> */} |
| 42 | + </RadioGroupPrimitive.Indicator> |
| 43 | + </RadioGroupPrimitive.Item> |
| 44 | + ) |
41 | 45 | }) |
42 | 46 | RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName |
43 | 47 |
|
|
0 commit comments