From 63cff406650909f576ba977714597260be998235 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Thu, 18 Sep 2025 17:18:51 -0300 Subject: [PATCH] changed ui elements, added separator --- frontend/components/ui/button.tsx | 42 +++++++++++++++++++++------- frontend/components/ui/card.tsx | 2 +- frontend/components/ui/separator.tsx | 31 ++++++++++++++++++++ 3 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 frontend/components/ui/separator.tsx diff --git a/frontend/components/ui/button.tsx b/frontend/components/ui/button.tsx index 87cb5c62..5d8b3287 100644 --- a/frontend/components/ui/button.tsx +++ b/frontend/components/ui/button.tsx @@ -8,13 +8,20 @@ const buttonVariants = cva( variants: { variant: { default: "bg-primary text-primary-foreground hover:bg-primary-hover", - destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90", - outline: "border border-input hover:bg-input hover:text-accent-foreground", - primary: "border bg-background text-secondary-foreground hover:bg-muted hover:shadow-sm", - warning: "bg-warning-foreground text-warning-text hover:bg-warning-foreground/90 hover:shadow-sm", - secondary: "border border-muted bg-muted text-secondary-foreground hover:bg-secondary-foreground/5", - ghost: "text-foreground hover:bg-accent hover:text-accent-foreground disabled:!bg-transparent", - ghostActive: "bg-muted text-foreground hover:bg-secondary-hover hover:text-accent-foreground", + destructive: + "bg-destructive text-destructive-foreground hover:bg-destructive/90", + outline: + "border border-input hover:bg-muted hover:text-accent-foreground", + primary: + "border bg-background text-secondary-foreground hover:bg-muted hover:shadow-sm", + warning: + "bg-warning-foreground text-warning-text hover:bg-warning-foreground/90 hover:shadow-sm", + secondary: + "border border-muted bg-muted text-secondary-foreground hover:bg-secondary-foreground/5", + ghost: + "text-foreground hover:bg-accent hover:text-accent-foreground disabled:!bg-transparent", + ghostActive: + "bg-muted text-foreground hover:bg-secondary-hover hover:text-accent-foreground", link: "underline-offset-4 hover:underline text-primary", }, size: { @@ -38,7 +45,9 @@ const buttonVariants = cva( function toTitleCase(text: string) { return text ?.split(" ") - ?.map((word) => word?.charAt(0)?.toUpperCase() + word?.slice(1)?.toLowerCase()) + ?.map( + (word) => word?.charAt(0)?.toUpperCase() + word?.slice(1)?.toLowerCase(), + ) ?.join(" "); } @@ -51,7 +60,20 @@ export interface ButtonProps } const Button = React.forwardRef( - ({ className, variant, size, loading, disabled, asChild = false, children, ignoreTitleCase = false, ...props }, ref) => { + ( + { + className, + variant, + size, + loading, + disabled, + asChild = false, + children, + ignoreTitleCase = false, + ...props + }, + ref, + ) => { const Comp = asChild ? Slot : "button"; let newChildren = children; if (typeof children === "string") { @@ -79,7 +101,7 @@ const Button = React.forwardRef( )} ); - } + }, ); Button.displayName = "Button"; diff --git a/frontend/components/ui/card.tsx b/frontend/components/ui/card.tsx index 210e2f19..b9bacd0d 100644 --- a/frontend/components/ui/card.tsx +++ b/frontend/components/ui/card.tsx @@ -64,7 +64,7 @@ const CardFooter = React.forwardRef< >(({ className, ...props }, ref) => (
)); diff --git a/frontend/components/ui/separator.tsx b/frontend/components/ui/separator.tsx new file mode 100644 index 00000000..3cc446d2 --- /dev/null +++ b/frontend/components/ui/separator.tsx @@ -0,0 +1,31 @@ +"use client"; + +import * as SeparatorPrimitive from "@radix-ui/react-separator"; +import * as React from "react"; + +import { cn } from "@/lib/utils"; + +const Separator = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>( + ( + { className, orientation = "horizontal", decorative = true, ...props }, + ref, + ) => ( + + ), +); +Separator.displayName = SeparatorPrimitive.Root.displayName; + +export { Separator };