@opencosmos/ui 1.3.1

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