@idealyst/components 1.0.24 → 1.0.25
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 +567 -567
- package/package.json +2 -2
- package/plugin/web.js +319 -185
- package/src/Avatar/Avatar.native.tsx +43 -43
- package/src/Avatar/Avatar.styles.tsx +66 -66
- package/src/Avatar/Avatar.web.tsx +50 -50
- package/src/Avatar/index.native.ts +1 -1
- package/src/Avatar/index.ts +1 -1
- package/src/Avatar/index.web.ts +1 -1
- package/src/Avatar/types.ts +42 -42
- package/src/Badge/Badge.native.tsx +42 -42
- package/src/Badge/Badge.styles.tsx +153 -153
- package/src/Badge/Badge.web.tsx +44 -44
- package/src/Badge/index.native.ts +1 -1
- package/src/Badge/index.ts +1 -1
- package/src/Badge/index.web.ts +1 -1
- package/src/Badge/types.ts +33 -33
- package/src/Button/Button.native.tsx +38 -38
- package/src/Button/Button.styles.tsx +214 -214
- package/src/Button/Button.types.ts +11 -11
- package/src/Button/Button.web.tsx +55 -55
- package/src/Button/index.native.ts +2 -2
- package/src/Button/index.ts +4 -4
- package/src/Button/index.web.ts +2 -2
- package/src/Button/types.ts +48 -48
- package/src/Card/Card.native.tsx +51 -51
- package/src/Card/Card.styles.tsx +239 -239
- package/src/Card/Card.web.tsx +61 -61
- package/src/Card/index.native.ts +2 -2
- package/src/Card/index.ts +4 -4
- package/src/Card/index.web.ts +2 -2
- package/src/Card/types.ts +58 -58
- package/src/Checkbox/Checkbox.native.tsx +98 -98
- package/src/Checkbox/Checkbox.styles.tsx +291 -291
- package/src/Checkbox/Checkbox.web.tsx +130 -130
- package/src/Checkbox/index.native.ts +2 -2
- package/src/Checkbox/index.ts +4 -4
- package/src/Checkbox/index.web.ts +2 -2
- package/src/Checkbox/types.ts +78 -78
- package/src/Divider/Divider.native.tsx +144 -144
- package/src/Divider/Divider.styles.tsx +601 -601
- package/src/Divider/Divider.web.tsx +72 -72
- package/src/Divider/index.native.ts +2 -2
- package/src/Divider/index.ts +4 -4
- package/src/Divider/index.web.ts +2 -2
- package/src/Divider/types.ts +53 -53
- package/src/Icon/Icon.native.tsx +38 -38
- package/src/Icon/Icon.styles.tsx +49 -49
- package/src/Icon/Icon.web.tsx +46 -46
- package/src/Icon/icon-types.ts +7452 -7452
- package/src/Icon/index.native.ts +2 -2
- package/src/Icon/index.ts +4 -4
- package/src/Icon/index.web.ts +2 -2
- package/src/Icon/types.ts +35 -35
- package/src/Input/Input.native.tsx +74 -74
- package/src/Input/Input.styles.tsx +176 -176
- package/src/Input/Input.web.tsx +70 -70
- package/src/Input/index.native.ts +2 -2
- package/src/Input/index.ts +4 -4
- package/src/Input/index.web.ts +2 -2
- package/src/Input/types.ts +68 -68
- package/src/Screen/Screen.native.tsx +40 -40
- package/src/Screen/Screen.styles.tsx +59 -59
- package/src/Screen/Screen.web.tsx +32 -32
- package/src/Screen/index.native.ts +1 -1
- package/src/Screen/index.ts +1 -1
- package/src/Screen/index.web.ts +1 -1
- package/src/Screen/types.ts +37 -37
- package/src/Text/Text.native.tsx +35 -35
- package/src/Text/Text.styles.tsx +66 -66
- package/src/Text/Text.web.tsx +40 -40
- package/src/Text/index.native.ts +2 -2
- package/src/Text/index.ts +4 -4
- package/src/Text/index.web.ts +2 -2
- package/src/Text/types.ts +38 -38
- package/src/View/View.native.tsx +55 -55
- package/src/View/View.styles.tsx +102 -102
- package/src/View/View.web.tsx +59 -59
- package/src/View/index.native.ts +2 -2
- package/src/View/index.ts +4 -4
- package/src/View/index.web.ts +2 -2
- package/src/View/types.ts +72 -72
- package/src/examples/AllExamples.tsx +71 -71
- package/src/examples/AvatarExamples.tsx +96 -96
- package/src/examples/BadgeExamples.tsx +199 -199
- package/src/examples/ButtonExamples.tsx +149 -149
- package/src/examples/CardExamples.tsx +175 -175
- package/src/examples/CheckboxExamples.tsx +216 -216
- package/src/examples/DividerExamples.tsx +217 -217
- package/src/examples/IconExamples.tsx +341 -341
- package/src/examples/InputExamples.tsx +133 -133
- package/src/examples/README.md +135 -135
- package/src/examples/ScreenExamples.tsx +153 -153
- package/src/examples/TextExamples.tsx +88 -88
- package/src/examples/ThemeExtensionExamples.tsx +90 -90
- package/src/examples/ValidationExamples.tsx +94 -94
- package/src/examples/ViewExamples.tsx +128 -128
- package/src/examples/extendedTheme.ts +328 -328
- package/src/examples/index.ts +14 -14
- package/src/index.native.ts +48 -48
- package/src/index.ts +47 -47
- package/src/theme/breakpoints.ts +8 -8
- package/src/theme/colorResolver.ts +217 -217
- package/src/theme/colors.ts +314 -314
- package/src/theme/defaultThemes.ts +325 -325
- package/src/theme/index.ts +187 -187
- package/src/theme/themeBuilder.ts +601 -601
- package/src/theme/unistyles.d.ts +5 -5
- package/src/theme/variantHelpers.ts +583 -583
- package/src/theme/variants.ts +55 -55
|
@@ -1,326 +1,326 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createTheme,
|
|
3
|
-
generateColorPalette,
|
|
4
|
-
createLightResolvedIntents,
|
|
5
|
-
createDarkResolvedIntents,
|
|
6
|
-
createLightResolvedColors,
|
|
7
|
-
createDarkResolvedColors,
|
|
8
|
-
type ThemeConfig
|
|
9
|
-
} from './themeBuilder';
|
|
10
|
-
|
|
11
|
-
// Common theme properties shared across all themes
|
|
12
|
-
export const commonThemeProperties = {
|
|
13
|
-
spacing: {
|
|
14
|
-
xs: 4,
|
|
15
|
-
sm: 8,
|
|
16
|
-
md: 16,
|
|
17
|
-
lg: 24,
|
|
18
|
-
xl: 32,
|
|
19
|
-
xxl: 40,
|
|
20
|
-
xxxl: 48,
|
|
21
|
-
xxxxl: 64,
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
borderRadius: {
|
|
25
|
-
none: 0,
|
|
26
|
-
xs: 2,
|
|
27
|
-
sm: 4,
|
|
28
|
-
md: 8,
|
|
29
|
-
lg: 12,
|
|
30
|
-
xl: 16,
|
|
31
|
-
xxl: 20,
|
|
32
|
-
full: 9999,
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
typography: {
|
|
36
|
-
fontSize: {
|
|
37
|
-
xs: 12,
|
|
38
|
-
sm: 14,
|
|
39
|
-
md: 16,
|
|
40
|
-
lg: 18,
|
|
41
|
-
xl: 20,
|
|
42
|
-
xxl: 24,
|
|
43
|
-
xxxl: 32,
|
|
44
|
-
xxxxl: 40,
|
|
45
|
-
},
|
|
46
|
-
fontWeight: {
|
|
47
|
-
light: '300',
|
|
48
|
-
regular: '400',
|
|
49
|
-
medium: '500',
|
|
50
|
-
semibold: '600',
|
|
51
|
-
bold: '700',
|
|
52
|
-
extrabold: '800',
|
|
53
|
-
},
|
|
54
|
-
lineHeight: {
|
|
55
|
-
tight: 1.25,
|
|
56
|
-
normal: 1.5,
|
|
57
|
-
relaxed: 1.75,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
shadows: {
|
|
62
|
-
sm: {
|
|
63
|
-
shadowColor: '#000',
|
|
64
|
-
shadowOffset: { width: 0, height: 1 },
|
|
65
|
-
shadowOpacity: 0.05,
|
|
66
|
-
shadowRadius: 2,
|
|
67
|
-
elevation: 1,
|
|
68
|
-
},
|
|
69
|
-
md: {
|
|
70
|
-
shadowColor: '#000',
|
|
71
|
-
shadowOffset: { width: 0, height: 4 },
|
|
72
|
-
shadowOpacity: 0.1,
|
|
73
|
-
shadowRadius: 8,
|
|
74
|
-
elevation: 4,
|
|
75
|
-
},
|
|
76
|
-
lg: {
|
|
77
|
-
shadowColor: '#000',
|
|
78
|
-
shadowOffset: { width: 0, height: 8 },
|
|
79
|
-
shadowOpacity: 0.15,
|
|
80
|
-
shadowRadius: 16,
|
|
81
|
-
elevation: 8,
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
transitions: {
|
|
86
|
-
fast: '0.15s ease',
|
|
87
|
-
base: '0.2s ease',
|
|
88
|
-
slow: '0.3s ease',
|
|
89
|
-
button: 'all 0.2s ease',
|
|
90
|
-
fade: 'opacity 0.2s ease',
|
|
91
|
-
slide: 'transform 0.3s ease',
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
// Dynamic helper functions
|
|
95
|
-
gap: (value: number) => value * 8,
|
|
96
|
-
scale: (value: number) => value * 1.2,
|
|
97
|
-
alpha: (color: string, alpha: number) => `${color}${Math.round(alpha * 255).toString(16).padStart(2, '0')}`,
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
// =============================================================================
|
|
101
|
-
// DEFAULT PALETTES
|
|
102
|
-
// =============================================================================
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Helper function to create standard color palettes
|
|
106
|
-
*/
|
|
107
|
-
export function createStandardPalettes(): ThemeConfig['palettes'] {
|
|
108
|
-
return {
|
|
109
|
-
red: generateColorPalette('#ef4444'),
|
|
110
|
-
orange: generateColorPalette('#f97316'),
|
|
111
|
-
yellow: generateColorPalette('#eab308'),
|
|
112
|
-
green: generateColorPalette('#22c55e'),
|
|
113
|
-
blue: generateColorPalette('#3b82f6'),
|
|
114
|
-
purple: generateColorPalette('#a855f7'),
|
|
115
|
-
black: generateColorPalette('#000000'),
|
|
116
|
-
gray: generateColorPalette('#6b7280'),
|
|
117
|
-
white: generateColorPalette('#ffffff'),
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Helper function to create dark theme palettes with proper dark mode colors
|
|
123
|
-
*/
|
|
124
|
-
export function createDarkPalettes(): ThemeConfig['palettes'] {
|
|
125
|
-
const basePalettes = createStandardPalettes();
|
|
126
|
-
|
|
127
|
-
return {
|
|
128
|
-
...basePalettes,
|
|
129
|
-
// Adjusted gray palette for dark theme
|
|
130
|
-
gray: {
|
|
131
|
-
50: '#18181b', // Very dark background
|
|
132
|
-
100: '#27272a', // Dark surface
|
|
133
|
-
200: '#3f3f46', // Medium dark
|
|
134
|
-
300: '#52525b', // Medium
|
|
135
|
-
400: '#71717a', // Medium light
|
|
136
|
-
500: '#a1a1aa', // Light gray
|
|
137
|
-
600: '#d4d4d8', // Lighter gray
|
|
138
|
-
700: '#e4e4e7', // Very light gray
|
|
139
|
-
800: '#f4f4f5', // Nearly white
|
|
140
|
-
900: '#fafafa', // White
|
|
141
|
-
},
|
|
142
|
-
// Adjusted black palette for dark theme
|
|
143
|
-
black: {
|
|
144
|
-
50: '#000000', // Pure black
|
|
145
|
-
100: '#0a0a0a', // Very dark
|
|
146
|
-
200: '#141414', // Dark
|
|
147
|
-
300: '#1f1f1f', // Medium dark
|
|
148
|
-
400: '#2a2a2a', // Medium
|
|
149
|
-
500: '#3c3c3c', // Medium light
|
|
150
|
-
600: '#525252', // Light
|
|
151
|
-
700: '#737373', // Lighter
|
|
152
|
-
800: '#a3a3a3', // Very light
|
|
153
|
-
900: '#d4d4d4', // Nearly white
|
|
154
|
-
},
|
|
155
|
-
// Adjusted white palette for dark theme
|
|
156
|
-
white: {
|
|
157
|
-
50: '#0c0c0c', // Very dark (inverted)
|
|
158
|
-
100: '#171717', // Dark
|
|
159
|
-
200: '#262626', // Medium dark
|
|
160
|
-
300: '#404040', // Medium
|
|
161
|
-
400: '#525252', // Medium light
|
|
162
|
-
500: '#737373', // Light
|
|
163
|
-
600: '#a3a3a3', // Lighter
|
|
164
|
-
700: '#d4d4d4', // Very light
|
|
165
|
-
800: '#f5f5f5', // Nearly white
|
|
166
|
-
900: '#ffffff', // Pure white
|
|
167
|
-
},
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// Convenience functions for complete theme creation
|
|
172
|
-
export function createLightIntentMappings(): ThemeConfig['intents'] {
|
|
173
|
-
const palettes = createStandardPalettes();
|
|
174
|
-
return createLightResolvedIntents(palettes);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export function createDarkIntentMappings(): ThemeConfig['intents'] {
|
|
178
|
-
const palettes = createDarkPalettes();
|
|
179
|
-
return createDarkResolvedIntents(palettes);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export function createLightColorMappings(): ThemeConfig['colors'] {
|
|
183
|
-
const palettes = createStandardPalettes();
|
|
184
|
-
return createLightResolvedColors(palettes);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export function createDarkColorMappings(): ThemeConfig['colors'] {
|
|
188
|
-
const palettes = createDarkPalettes();
|
|
189
|
-
return createDarkResolvedColors(palettes);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// Create default light theme using the explicit theme builder
|
|
193
|
-
export function createDefaultLightTheme() {
|
|
194
|
-
return createTheme({
|
|
195
|
-
name: 'DefaultLight',
|
|
196
|
-
mode: 'light',
|
|
197
|
-
palettes: createStandardPalettes(),
|
|
198
|
-
intents: createLightIntentMappings(),
|
|
199
|
-
colors: createLightColorMappings(),
|
|
200
|
-
|
|
201
|
-
typography: {
|
|
202
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
borderRadius: {
|
|
206
|
-
sm: 4,
|
|
207
|
-
md: 8,
|
|
208
|
-
lg: 12,
|
|
209
|
-
xl: 16,
|
|
210
|
-
xxl: 20,
|
|
211
|
-
},
|
|
212
|
-
|
|
213
|
-
spacing: {
|
|
214
|
-
xs: 4,
|
|
215
|
-
sm: 8,
|
|
216
|
-
md: 16,
|
|
217
|
-
lg: 24,
|
|
218
|
-
xl: 32,
|
|
219
|
-
xxl: 40,
|
|
220
|
-
xxxl: 48,
|
|
221
|
-
},
|
|
222
|
-
|
|
223
|
-
shadows: {
|
|
224
|
-
sm: {
|
|
225
|
-
shadowColor: '#000',
|
|
226
|
-
shadowOffset: { width: 0, height: 1 },
|
|
227
|
-
shadowOpacity: 0.05,
|
|
228
|
-
shadowRadius: 2,
|
|
229
|
-
elevation: 1,
|
|
230
|
-
},
|
|
231
|
-
md: {
|
|
232
|
-
shadowColor: '#000',
|
|
233
|
-
shadowOffset: { width: 0, height: 4 },
|
|
234
|
-
shadowOpacity: 0.1,
|
|
235
|
-
shadowRadius: 8,
|
|
236
|
-
elevation: 4,
|
|
237
|
-
},
|
|
238
|
-
lg: {
|
|
239
|
-
shadowColor: '#000',
|
|
240
|
-
shadowOffset: { width: 0, height: 8 },
|
|
241
|
-
shadowOpacity: 0.15,
|
|
242
|
-
shadowRadius: 16,
|
|
243
|
-
elevation: 8,
|
|
244
|
-
},
|
|
245
|
-
},
|
|
246
|
-
|
|
247
|
-
transitions: {
|
|
248
|
-
fast: '0.15s ease',
|
|
249
|
-
base: '0.2s ease',
|
|
250
|
-
slow: '0.3s ease',
|
|
251
|
-
button: 'all 0.2s ease',
|
|
252
|
-
fade: 'opacity 0.2s ease',
|
|
253
|
-
slide: 'transform 0.3s ease',
|
|
254
|
-
},
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// Create default dark theme using the explicit theme builder
|
|
259
|
-
export function createDefaultDarkTheme() {
|
|
260
|
-
return createTheme({
|
|
261
|
-
name: 'DefaultDark',
|
|
262
|
-
mode: 'dark',
|
|
263
|
-
palettes: createDarkPalettes(),
|
|
264
|
-
intents: createDarkIntentMappings(),
|
|
265
|
-
colors: createDarkColorMappings(),
|
|
266
|
-
|
|
267
|
-
typography: {
|
|
268
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
269
|
-
},
|
|
270
|
-
|
|
271
|
-
borderRadius: {
|
|
272
|
-
sm: 4,
|
|
273
|
-
md: 8,
|
|
274
|
-
lg: 12,
|
|
275
|
-
xl: 16,
|
|
276
|
-
xxl: 20,
|
|
277
|
-
},
|
|
278
|
-
|
|
279
|
-
spacing: {
|
|
280
|
-
xs: 4,
|
|
281
|
-
sm: 8,
|
|
282
|
-
md: 16,
|
|
283
|
-
lg: 24,
|
|
284
|
-
xl: 32,
|
|
285
|
-
xxl: 40,
|
|
286
|
-
xxxl: 48,
|
|
287
|
-
},
|
|
288
|
-
|
|
289
|
-
shadows: {
|
|
290
|
-
sm: {
|
|
291
|
-
shadowColor: '#000',
|
|
292
|
-
shadowOffset: { width: 0, height: 1 },
|
|
293
|
-
shadowOpacity: 0.2,
|
|
294
|
-
shadowRadius: 2,
|
|
295
|
-
elevation: 1,
|
|
296
|
-
},
|
|
297
|
-
md: {
|
|
298
|
-
shadowColor: '#000',
|
|
299
|
-
shadowOffset: { width: 0, height: 4 },
|
|
300
|
-
shadowOpacity: 0.3,
|
|
301
|
-
shadowRadius: 8,
|
|
302
|
-
elevation: 4,
|
|
303
|
-
},
|
|
304
|
-
lg: {
|
|
305
|
-
shadowColor: '#000',
|
|
306
|
-
shadowOffset: { width: 0, height: 8 },
|
|
307
|
-
shadowOpacity: 0.4,
|
|
308
|
-
shadowRadius: 16,
|
|
309
|
-
elevation: 8,
|
|
310
|
-
},
|
|
311
|
-
},
|
|
312
|
-
|
|
313
|
-
transitions: {
|
|
314
|
-
fast: '0.15s ease',
|
|
315
|
-
base: '0.2s ease',
|
|
316
|
-
slow: '0.3s ease',
|
|
317
|
-
button: 'all 0.2s ease',
|
|
318
|
-
fade: 'opacity 0.2s ease',
|
|
319
|
-
slide: 'transform 0.3s ease',
|
|
320
|
-
},
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
// Export the created themes
|
|
325
|
-
export const defaultLightTheme = createDefaultLightTheme();
|
|
1
|
+
import {
|
|
2
|
+
createTheme,
|
|
3
|
+
generateColorPalette,
|
|
4
|
+
createLightResolvedIntents,
|
|
5
|
+
createDarkResolvedIntents,
|
|
6
|
+
createLightResolvedColors,
|
|
7
|
+
createDarkResolvedColors,
|
|
8
|
+
type ThemeConfig
|
|
9
|
+
} from './themeBuilder';
|
|
10
|
+
|
|
11
|
+
// Common theme properties shared across all themes
|
|
12
|
+
export const commonThemeProperties = {
|
|
13
|
+
spacing: {
|
|
14
|
+
xs: 4,
|
|
15
|
+
sm: 8,
|
|
16
|
+
md: 16,
|
|
17
|
+
lg: 24,
|
|
18
|
+
xl: 32,
|
|
19
|
+
xxl: 40,
|
|
20
|
+
xxxl: 48,
|
|
21
|
+
xxxxl: 64,
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
borderRadius: {
|
|
25
|
+
none: 0,
|
|
26
|
+
xs: 2,
|
|
27
|
+
sm: 4,
|
|
28
|
+
md: 8,
|
|
29
|
+
lg: 12,
|
|
30
|
+
xl: 16,
|
|
31
|
+
xxl: 20,
|
|
32
|
+
full: 9999,
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
typography: {
|
|
36
|
+
fontSize: {
|
|
37
|
+
xs: 12,
|
|
38
|
+
sm: 14,
|
|
39
|
+
md: 16,
|
|
40
|
+
lg: 18,
|
|
41
|
+
xl: 20,
|
|
42
|
+
xxl: 24,
|
|
43
|
+
xxxl: 32,
|
|
44
|
+
xxxxl: 40,
|
|
45
|
+
},
|
|
46
|
+
fontWeight: {
|
|
47
|
+
light: '300',
|
|
48
|
+
regular: '400',
|
|
49
|
+
medium: '500',
|
|
50
|
+
semibold: '600',
|
|
51
|
+
bold: '700',
|
|
52
|
+
extrabold: '800',
|
|
53
|
+
},
|
|
54
|
+
lineHeight: {
|
|
55
|
+
tight: 1.25,
|
|
56
|
+
normal: 1.5,
|
|
57
|
+
relaxed: 1.75,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
shadows: {
|
|
62
|
+
sm: {
|
|
63
|
+
shadowColor: '#000',
|
|
64
|
+
shadowOffset: { width: 0, height: 1 },
|
|
65
|
+
shadowOpacity: 0.05,
|
|
66
|
+
shadowRadius: 2,
|
|
67
|
+
elevation: 1,
|
|
68
|
+
},
|
|
69
|
+
md: {
|
|
70
|
+
shadowColor: '#000',
|
|
71
|
+
shadowOffset: { width: 0, height: 4 },
|
|
72
|
+
shadowOpacity: 0.1,
|
|
73
|
+
shadowRadius: 8,
|
|
74
|
+
elevation: 4,
|
|
75
|
+
},
|
|
76
|
+
lg: {
|
|
77
|
+
shadowColor: '#000',
|
|
78
|
+
shadowOffset: { width: 0, height: 8 },
|
|
79
|
+
shadowOpacity: 0.15,
|
|
80
|
+
shadowRadius: 16,
|
|
81
|
+
elevation: 8,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
transitions: {
|
|
86
|
+
fast: '0.15s ease',
|
|
87
|
+
base: '0.2s ease',
|
|
88
|
+
slow: '0.3s ease',
|
|
89
|
+
button: 'all 0.2s ease',
|
|
90
|
+
fade: 'opacity 0.2s ease',
|
|
91
|
+
slide: 'transform 0.3s ease',
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
// Dynamic helper functions
|
|
95
|
+
gap: (value: number) => value * 8,
|
|
96
|
+
scale: (value: number) => value * 1.2,
|
|
97
|
+
alpha: (color: string, alpha: number) => `${color}${Math.round(alpha * 255).toString(16).padStart(2, '0')}`,
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// =============================================================================
|
|
101
|
+
// DEFAULT PALETTES
|
|
102
|
+
// =============================================================================
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Helper function to create standard color palettes
|
|
106
|
+
*/
|
|
107
|
+
export function createStandardPalettes(): ThemeConfig['palettes'] {
|
|
108
|
+
return {
|
|
109
|
+
red: generateColorPalette('#ef4444'),
|
|
110
|
+
orange: generateColorPalette('#f97316'),
|
|
111
|
+
yellow: generateColorPalette('#eab308'),
|
|
112
|
+
green: generateColorPalette('#22c55e'),
|
|
113
|
+
blue: generateColorPalette('#3b82f6'),
|
|
114
|
+
purple: generateColorPalette('#a855f7'),
|
|
115
|
+
black: generateColorPalette('#000000'),
|
|
116
|
+
gray: generateColorPalette('#6b7280'),
|
|
117
|
+
white: generateColorPalette('#ffffff'),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Helper function to create dark theme palettes with proper dark mode colors
|
|
123
|
+
*/
|
|
124
|
+
export function createDarkPalettes(): ThemeConfig['palettes'] {
|
|
125
|
+
const basePalettes = createStandardPalettes();
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
...basePalettes,
|
|
129
|
+
// Adjusted gray palette for dark theme
|
|
130
|
+
gray: {
|
|
131
|
+
50: '#18181b', // Very dark background
|
|
132
|
+
100: '#27272a', // Dark surface
|
|
133
|
+
200: '#3f3f46', // Medium dark
|
|
134
|
+
300: '#52525b', // Medium
|
|
135
|
+
400: '#71717a', // Medium light
|
|
136
|
+
500: '#a1a1aa', // Light gray
|
|
137
|
+
600: '#d4d4d8', // Lighter gray
|
|
138
|
+
700: '#e4e4e7', // Very light gray
|
|
139
|
+
800: '#f4f4f5', // Nearly white
|
|
140
|
+
900: '#fafafa', // White
|
|
141
|
+
},
|
|
142
|
+
// Adjusted black palette for dark theme
|
|
143
|
+
black: {
|
|
144
|
+
50: '#000000', // Pure black
|
|
145
|
+
100: '#0a0a0a', // Very dark
|
|
146
|
+
200: '#141414', // Dark
|
|
147
|
+
300: '#1f1f1f', // Medium dark
|
|
148
|
+
400: '#2a2a2a', // Medium
|
|
149
|
+
500: '#3c3c3c', // Medium light
|
|
150
|
+
600: '#525252', // Light
|
|
151
|
+
700: '#737373', // Lighter
|
|
152
|
+
800: '#a3a3a3', // Very light
|
|
153
|
+
900: '#d4d4d4', // Nearly white
|
|
154
|
+
},
|
|
155
|
+
// Adjusted white palette for dark theme
|
|
156
|
+
white: {
|
|
157
|
+
50: '#0c0c0c', // Very dark (inverted)
|
|
158
|
+
100: '#171717', // Dark
|
|
159
|
+
200: '#262626', // Medium dark
|
|
160
|
+
300: '#404040', // Medium
|
|
161
|
+
400: '#525252', // Medium light
|
|
162
|
+
500: '#737373', // Light
|
|
163
|
+
600: '#a3a3a3', // Lighter
|
|
164
|
+
700: '#d4d4d4', // Very light
|
|
165
|
+
800: '#f5f5f5', // Nearly white
|
|
166
|
+
900: '#ffffff', // Pure white
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Convenience functions for complete theme creation
|
|
172
|
+
export function createLightIntentMappings(): ThemeConfig['intents'] {
|
|
173
|
+
const palettes = createStandardPalettes();
|
|
174
|
+
return createLightResolvedIntents(palettes);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export function createDarkIntentMappings(): ThemeConfig['intents'] {
|
|
178
|
+
const palettes = createDarkPalettes();
|
|
179
|
+
return createDarkResolvedIntents(palettes);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export function createLightColorMappings(): ThemeConfig['colors'] {
|
|
183
|
+
const palettes = createStandardPalettes();
|
|
184
|
+
return createLightResolvedColors(palettes);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export function createDarkColorMappings(): ThemeConfig['colors'] {
|
|
188
|
+
const palettes = createDarkPalettes();
|
|
189
|
+
return createDarkResolvedColors(palettes);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Create default light theme using the explicit theme builder
|
|
193
|
+
export function createDefaultLightTheme() {
|
|
194
|
+
return createTheme({
|
|
195
|
+
name: 'DefaultLight',
|
|
196
|
+
mode: 'light',
|
|
197
|
+
palettes: createStandardPalettes(),
|
|
198
|
+
intents: createLightIntentMappings(),
|
|
199
|
+
colors: createLightColorMappings(),
|
|
200
|
+
|
|
201
|
+
typography: {
|
|
202
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
borderRadius: {
|
|
206
|
+
sm: 4,
|
|
207
|
+
md: 8,
|
|
208
|
+
lg: 12,
|
|
209
|
+
xl: 16,
|
|
210
|
+
xxl: 20,
|
|
211
|
+
},
|
|
212
|
+
|
|
213
|
+
spacing: {
|
|
214
|
+
xs: 4,
|
|
215
|
+
sm: 8,
|
|
216
|
+
md: 16,
|
|
217
|
+
lg: 24,
|
|
218
|
+
xl: 32,
|
|
219
|
+
xxl: 40,
|
|
220
|
+
xxxl: 48,
|
|
221
|
+
},
|
|
222
|
+
|
|
223
|
+
shadows: {
|
|
224
|
+
sm: {
|
|
225
|
+
shadowColor: '#000',
|
|
226
|
+
shadowOffset: { width: 0, height: 1 },
|
|
227
|
+
shadowOpacity: 0.05,
|
|
228
|
+
shadowRadius: 2,
|
|
229
|
+
elevation: 1,
|
|
230
|
+
},
|
|
231
|
+
md: {
|
|
232
|
+
shadowColor: '#000',
|
|
233
|
+
shadowOffset: { width: 0, height: 4 },
|
|
234
|
+
shadowOpacity: 0.1,
|
|
235
|
+
shadowRadius: 8,
|
|
236
|
+
elevation: 4,
|
|
237
|
+
},
|
|
238
|
+
lg: {
|
|
239
|
+
shadowColor: '#000',
|
|
240
|
+
shadowOffset: { width: 0, height: 8 },
|
|
241
|
+
shadowOpacity: 0.15,
|
|
242
|
+
shadowRadius: 16,
|
|
243
|
+
elevation: 8,
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
|
|
247
|
+
transitions: {
|
|
248
|
+
fast: '0.15s ease',
|
|
249
|
+
base: '0.2s ease',
|
|
250
|
+
slow: '0.3s ease',
|
|
251
|
+
button: 'all 0.2s ease',
|
|
252
|
+
fade: 'opacity 0.2s ease',
|
|
253
|
+
slide: 'transform 0.3s ease',
|
|
254
|
+
},
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Create default dark theme using the explicit theme builder
|
|
259
|
+
export function createDefaultDarkTheme() {
|
|
260
|
+
return createTheme({
|
|
261
|
+
name: 'DefaultDark',
|
|
262
|
+
mode: 'dark',
|
|
263
|
+
palettes: createDarkPalettes(),
|
|
264
|
+
intents: createDarkIntentMappings(),
|
|
265
|
+
colors: createDarkColorMappings(),
|
|
266
|
+
|
|
267
|
+
typography: {
|
|
268
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
269
|
+
},
|
|
270
|
+
|
|
271
|
+
borderRadius: {
|
|
272
|
+
sm: 4,
|
|
273
|
+
md: 8,
|
|
274
|
+
lg: 12,
|
|
275
|
+
xl: 16,
|
|
276
|
+
xxl: 20,
|
|
277
|
+
},
|
|
278
|
+
|
|
279
|
+
spacing: {
|
|
280
|
+
xs: 4,
|
|
281
|
+
sm: 8,
|
|
282
|
+
md: 16,
|
|
283
|
+
lg: 24,
|
|
284
|
+
xl: 32,
|
|
285
|
+
xxl: 40,
|
|
286
|
+
xxxl: 48,
|
|
287
|
+
},
|
|
288
|
+
|
|
289
|
+
shadows: {
|
|
290
|
+
sm: {
|
|
291
|
+
shadowColor: '#000',
|
|
292
|
+
shadowOffset: { width: 0, height: 1 },
|
|
293
|
+
shadowOpacity: 0.2,
|
|
294
|
+
shadowRadius: 2,
|
|
295
|
+
elevation: 1,
|
|
296
|
+
},
|
|
297
|
+
md: {
|
|
298
|
+
shadowColor: '#000',
|
|
299
|
+
shadowOffset: { width: 0, height: 4 },
|
|
300
|
+
shadowOpacity: 0.3,
|
|
301
|
+
shadowRadius: 8,
|
|
302
|
+
elevation: 4,
|
|
303
|
+
},
|
|
304
|
+
lg: {
|
|
305
|
+
shadowColor: '#000',
|
|
306
|
+
shadowOffset: { width: 0, height: 8 },
|
|
307
|
+
shadowOpacity: 0.4,
|
|
308
|
+
shadowRadius: 16,
|
|
309
|
+
elevation: 8,
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
|
|
313
|
+
transitions: {
|
|
314
|
+
fast: '0.15s ease',
|
|
315
|
+
base: '0.2s ease',
|
|
316
|
+
slow: '0.3s ease',
|
|
317
|
+
button: 'all 0.2s ease',
|
|
318
|
+
fade: 'opacity 0.2s ease',
|
|
319
|
+
slide: 'transform 0.3s ease',
|
|
320
|
+
},
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// Export the created themes
|
|
325
|
+
export const defaultLightTheme = createDefaultLightTheme();
|
|
326
326
|
export const defaultDarkTheme = createDefaultDarkTheme();
|