Openstatus www.openstatus.dev
at main 44 lines 1.5 kB view raw
1"use client"; 2 3import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"; 4import { Circle } from "lucide-react"; 5import * as React from "react"; 6 7import { cn } from "../lib/utils"; 8 9const RadioGroup = React.forwardRef< 10 React.ElementRef<typeof RadioGroupPrimitive.Root>, 11 React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> 12>(({ className, ...props }, ref) => { 13 return ( 14 <RadioGroupPrimitive.Root 15 className={cn("grid gap-2", className)} 16 {...props} 17 ref={ref} 18 /> 19 ); 20}); 21RadioGroup.displayName = RadioGroupPrimitive.Root.displayName; 22 23const RadioGroupItem = React.forwardRef< 24 React.ElementRef<typeof RadioGroupPrimitive.Item>, 25 React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> 26>(({ className, ...props }, ref) => { 27 return ( 28 <RadioGroupPrimitive.Item 29 ref={ref} 30 className={cn( 31 "border-primary text-primary ring-offset-background focus-visible:ring-ring aspect-square h-4 w-4 rounded-full border focus:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", 32 className, 33 )} 34 {...props} 35 > 36 <RadioGroupPrimitive.Indicator className="flex items-center justify-center"> 37 <Circle className="h-2.5 w-2.5 fill-current text-current" /> 38 </RadioGroupPrimitive.Indicator> 39 </RadioGroupPrimitive.Item> 40 ); 41}); 42RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName; 43 44export { RadioGroup, RadioGroupItem };