gradient-forge 1.0.0

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 (56) hide show
  1. package/.eslintrc.json +3 -0
  2. package/.github/FUNDING.yml +2 -0
  3. package/README.md +140 -0
  4. package/app/docs/page.tsx +417 -0
  5. package/app/gallery/page.tsx +398 -0
  6. package/app/globals.css +1155 -0
  7. package/app/layout.tsx +36 -0
  8. package/app/page.tsx +600 -0
  9. package/app/showcase/page.tsx +730 -0
  10. package/app/studio/page.tsx +1310 -0
  11. package/cli/index.mjs +1141 -0
  12. package/cli/templates/theme-context.tsx +120 -0
  13. package/cli/templates/theme-engine.ts +237 -0
  14. package/cli/templates/themes.css +512 -0
  15. package/components/site/component-showcase.tsx +623 -0
  16. package/components/site/site-data.ts +103 -0
  17. package/components/site/site-header.tsx +270 -0
  18. package/components/templates/blog.tsx +198 -0
  19. package/components/templates/components-showcase.tsx +298 -0
  20. package/components/templates/dashboard.tsx +246 -0
  21. package/components/templates/ecommerce.tsx +199 -0
  22. package/components/templates/mail.tsx +275 -0
  23. package/components/templates/saas-landing.tsx +169 -0
  24. package/components/theme/studio-code-panel.tsx +485 -0
  25. package/components/theme/theme-context.tsx +120 -0
  26. package/components/theme/theme-engine.ts +237 -0
  27. package/components/theme/theme-exporter.tsx +369 -0
  28. package/components/theme/theme-panel.tsx +268 -0
  29. package/components/theme/token-export-utils.ts +1211 -0
  30. package/components/ui/animated.tsx +55 -0
  31. package/components/ui/avatar.tsx +38 -0
  32. package/components/ui/badge.tsx +32 -0
  33. package/components/ui/button.tsx +65 -0
  34. package/components/ui/card.tsx +56 -0
  35. package/components/ui/checkbox.tsx +19 -0
  36. package/components/ui/command-palette.tsx +245 -0
  37. package/components/ui/gsap-animated.tsx +436 -0
  38. package/components/ui/input.tsx +17 -0
  39. package/components/ui/select.tsx +176 -0
  40. package/components/ui/skeleton.tsx +102 -0
  41. package/components/ui/switch.tsx +43 -0
  42. package/components/ui/tabs.tsx +115 -0
  43. package/components/ui/toast.tsx +119 -0
  44. package/gradient-forge/theme-context.tsx +119 -0
  45. package/gradient-forge/theme-engine.ts +236 -0
  46. package/gradient-forge/themes.css +556 -0
  47. package/lib/animations.ts +50 -0
  48. package/lib/gsap.ts +426 -0
  49. package/lib/utils.ts +6 -0
  50. package/next-env.d.ts +6 -0
  51. package/next.config.mjs +6 -0
  52. package/package.json +53 -0
  53. package/postcss.config.mjs +5 -0
  54. package/tailwind.config.ts +15 -0
  55. package/tsconfig.json +43 -0
  56. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,1211 @@
1
+ // Token Export Utilities - Comprehensive export format generators
2
+ import { NITRO_ALL_THEMES, type ThemeId } from "./theme-engine";
3
+
4
+ // Token definitions for each theme
5
+ const themeTokens: Record<string, Record<string, string>> = {
6
+ "theme-nitro-mint-apple": {
7
+ "--background": "160 45% 18%",
8
+ "--foreground": "150 40% 95%",
9
+ "--card": "160 40% 20%",
10
+ "--card-foreground": "150 40% 95%",
11
+ "--popover": "160 40% 20%",
12
+ "--popover-foreground": "150 40% 95%",
13
+ "--primary": "145 50% 55%",
14
+ "--primary-foreground": "160 40% 10%",
15
+ "--secondary": "100 45% 68%",
16
+ "--secondary-foreground": "160 40% 10%",
17
+ "--muted": "160 35% 25%",
18
+ "--muted-foreground": "150 30% 70%",
19
+ "--accent": "100 45% 68%",
20
+ "--accent-foreground": "160 40% 10%",
21
+ "--destructive": "0 84% 60%",
22
+ "--destructive-foreground": "0 0% 98%",
23
+ "--border": "160 30% 30%",
24
+ "--input": "160 30% 30%",
25
+ "--ring": "145 50% 55%",
26
+ "--chart-1": "145 50% 55%",
27
+ "--chart-2": "100 45% 68%",
28
+ "--chart-3": "75 60% 80%",
29
+ "--chart-4": "120 50% 60%",
30
+ "--chart-5": "160 40% 40%",
31
+ "--sidebar-background": "160 45% 16%",
32
+ "--sidebar-foreground": "150 40% 95%",
33
+ "--sidebar-primary": "145 50% 55%",
34
+ "--sidebar-primary-foreground": "160 40% 10%",
35
+ "--sidebar-accent": "160 35% 25%",
36
+ "--sidebar-accent-foreground": "150 40% 95%",
37
+ "--sidebar-border": "160 30% 30%",
38
+ "--sidebar-ring": "145 50% 55%",
39
+ "--app-surface-tint": "hsl(145 50% 55% / 0.1)",
40
+ },
41
+ "theme-nitro-citrus-sherbert": {
42
+ "--background": "25 70% 15%",
43
+ "--foreground": "35 60% 95%",
44
+ "--card": "25 65% 18%",
45
+ "--card-foreground": "35 60% 95%",
46
+ "--popover": "25 65% 18%",
47
+ "--popover-foreground": "35 60% 95%",
48
+ "--primary": "25 80% 55%",
49
+ "--primary-foreground": "25 70% 10%",
50
+ "--secondary": "45 85% 65%",
51
+ "--secondary-foreground": "25 70% 10%",
52
+ "--muted": "25 50% 25%",
53
+ "--muted-foreground": "35 40% 70%",
54
+ "--accent": "55 90% 75%",
55
+ "--accent-foreground": "25 70% 10%",
56
+ "--destructive": "0 84% 60%",
57
+ "--destructive-foreground": "0 0% 98%",
58
+ "--border": "25 45% 30%",
59
+ "--input": "25 45% 30%",
60
+ "--ring": "25 80% 55%",
61
+ "--chart-1": "25 80% 55%",
62
+ "--chart-2": "45 85% 65%",
63
+ "--chart-3": "55 90% 75%",
64
+ "--chart-4": "15 70% 50%",
65
+ "--chart-5": "35 75% 60%",
66
+ "--sidebar-background": "25 70% 13%",
67
+ "--sidebar-foreground": "35 60% 95%",
68
+ "--sidebar-primary": "25 80% 55%",
69
+ "--sidebar-primary-foreground": "25 70% 10%",
70
+ "--sidebar-accent": "25 50% 25%",
71
+ "--sidebar-accent-foreground": "35 60% 95%",
72
+ "--sidebar-border": "25 45% 30%",
73
+ "--sidebar-ring": "25 80% 55%",
74
+ "--app-surface-tint": "hsl(25 80% 55% / 0.1)",
75
+ },
76
+ "theme-nitro-retro-raincloud": {
77
+ "--background": "215 25% 20%",
78
+ "--foreground": "210 30% 95%",
79
+ "--card": "215 22% 23%",
80
+ "--card-foreground": "210 30% 95%",
81
+ "--popover": "215 22% 23%",
82
+ "--popover-foreground": "210 30% 95%",
83
+ "--primary": "210 25% 55%",
84
+ "--primary-foreground": "215 25% 15%",
85
+ "--secondary": "210 20% 65%",
86
+ "--secondary-foreground": "215 25% 15%",
87
+ "--muted": "215 20% 30%",
88
+ "--muted-foreground": "210 20% 70%",
89
+ "--accent": "210 20% 65%",
90
+ "--accent-foreground": "215 25% 15%",
91
+ "--destructive": "0 84% 60%",
92
+ "--destructive-foreground": "0 0% 98%",
93
+ "--border": "215 20% 35%",
94
+ "--input": "215 20% 35%",
95
+ "--ring": "210 25% 55%",
96
+ "--chart-1": "210 25% 55%",
97
+ "--chart-2": "210 20% 65%",
98
+ "--chart-3": "210 15% 75%",
99
+ "--chart-4": "215 20% 45%",
100
+ "--chart-5": "215 25% 35%",
101
+ "--sidebar-background": "215 25% 18%",
102
+ "--sidebar-foreground": "210 30% 95%",
103
+ "--sidebar-primary": "210 25% 55%",
104
+ "--sidebar-primary-foreground": "215 25% 15%",
105
+ "--sidebar-accent": "215 20% 30%",
106
+ "--sidebar-accent-foreground": "210 30% 95%",
107
+ "--sidebar-border": "215 20% 35%",
108
+ "--sidebar-ring": "210 25% 55%",
109
+ "--app-surface-tint": "hsl(210 25% 55% / 0.1)",
110
+ },
111
+ "theme-nitro-hanami": {
112
+ "--background": "330 30% 20%",
113
+ "--foreground": "330 30% 95%",
114
+ "--card": "330 25% 23%",
115
+ "--card-foreground": "330 30% 95%",
116
+ "--popover": "330 25% 23%",
117
+ "--popover-foreground": "330 30% 95%",
118
+ "--primary": "330 40% 55%",
119
+ "--primary-foreground": "330 30% 10%",
120
+ "--secondary": "340 45% 65%",
121
+ "--secondary-foreground": "330 30% 10%",
122
+ "--muted": "330 20% 30%",
123
+ "--muted-foreground": "330 25% 70%",
124
+ "--accent": "350 50% 75%",
125
+ "--accent-foreground": "330 30% 10%",
126
+ "--destructive": "0 84% 60%",
127
+ "--destructive-foreground": "0 0% 98%",
128
+ "--border": "330 20% 35%",
129
+ "--input": "330 20% 35%",
130
+ "--ring": "330 40% 55%",
131
+ "--chart-1": "330 40% 55%",
132
+ "--chart-2": "340 45% 65%",
133
+ "--chart-3": "350 50% 75%",
134
+ "--chart-4": "320 35% 45%",
135
+ "--chart-5": "340 30% 35%",
136
+ "--sidebar-background": "330 30% 18%",
137
+ "--sidebar-foreground": "330 30% 95%",
138
+ "--sidebar-primary": "330 40% 55%",
139
+ "--sidebar-primary-foreground": "330 30% 10%",
140
+ "--sidebar-accent": "330 20% 30%",
141
+ "--sidebar-accent-foreground": "330 30% 95%",
142
+ "--sidebar-border": "330 20% 35%",
143
+ "--sidebar-ring": "330 40% 55%",
144
+ "--app-surface-tint": "hsl(330 40% 55% / 0.1)",
145
+ },
146
+ "theme-nitro-sunrise": {
147
+ "--background": "350 50% 18%",
148
+ "--foreground": "30 60% 95%",
149
+ "--card": "350 45% 21%",
150
+ "--card-foreground": "30 60% 95%",
151
+ "--popover": "350 45% 21%",
152
+ "--popover-foreground": "30 60% 95%",
153
+ "--primary": "355 75% 60%",
154
+ "--primary-foreground": "350 50% 10%",
155
+ "--secondary": "25 85% 65%",
156
+ "--secondary-foreground": "350 50% 10%",
157
+ "--muted": "350 30% 28%",
158
+ "--muted-foreground": "30 40% 75%",
159
+ "--accent": "45 90% 73%",
160
+ "--accent-foreground": "350 50% 10%",
161
+ "--destructive": "0 84% 60%",
162
+ "--destructive-foreground": "0 0% 98%",
163
+ "--border": "350 25% 35%",
164
+ "--input": "350 25% 35%",
165
+ "--ring": "355 75% 60%",
166
+ "--chart-1": "355 75% 60%",
167
+ "--chart-2": "25 85% 65%",
168
+ "--chart-3": "45 90% 73%",
169
+ "--chart-4": "340 60% 50%",
170
+ "--chart-5": "15 70% 58%",
171
+ "--sidebar-background": "350 50% 16%",
172
+ "--sidebar-foreground": "30 60% 95%",
173
+ "--sidebar-primary": "355 75% 60%",
174
+ "--sidebar-primary-foreground": "350 50% 10%",
175
+ "--sidebar-accent": "350 30% 28%",
176
+ "--sidebar-accent-foreground": "30 60% 95%",
177
+ "--sidebar-border": "350 25% 35%",
178
+ "--sidebar-ring": "355 75% 60%",
179
+ "--app-surface-tint": "hsl(355 75% 60% / 0.1)",
180
+ },
181
+ "theme-nitro-cotton-candy": {
182
+ "--background": "220 50% 20%",
183
+ "--foreground": "220 40% 95%",
184
+ "--card": "220 45% 23%",
185
+ "--card-foreground": "220 40% 95%",
186
+ "--popover": "220 45% 23%",
187
+ "--popover-foreground": "220 40% 95%",
188
+ "--primary": "220 70% 65%",
189
+ "--primary-foreground": "220 50% 10%",
190
+ "--secondary": "270 60% 70%",
191
+ "--secondary-foreground": "220 50% 10%",
192
+ "--muted": "220 30% 30%",
193
+ "--muted-foreground": "220 30% 75%",
194
+ "--accent": "330 65% 75%",
195
+ "--accent-foreground": "220 50% 10%",
196
+ "--destructive": "0 84% 60%",
197
+ "--destructive-foreground": "0 0% 98%",
198
+ "--border": "220 25% 35%",
199
+ "--input": "220 25% 35%",
200
+ "--ring": "220 70% 65%",
201
+ "--chart-1": "220 70% 65%",
202
+ "--chart-2": "270 60% 70%",
203
+ "--chart-3": "330 65% 75%",
204
+ "--chart-4": "200 60% 55%",
205
+ "--chart-5": "280 50% 45%",
206
+ "--sidebar-background": "220 50% 18%",
207
+ "--sidebar-foreground": "220 40% 95%",
208
+ "--sidebar-primary": "220 70% 65%",
209
+ "--sidebar-primary-foreground": "220 50% 10%",
210
+ "--sidebar-accent": "220 30% 30%",
211
+ "--sidebar-accent-foreground": "220 40% 95%",
212
+ "--sidebar-border": "220 25% 35%",
213
+ "--sidebar-ring": "220 70% 65%",
214
+ "--app-surface-tint": "hsl(220 70% 65% / 0.1)",
215
+ },
216
+ "theme-nitro-lofi-vibes": {
217
+ "--background": "230 25% 18%",
218
+ "--foreground": "230 20% 95%",
219
+ "--card": "230 22% 21%",
220
+ "--card-foreground": "230 20% 95%",
221
+ "--popover": "230 22% 21%",
222
+ "--popover-foreground": "230 20% 95%",
223
+ "--primary": "230 25% 55%",
224
+ "--primary-foreground": "230 25% 10%",
225
+ "--secondary": "260 20% 60%",
226
+ "--secondary-foreground": "230 25% 10%",
227
+ "--muted": "230 15% 28%",
228
+ "--muted-foreground": "230 15% 70%",
229
+ "--accent": "280 20% 55%",
230
+ "--accent-foreground": "230 25% 10%",
231
+ "--destructive": "0 84% 60%",
232
+ "--destructive-foreground": "0 0% 98%",
233
+ "--border": "230 15% 33%",
234
+ "--input": "230 15% 33%",
235
+ "--ring": "230 25% 55%",
236
+ "--chart-1": "230 25% 55%",
237
+ "--chart-2": "260 20% 60%",
238
+ "--chart-3": "280 20% 55%",
239
+ "--chart-4": "240 20% 45%",
240
+ "--chart-5": "250 20% 35%",
241
+ "--sidebar-background": "230 25% 16%",
242
+ "--sidebar-foreground": "230 20% 95%",
243
+ "--sidebar-primary": "230 25% 55%",
244
+ "--sidebar-primary-foreground": "230 25% 10%",
245
+ "--sidebar-accent": "230 15% 28%",
246
+ "--sidebar-accent-foreground": "230 20% 95%",
247
+ "--sidebar-border": "230 15% 33%",
248
+ "--sidebar-ring": "230 25% 55%",
249
+ "--app-surface-tint": "hsl(230 25% 55% / 0.1)",
250
+ },
251
+ "theme-nitro-desert-khaki": {
252
+ "--background": "35 25% 18%",
253
+ "--foreground": "35 30% 95%",
254
+ "--card": "35 22% 21%",
255
+ "--card-foreground": "35 30% 95%",
256
+ "--popover": "35 22% 21%",
257
+ "--popover-foreground": "35 30% 95%",
258
+ "--primary": "35 25% 50%",
259
+ "--primary-foreground": "35 25% 10%",
260
+ "--secondary": "40 20% 58%",
261
+ "--secondary-foreground": "35 25% 10%",
262
+ "--muted": "35 15% 28%",
263
+ "--muted-foreground": "35 20% 70%",
264
+ "--accent": "45 25% 60%",
265
+ "--accent-foreground": "35 25% 10%",
266
+ "--destructive": "0 84% 60%",
267
+ "--destructive-foreground": "0 0% 98%",
268
+ "--border": "35 15% 33%",
269
+ "--input": "35 15% 33%",
270
+ "--ring": "35 25% 50%",
271
+ "--chart-1": "35 25% 50%",
272
+ "--chart-2": "40 20% 58%",
273
+ "--chart-3": "45 25% 60%",
274
+ "--chart-4": "30 20% 42%",
275
+ "--chart-5": "38 18% 32%",
276
+ "--sidebar-background": "35 25% 16%",
277
+ "--sidebar-foreground": "35 30% 95%",
278
+ "--sidebar-primary": "35 25% 50%",
279
+ "--sidebar-primary-foreground": "35 25% 10%",
280
+ "--sidebar-accent": "35 15% 28%",
281
+ "--sidebar-accent-foreground": "35 30% 95%",
282
+ "--sidebar-border": "35 15% 33%",
283
+ "--sidebar-ring": "35 25% 50%",
284
+ "--app-surface-tint": "hsl(35 25% 50% / 0.1)",
285
+ },
286
+ "theme-nitro-sunset": {
287
+ "--background": "320 40% 15%",
288
+ "--foreground": "25 60% 95%",
289
+ "--card": "320 35% 18%",
290
+ "--card-foreground": "25 60% 95%",
291
+ "--popover": "320 35% 18%",
292
+ "--popover-foreground": "25 60% 95%",
293
+ "--primary": "335 60% 50%",
294
+ "--primary-foreground": "320 40% 10%",
295
+ "--secondary": "20 70% 55%",
296
+ "--secondary-foreground": "320 40% 10%",
297
+ "--muted": "320 25% 25%",
298
+ "--muted-foreground": "25 40% 75%",
299
+ "--accent": "25 85% 62%",
300
+ "--accent-foreground": "320 40% 10%",
301
+ "--destructive": "0 84% 60%",
302
+ "--destructive-foreground": "0 0% 98%",
303
+ "--border": "320 20% 32%",
304
+ "--input": "320 20% 32%",
305
+ "--ring": "335 60% 50%",
306
+ "--chart-1": "335 60% 50%",
307
+ "--chart-2": "20 70% 55%",
308
+ "--chart-3": "25 85% 62%",
309
+ "--chart-4": "340 50% 45%",
310
+ "--chart-5": "10 60% 50%",
311
+ "--sidebar-background": "320 40% 13%",
312
+ "--sidebar-foreground": "25 60% 95%",
313
+ "--sidebar-primary": "335 60% 50%",
314
+ "--sidebar-primary-foreground": "320 40% 10%",
315
+ "--sidebar-accent": "320 25% 25%",
316
+ "--sidebar-accent-foreground": "25 60% 95%",
317
+ "--sidebar-border": "320 20% 32%",
318
+ "--sidebar-ring": "335 60% 50%",
319
+ "--app-surface-tint": "hsl(335 60% 50% / 0.1)",
320
+ },
321
+ "theme-nitro-chroma-glow": {
322
+ "--background": "240 60% 15%",
323
+ "--foreground": "240 40% 95%",
324
+ "--card": "240 55% 18%",
325
+ "--card-foreground": "240 40% 95%",
326
+ "--popover": "240 55% 18%",
327
+ "--popover-foreground": "240 40% 95%",
328
+ "--primary": "235 100% 60%",
329
+ "--primary-foreground": "240 60% 10%",
330
+ "--secondary": "280 95% 55%",
331
+ "--secondary-foreground": "240 60% 10%",
332
+ "--muted": "240 30% 25%",
333
+ "--muted-foreground": "240 25% 75%",
334
+ "--accent": "195 100% 50%",
335
+ "--accent-foreground": "240 60% 10%",
336
+ "--destructive": "0 84% 60%",
337
+ "--destructive-foreground": "0 0% 98%",
338
+ "--border": "240 25% 32%",
339
+ "--input": "240 25% 32%",
340
+ "--ring": "235 100% 60%",
341
+ "--chart-1": "235 100% 60%",
342
+ "--chart-2": "280 95% 55%",
343
+ "--chart-3": "195 100% 50%",
344
+ "--chart-4": "260 80% 50%",
345
+ "--chart-5": "220 70% 45%",
346
+ "--sidebar-background": "240 60% 13%",
347
+ "--sidebar-foreground": "240 40% 95%",
348
+ "--sidebar-primary": "235 100% 60%",
349
+ "--sidebar-primary-foreground": "240 60% 10%",
350
+ "--sidebar-accent": "240 30% 25%",
351
+ "--sidebar-accent-foreground": "240 40% 95%",
352
+ "--sidebar-border": "240 25% 32%",
353
+ "--sidebar-ring": "235 100% 60%",
354
+ "--app-surface-tint": "hsl(235 100% 60% / 0.1)",
355
+ },
356
+ "theme-nitro-forest": {
357
+ "--background": "150 40% 12%",
358
+ "--foreground": "140 30% 95%",
359
+ "--card": "150 35% 15%",
360
+ "--card-foreground": "140 30% 95%",
361
+ "--popover": "150 35% 15%",
362
+ "--popover-foreground": "140 30% 95%",
363
+ "--primary": "150 45% 45%",
364
+ "--primary-foreground": "150 40% 10%",
365
+ "--secondary": "100 40% 55%",
366
+ "--secondary-foreground": "150 40% 10%",
367
+ "--muted": "150 25% 22%",
368
+ "--muted-foreground": "140 20% 70%",
369
+ "--accent": "85 45% 52%",
370
+ "--accent-foreground": "150 40% 10%",
371
+ "--destructive": "0 84% 60%",
372
+ "--destructive-foreground": "0 0% 98%",
373
+ "--border": "150 20% 28%",
374
+ "--input": "150 20% 28%",
375
+ "--ring": "150 45% 45%",
376
+ "--chart-1": "150 45% 45%",
377
+ "--chart-2": "100 40% 55%",
378
+ "--chart-3": "85 45% 52%",
379
+ "--chart-4": "120 40% 40%",
380
+ "--chart-5": "160 35% 30%",
381
+ "--sidebar-background": "150 40% 10%",
382
+ "--sidebar-foreground": "140 30% 95%",
383
+ "--sidebar-primary": "150 45% 45%",
384
+ "--sidebar-primary-foreground": "150 40% 10%",
385
+ "--sidebar-accent": "150 25% 22%",
386
+ "--sidebar-accent-foreground": "140 30% 95%",
387
+ "--sidebar-border": "150 20% 28%",
388
+ "--sidebar-ring": "150 45% 45%",
389
+ "--app-surface-tint": "hsl(150 45% 45% / 0.1)",
390
+ },
391
+ "theme-nitro-crimson": {
392
+ "--background": "345 60% 8%",
393
+ "--foreground": "345 40% 95%",
394
+ "--card": "345 55% 11%",
395
+ "--card-foreground": "345 40% 95%",
396
+ "--popover": "345 55% 11%",
397
+ "--popover-foreground": "345 40% 95%",
398
+ "--primary": "350 65% 45%",
399
+ "--primary-foreground": "345 60% 98%",
400
+ "--secondary": "350 50% 55%",
401
+ "--secondary-foreground": "345 60% 98%",
402
+ "--muted": "345 30% 18%",
403
+ "--muted-foreground": "345 25% 70%",
404
+ "--accent": "355 55% 60%",
405
+ "--accent-foreground": "345 60% 10%",
406
+ "--destructive": "0 84% 60%",
407
+ "--destructive-foreground": "0 0% 98%",
408
+ "--border": "345 25% 25%",
409
+ "--input": "345 25% 25%",
410
+ "--ring": "350 65% 45%",
411
+ "--chart-1": "350 65% 45%",
412
+ "--chart-2": "350 50% 55%",
413
+ "--chart-3": "355 55% 60%",
414
+ "--chart-4": "340 55% 40%",
415
+ "--chart-5": "0 50% 30%",
416
+ "--sidebar-background": "345 60% 6%",
417
+ "--sidebar-foreground": "345 40% 95%",
418
+ "--sidebar-primary": "350 65% 45%",
419
+ "--sidebar-primary-foreground": "345 60% 98%",
420
+ "--sidebar-accent": "345 30% 18%",
421
+ "--sidebar-accent-foreground": "345 40% 95%",
422
+ "--sidebar-border": "345 25% 25%",
423
+ "--sidebar-ring": "350 65% 45%",
424
+ "--app-surface-tint": "hsl(350 65% 45% / 0.1)",
425
+ },
426
+ "theme-nitro-midnight-blurple": {
427
+ "--background": "235 26% 11%",
428
+ "--foreground": "235 30% 95%",
429
+ "--card": "235 22% 12%",
430
+ "--card-foreground": "235 30% 95%",
431
+ "--popover": "235 22% 12%",
432
+ "--popover-foreground": "235 30% 95%",
433
+ "--primary": "241 92% 70%",
434
+ "--primary-foreground": "235 26% 98%",
435
+ "--secondary": "210 92% 65%",
436
+ "--secondary-foreground": "235 26% 98%",
437
+ "--muted": "235 20% 20%",
438
+ "--muted-foreground": "235 20% 72%",
439
+ "--accent": "210 92% 65%",
440
+ "--accent-foreground": "235 26% 98%",
441
+ "--destructive": "0 84% 60%",
442
+ "--destructive-foreground": "0 0% 98%",
443
+ "--border": "235 18% 25%",
444
+ "--input": "235 18% 25%",
445
+ "--ring": "241 92% 70%",
446
+ "--chart-1": "241 92% 70%",
447
+ "--chart-2": "210 92% 65%",
448
+ "--chart-3": "251 92% 62%",
449
+ "--chart-4": "220 80% 55%",
450
+ "--chart-5": "260 70% 45%",
451
+ "--sidebar-background": "235 26% 9%",
452
+ "--sidebar-foreground": "235 30% 95%",
453
+ "--sidebar-primary": "241 92% 70%",
454
+ "--sidebar-primary-foreground": "235 26% 98%",
455
+ "--sidebar-accent": "235 20% 20%",
456
+ "--sidebar-accent-foreground": "235 30% 95%",
457
+ "--sidebar-border": "235 18% 25%",
458
+ "--sidebar-ring": "241 92% 70%",
459
+ "--app-surface-tint": "hsl(241 92% 70% / 0.1)",
460
+ },
461
+ "theme-nitro-mars": {
462
+ "--background": "10 45% 12%",
463
+ "--foreground": "20 40% 95%",
464
+ "--card": "10 40% 15%",
465
+ "--card-foreground": "20 40% 95%",
466
+ "--popover": "10 40% 15%",
467
+ "--popover-foreground": "20 40% 95%",
468
+ "--primary": "12 55% 55%",
469
+ "--primary-foreground": "10 45% 10%",
470
+ "--secondary": "20 50% 45%",
471
+ "--secondary-foreground": "10 45% 10%",
472
+ "--muted": "10 25% 22%",
473
+ "--muted-foreground": "20 25% 72%",
474
+ "--accent": "25 55% 50%",
475
+ "--accent-foreground": "10 45% 10%",
476
+ "--destructive": "0 84% 60%",
477
+ "--destructive-foreground": "0 0% 98%",
478
+ "--border": "10 20% 28%",
479
+ "--input": "10 20% 28%",
480
+ "--ring": "12 55% 55%",
481
+ "--chart-1": "12 55% 55%",
482
+ "--chart-2": "20 50% 45%",
483
+ "--chart-3": "25 55% 50%",
484
+ "--chart-4": "5 50% 40%",
485
+ "--chart-5": "15 45% 32%",
486
+ "--sidebar-background": "10 45% 10%",
487
+ "--sidebar-foreground": "20 40% 95%",
488
+ "--sidebar-primary": "12 55% 55%",
489
+ "--sidebar-primary-foreground": "10 45% 10%",
490
+ "--sidebar-accent": "10 25% 22%",
491
+ "--sidebar-accent-foreground": "20 40% 95%",
492
+ "--sidebar-border": "10 20% 28%",
493
+ "--sidebar-ring": "12 55% 55%",
494
+ "--app-surface-tint": "hsl(12 55% 55% / 0.1)",
495
+ },
496
+ "theme-nitro-dusk": {
497
+ "--background": "260 30% 15%",
498
+ "--foreground": "260 30% 95%",
499
+ "--card": "260 25% 18%",
500
+ "--card-foreground": "260 30% 95%",
501
+ "--popover": "260 25% 18%",
502
+ "--popover-foreground": "260 30% 95%",
503
+ "--primary": "270 35% 60%",
504
+ "--primary-foreground": "260 30% 10%",
505
+ "--secondary": "280 30% 50%",
506
+ "--secondary-foreground": "260 30% 10%",
507
+ "--muted": "260 20% 25%",
508
+ "--muted-foreground": "260 20% 72%",
509
+ "--accent": "290 35% 55%",
510
+ "--accent-foreground": "260 30% 10%",
511
+ "--destructive": "0 84% 60%",
512
+ "--destructive-foreground": "0 0% 98%",
513
+ "--border": "260 18% 32%",
514
+ "--input": "260 18% 32%",
515
+ "--ring": "270 35% 60%",
516
+ "--chart-1": "270 35% 60%",
517
+ "--chart-2": "280 30% 50%",
518
+ "--chart-3": "290 35% 55%",
519
+ "--chart-4": "260 30% 45%",
520
+ "--chart-5": "250 25% 35%",
521
+ "--sidebar-background": "260 30% 13%",
522
+ "--sidebar-foreground": "260 30% 95%",
523
+ "--sidebar-primary": "270 35% 60%",
524
+ "--sidebar-primary-foreground": "260 30% 10%",
525
+ "--sidebar-accent": "260 20% 25%",
526
+ "--sidebar-accent-foreground": "260 30% 95%",
527
+ "--sidebar-border": "260 18% 32%",
528
+ "--sidebar-ring": "270 35% 60%",
529
+ "--app-surface-tint": "hsl(270 35% 60% / 0.1)",
530
+ },
531
+ "theme-nitro-under-the-sea": {
532
+ "--background": "200 50% 12%",
533
+ "--foreground": "190 40% 95%",
534
+ "--card": "200 45% 15%",
535
+ "--card-foreground": "190 40% 95%",
536
+ "--popover": "200 45% 15%",
537
+ "--popover-foreground": "190 40% 95%",
538
+ "--primary": "190 50% 48%",
539
+ "--primary-foreground": "200 50% 10%",
540
+ "--secondary": "180 45% 40%",
541
+ "--secondary-foreground": "200 50% 10%",
542
+ "--muted": "200 30% 22%",
543
+ "--muted-foreground": "190 25% 72%",
544
+ "--accent": "175 50% 35%",
545
+ "--accent-foreground": "200 50% 98%",
546
+ "--destructive": "0 84% 60%",
547
+ "--destructive-foreground": "0 0% 98%",
548
+ "--border": "200 25% 28%",
549
+ "--input": "200 25% 28%",
550
+ "--ring": "190 50% 48%",
551
+ "--chart-1": "190 50% 48%",
552
+ "--chart-2": "180 45% 40%",
553
+ "--chart-3": "175 50% 35%",
554
+ "--chart-4": "210 45% 42%",
555
+ "--chart-5": "195 40% 32%",
556
+ "--sidebar-background": "200 50% 10%",
557
+ "--sidebar-foreground": "190 40% 95%",
558
+ "--sidebar-primary": "190 50% 48%",
559
+ "--sidebar-primary-foreground": "200 50% 10%",
560
+ "--sidebar-accent": "200 30% 22%",
561
+ "--sidebar-accent-foreground": "190 40% 95%",
562
+ "--sidebar-border": "200 25% 28%",
563
+ "--sidebar-ring": "190 50% 48%",
564
+ "--app-surface-tint": "hsl(190 50% 48% / 0.1)",
565
+ },
566
+ "theme-nitro-retro-storm": {
567
+ "--background": "210 25% 18%",
568
+ "--foreground": "210 20% 95%",
569
+ "--card": "210 22% 21%",
570
+ "--card-foreground": "210 20% 95%",
571
+ "--popover": "210 22% 21%",
572
+ "--popover-foreground": "210 20% 95%",
573
+ "--primary": "210 20% 55%",
574
+ "--primary-foreground": "210 25% 10%",
575
+ "--secondary": "210 15% 60%",
576
+ "--secondary-foreground": "210 25% 10%",
577
+ "--muted": "210 15% 28%",
578
+ "--muted-foreground": "210 15% 70%",
579
+ "--accent": "210 15% 50%",
580
+ "--accent-foreground": "210 25% 10%",
581
+ "--destructive": "0 84% 60%",
582
+ "--destructive-foreground": "0 0% 98%",
583
+ "--border": "210 15% 33%",
584
+ "--input": "210 15% 33%",
585
+ "--ring": "210 20% 55%",
586
+ "--chart-1": "210 20% 55%",
587
+ "--chart-2": "210 15% 60%",
588
+ "--chart-3": "210 15% 50%",
589
+ "--chart-4": "200 15% 45%",
590
+ "--chart-5": "220 15% 35%",
591
+ "--sidebar-background": "210 25% 16%",
592
+ "--sidebar-foreground": "210 20% 95%",
593
+ "--sidebar-primary": "210 20% 55%",
594
+ "--sidebar-primary-foreground": "210 25% 10%",
595
+ "--sidebar-accent": "210 15% 28%",
596
+ "--sidebar-accent-foreground": "210 20% 95%",
597
+ "--sidebar-border": "210 15% 33%",
598
+ "--sidebar-ring": "210 20% 55%",
599
+ "--app-surface-tint": "hsl(210 20% 55% / 0.1)",
600
+ },
601
+ "theme-nitro-neon-nights": {
602
+ "--background": "245 60% 8%",
603
+ "--foreground": "260 40% 95%",
604
+ "--card": "245 55% 11%",
605
+ "--card-foreground": "260 40% 95%",
606
+ "--popover": "245 55% 11%",
607
+ "--popover-foreground": "260 40% 95%",
608
+ "--primary": "290 90% 55%",
609
+ "--primary-foreground": "245 60% 98%",
610
+ "--secondary": "195 100% 45%",
611
+ "--secondary-foreground": "245 60% 98%",
612
+ "--muted": "245 30% 18%",
613
+ "--muted-foreground": "260 25% 72%",
614
+ "--accent": "195 100% 45%",
615
+ "--accent-foreground": "245 60% 98%",
616
+ "--destructive": "0 84% 60%",
617
+ "--destructive-foreground": "0 0% 98%",
618
+ "--border": "245 25% 25%",
619
+ "--input": "245 25% 25%",
620
+ "--ring": "290 90% 55%",
621
+ "--chart-1": "290 90% 55%",
622
+ "--chart-2": "195 100% 45%",
623
+ "--chart-3": "260 80% 50%",
624
+ "--chart-4": "320 80% 55%",
625
+ "--chart-5": "180 80% 45%",
626
+ "--sidebar-background": "245 60% 6%",
627
+ "--sidebar-foreground": "260 40% 95%",
628
+ "--sidebar-primary": "290 90% 55%",
629
+ "--sidebar-primary-foreground": "245 60% 98%",
630
+ "--sidebar-accent": "245 30% 18%",
631
+ "--sidebar-accent-foreground": "260 40% 95%",
632
+ "--sidebar-border": "245 25% 25%",
633
+ "--sidebar-ring": "290 90% 55%",
634
+ "--app-surface-tint": "hsl(290 90% 55% / 0.1)",
635
+ },
636
+ "theme-nitro-strawberry-lemonade": {
637
+ "--background": "340 55% 18%",
638
+ "--foreground": "40 70% 95%",
639
+ "--card": "340 50% 21%",
640
+ "--card-foreground": "40 70% 95%",
641
+ "--popover": "340 50% 21%",
642
+ "--popover-foreground": "40 70% 95%",
643
+ "--primary": "345 70% 50%",
644
+ "--primary-foreground": "340 55% 98%",
645
+ "--secondary": "45 80% 58%",
646
+ "--secondary-foreground": "340 55% 10%",
647
+ "--muted": "340 30% 28%",
648
+ "--muted-foreground": "40 40% 75%",
649
+ "--accent": "45 80% 58%",
650
+ "--accent-foreground": "340 55% 10%",
651
+ "--destructive": "0 84% 60%",
652
+ "--destructive-foreground": "0 0% 98%",
653
+ "--border": "340 25% 35%",
654
+ "--input": "340 25% 35%",
655
+ "--ring": "345 70% 50%",
656
+ "--chart-1": "345 70% 50%",
657
+ "--chart-2": "45 80% 58%",
658
+ "--chart-3": "340 55% 45%",
659
+ "--chart-4": "20 70% 50%",
660
+ "--chart-5": "55 75% 55%",
661
+ "--sidebar-background": "340 55% 16%",
662
+ "--sidebar-foreground": "40 70% 95%",
663
+ "--sidebar-primary": "345 70% 50%",
664
+ "--sidebar-primary-foreground": "340 55% 98%",
665
+ "--sidebar-accent": "340 30% 28%",
666
+ "--sidebar-accent-foreground": "40 70% 95%",
667
+ "--sidebar-border": "340 25% 35%",
668
+ "--sidebar-ring": "345 70% 50%",
669
+ "--app-surface-tint": "hsl(345 70% 50% / 0.1)",
670
+ },
671
+ "theme-nitro-aurora": {
672
+ "--background": "190 50% 12%",
673
+ "--foreground": "160 50% 95%",
674
+ "--card": "190 45% 15%",
675
+ "--card-foreground": "160 50% 95%",
676
+ "--popover": "190 45% 15%",
677
+ "--popover-foreground": "160 50% 95%",
678
+ "--primary": "175 60% 52%",
679
+ "--primary-foreground": "190 50% 10%",
680
+ "--secondary": "145 45% 55%",
681
+ "--secondary-foreground": "190 50% 10%",
682
+ "--muted": "190 30% 22%",
683
+ "--muted-foreground": "160 30% 72%",
684
+ "--accent": "100 45% 55%",
685
+ "--accent-foreground": "190 50% 98%",
686
+ "--destructive": "0 84% 60%",
687
+ "--destructive-foreground": "0 0% 98%",
688
+ "--border": "190 25% 28%",
689
+ "--input": "190 25% 28%",
690
+ "--ring": "175 60% 52%",
691
+ "--chart-1": "175 60% 52%",
692
+ "--chart-2": "145 45% 55%",
693
+ "--chart-3": "100 45% 55%",
694
+ "--chart-4": "160 50% 42%",
695
+ "--chart-5": "200 45% 35%",
696
+ "--sidebar-background": "190 50% 10%",
697
+ "--sidebar-foreground": "160 50% 95%",
698
+ "--sidebar-primary": "175 60% 52%",
699
+ "--sidebar-primary-foreground": "190 50% 10%",
700
+ "--sidebar-accent": "190 30% 22%",
701
+ "--sidebar-accent-foreground": "160 50% 95%",
702
+ "--sidebar-border": "190 25% 28%",
703
+ "--sidebar-ring": "175 60% 52%",
704
+ "--app-surface-tint": "hsl(175 60% 52% / 0.1)",
705
+ },
706
+ "theme-nitro-sepia": {
707
+ "--background": "30 25% 12%",
708
+ "--foreground": "35 30% 95%",
709
+ "--card": "30 22% 15%",
710
+ "--card-foreground": "35 30% 95%",
711
+ "--popover": "30 22% 15%",
712
+ "--popover-foreground": "35 30% 95%",
713
+ "--primary": "30 25% 52%",
714
+ "--primary-foreground": "30 25% 10%",
715
+ "--secondary": "35 25% 58%",
716
+ "--secondary-foreground": "30 25% 10%",
717
+ "--muted": "30 15% 22%",
718
+ "--muted-foreground": "35 20% 70%",
719
+ "--accent": "40 30% 55%",
720
+ "--accent-foreground": "30 25% 10%",
721
+ "--destructive": "0 84% 60%",
722
+ "--destructive-foreground": "0 0% 98%",
723
+ "--border": "30 15% 28%",
724
+ "--input": "30 15% 28%",
725
+ "--ring": "30 25% 52%",
726
+ "--chart-1": "30 25% 52%",
727
+ "--chart-2": "35 25% 58%",
728
+ "--chart-3": "40 30% 55%",
729
+ "--chart-4": "25 20% 42%",
730
+ "--chart-5": "35 20% 32%",
731
+ "--sidebar-background": "30 25% 10%",
732
+ "--sidebar-foreground": "35 30% 95%",
733
+ "--sidebar-primary": "30 25% 52%",
734
+ "--sidebar-primary-foreground": "30 25% 10%",
735
+ "--sidebar-accent": "30 15% 22%",
736
+ "--sidebar-accent-foreground": "35 30% 95%",
737
+ "--sidebar-border": "30 15% 28%",
738
+ "--sidebar-ring": "30 25% 52%",
739
+ "--app-surface-tint": "hsl(30 25% 52% / 0.1)",
740
+ },
741
+ "theme-nitro-memory-lane": {
742
+ "--background": "320 20% 18%",
743
+ "--foreground": "210 20% 90%",
744
+ "--card": "320 18% 21%",
745
+ "--card-foreground": "210 20% 90%",
746
+ "--popover": "320 18% 21%",
747
+ "--popover-foreground": "210 20% 90%",
748
+ "--primary": "280 30% 62%",
749
+ "--primary-foreground": "320 20% 10%",
750
+ "--secondary": "200 25% 55%",
751
+ "--secondary-foreground": "320 20% 10%",
752
+ "--muted": "320 15% 28%",
753
+ "--muted-foreground": "210 15% 68%",
754
+ "--accent": "165 25% 58%",
755
+ "--accent-foreground": "320 20% 10%",
756
+ "--destructive": "0 84% 60%",
757
+ "--destructive-foreground": "0 0% 98%",
758
+ "--border": "320 12% 32%",
759
+ "--input": "320 12% 32%",
760
+ "--ring": "280 30% 62%",
761
+ "--chart-1": "280 30% 62%",
762
+ "--chart-2": "200 25% 55%",
763
+ "--chart-3": "165 25% 58%",
764
+ "--chart-4": "300 25% 48%",
765
+ "--chart-5": "180 20% 42%",
766
+ "--sidebar-background": "320 20% 16%",
767
+ "--sidebar-foreground": "210 20% 90%",
768
+ "--sidebar-primary": "280 30% 62%",
769
+ "--sidebar-primary-foreground": "320 20% 10%",
770
+ "--sidebar-accent": "320 15% 28%",
771
+ "--sidebar-accent-foreground": "210 20% 90%",
772
+ "--sidebar-border": "320 12% 32%",
773
+ "--sidebar-ring": "280 30% 62%",
774
+ "--app-surface-tint": "hsl(280 30% 62% / 0.1)",
775
+ },
776
+ };
777
+
778
+ export type ExportFormat =
779
+ | "css"
780
+ | "scss"
781
+ | "json"
782
+ | "tailwind"
783
+ | "w3c-tokens"
784
+ | "figma-tokens"
785
+ | "css-variables"
786
+ | "html-root";
787
+
788
+ export interface ExportOptions {
789
+ format: ExportFormat;
790
+ themeId: ThemeId;
791
+ colorMode?: "dark" | "light";
792
+ includeAllThemes?: boolean;
793
+ minimal?: boolean;
794
+ }
795
+
796
+ export interface ExportResult {
797
+ content: string;
798
+ filename: string;
799
+ mimeType: string;
800
+ }
801
+
802
+ export const getThemeTokens = (themeId: ThemeId): Record<string, string> => {
803
+ return themeTokens[themeId] ?? themeTokens["theme-nitro-midnight-blurple"];
804
+ };
805
+
806
+ const getThemeInfo = (themeId: ThemeId) => {
807
+ return NITRO_ALL_THEMES.find((t) => t.id === themeId);
808
+ };
809
+
810
+ const generateAppGradient = (themeId: ThemeId): string => {
811
+ const theme = getThemeInfo(themeId);
812
+ if (!theme) return "";
813
+
814
+ const tokens = getThemeTokens(themeId);
815
+ const primaryHsl = tokens["--primary"].split(" ").join(", ");
816
+ const accentHsl = tokens["--accent"].split(" ").join(", ");
817
+ const primary = `hsl(${primaryHsl})`;
818
+ const accent = `hsl(${accentHsl})`;
819
+
820
+ return `radial-gradient(1050px 560px at -10% -20%, ${primary.replace(")", " / 0.3)")}, transparent 60%),
821
+ radial-gradient(920px 520px at 112% 2%, ${accent.replace(")", " / 0.22)")}, transparent 58%),
822
+ linear-gradient(160deg, hsl(${tokens["--background"]}) 0%, hsl(${tokens["--background"]}) 50%, hsl(${tokens["--background"]}) 100%)`;
823
+ };
824
+
825
+ export const generateCSSExport = (options: ExportOptions): ExportResult => {
826
+ const { themeId, colorMode = "dark" } = options;
827
+ const tokens = getThemeTokens(themeId);
828
+ const theme = getThemeInfo(themeId);
829
+
830
+ const tokenEntries = Object.entries(tokens);
831
+ const cssVariables = tokenEntries
832
+ .filter(([key]) => key !== "--app-surface-tint")
833
+ .map(([key, value]) => ` ${key}: ${value};`)
834
+ .join("\n");
835
+
836
+ const appGradient = generateAppGradient(themeId);
837
+
838
+ const content = `/* Gradient Forge Theme: ${theme?.label ?? themeId} */
839
+ /* Color Mode: ${colorMode} */
840
+
841
+ .${themeId} {
842
+ ${cssVariables}
843
+ --app-gradient: ${appGradient};
844
+ ${tokens["--app-surface-tint"] ? `--app-surface-tint: ${tokens["--app-surface-tint"]};` : ""}
845
+ }
846
+
847
+ /* Surface Layer Styles */
848
+ .bg-card,
849
+ .bg-popover,
850
+ .bg-sidebar {
851
+ background-color: hsl(var(--background) / 0.34);
852
+ background-image: linear-gradient(var(--app-surface-tint), var(--app-surface-tint));
853
+ backdrop-filter: blur(16px);
854
+ }`;
855
+
856
+ return {
857
+ content,
858
+ filename: `${themeId}-theme.css`,
859
+ mimeType: "text/css",
860
+ };
861
+ };
862
+
863
+ export const generateSCSSExport = (options: ExportOptions): ExportResult => {
864
+ const { themeId, colorMode = "dark" } = options;
865
+ const tokens = getThemeTokens(themeId);
866
+ const theme = getThemeInfo(themeId);
867
+
868
+ const tokenEntries = Object.entries(tokens);
869
+ const scssVariables = tokenEntries
870
+ .filter(([key]) => key !== "--app-surface-tint")
871
+ .map(([key, value]) => `$${key.replace("--", "")}: ${value};`)
872
+ .join("\n");
873
+
874
+ const appGradient = generateAppGradient(themeId);
875
+
876
+ const content = `// Gradient Forge Theme: ${theme?.label ?? themeId}
877
+ // Color Mode: ${colorMode}
878
+
879
+ ${scssVariables}
880
+ $app-gradient: ${appGradient};
881
+ $app-surface-tint: ${tokens["--app-surface-tint"] ?? "transparent"};
882
+
883
+ // SCSS Mixins
884
+ @mixin surface-layer {
885
+ background-color: hsl($background / 0.34);
886
+ background-image: linear-gradient($app-surface-tint, $app-surface-tint);
887
+ backdrop-filter: blur(16px);
888
+ }
889
+
890
+ // Usage
891
+ // .my-card {
892
+ // @include surface-layer;
893
+ // }`;
894
+
895
+ return {
896
+ content,
897
+ filename: `${themeId}-theme.scss`,
898
+ mimeType: "text/x-scss",
899
+ };
900
+ };
901
+
902
+ export const generateJSONExport = (options: ExportOptions): ExportResult => {
903
+ const { themeId, colorMode = "dark" } = options;
904
+ const tokens = getThemeTokens(themeId);
905
+ const theme = getThemeInfo(themeId);
906
+
907
+ const tokenEntries = Object.entries(tokens);
908
+ const colorTokens: Record<string, string> = {};
909
+
910
+ tokenEntries.forEach(([key, value]) => {
911
+ const tokenName = key.replace("--", "");
912
+ if (key === "--app-surface-tint") {
913
+ colorTokens[tokenName] = value;
914
+ } else {
915
+ colorTokens[tokenName] = `hsl(${value})`;
916
+ }
917
+ });
918
+
919
+ const exportData = {
920
+ name: theme?.label ?? themeId,
921
+ id: themeId,
922
+ colorMode,
923
+ version: "1.0.0",
924
+ generatedAt: new Date().toISOString(),
925
+ colors: colorTokens,
926
+ gradients: {
927
+ app: generateAppGradient(themeId),
928
+ },
929
+ };
930
+
931
+ return {
932
+ content: JSON.stringify(exportData, null, 2),
933
+ filename: `${themeId}-tokens.json`,
934
+ mimeType: "application/json",
935
+ };
936
+ };
937
+
938
+ export const generateTailwindExport = (options: ExportOptions): ExportResult => {
939
+ const { themeId, colorMode = "dark" } = options;
940
+ const tokens = getThemeTokens(themeId);
941
+ const theme = getThemeInfo(themeId);
942
+
943
+ const colorEntries = Object.entries(tokens)
944
+ .filter(([key]) => key !== "--app-surface-tint")
945
+ .map(([key, value]) => {
946
+ const name = key.replace("--", "");
947
+ return ` ${name}: "hsl(var(${key}))"`;
948
+ })
949
+ .join(",\n");
950
+
951
+ const content = `// Gradient Forge Theme: ${theme?.label ?? themeId}
952
+ // Color Mode: ${colorMode}
953
+
954
+ // Add to your tailwind.config.ts or tailwind.config.js:
955
+
956
+ import type { Config } from "tailwindcss";
957
+
958
+ const config: Config = {
959
+ // ... other config
960
+ theme: {
961
+ extend: {
962
+ colors: {
963
+ ${colorEntries}
964
+ },
965
+ backgroundImage: {
966
+ "app-gradient": "var(--app-gradient)",
967
+ },
968
+ },
969
+ },
970
+ };
971
+
972
+ export default config;
973
+
974
+ // Don't forget to add the CSS variables to your globals.css!`;
975
+
976
+ return {
977
+ content,
978
+ filename: `${themeId}-tailwind.ts`,
979
+ mimeType: "text/typescript",
980
+ };
981
+ };
982
+
983
+ export const generateW3CTokensExport = (options: ExportOptions): ExportResult => {
984
+ const { themeId, colorMode = "dark" } = options;
985
+ const tokens = getThemeTokens(themeId);
986
+ const theme = getThemeInfo(themeId);
987
+
988
+ const tokenEntries = Object.entries(tokens);
989
+
990
+ const w3cTokens: Record<string, unknown> = {
991
+ $schema: "https://design-tokens.github.io/schema/format.json",
992
+ name: theme?.label ?? themeId,
993
+ id: themeId,
994
+ colorMode,
995
+ version: "1.0.0",
996
+ generatedAt: new Date().toISOString(),
997
+ };
998
+
999
+ const colorTokens: Record<string, { $type: string; $value: string; $description?: string }> = {};
1000
+
1001
+ tokenEntries.forEach(([key, value]) => {
1002
+ const tokenName = key.replace("--", "").replace(/-/g, ".");
1003
+ if (key === "--app-surface-tint") {
1004
+ colorTokens[tokenName] = {
1005
+ $type: "color",
1006
+ $value: value,
1007
+ $description: "Surface tint color for glassmorphism effects",
1008
+ };
1009
+ } else {
1010
+ colorTokens[tokenName] = {
1011
+ $type: "color",
1012
+ $value: `hsl(${value})`,
1013
+ };
1014
+ }
1015
+ });
1016
+
1017
+ w3cTokens.colors = colorTokens;
1018
+ w3cTokens.gradients = {
1019
+ app: {
1020
+ $type: "gradient",
1021
+ $value: generateAppGradient(themeId),
1022
+ },
1023
+ };
1024
+
1025
+ return {
1026
+ content: JSON.stringify(w3cTokens, null, 2),
1027
+ filename: `${themeId}-w3c-tokens.json`,
1028
+ mimeType: "application/json",
1029
+ };
1030
+ };
1031
+
1032
+ export const generateFigmaTokensExport = (options: ExportOptions): ExportResult => {
1033
+ const { themeId, colorMode = "dark" } = options;
1034
+ const tokens = getThemeTokens(themeId);
1035
+ const theme = getThemeInfo(themeId);
1036
+
1037
+ const tokenEntries = Object.entries(tokens);
1038
+
1039
+ const figmaTokens: Record<string, unknown> = {};
1040
+
1041
+ const colorTokens: Record<string, { value: string; type: string }> = {};
1042
+
1043
+ tokenEntries.forEach(([key, value]) => {
1044
+ const tokenName = key.replace("--", "");
1045
+ if (key === "--app-surface-tint") {
1046
+ colorTokens[tokenName] = {
1047
+ value: value,
1048
+ type: "color",
1049
+ };
1050
+ } else {
1051
+ colorTokens[tokenName] = {
1052
+ value: `hsl(${value})`,
1053
+ type: "color",
1054
+ };
1055
+ }
1056
+ });
1057
+
1058
+ figmaTokens.colors = colorTokens;
1059
+
1060
+ const fullExport = {
1061
+ GradientForge: {
1062
+ [theme?.label ?? themeId]: figmaTokens,
1063
+ },
1064
+ };
1065
+
1066
+ return {
1067
+ content: JSON.stringify(fullExport, null, 2),
1068
+ filename: `${themeId}-figma-tokens.json`,
1069
+ mimeType: "application/json",
1070
+ };
1071
+ };
1072
+
1073
+ export const generateCSSVariablesExport = (options: ExportOptions): ExportResult => {
1074
+ const { themeId, colorMode = "dark" } = options;
1075
+ const tokens = getThemeTokens(themeId);
1076
+ const theme = getThemeInfo(themeId);
1077
+
1078
+ const tokenEntries = Object.entries(tokens);
1079
+ const cssVariables = tokenEntries
1080
+ .filter(([key]) => key !== "--app-surface-tint")
1081
+ .map(([key, value]) => `${key}: ${value};`)
1082
+ .join("\n");
1083
+
1084
+ const content = `/* Gradient Forge Theme: ${theme?.label ?? themeId} */
1085
+ /* Color Mode: ${colorMode} */
1086
+ /* Paste these into your :root or theme class */
1087
+
1088
+ ${cssVariables}
1089
+ --app-gradient: ${generateAppGradient(themeId)};
1090
+ ${tokens["--app-surface-tint"] ? `--app-surface-tint: ${tokens["--app-surface-tint"]};` : ""}`;
1091
+
1092
+ return {
1093
+ content,
1094
+ filename: `${themeId}-variables.css`,
1095
+ mimeType: "text/css",
1096
+ };
1097
+ };
1098
+
1099
+ export const generateHTMLRootExport = (options: ExportOptions): ExportResult => {
1100
+ const { themeId, colorMode = "dark" } = options;
1101
+ const theme = getThemeInfo(themeId);
1102
+
1103
+ const content = `<!-- Gradient Forge Theme: ${theme?.label ?? themeId} -->
1104
+ <!-- Add these attributes to your <html> element -->
1105
+
1106
+ <html
1107
+ lang="en"
1108
+ class="${colorMode} ${themeId}"
1109
+ data-theme="${themeId}"
1110
+ data-color-mode="${colorMode}"
1111
+ suppressHydrationWarning
1112
+ >
1113
+ <!-- Your app content -->
1114
+ </html>`;
1115
+
1116
+ return {
1117
+ content,
1118
+ filename: `${themeId}-html-root.html`,
1119
+ mimeType: "text/html",
1120
+ };
1121
+ };
1122
+
1123
+ export const generateAllThemesCSS = (): ExportResult => {
1124
+ const allThemes = NITRO_ALL_THEMES.map((theme) => {
1125
+ const tokens = getThemeTokens(theme.id);
1126
+ const tokenEntries = Object.entries(tokens);
1127
+ const cssVariables = tokenEntries
1128
+ .filter(([key]) => key !== "--app-surface-tint")
1129
+ .map(([key, value]) => ` ${key}: ${value};`)
1130
+ .join("\n");
1131
+
1132
+ return `/* ${theme.label} */
1133
+ .${theme.id} {
1134
+ ${cssVariables}
1135
+ --app-surface-tint: ${tokens["--app-surface-tint"] ?? "transparent"};
1136
+ }`;
1137
+ }).join("\n\n");
1138
+
1139
+ return {
1140
+ content: `/* Gradient Forge - All Themes CSS */
1141
+ /* Generated on ${new Date().toISOString()} */
1142
+
1143
+ ${allThemes}
1144
+
1145
+ /* Surface Layer Styles */
1146
+ .bg-card,
1147
+ .bg-popover,
1148
+ .bg-sidebar {
1149
+ background-color: hsl(var(--background) / 0.34);
1150
+ background-image: linear-gradient(var(--app-surface-tint), var(--app-surface-tint));
1151
+ backdrop-filter: blur(16px);
1152
+ }`,
1153
+ filename: "gradient-forge-all-themes.css",
1154
+ mimeType: "text/css",
1155
+ };
1156
+ };
1157
+
1158
+ export const exportTokens = (options: ExportOptions): ExportResult => {
1159
+ switch (options.format) {
1160
+ case "css":
1161
+ return generateCSSExport(options);
1162
+ case "scss":
1163
+ return generateSCSSExport(options);
1164
+ case "json":
1165
+ return generateJSONExport(options);
1166
+ case "tailwind":
1167
+ return generateTailwindExport(options);
1168
+ case "w3c-tokens":
1169
+ return generateW3CTokensExport(options);
1170
+ case "figma-tokens":
1171
+ return generateFigmaTokensExport(options);
1172
+ case "css-variables":
1173
+ return generateCSSVariablesExport(options);
1174
+ case "html-root":
1175
+ return generateHTMLRootExport(options);
1176
+ default:
1177
+ return generateCSSExport(options);
1178
+ }
1179
+ };
1180
+
1181
+ export const downloadFile = (result: ExportResult): void => {
1182
+ const blob = new Blob([result.content], { type: result.mimeType });
1183
+ const url = URL.createObjectURL(blob);
1184
+ const link = document.createElement("a");
1185
+ link.href = url;
1186
+ link.download = result.filename;
1187
+ document.body.appendChild(link);
1188
+ link.click();
1189
+ document.body.removeChild(link);
1190
+ URL.revokeObjectURL(url);
1191
+ };
1192
+
1193
+ export const copyToClipboard = async (content: string): Promise<boolean> => {
1194
+ try {
1195
+ await navigator.clipboard.writeText(content);
1196
+ return true;
1197
+ } catch {
1198
+ return false;
1199
+ }
1200
+ };
1201
+
1202
+ export const exportFormats: { value: ExportFormat; label: string; description: string; extension: string }[] = [
1203
+ { value: "css", label: "CSS Theme", description: "Complete CSS theme file with all variables", extension: "css" },
1204
+ { value: "scss", label: "SCSS", description: "SCSS variables with mixins", extension: "scss" },
1205
+ { value: "json", label: "JSON Tokens", description: "Structured JSON with all theme data", extension: "json" },
1206
+ { value: "tailwind", label: "Tailwind Config", description: "Ready-to-use Tailwind configuration", extension: "ts" },
1207
+ { value: "w3c-tokens", label: "W3C Design Tokens", description: "W3C standard design tokens format", extension: "json" },
1208
+ { value: "figma-tokens", label: "Figma Tokens", description: "Figma Tokens plugin compatible format", extension: "json" },
1209
+ { value: "css-variables", label: "CSS Variables", description: "Raw CSS variables for :root", extension: "css" },
1210
+ { value: "html-root", label: "HTML Root", description: "HTML root element attributes", extension: "html" },
1211
+ ];