@titan-design/react-ui 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MesoStatusCard-CQk71hSi.d.mts +77 -0
- package/dist/MesoStatusCard-CQk71hSi.d.ts +77 -0
- package/dist/bodymap.d.mts +246 -3
- package/dist/bodymap.d.ts +246 -3
- package/dist/bodymap.mjs +1911 -6
- package/dist/bodymap.mjs.map +1 -1
- package/dist/index.d.mts +31 -738
- package/dist/index.d.ts +31 -738
- package/dist/index.js +894 -1692
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10287 -8203
- package/dist/index.mjs.map +1 -1
- package/dist/pages-D7Jlssvp.d.ts +791 -0
- package/dist/pages-MO0JCySL.d.mts +791 -0
- package/dist/pages.d.mts +4 -0
- package/dist/pages.d.ts +4 -0
- package/dist/pages.js +6646 -0
- package/dist/pages.js.map +1 -0
- package/dist/pages.mjs +6626 -0
- package/dist/pages.mjs.map +1 -0
- package/dist/theme/index.d.mts +12 -12
- package/dist/theme/index.d.ts +12 -12
- package/dist/theme/index.js +30 -30
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +1880 -2
- package/dist/theme/index.mjs.map +1 -1
- package/dist/theme/tokens-css.mjs +573 -1
- package/dist/theme/tokens-css.mjs.map +1 -1
- package/package.json +9 -7
- package/src/components/custom/Workout/BaseBadge.stories.tsx +3 -3
- package/src/components/custom/Workout/BaseBadge.test.tsx +1 -1
- package/src/components/custom/Workout/BaseBadge.tsx +1 -1
- package/src/components/custom/Workout/ExerciseCard.tsx +5 -1
- package/src/components/custom/Workout/ExerciseDetailPage.tsx +17 -4
- package/src/components/custom/Workout/IntensityBar.test.tsx +112 -60
- package/src/components/custom/Workout/IntensityBar.tsx +109 -58
- package/src/components/custom/Workout/PlaceholderStrip.tsx +5 -9
- package/src/components/custom/Workout/PrBadge.tsx +3 -3
- package/src/components/custom/Workout/PrHistoryModal.tsx +2 -2
- package/src/components/custom/Workout/README.md +50 -0
- package/src/components/custom/Workout/RestTimer.test.tsx +41 -10
- package/src/components/custom/Workout/RestTimer.tsx +48 -43
- package/src/components/custom/Workout/SetRow.tsx +10 -1
- package/src/components/custom/Workout/TempoDisplay.stories.tsx +69 -2
- package/src/components/custom/Workout/TempoDisplay.test.tsx +35 -0
- package/src/components/custom/Workout/TempoDisplay.tsx +104 -1
- package/src/components/custom/Workout/VelocityStrip.test.tsx +89 -2
- package/src/components/custom/Workout/VelocityStrip.tsx +203 -38
- package/src/components/custom/Workout/WeekRow.test.tsx +2 -2
- package/src/components/custom/Workout/WeightBadge.test.tsx +2 -2
- package/src/components/custom/Workout/WeightBadge.tsx +2 -2
- package/src/components/custom/Workout/icons.tsx +68 -0
- package/src/components/custom/Workout/index.ts +38 -47
- package/src/index.ts +3 -2
- package/src/pages.ts +61 -0
- package/src/test/stories-smoke.test.tsx +50 -0
- package/src/theme/barrel.ts +53 -0
- package/src/theme/index.ts +8 -43
- package/src/theme/native-theming-guard.test.ts +117 -0
- package/dist/bodymap-BhG55xHM.d.mts +0 -318
- package/dist/bodymap-BhG55xHM.d.ts +0 -318
- package/dist/chunk-2SISKTWM.mjs +0 -1027
- package/dist/chunk-2SISKTWM.mjs.map +0 -1
- package/dist/chunk-7XPB4NAO.mjs +0 -1013
- package/dist/chunk-7XPB4NAO.mjs.map +0 -1
- package/dist/chunk-SNVKL5WZ.mjs +0 -883
- package/dist/chunk-SNVKL5WZ.mjs.map +0 -1
package/dist/theme/index.mjs
CHANGED
|
@@ -1,4 +1,1882 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Platform, View } from 'react-native';
|
|
2
|
+
import { vars } from 'nativewind';
|
|
3
|
+
import { jsx as jsx$1 } from 'react/jsx-runtime';
|
|
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 themeIndependentCSSVars = {
|
|
733
|
+
// RGB decomposed values for glow shadows
|
|
734
|
+
"--color-brand-primary-rgb": "255, 121, 0",
|
|
735
|
+
"--color-brand-secondary-rgb": "64, 109, 135",
|
|
736
|
+
"--color-status-success-rgb": "20, 184, 166",
|
|
737
|
+
"--color-status-error-rgb": "209, 67, 67",
|
|
738
|
+
"--color-status-warning-rgb": "255, 176, 32",
|
|
739
|
+
"--color-status-info-rgb": "33, 150, 243",
|
|
740
|
+
"--color-background-base-rgb": "16, 16, 16",
|
|
741
|
+
// Font families
|
|
742
|
+
"--font-family-sans": "'Inter'",
|
|
743
|
+
"--font-family-body": "'Nunito Sans'",
|
|
744
|
+
"--font-family-heading": "'Space Grotesk'",
|
|
745
|
+
"--font-family-mono": "'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace",
|
|
746
|
+
// Animation tokens
|
|
747
|
+
"--ease-out": "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
748
|
+
"--ease-in-out": "cubic-bezier(0.65, 0, 0.35, 1)",
|
|
749
|
+
"--ease-spring": "cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
750
|
+
"--duration-fast": "150ms",
|
|
751
|
+
"--duration-normal": "250ms",
|
|
752
|
+
"--duration-slow": "400ms"
|
|
753
|
+
};
|
|
754
|
+
var lightThemeCSSVars = {
|
|
755
|
+
"--color-brand-primary": semanticColorsLight["brand-primary"],
|
|
756
|
+
"--color-brand-primary-light": semanticColorsLight["brand-primary-light"],
|
|
757
|
+
"--color-brand-primary-dark": semanticColorsLight["brand-primary-dark"],
|
|
758
|
+
"--color-brand-primary-subtle": semanticColorsLight["brand-primary-subtle"],
|
|
759
|
+
"--color-brand-secondary": semanticColorsLight["brand-secondary"],
|
|
760
|
+
"--color-brand-secondary-light": semanticColorsLight["brand-secondary-light"],
|
|
761
|
+
"--color-brand-secondary-dark": semanticColorsLight["brand-secondary-dark"],
|
|
762
|
+
"--color-brand-secondary-subtle": semanticColorsLight["brand-secondary-subtle"],
|
|
763
|
+
"--color-on-brand-primary": semanticColorsLight["on-brand-primary"],
|
|
764
|
+
"--color-on-brand-secondary": semanticColorsLight["on-brand-secondary"],
|
|
765
|
+
"--color-status-success": semanticColorsLight["status-success"],
|
|
766
|
+
"--color-status-success-subtle": semanticColorsLight["status-success-subtle"],
|
|
767
|
+
"--color-status-error": semanticColorsLight["status-error"],
|
|
768
|
+
"--color-status-error-subtle": semanticColorsLight["status-error-subtle"],
|
|
769
|
+
"--color-status-warning": semanticColorsLight["status-warning"],
|
|
770
|
+
"--color-status-warning-subtle": semanticColorsLight["status-warning-subtle"],
|
|
771
|
+
"--color-status-info": semanticColorsLight["status-info"],
|
|
772
|
+
"--color-status-info-subtle": semanticColorsLight["status-info-subtle"],
|
|
773
|
+
"--color-text-primary": semanticColorsLight["text-primary"],
|
|
774
|
+
"--color-text-secondary": semanticColorsLight["text-secondary"],
|
|
775
|
+
"--color-text-tertiary": semanticColorsLight["text-tertiary"],
|
|
776
|
+
"--color-text-disabled": semanticColorsLight["text-disabled"],
|
|
777
|
+
"--color-text-inverse": semanticColorsLight["text-inverse"],
|
|
778
|
+
"--color-text-link": semanticColorsLight["text-link"],
|
|
779
|
+
"--color-surface-base": semanticColorsLight["surface-base"],
|
|
780
|
+
"--color-surface-elevated": semanticColorsLight["surface-elevated"],
|
|
781
|
+
"--color-surface-raised": semanticColorsLight["surface-raised"],
|
|
782
|
+
"--color-background-base": semanticColorsLight["background-base"],
|
|
783
|
+
"--color-background-default": semanticColorsLight["background-default"],
|
|
784
|
+
"--color-background-subtle": semanticColorsLight["background-subtle"],
|
|
785
|
+
"--color-border-default": semanticColorsLight["border-default"],
|
|
786
|
+
"--color-border-subtle": semanticColorsLight["border-subtle"],
|
|
787
|
+
"--color-border-strong": semanticColorsLight["border-strong"],
|
|
788
|
+
"--color-border-focus": semanticColorsLight["border-focus"],
|
|
789
|
+
"--color-interactive-hover": semanticColorsLight["interactive-hover"],
|
|
790
|
+
"--color-interactive-focus": semanticColorsLight["interactive-focus"],
|
|
791
|
+
"--color-interactive-active": semanticColorsLight["interactive-active"],
|
|
792
|
+
"--color-interactive-selected": semanticColorsLight["interactive-selected"],
|
|
793
|
+
"--color-interactive-disabled": semanticColorsLight["interactive-disabled"],
|
|
794
|
+
"--color-divider": semanticColorsLight["divider"],
|
|
795
|
+
"--color-brand-primary-hover": semanticColorsLight["brand-primary-hover"],
|
|
796
|
+
"--color-brand-primary-active": semanticColorsLight["brand-primary-active"],
|
|
797
|
+
"--color-brand-secondary-hover": semanticColorsLight["brand-secondary-hover"],
|
|
798
|
+
"--color-brand-secondary-active": semanticColorsLight["brand-secondary-active"],
|
|
799
|
+
"--color-status-success-light": semanticColorsLight["status-success-light"],
|
|
800
|
+
"--color-status-success-dark": semanticColorsLight["status-success-dark"],
|
|
801
|
+
"--color-status-error-light": semanticColorsLight["status-error-light"],
|
|
802
|
+
"--color-status-error-dark": semanticColorsLight["status-error-dark"],
|
|
803
|
+
"--color-status-warning-light": semanticColorsLight["status-warning-light"],
|
|
804
|
+
"--color-status-warning-dark": semanticColorsLight["status-warning-dark"],
|
|
805
|
+
"--color-status-info-light": semanticColorsLight["status-info-light"],
|
|
806
|
+
"--color-status-info-dark": semanticColorsLight["status-info-dark"],
|
|
807
|
+
"--color-on-status-success": semanticColorsLight["on-status-success"],
|
|
808
|
+
"--color-on-status-error": semanticColorsLight["on-status-error"],
|
|
809
|
+
"--color-on-status-warning": semanticColorsLight["on-status-warning"],
|
|
810
|
+
"--color-on-status-info": semanticColorsLight["on-status-info"],
|
|
811
|
+
"--color-result-improve": semanticColorsLight["result-improve"],
|
|
812
|
+
"--color-result-improve-light": semanticColorsLight["result-improve-light"],
|
|
813
|
+
"--color-result-improve-dark": semanticColorsLight["result-improve-dark"],
|
|
814
|
+
"--color-result-degrade": semanticColorsLight["result-degrade"],
|
|
815
|
+
"--color-result-degrade-light": semanticColorsLight["result-degrade-light"],
|
|
816
|
+
"--color-result-degrade-dark": semanticColorsLight["result-degrade-dark"],
|
|
817
|
+
"--color-result-inconclusive": semanticColorsLight["result-inconclusive"],
|
|
818
|
+
"--color-result-inconclusive-light": semanticColorsLight["result-inconclusive-light"],
|
|
819
|
+
"--color-result-neutral": semanticColorsLight["result-neutral"],
|
|
820
|
+
"--color-on-result-improve": semanticColorsLight["on-result-improve"],
|
|
821
|
+
"--color-on-result-degrade": semanticColorsLight["on-result-degrade"],
|
|
822
|
+
"--color-on-result-inconclusive": semanticColorsLight["on-result-inconclusive"],
|
|
823
|
+
"--color-data-1": semanticColorsLight["data-1"],
|
|
824
|
+
"--color-data-2": semanticColorsLight["data-2"],
|
|
825
|
+
"--color-data-3": semanticColorsLight["data-3"],
|
|
826
|
+
"--color-data-4": semanticColorsLight["data-4"],
|
|
827
|
+
"--color-data-5": semanticColorsLight["data-5"],
|
|
828
|
+
"--color-data-6": semanticColorsLight["data-6"],
|
|
829
|
+
"--color-data-7": semanticColorsLight["data-7"],
|
|
830
|
+
"--color-data-8": semanticColorsLight["data-8"],
|
|
831
|
+
"--color-data-9": semanticColorsLight["data-9"],
|
|
832
|
+
"--color-data-10": semanticColorsLight["data-10"],
|
|
833
|
+
"--color-text-link-hover": semanticColorsLight["text-link-hover"],
|
|
834
|
+
"--color-surface-overlay": semanticColorsLight["surface-overlay"],
|
|
835
|
+
"--color-surface-input": semanticColorsLight["surface-input"],
|
|
836
|
+
"--color-border-input": semanticColorsLight["border-input"],
|
|
837
|
+
"--color-border-input-hover": semanticColorsLight["border-input-hover"],
|
|
838
|
+
"--color-border-input-focus": semanticColorsLight["border-input-focus"],
|
|
839
|
+
"--color-border-input-error": semanticColorsLight["border-input-error"],
|
|
840
|
+
"--color-interactive-disabled-text": semanticColorsLight["interactive-disabled-text"],
|
|
841
|
+
"--color-avatar-background": semanticColorsLight["avatar-background"],
|
|
842
|
+
"--color-avatar-text": semanticColorsLight["avatar-text"],
|
|
843
|
+
...themeIndependentCSSVars
|
|
844
|
+
};
|
|
845
|
+
var darkThemeCSSVars = {
|
|
846
|
+
"--color-brand-primary": semanticColorsDark["brand-primary"],
|
|
847
|
+
"--color-brand-primary-light": semanticColorsDark["brand-primary-light"],
|
|
848
|
+
"--color-brand-primary-dark": semanticColorsDark["brand-primary-dark"],
|
|
849
|
+
"--color-brand-primary-subtle": semanticColorsDark["brand-primary-subtle"],
|
|
850
|
+
"--color-brand-secondary": semanticColorsDark["brand-secondary"],
|
|
851
|
+
"--color-brand-secondary-light": semanticColorsDark["brand-secondary-light"],
|
|
852
|
+
"--color-brand-secondary-dark": semanticColorsDark["brand-secondary-dark"],
|
|
853
|
+
"--color-brand-secondary-subtle": semanticColorsDark["brand-secondary-subtle"],
|
|
854
|
+
"--color-on-brand-primary": semanticColorsDark["on-brand-primary"],
|
|
855
|
+
"--color-on-brand-secondary": semanticColorsDark["on-brand-secondary"],
|
|
856
|
+
"--color-status-success": semanticColorsDark["status-success"],
|
|
857
|
+
"--color-status-success-subtle": semanticColorsDark["status-success-subtle"],
|
|
858
|
+
"--color-status-error": semanticColorsDark["status-error"],
|
|
859
|
+
"--color-status-error-subtle": semanticColorsDark["status-error-subtle"],
|
|
860
|
+
"--color-status-warning": semanticColorsDark["status-warning"],
|
|
861
|
+
"--color-status-warning-subtle": semanticColorsDark["status-warning-subtle"],
|
|
862
|
+
"--color-status-info": semanticColorsDark["status-info"],
|
|
863
|
+
"--color-status-info-subtle": semanticColorsDark["status-info-subtle"],
|
|
864
|
+
"--color-text-primary": semanticColorsDark["text-primary"],
|
|
865
|
+
"--color-text-secondary": semanticColorsDark["text-secondary"],
|
|
866
|
+
"--color-text-tertiary": semanticColorsDark["text-tertiary"],
|
|
867
|
+
"--color-text-disabled": semanticColorsDark["text-disabled"],
|
|
868
|
+
"--color-text-inverse": semanticColorsDark["text-inverse"],
|
|
869
|
+
"--color-text-link": semanticColorsDark["text-link"],
|
|
870
|
+
"--color-surface-base": semanticColorsDark["surface-base"],
|
|
871
|
+
"--color-surface-elevated": semanticColorsDark["surface-elevated"],
|
|
872
|
+
"--color-surface-raised": semanticColorsDark["surface-raised"],
|
|
873
|
+
"--color-background-base": semanticColorsDark["background-base"],
|
|
874
|
+
"--color-background-default": semanticColorsDark["background-default"],
|
|
875
|
+
"--color-background-subtle": semanticColorsDark["background-subtle"],
|
|
876
|
+
"--color-border-default": semanticColorsDark["border-default"],
|
|
877
|
+
"--color-border-subtle": semanticColorsDark["border-subtle"],
|
|
878
|
+
"--color-border-strong": semanticColorsDark["border-strong"],
|
|
879
|
+
"--color-border-focus": semanticColorsDark["border-focus"],
|
|
880
|
+
"--color-interactive-hover": semanticColorsDark["interactive-hover"],
|
|
881
|
+
"--color-interactive-focus": semanticColorsDark["interactive-focus"],
|
|
882
|
+
"--color-interactive-active": semanticColorsDark["interactive-active"],
|
|
883
|
+
"--color-interactive-selected": semanticColorsDark["interactive-selected"],
|
|
884
|
+
"--color-interactive-disabled": semanticColorsDark["interactive-disabled"],
|
|
885
|
+
"--color-divider": semanticColorsDark["divider"],
|
|
886
|
+
"--color-brand-primary-hover": semanticColorsDark["brand-primary-hover"],
|
|
887
|
+
"--color-brand-primary-active": semanticColorsDark["brand-primary-active"],
|
|
888
|
+
"--color-brand-secondary-hover": semanticColorsDark["brand-secondary-hover"],
|
|
889
|
+
"--color-brand-secondary-active": semanticColorsDark["brand-secondary-active"],
|
|
890
|
+
"--color-status-success-light": semanticColorsDark["status-success-light"],
|
|
891
|
+
"--color-status-success-dark": semanticColorsDark["status-success-dark"],
|
|
892
|
+
"--color-status-error-light": semanticColorsDark["status-error-light"],
|
|
893
|
+
"--color-status-error-dark": semanticColorsDark["status-error-dark"],
|
|
894
|
+
"--color-status-warning-light": semanticColorsDark["status-warning-light"],
|
|
895
|
+
"--color-status-warning-dark": semanticColorsDark["status-warning-dark"],
|
|
896
|
+
"--color-status-info-light": semanticColorsDark["status-info-light"],
|
|
897
|
+
"--color-status-info-dark": semanticColorsDark["status-info-dark"],
|
|
898
|
+
"--color-on-status-success": semanticColorsDark["on-status-success"],
|
|
899
|
+
"--color-on-status-error": semanticColorsDark["on-status-error"],
|
|
900
|
+
"--color-on-status-warning": semanticColorsDark["on-status-warning"],
|
|
901
|
+
"--color-on-status-info": semanticColorsDark["on-status-info"],
|
|
902
|
+
"--color-result-improve": semanticColorsDark["result-improve"],
|
|
903
|
+
"--color-result-improve-light": semanticColorsDark["result-improve-light"],
|
|
904
|
+
"--color-result-improve-dark": semanticColorsDark["result-improve-dark"],
|
|
905
|
+
"--color-result-degrade": semanticColorsDark["result-degrade"],
|
|
906
|
+
"--color-result-degrade-light": semanticColorsDark["result-degrade-light"],
|
|
907
|
+
"--color-result-degrade-dark": semanticColorsDark["result-degrade-dark"],
|
|
908
|
+
"--color-result-inconclusive": semanticColorsDark["result-inconclusive"],
|
|
909
|
+
"--color-result-inconclusive-light": semanticColorsDark["result-inconclusive-light"],
|
|
910
|
+
"--color-result-neutral": semanticColorsDark["result-neutral"],
|
|
911
|
+
"--color-on-result-improve": semanticColorsDark["on-result-improve"],
|
|
912
|
+
"--color-on-result-degrade": semanticColorsDark["on-result-degrade"],
|
|
913
|
+
"--color-on-result-inconclusive": semanticColorsDark["on-result-inconclusive"],
|
|
914
|
+
"--color-data-1": semanticColorsDark["data-1"],
|
|
915
|
+
"--color-data-2": semanticColorsDark["data-2"],
|
|
916
|
+
"--color-data-3": semanticColorsDark["data-3"],
|
|
917
|
+
"--color-data-4": semanticColorsDark["data-4"],
|
|
918
|
+
"--color-data-5": semanticColorsDark["data-5"],
|
|
919
|
+
"--color-data-6": semanticColorsDark["data-6"],
|
|
920
|
+
"--color-data-7": semanticColorsDark["data-7"],
|
|
921
|
+
"--color-data-8": semanticColorsDark["data-8"],
|
|
922
|
+
"--color-data-9": semanticColorsDark["data-9"],
|
|
923
|
+
"--color-data-10": semanticColorsDark["data-10"],
|
|
924
|
+
"--color-text-link-hover": semanticColorsDark["text-link-hover"],
|
|
925
|
+
"--color-surface-overlay": semanticColorsDark["surface-overlay"],
|
|
926
|
+
"--color-surface-input": semanticColorsDark["surface-input"],
|
|
927
|
+
"--color-border-input": semanticColorsDark["border-input"],
|
|
928
|
+
"--color-border-input-hover": semanticColorsDark["border-input-hover"],
|
|
929
|
+
"--color-border-input-focus": semanticColorsDark["border-input-focus"],
|
|
930
|
+
"--color-border-input-error": semanticColorsDark["border-input-error"],
|
|
931
|
+
"--color-interactive-disabled-text": semanticColorsDark["interactive-disabled-text"],
|
|
932
|
+
"--color-avatar-background": semanticColorsDark["avatar-background"],
|
|
933
|
+
"--color-avatar-text": semanticColorsDark["avatar-text"],
|
|
934
|
+
...themeIndependentCSSVars
|
|
935
|
+
};
|
|
936
|
+
function getThemeCSSVars(mode) {
|
|
937
|
+
return mode === "dark" ? darkThemeCSSVars : lightThemeCSSVars;
|
|
938
|
+
}
|
|
939
|
+
var gluestackConfig = {
|
|
940
|
+
tokens: {
|
|
941
|
+
colors: {
|
|
942
|
+
// Map to our semantic colors via CSS vars
|
|
943
|
+
primary500: "var(--color-brand-primary)",
|
|
944
|
+
primary600: "var(--color-brand-primary-dark)",
|
|
945
|
+
primary400: "var(--color-brand-primary-light)",
|
|
946
|
+
secondary500: "var(--color-brand-secondary)",
|
|
947
|
+
secondary600: "var(--color-brand-secondary-dark)",
|
|
948
|
+
secondary400: "var(--color-brand-secondary-light)",
|
|
949
|
+
success500: "var(--color-status-success)",
|
|
950
|
+
error500: "var(--color-status-error)",
|
|
951
|
+
warning500: "var(--color-status-warning)",
|
|
952
|
+
info500: "var(--color-status-info)",
|
|
953
|
+
textLight: "var(--color-text-primary)",
|
|
954
|
+
textDark: "var(--color-text-inverse)",
|
|
955
|
+
backgroundLight: "var(--color-background-default)",
|
|
956
|
+
backgroundDark: "var(--color-surface-base)"
|
|
957
|
+
},
|
|
958
|
+
space: {
|
|
959
|
+
"0": 0,
|
|
960
|
+
"1": 4,
|
|
961
|
+
"2": 8,
|
|
962
|
+
"3": 12,
|
|
963
|
+
"4": 16,
|
|
964
|
+
"5": 20,
|
|
965
|
+
"6": 24,
|
|
966
|
+
"8": 32,
|
|
967
|
+
"10": 40,
|
|
968
|
+
"12": 48,
|
|
969
|
+
"16": 64,
|
|
970
|
+
"20": 80,
|
|
971
|
+
"24": 96
|
|
972
|
+
},
|
|
973
|
+
radii: {
|
|
974
|
+
none: 0,
|
|
975
|
+
sm: 4,
|
|
976
|
+
md: 8,
|
|
977
|
+
lg: 12,
|
|
978
|
+
xl: 16,
|
|
979
|
+
"2xl": 24,
|
|
980
|
+
full: 9999
|
|
981
|
+
},
|
|
982
|
+
fontSizes: {
|
|
983
|
+
xs: 12,
|
|
984
|
+
sm: 14,
|
|
985
|
+
md: 16,
|
|
986
|
+
lg: 18,
|
|
987
|
+
xl: 20,
|
|
988
|
+
"2xl": 24,
|
|
989
|
+
"3xl": 30,
|
|
990
|
+
"4xl": 36,
|
|
991
|
+
"5xl": 48
|
|
992
|
+
}
|
|
993
|
+
},
|
|
994
|
+
aliases: {
|
|
995
|
+
bg: "backgroundColor",
|
|
996
|
+
p: "padding",
|
|
997
|
+
px: "paddingHorizontal",
|
|
998
|
+
py: "paddingVertical",
|
|
999
|
+
m: "margin",
|
|
1000
|
+
mx: "marginHorizontal",
|
|
1001
|
+
my: "marginVertical",
|
|
1002
|
+
h: "height",
|
|
1003
|
+
w: "width",
|
|
1004
|
+
rounded: "borderRadius"
|
|
1005
|
+
}
|
|
1006
|
+
};
|
|
1007
|
+
function hexToRgb(hex) {
|
|
1008
|
+
const cleaned = hex.replace("#", "");
|
|
1009
|
+
let r, g, b;
|
|
1010
|
+
if (cleaned.length === 3) {
|
|
1011
|
+
r = parseInt(cleaned[0] + cleaned[0], 16);
|
|
1012
|
+
g = parseInt(cleaned[1] + cleaned[1], 16);
|
|
1013
|
+
b = parseInt(cleaned[2] + cleaned[2], 16);
|
|
1014
|
+
} else if (cleaned.length === 6) {
|
|
1015
|
+
r = parseInt(cleaned.slice(0, 2), 16);
|
|
1016
|
+
g = parseInt(cleaned.slice(2, 4), 16);
|
|
1017
|
+
b = parseInt(cleaned.slice(4, 6), 16);
|
|
1018
|
+
} else {
|
|
1019
|
+
return null;
|
|
1020
|
+
}
|
|
1021
|
+
return { r, g, b };
|
|
1022
|
+
}
|
|
1023
|
+
function rgbToHsv(r, g, b) {
|
|
1024
|
+
const rNorm = r / 255;
|
|
1025
|
+
const gNorm = g / 255;
|
|
1026
|
+
const bNorm = b / 255;
|
|
1027
|
+
const max = Math.max(rNorm, gNorm, bNorm);
|
|
1028
|
+
const min = Math.min(rNorm, gNorm, bNorm);
|
|
1029
|
+
const delta = max - min;
|
|
1030
|
+
const v = max;
|
|
1031
|
+
const s = max === 0 ? 0 : delta / max;
|
|
1032
|
+
let h = 0;
|
|
1033
|
+
if (delta !== 0) {
|
|
1034
|
+
if (max === rNorm) {
|
|
1035
|
+
h = 60 * ((gNorm - bNorm) / delta % 6);
|
|
1036
|
+
} else if (max === gNorm) {
|
|
1037
|
+
h = 60 * ((bNorm - rNorm) / delta + 2);
|
|
1038
|
+
} else {
|
|
1039
|
+
h = 60 * ((rNorm - gNorm) / delta + 4);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
if (h < 0) h += 360;
|
|
1043
|
+
return { h, s, v };
|
|
1044
|
+
}
|
|
1045
|
+
function hsvToRgb(h, s, v) {
|
|
1046
|
+
const c = v * s;
|
|
1047
|
+
const x = c * (1 - Math.abs(h / 60 % 2 - 1));
|
|
1048
|
+
const m = v - c;
|
|
1049
|
+
let rPrime, gPrime, bPrime;
|
|
1050
|
+
if (h >= 0 && h < 60) {
|
|
1051
|
+
rPrime = c;
|
|
1052
|
+
gPrime = x;
|
|
1053
|
+
bPrime = 0;
|
|
1054
|
+
} else if (h >= 60 && h < 120) {
|
|
1055
|
+
rPrime = x;
|
|
1056
|
+
gPrime = c;
|
|
1057
|
+
bPrime = 0;
|
|
1058
|
+
} else if (h >= 120 && h < 180) {
|
|
1059
|
+
rPrime = 0;
|
|
1060
|
+
gPrime = c;
|
|
1061
|
+
bPrime = x;
|
|
1062
|
+
} else if (h >= 180 && h < 240) {
|
|
1063
|
+
rPrime = 0;
|
|
1064
|
+
gPrime = x;
|
|
1065
|
+
bPrime = c;
|
|
1066
|
+
} else if (h >= 240 && h < 300) {
|
|
1067
|
+
rPrime = x;
|
|
1068
|
+
gPrime = 0;
|
|
1069
|
+
bPrime = c;
|
|
1070
|
+
} else {
|
|
1071
|
+
rPrime = c;
|
|
1072
|
+
gPrime = 0;
|
|
1073
|
+
bPrime = x;
|
|
1074
|
+
}
|
|
1075
|
+
return {
|
|
1076
|
+
r: Math.round((rPrime + m) * 255),
|
|
1077
|
+
g: Math.round((gPrime + m) * 255),
|
|
1078
|
+
b: Math.round((bPrime + m) * 255)
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1081
|
+
function rgbToHex(r, g, b) {
|
|
1082
|
+
const toHex = (n) => {
|
|
1083
|
+
const clamped = Math.max(0, Math.min(255, Math.round(n)));
|
|
1084
|
+
return clamped.toString(16).padStart(2, "0");
|
|
1085
|
+
};
|
|
1086
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
1087
|
+
}
|
|
1088
|
+
function lighten(hex, amount = 0.1) {
|
|
1089
|
+
const rgb = hexToRgb(hex);
|
|
1090
|
+
if (!rgb) return hex;
|
|
1091
|
+
const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b);
|
|
1092
|
+
const newV = Math.min(1, hsv.v + amount);
|
|
1093
|
+
const newRgb = hsvToRgb(hsv.h, hsv.s, newV);
|
|
1094
|
+
return rgbToHex(newRgb.r, newRgb.g, newRgb.b);
|
|
1095
|
+
}
|
|
1096
|
+
function darken(hex, amount = 0.1) {
|
|
1097
|
+
const rgb = hexToRgb(hex);
|
|
1098
|
+
if (!rgb) return hex;
|
|
1099
|
+
const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b);
|
|
1100
|
+
const newV = Math.max(0, hsv.v - amount);
|
|
1101
|
+
const newRgb = hsvToRgb(hsv.h, hsv.s, newV);
|
|
1102
|
+
return rgbToHex(newRgb.r, newRgb.g, newRgb.b);
|
|
1103
|
+
}
|
|
1104
|
+
function getHoverColors(bgColor, intensity = "medium") {
|
|
1105
|
+
const amounts = {
|
|
1106
|
+
subtle: 0.01,
|
|
1107
|
+
medium: 0.02,
|
|
1108
|
+
strong: 0.03
|
|
1109
|
+
};
|
|
1110
|
+
const amount = amounts[intensity];
|
|
1111
|
+
return {
|
|
1112
|
+
raised: lighten(bgColor, amount),
|
|
1113
|
+
// Raised hover: lighten (lifting up)
|
|
1114
|
+
pressed: darken(bgColor, amount)
|
|
1115
|
+
// Pressed hover: darken (pressing down)
|
|
1116
|
+
};
|
|
1117
|
+
}
|
|
1118
|
+
function isDark(hex) {
|
|
1119
|
+
const rgb = hexToRgb(hex);
|
|
1120
|
+
if (!rgb) return true;
|
|
1121
|
+
const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b);
|
|
1122
|
+
return hsv.v < 0.6;
|
|
1123
|
+
}
|
|
1124
|
+
var shadowColors = {
|
|
1125
|
+
// For charcoal surfaces (~#2C2C2C to #3C3C3C)
|
|
1126
|
+
charcoal: {
|
|
1127
|
+
dark: "rgba(0, 0, 0, 0.5)",
|
|
1128
|
+
light: "rgba(255, 255, 255, 0.12)",
|
|
1129
|
+
// brighter for crisp rim light
|
|
1130
|
+
darker: "rgba(0, 0, 0, 0.6)"
|
|
1131
|
+
},
|
|
1132
|
+
// For neutral dark surfaces (~#1F2937)
|
|
1133
|
+
neutralDark: {
|
|
1134
|
+
dark: "rgba(0, 0, 0, 0.4)",
|
|
1135
|
+
light: "rgba(255, 255, 255, 0.08)",
|
|
1136
|
+
darker: "rgba(0, 0, 0, 0.5)"
|
|
1137
|
+
},
|
|
1138
|
+
// For light surfaces (white/light gray backgrounds)
|
|
1139
|
+
neutralLight: {
|
|
1140
|
+
dark: "rgba(0, 0, 0, 0.15)",
|
|
1141
|
+
// Visible dark shadow for depth on light backgrounds
|
|
1142
|
+
light: "rgba(255, 255, 255, 1)",
|
|
1143
|
+
// Bright highlight for raised effect (visible on light gray)
|
|
1144
|
+
darker: "rgba(0, 0, 0, 0.2)"
|
|
1145
|
+
// Deeper shadow for pressed states
|
|
1146
|
+
}
|
|
1147
|
+
};
|
|
1148
|
+
var intensityConfig = {
|
|
1149
|
+
subtle: { offset: 1, blur: 2 },
|
|
1150
|
+
// very light, barely visible
|
|
1151
|
+
medium: { offset: 2, blur: 4 },
|
|
1152
|
+
// noticeable but restrained
|
|
1153
|
+
strong: { offset: 2, blur: 5 }
|
|
1154
|
+
// slightly deeper blur, same offset as medium
|
|
1155
|
+
};
|
|
1156
|
+
function createRaisedShadow(surface = "charcoal", intensity = "medium") {
|
|
1157
|
+
const colors = shadowColors[surface];
|
|
1158
|
+
const { offset, blur } = intensityConfig[intensity];
|
|
1159
|
+
const rimBlur = 1;
|
|
1160
|
+
return Platform.select({
|
|
1161
|
+
web: {
|
|
1162
|
+
boxShadow: `${offset}px ${offset}px ${blur}px ${colors.dark}, -${offset}px -${offset}px ${rimBlur}px ${colors.light}`
|
|
1163
|
+
},
|
|
1164
|
+
default: {
|
|
1165
|
+
// React Native shadow approximation (limited compared to web)
|
|
1166
|
+
shadowColor: "#000",
|
|
1167
|
+
shadowOffset: { width: offset, height: offset },
|
|
1168
|
+
shadowOpacity: 0.3,
|
|
1169
|
+
shadowRadius: blur / 2,
|
|
1170
|
+
elevation: offset
|
|
1171
|
+
}
|
|
1172
|
+
});
|
|
1173
|
+
}
|
|
1174
|
+
function createPressedShadow(surface = "charcoal", intensity = "medium") {
|
|
1175
|
+
const colors = shadowColors[surface];
|
|
1176
|
+
const { offset, blur } = intensityConfig[intensity];
|
|
1177
|
+
const rimOffset = 1;
|
|
1178
|
+
const rimBlur = 1;
|
|
1179
|
+
return Platform.select({
|
|
1180
|
+
web: {
|
|
1181
|
+
boxShadow: `inset ${offset}px ${offset}px ${blur}px ${colors.darker}, inset -${rimOffset}px -${rimOffset}px ${rimBlur}px ${colors.light}`
|
|
1182
|
+
},
|
|
1183
|
+
default: {
|
|
1184
|
+
// React Native doesn't support inset shadows, approximate with darker bg
|
|
1185
|
+
shadowOpacity: 0,
|
|
1186
|
+
elevation: 0
|
|
1187
|
+
}
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
function createFlatShadow() {
|
|
1191
|
+
return Platform.select({
|
|
1192
|
+
web: {
|
|
1193
|
+
boxShadow: "none"
|
|
1194
|
+
},
|
|
1195
|
+
default: {
|
|
1196
|
+
shadowOpacity: 0,
|
|
1197
|
+
elevation: 0
|
|
1198
|
+
}
|
|
1199
|
+
});
|
|
1200
|
+
}
|
|
1201
|
+
function createRaisedHoverShadow(surface = "charcoal", intensity = "medium") {
|
|
1202
|
+
const colors = shadowColors[surface];
|
|
1203
|
+
const { offset, blur } = intensityConfig[intensity];
|
|
1204
|
+
const hoverOffset = Math.max(1, Math.round(offset / 2));
|
|
1205
|
+
const hoverBlur = Math.max(1, Math.round(blur / 2));
|
|
1206
|
+
const rimBlur = 1;
|
|
1207
|
+
return Platform.select({
|
|
1208
|
+
web: {
|
|
1209
|
+
// Keep same offsets as normal state for rim to prevent "shrinking" effect
|
|
1210
|
+
boxShadow: `${hoverOffset}px ${hoverOffset}px ${hoverBlur}px ${colors.dark}, -${offset}px -${offset}px ${rimBlur}px ${colors.light}`
|
|
1211
|
+
},
|
|
1212
|
+
default: {
|
|
1213
|
+
shadowColor: "#000",
|
|
1214
|
+
shadowOffset: { width: hoverOffset, height: hoverOffset },
|
|
1215
|
+
shadowOpacity: 0.2,
|
|
1216
|
+
shadowRadius: hoverBlur / 2,
|
|
1217
|
+
elevation: hoverOffset
|
|
1218
|
+
}
|
|
1219
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
function createPressedHoverShadow(surface = "charcoal", intensity = "medium") {
|
|
1222
|
+
const colors = shadowColors[surface];
|
|
1223
|
+
const { offset, blur } = intensityConfig[intensity];
|
|
1224
|
+
const hoverOffset = Math.max(1, Math.round(offset / 2));
|
|
1225
|
+
const hoverBlur = Math.max(1, Math.round(blur / 2));
|
|
1226
|
+
const rimBlur = 1;
|
|
1227
|
+
return Platform.select({
|
|
1228
|
+
web: {
|
|
1229
|
+
// Keep rim offset at 1px (same as pressed normal) to prevent "shrinking" effect
|
|
1230
|
+
boxShadow: `inset ${hoverOffset}px ${hoverOffset}px ${hoverBlur}px ${colors.darker}, inset -1px -1px ${rimBlur}px ${colors.light}`
|
|
1231
|
+
},
|
|
1232
|
+
default: {
|
|
1233
|
+
shadowOpacity: 0,
|
|
1234
|
+
elevation: 0
|
|
1235
|
+
}
|
|
1236
|
+
});
|
|
1237
|
+
}
|
|
1238
|
+
var neumorphicShadows = {
|
|
1239
|
+
// Charcoal surface shadows (for dark toolbars, cards)
|
|
1240
|
+
charcoal: {
|
|
1241
|
+
raised: {
|
|
1242
|
+
subtle: createRaisedShadow("charcoal", "subtle"),
|
|
1243
|
+
medium: createRaisedShadow("charcoal", "medium"),
|
|
1244
|
+
strong: createRaisedShadow("charcoal", "strong")
|
|
1245
|
+
},
|
|
1246
|
+
raisedHover: {
|
|
1247
|
+
subtle: createRaisedHoverShadow("charcoal", "subtle"),
|
|
1248
|
+
medium: createRaisedHoverShadow("charcoal", "medium"),
|
|
1249
|
+
strong: createRaisedHoverShadow("charcoal", "strong")
|
|
1250
|
+
},
|
|
1251
|
+
pressed: {
|
|
1252
|
+
subtle: createPressedShadow("charcoal", "subtle"),
|
|
1253
|
+
medium: createPressedShadow("charcoal", "medium"),
|
|
1254
|
+
strong: createPressedShadow("charcoal", "strong")
|
|
1255
|
+
},
|
|
1256
|
+
pressedHover: {
|
|
1257
|
+
subtle: createPressedHoverShadow("charcoal", "subtle"),
|
|
1258
|
+
medium: createPressedHoverShadow("charcoal", "medium"),
|
|
1259
|
+
strong: createPressedHoverShadow("charcoal", "strong")
|
|
1260
|
+
},
|
|
1261
|
+
flat: createFlatShadow()
|
|
1262
|
+
},
|
|
1263
|
+
// Neutral dark surface shadows
|
|
1264
|
+
neutralDark: {
|
|
1265
|
+
raised: {
|
|
1266
|
+
subtle: createRaisedShadow("neutralDark", "subtle"),
|
|
1267
|
+
medium: createRaisedShadow("neutralDark", "medium"),
|
|
1268
|
+
strong: createRaisedShadow("neutralDark", "strong")
|
|
1269
|
+
},
|
|
1270
|
+
raisedHover: {
|
|
1271
|
+
subtle: createRaisedHoverShadow("neutralDark", "subtle"),
|
|
1272
|
+
medium: createRaisedHoverShadow("neutralDark", "medium"),
|
|
1273
|
+
strong: createRaisedHoverShadow("neutralDark", "strong")
|
|
1274
|
+
},
|
|
1275
|
+
pressed: {
|
|
1276
|
+
subtle: createPressedShadow("neutralDark", "subtle"),
|
|
1277
|
+
medium: createPressedShadow("neutralDark", "medium"),
|
|
1278
|
+
strong: createPressedShadow("neutralDark", "strong")
|
|
1279
|
+
},
|
|
1280
|
+
pressedHover: {
|
|
1281
|
+
subtle: createPressedHoverShadow("neutralDark", "subtle"),
|
|
1282
|
+
medium: createPressedHoverShadow("neutralDark", "medium"),
|
|
1283
|
+
strong: createPressedHoverShadow("neutralDark", "strong")
|
|
1284
|
+
},
|
|
1285
|
+
flat: createFlatShadow()
|
|
1286
|
+
},
|
|
1287
|
+
// Neutral light surface shadows
|
|
1288
|
+
neutralLight: {
|
|
1289
|
+
raised: {
|
|
1290
|
+
subtle: createRaisedShadow("neutralLight", "subtle"),
|
|
1291
|
+
medium: createRaisedShadow("neutralLight", "medium"),
|
|
1292
|
+
strong: createRaisedShadow("neutralLight", "strong")
|
|
1293
|
+
},
|
|
1294
|
+
raisedHover: {
|
|
1295
|
+
subtle: createRaisedHoverShadow("neutralLight", "subtle"),
|
|
1296
|
+
medium: createRaisedHoverShadow("neutralLight", "medium"),
|
|
1297
|
+
strong: createRaisedHoverShadow("neutralLight", "strong")
|
|
1298
|
+
},
|
|
1299
|
+
pressed: {
|
|
1300
|
+
subtle: createPressedShadow("neutralLight", "subtle"),
|
|
1301
|
+
medium: createPressedShadow("neutralLight", "medium"),
|
|
1302
|
+
strong: createPressedShadow("neutralLight", "strong")
|
|
1303
|
+
},
|
|
1304
|
+
pressedHover: {
|
|
1305
|
+
subtle: createPressedHoverShadow("neutralLight", "subtle"),
|
|
1306
|
+
medium: createPressedHoverShadow("neutralLight", "medium"),
|
|
1307
|
+
strong: createPressedHoverShadow("neutralLight", "strong")
|
|
1308
|
+
},
|
|
1309
|
+
flat: createFlatShadow()
|
|
1310
|
+
}
|
|
1311
|
+
};
|
|
1312
|
+
var elevationSystem = {
|
|
1313
|
+
// Deep inset (recessed input fields, deeply pressed buttons)
|
|
1314
|
+
[-2]: {
|
|
1315
|
+
name: "deep-inset",
|
|
1316
|
+
colorAdjustment: 0,
|
|
1317
|
+
shadowIntensity: "strong",
|
|
1318
|
+
shadowStyle: "pressed",
|
|
1319
|
+
description: "Deeply recessed elements (e.g., input fields, deeply pressed buttons)"
|
|
1320
|
+
},
|
|
1321
|
+
// Shallow inset (pressed buttons, sunken panels)
|
|
1322
|
+
[-1]: {
|
|
1323
|
+
name: "inset",
|
|
1324
|
+
colorAdjustment: 0,
|
|
1325
|
+
shadowIntensity: "medium",
|
|
1326
|
+
shadowStyle: "pressed",
|
|
1327
|
+
description: "Shallow inset elements (e.g., pressed buttons, sunken panels within cards)"
|
|
1328
|
+
},
|
|
1329
|
+
// Base level (page background, default surface)
|
|
1330
|
+
[0]: {
|
|
1331
|
+
name: "base",
|
|
1332
|
+
colorAdjustment: 0,
|
|
1333
|
+
shadowIntensity: "subtle",
|
|
1334
|
+
shadowStyle: "raised",
|
|
1335
|
+
description: "Base surface level (page background, default containers)"
|
|
1336
|
+
},
|
|
1337
|
+
// Level 1: Subtle elevation (outline cards, subtle containers)
|
|
1338
|
+
[1]: {
|
|
1339
|
+
name: "subtle",
|
|
1340
|
+
colorAdjustment: 0.01,
|
|
1341
|
+
shadowIntensity: "subtle",
|
|
1342
|
+
shadowStyle: "raised",
|
|
1343
|
+
description: "Subtle elevation (outline cards, subtle containers)"
|
|
1344
|
+
},
|
|
1345
|
+
// Level 2: Standard elevation (default cards, buttons)
|
|
1346
|
+
[2]: {
|
|
1347
|
+
name: "standard",
|
|
1348
|
+
colorAdjustment: 0.02,
|
|
1349
|
+
shadowIntensity: "medium",
|
|
1350
|
+
shadowStyle: "raised",
|
|
1351
|
+
description: "Standard elevation (default cards, raised buttons)"
|
|
1352
|
+
},
|
|
1353
|
+
// Level 3: Prominent elevation (important cards, modals)
|
|
1354
|
+
[3]: {
|
|
1355
|
+
name: "prominent",
|
|
1356
|
+
colorAdjustment: 0.04,
|
|
1357
|
+
shadowIntensity: "strong",
|
|
1358
|
+
shadowStyle: "raised",
|
|
1359
|
+
description: "Prominent elevation (important cards, modals, dropdowns)"
|
|
1360
|
+
},
|
|
1361
|
+
// Level 4: High elevation (overlays, popovers)
|
|
1362
|
+
[4]: {
|
|
1363
|
+
name: "high",
|
|
1364
|
+
colorAdjustment: 0.06,
|
|
1365
|
+
shadowIntensity: "strong",
|
|
1366
|
+
shadowStyle: "raised",
|
|
1367
|
+
description: "High elevation (overlays, popovers, tooltips)"
|
|
1368
|
+
},
|
|
1369
|
+
// Level 5: Floating (toasts, floating action buttons)
|
|
1370
|
+
[5]: {
|
|
1371
|
+
name: "floating",
|
|
1372
|
+
colorAdjustment: 0.08,
|
|
1373
|
+
shadowIntensity: "strong",
|
|
1374
|
+
shadowStyle: "raised",
|
|
1375
|
+
description: "Floating elevation (toasts, floating action buttons, highest z-index)"
|
|
1376
|
+
}
|
|
1377
|
+
};
|
|
1378
|
+
function calculateRimLightColor(baseColor, level) {
|
|
1379
|
+
const rgb = hexToRgb(baseColor);
|
|
1380
|
+
if (!rgb) {
|
|
1381
|
+
return "rgba(255, 255, 255, 0.5)";
|
|
1382
|
+
}
|
|
1383
|
+
const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b);
|
|
1384
|
+
const isLight = hsv.v > 0.6;
|
|
1385
|
+
const isSaturated = hsv.s > 0.3;
|
|
1386
|
+
const absLevel = Math.abs(level);
|
|
1387
|
+
const opacityBoost = Math.max(0, (absLevel - 1) * 0.05);
|
|
1388
|
+
if (isSaturated) {
|
|
1389
|
+
const rimLightValue = 0.95;
|
|
1390
|
+
const rimLightRgb = hsvToRgb(hsv.h, hsv.s * 0.3, rimLightValue);
|
|
1391
|
+
const baseOpacity = isLight ? 0.9 : 0.5;
|
|
1392
|
+
const finalOpacity = Math.min(1, baseOpacity + opacityBoost);
|
|
1393
|
+
return `rgba(${rimLightRgb.r}, ${rimLightRgb.g}, ${rimLightRgb.b}, ${finalOpacity.toFixed(2)})`;
|
|
1394
|
+
} else {
|
|
1395
|
+
const baseOpacity = isLight ? 0.9 : 0.12;
|
|
1396
|
+
const finalOpacity = Math.min(1, baseOpacity + opacityBoost);
|
|
1397
|
+
return `rgba(255, 255, 255, ${finalOpacity.toFixed(2)})`;
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
function calculateDarkShadowColors(surfaceColor) {
|
|
1401
|
+
const rgb = hexToRgb(surfaceColor);
|
|
1402
|
+
if (!rgb) {
|
|
1403
|
+
return {
|
|
1404
|
+
dark: "rgba(0, 0, 0, 0.3)",
|
|
1405
|
+
darker: "rgba(0, 0, 0, 0.4)"
|
|
1406
|
+
};
|
|
1407
|
+
}
|
|
1408
|
+
const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b);
|
|
1409
|
+
const isLight = hsv.v > 0.6;
|
|
1410
|
+
const isSaturated = hsv.s > 0.3;
|
|
1411
|
+
if (isSaturated) {
|
|
1412
|
+
const darkShadowValue = 0.15;
|
|
1413
|
+
const darkShadowRgb = hsvToRgb(hsv.h, hsv.s, darkShadowValue);
|
|
1414
|
+
if (isLight) {
|
|
1415
|
+
return {
|
|
1416
|
+
dark: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.3)`,
|
|
1417
|
+
darker: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.4)`
|
|
1418
|
+
};
|
|
1419
|
+
} else {
|
|
1420
|
+
return {
|
|
1421
|
+
dark: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.5)`,
|
|
1422
|
+
darker: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.6)`
|
|
1423
|
+
};
|
|
1424
|
+
}
|
|
1425
|
+
} else {
|
|
1426
|
+
if (isLight) {
|
|
1427
|
+
return {
|
|
1428
|
+
dark: "rgba(0, 0, 0, 0.2)",
|
|
1429
|
+
darker: "rgba(0, 0, 0, 0.3)"
|
|
1430
|
+
};
|
|
1431
|
+
} else {
|
|
1432
|
+
return {
|
|
1433
|
+
dark: "rgba(0, 0, 0, 0.5)",
|
|
1434
|
+
darker: "rgba(0, 0, 0, 0.6)"
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
function getRimLightConfig() {
|
|
1440
|
+
return {
|
|
1441
|
+
offset: 1,
|
|
1442
|
+
// Fixed 1px for crisp rim
|
|
1443
|
+
blur: 1
|
|
1444
|
+
// Tight blur for crisp edge
|
|
1445
|
+
};
|
|
1446
|
+
}
|
|
1447
|
+
function getElevationConfig(level) {
|
|
1448
|
+
return elevationSystem[level];
|
|
1449
|
+
}
|
|
1450
|
+
var elevationSurfaceCache = /* @__PURE__ */ new Map();
|
|
1451
|
+
var MAX_CACHE_SIZE = 100;
|
|
1452
|
+
function getCacheKey(baseColor, level, theme) {
|
|
1453
|
+
return `${baseColor}-${level}-${theme}`;
|
|
1454
|
+
}
|
|
1455
|
+
function calculateElevationSurface(baseColor, level, theme) {
|
|
1456
|
+
const config = elevationSystem[level];
|
|
1457
|
+
if (config.colorAdjustment === 0) {
|
|
1458
|
+
return baseColor;
|
|
1459
|
+
}
|
|
1460
|
+
if (level < 0) {
|
|
1461
|
+
return baseColor;
|
|
1462
|
+
}
|
|
1463
|
+
return lighten(baseColor, config.colorAdjustment);
|
|
1464
|
+
}
|
|
1465
|
+
function getElevationSurface(baseColor, level, theme) {
|
|
1466
|
+
const cacheKey = getCacheKey(baseColor, level, theme);
|
|
1467
|
+
if (elevationSurfaceCache.has(cacheKey)) {
|
|
1468
|
+
return elevationSurfaceCache.get(cacheKey);
|
|
1469
|
+
}
|
|
1470
|
+
const result = calculateElevationSurface(baseColor, level);
|
|
1471
|
+
if (elevationSurfaceCache.size >= MAX_CACHE_SIZE) {
|
|
1472
|
+
const firstKey = elevationSurfaceCache.keys().next().value;
|
|
1473
|
+
elevationSurfaceCache.delete(firstKey);
|
|
1474
|
+
}
|
|
1475
|
+
elevationSurfaceCache.set(cacheKey, result);
|
|
1476
|
+
return result;
|
|
1477
|
+
}
|
|
1478
|
+
var elevationShadowCache = /* @__PURE__ */ new Map();
|
|
1479
|
+
var MAX_SHADOW_CACHE_SIZE = 50;
|
|
1480
|
+
function getShadowCacheKey(baseColor, level, theme, isHovered) {
|
|
1481
|
+
return `${baseColor}-${level}-${theme}-${isHovered}`;
|
|
1482
|
+
}
|
|
1483
|
+
function calculateElevationShadow(baseColor, level, theme, isHovered = false) {
|
|
1484
|
+
const config = elevationSystem[level];
|
|
1485
|
+
if (level === 0) {
|
|
1486
|
+
return {};
|
|
1487
|
+
}
|
|
1488
|
+
const elevatedSurfaceColor = calculateElevationSurface(baseColor, level);
|
|
1489
|
+
const rimLightColor = calculateRimLightColor(baseColor, level);
|
|
1490
|
+
const darkShadowColors = calculateDarkShadowColors(elevatedSurfaceColor);
|
|
1491
|
+
const intensityConfig2 = {
|
|
1492
|
+
subtle: { offset: 1, blur: 2 },
|
|
1493
|
+
medium: { offset: 2, blur: 4 },
|
|
1494
|
+
strong: { offset: 2, blur: 5 }
|
|
1495
|
+
};
|
|
1496
|
+
const { offset, blur } = intensityConfig2[config.shadowIntensity];
|
|
1497
|
+
const rimConfig = getRimLightConfig();
|
|
1498
|
+
if (config.shadowStyle === "pressed") {
|
|
1499
|
+
if (isHovered) {
|
|
1500
|
+
const hoverOffset = Math.max(1, Math.round(offset / 2));
|
|
1501
|
+
const hoverBlur = Math.max(1, Math.round(blur / 2));
|
|
1502
|
+
return Platform.select({
|
|
1503
|
+
web: {
|
|
1504
|
+
boxShadow: `inset ${hoverOffset}px ${hoverOffset}px ${hoverBlur}px ${darkShadowColors.darker}, inset -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`
|
|
1505
|
+
},
|
|
1506
|
+
default: {
|
|
1507
|
+
shadowOpacity: 0,
|
|
1508
|
+
elevation: 0
|
|
1509
|
+
}
|
|
1510
|
+
});
|
|
1511
|
+
}
|
|
1512
|
+
return Platform.select({
|
|
1513
|
+
web: {
|
|
1514
|
+
boxShadow: `inset ${offset}px ${offset}px ${blur}px ${darkShadowColors.darker}, inset -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`
|
|
1515
|
+
},
|
|
1516
|
+
default: {
|
|
1517
|
+
shadowOpacity: 0,
|
|
1518
|
+
elevation: 0
|
|
1519
|
+
}
|
|
1520
|
+
});
|
|
1521
|
+
} else {
|
|
1522
|
+
if (isHovered) {
|
|
1523
|
+
const hoverOffset = Math.max(1, Math.round(offset / 2));
|
|
1524
|
+
const hoverBlur = Math.max(1, Math.round(blur / 2));
|
|
1525
|
+
return Platform.select({
|
|
1526
|
+
web: {
|
|
1527
|
+
boxShadow: `${hoverOffset}px ${hoverOffset}px ${hoverBlur}px ${darkShadowColors.dark}, -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`
|
|
1528
|
+
},
|
|
1529
|
+
default: {
|
|
1530
|
+
shadowColor: "#000",
|
|
1531
|
+
shadowOffset: { width: hoverOffset, height: hoverOffset },
|
|
1532
|
+
shadowOpacity: 0.2,
|
|
1533
|
+
shadowRadius: hoverBlur / 2,
|
|
1534
|
+
elevation: hoverOffset
|
|
1535
|
+
}
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
return Platform.select({
|
|
1539
|
+
web: {
|
|
1540
|
+
boxShadow: `${offset}px ${offset}px ${blur}px ${darkShadowColors.dark}, -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`
|
|
1541
|
+
},
|
|
1542
|
+
default: {
|
|
1543
|
+
shadowColor: "#000",
|
|
1544
|
+
shadowOffset: { width: offset, height: offset },
|
|
1545
|
+
shadowOpacity: 0.3,
|
|
1546
|
+
shadowRadius: blur / 2,
|
|
1547
|
+
elevation: offset
|
|
1548
|
+
}
|
|
1549
|
+
});
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
function getElevationShadow(baseColor, level, theme, isHovered = false) {
|
|
1553
|
+
const cacheKey = getShadowCacheKey(baseColor, level, theme, isHovered);
|
|
1554
|
+
if (elevationShadowCache.has(cacheKey)) {
|
|
1555
|
+
return elevationShadowCache.get(cacheKey);
|
|
1556
|
+
}
|
|
1557
|
+
const result = calculateElevationShadow(baseColor, level, theme, isHovered);
|
|
1558
|
+
if (elevationShadowCache.size >= MAX_SHADOW_CACHE_SIZE) {
|
|
1559
|
+
const firstKey = elevationShadowCache.keys().next().value;
|
|
1560
|
+
elevationShadowCache.delete(firstKey);
|
|
1561
|
+
}
|
|
1562
|
+
elevationShadowCache.set(cacheKey, result);
|
|
1563
|
+
return result;
|
|
1564
|
+
}
|
|
1565
|
+
function getBaseSurfaceColor(theme) {
|
|
1566
|
+
return theme === "light" ? semanticColorsLight["surface-raised"] : semanticColorsDark["surface-elevated"];
|
|
1567
|
+
}
|
|
1568
|
+
var componentElevationRanges = {
|
|
1569
|
+
button: {
|
|
1570
|
+
allowed: [2],
|
|
1571
|
+
default: 2,
|
|
1572
|
+
hover: 3
|
|
1573
|
+
},
|
|
1574
|
+
card: {
|
|
1575
|
+
allowed: [1, 2, 3],
|
|
1576
|
+
default: 2,
|
|
1577
|
+
hover: 3
|
|
1578
|
+
},
|
|
1579
|
+
input: {
|
|
1580
|
+
allowed: [-2, -1, 0],
|
|
1581
|
+
default: -1
|
|
1582
|
+
},
|
|
1583
|
+
overlay: {
|
|
1584
|
+
allowed: [4, 5],
|
|
1585
|
+
default: 4
|
|
1586
|
+
}
|
|
1587
|
+
};
|
|
1588
|
+
function getValidatedElevation(component, requested) {
|
|
1589
|
+
const range = componentElevationRanges[component];
|
|
1590
|
+
if (range.allowed.includes(requested)) {
|
|
1591
|
+
return requested;
|
|
1592
|
+
}
|
|
1593
|
+
const sorted = [...range.allowed].sort((a, b) => a - b);
|
|
1594
|
+
if (requested < sorted[0]) return sorted[0];
|
|
1595
|
+
if (requested > sorted[sorted.length - 1]) return sorted[sorted.length - 1];
|
|
1596
|
+
return sorted.reduce(
|
|
1597
|
+
(prev, curr) => Math.abs(curr - requested) < Math.abs(prev - requested) ? curr : prev
|
|
1598
|
+
);
|
|
1599
|
+
}
|
|
1600
|
+
var glowConfig = {
|
|
1601
|
+
subtle: { blur: 12, spread: 0, opacity: 0.25 },
|
|
1602
|
+
medium: { blur: 20, spread: 2, opacity: 0.4 },
|
|
1603
|
+
strong: { blur: 30, spread: 4, opacity: 0.55 }
|
|
1604
|
+
};
|
|
1605
|
+
function getGlowShadow(color, intensity = "medium") {
|
|
1606
|
+
const config = glowConfig[intensity];
|
|
1607
|
+
const rgb = hexToRgb(color);
|
|
1608
|
+
if (!rgb) return {};
|
|
1609
|
+
return Platform.select({
|
|
1610
|
+
web: {
|
|
1611
|
+
boxShadow: `0 0 ${config.blur}px ${config.spread}px rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${config.opacity})`
|
|
1612
|
+
},
|
|
1613
|
+
default: {
|
|
1614
|
+
shadowColor: color,
|
|
1615
|
+
shadowOffset: { width: 0, height: 0 },
|
|
1616
|
+
shadowOpacity: config.opacity,
|
|
1617
|
+
shadowRadius: config.blur / 2,
|
|
1618
|
+
elevation: 0
|
|
1619
|
+
}
|
|
1620
|
+
});
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
// src/theme/manifest/css-property-manifest.validate.ts
|
|
1624
|
+
var isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1625
|
+
var isVariantAxes = (value) => isPlainObject(value) && Object.keys(value).length > 0 && Object.values(value).every((axisValue) => typeof axisValue === "string");
|
|
1626
|
+
function collectVariantOverrideErrors(override, path) {
|
|
1627
|
+
if (!isPlainObject(override)) return [`${path} must be an object`];
|
|
1628
|
+
const errors = [];
|
|
1629
|
+
if (!isVariantAxes(override.variant))
|
|
1630
|
+
errors.push(`${path}.variant must be a non-empty string-keyed object`);
|
|
1631
|
+
if (override.token !== void 0 && override.token !== null && typeof override.token !== "string") {
|
|
1632
|
+
errors.push(`${path}.token must be a string or null`);
|
|
1633
|
+
}
|
|
1634
|
+
if (typeof override.resolvedValue !== "string" || override.resolvedValue.length === 0) {
|
|
1635
|
+
errors.push(`${path}.resolvedValue must be a non-empty string`);
|
|
1636
|
+
}
|
|
1637
|
+
return errors;
|
|
1638
|
+
}
|
|
1639
|
+
function collectPropertyErrors(entry, path) {
|
|
1640
|
+
if (!isPlainObject(entry)) return [`${path} must be an object`];
|
|
1641
|
+
const errors = [];
|
|
1642
|
+
if (typeof entry.property !== "string" || entry.property.length === 0) {
|
|
1643
|
+
errors.push(`${path}.property must be a non-empty string`);
|
|
1644
|
+
}
|
|
1645
|
+
if (entry.token !== null && typeof entry.token !== "string") {
|
|
1646
|
+
errors.push(`${path}.token must be a string or null`);
|
|
1647
|
+
}
|
|
1648
|
+
if (typeof entry.resolvedValue !== "string" || entry.resolvedValue.length === 0) {
|
|
1649
|
+
errors.push(`${path}.resolvedValue must be a non-empty string`);
|
|
1650
|
+
}
|
|
1651
|
+
if (entry.variantOverrides !== void 0) {
|
|
1652
|
+
if (!Array.isArray(entry.variantOverrides)) {
|
|
1653
|
+
errors.push(`${path}.variantOverrides must be an array`);
|
|
1654
|
+
} else {
|
|
1655
|
+
entry.variantOverrides.forEach(
|
|
1656
|
+
(override, i) => errors.push(...collectVariantOverrideErrors(override, `${path}.variantOverrides[${i}]`))
|
|
1657
|
+
);
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
return errors;
|
|
1661
|
+
}
|
|
1662
|
+
function validateCssPropertyManifest(candidate) {
|
|
1663
|
+
if (!isPlainObject(candidate)) return { valid: false, errors: ["manifest must be an object"] };
|
|
1664
|
+
const errors = [];
|
|
1665
|
+
if (typeof candidate.component !== "string" || candidate.component.length === 0) {
|
|
1666
|
+
errors.push("component must be a non-empty string");
|
|
1667
|
+
}
|
|
1668
|
+
if (candidate.baseVariant !== void 0 && !isVariantAxes(candidate.baseVariant)) {
|
|
1669
|
+
errors.push("baseVariant must be a non-empty string-keyed object");
|
|
1670
|
+
}
|
|
1671
|
+
if (!Array.isArray(candidate.properties) || candidate.properties.length === 0) {
|
|
1672
|
+
errors.push("properties must be a non-empty array");
|
|
1673
|
+
} else {
|
|
1674
|
+
candidate.properties.forEach(
|
|
1675
|
+
(entry, i) => errors.push(...collectPropertyErrors(entry, `properties[${i}]`))
|
|
1676
|
+
);
|
|
1677
|
+
}
|
|
1678
|
+
return { valid: errors.length === 0, errors };
|
|
1679
|
+
}
|
|
1680
|
+
function isCssPropertyManifest(candidate) {
|
|
1681
|
+
return validateCssPropertyManifest(candidate).valid;
|
|
1682
|
+
}
|
|
1683
|
+
function resolveColor(token, mode = "dark") {
|
|
1684
|
+
return Platform.OS === "web" ? `var(--color-${token})` : getSemanticColors(mode)[token];
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
// src/theme/presets/apply.ts
|
|
1688
|
+
function colorKeyToVar(key) {
|
|
1689
|
+
return `--color-${key}`;
|
|
1690
|
+
}
|
|
1691
|
+
function applyColorOverrides(colors, root) {
|
|
1692
|
+
for (const [key, value] of Object.entries(colors)) {
|
|
1693
|
+
if (value !== void 0) {
|
|
1694
|
+
root.style.setProperty(colorKeyToVar(key), value);
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
function applyFontOverrides(fonts, root) {
|
|
1699
|
+
const fontVarMap = {
|
|
1700
|
+
sans: "--font-family-sans",
|
|
1701
|
+
body: "--font-family-body",
|
|
1702
|
+
heading: "--font-family-heading",
|
|
1703
|
+
mono: "--font-family-mono"
|
|
1704
|
+
};
|
|
1705
|
+
for (const [key, value] of Object.entries(fonts)) {
|
|
1706
|
+
if (value !== void 0 && fontVarMap[key]) {
|
|
1707
|
+
root.style.setProperty(fontVarMap[key], value);
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
function injectFontImport(url) {
|
|
1712
|
+
if (typeof document === "undefined") return;
|
|
1713
|
+
const existing = document.querySelector(`link[href="${url}"]`);
|
|
1714
|
+
if (existing) return;
|
|
1715
|
+
const link = document.createElement("link");
|
|
1716
|
+
link.rel = "stylesheet";
|
|
1717
|
+
link.href = url;
|
|
1718
|
+
document.head.appendChild(link);
|
|
1719
|
+
}
|
|
1720
|
+
function applyThemePreset(preset) {
|
|
1721
|
+
if (typeof document === "undefined") {
|
|
1722
|
+
return () => {
|
|
1723
|
+
};
|
|
1724
|
+
}
|
|
1725
|
+
const root = document.documentElement;
|
|
1726
|
+
const removals = [];
|
|
1727
|
+
if (preset.fontImport) {
|
|
1728
|
+
injectFontImport(preset.fontImport);
|
|
1729
|
+
}
|
|
1730
|
+
const isLight = root.classList.contains("light");
|
|
1731
|
+
const modeColors = isLight ? preset.colors?.light : preset.colors?.dark;
|
|
1732
|
+
if (modeColors) {
|
|
1733
|
+
const previousValues = {};
|
|
1734
|
+
for (const key of Object.keys(modeColors)) {
|
|
1735
|
+
previousValues[colorKeyToVar(key)] = root.style.getPropertyValue(colorKeyToVar(key)) || null;
|
|
1736
|
+
}
|
|
1737
|
+
applyColorOverrides(modeColors, root);
|
|
1738
|
+
removals.push(() => {
|
|
1739
|
+
for (const [varName, prev] of Object.entries(previousValues)) {
|
|
1740
|
+
if (prev === null) {
|
|
1741
|
+
root.style.removeProperty(varName);
|
|
1742
|
+
} else {
|
|
1743
|
+
root.style.setProperty(varName, prev);
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
});
|
|
1747
|
+
}
|
|
1748
|
+
if (preset.fonts) {
|
|
1749
|
+
applyFontOverrides(preset.fonts, root);
|
|
1750
|
+
}
|
|
1751
|
+
if (preset.rootClasses) {
|
|
1752
|
+
for (const cls of preset.rootClasses) {
|
|
1753
|
+
root.classList.add(cls);
|
|
1754
|
+
}
|
|
1755
|
+
removals.push(() => {
|
|
1756
|
+
for (const cls of preset.rootClasses) {
|
|
1757
|
+
root.classList.remove(cls);
|
|
1758
|
+
}
|
|
1759
|
+
});
|
|
1760
|
+
}
|
|
1761
|
+
return () => {
|
|
1762
|
+
for (const remove of removals) {
|
|
1763
|
+
remove();
|
|
1764
|
+
}
|
|
1765
|
+
};
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
// src/theme/presets/default.ts
|
|
1769
|
+
var defaultPreset = {
|
|
1770
|
+
name: "default",
|
|
1771
|
+
description: "Titan Design System default theme \u2014 orange accent, steel secondary"
|
|
1772
|
+
};
|
|
1773
|
+
|
|
1774
|
+
// src/theme/presets/audiobook.ts
|
|
1775
|
+
var audiobookPreset = {
|
|
1776
|
+
name: "audiobook",
|
|
1777
|
+
description: "Warm copper/patina theme with editorial typography",
|
|
1778
|
+
fontImport: "https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,400;0,600;0,700;1,400&family=Outfit:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap",
|
|
1779
|
+
fonts: {
|
|
1780
|
+
sans: "'Outfit', 'Avenir', 'Avenir Next', system-ui, sans-serif",
|
|
1781
|
+
body: "'Outfit', 'Avenir', 'Avenir Next', system-ui, sans-serif",
|
|
1782
|
+
heading: "'Newsreader', 'Libre Baskerville', Georgia, serif",
|
|
1783
|
+
mono: "'JetBrains Mono', 'SF Mono', 'Fira Code', monospace"
|
|
1784
|
+
},
|
|
1785
|
+
colors: {
|
|
1786
|
+
dark: {
|
|
1787
|
+
// Brand: Copper accent
|
|
1788
|
+
"brand-primary": "#d4782a",
|
|
1789
|
+
"brand-primary-light": "#e8944a",
|
|
1790
|
+
"brand-primary-dark": "#9a4a15",
|
|
1791
|
+
"brand-primary-subtle": "rgba(212, 120, 42, 0.12)",
|
|
1792
|
+
"brand-primary-hover": "#e8944a",
|
|
1793
|
+
"brand-primary-active": "#f5b070",
|
|
1794
|
+
// Brand secondary: Patina/verdigris
|
|
1795
|
+
"brand-secondary": "#3a9b8a",
|
|
1796
|
+
"brand-secondary-light": "#55baa7",
|
|
1797
|
+
"brand-secondary-dark": "#1f5c52",
|
|
1798
|
+
"brand-secondary-subtle": "rgba(58, 155, 138, 0.12)",
|
|
1799
|
+
"brand-secondary-hover": "#55baa7",
|
|
1800
|
+
"brand-secondary-active": "#7ed4c4",
|
|
1801
|
+
"on-brand-primary": "#FFFFFF",
|
|
1802
|
+
"on-brand-secondary": "#FFFFFF",
|
|
1803
|
+
// Status colors (audiobook's warmer status palette)
|
|
1804
|
+
"status-success": "#5fb870",
|
|
1805
|
+
"status-error": "#d85c4a",
|
|
1806
|
+
"status-warning": "#d4a43a",
|
|
1807
|
+
"status-info": "#5a8fd4",
|
|
1808
|
+
// Text: warm off-whites
|
|
1809
|
+
"text-primary": "#f4f3f1",
|
|
1810
|
+
"text-secondary": "#b5b3af",
|
|
1811
|
+
"text-tertiary": "#7a7875",
|
|
1812
|
+
// Surfaces: warm charcoals (not pure gray)
|
|
1813
|
+
"surface-base": "#101114",
|
|
1814
|
+
"surface-elevated": "#15171c",
|
|
1815
|
+
"surface-raised": "#1a1d24",
|
|
1816
|
+
"surface-overlay": "#15171c",
|
|
1817
|
+
"surface-input": "#15171c",
|
|
1818
|
+
// Backgrounds
|
|
1819
|
+
"background-base": "#0a0b0d",
|
|
1820
|
+
"background-default": "#101114",
|
|
1821
|
+
"background-subtle": "#1a1d24",
|
|
1822
|
+
// Borders
|
|
1823
|
+
"border-default": "rgba(255, 255, 255, 0.06)",
|
|
1824
|
+
"border-subtle": "rgba(255, 255, 255, 0.03)",
|
|
1825
|
+
"border-strong": "#2d323d",
|
|
1826
|
+
"border-focus": "#d4782a",
|
|
1827
|
+
"border-input": "#2d323d",
|
|
1828
|
+
"border-input-hover": "#454c5c",
|
|
1829
|
+
"border-input-focus": "#d4782a",
|
|
1830
|
+
"border-input-error": "#d85c4a",
|
|
1831
|
+
// Interactive
|
|
1832
|
+
"interactive-hover": "rgba(255, 255, 255, 0.04)",
|
|
1833
|
+
"interactive-focus": "rgba(255, 255, 255, 0.12)",
|
|
1834
|
+
"interactive-active": "rgba(255, 255, 255, 0.16)",
|
|
1835
|
+
"interactive-selected": "rgba(255, 255, 255, 0.08)",
|
|
1836
|
+
"divider": "rgba(255, 255, 255, 0.06)",
|
|
1837
|
+
// Glow RGB values for shadow utilities
|
|
1838
|
+
"brand-primary-rgb": "212, 120, 42",
|
|
1839
|
+
"brand-secondary-rgb": "58, 155, 138",
|
|
1840
|
+
"status-success-rgb": "95, 184, 112",
|
|
1841
|
+
"status-error-rgb": "216, 92, 74",
|
|
1842
|
+
"status-warning-rgb": "212, 164, 58",
|
|
1843
|
+
"status-info-rgb": "90, 143, 212",
|
|
1844
|
+
"background-base-rgb": "10, 11, 13"
|
|
1845
|
+
}
|
|
1846
|
+
},
|
|
1847
|
+
rootClasses: ["atmosphere-warm", "grain"]
|
|
1848
|
+
};
|
|
1849
|
+
function wrapJsx(fn) {
|
|
1850
|
+
return function(type, props, ...rest) {
|
|
1851
|
+
if (props && typeof props.className === "string" && props.className) {
|
|
1852
|
+
const cn = props.className;
|
|
1853
|
+
const cssStyle = { $$css: true, [cn]: cn };
|
|
1854
|
+
const existing = props.style;
|
|
1855
|
+
props = {
|
|
1856
|
+
...props,
|
|
1857
|
+
style: existing ? [cssStyle, existing] : cssStyle
|
|
1858
|
+
};
|
|
1859
|
+
delete props.className;
|
|
1860
|
+
}
|
|
1861
|
+
return fn(type, props, ...rest);
|
|
1862
|
+
};
|
|
1863
|
+
}
|
|
1864
|
+
var jsx = wrapJsx(jsx$1);
|
|
1865
|
+
|
|
1866
|
+
// src/theme/ThemeProvider.tsx
|
|
1867
|
+
var MODE_VARS = {
|
|
1868
|
+
dark: vars(darkThemeCSSVars),
|
|
1869
|
+
light: vars(lightThemeCSSVars)
|
|
1870
|
+
};
|
|
1871
|
+
function ThemeProvider({
|
|
1872
|
+
mode = "dark",
|
|
1873
|
+
style,
|
|
1874
|
+
children,
|
|
1875
|
+
...props
|
|
1876
|
+
}) {
|
|
1877
|
+
return /* @__PURE__ */ jsx(View, { style: [MODE_VARS[mode], { flex: 1 }, style], ...props, children });
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
export { ThemeProvider, applyThemePreset, audiobookPreset, buttonSizes, componentElevationRanges, createFlatShadow, createPressedHoverShadow, createPressedShadow, createRaisedHoverShadow, createRaisedShadow, darkThemeCSSVars, darken, defaultPreset, discreteRainbow, elevationSystem, getBaseSurfaceColor, getDiscreteRainbowColor, getElevationConfig, getElevationShadow, getElevationSurface, getGlowShadow, getHoverColors, getSemanticColors, getThemeCSSVars, getValidatedElevation, gluestackConfig, hexToRgb, hsvToRgb, isCssPropertyManifest, isDark, lightThemeCSSVars, lighten, neumorphicShadows, primitiveBorderRadius, primitiveBreakpoints, primitiveColors, primitiveShadows, primitiveSpacing, primitiveTypography, primitiveZIndex, resolveColor, rgbToHex, rgbToHsv, semanticColorsDark, semanticColorsLight, semanticTypography, shadowColors, validateCssPropertyManifest };
|
|
3
1881
|
//# sourceMappingURL=index.mjs.map
|
|
4
1882
|
//# sourceMappingURL=index.mjs.map
|