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