@thesage/ui 0.0.9

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.
Files changed (43) hide show
  1. package/dist/fontThemes-Bwf7_lFg.d.mts +842 -0
  2. package/dist/fontThemes-Bwf7_lFg.d.ts +842 -0
  3. package/dist/hooks-C8PrmIXy.d.mts +225 -0
  4. package/dist/hooks-Ct9RBhg-.d.ts +225 -0
  5. package/dist/hooks.d.mts +3 -0
  6. package/dist/hooks.d.ts +3 -0
  7. package/dist/hooks.js +1342 -0
  8. package/dist/hooks.js.map +1 -0
  9. package/dist/hooks.mjs +1314 -0
  10. package/dist/hooks.mjs.map +1 -0
  11. package/dist/index-CsnncHSm.d.mts +23 -0
  12. package/dist/index-CsnncHSm.d.ts +23 -0
  13. package/dist/index.d.mts +2830 -0
  14. package/dist/index.d.ts +2830 -0
  15. package/dist/index.js +12637 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/index.mjs +12319 -0
  18. package/dist/index.mjs.map +1 -0
  19. package/dist/providers-Dv3LFGtJ.d.mts +17 -0
  20. package/dist/providers-Dv3LFGtJ.d.ts +17 -0
  21. package/dist/providers.d.mts +2 -0
  22. package/dist/providers.d.ts +2 -0
  23. package/dist/providers.js +1944 -0
  24. package/dist/providers.js.map +1 -0
  25. package/dist/providers.mjs +1918 -0
  26. package/dist/providers.mjs.map +1 -0
  27. package/dist/tokens.d.mts +831 -0
  28. package/dist/tokens.d.ts +831 -0
  29. package/dist/tokens.js +2399 -0
  30. package/dist/tokens.js.map +1 -0
  31. package/dist/tokens.mjs +2319 -0
  32. package/dist/tokens.mjs.map +1 -0
  33. package/dist/utils-DlJKRVzQ.d.mts +986 -0
  34. package/dist/utils-xrpHqxXR.d.ts +986 -0
  35. package/dist/utils.d.mts +4 -0
  36. package/dist/utils.d.ts +4 -0
  37. package/dist/utils.js +873 -0
  38. package/dist/utils.js.map +1 -0
  39. package/dist/utils.mjs +805 -0
  40. package/dist/utils.mjs.map +1 -0
  41. package/dist/validation-Bj1ye-v_.d.mts +114 -0
  42. package/dist/validation-Bj1ye-v_.d.ts +114 -0
  43. package/package.json +117 -0
@@ -0,0 +1,1918 @@
1
+ "use client";
2
+
3
+ // src/providers/ThemeProvider.tsx
4
+ import { useEffect, useState } from "react";
5
+
6
+ // src/lib/store/theme.ts
7
+ import { create } from "zustand";
8
+ import { persist } from "zustand/middleware";
9
+ var useThemeStore = create()(
10
+ persist(
11
+ (set, get) => ({
12
+ // Defaults
13
+ theme: "volt",
14
+ mode: "dark",
15
+ // Actions
16
+ setTheme: (theme) => set({ theme }),
17
+ setMode: (mode) => set({ mode }),
18
+ toggleMode: () => set((state) => ({ mode: state.mode === "light" ? "dark" : "light" })),
19
+ // Computed
20
+ get themeConfig() {
21
+ const state = get();
22
+ return { name: state.theme, mode: state.mode };
23
+ }
24
+ }),
25
+ {
26
+ name: "ecosystem-theme",
27
+ // Only persist theme and mode
28
+ partialize: (state) => ({
29
+ theme: state.theme,
30
+ mode: state.mode
31
+ })
32
+ }
33
+ )
34
+ );
35
+
36
+ // src/lib/store/customizer.ts
37
+ import { create as create2 } from "zustand";
38
+ import { persist as persist2 } from "zustand/middleware";
39
+
40
+ // ../tokens/src/base.ts
41
+ var baseTokens = {
42
+ /**
43
+ * Spacing scale (based on 4px grid)
44
+ */
45
+ spacing: {
46
+ "0": "0",
47
+ "0.5": "0.125rem",
48
+ // 2px
49
+ "1": "0.25rem",
50
+ // 4px
51
+ "2": "0.5rem",
52
+ // 8px
53
+ "3": "0.75rem",
54
+ // 12px
55
+ "4": "1rem",
56
+ // 16px
57
+ "5": "1.25rem",
58
+ // 20px
59
+ "6": "1.5rem",
60
+ // 24px
61
+ "8": "2rem",
62
+ // 32px
63
+ "10": "2.5rem",
64
+ // 40px
65
+ "12": "3rem",
66
+ // 48px
67
+ "16": "4rem",
68
+ // 64px
69
+ "20": "5rem",
70
+ // 80px
71
+ "24": "6rem",
72
+ // 96px
73
+ "32": "8rem"
74
+ // 128px
75
+ },
76
+ /**
77
+ * Typography scales
78
+ */
79
+ fontSize: {
80
+ "xs": "0.75rem",
81
+ // 12px
82
+ "sm": "0.875rem",
83
+ // 14px
84
+ "base": "1rem",
85
+ // 16px
86
+ "lg": "1.125rem",
87
+ // 18px
88
+ "xl": "1.25rem",
89
+ // 20px
90
+ "2xl": "1.5rem",
91
+ // 24px
92
+ "3xl": "1.875rem",
93
+ // 30px
94
+ "4xl": "2.25rem",
95
+ // 36px
96
+ "5xl": "3rem",
97
+ // 48px
98
+ "6xl": "3.75rem",
99
+ // 60px
100
+ "7xl": "4.5rem",
101
+ // 72px
102
+ "8xl": "6rem"
103
+ // 96px
104
+ },
105
+ fontWeight: {
106
+ light: "300",
107
+ normal: "400",
108
+ medium: "500",
109
+ semibold: "600",
110
+ bold: "700",
111
+ extrabold: "800",
112
+ black: "900"
113
+ },
114
+ lineHeight: {
115
+ none: "1",
116
+ tight: "1.25",
117
+ snug: "1.375",
118
+ normal: "1.5",
119
+ relaxed: "1.625",
120
+ loose: "2"
121
+ },
122
+ /**
123
+ * Border radius
124
+ */
125
+ borderRadius: {
126
+ none: "0",
127
+ sm: "0.125rem",
128
+ // 2px
129
+ DEFAULT: "0.25rem",
130
+ // 4px
131
+ md: "0.375rem",
132
+ // 6px
133
+ lg: "0.5rem",
134
+ // 8px
135
+ xl: "0.75rem",
136
+ // 12px
137
+ "2xl": "1rem",
138
+ // 16px
139
+ "3xl": "1.5rem",
140
+ // 24px
141
+ full: "9999px"
142
+ },
143
+ /**
144
+ * Motion durations (base values - themes can override)
145
+ */
146
+ duration: {
147
+ instant: "0ms",
148
+ fast: "150ms",
149
+ normal: "300ms",
150
+ slow: "500ms",
151
+ slower: "800ms"
152
+ },
153
+ /**
154
+ * Easing curves (base values - themes can override)
155
+ */
156
+ ease: {
157
+ linear: "linear",
158
+ in: "cubic-bezier(0.4, 0, 1, 1)",
159
+ out: "cubic-bezier(0, 0, 0.2, 1)",
160
+ inOut: "cubic-bezier(0.4, 0, 0.2, 1)"
161
+ },
162
+ /**
163
+ * Z-index scale
164
+ */
165
+ zIndex: {
166
+ "auto": "auto",
167
+ "0": "0",
168
+ "10": "10",
169
+ "20": "20",
170
+ "30": "30",
171
+ "40": "40",
172
+ "50": "50",
173
+ dropdown: "1000",
174
+ sticky: "1020",
175
+ fixed: "1030",
176
+ modalBackdrop: "1040",
177
+ modal: "1050",
178
+ popover: "1060",
179
+ tooltip: "1070"
180
+ },
181
+ /**
182
+ * Focus ring configuration
183
+ */
184
+ focus: {
185
+ width: "2px",
186
+ offset: "2px",
187
+ style: "solid"
188
+ }
189
+ };
190
+ var spacing = {
191
+ xs: baseTokens.spacing["1"],
192
+ // 4px — Tight internal padding
193
+ sm: baseTokens.spacing["2"],
194
+ // 8px — Default gap
195
+ md: baseTokens.spacing["4"],
196
+ // 16px — Section padding
197
+ lg: baseTokens.spacing["6"],
198
+ // 24px — Card padding
199
+ xl: baseTokens.spacing["8"],
200
+ // 32px — Section margins
201
+ "2xl": baseTokens.spacing["12"],
202
+ // 48px — Page sections
203
+ "3xl": baseTokens.spacing["16"]
204
+ // 64px — Major divisions
205
+ };
206
+ var typography = {
207
+ fonts: {
208
+ sans: "var(--font-body)",
209
+ serif: "var(--font-heading)",
210
+ mono: "var(--font-mono)"
211
+ },
212
+ sizes: {
213
+ xs: baseTokens.fontSize.xs,
214
+ // 12px — Fine print
215
+ sm: baseTokens.fontSize.sm,
216
+ // 14px — Secondary text
217
+ base: baseTokens.fontSize.base,
218
+ // 16px — Body text
219
+ lg: baseTokens.fontSize.lg,
220
+ // 18px — Lead paragraphs
221
+ xl: baseTokens.fontSize.xl,
222
+ // 20px — Section headers
223
+ "2xl": baseTokens.fontSize["2xl"],
224
+ // 24px — Page headers
225
+ "3xl": baseTokens.fontSize["3xl"]
226
+ // 30px — Hero text
227
+ },
228
+ weights: {
229
+ normal: baseTokens.fontWeight.normal,
230
+ // 400
231
+ medium: baseTokens.fontWeight.medium,
232
+ // 500
233
+ semibold: baseTokens.fontWeight.semibold,
234
+ // 600
235
+ bold: baseTokens.fontWeight.bold
236
+ // 700
237
+ },
238
+ leading: {
239
+ tight: baseTokens.lineHeight.tight,
240
+ // 1.25 — Headings
241
+ normal: baseTokens.lineHeight.normal,
242
+ // 1.5 — Body
243
+ relaxed: baseTokens.lineHeight.relaxed
244
+ // 1.625 — Spacious reading
245
+ }
246
+ };
247
+ var motion = {
248
+ duration: baseTokens.duration,
249
+ easing: {
250
+ default: baseTokens.ease.out,
251
+ // Most transitions
252
+ spring: "cubic-bezier(0.16, 1, 0.3, 1)",
253
+ // Playful interactions
254
+ linear: baseTokens.ease.linear
255
+ // Progress indicators
256
+ }
257
+ };
258
+
259
+ // ../tokens/src/studio.ts
260
+ var studioTokens = {
261
+ light: {
262
+ colors: {
263
+ // Backgrounds
264
+ background: "#ffffff",
265
+ backgroundSecondary: "#fafafa",
266
+ backgroundTertiary: "#f5f5f5",
267
+ // Foregrounds
268
+ foreground: "#0a0a0a",
269
+ foregroundSecondary: "#525252",
270
+ foregroundTertiary: "#a3a3a3",
271
+ // Brand
272
+ primary: "#0a0a0a",
273
+ primaryForeground: "#ffffff",
274
+ secondary: "#f5f5f5",
275
+ secondaryForeground: "#0a0a0a",
276
+ accent: "#0070f3",
277
+ accentForeground: "#ffffff",
278
+ // Borders
279
+ border: "#d4d4d4",
280
+ borderSubtle: "#f5f5f5",
281
+ // States
282
+ hover: "#fafafa",
283
+ active: "#f0f0f0",
284
+ // Link hover states
285
+ linkHover: "#0a0a0a",
286
+ linkHoverForeground: "#ffffff",
287
+ // Semantic
288
+ success: "#00a86b",
289
+ successForeground: "#ffffff",
290
+ warning: "#f59e0b",
291
+ warningForeground: "#ffffff",
292
+ error: "#ef4444",
293
+ errorForeground: "#ffffff",
294
+ info: "#0070f3",
295
+ infoForeground: "#ffffff",
296
+ // Component-specific colors
297
+ card: "#ffffff",
298
+ cardForeground: "#0a0a0a",
299
+ popover: "#ffffff",
300
+ popoverForeground: "#0a0a0a",
301
+ muted: "#f5f5f5",
302
+ mutedForeground: "#737373",
303
+ destructive: "#ef4444",
304
+ destructiveForeground: "#ffffff",
305
+ input: "#d4d4d4",
306
+ ring: "#0a0a0a",
307
+ // Surface is used by various components
308
+ surface: "#fafafa",
309
+ // Glass effects
310
+ glass: "rgba(255, 255, 255, 0.7)",
311
+ glassBorder: "rgba(0, 0, 0, 0.1)"
312
+ },
313
+ effects: {
314
+ blur: {
315
+ sm: "blur(4px)",
316
+ md: "blur(8px)",
317
+ lg: "blur(16px)",
318
+ xl: "blur(24px)"
319
+ },
320
+ shadow: {
321
+ sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
322
+ md: "0 4px 6px -1px rgba(0, 0, 0, 0.1)",
323
+ lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1)",
324
+ xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1)",
325
+ "2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)"
326
+ }
327
+ }
328
+ },
329
+ dark: {
330
+ colors: {
331
+ // Backgrounds
332
+ background: "#000000",
333
+ backgroundSecondary: "#171717",
334
+ backgroundTertiary: "#262626",
335
+ // Foregrounds
336
+ foreground: "#fafafa",
337
+ foregroundSecondary: "#a3a3a3",
338
+ foregroundTertiary: "#858585",
339
+ // Brand
340
+ primary: "#ffffff",
341
+ primaryForeground: "#0a0a0a",
342
+ secondary: "#262626",
343
+ secondaryForeground: "#fafafa",
344
+ accent: "#0090ff",
345
+ accentForeground: "#ffffff",
346
+ // Borders
347
+ border: "#404040",
348
+ borderSubtle: "#1a1a1a",
349
+ // States
350
+ hover: "#1a1a1a",
351
+ active: "#262626",
352
+ // Link hover states
353
+ linkHover: "#ffffff",
354
+ linkHoverForeground: "#0a0a0a",
355
+ // Semantic
356
+ success: "#10b981",
357
+ successForeground: "#ffffff",
358
+ warning: "#f59e0b",
359
+ warningForeground: "#ffffff",
360
+ error: "#ef4444",
361
+ errorForeground: "#ffffff",
362
+ info: "#0090ff",
363
+ infoForeground: "#ffffff",
364
+ // Component-specific colors
365
+ card: "#0a0a0a",
366
+ cardForeground: "#fafafa",
367
+ popover: "#0a0a0a",
368
+ popoverForeground: "#fafafa",
369
+ muted: "#262626",
370
+ mutedForeground: "#a3a3a3",
371
+ destructive: "#ef4444",
372
+ destructiveForeground: "#ffffff",
373
+ input: "#404040",
374
+ ring: "#d4d4d4",
375
+ // Surface is used by various components
376
+ surface: "#171717",
377
+ // Glass effects
378
+ glass: "rgba(0, 0, 0, 0.7)",
379
+ glassBorder: "rgba(255, 255, 255, 0.1)"
380
+ },
381
+ effects: {
382
+ blur: {
383
+ sm: "blur(4px)",
384
+ md: "blur(8px)",
385
+ lg: "blur(16px)",
386
+ xl: "blur(24px)"
387
+ },
388
+ shadow: {
389
+ sm: "0 1px 2px 0 rgba(0, 0, 0, 0.3)",
390
+ md: "0 4px 6px -1px rgba(0, 0, 0, 0.5)",
391
+ lg: "0 10px 15px -3px rgba(0, 0, 0, 0.6)",
392
+ xl: "0 20px 25px -5px rgba(0, 0, 0, 0.7)",
393
+ "2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.8)"
394
+ }
395
+ }
396
+ },
397
+ /**
398
+ * Motion personality for Studio theme
399
+ */
400
+ motion: {
401
+ // Duration scales based on motion slider (0-10)
402
+ getDuration: (intensity) => {
403
+ if (intensity === 0) return "0ms";
404
+ const ms = 150 + (intensity - 1) * 40;
405
+ return `${ms}ms`;
406
+ },
407
+ // Easing curves - smooth and professional
408
+ ease: {
409
+ default: "cubic-bezier(0.4, 0, 0.2, 1)",
410
+ // ease-in-out
411
+ in: "cubic-bezier(0.4, 0, 1, 1)",
412
+ out: "cubic-bezier(0, 0, 0.2, 1)",
413
+ spring: "cubic-bezier(0.16, 1, 0.3, 1)"
414
+ // Smooth spring
415
+ }
416
+ },
417
+ /**
418
+ * Typography for Studio theme
419
+ */
420
+ typography: {
421
+ heading: {
422
+ fontFamily: "var(--font-geist-sans)",
423
+ fontWeight: "600",
424
+ letterSpacing: "-0.02em"
425
+ },
426
+ body: {
427
+ fontFamily: "var(--font-geist-sans)",
428
+ fontWeight: "400",
429
+ letterSpacing: "0"
430
+ },
431
+ mono: {
432
+ fontFamily: "var(--font-geist-mono)",
433
+ fontWeight: "400",
434
+ letterSpacing: "0"
435
+ }
436
+ }
437
+ };
438
+
439
+ // ../tokens/src/sage.ts
440
+ var sageTokens = {
441
+ light: {
442
+ colors: {
443
+ // Warm, earthy backgrounds
444
+ background: "#faf8f5",
445
+ backgroundSecondary: "#f5f1eb",
446
+ backgroundTertiary: "#ede8e0",
447
+ // Warm neutrals for text
448
+ foreground: "#2d2823",
449
+ foregroundSecondary: "#5a524a",
450
+ foregroundTertiary: "#8a7f72",
451
+ // Muted sage green as primary
452
+ primary: "#7a9b7f",
453
+ primaryForeground: "#faf8f5",
454
+ primaryHover: "#6a8b6f",
455
+ // Secondary - warm stone
456
+ secondary: "#ede8e0",
457
+ secondaryForeground: "#2d2823",
458
+ // Warm terracotta accent
459
+ accent: "#c17a5f",
460
+ accentForeground: "#faf8f5",
461
+ accentHover: "#b16a4f",
462
+ // Semantic colors with muted, organic tones
463
+ success: "#6b8e6f",
464
+ successForeground: "#faf8f5",
465
+ warning: "#d4a574",
466
+ warningForeground: "#2d2823",
467
+ error: "#c17a5f",
468
+ errorForeground: "#faf8f5",
469
+ info: "#8b9dc3",
470
+ infoForeground: "#faf8f5",
471
+ // Borders - warm subtle
472
+ border: "#e0d8cf",
473
+ borderSubtle: "#ede8e0",
474
+ // States
475
+ hover: "#f5f1eb",
476
+ active: "#ede8e0",
477
+ // Link hover states - Muted sage green
478
+ linkHover: "#7a9b7f",
479
+ linkHoverForeground: "#faf8f5",
480
+ // Soft glass effects
481
+ glass: "rgba(250, 248, 245, 0.85)",
482
+ glassBorder: "rgba(122, 155, 127, 0.15)"
483
+ },
484
+ effects: {
485
+ blur: {
486
+ sm: "blur(6px)",
487
+ md: "blur(12px)",
488
+ lg: "blur(20px)",
489
+ xl: "blur(32px)"
490
+ },
491
+ shadow: {
492
+ sm: "0 2px 4px 0 rgba(45, 40, 35, 0.06)",
493
+ md: "0 4px 8px -2px rgba(45, 40, 35, 0.08)",
494
+ lg: "0 8px 16px -4px rgba(45, 40, 35, 0.12)",
495
+ xl: "0 16px 32px -8px rgba(45, 40, 35, 0.16)",
496
+ "2xl": "0 24px 48px -12px rgba(45, 40, 35, 0.20)"
497
+ }
498
+ }
499
+ },
500
+ dark: {
501
+ colors: {
502
+ // Deep forest backgrounds
503
+ background: "#1a1614",
504
+ backgroundSecondary: "#252220",
505
+ backgroundTertiary: "#2f2b28",
506
+ // Warm light text
507
+ foreground: "#f5f1eb",
508
+ foregroundSecondary: "#c7bfb5",
509
+ foregroundTertiary: "#8a7f72",
510
+ // Brighter sage for dark mode
511
+ primary: "#a8c5ad",
512
+ primaryForeground: "#1a1614",
513
+ primaryHover: "#b8d5bd",
514
+ // Secondary - lighter warm stone
515
+ secondary: "#2f2b28",
516
+ secondaryForeground: "#f5f1eb",
517
+ // Warm peachy accent for dark
518
+ accent: "#e5a78a",
519
+ accentForeground: "#1a1614",
520
+ accentHover: "#f5b79a",
521
+ // Semantic colors adjusted for dark
522
+ success: "#95b89a",
523
+ successForeground: "#1a1614",
524
+ warning: "#e5c59a",
525
+ warningForeground: "#1a1614",
526
+ error: "#e5a78a",
527
+ errorForeground: "#1a1614",
528
+ info: "#a8b5d5",
529
+ infoForeground: "#1a1614",
530
+ // Borders
531
+ border: "#3a3530",
532
+ borderSubtle: "#2f2b28",
533
+ // States
534
+ hover: "#252220",
535
+ active: "#2f2b28",
536
+ // Link hover states - Brighter sage for dark mode
537
+ linkHover: "#a8c5ad",
538
+ linkHoverForeground: "#1a1614",
539
+ // Dark glass effects
540
+ glass: "rgba(26, 22, 20, 0.85)",
541
+ glassBorder: "rgba(168, 197, 173, 0.2)"
542
+ },
543
+ effects: {
544
+ blur: {
545
+ sm: "blur(6px)",
546
+ md: "blur(12px)",
547
+ lg: "blur(20px)",
548
+ xl: "blur(32px)"
549
+ },
550
+ shadow: {
551
+ sm: "0 2px 4px 0 rgba(0, 0, 0, 0.3)",
552
+ md: "0 4px 8px -2px rgba(0, 0, 0, 0.4)",
553
+ lg: "0 8px 16px -4px rgba(0, 0, 0, 0.5)",
554
+ xl: "0 16px 32px -8px rgba(0, 0, 0, 0.6)",
555
+ "2xl": "0 24px 48px -12px rgba(0, 0, 0, 0.7)"
556
+ }
557
+ }
558
+ },
559
+ motion: {
560
+ getDuration: (intensity) => {
561
+ if (intensity === 0) return "0ms";
562
+ const ms = 300 + (intensity - 1) * 60;
563
+ return `${ms}ms`;
564
+ },
565
+ ease: {
566
+ default: "cubic-bezier(0.33, 1, 0.68, 1)",
567
+ // Organic, flowing
568
+ in: "cubic-bezier(0.4, 0, 1, 1)",
569
+ out: "cubic-bezier(0, 0, 0.2, 1)",
570
+ spring: "cubic-bezier(0.16, 1, 0.3, 1)"
571
+ }
572
+ },
573
+ interactions: {
574
+ hover: {
575
+ overlayColor: "var(--color-interaction-overlay)",
576
+ opacity: "var(--opacity-interaction-hover)"
577
+ },
578
+ active: {
579
+ scale: "var(--scale-interaction-active)"
580
+ },
581
+ focus: {
582
+ ringColor: "var(--color-interaction-focus-ring)",
583
+ ringWidth: "var(--width-interaction-focus-ring)",
584
+ ringOffset: "var(--width-interaction-focus-offset)"
585
+ },
586
+ disabled: {
587
+ opacity: "var(--opacity-interaction-disabled)"
588
+ }
589
+ },
590
+ typography: {
591
+ heading: {
592
+ fontFamily: "var(--font-sage-serif)",
593
+ // Lora serif
594
+ fontWeight: "600",
595
+ letterSpacing: "-0.01em"
596
+ },
597
+ body: {
598
+ fontFamily: "var(--font-sage-sans)",
599
+ // Instrument Sans
600
+ fontWeight: "400",
601
+ letterSpacing: "0"
602
+ },
603
+ mono: {
604
+ fontFamily: "var(--font-sage-mono)",
605
+ fontWeight: "400",
606
+ letterSpacing: "0"
607
+ }
608
+ }
609
+ };
610
+
611
+ // ../tokens/src/volt.ts
612
+ var voltTokens = {
613
+ light: {
614
+ colors: {
615
+ // Bright, punchy backgrounds
616
+ background: "#ffffff",
617
+ backgroundSecondary: "#f8f9fb",
618
+ backgroundTertiary: "#f0f2f5",
619
+ // Sharp contrast text
620
+ foreground: "#0a0a0a",
621
+ foregroundSecondary: "#4a4a4a",
622
+ foregroundTertiary: "#8a8a8a",
623
+ // Electric blue primary (WCAG AA compliant)
624
+ primary: "#0066ff",
625
+ primaryForeground: "#ffffff",
626
+ primaryHover: "#0052cc",
627
+ // Secondary - cool gray
628
+ secondary: "#f0f2f5",
629
+ secondaryForeground: "#0a0a0a",
630
+ // Vibrant cyan accent
631
+ accent: "#00d9ff",
632
+ accentForeground: "#0a0a0a",
633
+ accentHover: "#00c3e6",
634
+ // Bold semantic colors
635
+ success: "#00cc66",
636
+ successForeground: "#ffffff",
637
+ warning: "#ffaa00",
638
+ warningForeground: "#0a0a0a",
639
+ error: "#ff3366",
640
+ errorForeground: "#ffffff",
641
+ info: "#3399ff",
642
+ infoForeground: "#ffffff",
643
+ // Borders
644
+ border: "#e0e4ea",
645
+ borderSubtle: "#f0f2f5",
646
+ // States
647
+ hover: "#f8f9fb",
648
+ active: "#f0f2f5",
649
+ // Link hover states - Electric blue with high contrast
650
+ linkHover: "#0066ff",
651
+ linkHoverForeground: "#ffffff",
652
+ // Crisp glass effects
653
+ glass: "rgba(255, 255, 255, 0.8)",
654
+ glassBorder: "rgba(0, 102, 255, 0.2)"
655
+ },
656
+ effects: {
657
+ blur: {
658
+ sm: "blur(8px)",
659
+ md: "blur(16px)",
660
+ lg: "blur(32px)",
661
+ xl: "blur(48px)"
662
+ },
663
+ shadow: {
664
+ sm: "0 0 8px rgba(0, 102, 255, 0.15)",
665
+ md: "0 0 16px rgba(0, 102, 255, 0.2)",
666
+ lg: "0 0 24px rgba(0, 102, 255, 0.25)",
667
+ xl: "0 0 32px rgba(0, 102, 255, 0.3)",
668
+ "2xl": "0 0 48px rgba(0, 102, 255, 0.4)"
669
+ }
670
+ }
671
+ },
672
+ dark: {
673
+ colors: {
674
+ // Pure black cyberpunk background
675
+ background: "#000000",
676
+ backgroundSecondary: "#0a0a0a",
677
+ backgroundTertiary: "#141414",
678
+ // Bright white text
679
+ foreground: "#ffffff",
680
+ foregroundSecondary: "#b3b3b3",
681
+ foregroundTertiary: "#666666",
682
+ // Neon blue primary
683
+ primary: "#0099ff",
684
+ primaryForeground: "#000000",
685
+ primaryHover: "#00aaff",
686
+ // Secondary - dark gray
687
+ secondary: "#141414",
688
+ secondaryForeground: "#ffffff",
689
+ // Neon cyan accent
690
+ accent: "#00ffff",
691
+ accentForeground: "#000000",
692
+ accentHover: "#33ffff",
693
+ // Neon semantic colors
694
+ success: "#00ff99",
695
+ successForeground: "#000000",
696
+ warning: "#ffcc00",
697
+ warningForeground: "#000000",
698
+ error: "#ff0066",
699
+ errorForeground: "#ffffff",
700
+ info: "#66ccff",
701
+ infoForeground: "#000000",
702
+ // Borders
703
+ border: "#1a1a1a",
704
+ borderSubtle: "#141414",
705
+ // States
706
+ hover: "#0a0a0a",
707
+ active: "#141414",
708
+ // Link hover states - Neon cyan (high luma)
709
+ linkHover: "#00ffff",
710
+ linkHoverForeground: "#000000",
711
+ // Dark glass with glow
712
+ glass: "rgba(0, 0, 0, 0.8)",
713
+ glassBorder: "rgba(0, 153, 255, 0.3)"
714
+ },
715
+ effects: {
716
+ blur: {
717
+ sm: "blur(8px)",
718
+ md: "blur(16px)",
719
+ lg: "blur(32px)",
720
+ xl: "blur(48px)"
721
+ },
722
+ shadow: {
723
+ sm: "0 0 12px rgba(0, 153, 255, 0.4)",
724
+ md: "0 0 20px rgba(0, 153, 255, 0.5)",
725
+ lg: "0 0 32px rgba(0, 153, 255, 0.6)",
726
+ xl: "0 0 48px rgba(0, 153, 255, 0.7)",
727
+ "2xl": "0 0 64px rgba(0, 153, 255, 0.8)"
728
+ }
729
+ }
730
+ },
731
+ motion: {
732
+ getDuration: (intensity) => {
733
+ if (intensity === 0) return "0ms";
734
+ const ms = 100 + (intensity - 1) * 25;
735
+ return `${ms}ms`;
736
+ },
737
+ ease: {
738
+ default: "cubic-bezier(0.16, 1, 0.3, 1)",
739
+ // Snappy spring
740
+ in: "cubic-bezier(0.4, 0, 1, 1)",
741
+ out: "cubic-bezier(0, 0, 0.2, 1)",
742
+ spring: "cubic-bezier(0.68, -0.55, 0.27, 1.55)"
743
+ // Bouncy
744
+ }
745
+ },
746
+ typography: {
747
+ heading: {
748
+ fontFamily: "var(--font-volt-sans)",
749
+ // Space Grotesk
750
+ fontWeight: "700",
751
+ // Bold
752
+ letterSpacing: "-0.03em"
753
+ },
754
+ body: {
755
+ fontFamily: "var(--font-volt-sans)",
756
+ fontWeight: "400",
757
+ letterSpacing: "0"
758
+ },
759
+ mono: {
760
+ fontFamily: "var(--font-volt-mono)",
761
+ // Fira Code
762
+ fontWeight: "400",
763
+ letterSpacing: "0"
764
+ }
765
+ }
766
+ };
767
+
768
+ // ../tokens/src/typography.ts
769
+ var fontSizes = {
770
+ // Body text scale
771
+ xs: { base: "0.75rem", mobile: "0.75rem" },
772
+ // 12px
773
+ sm: { base: "0.875rem", mobile: "0.875rem" },
774
+ // 14px
775
+ base: { base: "1rem", mobile: "1rem" },
776
+ // 16px
777
+ lg: { base: "1.125rem", mobile: "1rem" },
778
+ // 18px / 16px mobile
779
+ xl: { base: "1.25rem", mobile: "1.125rem" },
780
+ // 20px / 18px mobile
781
+ "2xl": { base: "1.5rem", mobile: "1.25rem" },
782
+ // 24px / 20px mobile
783
+ "3xl": { base: "1.875rem", mobile: "1.5rem" },
784
+ // 30px / 24px mobile
785
+ // Heading scale (h6 → h1)
786
+ "4xl": { base: "2.25rem", mobile: "1.875rem" },
787
+ // 36px / 30px - h3
788
+ "5xl": { base: "3rem", mobile: "2.25rem" },
789
+ // 48px / 36px - h2
790
+ "6xl": { base: "3.75rem", mobile: "2.5rem" },
791
+ // 60px / 40px - h1
792
+ "7xl": { base: "4.5rem", mobile: "3rem" },
793
+ // 72px / 48px - Display
794
+ "8xl": { base: "6rem", mobile: "3.75rem" },
795
+ // 96px / 60px - Hero
796
+ "9xl": { base: "8rem", mobile: "4.5rem" }
797
+ // 128px / 72px - Ultra
798
+ };
799
+ var fontWeights = {
800
+ thin: "100",
801
+ extralight: "200",
802
+ light: "300",
803
+ normal: "400",
804
+ medium: "500",
805
+ semibold: "600",
806
+ bold: "700",
807
+ extrabold: "800",
808
+ black: "900"
809
+ };
810
+ var lineHeights = {
811
+ none: "1",
812
+ tight: "1.25",
813
+ snug: "1.375",
814
+ normal: "1.5",
815
+ relaxed: "1.625",
816
+ loose: "1.75",
817
+ extraloose: "2"
818
+ };
819
+ var letterSpacing = {
820
+ tighter: "-0.05em",
821
+ tight: "-0.025em",
822
+ normal: "0",
823
+ wide: "0.025em",
824
+ wider: "0.05em",
825
+ widest: "0.1em"
826
+ };
827
+ var typePresets = {
828
+ "display-large": {
829
+ size: fontSizes["8xl"],
830
+ weight: fontWeights.bold,
831
+ lineHeight: lineHeights.none,
832
+ letterSpacing: letterSpacing.tighter,
833
+ description: "Large hero text, landing pages"
834
+ },
835
+ "display": {
836
+ size: fontSizes["7xl"],
837
+ weight: fontWeights.bold,
838
+ lineHeight: lineHeights.tight,
839
+ letterSpacing: letterSpacing.tight,
840
+ description: "Hero sections, major headings"
841
+ },
842
+ "heading-1": {
843
+ size: fontSizes["6xl"],
844
+ weight: fontWeights.bold,
845
+ lineHeight: lineHeights.tight,
846
+ letterSpacing: letterSpacing.tight,
847
+ description: "Page titles, h1"
848
+ },
849
+ "heading-2": {
850
+ size: fontSizes["5xl"],
851
+ weight: fontWeights.bold,
852
+ lineHeight: lineHeights.tight,
853
+ letterSpacing: letterSpacing.normal,
854
+ description: "Section titles, h2"
855
+ },
856
+ "heading-3": {
857
+ size: fontSizes["4xl"],
858
+ weight: fontWeights.semibold,
859
+ lineHeight: lineHeights.snug,
860
+ letterSpacing: letterSpacing.normal,
861
+ description: "Subsection titles, h3"
862
+ },
863
+ "heading-4": {
864
+ size: fontSizes["2xl"],
865
+ weight: fontWeights.semibold,
866
+ lineHeight: lineHeights.snug,
867
+ letterSpacing: letterSpacing.normal,
868
+ description: "Component titles, h4"
869
+ },
870
+ "heading-5": {
871
+ size: fontSizes.xl,
872
+ weight: fontWeights.medium,
873
+ lineHeight: lineHeights.normal,
874
+ letterSpacing: letterSpacing.normal,
875
+ description: "Small headings, h5"
876
+ },
877
+ "heading-6": {
878
+ size: fontSizes.lg,
879
+ weight: fontWeights.medium,
880
+ lineHeight: lineHeights.normal,
881
+ letterSpacing: letterSpacing.normal,
882
+ description: "Tiny headings, h6"
883
+ },
884
+ "body-large": {
885
+ size: fontSizes.lg,
886
+ weight: fontWeights.normal,
887
+ lineHeight: lineHeights.relaxed,
888
+ letterSpacing: letterSpacing.normal,
889
+ description: "Lead paragraphs, intro text"
890
+ },
891
+ "body": {
892
+ size: fontSizes.base,
893
+ weight: fontWeights.normal,
894
+ lineHeight: lineHeights.normal,
895
+ letterSpacing: letterSpacing.normal,
896
+ description: "Default body text"
897
+ },
898
+ "body-small": {
899
+ size: fontSizes.sm,
900
+ weight: fontWeights.normal,
901
+ lineHeight: lineHeights.normal,
902
+ letterSpacing: letterSpacing.normal,
903
+ description: "Small body text, fine print"
904
+ },
905
+ "caption": {
906
+ size: fontSizes.xs,
907
+ weight: fontWeights.normal,
908
+ lineHeight: lineHeights.snug,
909
+ letterSpacing: letterSpacing.wide,
910
+ description: "Captions, labels, metadata"
911
+ },
912
+ "overline": {
913
+ size: fontSizes.xs,
914
+ weight: fontWeights.semibold,
915
+ lineHeight: lineHeights.normal,
916
+ letterSpacing: letterSpacing.widest,
917
+ description: "Eyebrows, categories, all-caps labels"
918
+ }
919
+ };
920
+
921
+ // ../tokens/src/syntax.ts
922
+ var syntaxColors = {
923
+ light: {
924
+ comment: "#22863a",
925
+ // Green for comments
926
+ keyword: "#8250df",
927
+ // Purple for keywords (import, export, const, etc.)
928
+ function: "#6639ba",
929
+ // Purple for function names
930
+ string: "#c1592a",
931
+ // Orange for strings
932
+ number: "#0a3069",
933
+ // Blue for numbers
934
+ boolean: "#0550ae",
935
+ // Blue for booleans
936
+ operator: "#1a1a1a",
937
+ // Almost black for operators
938
+ property: "#0550ae",
939
+ // Blue for properties
940
+ className: "#005cc5",
941
+ // Blue for class names
942
+ tag: "#005cc5",
943
+ // Blue for HTML/JSX tags
944
+ attribute: "#0550ae",
945
+ // Blue for attributes
946
+ variable: "#0550ae",
947
+ // Blue for variables
948
+ punctuation: "#57606a",
949
+ // Gray for punctuation
950
+ plain: "#1a1a1a"
951
+ // Default text color
952
+ },
953
+ dark: {
954
+ comment: "#6A9955",
955
+ // Green for comments
956
+ keyword: "#C586C0",
957
+ // Purple for keywords (import, export, const, etc.)
958
+ function: "#DCDCAA",
959
+ // Yellow for function names
960
+ string: "#CE9178",
961
+ // Orange for strings
962
+ number: "#B5CEA8",
963
+ // Light green for numbers
964
+ boolean: "#569CD6",
965
+ // Blue for booleans
966
+ operator: "#D4D4D4",
967
+ // Light gray for operators
968
+ property: "#9CDCFE",
969
+ // Light blue for properties
970
+ className: "#4EC9B0",
971
+ // Cyan for class names
972
+ tag: "#4EC9B0",
973
+ // Cyan for HTML/JSX tags
974
+ attribute: "#9CDCFE",
975
+ // Light blue for attributes
976
+ variable: "#9CDCFE",
977
+ // Light blue for variables
978
+ punctuation: "#808080",
979
+ // Gray for punctuation
980
+ plain: "#D4D4D4"
981
+ // Default text color
982
+ }
983
+ };
984
+ var codeColors = {
985
+ light: {
986
+ // Block code background - cool gray for subtle distinction
987
+ blockBackground: "#F8F9FA",
988
+ // Inline code background - pale amber for warmth and visibility
989
+ inlineBackground: "#FEF3E7",
990
+ // Border color for definition and separation
991
+ border: "#E1E4E8"
992
+ },
993
+ dark: {
994
+ // Block code background - VS Code-inspired dark background
995
+ blockBackground: "#1E1E1E",
996
+ // Inline code background - slightly lighter for contrast
997
+ inlineBackground: "#252525",
998
+ // Border color for definition
999
+ border: "#3D3D3D"
1000
+ }
1001
+ };
1002
+
1003
+ // ../tokens/src/color-utils.ts
1004
+ function hexToRgb(hex) {
1005
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
1006
+ return result ? {
1007
+ r: parseInt(result[1], 16),
1008
+ g: parseInt(result[2], 16),
1009
+ b: parseInt(result[3], 16)
1010
+ } : null;
1011
+ }
1012
+ function hexToHSL(hex) {
1013
+ const rgb = hexToRgb(hex);
1014
+ if (!rgb) return { h: 0, s: 0, l: 0 };
1015
+ const r = rgb.r / 255;
1016
+ const g = rgb.g / 255;
1017
+ const b = rgb.b / 255;
1018
+ const max = Math.max(r, g, b);
1019
+ const min = Math.min(r, g, b);
1020
+ let h = 0, s = 0, l = (max + min) / 2;
1021
+ if (max !== min) {
1022
+ const d = max - min;
1023
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
1024
+ switch (max) {
1025
+ case r:
1026
+ h = ((g - b) / d + (g < b ? 6 : 0)) / 6;
1027
+ break;
1028
+ case g:
1029
+ h = ((b - r) / d + 2) / 6;
1030
+ break;
1031
+ case b:
1032
+ h = ((r - g) / d + 4) / 6;
1033
+ break;
1034
+ }
1035
+ }
1036
+ return {
1037
+ h: Math.round(h * 360),
1038
+ s: Math.round(s * 100),
1039
+ l: Math.round(l * 100)
1040
+ };
1041
+ }
1042
+ function hslToHex(h, s, l) {
1043
+ h = h / 360;
1044
+ s = s / 100;
1045
+ l = l / 100;
1046
+ let r, g, b;
1047
+ if (s === 0) {
1048
+ r = g = b = l;
1049
+ } else {
1050
+ const hue2rgb = (p2, q2, t) => {
1051
+ if (t < 0) t += 1;
1052
+ if (t > 1) t -= 1;
1053
+ if (t < 1 / 6) return p2 + (q2 - p2) * 6 * t;
1054
+ if (t < 1 / 2) return q2;
1055
+ if (t < 2 / 3) return p2 + (q2 - p2) * (2 / 3 - t) * 6;
1056
+ return p2;
1057
+ };
1058
+ const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
1059
+ const p = 2 * l - q;
1060
+ r = hue2rgb(p, q, h + 1 / 3);
1061
+ g = hue2rgb(p, q, h);
1062
+ b = hue2rgb(p, q, h - 1 / 3);
1063
+ }
1064
+ const toHex = (x) => {
1065
+ const hex = Math.round(x * 255).toString(16);
1066
+ return hex.length === 1 ? "0" + hex : hex;
1067
+ };
1068
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
1069
+ }
1070
+ function adjustLightness(hex, percent) {
1071
+ const hsl = hexToHSL(hex);
1072
+ const newL = Math.max(0, Math.min(100, hsl.l + percent));
1073
+ return hslToHex(hsl.h, hsl.s, newL);
1074
+ }
1075
+ function adjustSaturation(hex, percent) {
1076
+ const hsl = hexToHSL(hex);
1077
+ const newS = Math.max(0, Math.min(100, hsl.s + percent));
1078
+ return hslToHex(hsl.h, newS, hsl.l);
1079
+ }
1080
+ function rotateHue(hex, degrees) {
1081
+ const hsl = hexToHSL(hex);
1082
+ const newH = (hsl.h + degrees) % 360;
1083
+ return hslToHex(newH, hsl.s, hsl.l);
1084
+ }
1085
+ function adjustOpacity(hex, opacity) {
1086
+ const rgb = hexToRgb(hex);
1087
+ if (!rgb) return hex;
1088
+ return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${opacity})`;
1089
+ }
1090
+ function getLuminance(r, g, b) {
1091
+ const [rs, gs, bs] = [r, g, b].map((c) => {
1092
+ const srgb = c / 255;
1093
+ return srgb <= 0.03928 ? srgb / 12.92 : Math.pow((srgb + 0.055) / 1.055, 2.4);
1094
+ });
1095
+ return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
1096
+ }
1097
+ function getContrastRatio(hex1, hex2) {
1098
+ const rgb1 = hexToRgb(hex1);
1099
+ const rgb2 = hexToRgb(hex2);
1100
+ if (!rgb1 || !rgb2) return 0;
1101
+ const lum1 = getLuminance(rgb1.r, rgb1.g, rgb1.b);
1102
+ const lum2 = getLuminance(rgb2.r, rgb2.g, rgb2.b);
1103
+ const lighter = Math.max(lum1, lum2);
1104
+ const darker = Math.min(lum1, lum2);
1105
+ return (lighter + 0.05) / (darker + 0.05);
1106
+ }
1107
+ function getOptimalForeground(bgHex, whiteHex = "#ffffff", blackHex = "#000000") {
1108
+ const whiteRatio = getContrastRatio(bgHex, whiteHex);
1109
+ const blackRatio = getContrastRatio(bgHex, blackHex);
1110
+ return whiteRatio > blackRatio ? whiteHex : blackHex;
1111
+ }
1112
+
1113
+ // ../tokens/src/token-graph.ts
1114
+ var primaryColorDerivations = {
1115
+ // Links use primary color
1116
+ "--color-link": {
1117
+ source: "--color-primary",
1118
+ transform: (primary) => primary,
1119
+ description: "Links inherit primary brand color"
1120
+ },
1121
+ // Focus ring uses primary color
1122
+ "--color-ring": {
1123
+ source: "--color-primary",
1124
+ transform: (primary) => primary,
1125
+ description: "Focus rings use primary for brand consistency"
1126
+ },
1127
+ // Link hover is slightly darker primary
1128
+ "--color-link-hover": {
1129
+ source: "--color-primary",
1130
+ transform: (primary) => adjustLightness(primary, -10),
1131
+ description: "Link hover is 10% darker for visual feedback"
1132
+ },
1133
+ // Chart primary series
1134
+ "--chart-1": {
1135
+ source: "--color-primary",
1136
+ transform: (primary) => primary,
1137
+ description: "First chart series uses primary"
1138
+ },
1139
+ // Chart secondary series (lighter tint)
1140
+ "--chart-2": {
1141
+ source: "--color-primary",
1142
+ transform: (primary) => adjustLightness(primary, 20),
1143
+ description: "Second chart series is lighter tint of primary"
1144
+ },
1145
+ // Chart tertiary series (darker shade)
1146
+ "--chart-3": {
1147
+ source: "--color-primary",
1148
+ transform: (primary) => adjustLightness(primary, -15),
1149
+ description: "Third chart series is darker shade of primary"
1150
+ },
1151
+ // Chart quaternary (desaturated primary)
1152
+ "--chart-4": {
1153
+ source: "--color-primary",
1154
+ transform: (primary) => adjustSaturation(primary, -30),
1155
+ description: "Fourth chart series is muted primary"
1156
+ },
1157
+ // Chart quinary (complementary color)
1158
+ "--chart-5": {
1159
+ source: "--color-primary",
1160
+ transform: (primary) => rotateHue(primary, 180),
1161
+ description: "Fifth chart series is complementary to primary"
1162
+ }
1163
+ };
1164
+ var secondaryColorDerivations = {
1165
+ // Hover states
1166
+ "--color-hover": {
1167
+ source: "--color-secondary",
1168
+ transform: (secondary) => secondary,
1169
+ description: "Hover backgrounds use secondary"
1170
+ },
1171
+ // Active states
1172
+ "--color-active": {
1173
+ source: "--color-secondary",
1174
+ transform: (secondary) => adjustLightness(secondary, -5),
1175
+ description: "Active state is slightly darker secondary"
1176
+ },
1177
+ // Muted backgrounds
1178
+ "--color-muted": {
1179
+ source: "--color-secondary",
1180
+ transform: (secondary) => secondary,
1181
+ description: "Muted sections use secondary color"
1182
+ }
1183
+ };
1184
+ var accentColorDerivations = {
1185
+ // Info semantic color uses accent
1186
+ "--color-info": {
1187
+ source: "--color-accent",
1188
+ transform: (accent) => accent,
1189
+ description: "Info semantic color uses accent"
1190
+ },
1191
+ // Info foreground calculated for contrast
1192
+ "--color-info-foreground": {
1193
+ source: "--color-accent",
1194
+ transform: (accent) => getOptimalForeground(accent),
1195
+ description: "Info foreground calculated for contrast"
1196
+ }
1197
+ };
1198
+ var modeSpecificDerivations = {
1199
+ "--color-primary-muted": {
1200
+ light: {
1201
+ source: "--color-primary",
1202
+ transform: (primary) => adjustLightness(primary, 40),
1203
+ description: "Muted primary for light backgrounds"
1204
+ },
1205
+ dark: {
1206
+ source: "--color-primary",
1207
+ transform: (primary) => adjustLightness(primary, -20),
1208
+ description: "Muted primary for dark backgrounds"
1209
+ }
1210
+ },
1211
+ "--color-primary-subtle": {
1212
+ light: {
1213
+ source: "--color-primary",
1214
+ transform: (primary) => adjustOpacity(primary, 0.1),
1215
+ description: "Subtle primary background for light mode"
1216
+ },
1217
+ dark: {
1218
+ source: "--color-primary",
1219
+ transform: (primary) => adjustOpacity(primary, 0.2),
1220
+ description: "Subtle primary background for dark mode"
1221
+ }
1222
+ }
1223
+ };
1224
+ function computeDerivedTokens(sourceToken, sourceValue, mode) {
1225
+ const derived = {};
1226
+ Object.entries(primaryColorDerivations).forEach(([token, config]) => {
1227
+ if (config.source === sourceToken) {
1228
+ derived[token] = config.transform(sourceValue);
1229
+ }
1230
+ });
1231
+ Object.entries(secondaryColorDerivations).forEach(([token, config]) => {
1232
+ if (config.source === sourceToken) {
1233
+ derived[token] = config.transform(sourceValue);
1234
+ }
1235
+ });
1236
+ Object.entries(accentColorDerivations).forEach(([token, config]) => {
1237
+ if (config.source === sourceToken) {
1238
+ derived[token] = config.transform(sourceValue);
1239
+ }
1240
+ });
1241
+ Object.entries(modeSpecificDerivations).forEach(([token, configs]) => {
1242
+ const config = configs[mode];
1243
+ if (config.source === sourceToken) {
1244
+ derived[token] = config.transform(sourceValue);
1245
+ }
1246
+ });
1247
+ return derived;
1248
+ }
1249
+
1250
+ // src/lib/colors.ts
1251
+ var colorTokens = {
1252
+ // Background colors
1253
+ background: "var(--color-background)",
1254
+ backgroundSecondary: "var(--color-background-secondary)",
1255
+ backgroundTertiary: "var(--color-background-tertiary)",
1256
+ surface: "var(--color-surface)",
1257
+ // Foreground/Text colors
1258
+ foreground: "var(--color-foreground)",
1259
+ foregroundSecondary: "var(--color-foreground-secondary)",
1260
+ foregroundTertiary: "var(--color-foreground-tertiary)",
1261
+ textPrimary: "var(--color-text-primary)",
1262
+ textSecondary: "var(--color-text-secondary)",
1263
+ textMuted: "var(--color-text-muted)",
1264
+ // Brand colors
1265
+ primary: "var(--color-primary)",
1266
+ primaryForeground: "var(--color-primary-foreground)",
1267
+ secondary: "var(--color-secondary)",
1268
+ secondaryForeground: "var(--color-secondary-foreground)",
1269
+ accent: "var(--color-accent)",
1270
+ accentForeground: "var(--color-accent-foreground)",
1271
+ // Semantic colors
1272
+ success: "var(--color-success)",
1273
+ successForeground: "var(--color-success-foreground)",
1274
+ warning: "var(--color-warning)",
1275
+ warningForeground: "var(--color-warning-foreground)",
1276
+ error: "var(--color-error)",
1277
+ errorForeground: "var(--color-error-foreground)",
1278
+ info: "var(--color-info)",
1279
+ infoForeground: "var(--color-info-foreground)",
1280
+ // Borders
1281
+ border: "var(--color-border)",
1282
+ borderSubtle: "var(--color-border-subtle)",
1283
+ // Interactive states
1284
+ hover: "var(--color-hover)",
1285
+ active: "var(--color-active)",
1286
+ focus: "var(--color-focus)",
1287
+ // Links
1288
+ link: "var(--color-link)",
1289
+ linkHover: "var(--color-link-hover)",
1290
+ linkHoverForeground: "var(--color-link-hover-foreground)"
1291
+ };
1292
+ var semanticColors = {
1293
+ /**
1294
+ * Status colors for indicating states
1295
+ */
1296
+ status: {
1297
+ success: {
1298
+ bg: colorTokens.success,
1299
+ fg: colorTokens.successForeground
1300
+ },
1301
+ warning: {
1302
+ bg: colorTokens.warning,
1303
+ fg: colorTokens.warningForeground
1304
+ },
1305
+ error: {
1306
+ bg: colorTokens.error,
1307
+ fg: colorTokens.errorForeground
1308
+ },
1309
+ info: {
1310
+ bg: colorTokens.info,
1311
+ fg: colorTokens.infoForeground
1312
+ }
1313
+ },
1314
+ /**
1315
+ * Brand colors for primary UI elements
1316
+ */
1317
+ brand: {
1318
+ primary: {
1319
+ bg: colorTokens.primary,
1320
+ fg: colorTokens.primaryForeground
1321
+ },
1322
+ secondary: {
1323
+ bg: colorTokens.secondary,
1324
+ fg: colorTokens.secondaryForeground
1325
+ },
1326
+ accent: {
1327
+ bg: colorTokens.accent,
1328
+ fg: colorTokens.accentForeground
1329
+ }
1330
+ },
1331
+ /**
1332
+ * Interactive state colors
1333
+ */
1334
+ interactive: {
1335
+ default: {
1336
+ bg: colorTokens.background,
1337
+ fg: colorTokens.foreground
1338
+ },
1339
+ hover: {
1340
+ bg: colorTokens.hover,
1341
+ fg: colorTokens.foreground
1342
+ },
1343
+ active: {
1344
+ bg: colorTokens.active,
1345
+ fg: colorTokens.foreground
1346
+ },
1347
+ focus: {
1348
+ border: colorTokens.focus
1349
+ }
1350
+ }
1351
+ };
1352
+ function hexToRgb2(hex) {
1353
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
1354
+ return result ? {
1355
+ r: parseInt(result[1], 16),
1356
+ g: parseInt(result[2], 16),
1357
+ b: parseInt(result[3], 16)
1358
+ } : null;
1359
+ }
1360
+ function getLuminance2(r, g, b) {
1361
+ const [rs, gs, bs] = [r, g, b].map((c) => {
1362
+ const srgb = c / 255;
1363
+ return srgb <= 0.03928 ? srgb / 12.92 : Math.pow((srgb + 0.055) / 1.055, 2.4);
1364
+ });
1365
+ return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
1366
+ }
1367
+ function getContrastRatio2(hex1, hex2) {
1368
+ const rgb1 = hexToRgb2(hex1);
1369
+ const rgb2 = hexToRgb2(hex2);
1370
+ if (!rgb1 || !rgb2) return 0;
1371
+ const lum1 = getLuminance2(rgb1.r, rgb1.g, rgb1.b);
1372
+ const lum2 = getLuminance2(rgb2.r, rgb2.g, rgb2.b);
1373
+ const lighter = Math.max(lum1, lum2);
1374
+ const darker = Math.min(lum1, lum2);
1375
+ return (lighter + 0.05) / (darker + 0.05);
1376
+ }
1377
+ function hexToHSL2(hex) {
1378
+ const rgb = hexToRgb2(hex);
1379
+ if (!rgb) return { h: 0, s: 0, l: 0 };
1380
+ const r = rgb.r / 255;
1381
+ const g = rgb.g / 255;
1382
+ const b = rgb.b / 255;
1383
+ const max = Math.max(r, g, b);
1384
+ const min = Math.min(r, g, b);
1385
+ let h = 0, s = 0, l = (max + min) / 2;
1386
+ if (max !== min) {
1387
+ const d = max - min;
1388
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
1389
+ switch (max) {
1390
+ case r:
1391
+ h = ((g - b) / d + (g < b ? 6 : 0)) / 6;
1392
+ break;
1393
+ case g:
1394
+ h = ((b - r) / d + 2) / 6;
1395
+ break;
1396
+ case b:
1397
+ h = ((r - g) / d + 4) / 6;
1398
+ break;
1399
+ }
1400
+ }
1401
+ return {
1402
+ h: Math.round(h * 360),
1403
+ s: Math.round(s * 100),
1404
+ l: Math.round(l * 100)
1405
+ };
1406
+ }
1407
+ function hslToHex2(h, s, l) {
1408
+ h = h / 360;
1409
+ s = s / 100;
1410
+ l = l / 100;
1411
+ let r, g, b;
1412
+ if (s === 0) {
1413
+ r = g = b = l;
1414
+ } else {
1415
+ const hue2rgb = (p2, q2, t) => {
1416
+ if (t < 0) t += 1;
1417
+ if (t > 1) t -= 1;
1418
+ if (t < 1 / 6) return p2 + (q2 - p2) * 6 * t;
1419
+ if (t < 1 / 2) return q2;
1420
+ if (t < 2 / 3) return p2 + (q2 - p2) * (2 / 3 - t) * 6;
1421
+ return p2;
1422
+ };
1423
+ const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
1424
+ const p = 2 * l - q;
1425
+ r = hue2rgb(p, q, h + 1 / 3);
1426
+ g = hue2rgb(p, q, h);
1427
+ b = hue2rgb(p, q, h - 1 / 3);
1428
+ }
1429
+ const toHex = (x) => {
1430
+ const hex = Math.round(x * 255).toString(16);
1431
+ return hex.length === 1 ? "0" + hex : hex;
1432
+ };
1433
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
1434
+ }
1435
+ function getOptimalForeground2(bgHex, whiteHex = "#ffffff", blackHex = "#000000") {
1436
+ const whiteRatio = getContrastRatio2(bgHex, whiteHex);
1437
+ const blackRatio = getContrastRatio2(bgHex, blackHex);
1438
+ return whiteRatio > blackRatio ? whiteHex : blackHex;
1439
+ }
1440
+ function generateColorScale(baseHex) {
1441
+ const hsl = hexToHSL2(baseHex);
1442
+ return {
1443
+ 50: hslToHex2(hsl.h, Math.max(hsl.s - 10, 20), 95),
1444
+ 100: hslToHex2(hsl.h, Math.max(hsl.s - 5, 30), 90),
1445
+ 200: hslToHex2(hsl.h, hsl.s, 80),
1446
+ 300: hslToHex2(hsl.h, hsl.s, 70),
1447
+ 400: hslToHex2(hsl.h, hsl.s, 60),
1448
+ 500: baseHex,
1449
+ // Base color
1450
+ 600: hslToHex2(hsl.h, Math.min(hsl.s + 5, 100), 45),
1451
+ 700: hslToHex2(hsl.h, Math.min(hsl.s + 10, 100), 35),
1452
+ 800: hslToHex2(hsl.h, Math.min(hsl.s + 15, 100), 25),
1453
+ 900: hslToHex2(hsl.h, Math.min(hsl.s + 20, 100), 15)
1454
+ };
1455
+ }
1456
+
1457
+ // src/lib/store/customizer.ts
1458
+ var useCustomizer = create2()(
1459
+ persist2(
1460
+ (set, get) => ({
1461
+ motion: 5,
1462
+ prefersReducedMotion: false,
1463
+ customizationMode: "simple",
1464
+ customColors: {},
1465
+ savedPalettes: [],
1466
+ customFontThemes: {},
1467
+ savedFontThemes: [],
1468
+ setMotion: (level) => set({ motion: level }),
1469
+ setPrefersReducedMotion: (value) => set({ prefersReducedMotion: value }),
1470
+ setCustomizationMode: (mode) => set({ customizationMode: mode }),
1471
+ setCustomPrimaryColor: (theme, mode, hexColor) => {
1472
+ const state = get();
1473
+ const currentPalette = state.customColors[theme]?.[mode];
1474
+ const scale = generateColorScale(hexColor);
1475
+ const primaryForeground = getOptimalForeground2(hexColor);
1476
+ const derivedTokens = computeDerivedTokens("--color-primary", hexColor, mode);
1477
+ const isSimple = state.customizationMode === "simple";
1478
+ const palette = {
1479
+ primary: hexColor,
1480
+ primaryForeground,
1481
+ secondary: isSimple ? void 0 : currentPalette?.secondary,
1482
+ secondaryForeground: isSimple ? void 0 : currentPalette?.secondaryForeground,
1483
+ accent: isSimple ? void 0 : currentPalette?.accent,
1484
+ accentForeground: isSimple ? void 0 : currentPalette?.accentForeground,
1485
+ scale,
1486
+ derivedTokens
1487
+ };
1488
+ set((state2) => ({
1489
+ customColors: {
1490
+ ...state2.customColors,
1491
+ [theme]: {
1492
+ ...state2.customColors[theme],
1493
+ [mode]: palette
1494
+ }
1495
+ }
1496
+ }));
1497
+ },
1498
+ setCustomSecondaryColor: (theme, mode, hexColor) => {
1499
+ const state = get();
1500
+ const currentPalette = state.customColors[theme]?.[mode];
1501
+ if (!currentPalette) return;
1502
+ const secondaryForeground = getOptimalForeground2(hexColor);
1503
+ const derivedTokens = computeDerivedTokens("--color-secondary", hexColor, mode);
1504
+ set((state2) => ({
1505
+ customColors: {
1506
+ ...state2.customColors,
1507
+ [theme]: {
1508
+ ...state2.customColors[theme],
1509
+ [mode]: {
1510
+ ...currentPalette,
1511
+ secondary: hexColor,
1512
+ secondaryForeground,
1513
+ derivedTokens: {
1514
+ ...currentPalette.derivedTokens,
1515
+ ...derivedTokens
1516
+ }
1517
+ }
1518
+ }
1519
+ }
1520
+ }));
1521
+ },
1522
+ setCustomAccentColor: (theme, mode, hexColor) => {
1523
+ const state = get();
1524
+ const currentPalette = state.customColors[theme]?.[mode];
1525
+ if (!currentPalette) return;
1526
+ const accentForeground = getOptimalForeground2(hexColor);
1527
+ const derivedTokens = computeDerivedTokens("--color-accent", hexColor, mode);
1528
+ set((state2) => ({
1529
+ customColors: {
1530
+ ...state2.customColors,
1531
+ [theme]: {
1532
+ ...state2.customColors[theme],
1533
+ [mode]: {
1534
+ ...currentPalette,
1535
+ accent: hexColor,
1536
+ accentForeground,
1537
+ derivedTokens: {
1538
+ ...currentPalette.derivedTokens,
1539
+ ...derivedTokens
1540
+ }
1541
+ }
1542
+ }
1543
+ }
1544
+ }));
1545
+ },
1546
+ applyColorPalette: (theme, mode, colors) => {
1547
+ const scale = generateColorScale(colors.primary);
1548
+ const primaryForeground = getOptimalForeground2(colors.primary);
1549
+ let derivedTokens = computeDerivedTokens("--color-primary", colors.primary, mode);
1550
+ let secondary = colors.secondary;
1551
+ let secondaryForeground = secondary ? getOptimalForeground2(secondary) : void 0;
1552
+ if (secondary) {
1553
+ const secondaryDerived = computeDerivedTokens("--color-secondary", secondary, mode);
1554
+ derivedTokens = { ...derivedTokens, ...secondaryDerived };
1555
+ }
1556
+ let accent = colors.accent;
1557
+ let accentForeground = accent ? getOptimalForeground2(accent) : void 0;
1558
+ if (accent) {
1559
+ const accentDerived = computeDerivedTokens("--color-accent", accent, mode);
1560
+ derivedTokens = { ...derivedTokens, ...accentDerived };
1561
+ }
1562
+ const palette = {
1563
+ name: colors.name,
1564
+ description: colors.description,
1565
+ primary: colors.primary,
1566
+ primaryForeground,
1567
+ secondary,
1568
+ secondaryForeground,
1569
+ accent,
1570
+ accentForeground,
1571
+ scale,
1572
+ derivedTokens
1573
+ };
1574
+ set((state) => ({
1575
+ customColors: {
1576
+ ...state.customColors,
1577
+ [theme]: {
1578
+ ...state.customColors[theme],
1579
+ [mode]: palette
1580
+ }
1581
+ }
1582
+ }));
1583
+ },
1584
+ resetCustomColors: (theme, mode) => {
1585
+ if (mode) {
1586
+ set((state) => ({
1587
+ customColors: {
1588
+ ...state.customColors,
1589
+ [theme]: {
1590
+ ...state.customColors[theme],
1591
+ [mode]: void 0
1592
+ }
1593
+ }
1594
+ }));
1595
+ } else {
1596
+ set((state) => {
1597
+ const { [theme]: _, ...rest } = state.customColors;
1598
+ return { customColors: rest };
1599
+ });
1600
+ }
1601
+ },
1602
+ getActiveColorPalette: (theme, mode) => {
1603
+ return get().customColors[theme]?.[mode] || null;
1604
+ },
1605
+ // Saved palette management
1606
+ savePalette: (paletteData) => {
1607
+ const id = `custom-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
1608
+ const newPalette = {
1609
+ ...paletteData,
1610
+ id,
1611
+ category: "custom",
1612
+ createdAt: Date.now()
1613
+ };
1614
+ set((state) => ({
1615
+ savedPalettes: [...state.savedPalettes, newPalette]
1616
+ }));
1617
+ },
1618
+ updatePalette: (id, updates) => {
1619
+ set((state) => ({
1620
+ savedPalettes: state.savedPalettes.map(
1621
+ (p) => p.id === id ? { ...p, ...updates } : p
1622
+ )
1623
+ }));
1624
+ },
1625
+ renamePalette: (id, newName) => {
1626
+ set((state) => ({
1627
+ savedPalettes: state.savedPalettes.map(
1628
+ (p) => p.id === id ? { ...p, name: newName } : p
1629
+ )
1630
+ }));
1631
+ },
1632
+ deletePalette: (id) => {
1633
+ set((state) => ({
1634
+ savedPalettes: state.savedPalettes.filter((p) => p.id !== id)
1635
+ }));
1636
+ },
1637
+ reorderPalettes: (palettes) => {
1638
+ set({ savedPalettes: palettes });
1639
+ },
1640
+ getSavedPalettes: () => {
1641
+ return get().savedPalettes;
1642
+ },
1643
+ // Font theme management
1644
+ applyFontTheme: (theme, mode, fontTheme) => {
1645
+ set((state) => ({
1646
+ customFontThemes: {
1647
+ ...state.customFontThemes,
1648
+ [theme]: {
1649
+ ...state.customFontThemes[theme],
1650
+ [mode]: fontTheme
1651
+ }
1652
+ }
1653
+ }));
1654
+ },
1655
+ resetCustomFonts: (theme, mode) => {
1656
+ if (mode) {
1657
+ set((state) => ({
1658
+ customFontThemes: {
1659
+ ...state.customFontThemes,
1660
+ [theme]: {
1661
+ ...state.customFontThemes[theme],
1662
+ [mode]: void 0
1663
+ }
1664
+ }
1665
+ }));
1666
+ } else {
1667
+ set((state) => {
1668
+ const { [theme]: _, ...rest } = state.customFontThemes;
1669
+ return { customFontThemes: rest };
1670
+ });
1671
+ }
1672
+ },
1673
+ getActiveFontTheme: (theme, mode) => {
1674
+ return get().customFontThemes[theme]?.[mode] || null;
1675
+ },
1676
+ // Saved font theme management
1677
+ saveFontTheme: (fontThemeData) => {
1678
+ const id = `font-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
1679
+ const newFontTheme = {
1680
+ ...fontThemeData,
1681
+ id,
1682
+ category: "custom",
1683
+ createdAt: Date.now(),
1684
+ isCustom: true
1685
+ };
1686
+ set((state) => ({
1687
+ savedFontThemes: [...state.savedFontThemes, newFontTheme]
1688
+ }));
1689
+ },
1690
+ updateFontTheme: (id, updates) => {
1691
+ set((state) => ({
1692
+ savedFontThemes: state.savedFontThemes.map(
1693
+ (ft) => ft.id === id ? { ...ft, ...updates } : ft
1694
+ )
1695
+ }));
1696
+ },
1697
+ renameFontTheme: (id, newName) => {
1698
+ set((state) => ({
1699
+ savedFontThemes: state.savedFontThemes.map(
1700
+ (ft) => ft.id === id ? { ...ft, name: newName } : ft
1701
+ )
1702
+ }));
1703
+ },
1704
+ deleteFontTheme: (id) => {
1705
+ set((state) => ({
1706
+ savedFontThemes: state.savedFontThemes.filter((ft) => ft.id !== id)
1707
+ }));
1708
+ },
1709
+ reorderFontThemes: (fontThemes) => {
1710
+ set({ savedFontThemes: fontThemes });
1711
+ },
1712
+ getSavedFontThemes: () => {
1713
+ return get().savedFontThemes;
1714
+ }
1715
+ }),
1716
+ {
1717
+ name: "ecosystem-customizer",
1718
+ version: 4,
1719
+ partialize: (state) => ({
1720
+ motion: state.motion,
1721
+ prefersReducedMotion: state.prefersReducedMotion,
1722
+ customizationMode: state.customizationMode,
1723
+ customColors: state.customColors,
1724
+ savedPalettes: state.savedPalettes,
1725
+ customFontThemes: state.customFontThemes,
1726
+ savedFontThemes: state.savedFontThemes
1727
+ })
1728
+ }
1729
+ )
1730
+ );
1731
+
1732
+ // src/providers/ThemeProvider.tsx
1733
+ import { Fragment, jsx } from "react/jsx-runtime";
1734
+ var themeTokens = {
1735
+ studio: studioTokens,
1736
+ sage: sageTokens,
1737
+ volt: voltTokens
1738
+ };
1739
+ var fontFamilies = {
1740
+ studio: {
1741
+ heading: "var(--font-studio-heading)",
1742
+ body: "var(--font-studio-body)",
1743
+ mono: "var(--font-mono)"
1744
+ },
1745
+ sage: {
1746
+ sans: "var(--font-sage-body)",
1747
+ serif: "var(--font-sage-heading)",
1748
+ mono: "var(--font-mono)"
1749
+ },
1750
+ volt: {
1751
+ sans: "var(--font-volt-heading)",
1752
+ mono: "var(--font-mono)"
1753
+ }
1754
+ };
1755
+ function getThemeVars(theme, mode) {
1756
+ const tokens = themeTokens[theme];
1757
+ const colors = tokens[mode]?.colors;
1758
+ const effects = tokens[mode]?.effects;
1759
+ const fonts = fontFamilies[theme];
1760
+ return {
1761
+ // Colors - Base
1762
+ "--color-background": colors?.background || "#ffffff",
1763
+ "--color-background-secondary": colors?.backgroundSecondary || colors?.background || "#fafafa",
1764
+ "--color-background-tertiary": colors?.backgroundTertiary || colors?.backgroundSecondary || colors?.background || "#f5f5f5",
1765
+ "--color-foreground": colors?.foreground || "#0a0a0a",
1766
+ "--color-primary": colors?.primary || "#0a0a0a",
1767
+ "--color-primary-foreground": colors?.primaryForeground || "#ffffff",
1768
+ "--color-secondary": colors?.secondary || "#f5f5f5",
1769
+ "--color-secondary-foreground": colors?.secondaryForeground || "#0a0a0a",
1770
+ "--color-accent": colors?.accent || colors?.primary || "#0070f3",
1771
+ "--color-accent-foreground": colors?.accentForeground || "#ffffff",
1772
+ "--color-success": colors?.success || "#00a86b",
1773
+ "--color-success-foreground": colors?.successForeground || "#ffffff",
1774
+ "--color-warning": colors?.warning || "#f59e0b",
1775
+ "--color-warning-foreground": colors?.warningForeground || "#ffffff",
1776
+ "--color-error": colors?.error || "#ef4444",
1777
+ "--color-error-foreground": colors?.errorForeground || "#ffffff",
1778
+ "--color-info": colors?.info || colors?.accent || "#0070f3",
1779
+ "--color-info-foreground": colors?.infoForeground || "#ffffff",
1780
+ "--color-glass": colors?.glass || "rgba(255, 255, 255, 0.7)",
1781
+ "--color-glass-border": colors?.glassBorder || "rgba(0, 0, 0, 0.1)",
1782
+ // Semantic color aliases (matching README examples)
1783
+ "--color-text-primary": colors?.foreground || "#0a0a0a",
1784
+ "--color-text-secondary": colors?.foregroundSecondary || "#525252",
1785
+ "--color-text-muted": colors?.foregroundTertiary || "#a3a3a3",
1786
+ "--color-surface": colors?.backgroundSecondary || colors?.background || "#fafafa",
1787
+ "--color-border": colors?.border || colors?.glassBorder || "rgba(0, 0, 0, 0.1)",
1788
+ "--color-focus": colors?.accent || colors?.primary || "#0070f3",
1789
+ // Links and focus rings (can be overridden by derived tokens)
1790
+ "--color-link": colors?.link || colors?.primary || "#0a0a0a",
1791
+ "--color-ring": colors?.ring || colors?.primary || "#0a0a0a",
1792
+ // Interactive states
1793
+ "--color-hover": colors?.hover || colors?.backgroundSecondary || "#fafafa",
1794
+ "--color-active": colors?.active || colors?.backgroundTertiary || "#f0f0f0",
1795
+ "--color-link-hover": colors?.linkHover || colors?.primary || "#0a0a0a",
1796
+ "--color-link-hover-foreground": colors?.linkHoverForeground || colors?.background || "#ffffff",
1797
+ // Effects - Blur
1798
+ "--effect-blur-sm": effects?.blur?.sm || "blur(4px)",
1799
+ "--effect-blur-md": effects?.blur?.md || "blur(8px)",
1800
+ "--effect-blur-lg": effects?.blur?.lg || "blur(16px)",
1801
+ "--effect-blur-xl": effects?.blur?.xl || effects?.blur?.lg || "blur(24px)",
1802
+ // Effects - Shadow
1803
+ "--effect-shadow-sm": effects?.shadow?.sm || "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
1804
+ "--effect-shadow-md": effects?.shadow?.md || effects?.shadow?.sm || "0 4px 6px -1px rgba(0, 0, 0, 0.1)",
1805
+ "--effect-shadow-lg": effects?.shadow?.lg || effects?.shadow?.md || effects?.shadow?.sm || "0 10px 15px -3px rgba(0, 0, 0, 0.1)",
1806
+ // Typography - Font Families
1807
+ "--font-heading": fonts?.heading || (theme === "sage" && fonts?.serif ? fonts.serif : fonts?.sans) || "var(--font-studio-heading)",
1808
+ "--font-body": fonts?.body || fonts?.sans || "var(--font-studio-body)",
1809
+ "--font-mono": fonts?.mono || "var(--font-studio-mono)",
1810
+ // Motion - These are accessed programmatically via tokens
1811
+ // but we can set defaults for CSS animations
1812
+ "--ease-default": tokens?.motion?.ease?.default || "cubic-bezier(0.4, 0, 0.2, 1)",
1813
+ "--ease-spring": tokens?.motion?.ease?.spring || tokens?.motion?.ease?.default || "cubic-bezier(0.16, 1, 0.3, 1)",
1814
+ // Syntax Highlighting - Based on VS Code Dark+ theme
1815
+ "--syntax-comment": mode === "light" ? syntaxColors.light.comment : syntaxColors.dark.comment,
1816
+ "--syntax-keyword": mode === "light" ? syntaxColors.light.keyword : syntaxColors.dark.keyword,
1817
+ "--syntax-function": mode === "light" ? syntaxColors.light.function : syntaxColors.dark.function,
1818
+ "--syntax-string": mode === "light" ? syntaxColors.light.string : syntaxColors.dark.string,
1819
+ "--syntax-number": mode === "light" ? syntaxColors.light.number : syntaxColors.dark.number,
1820
+ "--syntax-boolean": mode === "light" ? syntaxColors.light.boolean : syntaxColors.dark.boolean,
1821
+ "--syntax-operator": mode === "light" ? syntaxColors.light.operator : syntaxColors.dark.operator,
1822
+ "--syntax-property": mode === "light" ? syntaxColors.light.property : syntaxColors.dark.property,
1823
+ "--syntax-className": mode === "light" ? syntaxColors.light.className : syntaxColors.dark.className,
1824
+ "--syntax-tag": mode === "light" ? syntaxColors.light.tag : syntaxColors.dark.tag,
1825
+ "--syntax-attribute": mode === "light" ? syntaxColors.light.attribute : syntaxColors.dark.attribute,
1826
+ "--syntax-variable": mode === "light" ? syntaxColors.light.variable : syntaxColors.dark.variable,
1827
+ "--syntax-punctuation": mode === "light" ? syntaxColors.light.punctuation : syntaxColors.dark.punctuation,
1828
+ "--syntax-plain": mode === "light" ? syntaxColors.light.plain : syntaxColors.dark.plain,
1829
+ // Code Block Backgrounds and Borders - Accessible contrast (WCAG AA 4.5:1)
1830
+ "--code-block-bg": mode === "light" ? codeColors.light.blockBackground : codeColors.dark.blockBackground,
1831
+ "--code-inline-bg": mode === "light" ? codeColors.light.inlineBackground : codeColors.dark.inlineBackground,
1832
+ "--code-border": mode === "light" ? codeColors.light.border : codeColors.dark.border
1833
+ };
1834
+ }
1835
+ function mergeCustomColorTokens(baseTokens2, customPalette) {
1836
+ return {
1837
+ ...baseTokens2,
1838
+ // Override primary color
1839
+ "--color-primary": customPalette.primary,
1840
+ "--color-primary-foreground": customPalette.primaryForeground,
1841
+ // Apply color scale (for utilities like bg-primary/50)
1842
+ "--color-primary-50": customPalette.scale[50],
1843
+ "--color-primary-100": customPalette.scale[100],
1844
+ "--color-primary-200": customPalette.scale[200],
1845
+ "--color-primary-300": customPalette.scale[300],
1846
+ "--color-primary-400": customPalette.scale[400],
1847
+ "--color-primary-500": customPalette.scale[500],
1848
+ "--color-primary-600": customPalette.scale[600],
1849
+ "--color-primary-700": customPalette.scale[700],
1850
+ "--color-primary-800": customPalette.scale[800],
1851
+ "--color-primary-900": customPalette.scale[900],
1852
+ // Override secondary color if provided (advanced mode)
1853
+ ...customPalette.secondary && {
1854
+ "--color-secondary": customPalette.secondary,
1855
+ "--color-secondary-foreground": customPalette.secondaryForeground || baseTokens2["--color-secondary-foreground"]
1856
+ },
1857
+ // Override accent color if provided (advanced mode)
1858
+ ...customPalette.accent && {
1859
+ "--color-accent": customPalette.accent,
1860
+ "--color-accent-foreground": customPalette.accentForeground || baseTokens2["--color-accent-foreground"]
1861
+ },
1862
+ // Apply ALL derived tokens from dependency graph
1863
+ // This automatically updates:
1864
+ // - Links (--color-link, --color-link-hover)
1865
+ // - Focus rings (--color-ring)
1866
+ // - Charts (--chart-1, --chart-2, --chart-3, --chart-4, --chart-5)
1867
+ // - Buttons, badges, and any other dependent tokens
1868
+ ...customPalette.derivedTokens
1869
+ };
1870
+ }
1871
+ function ThemeProvider({ children }) {
1872
+ const { theme, mode } = useThemeStore();
1873
+ const customPalette = useCustomizer((state) => state.customColors?.[theme]?.[mode]);
1874
+ const [isTransitioning, setIsTransitioning] = useState(false);
1875
+ const [mounted, setMounted] = useState(false);
1876
+ useEffect(() => {
1877
+ setMounted(true);
1878
+ }, []);
1879
+ useEffect(() => {
1880
+ if (!mounted) return;
1881
+ setIsTransitioning(true);
1882
+ const root = document.documentElement;
1883
+ const baseTokens2 = getThemeVars(theme, mode);
1884
+ console.log("[ThemeProvider] Update:", {
1885
+ theme,
1886
+ mode,
1887
+ hasCustomPalette: !!customPalette,
1888
+ customPrimary: customPalette?.primary,
1889
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1890
+ });
1891
+ const finalTokens = customPalette ? mergeCustomColorTokens(baseTokens2, customPalette) : baseTokens2;
1892
+ root.classList.add("theme-transitioning");
1893
+ Object.entries(finalTokens).forEach(([key, value]) => {
1894
+ root.style.setProperty(key, value);
1895
+ });
1896
+ root.setAttribute("data-theme", theme);
1897
+ root.setAttribute("data-mode", mode);
1898
+ root.setAttribute("data-custom-colors", customPalette ? "active" : "default");
1899
+ if (mode === "dark") {
1900
+ root.classList.add("dark");
1901
+ } else {
1902
+ root.classList.remove("dark");
1903
+ }
1904
+ const timeout = setTimeout(() => {
1905
+ root.classList.remove("theme-transitioning");
1906
+ setIsTransitioning(false);
1907
+ }, 400);
1908
+ return () => clearTimeout(timeout);
1909
+ }, [theme, mode, mounted, customPalette]);
1910
+ if (!mounted) {
1911
+ return null;
1912
+ }
1913
+ return /* @__PURE__ */ jsx(Fragment, { children });
1914
+ }
1915
+ export {
1916
+ ThemeProvider
1917
+ };
1918
+ //# sourceMappingURL=providers.mjs.map