@titan-design/react-ui 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +319 -0
- package/dist/chunk-NA3EES23.mjs +1481 -0
- package/dist/chunk-NA3EES23.mjs.map +1 -0
- package/dist/index.d.mts +2484 -0
- package/dist/index.d.ts +2484 -0
- package/dist/index.js +6065 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4412 -0
- package/dist/index.mjs.map +1 -0
- package/dist/theme/index.d.mts +1287 -0
- package/dist/theme/index.d.ts +1287 -0
- package/dist/theme/index.js +1522 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/index.mjs +3 -0
- package/dist/theme/index.mjs.map +1 -0
- package/package.json +116 -0
- package/tailwind.config.js +195 -0
|
@@ -0,0 +1,1522 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var reactNative = require('react-native');
|
|
4
|
+
|
|
5
|
+
// src/theme/tokens/primitives.ts
|
|
6
|
+
var primitiveColors = {
|
|
7
|
+
// Blue scale (primary brand)
|
|
8
|
+
blue: {
|
|
9
|
+
50: "#EFF6FF",
|
|
10
|
+
100: "#DBEAFE",
|
|
11
|
+
200: "#BFDBFE",
|
|
12
|
+
300: "#93C5FD",
|
|
13
|
+
400: "#60A5FA",
|
|
14
|
+
500: "#3B82F6",
|
|
15
|
+
600: "#5048E5",
|
|
16
|
+
// Primary main
|
|
17
|
+
700: "#3832A0",
|
|
18
|
+
// Primary dark
|
|
19
|
+
800: "#1E40AF",
|
|
20
|
+
900: "#1E3A8A"
|
|
21
|
+
},
|
|
22
|
+
// Green scale (secondary brand)
|
|
23
|
+
green: {
|
|
24
|
+
50: "#ECFDF5",
|
|
25
|
+
100: "#D1FAE5",
|
|
26
|
+
200: "#A7F3D0",
|
|
27
|
+
300: "#6EE7B7",
|
|
28
|
+
400: "#3FC79A",
|
|
29
|
+
// Secondary light
|
|
30
|
+
500: "#10B981",
|
|
31
|
+
// Secondary main
|
|
32
|
+
600: "#059669",
|
|
33
|
+
700: "#0B815A",
|
|
34
|
+
// Secondary dark
|
|
35
|
+
800: "#065F46",
|
|
36
|
+
900: "#064E3B"
|
|
37
|
+
},
|
|
38
|
+
// Teal scale (success)
|
|
39
|
+
teal: {
|
|
40
|
+
50: "#F0FDFA",
|
|
41
|
+
100: "#CCFBF1",
|
|
42
|
+
200: "#99F6E4",
|
|
43
|
+
300: "#5EEAD4",
|
|
44
|
+
400: "#43C6B7",
|
|
45
|
+
// Success light
|
|
46
|
+
500: "#14B8A6",
|
|
47
|
+
// Success main
|
|
48
|
+
600: "#0D9488",
|
|
49
|
+
700: "#0E8074",
|
|
50
|
+
// Success dark
|
|
51
|
+
800: "#115E59",
|
|
52
|
+
900: "#134E4A"
|
|
53
|
+
},
|
|
54
|
+
// Red scale (error)
|
|
55
|
+
red: {
|
|
56
|
+
50: "#FEF2F2",
|
|
57
|
+
100: "#FEE2E2",
|
|
58
|
+
200: "#FECACA",
|
|
59
|
+
300: "#FCA5A5",
|
|
60
|
+
400: "#DA6868",
|
|
61
|
+
// Error light
|
|
62
|
+
500: "#EF4444",
|
|
63
|
+
600: "#D14343",
|
|
64
|
+
// Error main
|
|
65
|
+
700: "#922E2E",
|
|
66
|
+
// Error dark
|
|
67
|
+
800: "#991B1B",
|
|
68
|
+
900: "#7F1D1D"
|
|
69
|
+
},
|
|
70
|
+
// Amber scale (warning)
|
|
71
|
+
amber: {
|
|
72
|
+
50: "#FFFBEB",
|
|
73
|
+
100: "#FEF3C7",
|
|
74
|
+
200: "#FDE68A",
|
|
75
|
+
300: "#FCD34D",
|
|
76
|
+
400: "#FFBF4C",
|
|
77
|
+
// Warning light
|
|
78
|
+
500: "#FFB020",
|
|
79
|
+
// Warning main
|
|
80
|
+
600: "#B27B16",
|
|
81
|
+
// Warning dark
|
|
82
|
+
700: "#B45309",
|
|
83
|
+
800: "#92400E",
|
|
84
|
+
900: "#78350F"
|
|
85
|
+
},
|
|
86
|
+
// Sky/Blue scale (info)
|
|
87
|
+
sky: {
|
|
88
|
+
50: "#F0F9FF",
|
|
89
|
+
100: "#E0F2FE",
|
|
90
|
+
200: "#BAE6FD",
|
|
91
|
+
300: "#7DD3FC",
|
|
92
|
+
400: "#64B6F7",
|
|
93
|
+
// Info light
|
|
94
|
+
500: "#2196F3",
|
|
95
|
+
// Info main
|
|
96
|
+
600: "#0284C7",
|
|
97
|
+
700: "#0B79D0",
|
|
98
|
+
// Info dark
|
|
99
|
+
800: "#075985",
|
|
100
|
+
900: "#0C4A6E"
|
|
101
|
+
},
|
|
102
|
+
// Neutral/Gray scale
|
|
103
|
+
neutral: {
|
|
104
|
+
50: "#FAFAFA",
|
|
105
|
+
100: "#F3F4F6",
|
|
106
|
+
200: "#E5E7EB",
|
|
107
|
+
300: "#D1D5DB",
|
|
108
|
+
400: "#9CA3AF",
|
|
109
|
+
500: "#6B7280",
|
|
110
|
+
600: "#4B5563",
|
|
111
|
+
700: "#374151",
|
|
112
|
+
800: "#1F2937",
|
|
113
|
+
900: "#111827",
|
|
114
|
+
950: "#030712"
|
|
115
|
+
},
|
|
116
|
+
// Orange scale (accent/brand color)
|
|
117
|
+
accent: {
|
|
118
|
+
100: "#FFA860",
|
|
119
|
+
200: "#FF9630",
|
|
120
|
+
300: "#FF8500",
|
|
121
|
+
400: "#FF7900",
|
|
122
|
+
500: "#F56C00",
|
|
123
|
+
600: "#E06D10",
|
|
124
|
+
700: "#D0620C",
|
|
125
|
+
800: "#B75500",
|
|
126
|
+
900: "#A34900"
|
|
127
|
+
},
|
|
128
|
+
// Charcoal scale (dark backgrounds)
|
|
129
|
+
charcoal: {
|
|
130
|
+
0: "#6E6E6E",
|
|
131
|
+
50: "#5D5D5D",
|
|
132
|
+
100: "#4C4C4C",
|
|
133
|
+
200: "#3C3C3C",
|
|
134
|
+
300: "#2C2C2C",
|
|
135
|
+
400: "#1F1F1F",
|
|
136
|
+
500: "#1C1C1C",
|
|
137
|
+
600: "#191919",
|
|
138
|
+
700: "#161616",
|
|
139
|
+
800: "#131313",
|
|
140
|
+
900: "#101010"
|
|
141
|
+
},
|
|
142
|
+
// Steel scale (cool accent)
|
|
143
|
+
steel: {
|
|
144
|
+
100: "#8AA4B8",
|
|
145
|
+
200: "#7894A8",
|
|
146
|
+
300: "#678498",
|
|
147
|
+
400: "#557488",
|
|
148
|
+
500: "#406D87",
|
|
149
|
+
600: "#39617A",
|
|
150
|
+
700: "#32556D",
|
|
151
|
+
800: "#243D53",
|
|
152
|
+
900: "#1D3146"
|
|
153
|
+
},
|
|
154
|
+
// Pure colors
|
|
155
|
+
white: "#FFFFFF",
|
|
156
|
+
black: "#000000",
|
|
157
|
+
transparent: "transparent"
|
|
158
|
+
};
|
|
159
|
+
var discreteRainbow = [
|
|
160
|
+
"#E8ECFB",
|
|
161
|
+
"#D9CCE3",
|
|
162
|
+
"#D1BBD7",
|
|
163
|
+
"#CAACCB",
|
|
164
|
+
"#BA8DB4",
|
|
165
|
+
"#AE76A3",
|
|
166
|
+
"#AA6F9E",
|
|
167
|
+
"#994F88",
|
|
168
|
+
"#882E72",
|
|
169
|
+
"#1965B0",
|
|
170
|
+
"#437DBF",
|
|
171
|
+
"#5289C7",
|
|
172
|
+
"#6195CF",
|
|
173
|
+
"#7BAFDE",
|
|
174
|
+
"#4EB265",
|
|
175
|
+
"#90C987",
|
|
176
|
+
"#CAE0AB",
|
|
177
|
+
"#F7F056",
|
|
178
|
+
"#F7CB45",
|
|
179
|
+
"#F6C141",
|
|
180
|
+
"#F4A736",
|
|
181
|
+
"#F1932D",
|
|
182
|
+
"#EE8026",
|
|
183
|
+
"#E8601C",
|
|
184
|
+
"#E65518",
|
|
185
|
+
"#DC050C",
|
|
186
|
+
"#A5170E",
|
|
187
|
+
"#72190E",
|
|
188
|
+
"#42150A"
|
|
189
|
+
];
|
|
190
|
+
var discreteRainbowPalettes = [
|
|
191
|
+
[10],
|
|
192
|
+
[10, 26],
|
|
193
|
+
[10, 18, 26],
|
|
194
|
+
[10, 15, 18, 26],
|
|
195
|
+
[10, 14, 15, 18, 26],
|
|
196
|
+
[10, 14, 15, 17, 18, 26],
|
|
197
|
+
[9, 10, 14, 15, 17, 18, 26],
|
|
198
|
+
[9, 10, 14, 15, 17, 18, 23, 26],
|
|
199
|
+
[9, 10, 14, 15, 17, 18, 23, 26, 28],
|
|
200
|
+
[9, 10, 14, 15, 17, 18, 21, 24, 26, 28],
|
|
201
|
+
[9, 10, 12, 14, 15, 17, 18, 21, 24, 26, 28],
|
|
202
|
+
[3, 6, 9, 10, 12, 14, 15, 17, 18, 21, 24, 26],
|
|
203
|
+
[3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 21, 24, 26],
|
|
204
|
+
[3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26],
|
|
205
|
+
[3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],
|
|
206
|
+
[3, 5, 7, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],
|
|
207
|
+
[3, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],
|
|
208
|
+
[3, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],
|
|
209
|
+
[2, 4, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],
|
|
210
|
+
[2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],
|
|
211
|
+
[2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28],
|
|
212
|
+
[2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28, 29],
|
|
213
|
+
[1, 2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28, 29]
|
|
214
|
+
];
|
|
215
|
+
function getDiscreteRainbowColor(index, size) {
|
|
216
|
+
index = Math.max(0, index);
|
|
217
|
+
size = Math.min(Math.max(1, size), discreteRainbowPalettes.length);
|
|
218
|
+
const palette = discreteRainbowPalettes[size - 1];
|
|
219
|
+
if (index >= palette.length) index = index % palette.length;
|
|
220
|
+
return discreteRainbow[palette[index] - 1];
|
|
221
|
+
}
|
|
222
|
+
var primitiveTypography = {
|
|
223
|
+
fontFamilies: {
|
|
224
|
+
sans: ["Inter", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Helvetica", "Arial", "sans-serif"],
|
|
225
|
+
body: ["Nunito Sans", "sans-serif"],
|
|
226
|
+
heading: ["Space Grotesk", "sans-serif"],
|
|
227
|
+
mono: ["SF Mono", "Monaco", "Inconsolata", "Fira Mono", "Droid Sans Mono", "Source Code Pro", "monospace"]
|
|
228
|
+
},
|
|
229
|
+
fontSizes: {
|
|
230
|
+
xs: "0.75rem",
|
|
231
|
+
// 12px
|
|
232
|
+
sm: "0.875rem",
|
|
233
|
+
// 14px
|
|
234
|
+
base: "1rem",
|
|
235
|
+
// 16px
|
|
236
|
+
lg: "1.125rem",
|
|
237
|
+
// 18px
|
|
238
|
+
xl: "1.5rem",
|
|
239
|
+
// 24px
|
|
240
|
+
"2xl": "2rem",
|
|
241
|
+
// 32px
|
|
242
|
+
"3xl": "2.25rem",
|
|
243
|
+
// 36px
|
|
244
|
+
"4xl": "3rem",
|
|
245
|
+
// 48px
|
|
246
|
+
"5xl": "3.5rem"
|
|
247
|
+
// 56px
|
|
248
|
+
},
|
|
249
|
+
fontWeights: {
|
|
250
|
+
normal: 400,
|
|
251
|
+
medium: 500,
|
|
252
|
+
semibold: 600,
|
|
253
|
+
bold: 700
|
|
254
|
+
},
|
|
255
|
+
lineHeights: {
|
|
256
|
+
none: 1,
|
|
257
|
+
tight: 1.375,
|
|
258
|
+
snug: 1.5,
|
|
259
|
+
normal: 1.57,
|
|
260
|
+
relaxed: 1.66,
|
|
261
|
+
loose: 1.75
|
|
262
|
+
},
|
|
263
|
+
letterSpacing: {
|
|
264
|
+
tighter: "-0.05em",
|
|
265
|
+
tight: "-0.025em",
|
|
266
|
+
normal: "0em",
|
|
267
|
+
wide: "0.025em",
|
|
268
|
+
wider: "0.05em",
|
|
269
|
+
widest: "0.5px"
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
var primitiveSpacing = {
|
|
273
|
+
0: "0",
|
|
274
|
+
px: "1px",
|
|
275
|
+
0.5: "0.125rem",
|
|
276
|
+
// 2px
|
|
277
|
+
1: "0.25rem",
|
|
278
|
+
// 4px
|
|
279
|
+
1.5: "0.375rem",
|
|
280
|
+
// 6px
|
|
281
|
+
2: "0.5rem",
|
|
282
|
+
// 8px
|
|
283
|
+
2.5: "0.625rem",
|
|
284
|
+
// 10px
|
|
285
|
+
3: "0.75rem",
|
|
286
|
+
// 12px
|
|
287
|
+
3.5: "0.875rem",
|
|
288
|
+
// 14px
|
|
289
|
+
4: "1rem",
|
|
290
|
+
// 16px
|
|
291
|
+
5: "1.25rem",
|
|
292
|
+
// 20px
|
|
293
|
+
6: "1.5rem",
|
|
294
|
+
// 24px
|
|
295
|
+
7: "1.75rem",
|
|
296
|
+
// 28px
|
|
297
|
+
8: "2rem",
|
|
298
|
+
// 32px
|
|
299
|
+
9: "2.25rem",
|
|
300
|
+
// 36px
|
|
301
|
+
10: "2.5rem",
|
|
302
|
+
// 40px
|
|
303
|
+
11: "2.75rem",
|
|
304
|
+
// 44px
|
|
305
|
+
12: "3rem",
|
|
306
|
+
// 48px
|
|
307
|
+
14: "3.5rem",
|
|
308
|
+
// 56px
|
|
309
|
+
16: "4rem",
|
|
310
|
+
// 64px
|
|
311
|
+
20: "5rem",
|
|
312
|
+
// 80px
|
|
313
|
+
24: "6rem",
|
|
314
|
+
// 96px
|
|
315
|
+
28: "7rem",
|
|
316
|
+
// 112px
|
|
317
|
+
32: "8rem"
|
|
318
|
+
// 128px
|
|
319
|
+
};
|
|
320
|
+
var primitiveBorderRadius = {
|
|
321
|
+
none: "0",
|
|
322
|
+
sm: "4px",
|
|
323
|
+
DEFAULT: "8px",
|
|
324
|
+
md: "8px",
|
|
325
|
+
lg: "12px",
|
|
326
|
+
xl: "16px",
|
|
327
|
+
"2xl": "24px",
|
|
328
|
+
full: "9999px"
|
|
329
|
+
};
|
|
330
|
+
var primitiveShadows = {
|
|
331
|
+
none: "none",
|
|
332
|
+
sm: "0px 1px 2px rgba(100, 116, 139, 0.12)",
|
|
333
|
+
DEFAULT: "0px 1px 3px rgba(100, 116, 139, 0.12), 0px 1px 2px rgba(100, 116, 139, 0.24)",
|
|
334
|
+
md: "0px 4px 6px rgba(100, 116, 139, 0.12)",
|
|
335
|
+
lg: "0px 10px 15px rgba(100, 116, 139, 0.12)",
|
|
336
|
+
xl: "0px 20px 25px rgba(100, 116, 139, 0.12)",
|
|
337
|
+
"2xl": "0px 25px 50px rgba(100, 116, 139, 0.25)",
|
|
338
|
+
inner: "inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"
|
|
339
|
+
};
|
|
340
|
+
var primitiveBreakpoints = {
|
|
341
|
+
xs: 0,
|
|
342
|
+
sm: 600,
|
|
343
|
+
md: 1e3,
|
|
344
|
+
lg: 1200,
|
|
345
|
+
xl: 1920
|
|
346
|
+
};
|
|
347
|
+
var primitiveZIndex = {
|
|
348
|
+
hide: -1,
|
|
349
|
+
auto: "auto",
|
|
350
|
+
base: 0,
|
|
351
|
+
docked: 10,
|
|
352
|
+
dropdown: 1e3,
|
|
353
|
+
sticky: 1100,
|
|
354
|
+
drawer: 1100,
|
|
355
|
+
banner: 1200,
|
|
356
|
+
appBar: 1200,
|
|
357
|
+
overlay: 1300,
|
|
358
|
+
modal: 1400,
|
|
359
|
+
popover: 1500,
|
|
360
|
+
skipLink: 1600,
|
|
361
|
+
toast: 1700,
|
|
362
|
+
tooltip: 1800
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
// src/theme/tokens/semantic.ts
|
|
366
|
+
var semanticColorsLight = {
|
|
367
|
+
// Brand colors (brand-*)
|
|
368
|
+
"brand-primary": primitiveColors.accent[400],
|
|
369
|
+
// #FF7900
|
|
370
|
+
"brand-primary-light": primitiveColors.accent[200],
|
|
371
|
+
// #FF9630
|
|
372
|
+
"brand-primary-dark": primitiveColors.accent[700],
|
|
373
|
+
// #D0620C
|
|
374
|
+
"brand-primary-subtle": "rgba(255, 121, 0, 0.08)",
|
|
375
|
+
"brand-primary-hover": primitiveColors.accent[500],
|
|
376
|
+
"brand-primary-active": primitiveColors.accent[600],
|
|
377
|
+
"brand-secondary": primitiveColors.steel[500],
|
|
378
|
+
// #406D87
|
|
379
|
+
"brand-secondary-light": primitiveColors.steel[300],
|
|
380
|
+
// #678498
|
|
381
|
+
"brand-secondary-dark": primitiveColors.steel[700],
|
|
382
|
+
// #32556D
|
|
383
|
+
"brand-secondary-subtle": "rgba(64, 109, 135, 0.08)",
|
|
384
|
+
"brand-secondary-hover": primitiveColors.steel[600],
|
|
385
|
+
"brand-secondary-active": primitiveColors.steel[700],
|
|
386
|
+
// Text on brand backgrounds (on-*)
|
|
387
|
+
"on-brand-primary": primitiveColors.white,
|
|
388
|
+
"on-brand-secondary": primitiveColors.white,
|
|
389
|
+
// Status colors (status-*)
|
|
390
|
+
"status-success": primitiveColors.teal[500],
|
|
391
|
+
// #14B8A6
|
|
392
|
+
"status-success-light": primitiveColors.teal[400],
|
|
393
|
+
// #43C6B7
|
|
394
|
+
"status-success-dark": primitiveColors.teal[700],
|
|
395
|
+
// #0E8074
|
|
396
|
+
"status-success-subtle": primitiveColors.teal[50],
|
|
397
|
+
"status-error": primitiveColors.red[600],
|
|
398
|
+
// #D14343
|
|
399
|
+
"status-error-light": primitiveColors.red[400],
|
|
400
|
+
// #DA6868
|
|
401
|
+
"status-error-dark": primitiveColors.red[700],
|
|
402
|
+
// #922E2E
|
|
403
|
+
"status-error-subtle": primitiveColors.red[50],
|
|
404
|
+
"status-warning": primitiveColors.amber[500],
|
|
405
|
+
// #FFB020
|
|
406
|
+
"status-warning-light": primitiveColors.amber[400],
|
|
407
|
+
// #FFBF4C
|
|
408
|
+
"status-warning-dark": primitiveColors.amber[600],
|
|
409
|
+
// #B27B16
|
|
410
|
+
"status-warning-subtle": primitiveColors.amber[50],
|
|
411
|
+
"status-info": primitiveColors.sky[500],
|
|
412
|
+
// #2196F3
|
|
413
|
+
"status-info-light": primitiveColors.sky[400],
|
|
414
|
+
// #64B6F7
|
|
415
|
+
"status-info-dark": primitiveColors.sky[700],
|
|
416
|
+
// #0B79D0
|
|
417
|
+
"status-info-subtle": primitiveColors.sky[50],
|
|
418
|
+
// Text on status backgrounds (on-status-*)
|
|
419
|
+
"on-status-success": primitiveColors.white,
|
|
420
|
+
"on-status-error": primitiveColors.white,
|
|
421
|
+
"on-status-warning": primitiveColors.white,
|
|
422
|
+
"on-status-info": primitiveColors.white,
|
|
423
|
+
// Result/outcome indicators (result-*)
|
|
424
|
+
"result-improve": "#4caf50",
|
|
425
|
+
// Green - positive outcome
|
|
426
|
+
"result-improve-light": "rgba(76, 175, 80, 0.12)",
|
|
427
|
+
"result-improve-dark": "#248a24",
|
|
428
|
+
"result-degrade": "#ef5350",
|
|
429
|
+
// Red - negative outcome
|
|
430
|
+
"result-degrade-light": "rgba(239, 83, 80, 0.12)",
|
|
431
|
+
"result-degrade-dark": "#b30000",
|
|
432
|
+
"result-inconclusive": "#9E9A97",
|
|
433
|
+
// Gray - no clear result
|
|
434
|
+
"result-inconclusive-light": "rgba(158, 154, 151, 0.12)",
|
|
435
|
+
"result-neutral": primitiveColors.neutral[500],
|
|
436
|
+
// Neutral baseline
|
|
437
|
+
// Text on result backgrounds (on-result-*)
|
|
438
|
+
"on-result-improve": primitiveColors.white,
|
|
439
|
+
"on-result-degrade": primitiveColors.white,
|
|
440
|
+
"on-result-inconclusive": primitiveColors.white,
|
|
441
|
+
// Data visualization colors (data-*)
|
|
442
|
+
// First 10 colors from discrete rainbow optimized for charts
|
|
443
|
+
"data-1": discreteRainbow[9],
|
|
444
|
+
// #1965B0 - Blue
|
|
445
|
+
"data-2": discreteRainbow[14],
|
|
446
|
+
// #4EB265 - Green
|
|
447
|
+
"data-3": discreteRainbow[17],
|
|
448
|
+
// #F7F056 - Yellow
|
|
449
|
+
"data-4": discreteRainbow[25],
|
|
450
|
+
// #DC050C - Red
|
|
451
|
+
"data-5": discreteRainbow[8],
|
|
452
|
+
// #882E72 - Purple
|
|
453
|
+
"data-6": discreteRainbow[20],
|
|
454
|
+
// #F4A736 - Orange
|
|
455
|
+
"data-7": discreteRainbow[13],
|
|
456
|
+
// #7BAFDE - Light Blue
|
|
457
|
+
"data-8": discreteRainbow[15],
|
|
458
|
+
// #90C987 - Light Green
|
|
459
|
+
"data-9": discreteRainbow[3],
|
|
460
|
+
// #CAACCB - Lavender
|
|
461
|
+
"data-10": discreteRainbow[22],
|
|
462
|
+
// #EE8026 - Dark Orange
|
|
463
|
+
// Text colors (text-*)
|
|
464
|
+
"text-primary": "#121828",
|
|
465
|
+
"text-secondary": "#65748B",
|
|
466
|
+
"text-tertiary": primitiveColors.neutral[400],
|
|
467
|
+
"text-disabled": "rgba(55, 65, 81, 0.48)",
|
|
468
|
+
"text-inverse": primitiveColors.white,
|
|
469
|
+
"text-link": primitiveColors.blue[600],
|
|
470
|
+
"text-link-hover": primitiveColors.blue[700],
|
|
471
|
+
// Surface colors (surface-*) - for elevated containers
|
|
472
|
+
"surface-base": primitiveColors.white,
|
|
473
|
+
"surface-elevated": primitiveColors.neutral[50],
|
|
474
|
+
// #FAFAFA - slightly off-white for elevated cards
|
|
475
|
+
"surface-raised": primitiveColors.neutral[100],
|
|
476
|
+
// #F3F4F6 - light gray for raised cards
|
|
477
|
+
"surface-overlay": primitiveColors.white,
|
|
478
|
+
"surface-input": primitiveColors.neutral[50],
|
|
479
|
+
// Input field background (filled variant)
|
|
480
|
+
// Background colors (background-*)
|
|
481
|
+
"background-base": "#EBEBEB",
|
|
482
|
+
"background-default": primitiveColors.white,
|
|
483
|
+
"background-subtle": primitiveColors.neutral[50],
|
|
484
|
+
// Border colors (border-*)
|
|
485
|
+
"border-default": "#E8E9EB",
|
|
486
|
+
"border-subtle": primitiveColors.neutral[100],
|
|
487
|
+
"border-strong": primitiveColors.neutral[300],
|
|
488
|
+
"border-focus": primitiveColors.blue[600],
|
|
489
|
+
"border-input": primitiveColors.neutral[300],
|
|
490
|
+
// Input field border
|
|
491
|
+
"border-input-hover": primitiveColors.neutral[400],
|
|
492
|
+
// Input field border on hover
|
|
493
|
+
"border-input-focus": primitiveColors.blue[600],
|
|
494
|
+
// Input field border on focus
|
|
495
|
+
"border-input-error": primitiveColors.red[600],
|
|
496
|
+
// Input field border on error
|
|
497
|
+
// Interactive states (interactive-*)
|
|
498
|
+
"interactive-hover": "rgba(55, 65, 81, 0.04)",
|
|
499
|
+
"interactive-focus": "rgba(55, 65, 81, 0.12)",
|
|
500
|
+
"interactive-active": "rgba(55, 65, 81, 0.16)",
|
|
501
|
+
"interactive-selected": "rgba(55, 65, 81, 0.08)",
|
|
502
|
+
"interactive-disabled": "rgba(55, 65, 81, 0.12)",
|
|
503
|
+
"interactive-disabled-text": "rgba(55, 65, 81, 0.26)",
|
|
504
|
+
// Divider
|
|
505
|
+
"divider": "#E8E9EB",
|
|
506
|
+
// Avatar default
|
|
507
|
+
"avatar-background": primitiveColors.neutral[500],
|
|
508
|
+
"avatar-text": primitiveColors.white
|
|
509
|
+
};
|
|
510
|
+
var semanticColorsDark = {
|
|
511
|
+
// Brand colors stay the same in dark mode
|
|
512
|
+
"brand-primary": primitiveColors.accent[400],
|
|
513
|
+
"brand-primary-light": primitiveColors.accent[200],
|
|
514
|
+
"brand-primary-dark": primitiveColors.accent[700],
|
|
515
|
+
"brand-primary-subtle": "rgba(255, 121, 0, 0.12)",
|
|
516
|
+
"brand-primary-hover": primitiveColors.accent[300],
|
|
517
|
+
"brand-primary-active": primitiveColors.accent[200],
|
|
518
|
+
"brand-secondary": primitiveColors.steel[500],
|
|
519
|
+
"brand-secondary-light": primitiveColors.steel[300],
|
|
520
|
+
"brand-secondary-dark": primitiveColors.steel[700],
|
|
521
|
+
"brand-secondary-subtle": "rgba(64, 109, 135, 0.12)",
|
|
522
|
+
"brand-secondary-hover": primitiveColors.steel[400],
|
|
523
|
+
"brand-secondary-active": primitiveColors.steel[300],
|
|
524
|
+
// Text on brand backgrounds
|
|
525
|
+
"on-brand-primary": primitiveColors.white,
|
|
526
|
+
"on-brand-secondary": primitiveColors.white,
|
|
527
|
+
// Status colors
|
|
528
|
+
"status-success": primitiveColors.teal[500],
|
|
529
|
+
"status-success-light": primitiveColors.teal[400],
|
|
530
|
+
"status-success-dark": primitiveColors.teal[700],
|
|
531
|
+
"status-success-subtle": "rgba(20, 184, 166, 0.12)",
|
|
532
|
+
"status-error": primitiveColors.red[600],
|
|
533
|
+
"status-error-light": primitiveColors.red[400],
|
|
534
|
+
"status-error-dark": primitiveColors.red[700],
|
|
535
|
+
"status-error-subtle": "rgba(209, 67, 67, 0.12)",
|
|
536
|
+
"status-warning": primitiveColors.amber[500],
|
|
537
|
+
"status-warning-light": primitiveColors.amber[400],
|
|
538
|
+
"status-warning-dark": primitiveColors.amber[600],
|
|
539
|
+
"status-warning-subtle": "rgba(255, 176, 32, 0.12)",
|
|
540
|
+
"status-info": primitiveColors.sky[500],
|
|
541
|
+
"status-info-light": primitiveColors.sky[400],
|
|
542
|
+
"status-info-dark": primitiveColors.sky[700],
|
|
543
|
+
"status-info-subtle": "rgba(33, 150, 243, 0.12)",
|
|
544
|
+
// Text on status backgrounds
|
|
545
|
+
"on-status-success": primitiveColors.white,
|
|
546
|
+
"on-status-error": primitiveColors.white,
|
|
547
|
+
"on-status-warning": primitiveColors.white,
|
|
548
|
+
"on-status-info": primitiveColors.white,
|
|
549
|
+
// Result/outcome indicators (result-*)
|
|
550
|
+
"result-improve": "#4caf50",
|
|
551
|
+
"result-improve-light": "rgba(76, 175, 80, 0.16)",
|
|
552
|
+
"result-improve-dark": "#248a24",
|
|
553
|
+
"result-degrade": "#ef5350",
|
|
554
|
+
"result-degrade-light": "rgba(239, 83, 80, 0.16)",
|
|
555
|
+
"result-degrade-dark": "#b30000",
|
|
556
|
+
"result-inconclusive": "#9E9A97",
|
|
557
|
+
"result-inconclusive-light": "rgba(158, 154, 151, 0.16)",
|
|
558
|
+
"result-neutral": primitiveColors.neutral[400],
|
|
559
|
+
// Text on result backgrounds
|
|
560
|
+
"on-result-improve": primitiveColors.white,
|
|
561
|
+
"on-result-degrade": primitiveColors.white,
|
|
562
|
+
"on-result-inconclusive": primitiveColors.white,
|
|
563
|
+
// Data visualization colors (same in dark mode for consistency)
|
|
564
|
+
"data-1": discreteRainbow[9],
|
|
565
|
+
"data-2": discreteRainbow[14],
|
|
566
|
+
"data-3": discreteRainbow[17],
|
|
567
|
+
"data-4": discreteRainbow[25],
|
|
568
|
+
"data-5": discreteRainbow[8],
|
|
569
|
+
"data-6": discreteRainbow[20],
|
|
570
|
+
"data-7": discreteRainbow[13],
|
|
571
|
+
"data-8": discreteRainbow[15],
|
|
572
|
+
"data-9": discreteRainbow[3],
|
|
573
|
+
"data-10": discreteRainbow[22],
|
|
574
|
+
// Text colors - inverted for dark mode
|
|
575
|
+
"text-primary": primitiveColors.neutral[100],
|
|
576
|
+
"text-secondary": primitiveColors.neutral[400],
|
|
577
|
+
"text-tertiary": primitiveColors.neutral[500],
|
|
578
|
+
"text-disabled": "rgba(255, 255, 255, 0.38)",
|
|
579
|
+
"text-inverse": primitiveColors.neutral[900],
|
|
580
|
+
"text-link": "#828DF8",
|
|
581
|
+
"text-link-hover": primitiveColors.blue[400],
|
|
582
|
+
// Surface colors - dark backgrounds
|
|
583
|
+
"surface-base": primitiveColors.charcoal[700],
|
|
584
|
+
// #161616 - main surface
|
|
585
|
+
"surface-elevated": primitiveColors.charcoal[600],
|
|
586
|
+
// #191919 - elevated surface
|
|
587
|
+
"surface-raised": primitiveColors.charcoal[500],
|
|
588
|
+
// #1C1C1C - raised surface
|
|
589
|
+
"surface-overlay": primitiveColors.charcoal[600],
|
|
590
|
+
// #191919 - overlay surface
|
|
591
|
+
"surface-input": primitiveColors.charcoal[600],
|
|
592
|
+
// #191919 - input surface
|
|
593
|
+
// Background colors
|
|
594
|
+
"background-base": primitiveColors.charcoal[900],
|
|
595
|
+
// #101010 - darkest charcoal
|
|
596
|
+
"background-default": primitiveColors.charcoal[700],
|
|
597
|
+
// #161616 - main background
|
|
598
|
+
"background-subtle": primitiveColors.charcoal[500],
|
|
599
|
+
// #1C1C1C - subtle background
|
|
600
|
+
// Border colors
|
|
601
|
+
"border-default": primitiveColors.charcoal[400],
|
|
602
|
+
// #1F1F1F - default border
|
|
603
|
+
"border-subtle": primitiveColors.charcoal[500],
|
|
604
|
+
// #1C1C1C - subtle border
|
|
605
|
+
"border-strong": primitiveColors.charcoal[300],
|
|
606
|
+
// #2C2C2C - strong border
|
|
607
|
+
"border-focus": "#828DF8",
|
|
608
|
+
"border-input": primitiveColors.neutral[600],
|
|
609
|
+
"border-input-hover": primitiveColors.neutral[500],
|
|
610
|
+
"border-input-focus": "#828DF8",
|
|
611
|
+
"border-input-error": primitiveColors.red[500],
|
|
612
|
+
// Interactive states
|
|
613
|
+
"interactive-hover": "rgba(255, 255, 255, 0.04)",
|
|
614
|
+
"interactive-focus": "rgba(255, 255, 255, 0.12)",
|
|
615
|
+
"interactive-active": "rgba(255, 255, 255, 0.16)",
|
|
616
|
+
"interactive-selected": "rgba(255, 255, 255, 0.08)",
|
|
617
|
+
"interactive-disabled": "rgba(255, 255, 255, 0.12)",
|
|
618
|
+
"interactive-disabled-text": "rgba(255, 255, 255, 0.26)",
|
|
619
|
+
// Divider
|
|
620
|
+
"divider": primitiveColors.charcoal[400],
|
|
621
|
+
// #1F1F1F - divider color
|
|
622
|
+
// Avatar default
|
|
623
|
+
"avatar-background": primitiveColors.neutral[600],
|
|
624
|
+
"avatar-text": primitiveColors.white
|
|
625
|
+
};
|
|
626
|
+
var semanticTypography = {
|
|
627
|
+
// Headings (Space Grotesk)
|
|
628
|
+
h1: {
|
|
629
|
+
fontFamily: "heading",
|
|
630
|
+
fontSize: "3.5rem",
|
|
631
|
+
fontWeight: 700,
|
|
632
|
+
lineHeight: 1.375
|
|
633
|
+
},
|
|
634
|
+
h2: {
|
|
635
|
+
fontFamily: "heading",
|
|
636
|
+
fontSize: "3rem",
|
|
637
|
+
fontWeight: 700,
|
|
638
|
+
lineHeight: 1.375
|
|
639
|
+
},
|
|
640
|
+
h3: {
|
|
641
|
+
fontFamily: "heading",
|
|
642
|
+
fontSize: "2.25rem",
|
|
643
|
+
fontWeight: 700,
|
|
644
|
+
lineHeight: 1.375
|
|
645
|
+
},
|
|
646
|
+
h4: {
|
|
647
|
+
fontFamily: "heading",
|
|
648
|
+
fontSize: "2rem",
|
|
649
|
+
fontWeight: 700,
|
|
650
|
+
lineHeight: 1.375
|
|
651
|
+
},
|
|
652
|
+
h5: {
|
|
653
|
+
fontFamily: "heading",
|
|
654
|
+
fontSize: "1.5rem",
|
|
655
|
+
fontWeight: 600,
|
|
656
|
+
lineHeight: 1.375
|
|
657
|
+
},
|
|
658
|
+
h6: {
|
|
659
|
+
fontFamily: "heading",
|
|
660
|
+
fontSize: "1.125rem",
|
|
661
|
+
fontWeight: 600,
|
|
662
|
+
lineHeight: 1.375
|
|
663
|
+
},
|
|
664
|
+
// Body text (Nunito Sans)
|
|
665
|
+
body1: {
|
|
666
|
+
fontFamily: "body",
|
|
667
|
+
fontSize: "1rem",
|
|
668
|
+
fontWeight: 400,
|
|
669
|
+
lineHeight: 1.5
|
|
670
|
+
},
|
|
671
|
+
body2: {
|
|
672
|
+
fontFamily: "body",
|
|
673
|
+
fontSize: "0.875rem",
|
|
674
|
+
fontWeight: 400,
|
|
675
|
+
lineHeight: 1.57
|
|
676
|
+
},
|
|
677
|
+
subtitle1: {
|
|
678
|
+
fontFamily: "body",
|
|
679
|
+
fontSize: "1rem",
|
|
680
|
+
fontWeight: 500,
|
|
681
|
+
lineHeight: 1.75
|
|
682
|
+
},
|
|
683
|
+
subtitle2: {
|
|
684
|
+
fontFamily: "body",
|
|
685
|
+
fontSize: "0.875rem",
|
|
686
|
+
fontWeight: 500,
|
|
687
|
+
lineHeight: 1.57
|
|
688
|
+
},
|
|
689
|
+
caption: {
|
|
690
|
+
fontFamily: "body",
|
|
691
|
+
fontSize: "0.75rem",
|
|
692
|
+
fontWeight: 400,
|
|
693
|
+
lineHeight: 1.66
|
|
694
|
+
},
|
|
695
|
+
overline: {
|
|
696
|
+
fontFamily: "body",
|
|
697
|
+
fontSize: "0.75rem",
|
|
698
|
+
fontWeight: 600,
|
|
699
|
+
lineHeight: 2.5,
|
|
700
|
+
letterSpacing: "0.5px",
|
|
701
|
+
textTransform: "uppercase"
|
|
702
|
+
},
|
|
703
|
+
button: {
|
|
704
|
+
fontFamily: "sans",
|
|
705
|
+
fontSize: "0.875rem",
|
|
706
|
+
fontWeight: 600,
|
|
707
|
+
lineHeight: 1.75
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
var buttonSizes = {
|
|
711
|
+
sm: {
|
|
712
|
+
paddingX: "16px",
|
|
713
|
+
paddingY: "6px",
|
|
714
|
+
fontSize: "0.875rem"
|
|
715
|
+
},
|
|
716
|
+
md: {
|
|
717
|
+
paddingX: "20px",
|
|
718
|
+
paddingY: "8px",
|
|
719
|
+
fontSize: "0.875rem"
|
|
720
|
+
},
|
|
721
|
+
lg: {
|
|
722
|
+
paddingX: "24px",
|
|
723
|
+
paddingY: "11px",
|
|
724
|
+
fontSize: "1rem"
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
function getSemanticColors(mode) {
|
|
728
|
+
return mode === "dark" ? semanticColorsDark : semanticColorsLight;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
// src/theme/config.ts
|
|
732
|
+
var lightThemeCSSVars = {
|
|
733
|
+
"--color-brand-primary": semanticColorsLight["brand-primary"],
|
|
734
|
+
"--color-brand-primary-light": semanticColorsLight["brand-primary-light"],
|
|
735
|
+
"--color-brand-primary-dark": semanticColorsLight["brand-primary-dark"],
|
|
736
|
+
"--color-brand-primary-subtle": semanticColorsLight["brand-primary-subtle"],
|
|
737
|
+
"--color-brand-secondary": semanticColorsLight["brand-secondary"],
|
|
738
|
+
"--color-brand-secondary-light": semanticColorsLight["brand-secondary-light"],
|
|
739
|
+
"--color-brand-secondary-dark": semanticColorsLight["brand-secondary-dark"],
|
|
740
|
+
"--color-brand-secondary-subtle": semanticColorsLight["brand-secondary-subtle"],
|
|
741
|
+
"--color-on-brand-primary": semanticColorsLight["on-brand-primary"],
|
|
742
|
+
"--color-on-brand-secondary": semanticColorsLight["on-brand-secondary"],
|
|
743
|
+
"--color-status-success": semanticColorsLight["status-success"],
|
|
744
|
+
"--color-status-success-subtle": semanticColorsLight["status-success-subtle"],
|
|
745
|
+
"--color-status-error": semanticColorsLight["status-error"],
|
|
746
|
+
"--color-status-error-subtle": semanticColorsLight["status-error-subtle"],
|
|
747
|
+
"--color-status-warning": semanticColorsLight["status-warning"],
|
|
748
|
+
"--color-status-warning-subtle": semanticColorsLight["status-warning-subtle"],
|
|
749
|
+
"--color-status-info": semanticColorsLight["status-info"],
|
|
750
|
+
"--color-status-info-subtle": semanticColorsLight["status-info-subtle"],
|
|
751
|
+
"--color-text-primary": semanticColorsLight["text-primary"],
|
|
752
|
+
"--color-text-secondary": semanticColorsLight["text-secondary"],
|
|
753
|
+
"--color-text-tertiary": semanticColorsLight["text-tertiary"],
|
|
754
|
+
"--color-text-disabled": semanticColorsLight["text-disabled"],
|
|
755
|
+
"--color-text-inverse": semanticColorsLight["text-inverse"],
|
|
756
|
+
"--color-text-link": semanticColorsLight["text-link"],
|
|
757
|
+
"--color-surface-base": semanticColorsLight["surface-base"],
|
|
758
|
+
"--color-surface-elevated": semanticColorsLight["surface-elevated"],
|
|
759
|
+
"--color-surface-raised": semanticColorsLight["surface-raised"],
|
|
760
|
+
"--color-background-base": semanticColorsLight["background-base"],
|
|
761
|
+
"--color-background-default": semanticColorsLight["background-default"],
|
|
762
|
+
"--color-background-subtle": semanticColorsLight["background-subtle"],
|
|
763
|
+
"--color-border-default": semanticColorsLight["border-default"],
|
|
764
|
+
"--color-border-subtle": semanticColorsLight["border-subtle"],
|
|
765
|
+
"--color-border-strong": semanticColorsLight["border-strong"],
|
|
766
|
+
"--color-border-focus": semanticColorsLight["border-focus"],
|
|
767
|
+
"--color-interactive-hover": semanticColorsLight["interactive-hover"],
|
|
768
|
+
"--color-interactive-focus": semanticColorsLight["interactive-focus"],
|
|
769
|
+
"--color-interactive-active": semanticColorsLight["interactive-active"],
|
|
770
|
+
"--color-interactive-selected": semanticColorsLight["interactive-selected"],
|
|
771
|
+
"--color-interactive-disabled": semanticColorsLight["interactive-disabled"],
|
|
772
|
+
"--color-divider": semanticColorsLight["divider"]
|
|
773
|
+
};
|
|
774
|
+
var darkThemeCSSVars = {
|
|
775
|
+
"--color-brand-primary": semanticColorsDark["brand-primary"],
|
|
776
|
+
"--color-brand-primary-light": semanticColorsDark["brand-primary-light"],
|
|
777
|
+
"--color-brand-primary-dark": semanticColorsDark["brand-primary-dark"],
|
|
778
|
+
"--color-brand-primary-subtle": semanticColorsDark["brand-primary-subtle"],
|
|
779
|
+
"--color-brand-secondary": semanticColorsDark["brand-secondary"],
|
|
780
|
+
"--color-brand-secondary-light": semanticColorsDark["brand-secondary-light"],
|
|
781
|
+
"--color-brand-secondary-dark": semanticColorsDark["brand-secondary-dark"],
|
|
782
|
+
"--color-brand-secondary-subtle": semanticColorsDark["brand-secondary-subtle"],
|
|
783
|
+
"--color-on-brand-primary": semanticColorsDark["on-brand-primary"],
|
|
784
|
+
"--color-on-brand-secondary": semanticColorsDark["on-brand-secondary"],
|
|
785
|
+
"--color-status-success": semanticColorsDark["status-success"],
|
|
786
|
+
"--color-status-success-subtle": semanticColorsDark["status-success-subtle"],
|
|
787
|
+
"--color-status-error": semanticColorsDark["status-error"],
|
|
788
|
+
"--color-status-error-subtle": semanticColorsDark["status-error-subtle"],
|
|
789
|
+
"--color-status-warning": semanticColorsDark["status-warning"],
|
|
790
|
+
"--color-status-warning-subtle": semanticColorsDark["status-warning-subtle"],
|
|
791
|
+
"--color-status-info": semanticColorsDark["status-info"],
|
|
792
|
+
"--color-status-info-subtle": semanticColorsDark["status-info-subtle"],
|
|
793
|
+
"--color-text-primary": semanticColorsDark["text-primary"],
|
|
794
|
+
"--color-text-secondary": semanticColorsDark["text-secondary"],
|
|
795
|
+
"--color-text-tertiary": semanticColorsDark["text-tertiary"],
|
|
796
|
+
"--color-text-disabled": semanticColorsDark["text-disabled"],
|
|
797
|
+
"--color-text-inverse": semanticColorsDark["text-inverse"],
|
|
798
|
+
"--color-text-link": semanticColorsDark["text-link"],
|
|
799
|
+
"--color-surface-base": semanticColorsDark["surface-base"],
|
|
800
|
+
"--color-surface-elevated": semanticColorsDark["surface-elevated"],
|
|
801
|
+
"--color-surface-raised": semanticColorsDark["surface-raised"],
|
|
802
|
+
"--color-background-base": semanticColorsDark["background-base"],
|
|
803
|
+
"--color-background-default": semanticColorsDark["background-default"],
|
|
804
|
+
"--color-background-subtle": semanticColorsDark["background-subtle"],
|
|
805
|
+
"--color-border-default": semanticColorsDark["border-default"],
|
|
806
|
+
"--color-border-subtle": semanticColorsDark["border-subtle"],
|
|
807
|
+
"--color-border-strong": semanticColorsDark["border-strong"],
|
|
808
|
+
"--color-border-focus": semanticColorsDark["border-focus"],
|
|
809
|
+
"--color-interactive-hover": semanticColorsDark["interactive-hover"],
|
|
810
|
+
"--color-interactive-focus": semanticColorsDark["interactive-focus"],
|
|
811
|
+
"--color-interactive-active": semanticColorsDark["interactive-active"],
|
|
812
|
+
"--color-interactive-selected": semanticColorsDark["interactive-selected"],
|
|
813
|
+
"--color-interactive-disabled": semanticColorsDark["interactive-disabled"],
|
|
814
|
+
"--color-divider": semanticColorsDark["divider"]
|
|
815
|
+
};
|
|
816
|
+
function getThemeCSSVars(mode) {
|
|
817
|
+
return mode === "dark" ? darkThemeCSSVars : lightThemeCSSVars;
|
|
818
|
+
}
|
|
819
|
+
var gluestackConfig = {
|
|
820
|
+
tokens: {
|
|
821
|
+
colors: {
|
|
822
|
+
// Map to our semantic colors via CSS vars
|
|
823
|
+
primary500: "var(--color-brand-primary)",
|
|
824
|
+
primary600: "var(--color-brand-primary-dark)",
|
|
825
|
+
primary400: "var(--color-brand-primary-light)",
|
|
826
|
+
secondary500: "var(--color-brand-secondary)",
|
|
827
|
+
secondary600: "var(--color-brand-secondary-dark)",
|
|
828
|
+
secondary400: "var(--color-brand-secondary-light)",
|
|
829
|
+
success500: "var(--color-status-success)",
|
|
830
|
+
error500: "var(--color-status-error)",
|
|
831
|
+
warning500: "var(--color-status-warning)",
|
|
832
|
+
info500: "var(--color-status-info)",
|
|
833
|
+
textLight: "var(--color-text-primary)",
|
|
834
|
+
textDark: "var(--color-text-inverse)",
|
|
835
|
+
backgroundLight: "var(--color-background-default)",
|
|
836
|
+
backgroundDark: "var(--color-surface-base)"
|
|
837
|
+
},
|
|
838
|
+
space: {
|
|
839
|
+
"0": 0,
|
|
840
|
+
"1": 4,
|
|
841
|
+
"2": 8,
|
|
842
|
+
"3": 12,
|
|
843
|
+
"4": 16,
|
|
844
|
+
"5": 20,
|
|
845
|
+
"6": 24,
|
|
846
|
+
"8": 32,
|
|
847
|
+
"10": 40,
|
|
848
|
+
"12": 48,
|
|
849
|
+
"16": 64,
|
|
850
|
+
"20": 80,
|
|
851
|
+
"24": 96
|
|
852
|
+
},
|
|
853
|
+
radii: {
|
|
854
|
+
none: 0,
|
|
855
|
+
sm: 4,
|
|
856
|
+
md: 8,
|
|
857
|
+
lg: 12,
|
|
858
|
+
xl: 16,
|
|
859
|
+
"2xl": 24,
|
|
860
|
+
full: 9999
|
|
861
|
+
},
|
|
862
|
+
fontSizes: {
|
|
863
|
+
xs: 12,
|
|
864
|
+
sm: 14,
|
|
865
|
+
md: 16,
|
|
866
|
+
lg: 18,
|
|
867
|
+
xl: 20,
|
|
868
|
+
"2xl": 24,
|
|
869
|
+
"3xl": 30,
|
|
870
|
+
"4xl": 36,
|
|
871
|
+
"5xl": 48
|
|
872
|
+
}
|
|
873
|
+
},
|
|
874
|
+
aliases: {
|
|
875
|
+
bg: "backgroundColor",
|
|
876
|
+
p: "padding",
|
|
877
|
+
px: "paddingHorizontal",
|
|
878
|
+
py: "paddingVertical",
|
|
879
|
+
m: "margin",
|
|
880
|
+
mx: "marginHorizontal",
|
|
881
|
+
my: "marginVertical",
|
|
882
|
+
h: "height",
|
|
883
|
+
w: "width",
|
|
884
|
+
rounded: "borderRadius"
|
|
885
|
+
}
|
|
886
|
+
};
|
|
887
|
+
function hexToRgb(hex) {
|
|
888
|
+
const cleaned = hex.replace("#", "");
|
|
889
|
+
let r, g, b;
|
|
890
|
+
if (cleaned.length === 3) {
|
|
891
|
+
r = parseInt(cleaned[0] + cleaned[0], 16);
|
|
892
|
+
g = parseInt(cleaned[1] + cleaned[1], 16);
|
|
893
|
+
b = parseInt(cleaned[2] + cleaned[2], 16);
|
|
894
|
+
} else if (cleaned.length === 6) {
|
|
895
|
+
r = parseInt(cleaned.slice(0, 2), 16);
|
|
896
|
+
g = parseInt(cleaned.slice(2, 4), 16);
|
|
897
|
+
b = parseInt(cleaned.slice(4, 6), 16);
|
|
898
|
+
} else {
|
|
899
|
+
return null;
|
|
900
|
+
}
|
|
901
|
+
return { r, g, b };
|
|
902
|
+
}
|
|
903
|
+
function rgbToHsv(r, g, b) {
|
|
904
|
+
const rNorm = r / 255;
|
|
905
|
+
const gNorm = g / 255;
|
|
906
|
+
const bNorm = b / 255;
|
|
907
|
+
const max = Math.max(rNorm, gNorm, bNorm);
|
|
908
|
+
const min = Math.min(rNorm, gNorm, bNorm);
|
|
909
|
+
const delta = max - min;
|
|
910
|
+
const v = max;
|
|
911
|
+
const s = max === 0 ? 0 : delta / max;
|
|
912
|
+
let h = 0;
|
|
913
|
+
if (delta !== 0) {
|
|
914
|
+
if (max === rNorm) {
|
|
915
|
+
h = 60 * ((gNorm - bNorm) / delta % 6);
|
|
916
|
+
} else if (max === gNorm) {
|
|
917
|
+
h = 60 * ((bNorm - rNorm) / delta + 2);
|
|
918
|
+
} else {
|
|
919
|
+
h = 60 * ((rNorm - gNorm) / delta + 4);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
if (h < 0) h += 360;
|
|
923
|
+
return { h, s, v };
|
|
924
|
+
}
|
|
925
|
+
function hsvToRgb(h, s, v) {
|
|
926
|
+
const c = v * s;
|
|
927
|
+
const x = c * (1 - Math.abs(h / 60 % 2 - 1));
|
|
928
|
+
const m = v - c;
|
|
929
|
+
let rPrime = 0, gPrime = 0, bPrime = 0;
|
|
930
|
+
if (h >= 0 && h < 60) {
|
|
931
|
+
rPrime = c;
|
|
932
|
+
gPrime = x;
|
|
933
|
+
bPrime = 0;
|
|
934
|
+
} else if (h >= 60 && h < 120) {
|
|
935
|
+
rPrime = x;
|
|
936
|
+
gPrime = c;
|
|
937
|
+
bPrime = 0;
|
|
938
|
+
} else if (h >= 120 && h < 180) {
|
|
939
|
+
rPrime = 0;
|
|
940
|
+
gPrime = c;
|
|
941
|
+
bPrime = x;
|
|
942
|
+
} else if (h >= 180 && h < 240) {
|
|
943
|
+
rPrime = 0;
|
|
944
|
+
gPrime = x;
|
|
945
|
+
bPrime = c;
|
|
946
|
+
} else if (h >= 240 && h < 300) {
|
|
947
|
+
rPrime = x;
|
|
948
|
+
gPrime = 0;
|
|
949
|
+
bPrime = c;
|
|
950
|
+
} else {
|
|
951
|
+
rPrime = c;
|
|
952
|
+
gPrime = 0;
|
|
953
|
+
bPrime = x;
|
|
954
|
+
}
|
|
955
|
+
return {
|
|
956
|
+
r: Math.round((rPrime + m) * 255),
|
|
957
|
+
g: Math.round((gPrime + m) * 255),
|
|
958
|
+
b: Math.round((bPrime + m) * 255)
|
|
959
|
+
};
|
|
960
|
+
}
|
|
961
|
+
function rgbToHex(r, g, b) {
|
|
962
|
+
const toHex = (n) => {
|
|
963
|
+
const clamped = Math.max(0, Math.min(255, Math.round(n)));
|
|
964
|
+
return clamped.toString(16).padStart(2, "0");
|
|
965
|
+
};
|
|
966
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
967
|
+
}
|
|
968
|
+
function lighten(hex, amount = 0.1) {
|
|
969
|
+
const rgb = hexToRgb(hex);
|
|
970
|
+
if (!rgb) return hex;
|
|
971
|
+
const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b);
|
|
972
|
+
const newV = Math.min(1, hsv.v + amount);
|
|
973
|
+
const newRgb = hsvToRgb(hsv.h, hsv.s, newV);
|
|
974
|
+
return rgbToHex(newRgb.r, newRgb.g, newRgb.b);
|
|
975
|
+
}
|
|
976
|
+
function darken(hex, amount = 0.1) {
|
|
977
|
+
const rgb = hexToRgb(hex);
|
|
978
|
+
if (!rgb) return hex;
|
|
979
|
+
const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b);
|
|
980
|
+
const newV = Math.max(0, hsv.v - amount);
|
|
981
|
+
const newRgb = hsvToRgb(hsv.h, hsv.s, newV);
|
|
982
|
+
return rgbToHex(newRgb.r, newRgb.g, newRgb.b);
|
|
983
|
+
}
|
|
984
|
+
function getHoverColors(bgColor, intensity = "medium") {
|
|
985
|
+
const amounts = {
|
|
986
|
+
subtle: 0.01,
|
|
987
|
+
medium: 0.02,
|
|
988
|
+
strong: 0.03
|
|
989
|
+
};
|
|
990
|
+
const amount = amounts[intensity];
|
|
991
|
+
return {
|
|
992
|
+
raised: lighten(bgColor, amount),
|
|
993
|
+
// Raised hover: lighten (lifting up)
|
|
994
|
+
pressed: darken(bgColor, amount)
|
|
995
|
+
// Pressed hover: darken (pressing down)
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
function isDark(hex) {
|
|
999
|
+
const rgb = hexToRgb(hex);
|
|
1000
|
+
if (!rgb) return true;
|
|
1001
|
+
const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b);
|
|
1002
|
+
return hsv.v < 0.6;
|
|
1003
|
+
}
|
|
1004
|
+
var shadowColors = {
|
|
1005
|
+
// For charcoal surfaces (~#2C2C2C to #3C3C3C)
|
|
1006
|
+
charcoal: {
|
|
1007
|
+
dark: "rgba(0, 0, 0, 0.5)",
|
|
1008
|
+
light: "rgba(255, 255, 255, 0.12)",
|
|
1009
|
+
// brighter for crisp rim light
|
|
1010
|
+
darker: "rgba(0, 0, 0, 0.6)"
|
|
1011
|
+
},
|
|
1012
|
+
// For neutral dark surfaces (~#1F2937)
|
|
1013
|
+
neutralDark: {
|
|
1014
|
+
dark: "rgba(0, 0, 0, 0.4)",
|
|
1015
|
+
light: "rgba(255, 255, 255, 0.08)",
|
|
1016
|
+
darker: "rgba(0, 0, 0, 0.5)"
|
|
1017
|
+
},
|
|
1018
|
+
// For light surfaces (white/light gray backgrounds)
|
|
1019
|
+
neutralLight: {
|
|
1020
|
+
dark: "rgba(0, 0, 0, 0.15)",
|
|
1021
|
+
// Visible dark shadow for depth on light backgrounds
|
|
1022
|
+
light: "rgba(255, 255, 255, 1)",
|
|
1023
|
+
// Bright highlight for raised effect (visible on light gray)
|
|
1024
|
+
darker: "rgba(0, 0, 0, 0.2)"
|
|
1025
|
+
// Deeper shadow for pressed states
|
|
1026
|
+
}
|
|
1027
|
+
};
|
|
1028
|
+
var intensityConfig = {
|
|
1029
|
+
subtle: { offset: 1, blur: 2 },
|
|
1030
|
+
// very light, barely visible
|
|
1031
|
+
medium: { offset: 2, blur: 4 },
|
|
1032
|
+
// noticeable but restrained
|
|
1033
|
+
strong: { offset: 2, blur: 5 }
|
|
1034
|
+
// slightly deeper blur, same offset as medium
|
|
1035
|
+
};
|
|
1036
|
+
function createRaisedShadow(surface = "charcoal", intensity = "medium") {
|
|
1037
|
+
const colors = shadowColors[surface];
|
|
1038
|
+
const { offset, blur } = intensityConfig[intensity];
|
|
1039
|
+
const rimBlur = 1;
|
|
1040
|
+
return reactNative.Platform.select({
|
|
1041
|
+
web: {
|
|
1042
|
+
boxShadow: `${offset}px ${offset}px ${blur}px ${colors.dark}, -${offset}px -${offset}px ${rimBlur}px ${colors.light}`
|
|
1043
|
+
},
|
|
1044
|
+
default: {
|
|
1045
|
+
// React Native shadow approximation (limited compared to web)
|
|
1046
|
+
shadowColor: "#000",
|
|
1047
|
+
shadowOffset: { width: offset, height: offset },
|
|
1048
|
+
shadowOpacity: 0.3,
|
|
1049
|
+
shadowRadius: blur / 2,
|
|
1050
|
+
elevation: offset
|
|
1051
|
+
}
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
function createPressedShadow(surface = "charcoal", intensity = "medium") {
|
|
1055
|
+
const colors = shadowColors[surface];
|
|
1056
|
+
const { offset, blur } = intensityConfig[intensity];
|
|
1057
|
+
const rimOffset = 1;
|
|
1058
|
+
const rimBlur = 1;
|
|
1059
|
+
return reactNative.Platform.select({
|
|
1060
|
+
web: {
|
|
1061
|
+
boxShadow: `inset ${offset}px ${offset}px ${blur}px ${colors.darker}, inset -${rimOffset}px -${rimOffset}px ${rimBlur}px ${colors.light}`
|
|
1062
|
+
},
|
|
1063
|
+
default: {
|
|
1064
|
+
// React Native doesn't support inset shadows, approximate with darker bg
|
|
1065
|
+
shadowOpacity: 0,
|
|
1066
|
+
elevation: 0
|
|
1067
|
+
}
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
function createFlatShadow() {
|
|
1071
|
+
return reactNative.Platform.select({
|
|
1072
|
+
web: {
|
|
1073
|
+
boxShadow: "none"
|
|
1074
|
+
},
|
|
1075
|
+
default: {
|
|
1076
|
+
shadowOpacity: 0,
|
|
1077
|
+
elevation: 0
|
|
1078
|
+
}
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
function createRaisedHoverShadow(surface = "charcoal", intensity = "medium") {
|
|
1082
|
+
const colors = shadowColors[surface];
|
|
1083
|
+
const { offset, blur } = intensityConfig[intensity];
|
|
1084
|
+
const hoverOffset = Math.max(1, Math.round(offset / 2));
|
|
1085
|
+
const hoverBlur = Math.max(1, Math.round(blur / 2));
|
|
1086
|
+
const rimBlur = 1;
|
|
1087
|
+
return reactNative.Platform.select({
|
|
1088
|
+
web: {
|
|
1089
|
+
// Keep same offsets as normal state for rim to prevent "shrinking" effect
|
|
1090
|
+
boxShadow: `${hoverOffset}px ${hoverOffset}px ${hoverBlur}px ${colors.dark}, -${offset}px -${offset}px ${rimBlur}px ${colors.light}`
|
|
1091
|
+
},
|
|
1092
|
+
default: {
|
|
1093
|
+
shadowColor: "#000",
|
|
1094
|
+
shadowOffset: { width: hoverOffset, height: hoverOffset },
|
|
1095
|
+
shadowOpacity: 0.2,
|
|
1096
|
+
shadowRadius: hoverBlur / 2,
|
|
1097
|
+
elevation: hoverOffset
|
|
1098
|
+
}
|
|
1099
|
+
});
|
|
1100
|
+
}
|
|
1101
|
+
function createPressedHoverShadow(surface = "charcoal", intensity = "medium") {
|
|
1102
|
+
const colors = shadowColors[surface];
|
|
1103
|
+
const { offset, blur } = intensityConfig[intensity];
|
|
1104
|
+
const hoverOffset = Math.max(1, Math.round(offset / 2));
|
|
1105
|
+
const hoverBlur = Math.max(1, Math.round(blur / 2));
|
|
1106
|
+
const rimBlur = 1;
|
|
1107
|
+
return reactNative.Platform.select({
|
|
1108
|
+
web: {
|
|
1109
|
+
// Keep rim offset at 1px (same as pressed normal) to prevent "shrinking" effect
|
|
1110
|
+
boxShadow: `inset ${hoverOffset}px ${hoverOffset}px ${hoverBlur}px ${colors.darker}, inset -1px -1px ${rimBlur}px ${colors.light}`
|
|
1111
|
+
},
|
|
1112
|
+
default: {
|
|
1113
|
+
shadowOpacity: 0,
|
|
1114
|
+
elevation: 0
|
|
1115
|
+
}
|
|
1116
|
+
});
|
|
1117
|
+
}
|
|
1118
|
+
var neumorphicShadows = {
|
|
1119
|
+
// Charcoal surface shadows (for dark toolbars, cards)
|
|
1120
|
+
charcoal: {
|
|
1121
|
+
raised: {
|
|
1122
|
+
subtle: createRaisedShadow("charcoal", "subtle"),
|
|
1123
|
+
medium: createRaisedShadow("charcoal", "medium"),
|
|
1124
|
+
strong: createRaisedShadow("charcoal", "strong")
|
|
1125
|
+
},
|
|
1126
|
+
raisedHover: {
|
|
1127
|
+
subtle: createRaisedHoverShadow("charcoal", "subtle"),
|
|
1128
|
+
medium: createRaisedHoverShadow("charcoal", "medium"),
|
|
1129
|
+
strong: createRaisedHoverShadow("charcoal", "strong")
|
|
1130
|
+
},
|
|
1131
|
+
pressed: {
|
|
1132
|
+
subtle: createPressedShadow("charcoal", "subtle"),
|
|
1133
|
+
medium: createPressedShadow("charcoal", "medium"),
|
|
1134
|
+
strong: createPressedShadow("charcoal", "strong")
|
|
1135
|
+
},
|
|
1136
|
+
pressedHover: {
|
|
1137
|
+
subtle: createPressedHoverShadow("charcoal", "subtle"),
|
|
1138
|
+
medium: createPressedHoverShadow("charcoal", "medium"),
|
|
1139
|
+
strong: createPressedHoverShadow("charcoal", "strong")
|
|
1140
|
+
},
|
|
1141
|
+
flat: createFlatShadow()
|
|
1142
|
+
},
|
|
1143
|
+
// Neutral dark surface shadows
|
|
1144
|
+
neutralDark: {
|
|
1145
|
+
raised: {
|
|
1146
|
+
subtle: createRaisedShadow("neutralDark", "subtle"),
|
|
1147
|
+
medium: createRaisedShadow("neutralDark", "medium"),
|
|
1148
|
+
strong: createRaisedShadow("neutralDark", "strong")
|
|
1149
|
+
},
|
|
1150
|
+
raisedHover: {
|
|
1151
|
+
subtle: createRaisedHoverShadow("neutralDark", "subtle"),
|
|
1152
|
+
medium: createRaisedHoverShadow("neutralDark", "medium"),
|
|
1153
|
+
strong: createRaisedHoverShadow("neutralDark", "strong")
|
|
1154
|
+
},
|
|
1155
|
+
pressed: {
|
|
1156
|
+
subtle: createPressedShadow("neutralDark", "subtle"),
|
|
1157
|
+
medium: createPressedShadow("neutralDark", "medium"),
|
|
1158
|
+
strong: createPressedShadow("neutralDark", "strong")
|
|
1159
|
+
},
|
|
1160
|
+
pressedHover: {
|
|
1161
|
+
subtle: createPressedHoverShadow("neutralDark", "subtle"),
|
|
1162
|
+
medium: createPressedHoverShadow("neutralDark", "medium"),
|
|
1163
|
+
strong: createPressedHoverShadow("neutralDark", "strong")
|
|
1164
|
+
},
|
|
1165
|
+
flat: createFlatShadow()
|
|
1166
|
+
},
|
|
1167
|
+
// Neutral light surface shadows
|
|
1168
|
+
neutralLight: {
|
|
1169
|
+
raised: {
|
|
1170
|
+
subtle: createRaisedShadow("neutralLight", "subtle"),
|
|
1171
|
+
medium: createRaisedShadow("neutralLight", "medium"),
|
|
1172
|
+
strong: createRaisedShadow("neutralLight", "strong")
|
|
1173
|
+
},
|
|
1174
|
+
raisedHover: {
|
|
1175
|
+
subtle: createRaisedHoverShadow("neutralLight", "subtle"),
|
|
1176
|
+
medium: createRaisedHoverShadow("neutralLight", "medium"),
|
|
1177
|
+
strong: createRaisedHoverShadow("neutralLight", "strong")
|
|
1178
|
+
},
|
|
1179
|
+
pressed: {
|
|
1180
|
+
subtle: createPressedShadow("neutralLight", "subtle"),
|
|
1181
|
+
medium: createPressedShadow("neutralLight", "medium"),
|
|
1182
|
+
strong: createPressedShadow("neutralLight", "strong")
|
|
1183
|
+
},
|
|
1184
|
+
pressedHover: {
|
|
1185
|
+
subtle: createPressedHoverShadow("neutralLight", "subtle"),
|
|
1186
|
+
medium: createPressedHoverShadow("neutralLight", "medium"),
|
|
1187
|
+
strong: createPressedHoverShadow("neutralLight", "strong")
|
|
1188
|
+
},
|
|
1189
|
+
flat: createFlatShadow()
|
|
1190
|
+
}
|
|
1191
|
+
};
|
|
1192
|
+
var elevationSystem = {
|
|
1193
|
+
// Deep inset (recessed input fields, deeply pressed buttons)
|
|
1194
|
+
[-2]: {
|
|
1195
|
+
name: "deep-inset",
|
|
1196
|
+
colorAdjustment: 0,
|
|
1197
|
+
shadowIntensity: "strong",
|
|
1198
|
+
shadowStyle: "pressed",
|
|
1199
|
+
description: "Deeply recessed elements (e.g., input fields, deeply pressed buttons)"
|
|
1200
|
+
},
|
|
1201
|
+
// Shallow inset (pressed buttons, sunken panels)
|
|
1202
|
+
[-1]: {
|
|
1203
|
+
name: "inset",
|
|
1204
|
+
colorAdjustment: 0,
|
|
1205
|
+
shadowIntensity: "medium",
|
|
1206
|
+
shadowStyle: "pressed",
|
|
1207
|
+
description: "Shallow inset elements (e.g., pressed buttons, sunken panels within cards)"
|
|
1208
|
+
},
|
|
1209
|
+
// Base level (page background, default surface)
|
|
1210
|
+
[0]: {
|
|
1211
|
+
name: "base",
|
|
1212
|
+
colorAdjustment: 0,
|
|
1213
|
+
shadowIntensity: "subtle",
|
|
1214
|
+
shadowStyle: "raised",
|
|
1215
|
+
description: "Base surface level (page background, default containers)"
|
|
1216
|
+
},
|
|
1217
|
+
// Level 1: Subtle elevation (outline cards, subtle containers)
|
|
1218
|
+
[1]: {
|
|
1219
|
+
name: "subtle",
|
|
1220
|
+
colorAdjustment: 0.01,
|
|
1221
|
+
shadowIntensity: "subtle",
|
|
1222
|
+
shadowStyle: "raised",
|
|
1223
|
+
description: "Subtle elevation (outline cards, subtle containers)"
|
|
1224
|
+
},
|
|
1225
|
+
// Level 2: Standard elevation (default cards, buttons)
|
|
1226
|
+
[2]: {
|
|
1227
|
+
name: "standard",
|
|
1228
|
+
colorAdjustment: 0.02,
|
|
1229
|
+
shadowIntensity: "medium",
|
|
1230
|
+
shadowStyle: "raised",
|
|
1231
|
+
description: "Standard elevation (default cards, raised buttons)"
|
|
1232
|
+
},
|
|
1233
|
+
// Level 3: Prominent elevation (important cards, modals)
|
|
1234
|
+
[3]: {
|
|
1235
|
+
name: "prominent",
|
|
1236
|
+
colorAdjustment: 0.04,
|
|
1237
|
+
shadowIntensity: "strong",
|
|
1238
|
+
shadowStyle: "raised",
|
|
1239
|
+
description: "Prominent elevation (important cards, modals, dropdowns)"
|
|
1240
|
+
},
|
|
1241
|
+
// Level 4: High elevation (overlays, popovers)
|
|
1242
|
+
[4]: {
|
|
1243
|
+
name: "high",
|
|
1244
|
+
colorAdjustment: 0.06,
|
|
1245
|
+
shadowIntensity: "strong",
|
|
1246
|
+
shadowStyle: "raised",
|
|
1247
|
+
description: "High elevation (overlays, popovers, tooltips)"
|
|
1248
|
+
},
|
|
1249
|
+
// Level 5: Floating (toasts, floating action buttons)
|
|
1250
|
+
[5]: {
|
|
1251
|
+
name: "floating",
|
|
1252
|
+
colorAdjustment: 0.08,
|
|
1253
|
+
shadowIntensity: "strong",
|
|
1254
|
+
shadowStyle: "raised",
|
|
1255
|
+
description: "Floating elevation (toasts, floating action buttons, highest z-index)"
|
|
1256
|
+
}
|
|
1257
|
+
};
|
|
1258
|
+
function calculateRimLightColor(baseColor, level) {
|
|
1259
|
+
const rgb = hexToRgb(baseColor);
|
|
1260
|
+
if (!rgb) {
|
|
1261
|
+
return "rgba(255, 255, 255, 0.5)";
|
|
1262
|
+
}
|
|
1263
|
+
const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b);
|
|
1264
|
+
const isLight = hsv.v > 0.6;
|
|
1265
|
+
const isSaturated = hsv.s > 0.3;
|
|
1266
|
+
const absLevel = Math.abs(level);
|
|
1267
|
+
const opacityBoost = Math.max(0, (absLevel - 1) * 0.05);
|
|
1268
|
+
if (isSaturated) {
|
|
1269
|
+
const rimLightValue = 0.95;
|
|
1270
|
+
const rimLightRgb = hsvToRgb(hsv.h, hsv.s * 0.3, rimLightValue);
|
|
1271
|
+
const baseOpacity = isLight ? 0.9 : 0.5;
|
|
1272
|
+
const finalOpacity = Math.min(1, baseOpacity + opacityBoost);
|
|
1273
|
+
return `rgba(${rimLightRgb.r}, ${rimLightRgb.g}, ${rimLightRgb.b}, ${finalOpacity.toFixed(2)})`;
|
|
1274
|
+
} else {
|
|
1275
|
+
const baseOpacity = isLight ? 0.9 : 0.12;
|
|
1276
|
+
const finalOpacity = Math.min(1, baseOpacity + opacityBoost);
|
|
1277
|
+
return `rgba(255, 255, 255, ${finalOpacity.toFixed(2)})`;
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
function calculateDarkShadowColors(surfaceColor) {
|
|
1281
|
+
const rgb = hexToRgb(surfaceColor);
|
|
1282
|
+
if (!rgb) {
|
|
1283
|
+
return {
|
|
1284
|
+
dark: "rgba(0, 0, 0, 0.3)",
|
|
1285
|
+
darker: "rgba(0, 0, 0, 0.4)"
|
|
1286
|
+
};
|
|
1287
|
+
}
|
|
1288
|
+
const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b);
|
|
1289
|
+
const isLight = hsv.v > 0.6;
|
|
1290
|
+
const isSaturated = hsv.s > 0.3;
|
|
1291
|
+
if (isSaturated) {
|
|
1292
|
+
const darkShadowValue = 0.15;
|
|
1293
|
+
const darkShadowRgb = hsvToRgb(hsv.h, hsv.s, darkShadowValue);
|
|
1294
|
+
if (isLight) {
|
|
1295
|
+
return {
|
|
1296
|
+
dark: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.3)`,
|
|
1297
|
+
darker: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.4)`
|
|
1298
|
+
};
|
|
1299
|
+
} else {
|
|
1300
|
+
return {
|
|
1301
|
+
dark: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.5)`,
|
|
1302
|
+
darker: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.6)`
|
|
1303
|
+
};
|
|
1304
|
+
}
|
|
1305
|
+
} else {
|
|
1306
|
+
if (isLight) {
|
|
1307
|
+
return {
|
|
1308
|
+
dark: "rgba(0, 0, 0, 0.2)",
|
|
1309
|
+
darker: "rgba(0, 0, 0, 0.3)"
|
|
1310
|
+
};
|
|
1311
|
+
} else {
|
|
1312
|
+
return {
|
|
1313
|
+
dark: "rgba(0, 0, 0, 0.5)",
|
|
1314
|
+
darker: "rgba(0, 0, 0, 0.6)"
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
function getRimLightConfig() {
|
|
1320
|
+
return {
|
|
1321
|
+
offset: 1,
|
|
1322
|
+
// Fixed 1px for crisp rim
|
|
1323
|
+
blur: 1
|
|
1324
|
+
// Tight blur for crisp edge
|
|
1325
|
+
};
|
|
1326
|
+
}
|
|
1327
|
+
function getElevationConfig(level) {
|
|
1328
|
+
return elevationSystem[level];
|
|
1329
|
+
}
|
|
1330
|
+
var elevationSurfaceCache = /* @__PURE__ */ new Map();
|
|
1331
|
+
var MAX_CACHE_SIZE = 100;
|
|
1332
|
+
function getCacheKey(baseColor, level, theme) {
|
|
1333
|
+
return `${baseColor}-${level}-${theme}`;
|
|
1334
|
+
}
|
|
1335
|
+
function calculateElevationSurface(baseColor, level, theme) {
|
|
1336
|
+
const config = elevationSystem[level];
|
|
1337
|
+
if (config.colorAdjustment === 0) {
|
|
1338
|
+
return baseColor;
|
|
1339
|
+
}
|
|
1340
|
+
if (level < 0) {
|
|
1341
|
+
return baseColor;
|
|
1342
|
+
}
|
|
1343
|
+
return lighten(baseColor, config.colorAdjustment);
|
|
1344
|
+
}
|
|
1345
|
+
function getElevationSurface(baseColor, level, theme) {
|
|
1346
|
+
const cacheKey = getCacheKey(baseColor, level, theme);
|
|
1347
|
+
if (elevationSurfaceCache.has(cacheKey)) {
|
|
1348
|
+
return elevationSurfaceCache.get(cacheKey);
|
|
1349
|
+
}
|
|
1350
|
+
const result = calculateElevationSurface(baseColor, level);
|
|
1351
|
+
if (elevationSurfaceCache.size >= MAX_CACHE_SIZE) {
|
|
1352
|
+
const firstKey = elevationSurfaceCache.keys().next().value;
|
|
1353
|
+
elevationSurfaceCache.delete(firstKey);
|
|
1354
|
+
}
|
|
1355
|
+
elevationSurfaceCache.set(cacheKey, result);
|
|
1356
|
+
return result;
|
|
1357
|
+
}
|
|
1358
|
+
var elevationShadowCache = /* @__PURE__ */ new Map();
|
|
1359
|
+
var MAX_SHADOW_CACHE_SIZE = 50;
|
|
1360
|
+
function getShadowCacheKey(baseColor, level, theme, isHovered) {
|
|
1361
|
+
return `${baseColor}-${level}-${theme}-${isHovered}`;
|
|
1362
|
+
}
|
|
1363
|
+
function calculateElevationShadow(baseColor, level, theme, isHovered = false) {
|
|
1364
|
+
const config = elevationSystem[level];
|
|
1365
|
+
if (level === 0) {
|
|
1366
|
+
return {};
|
|
1367
|
+
}
|
|
1368
|
+
const elevatedSurfaceColor = calculateElevationSurface(baseColor, level);
|
|
1369
|
+
const rimLightColor = calculateRimLightColor(baseColor, level);
|
|
1370
|
+
const darkShadowColors = calculateDarkShadowColors(elevatedSurfaceColor);
|
|
1371
|
+
const intensityConfig2 = {
|
|
1372
|
+
subtle: { offset: 1, blur: 2 },
|
|
1373
|
+
medium: { offset: 2, blur: 4 },
|
|
1374
|
+
strong: { offset: 2, blur: 5 }
|
|
1375
|
+
};
|
|
1376
|
+
const { offset, blur } = intensityConfig2[config.shadowIntensity];
|
|
1377
|
+
const rimConfig = getRimLightConfig();
|
|
1378
|
+
if (config.shadowStyle === "pressed") {
|
|
1379
|
+
if (isHovered) {
|
|
1380
|
+
const hoverOffset = Math.max(1, Math.round(offset / 2));
|
|
1381
|
+
const hoverBlur = Math.max(1, Math.round(blur / 2));
|
|
1382
|
+
return reactNative.Platform.select({
|
|
1383
|
+
web: {
|
|
1384
|
+
boxShadow: `inset ${hoverOffset}px ${hoverOffset}px ${hoverBlur}px ${darkShadowColors.darker}, inset -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`
|
|
1385
|
+
},
|
|
1386
|
+
default: {
|
|
1387
|
+
shadowOpacity: 0,
|
|
1388
|
+
elevation: 0
|
|
1389
|
+
}
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
return reactNative.Platform.select({
|
|
1393
|
+
web: {
|
|
1394
|
+
boxShadow: `inset ${offset}px ${offset}px ${blur}px ${darkShadowColors.darker}, inset -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`
|
|
1395
|
+
},
|
|
1396
|
+
default: {
|
|
1397
|
+
shadowOpacity: 0,
|
|
1398
|
+
elevation: 0
|
|
1399
|
+
}
|
|
1400
|
+
});
|
|
1401
|
+
} else {
|
|
1402
|
+
if (isHovered) {
|
|
1403
|
+
const hoverOffset = Math.max(1, Math.round(offset / 2));
|
|
1404
|
+
const hoverBlur = Math.max(1, Math.round(blur / 2));
|
|
1405
|
+
return reactNative.Platform.select({
|
|
1406
|
+
web: {
|
|
1407
|
+
boxShadow: `${hoverOffset}px ${hoverOffset}px ${hoverBlur}px ${darkShadowColors.dark}, -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`
|
|
1408
|
+
},
|
|
1409
|
+
default: {
|
|
1410
|
+
shadowColor: "#000",
|
|
1411
|
+
shadowOffset: { width: hoverOffset, height: hoverOffset },
|
|
1412
|
+
shadowOpacity: 0.2,
|
|
1413
|
+
shadowRadius: hoverBlur / 2,
|
|
1414
|
+
elevation: hoverOffset
|
|
1415
|
+
}
|
|
1416
|
+
});
|
|
1417
|
+
}
|
|
1418
|
+
return reactNative.Platform.select({
|
|
1419
|
+
web: {
|
|
1420
|
+
boxShadow: `${offset}px ${offset}px ${blur}px ${darkShadowColors.dark}, -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`
|
|
1421
|
+
},
|
|
1422
|
+
default: {
|
|
1423
|
+
shadowColor: "#000",
|
|
1424
|
+
shadowOffset: { width: offset, height: offset },
|
|
1425
|
+
shadowOpacity: 0.3,
|
|
1426
|
+
shadowRadius: blur / 2,
|
|
1427
|
+
elevation: offset
|
|
1428
|
+
}
|
|
1429
|
+
});
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
function getElevationShadow(baseColor, level, theme, isHovered = false) {
|
|
1433
|
+
const cacheKey = getShadowCacheKey(baseColor, level, theme, isHovered);
|
|
1434
|
+
if (elevationShadowCache.has(cacheKey)) {
|
|
1435
|
+
return elevationShadowCache.get(cacheKey);
|
|
1436
|
+
}
|
|
1437
|
+
const result = calculateElevationShadow(baseColor, level, theme, isHovered);
|
|
1438
|
+
if (elevationShadowCache.size >= MAX_SHADOW_CACHE_SIZE) {
|
|
1439
|
+
const firstKey = elevationShadowCache.keys().next().value;
|
|
1440
|
+
elevationShadowCache.delete(firstKey);
|
|
1441
|
+
}
|
|
1442
|
+
elevationShadowCache.set(cacheKey, result);
|
|
1443
|
+
return result;
|
|
1444
|
+
}
|
|
1445
|
+
function getBaseSurfaceColor(theme) {
|
|
1446
|
+
return theme === "light" ? semanticColorsLight["surface-raised"] : semanticColorsDark["surface-elevated"];
|
|
1447
|
+
}
|
|
1448
|
+
var componentElevationRanges = {
|
|
1449
|
+
button: {
|
|
1450
|
+
allowed: [2],
|
|
1451
|
+
default: 2,
|
|
1452
|
+
hover: 3
|
|
1453
|
+
},
|
|
1454
|
+
card: {
|
|
1455
|
+
allowed: [1, 2, 3],
|
|
1456
|
+
default: 2,
|
|
1457
|
+
hover: 3
|
|
1458
|
+
},
|
|
1459
|
+
input: {
|
|
1460
|
+
allowed: [-2, -1, 0],
|
|
1461
|
+
default: -1
|
|
1462
|
+
},
|
|
1463
|
+
overlay: {
|
|
1464
|
+
allowed: [4, 5],
|
|
1465
|
+
default: 4
|
|
1466
|
+
}
|
|
1467
|
+
};
|
|
1468
|
+
function getValidatedElevation(component, requested) {
|
|
1469
|
+
const range = componentElevationRanges[component];
|
|
1470
|
+
if (range.allowed.includes(requested)) {
|
|
1471
|
+
return requested;
|
|
1472
|
+
}
|
|
1473
|
+
const sorted = [...range.allowed].sort((a, b) => a - b);
|
|
1474
|
+
if (requested < sorted[0]) return sorted[0];
|
|
1475
|
+
if (requested > sorted[sorted.length - 1]) return sorted[sorted.length - 1];
|
|
1476
|
+
return sorted.reduce(
|
|
1477
|
+
(prev, curr) => Math.abs(curr - requested) < Math.abs(prev - requested) ? curr : prev
|
|
1478
|
+
);
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
exports.buttonSizes = buttonSizes;
|
|
1482
|
+
exports.componentElevationRanges = componentElevationRanges;
|
|
1483
|
+
exports.createFlatShadow = createFlatShadow;
|
|
1484
|
+
exports.createPressedHoverShadow = createPressedHoverShadow;
|
|
1485
|
+
exports.createPressedShadow = createPressedShadow;
|
|
1486
|
+
exports.createRaisedHoverShadow = createRaisedHoverShadow;
|
|
1487
|
+
exports.createRaisedShadow = createRaisedShadow;
|
|
1488
|
+
exports.darkThemeCSSVars = darkThemeCSSVars;
|
|
1489
|
+
exports.darken = darken;
|
|
1490
|
+
exports.discreteRainbow = discreteRainbow;
|
|
1491
|
+
exports.elevationSystem = elevationSystem;
|
|
1492
|
+
exports.getBaseSurfaceColor = getBaseSurfaceColor;
|
|
1493
|
+
exports.getDiscreteRainbowColor = getDiscreteRainbowColor;
|
|
1494
|
+
exports.getElevationConfig = getElevationConfig;
|
|
1495
|
+
exports.getElevationShadow = getElevationShadow;
|
|
1496
|
+
exports.getElevationSurface = getElevationSurface;
|
|
1497
|
+
exports.getHoverColors = getHoverColors;
|
|
1498
|
+
exports.getSemanticColors = getSemanticColors;
|
|
1499
|
+
exports.getThemeCSSVars = getThemeCSSVars;
|
|
1500
|
+
exports.getValidatedElevation = getValidatedElevation;
|
|
1501
|
+
exports.gluestackConfig = gluestackConfig;
|
|
1502
|
+
exports.hexToRgb = hexToRgb;
|
|
1503
|
+
exports.hsvToRgb = hsvToRgb;
|
|
1504
|
+
exports.isDark = isDark;
|
|
1505
|
+
exports.lightThemeCSSVars = lightThemeCSSVars;
|
|
1506
|
+
exports.lighten = lighten;
|
|
1507
|
+
exports.neumorphicShadows = neumorphicShadows;
|
|
1508
|
+
exports.primitiveBorderRadius = primitiveBorderRadius;
|
|
1509
|
+
exports.primitiveBreakpoints = primitiveBreakpoints;
|
|
1510
|
+
exports.primitiveColors = primitiveColors;
|
|
1511
|
+
exports.primitiveShadows = primitiveShadows;
|
|
1512
|
+
exports.primitiveSpacing = primitiveSpacing;
|
|
1513
|
+
exports.primitiveTypography = primitiveTypography;
|
|
1514
|
+
exports.primitiveZIndex = primitiveZIndex;
|
|
1515
|
+
exports.rgbToHex = rgbToHex;
|
|
1516
|
+
exports.rgbToHsv = rgbToHsv;
|
|
1517
|
+
exports.semanticColorsDark = semanticColorsDark;
|
|
1518
|
+
exports.semanticColorsLight = semanticColorsLight;
|
|
1519
|
+
exports.semanticTypography = semanticTypography;
|
|
1520
|
+
exports.shadowColors = shadowColors;
|
|
1521
|
+
//# sourceMappingURL=index.js.map
|
|
1522
|
+
//# sourceMappingURL=index.js.map
|