@vritti/quantum-ui 0.1.0 → 0.1.2

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 (104) hide show
  1. package/dist/Button-CCQVCZBc.js +97 -0
  2. package/dist/Button-CCQVCZBc.js.map +1 -0
  3. package/dist/Card-C5V_kLq7.js +41 -0
  4. package/dist/Card-C5V_kLq7.js.map +1 -0
  5. package/dist/TextField-bmiQJ7hv.js +119 -0
  6. package/dist/TextField-bmiQJ7hv.js.map +1 -0
  7. package/dist/ThemeToggle-HP4cegI7.js +78 -0
  8. package/dist/ThemeToggle-HP4cegI7.js.map +1 -0
  9. package/dist/Typography-BCxuB5sP.js +100 -0
  10. package/dist/Typography-BCxuB5sP.js.map +1 -0
  11. package/dist/components/Button.js +1 -19
  12. package/dist/components/Button.js.map +1 -1
  13. package/dist/components/Card.js +2 -0
  14. package/dist/components/Card.js.map +1 -0
  15. package/dist/components/TextField.js +1 -28
  16. package/dist/components/TextField.js.map +1 -1
  17. package/dist/components/ThemeToggle.js +2 -0
  18. package/dist/components/ThemeToggle.js.map +1 -0
  19. package/dist/components/Typography.js +1 -41
  20. package/dist/components/Typography.js.map +1 -1
  21. package/dist/index-B_dX4wQk.js +123 -0
  22. package/dist/index-B_dX4wQk.js.map +1 -0
  23. package/dist/index.js +6 -92
  24. package/dist/index.js.map +1 -1
  25. package/dist/lib/components/Button/Button.d.ts +10 -0
  26. package/dist/lib/components/Button/Button.d.ts.map +1 -0
  27. package/dist/lib/components/Button/index.d.ts +2 -0
  28. package/dist/lib/components/Button/index.d.ts.map +1 -0
  29. package/dist/lib/components/Card/Card.d.ts +2 -0
  30. package/dist/lib/components/Card/Card.d.ts.map +1 -0
  31. package/dist/lib/components/Card/index.d.ts +2 -0
  32. package/dist/lib/components/Card/index.d.ts.map +1 -0
  33. package/dist/lib/components/TextField/TextField.d.ts +8 -0
  34. package/dist/lib/components/TextField/TextField.d.ts.map +1 -0
  35. package/dist/lib/components/TextField/index.d.ts +2 -0
  36. package/dist/lib/components/TextField/index.d.ts.map +1 -0
  37. package/dist/lib/components/ThemeToggle/ThemeToggle.d.ts +7 -0
  38. package/dist/lib/components/ThemeToggle/ThemeToggle.d.ts.map +1 -0
  39. package/dist/lib/components/ThemeToggle/index.d.ts +2 -0
  40. package/dist/lib/components/ThemeToggle/index.d.ts.map +1 -0
  41. package/dist/lib/components/Typography/Typography.d.ts +10 -0
  42. package/dist/lib/components/Typography/Typography.d.ts.map +1 -0
  43. package/dist/lib/components/Typography/index.d.ts +2 -0
  44. package/dist/lib/components/Typography/index.d.ts.map +1 -0
  45. package/dist/lib/components/index.d.ts +6 -0
  46. package/dist/lib/components/index.d.ts.map +1 -0
  47. package/dist/lib/index.d.ts +3 -0
  48. package/dist/lib/index.d.ts.map +1 -0
  49. package/dist/utils-BLJyPY44.js +2963 -0
  50. package/dist/utils-BLJyPY44.js.map +1 -0
  51. package/package.json +23 -13
  52. package/readme.md +72 -60
  53. package/dist/ThemeScript-CQlC-jGc.js +0 -1509
  54. package/dist/ThemeScript-CQlC-jGc.js.map +0 -1
  55. package/dist/components/Button/Button.d.ts +0 -11
  56. package/dist/components/Button/Button.d.ts.map +0 -1
  57. package/dist/components/Button/index.d.ts +0 -3
  58. package/dist/components/Button/index.d.ts.map +0 -1
  59. package/dist/components/Paper/Paper.d.ts +0 -8
  60. package/dist/components/Paper/Paper.d.ts.map +0 -1
  61. package/dist/components/Paper/index.d.ts +0 -3
  62. package/dist/components/Paper/index.d.ts.map +0 -1
  63. package/dist/components/Paper.js +0 -13
  64. package/dist/components/Paper.js.map +0 -1
  65. package/dist/components/TextField/TextField.d.ts +0 -13
  66. package/dist/components/TextField/TextField.d.ts.map +0 -1
  67. package/dist/components/TextField/index.d.ts +0 -3
  68. package/dist/components/TextField/index.d.ts.map +0 -1
  69. package/dist/components/Typography/Typography.d.ts +0 -8
  70. package/dist/components/Typography/Typography.d.ts.map +0 -1
  71. package/dist/components/Typography/index.d.ts +0 -3
  72. package/dist/components/Typography/index.d.ts.map +0 -1
  73. package/dist/components/index.d.ts +0 -9
  74. package/dist/components/index.d.ts.map +0 -1
  75. package/dist/index.d.ts +0 -8
  76. package/dist/index.d.ts.map +0 -1
  77. package/dist/next.d.ts +0 -4
  78. package/dist/next.d.ts.map +0 -1
  79. package/dist/next.js +0 -2
  80. package/dist/next.js.map +0 -1
  81. package/dist/theme/ThemeProvider.d.ts +0 -9
  82. package/dist/theme/ThemeProvider.d.ts.map +0 -1
  83. package/dist/theme/ThemeScript.d.ts +0 -11
  84. package/dist/theme/ThemeScript.d.ts.map +0 -1
  85. package/dist/theme/components/Button.d.ts +0 -3
  86. package/dist/theme/components/Button.d.ts.map +0 -1
  87. package/dist/theme/components/Paper.d.ts +0 -3
  88. package/dist/theme/components/Paper.d.ts.map +0 -1
  89. package/dist/theme/components/TextField.d.ts +0 -3
  90. package/dist/theme/components/TextField.d.ts.map +0 -1
  91. package/dist/theme/components/index.d.ts +0 -4
  92. package/dist/theme/components/index.d.ts.map +0 -1
  93. package/dist/theme/createTheme.d.ts +0 -2
  94. package/dist/theme/createTheme.d.ts.map +0 -1
  95. package/dist/theme/cssVariableGenerator.d.ts +0 -4
  96. package/dist/theme/cssVariableGenerator.d.ts.map +0 -1
  97. package/dist/theme/index.d.ts +0 -8
  98. package/dist/theme/index.d.ts.map +0 -1
  99. package/dist/theme/palette.d.ts +0 -88
  100. package/dist/theme/palette.d.ts.map +0 -1
  101. package/dist/theme/semanticTokens.d.ts +0 -142
  102. package/dist/theme/semanticTokens.d.ts.map +0 -1
  103. package/dist/theme/useTheme.d.ts +0 -12
  104. package/dist/theme/useTheme.d.ts.map +0 -1
@@ -1,1509 +0,0 @@
1
- import { createTheme } from '@mui/material/styles';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- const ButtonTheme = {
5
- styleOverrides: {
6
- root: {
7
- borderRadius: "var(--quantum-borderRadius-medium)",
8
- fontFamily: "var(--quantum-typography-fontFamily-display)",
9
- // Space Grotesk for buttons
10
- fontWeight: "var(--quantum-typography-fontWeight-medium)",
11
- fontSize: "var(--quantum-typography-variants-button-fontSize)",
12
- lineHeight: "var(--quantum-typography-variants-button-lineHeight)",
13
- textTransform: "none",
14
- transition: "all var(--quantum-animation-duration-normal) var(--quantum-animation-easing-standard)",
15
- cursor: "pointer",
16
- position: "relative",
17
- overflow: "hidden",
18
- "&:focus-visible": {
19
- outline: "2px solid var(--quantum-color-action-primary)",
20
- outlineOffset: "2px"
21
- },
22
- "&:disabled": {
23
- opacity: 0.5,
24
- cursor: "not-allowed",
25
- transform: "none",
26
- // Disable all effects when disabled
27
- "&::before, &::after": {
28
- display: "none"
29
- }
30
- },
31
- "&:hover:not(:disabled)": {
32
- transform: "translateY(-1px)"
33
- },
34
- "&:active": {
35
- transform: "translateY(0)"
36
- },
37
- // ======================
38
- // PRIMARY: PROMINENT CONFIDENCE
39
- // ======================
40
- "&[data-intent='primary']": {
41
- backgroundColor: "var(--quantum-color-action-primary)",
42
- color: "var(--quantum-color-text-onPrimary)",
43
- border: "none",
44
- boxShadow: "0 4px 14px 0 rgba(var(--quantum-color-action-primaryRGB), 0.3)",
45
- // Confident energy field - slower rotating radial gradient with primary color only
46
- "&::before": {
47
- content: '""',
48
- position: "absolute",
49
- inset: "-2px",
50
- background: `
51
- radial-gradient(
52
- ellipse at top left,
53
- var(--quantum-color-action-primary) 0%,
54
- transparent 50%
55
- ),
56
- radial-gradient(
57
- ellipse at bottom right,
58
- var(--quantum-color-action-primary) 0%,
59
- transparent 50%
60
- )
61
- `,
62
- borderRadius: "inherit",
63
- zIndex: -1,
64
- opacity: 0,
65
- animation: "quantumConfidenceRotate 6s linear infinite",
66
- "@media (prefers-reduced-motion: reduce)": {
67
- animation: "none"
68
- }
69
- },
70
- "&:hover:not(:disabled)": {
71
- // ✅ FIXED: Using CSS color-mix instead of hardcoded values
72
- backgroundColor: "color-mix(in srgb, var(--quantum-color-action-primary) 85%, var(--quantum-color-text-primary))",
73
- boxShadow: `
74
- 0 6px 10px 0 rgba(var(--quantum-color-action-primaryRGB), 0.4),
75
- 0 0 10px rgba(var(--quantum-color-action-primaryRGB), 0.6),
76
- inset 0 0 10px var(--quantum-effects-shimmer)
77
- `,
78
- transform: "translateY(-2px)",
79
- "&::before": {
80
- opacity: 0.6
81
- }
82
- },
83
- // ✅ UNIFIED: Click energy burst effect
84
- "&:active::after": {
85
- content: '""',
86
- position: "absolute",
87
- top: "50%",
88
- left: "50%",
89
- width: "100%",
90
- height: "100%",
91
- background: "radial-gradient(circle, rgba(var(--quantum-color-action-primaryRGB), 0.6) 0%, transparent 70%)",
92
- borderRadius: "50%",
93
- transform: "translate(-50%, -50%) scale(0)",
94
- animation: "quantumEnergyBurst 0.5s ease-out",
95
- "@media (prefers-reduced-motion: reduce)": {
96
- animation: "none",
97
- opacity: 0
98
- }
99
- }
100
- },
101
- // ======================
102
- // SECONDARY: NOTICEABLE INTELLIGENCE
103
- // ======================
104
- "&[data-intent='secondary']": {
105
- backgroundColor: "transparent",
106
- color: "var(--quantum-color-action-primary)",
107
- border: "1.5px solid var(--quantum-color-action-primary)",
108
- boxShadow: "none",
109
- "&:hover:not(:disabled)": {
110
- backgroundColor: "rgba(var(--quantum-color-action-secondaryRGB), 0.08)",
111
- borderColor: "var(--quantum-color-action-secondary)",
112
- boxShadow: "0 2px 8px rgba(var(--quantum-color-action-secondaryRGB), 0.5)",
113
- color: "var(--quantum-color-action-secondary)"
114
- }
115
- },
116
- // ======================
117
- // DESTRUCTIVE: PROMINENT WARNING (IDENTICAL TO PRIMARY)
118
- // ======================
119
- "&[data-intent='destructive']": {
120
- backgroundColor: "var(--quantum-color-feedback-error)",
121
- color: "var(--quantum-color-text-onDestructive)",
122
- border: "none",
123
- boxShadow: "0 4px 14px 0 rgba(var(--quantum-color-feedback-errorRGB), 0.3)",
124
- // ✅ UNIFIED: Identical confidence energy field effect (same as primary)
125
- "&::before": {
126
- content: '""',
127
- position: "absolute",
128
- inset: "-2px",
129
- background: `
130
- radial-gradient(
131
- ellipse at top left,
132
- var(--quantum-color-feedback-error) 0%,
133
- transparent 50%
134
- ),
135
- radial-gradient(
136
- ellipse at bottom right,
137
- var(--quantum-color-feedback-error) 0%,
138
- transparent 50%
139
- )
140
- `,
141
- borderRadius: "inherit",
142
- zIndex: -1,
143
- opacity: 0,
144
- animation: "quantumConfidenceRotate 6s linear infinite",
145
- // ✅ UNIFIED: Same timing as primary
146
- "@media (prefers-reduced-motion: reduce)": {
147
- animation: "none"
148
- }
149
- },
150
- "&:hover:not(:disabled)": {
151
- // ✅ UNIFIED: Same hover effects as primary
152
- backgroundColor: "color-mix(in srgb, var(--quantum-color-feedback-error) 85%, var(--quantum-color-text-primary))",
153
- boxShadow: `
154
- 0 6px 10px 0 rgba(var(--quantum-color-feedback-errorRGB), 0.4),
155
- 0 0 10px rgba(var(--quantum-color-feedback-errorRGB), 0.6),
156
- inset 0 0 10px var(--quantum-effects-shimmer)
157
- `,
158
- transform: "translateY(-2px)",
159
- "&::before": {
160
- opacity: 0.6
161
- }
162
- },
163
- // ✅ UNIFIED: Identical click energy burst effect
164
- "&:active::after": {
165
- content: '""',
166
- position: "absolute",
167
- top: "50%",
168
- left: "50%",
169
- width: "100%",
170
- height: "100%",
171
- background: "radial-gradient(circle, rgba(var(--quantum-color-feedback-errorRGB), 0.6) 0%, transparent 70%)",
172
- borderRadius: "50%",
173
- transform: "translate(-50%, -50%) scale(0)",
174
- animation: "quantumEnergyBurst 0.5s ease-out",
175
- "@media (prefers-reduced-motion: reduce)": {
176
- animation: "none",
177
- opacity: 0
178
- }
179
- }
180
- },
181
- // ======================
182
- // GHOST: SUBTLE PRESENCE
183
- // ======================
184
- "&[data-intent='ghost']": {
185
- backgroundColor: "transparent",
186
- color: "var(--quantum-color-text-secondary)",
187
- border: "none",
188
- boxShadow: "none",
189
- // Subtle intelligence hint
190
- "&::before": {
191
- content: '""',
192
- position: "absolute",
193
- inset: 0,
194
- background: `radial-gradient(
195
- circle at center,
196
- rgba(var(--quantum-color-action-primaryRGB), 0.05) 0%,
197
- transparent 70%
198
- )`,
199
- borderRadius: "inherit",
200
- opacity: 0,
201
- transition: "opacity 0.4s ease"
202
- },
203
- "&:hover:not(:disabled)": {
204
- backgroundColor: "var(--quantum-color-surface-secondary)",
205
- color: "var(--quantum-color-action-primary)",
206
- boxShadow: "0 2px 8px rgba(var(--quantum-color-action-primaryRGB), 0.1)",
207
- "&::before": {
208
- opacity: 1
209
- }
210
- }
211
- }
212
- },
213
- // ✅ ENHANCED: Consistent size variants with proper scaling
214
- sizeSmall: {
215
- padding: "var(--quantum-spacing-tight) var(--quantum-spacing-comfortable)",
216
- fontSize: "var(--quantum-typography-variants-caption-fontSize)",
217
- lineHeight: "var(--quantum-typography-variants-caption-lineHeight)",
218
- minHeight: "32px"
219
- },
220
- sizeMedium: {
221
- padding: "var(--quantum-spacing-normal) var(--quantum-spacing-spacious)",
222
- fontSize: "var(--quantum-typography-variants-button-fontSize)",
223
- lineHeight: "var(--quantum-typography-variants-button-lineHeight)",
224
- minHeight: "40px"
225
- },
226
- sizeLarge: {
227
- padding: "var(--quantum-spacing-comfortable) var(--quantum-spacing-loose)",
228
- fontSize: "var(--quantum-typography-variants-body2-fontSize)",
229
- lineHeight: "var(--quantum-typography-variants-body2-lineHeight)",
230
- minHeight: "48px"
231
- }
232
- }
233
- };
234
-
235
- const PaperTheme = {
236
- styleOverrides: {
237
- root: {
238
- borderRadius: "var(--quantum-borderRadius-medium)",
239
- transition: "all var(--quantum-animation-duration-normal) var(--quantum-animation-easing-standard)",
240
- // Target data-variant attribute using CSS selector
241
- "&[data-variant='standard']": {
242
- backgroundColor: "var(--quantum-color-surface-primary)",
243
- border: "1px solid var(--quantum-color-border-default)",
244
- boxShadow: "var(--quantum-shadows-small)"
245
- },
246
- "&[data-variant='glass']": {
247
- backgroundColor: "var(--quantum-color-surface-secondary)",
248
- backdropFilter: "var(--quantum-glassmorphism-backdrop)",
249
- border: "1px solid var(--quantum-color-border-subtle)",
250
- boxShadow: "var(--quantum-shadows-glass)"
251
- },
252
- "&[data-variant='elevated']": {
253
- backgroundColor: "var(--quantum-color-surface-elevated)",
254
- border: "1px solid var(--quantum-color-border-subtle)",
255
- boxShadow: "var(--quantum-shadows-large)",
256
- "&:hover": {
257
- transform: "translateY(-2px)",
258
- boxShadow: "var(--quantum-shadows-large)"
259
- }
260
- },
261
- "&[data-variant='subtle']": {
262
- backgroundColor: "var(--quantum-color-surface-secondary)",
263
- border: "1px solid var(--quantum-color-border-subtle)",
264
- boxShadow: "none"
265
- },
266
- "&[data-variant='glassCard']": {
267
- backgroundColor: "var(--quantum-color-surface-glass)",
268
- backdropFilter: "var(--quantum-glassmorphism-backdrop)",
269
- border: "1px solid var(--quantum-color-border-glass)",
270
- borderRadius: "var(--quantum-borderRadius-large)",
271
- transition: "all var(--quantum-animation-duration-slow) var(--quantum-animation-easing-standard)",
272
- "&:hover": {
273
- backgroundColor: "var(--quantum-color-surface-glassHover)",
274
- border: "1px solid var(--quantum-color-border-glassAccent)"
275
- }
276
- },
277
- "&[data-variant='glassCardHover']": {
278
- backgroundColor: "var(--quantum-color-surface-glassHover)",
279
- backdropFilter: "var(--quantum-glassmorphism-backdrop)",
280
- border: "1px solid var(--quantum-color-border-glassAccent)",
281
- borderRadius: "var(--quantum-borderRadius-large)"
282
- },
283
- "&[data-variant='interactive']": {
284
- backgroundColor: "var(--quantum-color-surface-interactive)",
285
- border: "1px solid var(--quantum-color-border-glass)",
286
- borderRadius: "var(--quantum-borderRadius-medium)",
287
- transition: "all var(--quantum-animation-duration-slow) var(--quantum-animation-easing-standard)",
288
- "&:hover": {
289
- backgroundColor: "var(--quantum-color-surface-glassHover)",
290
- border: "1px solid var(--quantum-color-border-subtle)"
291
- }
292
- },
293
- "&[data-variant='overlay']": {
294
- backgroundColor: "var(--quantum-color-surface-overlay)",
295
- backdropFilter: "var(--quantum-glassmorphism-backdropLight)",
296
- border: "none"
297
- }
298
- }
299
- }
300
- };
301
-
302
- const TextFieldTheme = {
303
- styleOverrides: {
304
- root: {
305
- fontFamily: "var(--quantum-typography-fontFamily)",
306
- minWidth: "var(--quantum-textField-minWidth)",
307
- "& .MuiInputLabel-root": {
308
- fontFamily: "var(--quantum-typography-fontFamily-display)",
309
- fontSize: "var(--quantum-textField-fontSize)",
310
- fontWeight: "var(--quantum-typography-fontWeight-normal)",
311
- color: "var(--quantum-color-text-secondary)",
312
- "&.Mui-focused": {
313
- fontWeight: "var(--quantum-typography-fontWeight-normal)",
314
- color: "var(--quantum-color-text-secondary)"
315
- },
316
- "&.MuiInputLabel-shrunk": {
317
- fontSize: "var(--quantum-typography-fontSize-caption)",
318
- fontWeight: "var(--quantum-typography-fontWeight-normal)"
319
- },
320
- "&.Mui-disabled": {
321
- color: "var(--quantum-color-text-disabled)"
322
- }
323
- },
324
- "& .MuiFilledInput-root": {
325
- borderRadius: "var(--quantum-borderRadius-large)",
326
- backgroundColor: "var(--quantum-color-surface-input)",
327
- fontSize: "var(--quantum-textField-fontSize)",
328
- transition: "none",
329
- border: "1px solid var(--quantum-color-border-subtle)",
330
- minHeight: "var(--quantum-textField-height)",
331
- backdropFilter: "blur(8px)",
332
- boxShadow: "var(--quantum-shadows-textField)",
333
- "&:before": {
334
- display: "none"
335
- },
336
- "&:hover:not(.Mui-disabled):before": {
337
- display: "none"
338
- },
339
- "&:after": {
340
- display: "none"
341
- },
342
- "&:hover:not(.Mui-focused):not(.Mui-disabled)": {
343
- borderColor: "var(--quantum-color-action-primary)",
344
- boxShadow: "var(--quantum-shadows-textField)"
345
- },
346
- "&.Mui-focused": {
347
- backgroundColor: "var(--quantum-color-surface-input)",
348
- borderColor: "var(--quantum-color-action-primary)",
349
- boxShadow: "var(--quantum-shadows-large), 0 0 20px rgba(var(--quantum-color-action-primaryRGB), 0.15)"
350
- },
351
- "&.Mui-error": {
352
- borderColor: "var(--quantum-color-feedback-error)",
353
- boxShadow: "0 0 12px rgba(var(--quantum-color-feedback-errorRGB), 0.2)"
354
- },
355
- "&.Mui-disabled": {
356
- backgroundColor: "var(--quantum-color-surface-secondary)",
357
- borderColor: "var(--quantum-color-border-subtle)",
358
- opacity: 0.6
359
- }
360
- },
361
- "& .MuiFilledInput-input": {
362
- paddingTop: "var(--quantum-textField-spacing-paddingTop)",
363
- paddingBottom: "var(--quantum-textField-spacing-paddingBottom)",
364
- paddingLeft: "var(--quantum-textField-spacing-paddingLeft)",
365
- paddingRight: "0px",
366
- height: "auto",
367
- color: "var(--quantum-color-text-primary)",
368
- fontSize: "var(--quantum-textField-fontSize)",
369
- fontWeight: "var(--quantum-typography-fontWeight-medium)",
370
- fontFamily: "var(--quantum-typography-fontFamily-primary)",
371
- letterSpacing: "-0.01em",
372
- "&::placeholder": {
373
- color: "var(--quantum-color-text-primary)",
374
- opacity: 0.6,
375
- fontWeight: "var(--quantum-typography-fontWeight-normal)"
376
- },
377
- "&:focus::placeholder": {
378
- color: "var(--quantum-color-text-primary)",
379
- opacity: 0.4,
380
- fontWeight: "var(--quantum-typography-fontWeight-light)"
381
- },
382
- "&:disabled": {
383
- color: "var(--quantum-color-text-disabled)",
384
- WebkitTextFillColor: "var(--quantum-color-text-disabled)"
385
- }
386
- },
387
- "& .MuiFormHelperText-root": {
388
- fontFamily: "var(--quantum-typography-variants-caption-fontFamily)",
389
- fontSize: "var(--quantum-typography-variants-caption-fontSize)",
390
- fontWeight: "var(--quantum-typography-variants-caption-fontWeight)",
391
- lineHeight: "var(--quantum-typography-variants-caption-lineHeight)",
392
- letterSpacing: "var(--quantum-typography-variants-caption-letterSpacing)",
393
- marginTop: "6px",
394
- marginLeft: "12px",
395
- color: "var(--quantum-color-text-secondary)",
396
- "&.Mui-error": {
397
- color: "var(--quantum-color-feedback-error)"
398
- },
399
- "&.Mui-disabled": {
400
- color: "var(--quantum-color-text-disabled)"
401
- }
402
- }
403
- }
404
- },
405
- variants: [
406
- // State variants with proper color theming
407
- {
408
- props: { color: "success" },
409
- style: {
410
- "& .MuiFilledInput-root": {
411
- borderColor: "var(--quantum-color-feedback-success)",
412
- boxShadow: "0 0 12px rgba(var(--quantum-color-feedback-successRGB), 0.2)",
413
- "&.Mui-focused": {
414
- borderColor: "var(--quantum-color-feedback-success)",
415
- boxShadow: "var(--quantum-shadows-large), 0 0 20px rgba(var(--quantum-color-feedback-successRGB), 0.15)"
416
- }
417
- },
418
- "& .MuiInputLabel-root.Mui-focused": {
419
- color: "var(--quantum-color-feedback-success)"
420
- },
421
- "& .MuiFormHelperText-root:not(.Mui-error)": {
422
- color: "var(--quantum-color-feedback-success)"
423
- }
424
- }
425
- },
426
- {
427
- props: { color: "warning" },
428
- style: {
429
- "& .MuiFilledInput-root": {
430
- borderColor: "var(--quantum-color-feedback-warning)",
431
- boxShadow: "0 0 12px rgba(var(--quantum-color-feedback-warningRGB), 0.2)",
432
- "&.Mui-focused": {
433
- borderColor: "var(--quantum-color-feedback-warning)",
434
- boxShadow: "var(--quantum-shadows-large), 0 0 20px rgba(var(--quantum-color-feedback-warningRGB), 0.15)"
435
- }
436
- },
437
- "& .MuiInputLabel-root.Mui-focused": {
438
- color: "var(--quantum-color-feedback-warning)"
439
- },
440
- "& .MuiFormHelperText-root:not(.Mui-error)": {
441
- color: "var(--quantum-color-feedback-warning)"
442
- }
443
- }
444
- },
445
- {
446
- props: { color: "error" },
447
- style: {
448
- "& .MuiInputLabel-root.Mui-focused": {
449
- color: "var(--quantum-color-feedback-error)"
450
- }
451
- }
452
- },
453
- {
454
- props: { color: "primary" },
455
- style: {
456
- "& .MuiInputLabel-root.Mui-focused": {
457
- color: "var(--quantum-color-action-primary)"
458
- }
459
- }
460
- }
461
- ]
462
- };
463
-
464
- const palette = {
465
- // Universal Primary Blue (Excellent contrast both modes)
466
- universalBlue: {
467
- 25: "#F8FAFF",
468
- // Very subtle blue tint for input backgrounds
469
- 50: "#EBF4FF",
470
- 300: "#85B8FF",
471
- 400: "#4A95FF",
472
- 500: "#0066CC",
473
- 950: "#000A14"
474
- },
475
- // High Contrast Neutrals for Light Mode
476
- lightNeutral: {
477
- 50: "#FFFFFF",
478
- // Pure white for maximum contrast
479
- 100: "#F8F9FA",
480
- // Very light gray
481
- 200: "#E9ECEF",
482
- // Light border
483
- 300: "#DEE2E6",
484
- // Subtle elements
485
- 500: "#6C757D",
486
- // Secondary text (9:1 contrast)
487
- 700: "#343A40",
488
- // Very strong text (16:1 contrast)
489
- 900: "#000000"},
490
- // High Contrast Neutrals for Dark Mode
491
- darkNeutral: {
492
- 50: "#FFFFFF",
493
- // Light text (16:1 contrast)
494
- 300: "#CED4DA",
495
- // Muted text (7:1 contrast)
496
- 500: "#495057",
497
- // Subtle elements
498
- 600: "#343A40",
499
- // Dark elements
500
- 700: "#212529",
501
- // Very dark surface
502
- 800: "#1A1D20",
503
- // Dark surface
504
- 900: "#0D1117",
505
- // Primary dark background
506
- 950: "#000000"
507
- // Maximum dark
508
- },
509
- // Secondary Accent (Complementary to blue)
510
- emeraldAccent: {
511
- 500: "#10B981"},
512
- // Status Colors (High contrast)
513
- red: {
514
- 500: "#DC2626"},
515
- amber: {
516
- 500: "#D97706"},
517
- emerald: {
518
- 500: "#059669"},
519
- blue: {
520
- 500: "#2563EB"},
521
- // Pure colors (Maximum contrast references)
522
- pure: {
523
- white: "#FFFFFF"}
524
- };
525
-
526
- const generateCSSVariablesFromTokens = (tokens, prefix = "quantum") => {
527
- const cssVariables = {};
528
- const traverse = (obj, path = []) => {
529
- if (typeof obj === "object" && obj !== null) {
530
- Object.entries(obj).forEach(([key, value]) => {
531
- const currentPath = [...path, key];
532
- if (typeof value === "string" || typeof value === "number") {
533
- const variableName = `--${prefix}-${currentPath.join("-")}`;
534
- cssVariables[variableName] = String(value);
535
- } else if (typeof value === "object" && value !== null) {
536
- traverse(value, currentPath);
537
- }
538
- });
539
- }
540
- };
541
- traverse(tokens);
542
- return cssVariables;
543
- };
544
-
545
- const SEMANTIC_TOKENS = {
546
- colors: {
547
- // Action colors
548
- action: {
549
- primary: {
550
- light: palette.universalBlue[500],
551
- dark: palette.universalBlue[500],
552
- needsRGB: true
553
- },
554
- secondary: {
555
- light: palette.emeraldAccent[500],
556
- dark: palette.emeraldAccent[500],
557
- needsRGB: true
558
- },
559
- destructive: {
560
- light: palette.red[500],
561
- dark: palette.red[500],
562
- needsRGB: true
563
- }
564
- },
565
- // Surface colors
566
- surface: {
567
- primary: {
568
- light: palette.lightNeutral[50],
569
- // Pure white
570
- dark: palette.darkNeutral[900]
571
- // Deep dark
572
- },
573
- input: {
574
- light: palette.universalBlue[25],
575
- // "#F8FAFF" - very subtle blue tint for inputs
576
- dark: palette.universalBlue[950]
577
- // "#000A14" - deep blue-black for inputs
578
- },
579
- secondary: {
580
- light: palette.lightNeutral[100],
581
- // Very light gray
582
- dark: palette.darkNeutral[900]
583
- // Dark surface
584
- },
585
- elevated: {
586
- light: palette.pure.white,
587
- dark: palette.darkNeutral[900]
588
- },
589
- glass: {
590
- light: palette.lightNeutral[200],
591
- // Light glass surface
592
- dark: palette.darkNeutral[800]
593
- // Dark glass surface
594
- },
595
- glassHover: {
596
- light: palette.lightNeutral[100],
597
- // Slightly lighter on hover
598
- dark: palette.darkNeutral[700]
599
- // Lighter dark surface on hover
600
- },
601
- interactive: {
602
- light: palette.universalBlue[50],
603
- // Very subtle blue tint
604
- dark: palette.universalBlue[950]
605
- // Deep blue tint for dark mode
606
- },
607
- overlay: {
608
- light: palette.darkNeutral[900],
609
- // Dark overlay
610
- dark: palette.darkNeutral[950],
611
- // Darker overlay for dark mode
612
- needsRGB: true
613
- }
614
- },
615
- // Text colors
616
- text: {
617
- primary: {
618
- light: palette.lightNeutral[900],
619
- // Pure black
620
- dark: palette.darkNeutral[50],
621
- // Pure white
622
- needsRGB: true
623
- },
624
- secondary: {
625
- light: palette.lightNeutral[700],
626
- // High contrast secondary
627
- dark: palette.darkNeutral[300]
628
- // High contrast secondary dark
629
- },
630
- disabled: {
631
- light: palette.lightNeutral[500],
632
- dark: palette.darkNeutral[500]
633
- }
634
- },
635
- // Feedback colors
636
- feedback: {
637
- success: {
638
- light: palette.emerald[500],
639
- dark: palette.emerald[500],
640
- needsRGB: true
641
- },
642
- warning: {
643
- light: palette.amber[500],
644
- dark: palette.amber[500],
645
- needsRGB: true
646
- },
647
- error: {
648
- light: palette.red[500],
649
- dark: palette.red[500],
650
- needsRGB: true
651
- },
652
- info: {
653
- light: palette.blue[500],
654
- dark: palette.blue[500]
655
- }
656
- },
657
- // Border colors
658
- border: {
659
- default: {
660
- light: palette.lightNeutral[300],
661
- dark: palette.darkNeutral[600]
662
- },
663
- subtle: {
664
- light: palette.lightNeutral[200],
665
- dark: palette.darkNeutral[700]
666
- },
667
- glass: {
668
- light: palette.lightNeutral[300],
669
- // Light glass border
670
- dark: palette.darkNeutral[600]
671
- // Dark glass border
672
- },
673
- glassAccent: {
674
- light: palette.universalBlue[300],
675
- // Blue accent border
676
- dark: palette.universalBlue[400]
677
- // Slightly brighter for dark mode
678
- }
679
- }
680
- },
681
- // Effects - static values
682
- effects: {
683
- shimmer: {
684
- light: "rgba(255, 255, 255, 0.1)",
685
- // White shimmer for light mode
686
- dark: "rgba(255, 255, 255, 0.05)"
687
- // Subtle white shimmer for dark mode
688
- }
689
- },
690
- // Border radius - responsive values
691
- borderRadius: {
692
- none: {
693
- mobile: "0px",
694
- tablet: "0px",
695
- desktop: "0px"
696
- },
697
- small: {
698
- mobile: "3px",
699
- tablet: "4px",
700
- desktop: "4px"
701
- },
702
- medium: {
703
- mobile: "6px",
704
- tablet: "8px",
705
- desktop: "8px"
706
- },
707
- large: {
708
- mobile: "8px",
709
- tablet: "12px",
710
- desktop: "12px"
711
- },
712
- full: {
713
- mobile: "9999px",
714
- tablet: "9999px",
715
- desktop: "9999px"
716
- }
717
- },
718
- // Shadows - theme-aware values
719
- shadows: {
720
- small: {
721
- light: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
722
- dark: "0 1px 2px 0 rgba(0, 0, 0, 0.3)"
723
- },
724
- medium: {
725
- light: "0 4px 6px -1px rgba(0, 0, 0, 0.1)",
726
- dark: "0 4px 6px -1px rgba(0, 0, 0, 0.4)"
727
- },
728
- large: {
729
- light: "0 10px 15px -3px rgba(0, 0, 0, 0.1)",
730
- dark: "0 10px 15px -3px rgba(0, 0, 0, 0.5)"
731
- },
732
- glass: {
733
- light: "0 8px 32px 0 rgba(31, 38, 135, 0.37)",
734
- dark: "0 8px 32px 0 rgba(59, 130, 246, 0.25)"
735
- },
736
- glassInset: {
737
- light: "inset 0 1px 0 0 rgba(255, 255, 255, 0.1)",
738
- dark: "inset 0 1px 0 0 rgba(255, 255, 255, 0.05)"
739
- },
740
- textField: {
741
- light: "0 4px 6px -1px rgba(0, 0, 0, 0.1), inset 0 1px 0 0 rgba(255, 255, 255, 0.08)",
742
- dark: "0 4px 6px -1px rgba(187, 187, 187, 0.03), inset 0 1px 0 0 rgba(0, 0, 0, 0.4)"
743
- }
744
- },
745
- // Glass effects - theme-aware values
746
- glassmorphism: {
747
- backdrop: {
748
- light: "blur(16px)",
749
- dark: "blur(20px)"
750
- // Stronger blur in dark mode for better effect
751
- },
752
- backdropLight: {
753
- light: "blur(8px)",
754
- dark: "blur(12px)"
755
- },
756
- backdropHeavy: {
757
- light: "blur(24px)",
758
- dark: "blur(32px)"
759
- }
760
- },
761
- // Animation - static values
762
- animation: {
763
- duration: {
764
- fast: "150ms",
765
- normal: "200ms",
766
- slow: "300ms"
767
- },
768
- easing: {
769
- standard: "cubic-bezier(0.4, 0.0, 0.2, 1)",
770
- decelerate: "cubic-bezier(0.0, 0.0, 0.2, 1)",
771
- accelerate: "cubic-bezier(0.4, 0.0, 1, 1)"
772
- }
773
- },
774
- // ✅ UPDATED: Business-Optimized Typography System
775
- typography: {
776
- // Font families - Dual font approach: Inter + Space Grotesk
777
- fontFamily: {
778
- // Space Grotesk for display elements, headings, UI
779
- display: "'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif",
780
- // Inter for body text and readable content
781
- primary: "'Quicksand','Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif"
782
- },
783
- // Font weights
784
- fontWeight: {
785
- light: 300,
786
- normal: 400,
787
- medium: 500,
788
- semibold: 600,
789
- bold: 700
790
- },
791
- // ✅ UPDATED: Business-optimized typography variants
792
- variants: {
793
- // Display - Hero sections (REDUCED from 72px max to 56px max)
794
- display: {
795
- fontSize: {
796
- mobile: "2.25rem",
797
- // 36px (was 40px)
798
- tablet: "3rem",
799
- // 48px (was 56px)
800
- desktop: "3.5rem"
801
- // 56px (was 72px) - More reasonable for dashboards
802
- },
803
- lineHeight: {
804
- mobile: 1.1,
805
- tablet: 1.1,
806
- desktop: 1
807
- },
808
- fontWeight: 700,
809
- letterSpacing: "-0.02em",
810
- fontFamily: "display"
811
- },
812
- // H1 - Page titles (INCREASED from 40px max to 48px max)
813
- h1: {
814
- fontSize: {
815
- mobile: "2rem",
816
- // 32px (was 30px)
817
- tablet: "2.5rem",
818
- // 40px (was 36px)
819
- desktop: "3rem"
820
- // 48px (was 40px) - More impact for page titles
821
- },
822
- lineHeight: {
823
- mobile: 1.2,
824
- tablet: 1.2,
825
- desktop: 1.1
826
- },
827
- fontWeight: 700,
828
- // INCREASED from 600 to 700 for more presence
829
- fontFamily: "display"
830
- },
831
- // H2 - Section titles (SLIGHTLY INCREASED)
832
- h2: {
833
- fontSize: {
834
- mobile: "1.5rem",
835
- // 24px (same)
836
- tablet: "1.875rem",
837
- // 30px (was 28px)
838
- desktop: "2.25rem"
839
- // 36px (was 32px) - Better hierarchy
840
- },
841
- lineHeight: {
842
- mobile: 1.3,
843
- tablet: 1.3,
844
- desktop: 1.2
845
- },
846
- fontWeight: 600,
847
- fontFamily: "display"
848
- },
849
- // H3 - Subsection titles (INCREASED for better hierarchy)
850
- h3: {
851
- fontSize: {
852
- mobile: "1.25rem",
853
- // 20px (same)
854
- tablet: "1.5rem",
855
- // 24px (was 22px)
856
- desktop: "1.75rem"
857
- // 28px (was 24px) - Better gap from body text
858
- },
859
- lineHeight: {
860
- mobile: 1.4,
861
- tablet: 1.4,
862
- desktop: 1.3
863
- },
864
- fontWeight: 600,
865
- fontFamily: "display"
866
- // CHANGED from "primary" to "display" for consistency
867
- },
868
- // H4 - Component headers (INCREASED for clearer hierarchy)
869
- h4: {
870
- fontSize: {
871
- mobile: "1.125rem",
872
- // 18px (same)
873
- tablet: "1.25rem",
874
- // 20px (same)
875
- desktop: "1.5rem"
876
- // 24px (was 22px) - Better distinction from body
877
- },
878
- lineHeight: {
879
- mobile: 1.4,
880
- tablet: 1.4,
881
- desktop: 1.4
882
- },
883
- fontWeight: 600,
884
- // INCREASED from 500 to 600 for more definition
885
- fontFamily: "display"
886
- // CHANGED from "primary" to "display"
887
- },
888
- // H5 - Small headers (ADDED - was missing)
889
- h5: {
890
- fontSize: {
891
- mobile: "1rem",
892
- // 16px
893
- tablet: "1.125rem",
894
- // 18px
895
- desktop: "1.25rem"
896
- // 20px
897
- },
898
- lineHeight: {
899
- mobile: 1.4,
900
- tablet: 1.4,
901
- desktop: 1.4
902
- },
903
- fontWeight: 600,
904
- fontFamily: "display"
905
- },
906
- // H6 - Smallest headers (ADDED - was missing)
907
- h6: {
908
- fontSize: {
909
- mobile: "0.875rem",
910
- // 14px
911
- tablet: "1rem",
912
- // 16px
913
- desktop: "1.125rem"
914
- // 18px
915
- },
916
- lineHeight: {
917
- mobile: 1.4,
918
- tablet: 1.4,
919
- desktop: 1.4
920
- },
921
- fontWeight: 500,
922
- fontFamily: "display"
923
- },
924
- // Body1 - Main content (OPTIMIZED - Inter font)
925
- body1: {
926
- fontSize: {
927
- mobile: "0.875rem",
928
- // 14px - more appropriate for web apps
929
- tablet: "1rem",
930
- // 16px - reduced from 18px
931
- desktop: "1rem"
932
- // 16px - reduced from 18px for better UI proportions
933
- },
934
- lineHeight: {
935
- mobile: 1.5,
936
- tablet: 1.6,
937
- desktop: 1.6
938
- },
939
- fontWeight: 400,
940
- fontFamily: "primary"
941
- // Inter for readability
942
- },
943
- // Body2 - Secondary content (OPTIMIZED)
944
- body2: {
945
- fontSize: {
946
- mobile: "0.8125rem",
947
- // 13px - reduced for form fields
948
- tablet: "0.875rem",
949
- // 14px - reduced from 16px
950
- desktop: "0.875rem"
951
- // 14px - better for form elements
952
- },
953
- lineHeight: {
954
- mobile: 1.5,
955
- tablet: 1.5,
956
- desktop: 1.5
957
- },
958
- fontWeight: 400,
959
- fontFamily: "primary"
960
- // Inter for readability
961
- },
962
- // Button - Interface elements (OPTIMIZED)
963
- button: {
964
- fontSize: {
965
- mobile: "0.75rem",
966
- // 12px - reduced for more compact buttons
967
- tablet: "0.8125rem",
968
- // 13px - reduced from 14px
969
- desktop: "0.8125rem"
970
- // 13px - more compact for business UI
971
- },
972
- lineHeight: {
973
- mobile: 1.3,
974
- // Tighter line height for buttons (was 1.4)
975
- tablet: 1.3,
976
- desktop: 1.3
977
- },
978
- fontWeight: 500,
979
- fontFamily: "display"
980
- },
981
- // Caption - Small text, metadata (REFINED for small buttons)
982
- caption: {
983
- fontSize: {
984
- mobile: "0.6875rem",
985
- // 11px - reduced for metadata
986
- tablet: "0.75rem",
987
- // 12px - reduced from 13px
988
- desktop: "0.75rem"
989
- // 12px - appropriate for helper text
990
- },
991
- lineHeight: {
992
- mobile: 1.3,
993
- // Tighter for small buttons (was 1.4)
994
- tablet: 1.3,
995
- desktop: 1.3
996
- },
997
- fontWeight: 500,
998
- // Increased from 400 for better small text legibility
999
- fontFamily: "display"
1000
- // Changed from "primary" to "display" for button consistency
1001
- }
1002
- }
1003
- },
1004
- // TextField component tokens
1005
- textField: {
1006
- height: {
1007
- mobile: "3rem",
1008
- // 48px
1009
- tablet: "3.25rem",
1010
- // 52px
1011
- desktop: "3.25rem"
1012
- // 52px
1013
- },
1014
- minWidth: {
1015
- mobile: "280px",
1016
- // Minimum mobile width
1017
- tablet: "320px",
1018
- // Minimum tablet width
1019
- desktop: "360px"
1020
- // Minimum desktop width
1021
- },
1022
- fontSize: {
1023
- mobile: "1rem",
1024
- // 16px
1025
- tablet: "1.1rem",
1026
- // 20px
1027
- desktop: "1.1rem"
1028
- // 20px
1029
- },
1030
- spacing: {
1031
- paddingTop: {
1032
- mobile: "20px",
1033
- tablet: "24px",
1034
- desktop: "24px"
1035
- },
1036
- paddingBottom: {
1037
- mobile: "8px",
1038
- tablet: "4px",
1039
- desktop: "4px"
1040
- },
1041
- paddingLeft: {
1042
- mobile: "12px",
1043
- tablet: "12px",
1044
- desktop: "12px"
1045
- }
1046
- }
1047
- },
1048
- // Spacing system (unchanged - was already good)
1049
- spacing: {
1050
- tight: {
1051
- mobile: "4px",
1052
- tablet: "4px",
1053
- desktop: "6px"
1054
- // Slightly increased for desktop precision
1055
- },
1056
- normal: {
1057
- mobile: "6px",
1058
- // Reduced from 8px for more compact buttons
1059
- tablet: "8px",
1060
- desktop: "10px"
1061
- // More refined than 8px
1062
- },
1063
- comfortable: {
1064
- mobile: "12px",
1065
- tablet: "14px",
1066
- // Slightly increased for better button width
1067
- desktop: "16px"
1068
- // Reduced from 20px for more compact feel
1069
- },
1070
- spacious: {
1071
- mobile: "16px",
1072
- tablet: "20px",
1073
- // Reduced from 24px
1074
- desktop: "24px"
1075
- // Reduced from 32px for business interfaces
1076
- },
1077
- loose: {
1078
- mobile: "20px",
1079
- // Reduced from 24px
1080
- tablet: "28px",
1081
- // Reduced from 32px
1082
- desktop: "36px"
1083
- // Reduced from 48px - better for business apps
1084
- }
1085
- }
1086
- };
1087
- const hexToRgb = (hex) => {
1088
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
1089
- if (!result) return "0, 0, 0";
1090
- return [
1091
- parseInt(result[1], 16),
1092
- parseInt(result[2], 16),
1093
- parseInt(result[3], 16)
1094
- ].join(", ");
1095
- };
1096
- const getAllThemeVariables = () => {
1097
- const modes = ["light", "dark"];
1098
- const breakpoints = [
1099
- "mobile",
1100
- "tablet",
1101
- "desktop"
1102
- ];
1103
- const result = {};
1104
- modes.forEach((mode) => {
1105
- breakpoints.forEach((breakpoint) => {
1106
- const tokens = {
1107
- color: {},
1108
- borderRadius: {},
1109
- shadows: {},
1110
- glassmorphism: {},
1111
- effects: {},
1112
- animation: SEMANTIC_TOKENS.animation,
1113
- typography: {
1114
- fontFamily: SEMANTIC_TOKENS.typography.fontFamily,
1115
- fontWeight: SEMANTIC_TOKENS.typography.fontWeight,
1116
- variants: {}
1117
- },
1118
- spacing: {},
1119
- textField: {}
1120
- };
1121
- Object.entries(SEMANTIC_TOKENS.colors).forEach(([category, colors]) => {
1122
- tokens.color[category] = {};
1123
- Object.entries(colors).forEach(([name, colorDef]) => {
1124
- tokens.color[category][name] = colorDef[mode];
1125
- if (colorDef.needsRGB) {
1126
- const colorValue = colorDef[mode];
1127
- tokens.color[category][name + "RGB"] = hexToRgb(colorValue);
1128
- }
1129
- });
1130
- });
1131
- Object.entries(SEMANTIC_TOKENS.spacing).forEach(
1132
- ([name, responsiveValue]) => {
1133
- tokens.spacing[name] = responsiveValue[breakpoint];
1134
- }
1135
- );
1136
- Object.entries(SEMANTIC_TOKENS.borderRadius).forEach(
1137
- ([name, responsiveValue]) => {
1138
- tokens.borderRadius[name] = responsiveValue[breakpoint];
1139
- }
1140
- );
1141
- Object.entries(SEMANTIC_TOKENS.shadows).forEach(([name, shadowValue]) => {
1142
- if (typeof shadowValue === "object" && "light" in shadowValue && "dark" in shadowValue) {
1143
- tokens.shadows[name] = shadowValue[mode];
1144
- } else {
1145
- tokens.shadows[name] = shadowValue;
1146
- }
1147
- });
1148
- Object.entries(SEMANTIC_TOKENS.glassmorphism).forEach(
1149
- ([name, glassValue]) => {
1150
- if (typeof glassValue === "object" && "light" in glassValue && "dark" in glassValue) {
1151
- tokens.glassmorphism[name] = glassValue[mode];
1152
- } else {
1153
- tokens.glassmorphism[name] = glassValue;
1154
- }
1155
- }
1156
- );
1157
- Object.entries(SEMANTIC_TOKENS.effects).forEach(([name, effectValue]) => {
1158
- if (typeof effectValue === "object" && "light" in effectValue && "dark" in effectValue) {
1159
- tokens.effects[name] = effectValue[mode];
1160
- } else {
1161
- tokens.effects[name] = effectValue;
1162
- }
1163
- });
1164
- tokens.textField = {
1165
- height: SEMANTIC_TOKENS.textField.height[breakpoint],
1166
- minWidth: SEMANTIC_TOKENS.textField.minWidth[breakpoint],
1167
- fontSize: SEMANTIC_TOKENS.textField.fontSize[breakpoint],
1168
- spacing: {
1169
- paddingTop: SEMANTIC_TOKENS.textField.spacing.paddingTop[breakpoint],
1170
- paddingBottom: SEMANTIC_TOKENS.textField.spacing.paddingBottom[breakpoint],
1171
- paddingLeft: SEMANTIC_TOKENS.textField.spacing.paddingLeft[breakpoint]
1172
- }
1173
- };
1174
- Object.entries(SEMANTIC_TOKENS.typography.variants).forEach(
1175
- ([variantName, variant]) => {
1176
- tokens.typography.variants[variantName] = {
1177
- fontSize: variant.fontSize[breakpoint],
1178
- lineHeight: variant.lineHeight[breakpoint],
1179
- fontWeight: variant.fontWeight,
1180
- fontFamily: SEMANTIC_TOKENS.typography.fontFamily[variant.fontFamily],
1181
- ...variant.letterSpacing && {
1182
- letterSpacing: variant.letterSpacing
1183
- }
1184
- };
1185
- }
1186
- );
1187
- const key = `${mode}${breakpoint.charAt(0).toUpperCase()}${breakpoint.slice(1)}`;
1188
- result[key] = generateCSSVariablesFromTokens(tokens);
1189
- });
1190
- });
1191
- return result;
1192
- };
1193
-
1194
- const createQuantumTheme = (mode) => {
1195
- const {
1196
- lightDesktop,
1197
- lightMobile,
1198
- lightTablet,
1199
- darkDesktop,
1200
- darkMobile,
1201
- darkTablet
1202
- } = getAllThemeVariables();
1203
- const colors = SEMANTIC_TOKENS.colors;
1204
- const currentModeColors = {
1205
- actionPrimary: colors.action.primary[mode],
1206
- actionSecondary: colors.action.secondary[mode],
1207
- feedbackError: colors.feedback.error[mode],
1208
- feedbackWarning: colors.feedback.warning[mode],
1209
- feedbackInfo: colors.feedback.info[mode],
1210
- feedbackSuccess: colors.feedback.success[mode],
1211
- surfacePrimary: colors.surface.primary[mode],
1212
- surfaceSecondary: colors.surface.secondary[mode],
1213
- textPrimary: colors.text.primary[mode],
1214
- textSecondary: colors.text.secondary[mode],
1215
- textDisabled: colors.text.disabled[mode],
1216
- borderDefault: colors.border.default[mode]
1217
- };
1218
- const theme = createTheme({
1219
- // Note: Material-UI cssVariables disabled to prevent interference with our theme persistence
1220
- // Our CSS variables are injected via MuiCssBaseline styleOverrides instead
1221
- palette: {
1222
- mode,
1223
- primary: {
1224
- main: currentModeColors.actionPrimary,
1225
- contrastText: currentModeColors.textPrimary
1226
- },
1227
- secondary: {
1228
- main: currentModeColors.actionSecondary,
1229
- contrastText: currentModeColors.textPrimary
1230
- },
1231
- error: {
1232
- main: currentModeColors.feedbackError,
1233
- contrastText: currentModeColors.textPrimary
1234
- },
1235
- warning: {
1236
- main: currentModeColors.feedbackWarning,
1237
- contrastText: currentModeColors.textPrimary
1238
- },
1239
- info: {
1240
- main: currentModeColors.feedbackInfo,
1241
- contrastText: currentModeColors.textPrimary
1242
- },
1243
- success: {
1244
- main: currentModeColors.feedbackSuccess,
1245
- contrastText: currentModeColors.textPrimary
1246
- },
1247
- background: {
1248
- default: currentModeColors.surfacePrimary,
1249
- paper: currentModeColors.surfaceSecondary
1250
- },
1251
- text: {
1252
- primary: currentModeColors.textPrimary,
1253
- secondary: currentModeColors.textSecondary,
1254
- disabled: currentModeColors.textDisabled
1255
- },
1256
- divider: currentModeColors.borderDefault
1257
- },
1258
- typography: {
1259
- h1: {
1260
- fontFamily: "var(--quantum-typography-fontFamily-display)",
1261
- fontSize: "var(--quantum-typography-variants-display-fontSize)",
1262
- lineHeight: "var(--quantum-typography-variants-display-lineHeight)",
1263
- fontWeight: "var(--quantum-typography-variants-display-fontWeight)",
1264
- letterSpacing: "var(--quantum-typography-variants-display-letterSpacing)",
1265
- color: "var(--quantum-color-text-primary)"
1266
- },
1267
- h2: {
1268
- fontFamily: "var(--quantum-typography-fontFamily-display)",
1269
- fontSize: "var(--quantum-typography-variants-h1-fontSize)",
1270
- lineHeight: "var(--quantum-typography-variants-h1-lineHeight)",
1271
- fontWeight: "var(--quantum-typography-variants-h1-fontWeight)",
1272
- color: "var(--quantum-color-text-primary)"
1273
- },
1274
- h3: {
1275
- fontFamily: "var(--quantum-typography-fontFamily-display)",
1276
- fontSize: "var(--quantum-typography-variants-h2-fontSize)",
1277
- lineHeight: "var(--quantum-typography-variants-h2-lineHeight)",
1278
- fontWeight: "var(--quantum-typography-variants-h2-fontWeight)",
1279
- color: "var(--quantum-color-text-primary)"
1280
- },
1281
- h4: {
1282
- fontFamily: "var(--quantum-typography-fontFamily-primary)",
1283
- fontSize: "var(--quantum-typography-variants-h3-fontSize)",
1284
- lineHeight: "var(--quantum-typography-variants-h3-lineHeight)",
1285
- fontWeight: "var(--quantum-typography-variants-h3-fontWeight)",
1286
- color: "var(--quantum-color-text-primary)"
1287
- },
1288
- h5: {
1289
- fontFamily: "var(--quantum-typography-fontFamily-primary)",
1290
- fontSize: "var(--quantum-typography-variants-h4-fontSize)",
1291
- lineHeight: "var(--quantum-typography-variants-h4-lineHeight)",
1292
- fontWeight: "var(--quantum-typography-variants-h4-fontWeight)",
1293
- color: "var(--quantum-color-text-primary)"
1294
- },
1295
- h6: {
1296
- fontFamily: "var(--quantum-typography-fontFamily-primary)",
1297
- fontSize: "var(--quantum-typography-variants-caption-fontSize)",
1298
- lineHeight: "var(--quantum-typography-variants-caption-lineHeight)",
1299
- fontWeight: "var(--quantum-typography-fontWeight-medium)",
1300
- color: "var(--quantum-color-text-secondary)"
1301
- },
1302
- body1: {
1303
- fontFamily: "var(--quantum-typography-fontFamily-primary)",
1304
- fontSize: "var(--quantum-typography-variants-body1-fontSize)",
1305
- lineHeight: "var(--quantum-typography-variants-body1-lineHeight)",
1306
- fontWeight: "var(--quantum-typography-variants-body1-fontWeight)",
1307
- color: "var(--quantum-color-text-primary)"
1308
- },
1309
- body2: {
1310
- fontFamily: "var(--quantum-typography-fontFamily-primary)",
1311
- fontSize: "var(--quantum-typography-variants-body2-fontSize)",
1312
- lineHeight: "var(--quantum-typography-variants-body2-lineHeight)",
1313
- fontWeight: "var(--quantum-typography-variants-body2-fontWeight)",
1314
- color: "var(--quantum-color-text-secondary)"
1315
- },
1316
- button: {
1317
- fontFamily: "var(--quantum-typography-fontFamily-display)",
1318
- fontSize: "var(--quantum-typography-variants-button-fontSize)",
1319
- lineHeight: "var(--quantum-typography-variants-button-lineHeight)",
1320
- fontWeight: "var(--quantum-typography-variants-button-fontWeight)",
1321
- color: "var(--quantum-color-text-primary)",
1322
- textTransform: "none"
1323
- },
1324
- caption: {
1325
- fontFamily: "var(--quantum-typography-fontFamily-primary)",
1326
- fontSize: "var(--quantum-typography-variants-caption-fontSize)",
1327
- lineHeight: "var(--quantum-typography-variants-caption-lineHeight)",
1328
- fontWeight: "var(--quantum-typography-variants-caption-fontWeight)",
1329
- color: "var(--quantum-color-text-secondary)"
1330
- },
1331
- overline: {
1332
- fontFamily: "var(--quantum-typography-fontFamily-primary)",
1333
- fontWeight: "var(--quantum-typography-fontWeight-medium)",
1334
- color: "var(--quantum-color-text-secondary)",
1335
- textTransform: "uppercase",
1336
- letterSpacing: "0.08em"
1337
- }
1338
- },
1339
- shape: {
1340
- borderRadius: 8
1341
- },
1342
- components: {
1343
- // CSS Variables injection
1344
- MuiCssBaseline: {
1345
- styleOverrides: {
1346
- "@keyframes quantumConfidenceRotate": {
1347
- "0%": { transform: "rotate(0deg)" },
1348
- "100%": { transform: "rotate(360deg)" }
1349
- },
1350
- // Energy burst animation for button clicks
1351
- "@keyframes quantumEnergyBurst": {
1352
- "0%": {
1353
- transform: "translate(-50%, -50%) scale(0)",
1354
- opacity: 1
1355
- },
1356
- "100%": {
1357
- transform: "translate(-50%, -50%) scale(2)",
1358
- opacity: 0
1359
- }
1360
- },
1361
- // Warning rotate animation for destructive buttons (similar to primary)
1362
- "@keyframes quantumWarningRotate": {
1363
- "0%": { transform: "rotate(0deg)" },
1364
- "100%": { transform: "rotate(360deg)" }
1365
- },
1366
- // Respect reduced motion preferences
1367
- "@media (prefers-reduced-motion: reduce)": {
1368
- "*": {
1369
- animationDuration: "0.01ms !important",
1370
- animationIterationCount: "1 !important",
1371
- transitionDuration: "0.01ms !important"
1372
- }
1373
- },
1374
- // Add Space Grotesk font loading
1375
- "@font-face": {
1376
- fontFamily: "Space Grotesk",
1377
- fontDisplay: "swap"
1378
- },
1379
- // Light mode - mobile first (base styles)
1380
- ":root": {
1381
- ...lightMobile,
1382
- // Ensure font is loaded
1383
- fontFamily: SEMANTIC_TOKENS.typography.fontFamily.primary
1384
- },
1385
- // Dark mode - mobile first
1386
- '[data-theme="dark"]': darkMobile,
1387
- // Light mode - tablet and up & Dark mode - tablet and up
1388
- "@media (min-width: 768px)": {
1389
- ":root": lightTablet,
1390
- '[data-theme="dark"]': darkTablet
1391
- },
1392
- // Light mode - desktop and up & Dark mode - desktop and up
1393
- "@media (min-width: 1024px)": {
1394
- ":root": lightDesktop,
1395
- '[data-theme="dark"]': darkDesktop
1396
- },
1397
- // Ensure all text uses Space Grotesk by default
1398
- "html, body": {
1399
- fontFamily: SEMANTIC_TOKENS.typography.fontFamily.primary,
1400
- fontDisplay: "swap"
1401
- }
1402
- }
1403
- },
1404
- // Component theme overrides
1405
- MuiButton: ButtonTheme,
1406
- MuiPaper: PaperTheme,
1407
- MuiTextField: TextFieldTheme
1408
- }
1409
- });
1410
- return theme;
1411
- };
1412
-
1413
- const ThemeScript = ({
1414
- defaultColorScheme = "light",
1415
- storageKey = "quantum-color-scheme",
1416
- attribute = "data-theme",
1417
- preventFlickering = true
1418
- }) => {
1419
- const script = `
1420
- (function() {
1421
- ${preventFlickering ? `
1422
- // Add no-transition class to prevent flickering during initial load
1423
- document.documentElement.classList.add('no-transition');
1424
- ` : ""}
1425
-
1426
- try {
1427
- const savedScheme = localStorage.getItem('${storageKey}');
1428
- const validSchemes = ['light', 'dark'];
1429
- const themeToApply = savedScheme && validSchemes.includes(savedScheme)
1430
- ? savedScheme
1431
- : '${defaultColorScheme}';
1432
-
1433
- document.documentElement.setAttribute('${attribute}', themeToApply);
1434
- } catch (e) {
1435
- // Fallback if localStorage is not available (private browsing, etc.)
1436
- document.documentElement.setAttribute('${attribute}', '${defaultColorScheme}');
1437
- }
1438
-
1439
- ${preventFlickering ? `
1440
- // Remove no-transition class after DOM is ready to enable smooth transitions
1441
- function enableTransitions() {
1442
- document.documentElement.classList.remove('no-transition');
1443
- document.documentElement.classList.add('loaded');
1444
- }
1445
-
1446
- if (document.readyState === 'loading') {
1447
- window.addEventListener('DOMContentLoaded', function() {
1448
- setTimeout(enableTransitions, 100);
1449
- });
1450
- } else {
1451
- // DOM is already ready
1452
- setTimeout(enableTransitions, 100);
1453
- }
1454
- ` : ""}
1455
- })();
1456
- `;
1457
- return /* @__PURE__ */ jsx(
1458
- "script",
1459
- {
1460
- dangerouslySetInnerHTML: { __html: script },
1461
- suppressHydrationWarning: true
1462
- }
1463
- );
1464
- };
1465
- const getThemeScript = (options = {}) => {
1466
- const {
1467
- defaultColorScheme = "light",
1468
- storageKey = "quantum-color-scheme",
1469
- attribute = "data-theme",
1470
- preventFlickering = true
1471
- } = options;
1472
- return `
1473
- (function() {
1474
- ${preventFlickering ? `
1475
- document.documentElement.classList.add('no-transition');
1476
- ` : ""}
1477
-
1478
- try {
1479
- const savedScheme = localStorage.getItem('${storageKey}');
1480
- const validSchemes = ['light', 'dark'];
1481
- const themeToApply = savedScheme && validSchemes.includes(savedScheme)
1482
- ? savedScheme
1483
- : '${defaultColorScheme}';
1484
-
1485
- document.documentElement.setAttribute('${attribute}', themeToApply);
1486
- } catch (e) {
1487
- document.documentElement.setAttribute('${attribute}', '${defaultColorScheme}');
1488
- }
1489
-
1490
- ${preventFlickering ? `
1491
- function enableTransitions() {
1492
- document.documentElement.classList.remove('no-transition');
1493
- document.documentElement.classList.add('loaded');
1494
- }
1495
-
1496
- if (document.readyState === 'loading') {
1497
- window.addEventListener('DOMContentLoaded', function() {
1498
- setTimeout(enableTransitions, 100);
1499
- });
1500
- } else {
1501
- setTimeout(enableTransitions, 100);
1502
- }
1503
- ` : ""}
1504
- })();
1505
- `.trim();
1506
- };
1507
-
1508
- export { SEMANTIC_TOKENS as S, ThemeScript as T, createQuantumTheme as c, getThemeScript as g };
1509
- //# sourceMappingURL=ThemeScript-CQlC-jGc.js.map