@@ -2,42 +2,42 @@ import { ButtonHTMLAttributes, ReactNode } from "react";
22import { SequenceType } from "../types/sequence" ;
33
44interface ButtonProps extends ButtonHTMLAttributes < HTMLButtonElement > {
5- children : ReactNode ;
6- variant ?: "primary" | "secondary" | SequenceType ;
7- fullWidth ?: boolean ;
5+ children : ReactNode ;
6+ variant ?: "primary" | "secondary" | SequenceType ;
7+ fullWidth ?: boolean ;
88}
99
1010export default function Button ( {
11- children,
12- variant = "primary" ,
13- fullWidth = false ,
14- className = "" ,
15- ...props
11+ children,
12+ variant = "primary" ,
13+ fullWidth = false ,
14+ className = "" ,
15+ ...props
1616} : ButtonProps ) {
17- const baseStyles =
18- "px-6 py-3 rounded-lg font-medium transition-all duration-300 transform hover:scale-105 active:scale-95 shadow-lg" ;
17+ const baseStyles =
18+ "px-6 py-3 rounded-lg font-medium transition-all duration-300 transform hover:scale-[1.02] active:scale-[0.98] shadow-lg disabled:opacity-50 disabled:cursor-not-allowed focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-background " ;
1919
20- const variantStyles : Record < string , string > = {
21- primary :
22- "bg-gradient-to-r from-orange-400 to-orange-600 hover:from-orange-500 hover:to-orange-700 text-white " ,
23- secondary :
24- "bg-gradient-to-r from-gray-500 to-gray-700 hover:from-gray-600 hover:to-gray-800 text-white " ,
25- arithmetic :
26- "bg-gradient-to-r from-blue-400 to-blue-600 hover:from-blue-500 hover:to-blue-700 text-white " ,
27- geometric :
28- "bg-gradient-to-r from-purple-400 to-purple-600 hover:from-purple-500 hover:to-purple-700 text-white " ,
29- alphabet :
30- "bg-gradient-to-r from-green-400 to-green-600 hover:from-green-500 hover:to-green-700 text-white " ,
31- } ;
20+ const variantStyles : Record < string , string > = {
21+ primary :
22+ "bg-primary text-primary-foreground hover:brightness-110 focus:ring-primary " ,
23+ secondary :
24+ "bg-secondary text-secondary-foreground hover:bg-secondary/80 focus:ring-secondary " ,
25+ arithmetic :
26+ "bg-seq-arithmetic text-white hover:brightness-110 focus:ring-seq-arithmetic " ,
27+ geometric :
28+ "bg-seq-geometric text-white hover:brightness-110 focus:ring-seq-geometric " ,
29+ alphabet :
30+ "bg-seq-alphabet text-white hover:brightness-110 focus:ring-seq-alphabet " ,
31+ } ;
3232
33- const widthStyles = fullWidth ? "w-full" : "w-auto" ;
33+ const widthStyles = fullWidth ? "w-full" : "w-auto" ;
3434
35- return (
36- < button
37- className = { `${ baseStyles } ${ variantStyles [ variant ] } ${ widthStyles } ${ className } ` }
38- { ...props }
39- >
40- { children }
41- </ button >
42- ) ;
35+ return (
36+ < button
37+ className = { `${ baseStyles } ${ variantStyles [ variant ] } ${ widthStyles } ${ className } ` }
38+ { ...props }
39+ >
40+ { children }
41+ </ button >
42+ ) ;
4343}
0 commit comments