@optilogic/core 1.0.0-beta.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 (70) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +107 -0
  3. package/dist/index.cjs +6003 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +2310 -0
  6. package/dist/index.d.ts +2310 -0
  7. package/dist/index.js +5828 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/styles.css +96 -0
  10. package/dist/tailwind-preset.cjs +106 -0
  11. package/dist/tailwind-preset.cjs.map +1 -0
  12. package/dist/tailwind-preset.d.cts +23 -0
  13. package/dist/tailwind-preset.d.ts +23 -0
  14. package/dist/tailwind-preset.js +101 -0
  15. package/dist/tailwind-preset.js.map +1 -0
  16. package/package.json +154 -0
  17. package/src/components/accordion.tsx +187 -0
  18. package/src/components/alert-dialog.tsx +143 -0
  19. package/src/components/autocomplete.tsx +271 -0
  20. package/src/components/badge.tsx +62 -0
  21. package/src/components/button.tsx +85 -0
  22. package/src/components/calendar.tsx +235 -0
  23. package/src/components/card.tsx +94 -0
  24. package/src/components/checkbox.tsx +77 -0
  25. package/src/components/chip.tsx +77 -0
  26. package/src/components/confirmation-modal.tsx +195 -0
  27. package/src/components/context-menu.tsx +406 -0
  28. package/src/components/copy-button.tsx +84 -0
  29. package/src/components/data-grid/DataGrid.tsx +1027 -0
  30. package/src/components/data-grid/components/CellEditor.tsx +346 -0
  31. package/src/components/data-grid/components/FilterPopover.tsx +459 -0
  32. package/src/components/data-grid/components/HeaderCell.tsx +207 -0
  33. package/src/components/data-grid/components/index.ts +14 -0
  34. package/src/components/data-grid/hooks/index.ts +28 -0
  35. package/src/components/data-grid/hooks/useColumnResize.ts +378 -0
  36. package/src/components/data-grid/hooks/useDataGridState.ts +346 -0
  37. package/src/components/data-grid/hooks/useKeyboardNavigation.ts +361 -0
  38. package/src/components/data-grid/index.ts +71 -0
  39. package/src/components/data-grid/types.ts +478 -0
  40. package/src/components/data-grid/utils/dataProcessing.ts +277 -0
  41. package/src/components/data-grid/utils/index.ts +12 -0
  42. package/src/components/date-picker.tsx +366 -0
  43. package/src/components/dropdown-menu.tsx +230 -0
  44. package/src/components/icon-button.tsx +157 -0
  45. package/src/components/input.tsx +40 -0
  46. package/src/components/label.tsx +37 -0
  47. package/src/components/loading-spinner.tsx +113 -0
  48. package/src/components/modal.tsx +207 -0
  49. package/src/components/popover.tsx +62 -0
  50. package/src/components/progress.tsx +41 -0
  51. package/src/components/resizable-panel.tsx +434 -0
  52. package/src/components/resize-handle.tsx +187 -0
  53. package/src/components/select.tsx +160 -0
  54. package/src/components/separator.tsx +50 -0
  55. package/src/components/skeleton.tsx +37 -0
  56. package/src/components/switch.tsx +59 -0
  57. package/src/components/table.tsx +136 -0
  58. package/src/components/tabs.tsx +102 -0
  59. package/src/components/textarea.tsx +36 -0
  60. package/src/components/theme-picker.tsx +245 -0
  61. package/src/components/toaster.tsx +84 -0
  62. package/src/components/tooltip.tsx +199 -0
  63. package/src/index.ts +318 -0
  64. package/src/styles.css +96 -0
  65. package/src/tailwind-preset.ts +129 -0
  66. package/src/theme/index.ts +41 -0
  67. package/src/theme/presets.ts +502 -0
  68. package/src/theme/types.ts +164 -0
  69. package/src/theme/utils.ts +309 -0
  70. package/src/utils/cn.ts +14 -0
@@ -0,0 +1,502 @@
1
+ /**
2
+ * Theme Presets
3
+ *
4
+ * Built-in theme definitions for opti-ui.
5
+ * Ported from platform-leapfrog for consistent theming.
6
+ */
7
+
8
+ import type { Theme } from "./types";
9
+
10
+ /**
11
+ * Green Theme - Alternative theme option
12
+ */
13
+ export const GREEN_THEME: Theme = {
14
+ id: "green-theme",
15
+ name: "Green Theme",
16
+ description: "A green theme with natural, earthy tones",
17
+ author: "Leapfrog",
18
+ background: "#1a2820",
19
+ foreground: "#E6F5EC",
20
+ card: "#2d4038",
21
+ cardForeground: "#E6F5EC",
22
+ popover: "#243630",
23
+ popoverForeground: "#E6F5EC",
24
+ primary: "#6FCF97",
25
+ primaryForeground: "#1a2820",
26
+ accent: "#6FCF97",
27
+ accentForeground: "#1a2820",
28
+ secondary: "#1f3329",
29
+ secondaryForeground: "#E6F5EC",
30
+ muted: "#354840",
31
+ mutedForeground: "#9DB8A8",
32
+ destructive: "#EB5757",
33
+ destructiveForeground: "#E6F5EC",
34
+ success: "#6FCF97",
35
+ successForeground: "#1a2820",
36
+ warning: "#F2C94C",
37
+ warningForeground: "#1a2820",
38
+ chip: "#3a5045",
39
+ chipForeground: "#C5E3D1",
40
+ border: "#243630",
41
+ input: "#243630",
42
+ ring: "#6FCF97",
43
+ chart1: "#6FCF97",
44
+ chart2: "#8FE3B0",
45
+ chart3: "#9DB8A8",
46
+ chart4: "#2d4038",
47
+ chart5: "#354840",
48
+ radius: "0.5rem",
49
+ };
50
+
51
+ /**
52
+ * Optilogic Legacy Theme - Default theme
53
+ */
54
+ export const OPTILOGIC_LEGACY_THEME: Theme = {
55
+ id: "optilogic-legacy",
56
+ name: "Optilogic Legacy",
57
+ description: "Classic Optilogic color scheme with blue accents",
58
+ author: "Optilogic",
59
+ background: "#FFFFFF",
60
+ foreground: "#0C0A5A",
61
+ card: "#F9F9F9",
62
+ cardForeground: "#0C0A5A",
63
+ popover: "#FFFFFF",
64
+ popoverForeground: "#0C0A5A",
65
+ primary: "#0C0A5A",
66
+ primaryForeground: "#FFFFFF",
67
+ accent: "#CFD4FB",
68
+ accentForeground: "#0C0A5A",
69
+ secondary: "#5766F2",
70
+ secondaryForeground: "#FFFFFF",
71
+ muted: "#E6EAF0",
72
+ mutedForeground: "#737272",
73
+ destructive: "#DB2828",
74
+ destructiveForeground: "#FFFFFF",
75
+ success: "#44BD7E",
76
+ successForeground: "#FFFFFF",
77
+ warning: "#F5CF47",
78
+ warningForeground: "#0C0A5A",
79
+ chip: "#B8C5F9",
80
+ chipForeground: "#0C0A5A",
81
+ border: "#D0D0D0",
82
+ input: "#FFFFFF",
83
+ ring: "#5766F2",
84
+ chart1: "#78D237",
85
+ chart2: "#F5CF47",
86
+ chart3: "#5766F2",
87
+ chart4: "#44BD7E",
88
+ chart5: "#929BEF",
89
+ radius: "0.5rem",
90
+ };
91
+
92
+ /**
93
+ * Futuristic Theme - Neon cyberpunk aesthetic
94
+ */
95
+ export const FUTURISTIC_THEME: Theme = {
96
+ id: "futuristic",
97
+ name: "Futuristic",
98
+ description: "Neon cyberpunk aesthetic with electric blues and purples",
99
+ author: "Leapfrog",
100
+ background: "#0a0e27",
101
+ foreground: "#e0e7ff",
102
+ card: "#1a1f3a",
103
+ cardForeground: "#e0e7ff",
104
+ popover: "#1a1f3a",
105
+ popoverForeground: "#e0e7ff",
106
+ primary: "#6366f1",
107
+ primaryForeground: "#ffffff",
108
+ accent: "#8b5cf6",
109
+ accentForeground: "#ffffff",
110
+ secondary: "#1e293b",
111
+ secondaryForeground: "#e0e7ff",
112
+ muted: "#1e293b",
113
+ mutedForeground: "#94a3b8",
114
+ destructive: "#ef4444",
115
+ destructiveForeground: "#ffffff",
116
+ success: "#10b981",
117
+ successForeground: "#ffffff",
118
+ warning: "#f59e0b",
119
+ warningForeground: "#ffffff",
120
+ chip: "#312e81",
121
+ chipForeground: "#c7d2fe",
122
+ border: "#1e293b",
123
+ input: "#1e293b",
124
+ ring: "#6366f1",
125
+ chart1: "#6366f1",
126
+ chart2: "#8b5cf6",
127
+ chart3: "#a855f7",
128
+ chart4: "#ec4899",
129
+ chart5: "#f43f5e",
130
+ radius: "0.5rem",
131
+ };
132
+
133
+ /**
134
+ * Nature Inspired Theme - Earthy greens and browns
135
+ */
136
+ export const NATURE_THEME: Theme = {
137
+ id: "nature",
138
+ name: "Nature Inspired",
139
+ description: "Earthy greens and browns inspired by forests and meadows",
140
+ author: "Leapfrog",
141
+ background: "#1a2e1a",
142
+ foreground: "#e8f5e9",
143
+ card: "#2d4a2d",
144
+ cardForeground: "#e8f5e9",
145
+ popover: "#243824",
146
+ popoverForeground: "#e8f5e9",
147
+ primary: "#4caf50",
148
+ primaryForeground: "#1a2e1a",
149
+ accent: "#66bb6a",
150
+ accentForeground: "#1a2e1a",
151
+ secondary: "#2d4a2d",
152
+ secondaryForeground: "#e8f5e9",
153
+ muted: "#3d5a3d",
154
+ mutedForeground: "#a5d6a7",
155
+ destructive: "#e57373",
156
+ destructiveForeground: "#ffffff",
157
+ success: "#66bb6a",
158
+ successForeground: "#1a2e1a",
159
+ warning: "#ffb74d",
160
+ warningForeground: "#1a2e1a",
161
+ chip: "#3d5a3d",
162
+ chipForeground: "#c8e6c9",
163
+ border: "#243824",
164
+ input: "#243824",
165
+ ring: "#4caf50",
166
+ chart1: "#4caf50",
167
+ chart2: "#66bb6a",
168
+ chart3: "#81c784",
169
+ chart4: "#a5d6a7",
170
+ chart5: "#c8e6c9",
171
+ radius: "0.5rem",
172
+ };
173
+
174
+ /**
175
+ * Sci-Fi Theme - Deep space with vibrant accents
176
+ */
177
+ export const SCIFI_THEME: Theme = {
178
+ id: "scifi",
179
+ name: "Sci-Fi",
180
+ description: "Deep space aesthetic with vibrant cyan and magenta accents",
181
+ author: "Leapfrog",
182
+ background: "#0d1117",
183
+ foreground: "#c9d1d9",
184
+ card: "#161b22",
185
+ cardForeground: "#c9d1d9",
186
+ popover: "#161b22",
187
+ popoverForeground: "#c9d1d9",
188
+ primary: "#00d9ff",
189
+ primaryForeground: "#0d1117",
190
+ accent: "#ff00ff",
191
+ accentForeground: "#ffffff",
192
+ secondary: "#1c2128",
193
+ secondaryForeground: "#c9d1d9",
194
+ muted: "#21262d",
195
+ mutedForeground: "#8b949e",
196
+ destructive: "#ff6b6b",
197
+ destructiveForeground: "#ffffff",
198
+ success: "#00ff88",
199
+ successForeground: "#0d1117",
200
+ warning: "#ffd93d",
201
+ warningForeground: "#0d1117",
202
+ chip: "#1c2128",
203
+ chipForeground: "#58a6ff",
204
+ border: "#30363d",
205
+ input: "#21262d",
206
+ ring: "#00d9ff",
207
+ chart1: "#00d9ff",
208
+ chart2: "#ff00ff",
209
+ chart3: "#00ff88",
210
+ chart4: "#ffd93d",
211
+ chart5: "#58a6ff",
212
+ radius: "0.5rem",
213
+ };
214
+
215
+ /**
216
+ * Ocean Theme - Calming blues and teals
217
+ */
218
+ export const OCEAN_THEME: Theme = {
219
+ id: "ocean",
220
+ name: "Ocean",
221
+ description: "Calming blues and teals inspired by the deep sea",
222
+ author: "Leapfrog",
223
+ background: "#0a1929",
224
+ foreground: "#e3f2fd",
225
+ card: "#132f4c",
226
+ cardForeground: "#e3f2fd",
227
+ popover: "#0f2540",
228
+ popoverForeground: "#e3f2fd",
229
+ primary: "#2196f3",
230
+ primaryForeground: "#ffffff",
231
+ accent: "#00bcd4",
232
+ accentForeground: "#0a1929",
233
+ secondary: "#1565c0",
234
+ secondaryForeground: "#ffffff",
235
+ muted: "#1e3a5f",
236
+ mutedForeground: "#90caf9",
237
+ destructive: "#f44336",
238
+ destructiveForeground: "#ffffff",
239
+ success: "#4caf50",
240
+ successForeground: "#ffffff",
241
+ warning: "#ff9800",
242
+ warningForeground: "#ffffff",
243
+ chip: "#1565c0",
244
+ chipForeground: "#bbdefb",
245
+ border: "#1e3a5f",
246
+ input: "#1e3a5f",
247
+ ring: "#2196f3",
248
+ chart1: "#2196f3",
249
+ chart2: "#00bcd4",
250
+ chart3: "#03a9f4",
251
+ chart4: "#0288d1",
252
+ chart5: "#0277bd",
253
+ radius: "0.5rem",
254
+ };
255
+
256
+ /**
257
+ * Sunset Theme - Warm oranges and purples
258
+ */
259
+ export const SUNSET_THEME: Theme = {
260
+ id: "sunset",
261
+ name: "Sunset",
262
+ description: "Warm oranges and purples like a beautiful sunset",
263
+ author: "Leapfrog",
264
+ background: "#1a0d1a",
265
+ foreground: "#ffe0e6",
266
+ card: "#2d1a2d",
267
+ cardForeground: "#ffe0e6",
268
+ popover: "#241424",
269
+ popoverForeground: "#ffe0e6",
270
+ primary: "#ff6b35",
271
+ primaryForeground: "#ffffff",
272
+ accent: "#c44569",
273
+ accentForeground: "#ffffff",
274
+ secondary: "#f7931e",
275
+ secondaryForeground: "#1a0d1a",
276
+ muted: "#3d2a3d",
277
+ mutedForeground: "#ffb3c1",
278
+ destructive: "#e63946",
279
+ destructiveForeground: "#ffffff",
280
+ success: "#06d6a0",
281
+ successForeground: "#1a0d1a",
282
+ warning: "#ffb703",
283
+ warningForeground: "#1a0d1a",
284
+ chip: "#3d2a3d",
285
+ chipForeground: "#ffb3c1",
286
+ border: "#241424",
287
+ input: "#241424",
288
+ ring: "#ff6b35",
289
+ chart1: "#ff6b35",
290
+ chart2: "#c44569",
291
+ chart3: "#f7931e",
292
+ chart4: "#ffb703",
293
+ chart5: "#ff8c42",
294
+ radius: "0.5rem",
295
+ };
296
+
297
+ /**
298
+ * Forest Theme - Deep greens and browns
299
+ */
300
+ export const FOREST_THEME: Theme = {
301
+ id: "forest",
302
+ name: "Forest",
303
+ description: "Deep greens and browns like an ancient forest",
304
+ author: "Leapfrog",
305
+ background: "#0d1b0d",
306
+ foreground: "#e8f5e9",
307
+ card: "#1a2e1a",
308
+ cardForeground: "#e8f5e9",
309
+ popover: "#152515",
310
+ popoverForeground: "#e8f5e9",
311
+ primary: "#2e7d32",
312
+ primaryForeground: "#ffffff",
313
+ accent: "#558b2f",
314
+ accentForeground: "#ffffff",
315
+ secondary: "#1b5e20",
316
+ secondaryForeground: "#e8f5e9",
317
+ muted: "#2d4a2d",
318
+ mutedForeground: "#a5d6a7",
319
+ destructive: "#c62828",
320
+ destructiveForeground: "#ffffff",
321
+ success: "#4caf50",
322
+ successForeground: "#ffffff",
323
+ warning: "#f57c00",
324
+ warningForeground: "#ffffff",
325
+ chip: "#2d4a2d",
326
+ chipForeground: "#c8e6c9",
327
+ border: "#1b5e20",
328
+ input: "#1a2e1a",
329
+ ring: "#2e7d32",
330
+ chart1: "#2e7d32",
331
+ chart2: "#388e3c",
332
+ chart3: "#43a047",
333
+ chart4: "#66bb6a",
334
+ chart5: "#81c784",
335
+ radius: "0.5rem",
336
+ };
337
+
338
+ /**
339
+ * Cyberpunk Theme - Neon pinks and cyans
340
+ */
341
+ export const CYBERPUNK_THEME: Theme = {
342
+ id: "cyberpunk",
343
+ name: "Cyberpunk",
344
+ description: "Neon pinks and cyans with high contrast",
345
+ author: "Leapfrog",
346
+ background: "#0a0a0f",
347
+ foreground: "#f0f0f0",
348
+ card: "#1a1a2e",
349
+ cardForeground: "#f0f0f0",
350
+ popover: "#16213e",
351
+ popoverForeground: "#f0f0f0",
352
+ primary: "#ff00ff",
353
+ primaryForeground: "#ffffff",
354
+ accent: "#00ffff",
355
+ accentForeground: "#0a0a0f",
356
+ secondary: "#16213e",
357
+ secondaryForeground: "#f0f0f0",
358
+ muted: "#1a1a2e",
359
+ mutedForeground: "#a0a0a0",
360
+ destructive: "#ff1744",
361
+ destructiveForeground: "#ffffff",
362
+ success: "#00ff88",
363
+ successForeground: "#0a0a0f",
364
+ warning: "#ffd700",
365
+ warningForeground: "#0a0a0f",
366
+ chip: "#16213e",
367
+ chipForeground: "#ff00ff",
368
+ border: "#1a1a2e",
369
+ input: "#16213e",
370
+ ring: "#ff00ff",
371
+ chart1: "#ff00ff",
372
+ chart2: "#00ffff",
373
+ chart3: "#00ff88",
374
+ chart4: "#ffd700",
375
+ chart5: "#ff1744",
376
+ radius: "0.5rem",
377
+ };
378
+
379
+ /**
380
+ * Minimalist Light Theme - Clean and simple
381
+ */
382
+ export const MINIMALIST_LIGHT_THEME: Theme = {
383
+ id: "minimalist-light",
384
+ name: "Minimalist Light",
385
+ description: "Clean and simple light theme with subtle grays",
386
+ author: "Leapfrog",
387
+ background: "#ffffff",
388
+ foreground: "#1a1a1a",
389
+ card: "#f8f9fa",
390
+ cardForeground: "#1a1a1a",
391
+ popover: "#ffffff",
392
+ popoverForeground: "#1a1a1a",
393
+ primary: "#000000",
394
+ primaryForeground: "#ffffff",
395
+ accent: "#e9ecef",
396
+ accentForeground: "#1a1a1a",
397
+ secondary: "#f1f3f5",
398
+ secondaryForeground: "#1a1a1a",
399
+ muted: "#e9ecef",
400
+ mutedForeground: "#6c757d",
401
+ destructive: "#dc3545",
402
+ destructiveForeground: "#ffffff",
403
+ success: "#28a745",
404
+ successForeground: "#ffffff",
405
+ warning: "#ffc107",
406
+ warningForeground: "#1a1a1a",
407
+ chip: "#e9ecef",
408
+ chipForeground: "#495057",
409
+ border: "#dee2e6",
410
+ input: "#ffffff",
411
+ ring: "#000000",
412
+ chart1: "#000000",
413
+ chart2: "#6c757d",
414
+ chart3: "#adb5bd",
415
+ chart4: "#dee2e6",
416
+ chart5: "#e9ecef",
417
+ radius: "0.5rem",
418
+ };
419
+
420
+ /**
421
+ * Dark Elegant Theme - Sophisticated dark mode
422
+ */
423
+ export const DARK_ELEGANT_THEME: Theme = {
424
+ id: "dark-elegant",
425
+ name: "Dark Elegant",
426
+ description: "Sophisticated dark mode with refined colors",
427
+ author: "Leapfrog",
428
+ background: "#121212",
429
+ foreground: "#e0e0e0",
430
+ card: "#1e1e1e",
431
+ cardForeground: "#e0e0e0",
432
+ popover: "#1e1e1e",
433
+ popoverForeground: "#e0e0e0",
434
+ primary: "#bb86fc",
435
+ primaryForeground: "#121212",
436
+ accent: "#03dac6",
437
+ accentForeground: "#121212",
438
+ secondary: "#2d2d2d",
439
+ secondaryForeground: "#e0e0e0",
440
+ muted: "#2d2d2d",
441
+ mutedForeground: "#9e9e9e",
442
+ destructive: "#cf6679",
443
+ destructiveForeground: "#ffffff",
444
+ success: "#4caf50",
445
+ successForeground: "#ffffff",
446
+ warning: "#ff9800",
447
+ warningForeground: "#ffffff",
448
+ chip: "#2d2d2d",
449
+ chipForeground: "#b39ddb",
450
+ border: "#2d2d2d",
451
+ input: "#1e1e1e",
452
+ ring: "#bb86fc",
453
+ chart1: "#bb86fc",
454
+ chart2: "#03dac6",
455
+ chart3: "#4caf50",
456
+ chart4: "#ff9800",
457
+ chart5: "#cf6679",
458
+ radius: "0.5rem",
459
+ };
460
+
461
+ /**
462
+ * All available preset themes
463
+ */
464
+ export const PRESET_THEMES: Theme[] = [OPTILOGIC_LEGACY_THEME];
465
+
466
+ /**
467
+ * All theme suggestions for preview
468
+ */
469
+ export const ALL_THEMES: Theme[] = [
470
+ OPTILOGIC_LEGACY_THEME,
471
+ FUTURISTIC_THEME,
472
+ NATURE_THEME,
473
+ SCIFI_THEME,
474
+ OCEAN_THEME,
475
+ SUNSET_THEME,
476
+ FOREST_THEME,
477
+ CYBERPUNK_THEME,
478
+ MINIMALIST_LIGHT_THEME,
479
+ DARK_ELEGANT_THEME,
480
+ GREEN_THEME,
481
+ ];
482
+
483
+ /**
484
+ * Get a preset theme by ID
485
+ */
486
+ export function getPresetTheme(id: string): Theme | undefined {
487
+ return ALL_THEMES.find((theme) => theme.id === id);
488
+ }
489
+
490
+ /**
491
+ * Get the default theme (fallback)
492
+ */
493
+ export function getDefaultTheme(): Theme {
494
+ return OPTILOGIC_LEGACY_THEME;
495
+ }
496
+
497
+ /**
498
+ * Check if a theme is a preset (not user-created)
499
+ */
500
+ export function isPresetTheme(themeId: string): boolean {
501
+ return ALL_THEMES.some((theme) => theme.id === themeId);
502
+ }
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Theme Types
3
+ *
4
+ * Type definitions for the JSON-based theme system.
5
+ * Ported from platform-leapfrog for consistent theming across projects.
6
+ */
7
+
8
+ /**
9
+ * Theme interface mapping all color properties to CSS variables
10
+ */
11
+ export interface Theme {
12
+ /** Theme metadata */
13
+ id: string;
14
+ name: string;
15
+ description?: string;
16
+ author?: string;
17
+
18
+ /** Base colors */
19
+ background: string; // --background
20
+ foreground: string; // --foreground
21
+
22
+ /** Surface colors */
23
+ card: string; // --card
24
+ cardForeground: string; // --card-foreground
25
+ popover: string; // --popover (bgElevated)
26
+ popoverForeground: string; // --popover-foreground
27
+
28
+ /** Accent & interactive colors */
29
+ primary: string; // --primary
30
+ primaryForeground: string; // --primary-foreground
31
+ accent: string; // --accent
32
+ accentForeground: string; // --accent-foreground
33
+
34
+ /** Secondary & utility colors */
35
+ secondary: string; // --secondary (gridHeader)
36
+ secondaryForeground: string; // --secondary-foreground
37
+ muted: string; // --muted (surfaceAlt)
38
+ mutedForeground: string; // --muted-foreground
39
+
40
+ /** State colors */
41
+ destructive: string; // --destructive (error)
42
+ destructiveForeground: string; // --destructive-foreground
43
+ success: string; // --success
44
+ successForeground: string; // --success-foreground
45
+ warning: string; // --warning
46
+ warningForeground: string; // --warning-foreground
47
+
48
+ /** Chip/badge colors */
49
+ chip: string; // --chip
50
+ chipForeground: string; // --chip-foreground
51
+
52
+ /** Borders & inputs */
53
+ border: string; // --border
54
+ input: string; // --input
55
+ ring: string; // --ring (focus ring)
56
+
57
+ /** Chart colors */
58
+ chart1: string; // --chart-1
59
+ chart2: string; // --chart-2
60
+ chart3: string; // --chart-3
61
+ chart4: string; // --chart-4
62
+ chart5: string; // --chart-5
63
+
64
+ /** Border radius */
65
+ radius?: string; // --radius (default: 0.5rem)
66
+ }
67
+
68
+ /**
69
+ * Theme with colors in hex format (for editing/display)
70
+ */
71
+ export type ThemeHex = Theme;
72
+
73
+ /**
74
+ * Theme with colors in HSL format (for CSS variables)
75
+ */
76
+ export interface ThemeHSL extends Omit<Theme, keyof ThemeColorFields> {
77
+ id: string;
78
+ name: string;
79
+ description?: string;
80
+ author?: string;
81
+ radius?: string;
82
+
83
+ background: string;
84
+ foreground: string;
85
+ card: string;
86
+ cardForeground: string;
87
+ popover: string;
88
+ popoverForeground: string;
89
+ primary: string;
90
+ primaryForeground: string;
91
+ accent: string;
92
+ accentForeground: string;
93
+ secondary: string;
94
+ secondaryForeground: string;
95
+ muted: string;
96
+ mutedForeground: string;
97
+ destructive: string;
98
+ destructiveForeground: string;
99
+ success: string;
100
+ successForeground: string;
101
+ warning: string;
102
+ warningForeground: string;
103
+ chip: string;
104
+ chipForeground: string;
105
+ border: string;
106
+ input: string;
107
+ ring: string;
108
+ chart1: string;
109
+ chart2: string;
110
+ chart3: string;
111
+ chart4: string;
112
+ chart5: string;
113
+ }
114
+
115
+ type ThemeColorFields = {
116
+ background: string;
117
+ foreground: string;
118
+ card: string;
119
+ cardForeground: string;
120
+ popover: string;
121
+ popoverForeground: string;
122
+ primary: string;
123
+ primaryForeground: string;
124
+ accent: string;
125
+ accentForeground: string;
126
+ secondary: string;
127
+ secondaryForeground: string;
128
+ muted: string;
129
+ mutedForeground: string;
130
+ destructive: string;
131
+ destructiveForeground: string;
132
+ success: string;
133
+ successForeground: string;
134
+ warning: string;
135
+ warningForeground: string;
136
+ chip: string;
137
+ chipForeground: string;
138
+ border: string;
139
+ input: string;
140
+ ring: string;
141
+ chart1: string;
142
+ chart2: string;
143
+ chart3: string;
144
+ chart4: string;
145
+ chart5: string;
146
+ };
147
+
148
+ /**
149
+ * Color field configuration for editors
150
+ */
151
+ export interface ColorFieldConfig {
152
+ key: keyof ThemeColorFields;
153
+ label: string;
154
+ description?: string;
155
+ group:
156
+ | "base"
157
+ | "surface"
158
+ | "accent"
159
+ | "secondary"
160
+ | "state"
161
+ | "chip"
162
+ | "border"
163
+ | "chart";
164
+ }