|
1 |
| -import * as React from "react" |
2 |
| -import { Slot } from "@radix-ui/react-slot" |
3 |
| -import { cva, type VariantProps } from "class-variance-authority" |
4 |
| - |
5 |
| -import { cn } from "@/lib/utils" |
| 1 | +import * as React from "react"; |
| 2 | +import { Slot } from "@radix-ui/react-slot"; |
| 3 | +import { cva, type VariantProps } from "class-variance-authority"; |
| 4 | +import { cn } from "@/lib/utils"; |
6 | 5 |
|
7 | 6 | const buttonVariants = cva(
|
8 |
| - "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", |
| 7 | + "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-zinc-950 disabled:pointer-events-none disabled:opacity-50 dark:focus-visible:ring-zinc-300 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", |
9 | 8 | {
|
10 | 9 | variants: {
|
11 | 10 | variant: {
|
12 | 11 | default:
|
13 |
| - "bg-primary text-primary-foreground shadow hover:bg-primary/90", |
| 12 | + "border border-transparent bg-zinc-900 text-zinc-50 shadow hover:bg-zinc-900/90 dark:bg-zinc-50 dark:text-zinc-900 dark:hover:bg-zinc-50/90", |
14 | 13 | destructive:
|
15 |
| - "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90", |
| 14 | + "bg-red-500 text-zinc-50 shadow-sm hover:bg-red-500/90 dark:bg-red-900 dark:text-zinc-50 dark:hover:bg-red-900/90", |
| 15 | + "destructive-outline": |
| 16 | + "border border-red-200 bg-white shadow-sm hover:bg-red-100 hover:text-red-900 dark:border-red-800 dark:bg-red-950 dark:hover:bg-red-800 dark:hover:text-red-50", |
16 | 17 | outline:
|
17 |
| - "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground", |
| 18 | + "border border-zinc-200 bg-white shadow-sm hover:bg-zinc-100 hover:text-zinc-900 dark:border-zinc-800 dark:bg-zinc-950 dark:hover:bg-zinc-800 dark:hover:text-zinc-50", |
18 | 19 | secondary:
|
19 |
| - "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80", |
20 |
| - ghost: "hover:bg-accent hover:text-accent-foreground", |
21 |
| - link: "text-primary underline-offset-4 hover:underline", |
| 20 | + "bg-zinc-100 text-zinc-900 shadow-sm hover:bg-zinc-100/80 dark:bg-zinc-800 dark:text-zinc-50 dark:hover:bg-zinc-800/80", |
| 21 | + ghost: |
| 22 | + "hover:bg-zinc-100 hover:text-zinc-900 dark:hover:bg-zinc-800 dark:hover:text-zinc-50", |
| 23 | + link: "text-zinc-900 underline-offset-4 hover:underline dark:text-zinc-50", |
22 | 24 | },
|
23 | 25 | size: {
|
24 |
| - default: "h-9 px-4 py-2", |
| 26 | + default: "h-9 rounded-xl px-4 py-2", |
25 | 27 | sm: "h-8 rounded-md px-3 text-xs",
|
26 | 28 | lg: "h-10 rounded-md px-8",
|
27 |
| - icon: "h-9 w-9", |
| 29 | + icon: "h-9 w-9 rounded-md", |
28 | 30 | },
|
29 | 31 | },
|
30 | 32 | defaultVariants: {
|
31 | 33 | variant: "default",
|
32 | 34 | size: "default",
|
33 | 35 | },
|
34 | 36 | }
|
35 |
| -) |
| 37 | +); |
36 | 38 |
|
37 | 39 | export interface ButtonProps
|
38 | 40 | extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
39 | 41 | VariantProps<typeof buttonVariants> {
|
40 |
| - asChild?: boolean |
| 42 | + asChild?: boolean; |
41 | 43 | }
|
42 | 44 |
|
43 | 45 | const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
44 | 46 | ({ className, variant, size, asChild = false, ...props }, ref) => {
|
45 |
| - const Comp = asChild ? Slot : "button" |
| 47 | + const Comp = asChild ? Slot : "button"; |
46 | 48 | return (
|
47 | 49 | <Comp
|
48 | 50 | className={cn(buttonVariants({ variant, size, className }))}
|
49 | 51 | ref={ref}
|
50 | 52 | {...props}
|
51 | 53 | />
|
52 |
| - ) |
| 54 | + ); |
53 | 55 | }
|
54 |
| -) |
55 |
| -Button.displayName = "Button" |
| 56 | +); |
| 57 | +Button.displayName = "Button"; |
56 | 58 |
|
57 |
| -export { Button, buttonVariants } |
| 59 | +export { Button, buttonVariants }; |
0 commit comments