From efa082f62332fa24519a0b99f23cdb52da32cd3f Mon Sep 17 00:00:00 2001 From: SrIzan10 <66965250+SrIzan10@users.noreply.github.com> Date: Wed, 16 Apr 2025 13:58:56 +0200 Subject: [PATCH] chore: ref codemod from react --- src/components/ui/avatar.tsx | 81 +++++---- src/components/ui/breadcrumb.tsx | 105 ++++++----- src/components/ui/button.tsx | 40 +++-- src/components/ui/card.tsx | 142 ++++++++------- src/components/ui/checkbox.tsx | 39 ++-- src/components/ui/command.tsx | 190 +++++++++++--------- src/components/ui/dialog.tsx | 123 +++++++------ src/components/ui/dropdown-menu.tsx | 268 +++++++++++++++------------- src/components/ui/form.tsx | 75 +++++--- src/components/ui/input-otp.tsx | 79 ++++---- src/components/ui/input.tsx | 35 ++-- src/components/ui/label.tsx | 22 +-- src/components/ui/popover.tsx | 39 ++-- src/components/ui/table.tsx | 212 ++++++++++++---------- src/components/ui/tabs.tsx | 87 +++++---- src/components/ui/textarea.tsx | 15 +- src/components/ui/tooltip.tsx | 32 ++-- 17 files changed, 890 insertions(+), 694 deletions(-) diff --git a/src/components/ui/avatar.tsx b/src/components/ui/avatar.tsx index 51e507b..e8d8e30 100644 --- a/src/components/ui/avatar.tsx +++ b/src/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/src/components/ui/breadcrumb.tsx b/src/components/ui/breadcrumb.tsx index 60e6c96..b32a52e 100644 --- a/src/components/ui/breadcrumb.tsx +++ b/src/components/ui/breadcrumb.tsx @@ -4,47 +4,55 @@ import { ChevronRight, MoreHorizontal } from "lucide-react" import { cn } from "@/lib/utils" -const Breadcrumb = React.forwardRef< - HTMLElement, - React.ComponentPropsWithoutRef<"nav"> & { - separator?: React.ReactNode +const Breadcrumb = ( + { + ref, + ...props } ->(({ ...props }, ref) =>