From ec6511bcb86941f91f0bb8834e35972242f76472 Mon Sep 17 00:00:00 2001 From: naiba Date: Thu, 2 Oct 2025 17:15:20 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A9=20f*ck=20react?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ui/alert-dialog.tsx | 42 +++++++++---------- src/components/ui/avatar.tsx | 20 ++++----- src/components/ui/badge.tsx | 4 +- src/components/ui/breadcrumb.tsx | 22 +++++----- src/components/ui/button.tsx | 6 +-- src/components/ui/calendar.tsx | 12 +++--- src/components/ui/card.tsx | 16 ++++---- src/components/ui/checkbox.tsx | 8 ++-- src/components/ui/combobox.tsx | 10 ++--- src/components/ui/command.tsx | 46 ++++++++++----------- src/components/ui/dialog.tsx | 30 +++++++------- src/components/ui/drawer.tsx | 32 +++++++-------- src/components/ui/dropdown-menu.tsx | 52 ++++++++++++------------ src/components/ui/form.tsx | 34 ++++++++-------- src/components/ui/input.tsx | 6 +-- src/components/ui/label.tsx | 8 ++-- src/components/ui/navigation-menu.tsx | 38 ++++++++--------- src/components/ui/pagination.tsx | 16 ++++---- src/components/ui/popover.tsx | 8 ++-- src/components/ui/scroll-area.tsx | 14 +++---- src/components/ui/select.tsx | 44 ++++++++++---------- src/components/ui/separator.tsx | 8 ++-- src/components/ui/switch.tsx | 8 ++-- src/components/ui/table.tsx | 30 +++++++------- src/components/ui/tabs.tsx | 20 ++++----- src/components/ui/textarea.tsx | 4 +- src/components/xui/filepath.tsx | 12 +++--- src/components/xui/multi-select.tsx | 12 +++--- src/components/xui/overlayless-sheet.tsx | 26 ++++++------ src/hooks/useMediaQuery.tsx | 6 +-- src/main.tsx | 43 +++++++++++--------- 31 files changed, 320 insertions(+), 317 deletions(-) diff --git a/src/components/ui/alert-dialog.tsx b/src/components/ui/alert-dialog.tsx index 1105492..aa0436e 100644 --- a/src/components/ui/alert-dialog.tsx +++ b/src/components/ui/alert-dialog.tsx @@ -1,7 +1,7 @@ import { buttonVariants } from "@/components/ui/button" import { cn } from "@/lib/utils" import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" -import * as React from "react" +import { forwardRef, ComponentRef, ComponentPropsWithoutRef, HTMLAttributes } from "react" const AlertDialog = AlertDialogPrimitive.Root @@ -9,9 +9,9 @@ const AlertDialogTrigger = AlertDialogPrimitive.Trigger const AlertDialogPortal = AlertDialogPrimitive.Portal -const AlertDialogOverlay = React.forwardRef< - React.ComponentRef, - React.ComponentPropsWithoutRef +const AlertDialogOverlay = forwardRef< + ComponentRef, + ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( , - React.ComponentPropsWithoutRef +const AlertDialogContent = forwardRef< + ComponentRef, + ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( @@ -42,12 +42,12 @@ const AlertDialogContent = React.forwardRef< )) AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName -const AlertDialogHeader = ({ className, ...props }: React.HTMLAttributes) => ( +const AlertDialogHeader = ({ className, ...props }: HTMLAttributes) => (
) AlertDialogHeader.displayName = "AlertDialogHeader" -const AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes) => ( +const AlertDialogFooter = ({ className, ...props }: HTMLAttributes) => (
, - React.ComponentPropsWithoutRef +const AlertDialogTitle = forwardRef< + ComponentRef, + ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( , - React.ComponentPropsWithoutRef +const AlertDialogDescription = forwardRef< + ComponentRef, + ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( , - React.ComponentPropsWithoutRef +const AlertDialogAction = forwardRef< + ComponentRef, + ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )) AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName -const AlertDialogCancel = React.forwardRef< - React.ComponentRef, - React.ComponentPropsWithoutRef +const AlertDialogCancel = forwardRef< + ComponentRef, + ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( , - React.ComponentPropsWithoutRef +const Avatar = forwardRef< + ComponentRef, + ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( , - React.ComponentPropsWithoutRef +const AvatarImage = forwardRef< + ComponentRef, + ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( , - React.ComponentPropsWithoutRef +const AvatarFallback = forwardRef< + ComponentRef, + ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( , + extends HTMLAttributes, VariantProps {} function Badge({ className, variant, ...props }: BadgeProps) { diff --git a/src/components/ui/breadcrumb.tsx b/src/components/ui/breadcrumb.tsx index ae14a38..fa3637d 100644 --- a/src/components/ui/breadcrumb.tsx +++ b/src/components/ui/breadcrumb.tsx @@ -1,17 +1,17 @@ import { cn } from "@/lib/utils" import { Slot } from "@radix-ui/react-slot" import { ChevronRight, MoreHorizontal } from "lucide-react" -import * as React from "react" +import { forwardRef, ComponentPropsWithoutRef, ReactNode, ComponentProps } from "react" -const Breadcrumb = React.forwardRef< +const Breadcrumb = forwardRef< HTMLElement, - React.ComponentPropsWithoutRef<"nav"> & { - separator?: React.ReactNode + ComponentPropsWithoutRef<"nav"> & { + separator?: ReactNode } >(({ ...props }, ref) =>