From 0523d775097c90ecb2702d1a7b2bc2f972e91955 Mon Sep 17 00:00:00 2001 From: Ed Castro Date: Wed, 2 Oct 2024 11:16:06 -0300 Subject: [PATCH] refactor: Rearrange class names in UI components This commit rearranges the order of class names in several UI components to improve readability and consistency. The changes were made in the following files: - `packages/ui/src/components/card.tsx` - `packages/ui/src/components/button.tsx` - `packages/ui/src/components/checkbox.tsx` - `packages/ui/src/components/input.tsx` - `packages/ui/src/components/hover-card.tsx` - `packages/ui/src/components/badge.tsx` - `packages/ui/src/components/dialog.tsx` - `packages/ui/src/components/select.tsx` The class names were reordered to follow a consistent pattern and improve maintainability. --- packages/ui/components.json | 2 +- packages/ui/src/components/badge.tsx | 8 ++++---- packages/ui/src/components/button.tsx | 2 +- packages/ui/src/components/card.tsx | 4 ++-- packages/ui/src/components/checkbox.tsx | 2 +- packages/ui/src/components/dialog.tsx | 8 ++++---- packages/ui/src/components/dropdown-menu.tsx | 14 +++++++------- packages/ui/src/components/hover-card.tsx | 2 +- packages/ui/src/components/input.tsx | 2 +- packages/ui/src/components/select.tsx | 8 ++++---- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/ui/components.json b/packages/ui/components.json index 99e2ebf..18b00f7 100644 --- a/packages/ui/components.json +++ b/packages/ui/components.json @@ -14,4 +14,4 @@ "components": "src/components/", "ui": "src/components/" } -} \ No newline at end of file +} diff --git a/packages/ui/src/components/badge.tsx b/packages/ui/src/components/badge.tsx index 7ed373e..0ed486b 100644 --- a/packages/ui/src/components/badge.tsx +++ b/packages/ui/src/components/badge.tsx @@ -5,17 +5,17 @@ import { cva } from "class-variance-authority"; import { cn } from "."; const badgeVariants = cva( - "focus:ring-ring inline-flex items-center rounded-full border px-3 py-1 text-sm font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2", + "inline-flex items-center rounded-full border px-3 py-1 text-sm font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", { variants: { variant: { default: "text-foreground backdrop-blur-md", solid: - "bg-primary text-primary-foreground hover:bg-primary/80 border-transparent", + "border-transparent bg-primary text-primary-foreground hover:bg-primary/80", secondary: - "bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent", + "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", destructive: - "bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent", + "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80", }, }, defaultVariants: { diff --git a/packages/ui/src/components/button.tsx b/packages/ui/src/components/button.tsx index c041008..71a3c31 100644 --- a/packages/ui/src/components/button.tsx +++ b/packages/ui/src/components/button.tsx @@ -6,7 +6,7 @@ import { cva } from "class-variance-authority"; import { cn } from "@commune-ts/ui"; const buttonVariants = cva( - "focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap text-sm font-medium backdrop-blur-md transition-colors focus-visible:outline-none focus-visible:ring-1 disabled:pointer-events-none disabled:opacity-50", + "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium backdrop-blur-md transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", { variants: { variant: { diff --git a/packages/ui/src/components/card.tsx b/packages/ui/src/components/card.tsx index b09bf8f..d36466c 100644 --- a/packages/ui/src/components/card.tsx +++ b/packages/ui/src/components/card.tsx @@ -8,7 +8,7 @@ const Card = React.forwardRef< >(({ className, ...props }, ref) => (
)); @@ -47,7 +47,7 @@ const CardDescription = React.forwardRef< >(({ className, ...props }, ref) => (

)); diff --git a/packages/ui/src/components/checkbox.tsx b/packages/ui/src/components/checkbox.tsx index 8abd65c..7821504 100644 --- a/packages/ui/src/components/checkbox.tsx +++ b/packages/ui/src/components/checkbox.tsx @@ -13,7 +13,7 @@ const Checkbox = React.forwardRef< {children} - + Close @@ -102,7 +102,7 @@ const DialogDescription = React.forwardRef< >(({ className, ...props }, ref) => ( )); diff --git a/packages/ui/src/components/dropdown-menu.tsx b/packages/ui/src/components/dropdown-menu.tsx index b62b70d..1d5d417 100644 --- a/packages/ui/src/components/dropdown-menu.tsx +++ b/packages/ui/src/components/dropdown-menu.tsx @@ -31,7 +31,7 @@ const DropdownMenuSubTrigger = React.forwardRef< (({ className, ...props }, ref) => ( )); diff --git a/packages/ui/src/components/hover-card.tsx b/packages/ui/src/components/hover-card.tsx index a5c42d5..78ed4a9 100644 --- a/packages/ui/src/components/hover-card.tsx +++ b/packages/ui/src/components/hover-card.tsx @@ -18,7 +18,7 @@ const HoverCardContent = React.forwardRef< align={align} sideOffset={sideOffset} className={cn( - "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 border border-white/20 p-4 shadow-md outline-none", + "z-50 w-64 border border-white/20 bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className, )} {...props} diff --git a/packages/ui/src/components/input.tsx b/packages/ui/src/components/input.tsx index 5bf07e7..4fb1f69 100644 --- a/packages/ui/src/components/input.tsx +++ b/packages/ui/src/components/input.tsx @@ -10,7 +10,7 @@ const Input = React.forwardRef( span]:line-clamp-1", + "flex h-9 w-full items-center justify-between whitespace-nowrap border border-input border-white/20 bg-background px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className, )} {...props} @@ -80,7 +80,7 @@ const SelectContent = React.forwardRef< (({ className, ...props }, ref) => ( ));