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) => )
+) =>
Breadcrumb.displayName = "Breadcrumb"
-const BreadcrumbList = React.forwardRef<
- HTMLOListElement,
- React.ComponentPropsWithoutRef<"ol">
->(({ className, ...props }, ref) => (
-
-))
+const BreadcrumbList = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef<"ol"> & {
+ ref: React.RefObject;
+ }
+) => (
)
BreadcrumbList.displayName = "BreadcrumbList"
-const BreadcrumbItem = React.forwardRef<
- HTMLLIElement,
- React.ComponentPropsWithoutRef<"li">
->(({ className, ...props }, ref) => (
-
-))
+const BreadcrumbItem = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef<"li"> & {
+ ref: React.RefObject;
+ }
+) => ()
BreadcrumbItem.displayName = "BreadcrumbItem"
-const BreadcrumbLink = React.forwardRef<
- HTMLAnchorElement,
- React.ComponentPropsWithoutRef<"a"> & {
- asChild?: boolean
+const BreadcrumbLink = (
+ {
+ ref,
+ asChild,
+ className,
+ ...props
}
->(({ asChild, className, ...props }, ref) => {
+) => {
const Comp = asChild ? Slot : "a"
return (
@@ -54,22 +62,25 @@ const BreadcrumbLink = React.forwardRef<
{...props}
/>
)
-})
+}
BreadcrumbLink.displayName = "BreadcrumbLink"
-const BreadcrumbPage = React.forwardRef<
- HTMLSpanElement,
- React.ComponentPropsWithoutRef<"span">
->(({ className, ...props }, ref) => (
-
-))
+const BreadcrumbPage = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef<"span"> & {
+ ref: React.RefObject;
+ }
+) => ()
BreadcrumbPage.displayName = "BreadcrumbPage"
const BreadcrumbSeparator = ({
diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx
index 3df0f8c..4b5047c 100644
--- a/src/components/ui/button.tsx
+++ b/src/components/ui/button.tsx
@@ -42,22 +42,32 @@ export interface ButtonProps
loading?: boolean;
}
-const Button = React.forwardRef(
- ({ className, variant, size, asChild = false, loading, ...props }, ref) => {
- const Comp = asChild ? Slot : "button"
- return (
-
- {loading && }
- {props.children}
-
- )
+const Button = (
+ {
+ ref,
+ className,
+ variant,
+ size,
+ asChild = false,
+ loading,
+ ...props
+ }: ButtonProps & {
+ ref: React.RefObject;
}
-)
+) => {
+ const Comp = asChild ? Slot : "button"
+ return (
+
+ {loading && }
+ {props.children}
+
+ )
+}
Button.displayName = "Button"
export { Button, buttonVariants }
diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx
index 08dc8c7..810bf06 100644
--- a/src/components/ui/card.tsx
+++ b/src/components/ui/card.tsx
@@ -2,78 +2,96 @@ import * as React from "react"
import { cn } from "@/lib/utils"
-const Card = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-))
+const Card = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.HTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => ()
Card.displayName = "Card"
-const CardHeader = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-))
+const CardHeader = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.HTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => ()
CardHeader.displayName = "CardHeader"
-const CardTitle = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-))
+const CardTitle = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.HTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => ()
CardTitle.displayName = "CardTitle"
-const CardDescription = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-))
+const CardDescription = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.HTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => ()
CardDescription.displayName = "CardDescription"
-const CardContent = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-))
+const CardContent = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.HTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => ()
CardContent.displayName = "CardContent"
-const CardFooter = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-))
+const CardFooter = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.HTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => ()
CardFooter.displayName = "CardFooter"
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
diff --git a/src/components/ui/checkbox.tsx b/src/components/ui/checkbox.tsx
index f0dace6..8c2f303 100644
--- a/src/components/ui/checkbox.tsx
+++ b/src/components/ui/checkbox.tsx
@@ -6,25 +6,28 @@ import { Check } from "lucide-react"
import { cn } from "@/lib/utils"
-const Checkbox = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
- & {
+ ref: React.RefObject>;
+ }
+) => (
+
-
-
-
-
-))
+
+
+)
Checkbox.displayName = CheckboxPrimitive.Root.displayName
export { Checkbox }
diff --git a/src/components/ui/command.tsx b/src/components/ui/command.tsx
index 7a23505..e139b43 100644
--- a/src/components/ui/command.tsx
+++ b/src/components/ui/command.tsx
@@ -8,19 +8,22 @@ import { Search } from "lucide-react"
import { cn } from "@/lib/utils"
import { Dialog, DialogContent } from "@/components/ui/dialog"
-const Command = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
-))
+const Command = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => ()
Command.displayName = CommandPrimitive.displayName
const CommandDialog = ({ children, ...props }: DialogProps) => {
@@ -35,92 +38,109 @@ const CommandDialog = ({ children, ...props }: DialogProps) => {
)
}
-const CommandInput = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
-
-
-
-))
+const CommandInput = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => (
+
+
+
)
CommandInput.displayName = CommandPrimitive.Input.displayName
-const CommandList = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
-))
+const CommandList = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => ()
CommandList.displayName = CommandPrimitive.List.displayName
-const CommandEmpty = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->((props, ref) => (
-
-))
+const CommandEmpty = (
+ {
+ ref,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => ()
CommandEmpty.displayName = CommandPrimitive.Empty.displayName
-const CommandGroup = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
-))
+const CommandGroup = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => ()
CommandGroup.displayName = CommandPrimitive.Group.displayName
-const CommandSeparator = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
-))
+const CommandSeparator = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => ()
CommandSeparator.displayName = CommandPrimitive.Separator.displayName
-const CommandItem = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
-))
+const CommandItem = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => ()
CommandItem.displayName = CommandPrimitive.Item.displayName
diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsx
index 0b958a1..ea55a35 100644
--- a/src/components/ui/dialog.tsx
+++ b/src/components/ui/dialog.tsx
@@ -14,43 +14,50 @@ const DialogPortal = DialogPrimitive.Portal
const DialogClose = DialogPrimitive.Close
-const DialogOverlay = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
- & {
+ ref: React.RefObject>;
+ }
+) => ()
+DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
+
+const DialogContent = (
+ {
+ ref,
+ className,
+ children,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => (
+
+
-))
-DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
-
-const DialogContent = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, children, ...props }, ref) => (
-
-
-
- {children}
-
-
- Close
-
-
-
-))
+ >
+ {children}
+
+
+ Close
+
+
+)
DialogContent.displayName = DialogPrimitive.Content.displayName
const DialogHeader = ({
@@ -81,31 +88,37 @@ const DialogFooter = ({
)
DialogFooter.displayName = "DialogFooter"
-const DialogTitle = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
-))
+const DialogTitle = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => ()
DialogTitle.displayName = DialogPrimitive.Title.displayName
-const DialogDescription = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
-))
+const DialogDescription = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => ()
DialogDescription.displayName = DialogPrimitive.Description.displayName
export {
diff --git a/src/components/ui/dropdown-menu.tsx b/src/components/ui/dropdown-menu.tsx
index 1057af8..dec4e5c 100644
--- a/src/components/ui/dropdown-menu.tsx
+++ b/src/components/ui/dropdown-menu.tsx
@@ -18,154 +18,174 @@ const DropdownMenuSub = DropdownMenuPrimitive.Sub
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
-const DropdownMenuSubTrigger = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef & {
- inset?: boolean
+const DropdownMenuSubTrigger = (
+ {
+ ref,
+ className,
+ inset,
+ children,
+ ...props
}
->(({ className, inset, children, ...props }, ref) => (
-
- {children}
-
-
-))
+) => (
+ {children}
+
+)
DropdownMenuSubTrigger.displayName =
DropdownMenuPrimitive.SubTrigger.displayName
-const DropdownMenuSubContent = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
-))
+const DropdownMenuSubContent = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => ()
DropdownMenuSubContent.displayName =
DropdownMenuPrimitive.SubContent.displayName
-const DropdownMenuContent = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, sideOffset = 4, ...props }, ref) => (
-
-
-
-))
-DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
-
-const DropdownMenuItem = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef & {
- inset?: boolean
+const DropdownMenuContent = (
+ {
+ ref,
+ className,
+ sideOffset = 4,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
}
->(({ className, inset, ...props }, ref) => (
- (
+
-))
+)
+DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
+
+const DropdownMenuItem = (
+ {
+ ref,
+ className,
+ inset,
+ ...props
+ }
+) => ()
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
-const DropdownMenuCheckboxItem = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, children, checked, ...props }, ref) => (
-
-
-
-
-
-
- {children}
-
-))
+const DropdownMenuCheckboxItem = (
+ {
+ ref,
+ className,
+ children,
+ checked,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => (
+
+
+
+
+
+ {children}
+)
DropdownMenuCheckboxItem.displayName =
DropdownMenuPrimitive.CheckboxItem.displayName
-const DropdownMenuRadioItem = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, children, ...props }, ref) => (
-
-
-
-
-
-
- {children}
-
-))
+const DropdownMenuRadioItem = (
+ {
+ ref,
+ className,
+ children,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => (
+
+
+
+
+
+ {children}
+)
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
-const DropdownMenuLabel = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef & {
- inset?: boolean
+const DropdownMenuLabel = (
+ {
+ ref,
+ className,
+ inset,
+ ...props
}
->(({ className, inset, ...props }, ref) => (
-
-))
+) => ()
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
-const DropdownMenuSeparator = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
-))
+const DropdownMenuSeparator = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => ()
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
const DropdownMenuShortcut = ({
diff --git a/src/components/ui/form.tsx b/src/components/ui/form.tsx
index ce264ae..eab035d 100644
--- a/src/components/ui/form.tsx
+++ b/src/components/ui/form.tsx
@@ -72,10 +72,15 @@ const FormItemContext = React.createContext(
{} as FormItemContextValue
)
-const FormItem = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => {
+const FormItem = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.HTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => {
const id = React.useId()
return (
@@ -83,13 +88,18 @@ const FormItem = React.forwardRef<
)
-})
+}
FormItem.displayName = "FormItem"
-const FormLabel = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => {
+const FormLabel = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => {
const { error, formItemId } = useFormField()
return (
@@ -100,13 +110,17 @@ const FormLabel = React.forwardRef<
{...props}
/>
)
-})
+}
FormLabel.displayName = "FormLabel"
-const FormControl = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ ...props }, ref) => {
+const FormControl = (
+ {
+ ref,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => {
const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
return (
@@ -122,13 +136,18 @@ const FormControl = React.forwardRef<
{...props}
/>
)
-})
+}
FormControl.displayName = "FormControl"
-const FormDescription = React.forwardRef<
- HTMLParagraphElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => {
+const FormDescription = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.HTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => {
const { formDescriptionId } = useFormField()
return (
@@ -139,13 +158,19 @@ const FormDescription = React.forwardRef<
{...props}
/>
)
-})
+}
FormDescription.displayName = "FormDescription"
-const FormMessage = React.forwardRef<
- HTMLParagraphElement,
- React.HTMLAttributes
->(({ className, children, ...props }, ref) => {
+const FormMessage = (
+ {
+ ref,
+ className,
+ children,
+ ...props
+ }: React.HTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => {
const { error, formMessageId } = useFormField()
const body = error ? String(error?.message) : children
@@ -163,7 +188,7 @@ const FormMessage = React.forwardRef<
{body}
)
-})
+}
FormMessage.displayName = "FormMessage"
export {
diff --git a/src/components/ui/input-otp.tsx b/src/components/ui/input-otp.tsx
index cf4029b..e718c1a 100644
--- a/src/components/ui/input-otp.tsx
+++ b/src/components/ui/input-otp.tsx
@@ -6,34 +6,45 @@ import { Dot } from "lucide-react"
import { cn } from "@/lib/utils"
-const InputOTP = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, containerClassName, ...props }, ref) => (
-
-))
+const InputOTP = (
+ {
+ ref,
+ className,
+ containerClassName,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => ()
InputOTP.displayName = "InputOTP"
-const InputOTPGroup = React.forwardRef<
- React.ElementRef<"div">,
- React.ComponentPropsWithoutRef<"div">
->(({ className, ...props }, ref) => (
-
-))
+const InputOTPGroup = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef<"div"> & {
+ ref: React.RefObject>;
+ }
+) => ()
InputOTPGroup.displayName = "InputOTPGroup"
-const InputOTPSlot = React.forwardRef<
- React.ElementRef<"div">,
- React.ComponentPropsWithoutRef<"div"> & { index: number }
->(({ index, className, ...props }, ref) => {
+const InputOTPSlot = (
+ {
+ ref,
+ index,
+ className,
+ ...props
+ }
+) => {
const inputOTPContext = React.useContext(OTPInputContext)
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]
@@ -55,17 +66,19 @@ const InputOTPSlot = React.forwardRef<
)}
)
-})
+}
InputOTPSlot.displayName = "InputOTPSlot"
-const InputOTPSeparator = React.forwardRef<
- React.ElementRef<"div">,
- React.ComponentPropsWithoutRef<"div">
->(({ ...props }, ref) => (
-
-
-
-))
+const InputOTPSeparator = (
+ {
+ ref,
+ ...props
+ }: React.ComponentPropsWithoutRef<"div"> & {
+ ref: React.RefObject>;
+ }
+) => (
+
+
)
InputOTPSeparator.displayName = "InputOTPSeparator"
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }
diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsx
index 6ae727d..90656f0 100644
--- a/src/components/ui/input.tsx
+++ b/src/components/ui/input.tsx
@@ -5,21 +5,28 @@ import { cn } from "@/lib/utils"
export interface InputProps
extends React.InputHTMLAttributes {}
-const Input = React.forwardRef(
- ({ className, type, ...props }, ref) => {
- return (
-
- )
+const Input = (
+ {
+ ref,
+ className,
+ type,
+ ...props
+ }: InputProps & {
+ ref: React.RefObject;
}
-)
+) => {
+ return (
+
+ )
+}
Input.displayName = "Input"
export { Input }
diff --git a/src/components/ui/label.tsx b/src/components/ui/label.tsx
index 5341821..ac4d8dc 100644
--- a/src/components/ui/label.tsx
+++ b/src/components/ui/label.tsx
@@ -10,17 +10,17 @@ const labelVariants = cva(
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
)
-const Label = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef &
- VariantProps
->(({ className, ...props }, ref) => (
-
-))
+const Label = (
+ {
+ ref,
+ className,
+ ...props
+ }
+) => ()
Label.displayName = LabelPrimitive.Root.displayName
export { Label }
diff --git a/src/components/ui/popover.tsx b/src/components/ui/popover.tsx
index f0acf09..081420f 100644
--- a/src/components/ui/popover.tsx
+++ b/src/components/ui/popover.tsx
@@ -9,23 +9,28 @@ const Popover = PopoverPrimitive.Root
const PopoverTrigger = PopoverPrimitive.Trigger
-const PopoverContent = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
-
-
-
-))
+const PopoverContent = (
+ {
+ ref,
+ className,
+ align = "center",
+ sideOffset = 4,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => (
+
+)
PopoverContent.displayName = PopoverPrimitive.Content.displayName
export { Popover, PopoverTrigger, PopoverContent }
diff --git a/src/components/ui/table.tsx b/src/components/ui/table.tsx
index 60ff58c..b6a3ecf 100644
--- a/src/components/ui/table.tsx
+++ b/src/components/ui/table.tsx
@@ -2,114 +2,138 @@ import * as React from "react"
import { cn } from "@/lib/utils"
-const Table = React.forwardRef<
- HTMLTableElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-))
+const Table = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.HTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => ()
Table.displayName = "Table"
-const TableHeader = React.forwardRef<
- HTMLTableSectionElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-))
+const TableHeader = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.HTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => ()
TableHeader.displayName = "TableHeader"
-const TableBody = React.forwardRef<
- HTMLTableSectionElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-))
+const TableBody = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.HTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => ()
TableBody.displayName = "TableBody"
-const TableFooter = React.forwardRef<
- HTMLTableSectionElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
- tr]:border-b-0",
- className
- )}
- {...props}
- />
-))
+const TableFooter = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.HTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => (tr]:border-b-0",
+ className
+ )}
+ {...props}
+/>)
TableFooter.displayName = "TableFooter"
-const TableRow = React.forwardRef<
- HTMLTableRowElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-))
+const TableRow = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.HTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => (
)
TableRow.displayName = "TableRow"
-const TableHead = React.forwardRef<
- HTMLTableCellElement,
- React.ThHTMLAttributes
->(({ className, ...props }, ref) => (
- |
-))
+const TableHead = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ThHTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => ( | )
TableHead.displayName = "TableHead"
-const TableCell = React.forwardRef<
- HTMLTableCellElement,
- React.TdHTMLAttributes
->(({ className, ...props }, ref) => (
- |
-))
+const TableCell = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.TdHTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => ( | )
TableCell.displayName = "TableCell"
-const TableCaption = React.forwardRef<
- HTMLTableCaptionElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-))
+const TableCaption = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.HTMLAttributes & {
+ ref: React.RefObject;
+ }
+) => ()
TableCaption.displayName = "TableCaption"
export {
diff --git a/src/components/ui/tabs.tsx b/src/components/ui/tabs.tsx
index fb0f348..ca1dea0 100644
--- a/src/components/ui/tabs.tsx
+++ b/src/components/ui/tabs.tsx
@@ -7,49 +7,58 @@ import { cn } from "@/lib/utils"
const Tabs = TabsPrimitive.Root
-const TabsList = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
-))
+const TabsList = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => ()
TabsList.displayName = TabsPrimitive.List.displayName
-const TabsTrigger = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
-))
+const TabsTrigger = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => ()
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
-const TabsContent = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
-))
+const TabsContent = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => ()
TabsContent.displayName = TabsPrimitive.Content.displayName
export { Tabs, TabsList, TabsTrigger, TabsContent }
diff --git a/src/components/ui/textarea.tsx b/src/components/ui/textarea.tsx
index 968b7c0..6b6b565 100644
--- a/src/components/ui/textarea.tsx
+++ b/src/components/ui/textarea.tsx
@@ -2,10 +2,15 @@ import * as React from "react"
import { cn } from "@/lib/utils"
-const Textarea = React.forwardRef<
- HTMLTextAreaElement,
- React.ComponentProps<"textarea">
->(({ className, ...props }, ref) => {
+const Textarea = (
+ {
+ ref,
+ className,
+ ...props
+ }: React.ComponentProps<"textarea"> & {
+ ref: React.RefObject;
+ }
+) => {
return (
)
-})
+}
Textarea.displayName = "Textarea"
export { Textarea }
diff --git a/src/components/ui/tooltip.tsx b/src/components/ui/tooltip.tsx
index 30fc44d..5a6459e 100644
--- a/src/components/ui/tooltip.tsx
+++ b/src/components/ui/tooltip.tsx
@@ -11,20 +11,24 @@ const Tooltip = TooltipPrimitive.Root
const TooltipTrigger = TooltipPrimitive.Trigger
-const TooltipContent = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, sideOffset = 4, ...props }, ref) => (
-
-))
+const TooltipContent = (
+ {
+ ref,
+ className,
+ sideOffset = 4,
+ ...props
+ }: React.ComponentPropsWithoutRef & {
+ ref: React.RefObject>;
+ }
+) => ()
TooltipContent.displayName = TooltipPrimitive.Content.displayName
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }