@idealyst/theme 1.1.6 → 1.1.7

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