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