@@ -47,51 +47,97 @@ function Button({ children, asChild, ...props }: BitButtonProps) {
4747 < ShadcnButton
4848 { ...props }
4949 className = { cn (
50- "rounded-none active:translate-y-1 transition-transform relative inline-flex items-center justify-center" ,
50+ "rounded-none active:translate-y-1 transition-transform relative inline-flex items-center justify-center gap-1.5 " ,
5151 font !== "normal" && "retro" ,
5252 className
5353 ) }
5454 size = { size }
5555 variant = { variant }
5656 asChild = { asChild }
5757 >
58- { children }
58+ { asChild ? (
59+ < span className = "relative inline-flex items-center justify-center gap-1.5" >
60+ { children }
5961
60- { variant !== "ghost" && variant !== "link" && size !== "icon" && (
61- < >
62- { /* Pixelated border */ }
63- < div className = "absolute -top-1.5 w-1/2 left-1.5 h-1.5 bg-foreground dark:bg-ring" />
64- < div className = "absolute -top-1.5 w-1/2 right-1.5 h-1.5 bg-foreground dark:bg-ring" />
65- < div className = "absolute -bottom-1.5 w-1/2 left-1.5 h-1.5 bg-foreground dark:bg-ring" />
66- < div className = "absolute -bottom-1.5 w-1/2 right-1.5 h-1.5 bg-foreground dark:bg-ring" />
67- < div className = "absolute top-0 left-0 size-1.5 bg-foreground dark:bg-ring" />
68- < div className = "absolute top-0 right-0 size-1.5 bg-foreground dark:bg-ring" />
69- < div className = "absolute bottom-0 left-0 size-1.5 bg-foreground dark:bg-ring" />
70- < div className = "absolute bottom-0 right-0 size-1.5 bg-foreground dark:bg-ring" />
71- < div className = "absolute top-1.5 -left-1.5 h-2/3 w-1.5 bg-foreground dark:bg-ring" />
72- < div className = "absolute top-1.5 -right-1.5 h-2/3 w-1.5 bg-foreground dark:bg-ring" />
73- { variant !== "outline" && (
62+ { variant !== "ghost" && variant !== "link" && size !== "icon" && (
7463 < >
75- { /* Top shadow */ }
76- < div className = "absolute top-0 left-0 w-full h-1.5 bg-foreground/20" />
77- < div className = "absolute top-1.5 left-0 w-3 h-1.5 bg-foreground/20" />
64+ { /* Pixelated border */ }
65+ < div className = "absolute -top-1.5 w-1/2 left-1.5 h-1.5 bg-foreground dark:bg-ring" />
66+ < div className = "absolute -top-1.5 w-1/2 right-1.5 h-1.5 bg-foreground dark:bg-ring" />
67+ < div className = "absolute -bottom-1.5 w-1/2 left-1.5 h-1.5 bg-foreground dark:bg-ring" />
68+ < div className = "absolute -bottom-1.5 w-1/2 right-1.5 h-1.5 bg-foreground dark:bg-ring" />
69+ < div className = "absolute top-0 left-0 size-1.5 bg-foreground dark:bg-ring" />
70+ < div className = "absolute top-0 right-0 size-1.5 bg-foreground dark:bg-ring" />
71+ < div className = "absolute bottom-0 left-0 size-1.5 bg-foreground dark:bg-ring" />
72+ < div className = "absolute bottom-0 right-0 size-1.5 bg-foreground dark:bg-ring" />
73+ < div className = "absolute top-1.5 -left-1.5 h-2/3 w-1.5 bg-foreground dark:bg-ring" />
74+ < div className = "absolute top-1.5 -right-1.5 h-2/3 w-1.5 bg-foreground dark:bg-ring" />
75+ { variant !== "outline" && (
76+ < >
77+ { /* Top shadow */ }
78+ < div className = "absolute top-0 left-0 w-full h-1.5 bg-foreground/20" />
79+ < div className = "absolute top-1.5 left-0 w-3 h-1.5 bg-foreground/20" />
7880
79- { /* Bottom shadow */ }
80- < div className = "absolute bottom-0 left-0 w-full h-1.5 bg-foreground/20" />
81- < div className = "absolute bottom-1.5 right-0 w-3 h-1.5 bg-foreground/20" />
81+ { /* Bottom shadow */ }
82+ < div className = "absolute bottom-0 left-0 w-full h-1.5 bg-foreground/20" />
83+ < div className = "absolute bottom-1.5 right-0 w-3 h-1.5 bg-foreground/20" />
84+ </ >
85+ ) }
8286 </ >
8387 ) }
84- </ >
85- ) }
8688
87- { size === "icon" && (
89+ { size === "icon" && (
90+ < >
91+ < div className = "absolute top-0 left-0 w-full h-[5px] md:h-1.5 bg-foreground dark:bg-ring pointer-events-none" />
92+ < div className = "absolute bottom-0 w-full h-[5px] md:h-1.5 bg-foreground dark:bg-ring pointer-events-none" />
93+ < div className = "absolute top-1 -left-1 w-[5px] md:w-1.5 h-1/2 bg-foreground dark:bg-ring pointer-events-none" />
94+ < div className = "absolute bottom-1 -left-1 w-[5px] md:w-1.5 h-1/2 bg-foreground dark:bg-ring pointer-events-none" />
95+ < div className = "absolute top-1 -right-1 w-[5px] md:w-1.5 h-1/2 bg-foreground dark:bg-ring pointer-events-none" />
96+ < div className = "absolute bottom-1 -right-1 w-[5px] md:w-1.5 h-1/2 bg-foreground dark:bg-ring pointer-events-none" />
97+ </ >
98+ ) }
99+ </ span >
100+ ) : (
88101 < >
89- < div className = "absolute top-0 left-0 w-full h-[5px] md:h-1.5 bg-foreground dark:bg-ring pointer-events-none" />
90- < div className = "absolute bottom-0 w-full h-[5px] md:h-1.5 bg-foreground dark:bg-ring pointer-events-none" />
91- < div className = "absolute top-1 -left-1 w-[5px] md:w-1.5 h-1/2 bg-foreground dark:bg-ring pointer-events-none" />
92- < div className = "absolute bottom-1 -left-1 w-[5px] md:w-1.5 h-1/2 bg-foreground dark:bg-ring pointer-events-none" />
93- < div className = "absolute top-1 -right-1 w-[5px] md:w-1.5 h-1/2 bg-foreground dark:bg-ring pointer-events-none" />
94- < div className = "absolute bottom-1 -right-1 w-[5px] md:w-1.5 h-1/2 bg-foreground dark:bg-ring pointer-events-none" />
102+ { children }
103+
104+ { variant !== "ghost" && variant !== "link" && size !== "icon" && (
105+ < >
106+ { /* Pixelated border */ }
107+ < div className = "absolute -top-1.5 w-1/2 left-1.5 h-1.5 bg-foreground dark:bg-ring" />
108+ < div className = "absolute -top-1.5 w-1/2 right-1.5 h-1.5 bg-foreground dark:bg-ring" />
109+ < div className = "absolute -bottom-1.5 w-1/2 left-1.5 h-1.5 bg-foreground dark:bg-ring" />
110+ < div className = "absolute -bottom-1.5 w-1/2 right-1.5 h-1.5 bg-foreground dark:bg-ring" />
111+ < div className = "absolute top-0 left-0 size-1.5 bg-foreground dark:bg-ring" />
112+ < div className = "absolute top-0 right-0 size-1.5 bg-foreground dark:bg-ring" />
113+ < div className = "absolute bottom-0 left-0 size-1.5 bg-foreground dark:bg-ring" />
114+ < div className = "absolute bottom-0 right-0 size-1.5 bg-foreground dark:bg-ring" />
115+ < div className = "absolute top-1.5 -left-1.5 h-2/3 w-1.5 bg-foreground dark:bg-ring" />
116+ < div className = "absolute top-1.5 -right-1.5 h-2/3 w-1.5 bg-foreground dark:bg-ring" />
117+ { variant !== "outline" && (
118+ < >
119+ { /* Top shadow */ }
120+ < div className = "absolute top-0 left-0 w-full h-1.5 bg-foreground/20" />
121+ < div className = "absolute top-1.5 left-0 w-3 h-1.5 bg-foreground/20" />
122+
123+ { /* Bottom shadow */ }
124+ < div className = "absolute bottom-0 left-0 w-full h-1.5 bg-foreground/20" />
125+ < div className = "absolute bottom-1.5 right-0 w-3 h-1.5 bg-foreground/20" />
126+ </ >
127+ ) }
128+ </ >
129+ ) }
130+
131+ { size === "icon" && (
132+ < >
133+ < div className = "absolute top-0 left-0 w-full h-[5px] md:h-1.5 bg-foreground dark:bg-ring pointer-events-none" />
134+ < div className = "absolute bottom-0 w-full h-[5px] md:h-1.5 bg-foreground dark:bg-ring pointer-events-none" />
135+ < div className = "absolute top-1 -left-1 w-[5px] md:w-1.5 h-1/2 bg-foreground dark:bg-ring pointer-events-none" />
136+ < div className = "absolute bottom-1 -left-1 w-[5px] md:w-1.5 h-1/2 bg-foreground dark:bg-ring pointer-events-none" />
137+ < div className = "absolute top-1 -right-1 w-[5px] md:w-1.5 h-1/2 bg-foreground dark:bg-ring pointer-events-none" />
138+ < div className = "absolute bottom-1 -right-1 w-[5px] md:w-1.5 h-1/2 bg-foreground dark:bg-ring pointer-events-none" />
139+ </ >
140+ ) }
95141 </ >
96142 ) }
97143 </ ShadcnButton >
0 commit comments