From 6c7a62a8a422e3144aeaed04ef5efa0ae28f36d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20N=2EO=2E=20N=C3=B8rgaard=20Henriksen?= <1136718+raix@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:01:13 +0200 Subject: [PATCH] Update button variant "icon" --- docs/components/buttons/button.mdx | 2 +- ui/components/Button.tsx | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/components/buttons/button.mdx b/docs/components/buttons/button.mdx index 0697e8f..907add8 100644 --- a/docs/components/buttons/button.mdx +++ b/docs/components/buttons/button.mdx @@ -127,7 +127,7 @@ import { ChevronLeft } from "lucide-react"; export default function Example() { return ( - ); diff --git a/ui/components/Button.tsx b/ui/components/Button.tsx index c422c9a..aecfd09 100644 --- a/ui/components/Button.tsx +++ b/ui/components/Button.tsx @@ -29,8 +29,7 @@ const button = tv({ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 pressed:bg-destructive/80", outline: "border border-input hover:bg-accent hover:text-accent-foreground pressed:bg-accent/80", ghost: "hover:bg-accent hover:text-accent-foreground pressed:bg-accent/80", - link: "text-primary underline-offset-4 hover:underline pressed:text-primary/80", - icon: "h-10 w-10 border border-input hover:bg-accent hover:text-accent-foreground pressed:bg-accent/80" + link: "text-primary underline-offset-4 hover:underline pressed:text-primary/80" }, size: { xs: "h-6 w-6", @@ -56,8 +55,8 @@ export function Button({ className, variant, size, ...props }: Readonly button({ ...renderProps, - size, - variant, + size: variant === "icon" ? "icon" : size, + variant: variant === "icon" ? "outline" : variant, className }) )}