@idealyst/theme 1.1.6 → 1.1.8

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/src/lightTheme.ts CHANGED
@@ -1,878 +1,309 @@
1
- import { ButtonSizeValue, ColorValue, Pallet, Shade, Size } from "./theme";
2
- import { Theme } from "./theme/index";
1
+ import { createTheme } from './builder';
3
2
 
4
- export const lightTheme: Theme = {
5
- interaction: {
6
- focusedBackground: 'rgba(59, 130, 246, 0.08)',
7
- focusBorder: 'rgba(59, 130, 246, 0.3)',
8
- opacity: {
9
- hover: 0.9,
10
- active: 0.75,
11
- disabled: 0.5,
12
- },
13
- },
14
- shadows: {
15
- none: {},
16
- sm: {
17
- elevation: 1,
18
- shadowColor: 'rgb(0, 0, 0, 0.5)',
19
- shadowOffset: { width: 0, height: 1 },
20
- shadowOpacity: 0.08,
21
- shadowRadius: 1.0,
22
- boxShadow: '0px 1px 2px rgba(0, 0, 0, 0.1)',
23
- },
24
- md: {
25
- elevation: 2,
26
- shadowColor: 'rgb(0, 0, 0, 0.5)',
27
- shadowOffset: { width: 0, height: 3 },
28
- shadowOpacity: 0.1,
29
- shadowRadius: 4.65,
30
- boxShadow: '0px 3px 6px rgba(0, 0, 0, 0.16)',
31
- },
32
- lg: {
33
- elevation: 3,
34
- shadowColor: 'rgb(0, 0, 0, 0.5)',
35
- shadowOffset: { width: 0, height: 6 },
36
- shadowOpacity: 0.12,
37
- shadowRadius: 6.27,
38
- boxShadow: '0px 6px 12px rgba(0, 0, 0, 0.12)',
39
- },
40
- xl: {
41
- elevation: 4,
42
- shadowColor: 'rgb(0, 0, 0, 0.5)',
43
- shadowOffset: { width: 0, height: 12 },
44
- shadowOpacity: 0.14,
45
- shadowRadius: 16.0,
46
- boxShadow: '0px 12px 24px rgba(0, 0, 0, 0.18)',
47
- },
48
- },
49
- intents: {
50
- primary: {
51
- primary: '#3b82f6',
52
- contrast: '#ffffff',
53
- light: '#bfdbfe',
54
- dark: '#1e40af',
55
- },
56
- success: {
57
- primary: '#22c55e',
58
- contrast: '#ffffff',
59
- light: '#a7f3d0',
60
- dark: '#165e29',
61
- },
62
- error: {
63
- primary: '#ef4444',
64
- contrast: '#ffffff',
65
- light: '#fca5a1',
66
- dark: '#9b2222',
67
- },
68
- warning: {
69
- primary: '#f97316',
70
- contrast: '#ffffff',
71
- light: '#ffedd5',
72
- dark: '#9a6a00',
73
- },
74
- neutral: {
75
- primary: '#6b7280',
76
- contrast: '#ffffff',
77
- light: '#e5e7eb',
78
- dark: '#374151',
79
- },
80
- info: {
81
- primary: '#0ea5e9',
82
- contrast: '#ffffff',
83
- light: '#a5f3fc',
84
- dark: '#1e40af',
85
- },
86
- },
87
- colors: {
3
+ // =============================================================================
4
+ // Build Light Theme
5
+ // =============================================================================
6
+
7
+ // Note: No explicit type annotation - let TypeScript infer from builder
8
+ export const lightTheme = createTheme()
9
+ // Intents
10
+ .addIntent('primary', {
11
+ primary: '#3b82f6',
12
+ contrast: '#ffffff',
13
+ light: '#bfdbfe',
14
+ dark: '#1e40af',
15
+ })
16
+ .addIntent('success', {
17
+ primary: '#22c55e',
18
+ contrast: '#ffffff',
19
+ light: '#a7f3d0',
20
+ dark: '#165e29',
21
+ })
22
+ .addIntent('error', {
23
+ primary: '#ef4444',
24
+ contrast: '#ffffff',
25
+ light: '#fca5a1',
26
+ dark: '#9b2222',
27
+ })
28
+ .addIntent('warning', {
29
+ primary: '#f97316',
30
+ contrast: '#ffffff',
31
+ light: '#ffedd5',
32
+ dark: '#9a6a00',
33
+ })
34
+ .addIntent('neutral', {
35
+ primary: '#6b7280',
36
+ contrast: '#ffffff',
37
+ light: '#e5e7eb',
38
+ dark: '#374151',
39
+ })
40
+ .addIntent('info', {
41
+ primary: '#0ea5e9',
42
+ contrast: '#ffffff',
43
+ light: '#a5f3fc',
44
+ dark: '#1e40af',
45
+ })
46
+ // Radii
47
+ .addRadius('none', 0)
48
+ .addRadius('xs', 2)
49
+ .addRadius('sm', 4)
50
+ .addRadius('md', 8)
51
+ .addRadius('lg', 12)
52
+ .addRadius('xl', 16)
53
+ // Shadows
54
+ .addShadow('none', {})
55
+ .addShadow('sm', {
56
+ elevation: 1,
57
+ shadowColor: '#000000',
58
+ shadowOffset: { width: 0, height: 1 },
59
+ shadowOpacity: 0.08,
60
+ shadowRadius: 1,
61
+ boxShadow: '0px 1px 2px rgba(0, 0, 0, 0.1)',
62
+ })
63
+ .addShadow('md', {
64
+ elevation: 2,
65
+ shadowColor: '#000000',
66
+ shadowOffset: { width: 0, height: 3 },
67
+ shadowOpacity: 0.1,
68
+ shadowRadius: 4.65,
69
+ boxShadow: '0px 3px 9.3px rgba(0, 0, 0, 0.12)',
70
+ })
71
+ .addShadow('lg', {
72
+ elevation: 3,
73
+ shadowColor: '#000000',
74
+ shadowOffset: { width: 0, height: 6 },
75
+ shadowOpacity: 0.12,
76
+ shadowRadius: 6.27,
77
+ boxShadow: '0px 6px 12.54px rgba(0, 0, 0, 0.14)',
78
+ })
79
+ .addShadow('xl', {
80
+ elevation: 4,
81
+ shadowColor: '#000000',
82
+ shadowOffset: { width: 0, height: 12 },
83
+ shadowOpacity: 0.14,
84
+ shadowRadius: 16,
85
+ boxShadow: '0px 12px 32px rgba(0, 0, 0, 0.16)',
86
+ })
87
+ // Colors
88
+ .setColors({
88
89
  pallet: generateColorPallette(),
89
90
  surface: {
90
- primary: '#ffffff',
91
- secondary: '#f5f5f5',
92
- tertiary: '#e0e0e0',
93
- inverse: '#000000',
94
- 'inverse-secondary': 'rgba(0, 0, 0, 0.9)',
95
- 'inverse-tertiary': 'rgba(0, 0, 0, 0.7)',
91
+ primary: '#ffffff',
92
+ secondary: '#f5f5f5',
93
+ tertiary: '#e0e0e0',
94
+ inverse: '#000000',
95
+ 'inverse-secondary': 'rgba(0, 0, 0, 0.9)',
96
+ 'inverse-tertiary': 'rgba(0, 0, 0, 0.7)',
96
97
  },
97
98
  text: {
98
- primary: '#000000',
99
- secondary: '#333333',
100
- tertiary: '#666666',
101
- inverse: '#ffffff',
102
- 'inverse-secondary': 'rgba(255, 255, 255, 0.9)',
103
- 'inverse-tertiary': 'rgba(255, 255, 255, 0.7)',
99
+ primary: '#000000',
100
+ secondary: '#333333',
101
+ tertiary: '#666666',
102
+ inverse: '#ffffff',
103
+ 'inverse-secondary': 'rgba(255, 255, 255, 0.9)',
104
+ 'inverse-tertiary': 'rgba(255, 255, 255, 0.7)',
104
105
  },
105
106
  border: {
106
- primary: '#e0e0e0',
107
- secondary: '#d0d0d0',
108
- tertiary: '#c0c0c0',
109
- disabled: '#f0f0f0',
110
- },
111
- },
112
- sizes: {
107
+ primary: '#e0e0e0',
108
+ secondary: '#d0d0d0',
109
+ tertiary: '#c0c0c0',
110
+ disabled: '#f0f0f0',
111
+ },
112
+ })
113
+ // Sizes
114
+ .setSizes({
113
115
  button: {
114
- xs: {
115
- paddingVertical: 4,
116
- paddingHorizontal: 8,
117
- minHeight: 24,
118
- fontSize: 12,
119
- lineHeight: 16,
120
- iconSize: 12,
121
- },
122
- sm: {
123
- paddingVertical: 6,
124
- paddingHorizontal: 12,
125
- minHeight: 32,
126
- fontSize: 14,
127
- lineHeight: 20,
128
- iconSize: 14,
129
- },
130
- md: {
131
- paddingVertical: 8,
132
- paddingHorizontal: 16,
133
- minHeight: 40,
134
- fontSize: 16,
135
- lineHeight: 24,
136
- iconSize: 16,
137
- },
138
- lg: {
139
- paddingVertical: 10,
140
- paddingHorizontal: 20,
141
- minHeight: 48,
142
- fontSize: 18,
143
- lineHeight: 28,
144
- iconSize: 18,
145
- },
146
- xl: {
147
- paddingVertical: 12,
148
- paddingHorizontal: 24,
149
- minHeight: 56,
150
- fontSize: 20,
151
- lineHeight: 32,
152
- iconSize: 20,
153
- }
154
- } as Record<Size, ButtonSizeValue>,
116
+ xs: { paddingVertical: 4, paddingHorizontal: 8, minHeight: 24, fontSize: 12, lineHeight: 16, iconSize: 12 },
117
+ sm: { paddingVertical: 6, paddingHorizontal: 12, minHeight: 32, fontSize: 14, lineHeight: 20, iconSize: 14 },
118
+ md: { paddingVertical: 8, paddingHorizontal: 16, minHeight: 40, fontSize: 16, lineHeight: 24, iconSize: 16 },
119
+ lg: { paddingVertical: 10, paddingHorizontal: 20, minHeight: 48, fontSize: 18, lineHeight: 28, iconSize: 18 },
120
+ xl: { paddingVertical: 12, paddingHorizontal: 24, minHeight: 56, fontSize: 20, lineHeight: 32, iconSize: 20 },
121
+ },
155
122
  chip: {
156
- xs: {
157
- paddingVertical: 1,
158
- paddingHorizontal: 6,
159
- minHeight: 16,
160
- borderRadius: 999,
161
- fontSize: 10,
162
- lineHeight: 12,
163
- iconSize: 10,
164
- },
165
- sm: {
166
- paddingVertical: 2,
167
- paddingHorizontal: 8,
168
- minHeight: 20,
169
- borderRadius: 999,
170
- fontSize: 11,
171
- lineHeight: 14,
172
- iconSize: 12,
173
- },
174
- md: {
175
- paddingVertical: 2,
176
- paddingHorizontal: 10,
177
- minHeight: 24,
178
- borderRadius: 999,
179
- fontSize: 12,
180
- lineHeight: 16,
181
- iconSize: 14,
182
- },
183
- lg: {
184
- paddingVertical: 3,
185
- paddingHorizontal: 12,
186
- minHeight: 28,
187
- borderRadius: 999,
188
- fontSize: 14,
189
- lineHeight: 18,
190
- iconSize: 16,
191
- },
192
- xl: {
193
- paddingVertical: 4,
194
- paddingHorizontal: 14,
195
- minHeight: 32,
196
- borderRadius: 999,
197
- fontSize: 16,
198
- lineHeight: 20,
199
- iconSize: 18,
200
- }
123
+ xs: { paddingVertical: 1, paddingHorizontal: 6, minHeight: 16, borderRadius: 999, fontSize: 10, lineHeight: 12, iconSize: 10 },
124
+ sm: { paddingVertical: 2, paddingHorizontal: 8, minHeight: 20, borderRadius: 999, fontSize: 11, lineHeight: 14, iconSize: 12 },
125
+ md: { paddingVertical: 2, paddingHorizontal: 10, minHeight: 24, borderRadius: 999, fontSize: 12, lineHeight: 16, iconSize: 14 },
126
+ lg: { paddingVertical: 3, paddingHorizontal: 12, minHeight: 28, borderRadius: 999, fontSize: 14, lineHeight: 18, iconSize: 16 },
127
+ xl: { paddingVertical: 4, paddingHorizontal: 14, minHeight: 32, borderRadius: 999, fontSize: 16, lineHeight: 20, iconSize: 18 },
201
128
  },
202
129
  badge: {
203
- xs: {
204
- minWidth: 12,
205
- height: 12,
206
- paddingHorizontal: 2,
207
- fontSize: 8,
208
- lineHeight: 10,
209
- iconSize: 8,
210
- },
211
- sm: {
212
- minWidth: 16,
213
- height: 16,
214
- paddingHorizontal: 4,
215
- fontSize: 10,
216
- lineHeight: 12,
217
- iconSize: 10,
218
- },
219
- md: {
220
- minWidth: 20,
221
- height: 20,
222
- paddingHorizontal: 6,
223
- fontSize: 12,
224
- lineHeight: 14,
225
- iconSize: 12,
226
- },
227
- lg: {
228
- minWidth: 24,
229
- height: 24,
230
- paddingHorizontal: 8,
231
- fontSize: 14,
232
- lineHeight: 16,
233
- iconSize: 14,
234
- },
235
- xl: {
236
- minWidth: 28,
237
- height: 28,
238
- paddingHorizontal: 10,
239
- fontSize: 16,
240
- lineHeight: 18,
241
- iconSize: 16,
242
- }
130
+ xs: { minWidth: 12, height: 12, paddingHorizontal: 2, fontSize: 8, lineHeight: 10, iconSize: 8 },
131
+ sm: { minWidth: 16, height: 16, paddingHorizontal: 4, fontSize: 10, lineHeight: 12, iconSize: 10 },
132
+ md: { minWidth: 20, height: 20, paddingHorizontal: 6, fontSize: 12, lineHeight: 14, iconSize: 12 },
133
+ lg: { minWidth: 24, height: 24, paddingHorizontal: 8, fontSize: 14, lineHeight: 16, iconSize: 14 },
134
+ xl: { minWidth: 28, height: 28, paddingHorizontal: 10, fontSize: 16, lineHeight: 18, iconSize: 16 },
243
135
  },
244
136
  icon: {
245
- xs: {
246
- width: 12,
247
- height: 12,
248
- fontSize: 12,
249
- },
250
- sm: {
251
- width: 16,
252
- height: 16,
253
- fontSize: 16,
254
- },
255
- md: {
256
- width: 24,
257
- height: 24,
258
- fontSize: 24,
259
- },
260
- lg: {
261
- width: 32,
262
- height: 32,
263
- fontSize: 32,
264
- },
265
- xl: {
266
- width: 48,
267
- height: 48,
268
- fontSize: 48,
269
- }
137
+ xs: { width: 12, height: 12, fontSize: 12 },
138
+ sm: { width: 16, height: 16, fontSize: 16 },
139
+ md: { width: 24, height: 24, fontSize: 24 },
140
+ lg: { width: 32, height: 32, fontSize: 32 },
141
+ xl: { width: 48, height: 48, fontSize: 48 },
270
142
  },
271
143
  input: {
272
- xs: {
273
- height: 28,
274
- paddingHorizontal: 6,
275
- fontSize: 12,
276
- iconSize: 12,
277
- iconMargin: 4,
278
- },
279
- sm: {
280
- height: 36,
281
- paddingHorizontal: 8,
282
- fontSize: 14,
283
- iconSize: 16,
284
- iconMargin: 4,
285
- },
286
- md: {
287
- height: 44,
288
- paddingHorizontal: 12,
289
- fontSize: 16,
290
- iconSize: 20,
291
- iconMargin: 6,
292
- },
293
- lg: {
294
- height: 52,
295
- paddingHorizontal: 16,
296
- fontSize: 18,
297
- iconSize: 24,
298
- iconMargin: 8,
299
- },
300
- xl: {
301
- height: 60,
302
- paddingHorizontal: 20,
303
- fontSize: 20,
304
- iconSize: 28,
305
- iconMargin: 10,
306
- }
144
+ xs: { height: 28, paddingHorizontal: 6, fontSize: 12, iconSize: 12, iconMargin: 4 },
145
+ sm: { height: 36, paddingHorizontal: 8, fontSize: 14, iconSize: 16, iconMargin: 4 },
146
+ md: { height: 44, paddingHorizontal: 12, fontSize: 16, iconSize: 20, iconMargin: 6 },
147
+ lg: { height: 52, paddingHorizontal: 16, fontSize: 18, iconSize: 24, iconMargin: 8 },
148
+ xl: { height: 60, paddingHorizontal: 20, fontSize: 20, iconSize: 28, iconMargin: 10 },
307
149
  },
308
150
  radioButton: {
309
- xs: {
310
- radioSize: 12,
311
- radioDotSize: 8,
312
- fontSize: 12,
313
- gap: 6,
314
- },
315
- sm: {
316
- radioSize: 14,
317
- radioDotSize: 10,
318
- fontSize: 14,
319
- gap: 8,
320
- },
321
- md: {
322
- radioSize: 18,
323
- radioDotSize: 12,
324
- fontSize: 16,
325
- gap: 8,
326
- },
327
- lg: {
328
- radioSize: 22,
329
- radioDotSize: 16,
330
- fontSize: 18,
331
- gap: 10,
332
- },
333
- xl: {
334
- radioSize: 26,
335
- radioDotSize: 20,
336
- fontSize: 20,
337
- gap: 12,
338
- }
151
+ xs: { radioSize: 12, radioDotSize: 8, fontSize: 12, gap: 6 },
152
+ sm: { radioSize: 14, radioDotSize: 10, fontSize: 14, gap: 8 },
153
+ md: { radioSize: 18, radioDotSize: 12, fontSize: 16, gap: 8 },
154
+ lg: { radioSize: 22, radioDotSize: 16, fontSize: 18, gap: 10 },
155
+ xl: { radioSize: 26, radioDotSize: 20, fontSize: 20, gap: 12 },
339
156
  },
340
157
  select: {
341
- xs: {
342
- paddingHorizontal: 8,
343
- minHeight: 28,
344
- fontSize: 12,
345
- iconSize: 16,
346
- },
347
- sm: {
348
- paddingHorizontal: 10,
349
- minHeight: 36,
350
- fontSize: 14,
351
- iconSize: 18,
352
- },
353
- md: {
354
- paddingHorizontal: 12,
355
- minHeight: 44,
356
- fontSize: 16,
357
- iconSize: 20,
358
- },
359
- lg: {
360
- paddingHorizontal: 16,
361
- minHeight: 52,
362
- fontSize: 18,
363
- iconSize: 24,
364
- },
365
- xl: {
366
- paddingHorizontal: 20,
367
- minHeight: 60,
368
- fontSize: 20,
369
- iconSize: 28,
370
- }
158
+ xs: { paddingHorizontal: 8, minHeight: 28, fontSize: 12, iconSize: 16 },
159
+ sm: { paddingHorizontal: 10, minHeight: 36, fontSize: 14, iconSize: 18 },
160
+ md: { paddingHorizontal: 12, minHeight: 44, fontSize: 16, iconSize: 20 },
161
+ lg: { paddingHorizontal: 16, minHeight: 52, fontSize: 18, iconSize: 24 },
162
+ xl: { paddingHorizontal: 20, minHeight: 60, fontSize: 20, iconSize: 28 },
371
163
  },
372
164
  slider: {
373
- xs: {
374
- trackHeight: 2,
375
- thumbSize: 12,
376
- thumbIconSize: 8,
377
- markHeight: 6,
378
- labelFontSize: 10,
379
- },
380
- sm: {
381
- trackHeight: 4,
382
- thumbSize: 16,
383
- thumbIconSize: 10,
384
- markHeight: 8,
385
- labelFontSize: 11,
386
- },
387
- md: {
388
- trackHeight: 6,
389
- thumbSize: 20,
390
- thumbIconSize: 12,
391
- markHeight: 10,
392
- labelFontSize: 12,
393
- },
394
- lg: {
395
- trackHeight: 8,
396
- thumbSize: 24,
397
- thumbIconSize: 16,
398
- markHeight: 12,
399
- labelFontSize: 13,
400
- },
401
- xl: {
402
- trackHeight: 10,
403
- thumbSize: 28,
404
- thumbIconSize: 18,
405
- markHeight: 14,
406
- labelFontSize: 14,
407
- }
165
+ xs: { trackHeight: 2, thumbSize: 12, thumbIconSize: 8, markHeight: 6, labelFontSize: 10 },
166
+ sm: { trackHeight: 4, thumbSize: 16, thumbIconSize: 10, markHeight: 8, labelFontSize: 11 },
167
+ md: { trackHeight: 6, thumbSize: 20, thumbIconSize: 12, markHeight: 10, labelFontSize: 12 },
168
+ lg: { trackHeight: 8, thumbSize: 24, thumbIconSize: 16, markHeight: 12, labelFontSize: 13 },
169
+ xl: { trackHeight: 10, thumbSize: 28, thumbIconSize: 18, markHeight: 14, labelFontSize: 14 },
408
170
  },
409
171
  switch: {
410
- xs: {
411
- trackWidth: 32,
412
- trackHeight: 18,
413
- thumbSize: 14,
414
- thumbIconSize: 8,
415
- translateX: 14,
416
- },
417
- sm: {
418
- trackWidth: 36,
419
- trackHeight: 20,
420
- thumbSize: 16,
421
- thumbIconSize: 10,
422
- translateX: 16,
423
- },
424
- md: {
425
- trackWidth: 44,
426
- trackHeight: 24,
427
- thumbSize: 20,
428
- thumbIconSize: 12,
429
- translateX: 20,
430
- },
431
- lg: {
432
- trackWidth: 52,
433
- trackHeight: 28,
434
- thumbSize: 24,
435
- thumbIconSize: 14,
436
- translateX: 24,
437
- },
438
- xl: {
439
- trackWidth: 60,
440
- trackHeight: 32,
441
- thumbSize: 28,
442
- thumbIconSize: 16,
443
- translateX: 28,
444
- }
172
+ xs: { trackWidth: 32, trackHeight: 18, thumbSize: 14, thumbIconSize: 8, translateX: 14 },
173
+ sm: { trackWidth: 36, trackHeight: 20, thumbSize: 16, thumbIconSize: 10, translateX: 16 },
174
+ md: { trackWidth: 44, trackHeight: 24, thumbSize: 20, thumbIconSize: 12, translateX: 20 },
175
+ lg: { trackWidth: 52, trackHeight: 28, thumbSize: 24, thumbIconSize: 14, translateX: 24 },
176
+ xl: { trackWidth: 60, trackHeight: 32, thumbSize: 28, thumbIconSize: 16, translateX: 28 },
445
177
  },
446
178
  textarea: {
447
- xs: {
448
- fontSize: 12,
449
- padding: 6,
450
- lineHeight: 18,
451
- minHeight: 60,
452
- },
453
- sm: {
454
- fontSize: 14,
455
- padding: 8,
456
- lineHeight: 20,
457
- minHeight: 80,
458
- },
459
- md: {
460
- fontSize: 16,
461
- padding: 12,
462
- lineHeight: 24,
463
- minHeight: 100,
464
- },
465
- lg: {
466
- fontSize: 18,
467
- padding: 16,
468
- lineHeight: 28,
469
- minHeight: 120,
470
- },
471
- xl: {
472
- fontSize: 20,
473
- padding: 20,
474
- lineHeight: 32,
475
- minHeight: 140,
476
- }
179
+ xs: { fontSize: 12, padding: 6, lineHeight: 18, minHeight: 60 },
180
+ sm: { fontSize: 14, padding: 8, lineHeight: 20, minHeight: 80 },
181
+ md: { fontSize: 16, padding: 12, lineHeight: 24, minHeight: 100 },
182
+ lg: { fontSize: 18, padding: 16, lineHeight: 28, minHeight: 120 },
183
+ xl: { fontSize: 20, padding: 20, lineHeight: 32, minHeight: 140 },
477
184
  },
478
185
  avatar: {
479
- xs: {
480
- width: 24,
481
- height: 24,
482
- fontSize: 12,
483
- },
484
- sm: {
485
- width: 32,
486
- height: 32,
487
- fontSize: 14,
488
- },
489
- md: {
490
- width: 40,
491
- height: 40,
492
- fontSize: 16,
493
- },
494
- lg: {
495
- width: 48,
496
- height: 48,
497
- fontSize: 18,
498
- },
499
- xl: {
500
- width: 64,
501
- height: 64,
502
- fontSize: 24,
503
- }
186
+ xs: { width: 24, height: 24, fontSize: 12 },
187
+ sm: { width: 32, height: 32, fontSize: 14 },
188
+ md: { width: 40, height: 40, fontSize: 16 },
189
+ lg: { width: 48, height: 48, fontSize: 18 },
190
+ xl: { width: 64, height: 64, fontSize: 24 },
504
191
  },
505
192
  progress: {
506
- xs: {
507
- linearHeight: 2,
508
- circularSize: 24,
509
- labelFontSize: 10,
510
- circularLabelFontSize: 8,
511
- },
512
- sm: {
513
- linearHeight: 4,
514
- circularSize: 32,
515
- labelFontSize: 12,
516
- circularLabelFontSize: 10,
517
- },
518
- md: {
519
- linearHeight: 8,
520
- circularSize: 48,
521
- labelFontSize: 14,
522
- circularLabelFontSize: 12,
523
- },
524
- lg: {
525
- linearHeight: 12,
526
- circularSize: 64,
527
- labelFontSize: 16,
528
- circularLabelFontSize: 14,
529
- },
530
- xl: {
531
- linearHeight: 16,
532
- circularSize: 80,
533
- labelFontSize: 18,
534
- circularLabelFontSize: 16,
535
- }
193
+ xs: { linearHeight: 2, circularSize: 24, labelFontSize: 10, circularLabelFontSize: 8 },
194
+ sm: { linearHeight: 4, circularSize: 32, labelFontSize: 12, circularLabelFontSize: 10 },
195
+ md: { linearHeight: 8, circularSize: 48, labelFontSize: 14, circularLabelFontSize: 12 },
196
+ lg: { linearHeight: 12, circularSize: 64, labelFontSize: 16, circularLabelFontSize: 14 },
197
+ xl: { linearHeight: 16, circularSize: 80, labelFontSize: 18, circularLabelFontSize: 16 },
536
198
  },
537
199
  accordion: {
538
- xs: {
539
- headerPadding: 8,
540
- headerFontSize: 12,
541
- iconSize: 16,
542
- contentPadding: 8,
543
- },
544
- sm: {
545
- headerPadding: 12,
546
- headerFontSize: 14,
547
- iconSize: 18,
548
- contentPadding: 12,
549
- },
550
- md: {
551
- headerPadding: 16,
552
- headerFontSize: 16,
553
- iconSize: 20,
554
- contentPadding: 16,
555
- },
556
- lg: {
557
- headerPadding: 20,
558
- headerFontSize: 18,
559
- iconSize: 24,
560
- contentPadding: 20,
561
- },
562
- xl: {
563
- headerPadding: 24,
564
- headerFontSize: 20,
565
- iconSize: 28,
566
- contentPadding: 24,
567
- }
200
+ xs: { headerPadding: 8, headerFontSize: 12, iconSize: 16, contentPadding: 8 },
201
+ sm: { headerPadding: 12, headerFontSize: 14, iconSize: 18, contentPadding: 12 },
202
+ md: { headerPadding: 16, headerFontSize: 16, iconSize: 20, contentPadding: 16 },
203
+ lg: { headerPadding: 20, headerFontSize: 18, iconSize: 24, contentPadding: 20 },
204
+ xl: { headerPadding: 24, headerFontSize: 20, iconSize: 28, contentPadding: 24 },
568
205
  },
569
206
  activityIndicator: {
570
- xs: {
571
- size: 16,
572
- borderWidth: 2,
573
- },
574
- sm: {
575
- size: 20,
576
- borderWidth: 2,
577
- },
578
- md: {
579
- size: 36,
580
- borderWidth: 3,
581
- },
582
- lg: {
583
- size: 48,
584
- borderWidth: 4,
585
- },
586
- xl: {
587
- size: 64,
588
- borderWidth: 5,
589
- }
207
+ xs: { size: 16, borderWidth: 2 },
208
+ sm: { size: 20, borderWidth: 2 },
209
+ md: { size: 36, borderWidth: 3 },
210
+ lg: { size: 48, borderWidth: 4 },
211
+ xl: { size: 64, borderWidth: 5 },
590
212
  },
591
213
  breadcrumb: {
592
- xs: {
593
- fontSize: 10,
594
- lineHeight: 14,
595
- iconSize: 12,
596
- },
597
- sm: {
598
- fontSize: 12,
599
- lineHeight: 16,
600
- iconSize: 14,
601
- },
602
- md: {
603
- fontSize: 14,
604
- lineHeight: 20,
605
- iconSize: 16,
606
- },
607
- lg: {
608
- fontSize: 16,
609
- lineHeight: 24,
610
- iconSize: 18,
611
- },
612
- xl: {
613
- fontSize: 18,
614
- lineHeight: 28,
615
- iconSize: 20,
616
- }
214
+ xs: { fontSize: 10, lineHeight: 14, iconSize: 12 },
215
+ sm: { fontSize: 12, lineHeight: 16, iconSize: 14 },
216
+ md: { fontSize: 14, lineHeight: 20, iconSize: 16 },
217
+ lg: { fontSize: 16, lineHeight: 24, iconSize: 18 },
218
+ xl: { fontSize: 18, lineHeight: 28, iconSize: 20 },
617
219
  },
618
220
  list: {
619
- xs: {
620
- paddingVertical: 2,
621
- paddingHorizontal: 3,
622
- minHeight: 28,
623
- iconSize: 14,
624
- labelFontSize: 12,
625
- labelLineHeight: 16,
626
- },
627
- sm: {
628
- paddingVertical: 4,
629
- paddingHorizontal: 8,
630
- minHeight: 32,
631
- iconSize: 16,
632
- labelFontSize: 14,
633
- labelLineHeight: 20,
634
- },
635
- md: {
636
- paddingVertical: 4,
637
- paddingHorizontal: 12,
638
- minHeight: 44,
639
- iconSize: 20,
640
- labelFontSize: 16,
641
- labelLineHeight: 24,
642
- },
643
- lg: {
644
- paddingVertical: 6,
645
- paddingHorizontal: 16,
646
- minHeight: 52,
647
- iconSize: 24,
648
- labelFontSize: 18,
649
- labelLineHeight: 28,
650
- },
651
- xl: {
652
- paddingVertical: 8,
653
- paddingHorizontal: 20,
654
- minHeight: 60,
655
- iconSize: 28,
656
- labelFontSize: 20,
657
- labelLineHeight: 32,
658
- }
221
+ xs: { paddingVertical: 2, paddingHorizontal: 3, minHeight: 28, iconSize: 14, labelFontSize: 12, labelLineHeight: 16 },
222
+ sm: { paddingVertical: 4, paddingHorizontal: 8, minHeight: 32, iconSize: 16, labelFontSize: 14, labelLineHeight: 20 },
223
+ md: { paddingVertical: 4, paddingHorizontal: 12, minHeight: 44, iconSize: 20, labelFontSize: 16, labelLineHeight: 24 },
224
+ lg: { paddingVertical: 6, paddingHorizontal: 16, minHeight: 52, iconSize: 24, labelFontSize: 18, labelLineHeight: 28 },
225
+ xl: { paddingVertical: 8, paddingHorizontal: 20, minHeight: 60, iconSize: 28, labelFontSize: 20, labelLineHeight: 32 },
659
226
  },
660
227
  menu: {
661
- xs: {
662
- paddingVertical: 2,
663
- paddingHorizontal: 6,
664
- iconSize: 14,
665
- labelFontSize: 12,
666
- },
667
- sm: {
668
- paddingVertical: 4,
669
- paddingHorizontal: 8,
670
- iconSize: 16,
671
- labelFontSize: 14,
672
- },
673
- md: {
674
- paddingVertical: 8,
675
- paddingHorizontal: 16,
676
- iconSize: 20,
677
- labelFontSize: 16,
678
- },
679
- lg: {
680
- paddingVertical: 16,
681
- paddingHorizontal: 24,
682
- iconSize: 24,
683
- labelFontSize: 18,
684
- },
685
- xl: {
686
- paddingVertical: 20,
687
- paddingHorizontal: 28,
688
- iconSize: 28,
689
- labelFontSize: 20,
690
- }
228
+ xs: { paddingVertical: 2, paddingHorizontal: 6, iconSize: 14, labelFontSize: 12 },
229
+ sm: { paddingVertical: 4, paddingHorizontal: 8, iconSize: 16, labelFontSize: 14 },
230
+ md: { paddingVertical: 8, paddingHorizontal: 16, iconSize: 20, labelFontSize: 16 },
231
+ lg: { paddingVertical: 16, paddingHorizontal: 24, iconSize: 24, labelFontSize: 18 },
232
+ xl: { paddingVertical: 20, paddingHorizontal: 28, iconSize: 28, labelFontSize: 20 },
691
233
  },
692
234
  text: {
693
- xs: {
694
- fontSize: 12,
695
- lineHeight: 18,
696
- },
697
- sm: {
698
- fontSize: 14,
699
- lineHeight: 21,
700
- },
701
- md: {
702
- fontSize: 16,
703
- lineHeight: 24,
704
- },
705
- lg: {
706
- fontSize: 18,
707
- lineHeight: 25.2,
708
- },
709
- xl: {
710
- fontSize: 24,
711
- lineHeight: 31.92,
712
- }
235
+ xs: { fontSize: 12, lineHeight: 18 },
236
+ sm: { fontSize: 14, lineHeight: 21 },
237
+ md: { fontSize: 16, lineHeight: 24 },
238
+ lg: { fontSize: 18, lineHeight: 25.2 },
239
+ xl: { fontSize: 24, lineHeight: 31.92 },
713
240
  },
714
241
  tabBar: {
715
- xs: {
716
- fontSize: 12,
717
- lineHeight: 18,
718
- padding: 6,
719
- },
720
- sm: {
721
- fontSize: 14,
722
- lineHeight: 20,
723
- padding: 8,
724
- },
725
- md: {
726
- fontSize: 16,
727
- lineHeight: 24,
728
- padding: 12,
729
- },
730
- lg: {
731
- fontSize: 18,
732
- lineHeight: 28,
733
- padding: 16,
734
- },
735
- xl: {
736
- fontSize: 20,
737
- lineHeight: 32,
738
- padding: 20,
739
- }
242
+ xs: { fontSize: 12, lineHeight: 18, padding: 6 },
243
+ sm: { fontSize: 14, lineHeight: 20, padding: 8 },
244
+ md: { fontSize: 16, lineHeight: 24, padding: 12 },
245
+ lg: { fontSize: 18, lineHeight: 28, padding: 16 },
246
+ xl: { fontSize: 20, lineHeight: 32, padding: 20 },
740
247
  },
741
248
  table: {
742
- xs: {
743
- padding: 6,
744
- fontSize: 12,
745
- lineHeight: 16,
746
- },
747
- sm: {
748
- padding: 8,
749
- fontSize: 13,
750
- lineHeight: 18,
751
- },
752
- md: {
753
- padding: 16,
754
- fontSize: 14,
755
- lineHeight: 20,
756
- },
757
- lg: {
758
- padding: 24,
759
- fontSize: 15,
760
- lineHeight: 22,
761
- },
762
- xl: {
763
- padding: 32,
764
- fontSize: 16,
765
- lineHeight: 24,
766
- }
249
+ xs: { padding: 6, fontSize: 12, lineHeight: 16 },
250
+ sm: { padding: 8, fontSize: 13, lineHeight: 18 },
251
+ md: { padding: 16, fontSize: 14, lineHeight: 20 },
252
+ lg: { padding: 24, fontSize: 15, lineHeight: 22 },
253
+ xl: { padding: 32, fontSize: 16, lineHeight: 24 },
767
254
  },
768
255
  tooltip: {
769
- xs: {
770
- fontSize: 11,
771
- padding: 4,
772
- },
773
- sm: {
774
- fontSize: 12,
775
- padding: 6,
776
- },
777
- md: {
778
- fontSize: 14,
779
- padding: 8,
780
- },
781
- lg: {
782
- fontSize: 16,
783
- padding: 10,
784
- },
785
- xl: {
786
- fontSize: 18,
787
- padding: 12,
788
- },
256
+ xs: { fontSize: 11, padding: 4 },
257
+ sm: { fontSize: 12, padding: 6 },
258
+ md: { fontSize: 14, padding: 8 },
259
+ lg: { fontSize: 16, padding: 10 },
260
+ xl: { fontSize: 18, padding: 12 },
789
261
  },
790
262
  view: {
791
- xs: {
792
- padding: 4,
793
- spacing: 4,
794
- },
795
- sm: {
796
- padding: 8,
797
- spacing: 8,
798
- },
799
- md: {
800
- padding: 16,
801
- spacing: 16,
802
- },
803
- lg: {
804
- padding: 24,
805
- spacing: 24,
806
- },
807
- xl: {
808
- padding: 32,
809
- spacing: 32,
810
- }
263
+ xs: { padding: 4, spacing: 4 },
264
+ sm: { padding: 8, spacing: 8 },
265
+ md: { padding: 16, spacing: 16 },
266
+ lg: { padding: 24, spacing: 24 },
267
+ xl: { padding: 32, spacing: 32 },
811
268
  },
812
269
  typography: {
813
- h1: {
814
- fontSize: 32,
815
- lineHeight: 40,
816
- fontWeight: '700',
817
- },
818
- h2: {
819
- fontSize: 28,
820
- lineHeight: 36,
821
- fontWeight: '700',
822
- },
823
- h3: {
824
- fontSize: 24,
825
- lineHeight: 32,
826
- fontWeight: '600',
827
- },
828
- h4: {
829
- fontSize: 20,
830
- lineHeight: 28,
831
- fontWeight: '600',
832
- },
833
- h5: {
834
- fontSize: 18,
835
- lineHeight: 26,
836
- fontWeight: '600',
837
- },
838
- h6: {
839
- fontSize: 16,
840
- lineHeight: 24,
841
- fontWeight: '600',
842
- },
843
- subtitle1: {
844
- fontSize: 16,
845
- lineHeight: 24,
846
- fontWeight: '500',
847
- },
848
- subtitle2: {
849
- fontSize: 14,
850
- lineHeight: 20,
851
- fontWeight: '500',
852
- },
853
- body1: {
854
- fontSize: 16,
855
- lineHeight: 24,
856
- fontWeight: '400',
857
- },
858
- body2: {
859
- fontSize: 14,
860
- lineHeight: 20,
861
- fontWeight: '400',
862
- },
863
- caption: {
864
- fontSize: 12,
865
- lineHeight: 16,
866
- fontWeight: '400',
867
- },
868
- }
869
- }
870
- } as Theme
270
+ h1: { fontSize: 32, lineHeight: 40, fontWeight: '700' },
271
+ h2: { fontSize: 28, lineHeight: 36, fontWeight: '700' },
272
+ h3: { fontSize: 24, lineHeight: 32, fontWeight: '600' },
273
+ h4: { fontSize: 20, lineHeight: 28, fontWeight: '600' },
274
+ h5: { fontSize: 18, lineHeight: 26, fontWeight: '600' },
275
+ h6: { fontSize: 16, lineHeight: 24, fontWeight: '600' },
276
+ subtitle1: { fontSize: 16, lineHeight: 24, fontWeight: '500' },
277
+ subtitle2: { fontSize: 14, lineHeight: 20, fontWeight: '500' },
278
+ body1: { fontSize: 16, lineHeight: 24, fontWeight: '400' },
279
+ body2: { fontSize: 14, lineHeight: 20, fontWeight: '400' },
280
+ caption: { fontSize: 12, lineHeight: 16, fontWeight: '400' },
281
+ },
282
+ })
283
+ // Interaction
284
+ .setInteraction({
285
+ focusedBackground: 'rgba(59, 130, 246, 0.08)',
286
+ focusBorder: 'rgba(59, 130, 246, 0.3)',
287
+ opacity: {
288
+ hover: 0.9,
289
+ active: 0.75,
290
+ disabled: 0.5,
291
+ },
292
+ })
293
+ .build();
294
+
295
+ // =============================================================================
296
+ // Color Palette Generator
297
+ // =============================================================================
298
+
299
+ // Local types to avoid circular dependency with RegisteredTheme
300
+ type BasePallet = 'red' | 'blue' | 'green' | 'yellow' | 'purple' | 'gray' | 'orange' | 'black' | 'white';
301
+ type BaseShade = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
871
302
 
872
- function generateColorPallette() {
873
- const colors = {} as Record<Pallet, Record<Shade, ColorValue>>
303
+ function generateColorPallette() {
304
+ const colors = {} as Record<BasePallet, Record<BaseShade, string>>;
874
305
 
875
- const baseColors: Record<Pallet, ColorValue> = {
306
+ const baseColors: Record<BasePallet, string> = {
876
307
  red: '#ef4444',
877
308
  blue: '#3b82f6',
878
309
  green: '#22c55e',
@@ -882,58 +313,54 @@ export const lightTheme: Theme = {
882
313
  orange: '#f97316',
883
314
  black: '#000000',
884
315
  white: '#ffffff',
885
- };
316
+ };
886
317
 
887
- // Helper function to convert hex to RGB
888
- const hexToRgb = (hex: string): [number, number, number] => {
318
+ const hexToRgb = (hex: string): [number, number, number] => {
889
319
  const r = parseInt(hex.slice(1, 3), 16);
890
320
  const g = parseInt(hex.slice(3, 5), 16);
891
321
  const b = parseInt(hex.slice(5, 7), 16);
892
322
  return [r, g, b];
893
- };
323
+ };
894
324
 
895
- // Helper function to convert RGB to hex
896
- const rgbToHex = (r: number, g: number, b: number): string => {
325
+ const rgbToHex = (r: number, g: number, b: number): string => {
897
326
  const toHex = (n: number) => Math.round(n).toString(16).padStart(2, '0');
898
327
  return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
899
- };
328
+ };
900
329
 
901
- // Helper function to interpolate between two colors
902
- const interpolate = (color1: [number, number, number], color2: [number, number, number], factor: number): [number, number, number] => {
330
+ const interpolate = (
331
+ color1: [number, number, number],
332
+ color2: [number, number, number],
333
+ factor: number
334
+ ): [number, number, number] => {
903
335
  return [
904
- color1[0] + (color2[0] - color1[0]) * factor,
905
- color1[1] + (color2[1] - color1[1]) * factor,
906
- color1[2] + (color2[2] - color1[2]) * factor,
336
+ color1[0] + (color2[0] - color1[0]) * factor,
337
+ color1[1] + (color2[1] - color1[1]) * factor,
338
+ color1[2] + (color2[2] - color1[2]) * factor,
907
339
  ];
908
- };
340
+ };
909
341
 
910
- const shades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
911
- const white: [number, number, number] = [255, 255, 255];
912
- const black: [number, number, number] = [0, 0, 0];
342
+ const shades: BaseShade[] = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
343
+ const white: [number, number, number] = [255, 255, 255];
344
+ const black: [number, number, number] = [0, 0, 0];
913
345
 
914
- for (const [colorName, baseColor] of Object.entries(baseColors)) {
915
- colors[colorName] = {} as Record<Shade, ColorValue>;
346
+ for (const [colorName, baseColor] of Object.entries(baseColors)) {
347
+ colors[colorName as BasePallet] = {} as Record<BaseShade, string>;
916
348
  const baseRgb = hexToRgb(baseColor);
917
349
 
918
350
  for (const shade of shades) {
919
- if (shade === 500) {
920
- // 500 is the base color
921
- colors[colorName][shade] = baseColor;
922
- } else if (shade < 500) {
923
- // Lighter shades - interpolate towards white
924
- // 50 is closest to white, 400 is closest to base
925
- const factor = (500 - shade) / 450; // 450 = 500 - 50
926
- const interpolated = interpolate(baseRgb, white, factor);
927
- colors[colorName][shade] = rgbToHex(...interpolated);
928
- } else {
929
- // Darker shades - interpolate towards black
930
- // 600 is closest to base, 900 is closest to black
931
- const factor = (shade - 500) / 400; // 400 = 900 - 500
932
- const interpolated = interpolate(baseRgb, black, factor);
933
- colors[colorName][shade] = rgbToHex(...interpolated);
934
- }
351
+ if (shade === 500) {
352
+ colors[colorName as BasePallet][shade] = baseColor;
353
+ } else if (shade < 500) {
354
+ const factor = (500 - shade) / 450;
355
+ const interpolated = interpolate(baseRgb, white, factor);
356
+ colors[colorName as BasePallet][shade] = rgbToHex(...interpolated);
357
+ } else {
358
+ const factor = (shade - 500) / 400;
359
+ const interpolated = interpolate(baseRgb, black, factor);
360
+ colors[colorName as BasePallet][shade] = rgbToHex(...interpolated);
361
+ }
935
362
  }
936
- }
363
+ }
937
364
 
938
- return colors;
939
- }
365
+ return colors;
366
+ }