@grupor5/raya 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -4
- package/dist/atoms/avatar/index.d.mts +12 -0
- package/dist/atoms/avatar/index.d.ts +12 -0
- package/dist/atoms/avatar/index.js +99 -0
- package/dist/atoms/avatar/index.mjs +76 -0
- package/dist/atoms/badge/index.d.mts +16 -0
- package/dist/atoms/badge/index.d.ts +16 -0
- package/dist/atoms/badge/index.js +149 -0
- package/dist/atoms/badge/index.mjs +146 -0
- package/dist/atoms/button/index.d.mts +11 -0
- package/dist/atoms/button/index.d.ts +11 -0
- package/dist/atoms/button/index.js +307 -0
- package/dist/atoms/button/index.mjs +301 -0
- package/dist/atoms/checkbox/index.d.mts +6 -0
- package/dist/atoms/checkbox/index.d.ts +6 -0
- package/dist/atoms/checkbox/index.js +98 -0
- package/dist/atoms/checkbox/index.mjs +75 -0
- package/dist/atoms/input/index.d.mts +12 -0
- package/dist/atoms/input/index.d.ts +12 -0
- package/dist/atoms/input/index.js +104 -0
- package/dist/atoms/input/index.mjs +82 -0
- package/dist/atoms/label/index.d.mts +8 -0
- package/dist/atoms/label/index.d.ts +8 -0
- package/dist/atoms/label/index.js +77 -0
- package/dist/atoms/label/index.mjs +54 -0
- package/dist/atoms/radio/index.d.mts +7 -0
- package/dist/atoms/radio/index.d.ts +7 -0
- package/dist/atoms/radio/index.js +97 -0
- package/dist/atoms/radio/index.mjs +73 -0
- package/dist/atoms/switch/index.d.mts +6 -0
- package/dist/atoms/switch/index.d.ts +6 -0
- package/dist/atoms/switch/index.js +97 -0
- package/dist/atoms/switch/index.mjs +74 -0
- package/dist/atoms/tag/index.d.mts +14 -0
- package/dist/atoms/tag/index.d.ts +14 -0
- package/dist/atoms/tag/index.js +128 -0
- package/dist/atoms/tag/index.mjs +122 -0
- package/dist/atoms/textarea/index.d.mts +11 -0
- package/dist/atoms/textarea/index.d.ts +11 -0
- package/dist/atoms/textarea/index.js +125 -0
- package/dist/atoms/textarea/index.mjs +103 -0
- package/dist/atoms/typography/index.d.mts +20 -0
- package/dist/atoms/typography/index.d.ts +20 -0
- package/dist/atoms/typography/index.js +140 -0
- package/dist/atoms/typography/index.mjs +115 -0
- package/dist/hooks/index.d.mts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +17 -0
- package/dist/hooks/index.mjs +15 -0
- package/dist/hooks/use-pagination.d.mts +10 -0
- package/dist/hooks/use-pagination.d.ts +10 -0
- package/dist/hooks/use-pagination.js +54 -0
- package/dist/hooks/use-pagination.mjs +51 -0
- package/dist/hooks/use-toast.d.mts +2 -0
- package/dist/hooks/use-toast.d.ts +2 -0
- package/dist/hooks/use-toast.js +2 -0
- package/dist/hooks/use-toast.mjs +1 -0
- package/dist/hooks/useModal.d.mts +7 -0
- package/dist/hooks/useModal.d.ts +7 -0
- package/dist/hooks/useModal.js +17 -0
- package/dist/hooks/useModal.mjs +15 -0
- package/dist/index.d.mts +50 -1298
- package/dist/index.d.ts +50 -1298
- package/dist/molecules/accordion/index.d.mts +17 -0
- package/dist/molecules/accordion/index.d.ts +17 -0
- package/dist/molecules/accordion/index.js +154 -0
- package/dist/molecules/accordion/index.mjs +128 -0
- package/dist/molecules/alert/index.d.mts +14 -0
- package/dist/molecules/alert/index.d.ts +14 -0
- package/dist/molecules/alert/index.js +425 -0
- package/dist/molecules/alert/index.mjs +402 -0
- package/dist/molecules/card/index.d.mts +10 -0
- package/dist/molecules/card/index.d.ts +10 -0
- package/dist/molecules/card/index.js +128 -0
- package/dist/molecules/card/index.mjs +101 -0
- package/dist/molecules/chart/index.d.mts +80 -0
- package/dist/molecules/chart/index.d.ts +80 -0
- package/dist/molecules/chart/index.js +300 -0
- package/dist/molecules/chart/index.mjs +272 -0
- package/dist/molecules/data-table/index.d.mts +57 -0
- package/dist/molecules/data-table/index.d.ts +57 -0
- package/dist/molecules/data-table/index.js +1456 -0
- package/dist/molecules/data-table/index.mjs +1430 -0
- package/dist/molecules/date-picker/index.d.mts +12 -0
- package/dist/molecules/date-picker/index.d.ts +12 -0
- package/dist/molecules/date-picker/index.js +756 -0
- package/dist/molecules/date-picker/index.mjs +734 -0
- package/dist/molecules/dropdown/index.d.mts +21 -0
- package/dist/molecules/dropdown/index.d.ts +21 -0
- package/dist/molecules/dropdown/index.js +221 -0
- package/dist/molecules/dropdown/index.mjs +198 -0
- package/dist/molecules/form/index.d.mts +19 -0
- package/dist/molecules/form/index.d.ts +19 -0
- package/dist/molecules/form/index.js +139 -0
- package/dist/molecules/form/index.mjs +114 -0
- package/dist/molecules/pagination/index.d.mts +15 -0
- package/dist/molecules/pagination/index.d.ts +15 -0
- package/dist/molecules/pagination/index.js +605 -0
- package/dist/molecules/pagination/index.mjs +583 -0
- package/dist/molecules/progress-bar/index.d.mts +15 -0
- package/dist/molecules/progress-bar/index.d.ts +15 -0
- package/dist/molecules/progress-bar/index.js +166 -0
- package/dist/molecules/progress-bar/index.mjs +144 -0
- package/dist/molecules/select/index.d.mts +15 -0
- package/dist/molecules/select/index.d.ts +15 -0
- package/dist/molecules/select/index.js +201 -0
- package/dist/molecules/select/index.mjs +169 -0
- package/dist/molecules/stepper/index.d.mts +67 -0
- package/dist/molecules/stepper/index.d.ts +67 -0
- package/dist/molecules/stepper/index.js +287 -0
- package/dist/molecules/stepper/index.mjs +260 -0
- package/dist/molecules/tabs/index.d.mts +9 -0
- package/dist/molecules/tabs/index.d.ts +9 -0
- package/dist/molecules/tabs/index.js +112 -0
- package/dist/molecules/tabs/index.mjs +86 -0
- package/dist/tokens/badge.d.mts +39 -0
- package/dist/tokens/badge.d.ts +39 -0
- package/dist/tokens/badge.js +61 -0
- package/dist/tokens/badge.mjs +59 -0
- package/dist/tokens/buttons.d.mts +277 -0
- package/dist/tokens/buttons.d.ts +277 -0
- package/dist/tokens/buttons.js +191 -0
- package/dist/tokens/buttons.mjs +173 -0
- package/dist/tokens/colors.d.mts +65 -0
- package/dist/tokens/colors.d.ts +65 -0
- package/dist/tokens/colors.js +68 -0
- package/dist/tokens/colors.mjs +66 -0
- package/dist/tokens/effects.d.mts +124 -0
- package/dist/tokens/effects.d.ts +124 -0
- package/dist/tokens/effects.js +130 -0
- package/dist/tokens/effects.mjs +115 -0
- package/dist/tokens/grids.d.mts +331 -0
- package/dist/tokens/grids.d.ts +331 -0
- package/dist/tokens/grids.js +305 -0
- package/dist/tokens/grids.mjs +292 -0
- package/dist/tokens/icons.d.mts +134 -0
- package/dist/tokens/icons.d.ts +134 -0
- package/dist/tokens/icons.js +108 -0
- package/dist/tokens/icons.mjs +97 -0
- package/dist/tokens/index.d.mts +6 -0
- package/dist/tokens/index.d.ts +6 -0
- package/dist/tokens/index.js +775 -0
- package/dist/tokens/index.mjs +743 -0
- package/dist/tokens/progress-bar.d.mts +31 -0
- package/dist/tokens/progress-bar.d.ts +31 -0
- package/dist/tokens/progress-bar.js +70 -0
- package/dist/tokens/progress-bar.mjs +68 -0
- package/dist/tokens/spacing.d.mts +90 -0
- package/dist/tokens/spacing.d.ts +90 -0
- package/dist/tokens/spacing.js +120 -0
- package/dist/tokens/spacing.mjs +109 -0
- package/dist/tokens/stroke.d.mts +292 -0
- package/dist/tokens/stroke.d.ts +292 -0
- package/dist/tokens/stroke.js +202 -0
- package/dist/tokens/stroke.mjs +186 -0
- package/dist/tokens/tab.d.mts +31 -0
- package/dist/tokens/tab.d.ts +31 -0
- package/dist/tokens/tab.js +48 -0
- package/dist/tokens/tab.mjs +46 -0
- package/dist/tokens/tag.d.mts +53 -0
- package/dist/tokens/tag.d.ts +53 -0
- package/dist/tokens/tag.js +80 -0
- package/dist/tokens/tag.mjs +78 -0
- package/dist/tokens/typography.d.mts +394 -0
- package/dist/tokens/typography.d.ts +394 -0
- package/dist/tokens/typography.js +302 -0
- package/dist/tokens/typography.mjs +292 -0
- package/dist/utils/classNames.d.mts +3 -0
- package/dist/utils/classNames.d.ts +3 -0
- package/dist/utils/classNames.js +8 -0
- package/dist/utils/classNames.mjs +6 -0
- package/dist/utils/cn.d.mts +5 -0
- package/dist/utils/cn.d.ts +5 -0
- package/dist/utils/cn.js +11 -0
- package/dist/utils/cn.mjs +9 -0
- package/dist/utils/index.d.mts +3 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +15 -0
- package/dist/utils/index.mjs +12 -0
- package/package.json +34 -1
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Button Design Tokens - Raya Design System
|
|
3
|
+
*
|
|
4
|
+
* Defines the button system tokens including sizes, variants, colors, and states
|
|
5
|
+
* for consistent button usage across the design system.
|
|
6
|
+
*/
|
|
7
|
+
declare const buttonSizes: {
|
|
8
|
+
readonly sm: {
|
|
9
|
+
readonly height: "32px";
|
|
10
|
+
readonly paddingX: "8px";
|
|
11
|
+
readonly paddingY: "4px";
|
|
12
|
+
readonly fontSize: "14px";
|
|
13
|
+
readonly iconSize: "16px";
|
|
14
|
+
readonly borderRadius: "10px";
|
|
15
|
+
};
|
|
16
|
+
readonly md: {
|
|
17
|
+
readonly height: "40px";
|
|
18
|
+
readonly paddingX: "16px";
|
|
19
|
+
readonly paddingY: "8px";
|
|
20
|
+
readonly fontSize: "16px";
|
|
21
|
+
readonly iconSize: "20px";
|
|
22
|
+
readonly borderRadius: "12px";
|
|
23
|
+
};
|
|
24
|
+
readonly lg: {
|
|
25
|
+
readonly height: "48px";
|
|
26
|
+
readonly paddingX: "24px";
|
|
27
|
+
readonly paddingY: "12px";
|
|
28
|
+
readonly fontSize: "18px";
|
|
29
|
+
readonly iconSize: "24px";
|
|
30
|
+
readonly borderRadius: "16px";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
declare const buttonSizeClasses: {
|
|
34
|
+
readonly sm: {
|
|
35
|
+
readonly base: "h-8 px-2 py-1 text-sm rounded-[10px]";
|
|
36
|
+
readonly icon: "h-8 w-8 rounded-[10px]";
|
|
37
|
+
readonly iconSize: "w-4 h-4";
|
|
38
|
+
};
|
|
39
|
+
readonly md: {
|
|
40
|
+
readonly base: "h-10 px-4 py-2 text-base rounded-xl";
|
|
41
|
+
readonly icon: "h-10 w-10 rounded-xl";
|
|
42
|
+
readonly iconSize: "w-5 h-5";
|
|
43
|
+
};
|
|
44
|
+
readonly lg: {
|
|
45
|
+
readonly base: "h-12 px-6 py-3 text-lg rounded-2xl";
|
|
46
|
+
readonly icon: "h-12 w-12 rounded-2xl";
|
|
47
|
+
readonly iconSize: "w-[22px] h-[22px]";
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
declare const buttonVariants: {
|
|
51
|
+
readonly primary: "filled";
|
|
52
|
+
readonly secondary: "outlined";
|
|
53
|
+
readonly ghost: "text-only";
|
|
54
|
+
readonly icon: "icon-only";
|
|
55
|
+
};
|
|
56
|
+
declare const buttonColors: {
|
|
57
|
+
readonly primary: "default";
|
|
58
|
+
readonly secondary: "purple";
|
|
59
|
+
readonly success: "green";
|
|
60
|
+
readonly warning: "orange";
|
|
61
|
+
readonly destructive: "red";
|
|
62
|
+
readonly neutral: "gray";
|
|
63
|
+
};
|
|
64
|
+
declare const buttonStates: {
|
|
65
|
+
readonly default: "normal";
|
|
66
|
+
readonly hover: "highlighted";
|
|
67
|
+
readonly pressed: "active";
|
|
68
|
+
readonly disabled: "inactive";
|
|
69
|
+
readonly loading: "processing";
|
|
70
|
+
};
|
|
71
|
+
declare const buttonVariantClasses: {
|
|
72
|
+
readonly primary: {
|
|
73
|
+
readonly primary: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 active:bg-[hsl(var(--primary-pressed))] disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
74
|
+
readonly secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/90 active:bg-secondary/80 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
75
|
+
readonly success: "bg-emerald-600 text-white shadow-sm hover:bg-emerald-700 active:bg-emerald-800 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
76
|
+
readonly warning: "bg-amber-600 text-white shadow-sm hover:bg-amber-700 active:bg-amber-800 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
77
|
+
readonly destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 active:bg-destructive/80 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
78
|
+
readonly neutral: "bg-neutral-700 text-white shadow-sm hover:bg-neutral-800 active:bg-neutral-900 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
79
|
+
};
|
|
80
|
+
readonly secondary: {
|
|
81
|
+
readonly primary: "border border-primary text-primary bg-transparent hover:bg-primary/10 active:bg-primary/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
82
|
+
readonly secondary: "border border-secondary text-secondary bg-transparent hover:bg-secondary/10 active:bg-secondary/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
83
|
+
readonly success: "border border-emerald-600 text-emerald-600 bg-transparent hover:bg-emerald-50 active:bg-emerald-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
84
|
+
readonly warning: "border border-amber-600 text-amber-600 bg-transparent hover:bg-amber-50 active:bg-amber-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
85
|
+
readonly destructive: "border border-destructive text-destructive bg-transparent hover:bg-destructive/10 active:bg-destructive/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
86
|
+
readonly neutral: "border border-neutral-700 text-neutral-700 bg-transparent hover:bg-neutral-50 active:bg-neutral-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
87
|
+
};
|
|
88
|
+
readonly ghost: {
|
|
89
|
+
readonly primary: "text-primary bg-transparent hover:bg-primary/10 active:bg-primary/20 disabled:text-neutral-500 disabled:bg-transparent";
|
|
90
|
+
readonly secondary: "text-secondary bg-transparent hover:bg-secondary/10 active:bg-secondary/20 disabled:text-neutral-500 disabled:bg-transparent";
|
|
91
|
+
readonly success: "text-emerald-600 bg-transparent hover:bg-emerald-50 active:bg-emerald-100 disabled:text-neutral-500 disabled:bg-transparent";
|
|
92
|
+
readonly warning: "text-amber-600 bg-transparent hover:bg-amber-50 active:bg-amber-100 disabled:text-neutral-500 disabled:bg-transparent";
|
|
93
|
+
readonly destructive: "text-destructive bg-transparent hover:bg-destructive/10 active:bg-destructive/20 disabled:text-neutral-500 disabled:bg-transparent";
|
|
94
|
+
readonly neutral: "text-neutral-700 bg-transparent hover:bg-neutral-100 active:bg-neutral-200 disabled:text-neutral-500 disabled:bg-transparent";
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
declare const buttonBaseClasses = "inline-flex items-center justify-center gap-2 whitespace-nowrap font-regular transition-all duration-200 focus-visible:outline-none disabled:pointer-events-none disabled:cursor-not-allowed focus-visible:border-2 focus-visible:border-[--stroke-color-focus-border]";
|
|
98
|
+
declare const buttonIconClasses: {
|
|
99
|
+
readonly left: "mr-2";
|
|
100
|
+
readonly right: "ml-2";
|
|
101
|
+
readonly only: "";
|
|
102
|
+
};
|
|
103
|
+
declare const buttonLoadingClasses: {
|
|
104
|
+
readonly spinner: "animate-spin";
|
|
105
|
+
readonly container: "flex items-center justify-center gap-2";
|
|
106
|
+
readonly text: "opacity-70";
|
|
107
|
+
};
|
|
108
|
+
type ButtonSize = keyof typeof buttonSizes;
|
|
109
|
+
type ButtonVariant = keyof typeof buttonVariants;
|
|
110
|
+
type ButtonColor = keyof typeof buttonColors;
|
|
111
|
+
type ButtonState = keyof typeof buttonStates;
|
|
112
|
+
declare const getButtonSizeClasses: (size: ButtonSize, isIcon?: boolean) => string;
|
|
113
|
+
declare const getButtonVariantClasses: (variant: ButtonVariant, color: ButtonColor) => string;
|
|
114
|
+
declare const getButtonIconSize: (size: ButtonSize) => string;
|
|
115
|
+
interface ButtonProps {
|
|
116
|
+
variant?: ButtonVariant;
|
|
117
|
+
size?: ButtonSize;
|
|
118
|
+
color?: ButtonColor;
|
|
119
|
+
disabled?: boolean;
|
|
120
|
+
loading?: boolean;
|
|
121
|
+
loadingText?: string;
|
|
122
|
+
icon?: string;
|
|
123
|
+
iconLeft?: string;
|
|
124
|
+
iconRight?: string;
|
|
125
|
+
className?: string;
|
|
126
|
+
children?: React.ReactNode;
|
|
127
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
128
|
+
type?: 'button' | 'submit' | 'reset';
|
|
129
|
+
'aria-label'?: string;
|
|
130
|
+
'aria-describedby'?: string;
|
|
131
|
+
asChild?: boolean;
|
|
132
|
+
}
|
|
133
|
+
declare const defaultButtonConfig: {
|
|
134
|
+
variant: ButtonVariant;
|
|
135
|
+
size: ButtonSize;
|
|
136
|
+
color: ButtonColor;
|
|
137
|
+
type: "button";
|
|
138
|
+
};
|
|
139
|
+
declare const buttonTheme: {
|
|
140
|
+
light: {
|
|
141
|
+
focus: string;
|
|
142
|
+
disabled: string;
|
|
143
|
+
};
|
|
144
|
+
dark: {
|
|
145
|
+
focus: string;
|
|
146
|
+
disabled: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
declare const buttonTokens: {
|
|
150
|
+
sizes: {
|
|
151
|
+
readonly sm: {
|
|
152
|
+
readonly height: "32px";
|
|
153
|
+
readonly paddingX: "8px";
|
|
154
|
+
readonly paddingY: "4px";
|
|
155
|
+
readonly fontSize: "14px";
|
|
156
|
+
readonly iconSize: "16px";
|
|
157
|
+
readonly borderRadius: "10px";
|
|
158
|
+
};
|
|
159
|
+
readonly md: {
|
|
160
|
+
readonly height: "40px";
|
|
161
|
+
readonly paddingX: "16px";
|
|
162
|
+
readonly paddingY: "8px";
|
|
163
|
+
readonly fontSize: "16px";
|
|
164
|
+
readonly iconSize: "20px";
|
|
165
|
+
readonly borderRadius: "12px";
|
|
166
|
+
};
|
|
167
|
+
readonly lg: {
|
|
168
|
+
readonly height: "48px";
|
|
169
|
+
readonly paddingX: "24px";
|
|
170
|
+
readonly paddingY: "12px";
|
|
171
|
+
readonly fontSize: "18px";
|
|
172
|
+
readonly iconSize: "24px";
|
|
173
|
+
readonly borderRadius: "16px";
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
sizeClasses: {
|
|
177
|
+
readonly sm: {
|
|
178
|
+
readonly base: "h-8 px-2 py-1 text-sm rounded-[10px]";
|
|
179
|
+
readonly icon: "h-8 w-8 rounded-[10px]";
|
|
180
|
+
readonly iconSize: "w-4 h-4";
|
|
181
|
+
};
|
|
182
|
+
readonly md: {
|
|
183
|
+
readonly base: "h-10 px-4 py-2 text-base rounded-xl";
|
|
184
|
+
readonly icon: "h-10 w-10 rounded-xl";
|
|
185
|
+
readonly iconSize: "w-5 h-5";
|
|
186
|
+
};
|
|
187
|
+
readonly lg: {
|
|
188
|
+
readonly base: "h-12 px-6 py-3 text-lg rounded-2xl";
|
|
189
|
+
readonly icon: "h-12 w-12 rounded-2xl";
|
|
190
|
+
readonly iconSize: "w-[22px] h-[22px]";
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
variants: {
|
|
194
|
+
readonly primary: "filled";
|
|
195
|
+
readonly secondary: "outlined";
|
|
196
|
+
readonly ghost: "text-only";
|
|
197
|
+
readonly icon: "icon-only";
|
|
198
|
+
};
|
|
199
|
+
colors: {
|
|
200
|
+
readonly primary: "default";
|
|
201
|
+
readonly secondary: "purple";
|
|
202
|
+
readonly success: "green";
|
|
203
|
+
readonly warning: "orange";
|
|
204
|
+
readonly destructive: "red";
|
|
205
|
+
readonly neutral: "gray";
|
|
206
|
+
};
|
|
207
|
+
states: {
|
|
208
|
+
readonly default: "normal";
|
|
209
|
+
readonly hover: "highlighted";
|
|
210
|
+
readonly pressed: "active";
|
|
211
|
+
readonly disabled: "inactive";
|
|
212
|
+
readonly loading: "processing";
|
|
213
|
+
};
|
|
214
|
+
variantClasses: {
|
|
215
|
+
readonly primary: {
|
|
216
|
+
readonly primary: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 active:bg-[hsl(var(--primary-pressed))] disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
217
|
+
readonly secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/90 active:bg-secondary/80 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
218
|
+
readonly success: "bg-emerald-600 text-white shadow-sm hover:bg-emerald-700 active:bg-emerald-800 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
219
|
+
readonly warning: "bg-amber-600 text-white shadow-sm hover:bg-amber-700 active:bg-amber-800 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
220
|
+
readonly destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 active:bg-destructive/80 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
221
|
+
readonly neutral: "bg-neutral-700 text-white shadow-sm hover:bg-neutral-800 active:bg-neutral-900 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
222
|
+
};
|
|
223
|
+
readonly secondary: {
|
|
224
|
+
readonly primary: "border border-primary text-primary bg-transparent hover:bg-primary/10 active:bg-primary/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
225
|
+
readonly secondary: "border border-secondary text-secondary bg-transparent hover:bg-secondary/10 active:bg-secondary/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
226
|
+
readonly success: "border border-emerald-600 text-emerald-600 bg-transparent hover:bg-emerald-50 active:bg-emerald-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
227
|
+
readonly warning: "border border-amber-600 text-amber-600 bg-transparent hover:bg-amber-50 active:bg-amber-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
228
|
+
readonly destructive: "border border-destructive text-destructive bg-transparent hover:bg-destructive/10 active:bg-destructive/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
229
|
+
readonly neutral: "border border-neutral-700 text-neutral-700 bg-transparent hover:bg-neutral-50 active:bg-neutral-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
230
|
+
};
|
|
231
|
+
readonly ghost: {
|
|
232
|
+
readonly primary: "text-primary bg-transparent hover:bg-primary/10 active:bg-primary/20 disabled:text-neutral-500 disabled:bg-transparent";
|
|
233
|
+
readonly secondary: "text-secondary bg-transparent hover:bg-secondary/10 active:bg-secondary/20 disabled:text-neutral-500 disabled:bg-transparent";
|
|
234
|
+
readonly success: "text-emerald-600 bg-transparent hover:bg-emerald-50 active:bg-emerald-100 disabled:text-neutral-500 disabled:bg-transparent";
|
|
235
|
+
readonly warning: "text-amber-600 bg-transparent hover:bg-amber-50 active:bg-amber-100 disabled:text-neutral-500 disabled:bg-transparent";
|
|
236
|
+
readonly destructive: "text-destructive bg-transparent hover:bg-destructive/10 active:bg-destructive/20 disabled:text-neutral-500 disabled:bg-transparent";
|
|
237
|
+
readonly neutral: "text-neutral-700 bg-transparent hover:bg-neutral-100 active:bg-neutral-200 disabled:text-neutral-500 disabled:bg-transparent";
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
baseClasses: string;
|
|
241
|
+
iconClasses: {
|
|
242
|
+
readonly left: "mr-2";
|
|
243
|
+
readonly right: "ml-2";
|
|
244
|
+
readonly only: "";
|
|
245
|
+
};
|
|
246
|
+
loadingClasses: {
|
|
247
|
+
readonly spinner: "animate-spin";
|
|
248
|
+
readonly container: "flex items-center justify-center gap-2";
|
|
249
|
+
readonly text: "opacity-70";
|
|
250
|
+
};
|
|
251
|
+
defaultConfig: {
|
|
252
|
+
variant: ButtonVariant;
|
|
253
|
+
size: ButtonSize;
|
|
254
|
+
color: ButtonColor;
|
|
255
|
+
type: "button";
|
|
256
|
+
};
|
|
257
|
+
theme: {
|
|
258
|
+
light: {
|
|
259
|
+
focus: string;
|
|
260
|
+
disabled: string;
|
|
261
|
+
};
|
|
262
|
+
dark: {
|
|
263
|
+
focus: string;
|
|
264
|
+
disabled: string;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
declare const buttonAnimations: {
|
|
269
|
+
readonly scale: "active:scale-95";
|
|
270
|
+
readonly fadeIn: "animate-in fade-in-0 duration-200";
|
|
271
|
+
readonly fadeOut: "animate-out fade-out-0 duration-200";
|
|
272
|
+
readonly slideIn: "animate-in slide-in-from-left-1 duration-200";
|
|
273
|
+
readonly slideOut: "animate-out slide-out-to-left-1 duration-200";
|
|
274
|
+
};
|
|
275
|
+
declare const loadingSpinnerSVG = "\n <svg className=\"animate-spin\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle \n className=\"opacity-25\" \n cx=\"12\" \n cy=\"12\" \n r=\"10\" \n stroke=\"currentColor\" \n strokeWidth=\"4\"\n />\n <path \n className=\"opacity-75\" \n fill=\"currentColor\" \n d=\"m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n";
|
|
276
|
+
|
|
277
|
+
export { type ButtonColor, type ButtonProps, type ButtonSize, type ButtonState, type ButtonVariant, buttonAnimations, buttonBaseClasses, buttonColors, buttonIconClasses, buttonLoadingClasses, buttonSizeClasses, buttonSizes, buttonStates, buttonTheme, buttonTokens, buttonVariantClasses, buttonVariants, defaultButtonConfig, getButtonIconSize, getButtonSizeClasses, getButtonVariantClasses, loadingSpinnerSVG };
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Button Design Tokens - Raya Design System
|
|
3
|
+
*
|
|
4
|
+
* Defines the button system tokens including sizes, variants, colors, and states
|
|
5
|
+
* for consistent button usage across the design system.
|
|
6
|
+
*/
|
|
7
|
+
declare const buttonSizes: {
|
|
8
|
+
readonly sm: {
|
|
9
|
+
readonly height: "32px";
|
|
10
|
+
readonly paddingX: "8px";
|
|
11
|
+
readonly paddingY: "4px";
|
|
12
|
+
readonly fontSize: "14px";
|
|
13
|
+
readonly iconSize: "16px";
|
|
14
|
+
readonly borderRadius: "10px";
|
|
15
|
+
};
|
|
16
|
+
readonly md: {
|
|
17
|
+
readonly height: "40px";
|
|
18
|
+
readonly paddingX: "16px";
|
|
19
|
+
readonly paddingY: "8px";
|
|
20
|
+
readonly fontSize: "16px";
|
|
21
|
+
readonly iconSize: "20px";
|
|
22
|
+
readonly borderRadius: "12px";
|
|
23
|
+
};
|
|
24
|
+
readonly lg: {
|
|
25
|
+
readonly height: "48px";
|
|
26
|
+
readonly paddingX: "24px";
|
|
27
|
+
readonly paddingY: "12px";
|
|
28
|
+
readonly fontSize: "18px";
|
|
29
|
+
readonly iconSize: "24px";
|
|
30
|
+
readonly borderRadius: "16px";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
declare const buttonSizeClasses: {
|
|
34
|
+
readonly sm: {
|
|
35
|
+
readonly base: "h-8 px-2 py-1 text-sm rounded-[10px]";
|
|
36
|
+
readonly icon: "h-8 w-8 rounded-[10px]";
|
|
37
|
+
readonly iconSize: "w-4 h-4";
|
|
38
|
+
};
|
|
39
|
+
readonly md: {
|
|
40
|
+
readonly base: "h-10 px-4 py-2 text-base rounded-xl";
|
|
41
|
+
readonly icon: "h-10 w-10 rounded-xl";
|
|
42
|
+
readonly iconSize: "w-5 h-5";
|
|
43
|
+
};
|
|
44
|
+
readonly lg: {
|
|
45
|
+
readonly base: "h-12 px-6 py-3 text-lg rounded-2xl";
|
|
46
|
+
readonly icon: "h-12 w-12 rounded-2xl";
|
|
47
|
+
readonly iconSize: "w-[22px] h-[22px]";
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
declare const buttonVariants: {
|
|
51
|
+
readonly primary: "filled";
|
|
52
|
+
readonly secondary: "outlined";
|
|
53
|
+
readonly ghost: "text-only";
|
|
54
|
+
readonly icon: "icon-only";
|
|
55
|
+
};
|
|
56
|
+
declare const buttonColors: {
|
|
57
|
+
readonly primary: "default";
|
|
58
|
+
readonly secondary: "purple";
|
|
59
|
+
readonly success: "green";
|
|
60
|
+
readonly warning: "orange";
|
|
61
|
+
readonly destructive: "red";
|
|
62
|
+
readonly neutral: "gray";
|
|
63
|
+
};
|
|
64
|
+
declare const buttonStates: {
|
|
65
|
+
readonly default: "normal";
|
|
66
|
+
readonly hover: "highlighted";
|
|
67
|
+
readonly pressed: "active";
|
|
68
|
+
readonly disabled: "inactive";
|
|
69
|
+
readonly loading: "processing";
|
|
70
|
+
};
|
|
71
|
+
declare const buttonVariantClasses: {
|
|
72
|
+
readonly primary: {
|
|
73
|
+
readonly primary: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 active:bg-[hsl(var(--primary-pressed))] disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
74
|
+
readonly secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/90 active:bg-secondary/80 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
75
|
+
readonly success: "bg-emerald-600 text-white shadow-sm hover:bg-emerald-700 active:bg-emerald-800 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
76
|
+
readonly warning: "bg-amber-600 text-white shadow-sm hover:bg-amber-700 active:bg-amber-800 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
77
|
+
readonly destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 active:bg-destructive/80 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
78
|
+
readonly neutral: "bg-neutral-700 text-white shadow-sm hover:bg-neutral-800 active:bg-neutral-900 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
79
|
+
};
|
|
80
|
+
readonly secondary: {
|
|
81
|
+
readonly primary: "border border-primary text-primary bg-transparent hover:bg-primary/10 active:bg-primary/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
82
|
+
readonly secondary: "border border-secondary text-secondary bg-transparent hover:bg-secondary/10 active:bg-secondary/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
83
|
+
readonly success: "border border-emerald-600 text-emerald-600 bg-transparent hover:bg-emerald-50 active:bg-emerald-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
84
|
+
readonly warning: "border border-amber-600 text-amber-600 bg-transparent hover:bg-amber-50 active:bg-amber-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
85
|
+
readonly destructive: "border border-destructive text-destructive bg-transparent hover:bg-destructive/10 active:bg-destructive/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
86
|
+
readonly neutral: "border border-neutral-700 text-neutral-700 bg-transparent hover:bg-neutral-50 active:bg-neutral-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
87
|
+
};
|
|
88
|
+
readonly ghost: {
|
|
89
|
+
readonly primary: "text-primary bg-transparent hover:bg-primary/10 active:bg-primary/20 disabled:text-neutral-500 disabled:bg-transparent";
|
|
90
|
+
readonly secondary: "text-secondary bg-transparent hover:bg-secondary/10 active:bg-secondary/20 disabled:text-neutral-500 disabled:bg-transparent";
|
|
91
|
+
readonly success: "text-emerald-600 bg-transparent hover:bg-emerald-50 active:bg-emerald-100 disabled:text-neutral-500 disabled:bg-transparent";
|
|
92
|
+
readonly warning: "text-amber-600 bg-transparent hover:bg-amber-50 active:bg-amber-100 disabled:text-neutral-500 disabled:bg-transparent";
|
|
93
|
+
readonly destructive: "text-destructive bg-transparent hover:bg-destructive/10 active:bg-destructive/20 disabled:text-neutral-500 disabled:bg-transparent";
|
|
94
|
+
readonly neutral: "text-neutral-700 bg-transparent hover:bg-neutral-100 active:bg-neutral-200 disabled:text-neutral-500 disabled:bg-transparent";
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
declare const buttonBaseClasses = "inline-flex items-center justify-center gap-2 whitespace-nowrap font-regular transition-all duration-200 focus-visible:outline-none disabled:pointer-events-none disabled:cursor-not-allowed focus-visible:border-2 focus-visible:border-[--stroke-color-focus-border]";
|
|
98
|
+
declare const buttonIconClasses: {
|
|
99
|
+
readonly left: "mr-2";
|
|
100
|
+
readonly right: "ml-2";
|
|
101
|
+
readonly only: "";
|
|
102
|
+
};
|
|
103
|
+
declare const buttonLoadingClasses: {
|
|
104
|
+
readonly spinner: "animate-spin";
|
|
105
|
+
readonly container: "flex items-center justify-center gap-2";
|
|
106
|
+
readonly text: "opacity-70";
|
|
107
|
+
};
|
|
108
|
+
type ButtonSize = keyof typeof buttonSizes;
|
|
109
|
+
type ButtonVariant = keyof typeof buttonVariants;
|
|
110
|
+
type ButtonColor = keyof typeof buttonColors;
|
|
111
|
+
type ButtonState = keyof typeof buttonStates;
|
|
112
|
+
declare const getButtonSizeClasses: (size: ButtonSize, isIcon?: boolean) => string;
|
|
113
|
+
declare const getButtonVariantClasses: (variant: ButtonVariant, color: ButtonColor) => string;
|
|
114
|
+
declare const getButtonIconSize: (size: ButtonSize) => string;
|
|
115
|
+
interface ButtonProps {
|
|
116
|
+
variant?: ButtonVariant;
|
|
117
|
+
size?: ButtonSize;
|
|
118
|
+
color?: ButtonColor;
|
|
119
|
+
disabled?: boolean;
|
|
120
|
+
loading?: boolean;
|
|
121
|
+
loadingText?: string;
|
|
122
|
+
icon?: string;
|
|
123
|
+
iconLeft?: string;
|
|
124
|
+
iconRight?: string;
|
|
125
|
+
className?: string;
|
|
126
|
+
children?: React.ReactNode;
|
|
127
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
128
|
+
type?: 'button' | 'submit' | 'reset';
|
|
129
|
+
'aria-label'?: string;
|
|
130
|
+
'aria-describedby'?: string;
|
|
131
|
+
asChild?: boolean;
|
|
132
|
+
}
|
|
133
|
+
declare const defaultButtonConfig: {
|
|
134
|
+
variant: ButtonVariant;
|
|
135
|
+
size: ButtonSize;
|
|
136
|
+
color: ButtonColor;
|
|
137
|
+
type: "button";
|
|
138
|
+
};
|
|
139
|
+
declare const buttonTheme: {
|
|
140
|
+
light: {
|
|
141
|
+
focus: string;
|
|
142
|
+
disabled: string;
|
|
143
|
+
};
|
|
144
|
+
dark: {
|
|
145
|
+
focus: string;
|
|
146
|
+
disabled: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
declare const buttonTokens: {
|
|
150
|
+
sizes: {
|
|
151
|
+
readonly sm: {
|
|
152
|
+
readonly height: "32px";
|
|
153
|
+
readonly paddingX: "8px";
|
|
154
|
+
readonly paddingY: "4px";
|
|
155
|
+
readonly fontSize: "14px";
|
|
156
|
+
readonly iconSize: "16px";
|
|
157
|
+
readonly borderRadius: "10px";
|
|
158
|
+
};
|
|
159
|
+
readonly md: {
|
|
160
|
+
readonly height: "40px";
|
|
161
|
+
readonly paddingX: "16px";
|
|
162
|
+
readonly paddingY: "8px";
|
|
163
|
+
readonly fontSize: "16px";
|
|
164
|
+
readonly iconSize: "20px";
|
|
165
|
+
readonly borderRadius: "12px";
|
|
166
|
+
};
|
|
167
|
+
readonly lg: {
|
|
168
|
+
readonly height: "48px";
|
|
169
|
+
readonly paddingX: "24px";
|
|
170
|
+
readonly paddingY: "12px";
|
|
171
|
+
readonly fontSize: "18px";
|
|
172
|
+
readonly iconSize: "24px";
|
|
173
|
+
readonly borderRadius: "16px";
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
sizeClasses: {
|
|
177
|
+
readonly sm: {
|
|
178
|
+
readonly base: "h-8 px-2 py-1 text-sm rounded-[10px]";
|
|
179
|
+
readonly icon: "h-8 w-8 rounded-[10px]";
|
|
180
|
+
readonly iconSize: "w-4 h-4";
|
|
181
|
+
};
|
|
182
|
+
readonly md: {
|
|
183
|
+
readonly base: "h-10 px-4 py-2 text-base rounded-xl";
|
|
184
|
+
readonly icon: "h-10 w-10 rounded-xl";
|
|
185
|
+
readonly iconSize: "w-5 h-5";
|
|
186
|
+
};
|
|
187
|
+
readonly lg: {
|
|
188
|
+
readonly base: "h-12 px-6 py-3 text-lg rounded-2xl";
|
|
189
|
+
readonly icon: "h-12 w-12 rounded-2xl";
|
|
190
|
+
readonly iconSize: "w-[22px] h-[22px]";
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
variants: {
|
|
194
|
+
readonly primary: "filled";
|
|
195
|
+
readonly secondary: "outlined";
|
|
196
|
+
readonly ghost: "text-only";
|
|
197
|
+
readonly icon: "icon-only";
|
|
198
|
+
};
|
|
199
|
+
colors: {
|
|
200
|
+
readonly primary: "default";
|
|
201
|
+
readonly secondary: "purple";
|
|
202
|
+
readonly success: "green";
|
|
203
|
+
readonly warning: "orange";
|
|
204
|
+
readonly destructive: "red";
|
|
205
|
+
readonly neutral: "gray";
|
|
206
|
+
};
|
|
207
|
+
states: {
|
|
208
|
+
readonly default: "normal";
|
|
209
|
+
readonly hover: "highlighted";
|
|
210
|
+
readonly pressed: "active";
|
|
211
|
+
readonly disabled: "inactive";
|
|
212
|
+
readonly loading: "processing";
|
|
213
|
+
};
|
|
214
|
+
variantClasses: {
|
|
215
|
+
readonly primary: {
|
|
216
|
+
readonly primary: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 active:bg-[hsl(var(--primary-pressed))] disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
217
|
+
readonly secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/90 active:bg-secondary/80 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
218
|
+
readonly success: "bg-emerald-600 text-white shadow-sm hover:bg-emerald-700 active:bg-emerald-800 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
219
|
+
readonly warning: "bg-amber-600 text-white shadow-sm hover:bg-amber-700 active:bg-amber-800 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
220
|
+
readonly destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 active:bg-destructive/80 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
221
|
+
readonly neutral: "bg-neutral-700 text-white shadow-sm hover:bg-neutral-800 active:bg-neutral-900 disabled:bg-neutral-300 disabled:text-neutral-500";
|
|
222
|
+
};
|
|
223
|
+
readonly secondary: {
|
|
224
|
+
readonly primary: "border border-primary text-primary bg-transparent hover:bg-primary/10 active:bg-primary/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
225
|
+
readonly secondary: "border border-secondary text-secondary bg-transparent hover:bg-secondary/10 active:bg-secondary/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
226
|
+
readonly success: "border border-emerald-600 text-emerald-600 bg-transparent hover:bg-emerald-50 active:bg-emerald-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
227
|
+
readonly warning: "border border-amber-600 text-amber-600 bg-transparent hover:bg-amber-50 active:bg-amber-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
228
|
+
readonly destructive: "border border-destructive text-destructive bg-transparent hover:bg-destructive/10 active:bg-destructive/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
229
|
+
readonly neutral: "border border-neutral-700 text-neutral-700 bg-transparent hover:bg-neutral-50 active:bg-neutral-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent";
|
|
230
|
+
};
|
|
231
|
+
readonly ghost: {
|
|
232
|
+
readonly primary: "text-primary bg-transparent hover:bg-primary/10 active:bg-primary/20 disabled:text-neutral-500 disabled:bg-transparent";
|
|
233
|
+
readonly secondary: "text-secondary bg-transparent hover:bg-secondary/10 active:bg-secondary/20 disabled:text-neutral-500 disabled:bg-transparent";
|
|
234
|
+
readonly success: "text-emerald-600 bg-transparent hover:bg-emerald-50 active:bg-emerald-100 disabled:text-neutral-500 disabled:bg-transparent";
|
|
235
|
+
readonly warning: "text-amber-600 bg-transparent hover:bg-amber-50 active:bg-amber-100 disabled:text-neutral-500 disabled:bg-transparent";
|
|
236
|
+
readonly destructive: "text-destructive bg-transparent hover:bg-destructive/10 active:bg-destructive/20 disabled:text-neutral-500 disabled:bg-transparent";
|
|
237
|
+
readonly neutral: "text-neutral-700 bg-transparent hover:bg-neutral-100 active:bg-neutral-200 disabled:text-neutral-500 disabled:bg-transparent";
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
baseClasses: string;
|
|
241
|
+
iconClasses: {
|
|
242
|
+
readonly left: "mr-2";
|
|
243
|
+
readonly right: "ml-2";
|
|
244
|
+
readonly only: "";
|
|
245
|
+
};
|
|
246
|
+
loadingClasses: {
|
|
247
|
+
readonly spinner: "animate-spin";
|
|
248
|
+
readonly container: "flex items-center justify-center gap-2";
|
|
249
|
+
readonly text: "opacity-70";
|
|
250
|
+
};
|
|
251
|
+
defaultConfig: {
|
|
252
|
+
variant: ButtonVariant;
|
|
253
|
+
size: ButtonSize;
|
|
254
|
+
color: ButtonColor;
|
|
255
|
+
type: "button";
|
|
256
|
+
};
|
|
257
|
+
theme: {
|
|
258
|
+
light: {
|
|
259
|
+
focus: string;
|
|
260
|
+
disabled: string;
|
|
261
|
+
};
|
|
262
|
+
dark: {
|
|
263
|
+
focus: string;
|
|
264
|
+
disabled: string;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
declare const buttonAnimations: {
|
|
269
|
+
readonly scale: "active:scale-95";
|
|
270
|
+
readonly fadeIn: "animate-in fade-in-0 duration-200";
|
|
271
|
+
readonly fadeOut: "animate-out fade-out-0 duration-200";
|
|
272
|
+
readonly slideIn: "animate-in slide-in-from-left-1 duration-200";
|
|
273
|
+
readonly slideOut: "animate-out slide-out-to-left-1 duration-200";
|
|
274
|
+
};
|
|
275
|
+
declare const loadingSpinnerSVG = "\n <svg className=\"animate-spin\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle \n className=\"opacity-25\" \n cx=\"12\" \n cy=\"12\" \n r=\"10\" \n stroke=\"currentColor\" \n strokeWidth=\"4\"\n />\n <path \n className=\"opacity-75\" \n fill=\"currentColor\" \n d=\"m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n";
|
|
276
|
+
|
|
277
|
+
export { type ButtonColor, type ButtonProps, type ButtonSize, type ButtonState, type ButtonVariant, buttonAnimations, buttonBaseClasses, buttonColors, buttonIconClasses, buttonLoadingClasses, buttonSizeClasses, buttonSizes, buttonStates, buttonTheme, buttonTokens, buttonVariantClasses, buttonVariants, defaultButtonConfig, getButtonIconSize, getButtonSizeClasses, getButtonVariantClasses, loadingSpinnerSVG };
|