diff --git a/demo/nextjs/components/ui/accordion.tsx b/demo/nextjs/components/ui/accordion.tsx index 3b95eb7e..1fed710a 100644 --- a/demo/nextjs/components/ui/accordion.tsx +++ b/demo/nextjs/components/ui/accordion.tsx @@ -8,22 +8,29 @@ import { cn } from "@/lib/utils"; const Accordion = AccordionPrimitive.Root; -const AccordionItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( +const AccordionItem = ({ + ref, + className, + ...props +}: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; +}) => ( -)); +); AccordionItem.displayName = "AccordionItem"; -const AccordionTrigger = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( +const AccordionTrigger = ({ + ref, + className, + children, + ...props +}: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; +}) => ( -)); +); AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName; -const AccordionContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( +const AccordionContent = ({ + ref, + className, + children, + ...props +}: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; +}) => (
{children}
-)); +); AccordionContent.displayName = AccordionPrimitive.Content.displayName; export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }; diff --git a/demo/nextjs/components/ui/alert-dialog.tsx b/demo/nextjs/components/ui/alert-dialog.tsx index f9ce27e8..51aee284 100644 --- a/demo/nextjs/components/ui/alert-dialog.tsx +++ b/demo/nextjs/components/ui/alert-dialog.tsx @@ -12,37 +12,43 @@ const AlertDialogTrigger = AlertDialogPrimitive.Trigger; const AlertDialogPortal = AlertDialogPrimitive.Portal; -const AlertDialogOverlay = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); +const AlertDialogOverlay = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => (); AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName; -const AlertDialogContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - - - - -)); +const AlertDialogContent = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => ( + + +); AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName; const AlertDialogHeader = ({ @@ -73,57 +79,69 @@ const AlertDialogFooter = ({ ); AlertDialogFooter.displayName = "AlertDialogFooter"; -const AlertDialogTitle = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); +const AlertDialogTitle = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => (); AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName; -const AlertDialogDescription = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); +const AlertDialogDescription = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => (); AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName; -const AlertDialogAction = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); +const AlertDialogAction = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => (); AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName; -const AlertDialogCancel = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); +const AlertDialogCancel = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => (); AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName; export { diff --git a/demo/nextjs/components/ui/alert.tsx b/demo/nextjs/components/ui/alert.tsx index ee12747d..fabb3eb1 100644 --- a/demo/nextjs/components/ui/alert.tsx +++ b/demo/nextjs/components/ui/alert.tsx @@ -19,41 +19,49 @@ const alertVariants = cva( }, ); -const Alert = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes & VariantProps ->(({ className, variant, ...props }, ref) => ( -
-)); +const Alert = ( + { + ref, + className, + variant, + ...props + } +) => (
); Alert.displayName = "Alert"; -const AlertTitle = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)); +const AlertTitle = ( + { + ref, + className, + ...props + }: React.HTMLAttributes & { + ref: React.RefObject; + } +) => (
); AlertTitle.displayName = "AlertTitle"; -const AlertDescription = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)); +const AlertDescription = ( + { + ref, + className, + ...props + }: React.HTMLAttributes & { + ref: React.RefObject; + } +) => (
); AlertDescription.displayName = "AlertDescription"; export { Alert, AlertTitle, AlertDescription }; diff --git a/demo/nextjs/components/ui/avatar.tsx b/demo/nextjs/components/ui/avatar.tsx index d9f1b10c..a97dc70f 100644 --- a/demo/nextjs/components/ui/avatar.tsx +++ b/demo/nextjs/components/ui/avatar.tsx @@ -5,46 +5,55 @@ import * as AvatarPrimitive from "@radix-ui/react-avatar"; import { cn } from "@/lib/utils"; -const Avatar = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); +const Avatar = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => (); Avatar.displayName = AvatarPrimitive.Root.displayName; -const AvatarImage = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); +const AvatarImage = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => (); AvatarImage.displayName = AvatarPrimitive.Image.displayName; -const AvatarFallback = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); +const AvatarFallback = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => (); AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName; export { Avatar, AvatarImage, AvatarFallback }; diff --git a/demo/nextjs/components/ui/breadcrumb.tsx b/demo/nextjs/components/ui/breadcrumb.tsx index a7efa2ee..b1699108 100644 --- a/demo/nextjs/components/ui/breadcrumb.tsx +++ b/demo/nextjs/components/ui/breadcrumb.tsx @@ -4,47 +4,55 @@ import { Slot } from "@radix-ui/react-slot"; import { cn } from "@/lib/utils"; -const Breadcrumb = React.forwardRef< - HTMLElement, - React.ComponentPropsWithoutRef<"nav"> & { - separator?: React.ReactNode; - } ->(({ ...props }, ref) =>