reactnatively-theme 0.1.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/LICENSE +20 -0
- package/dist/index.d.mts +812 -0
- package/dist/index.d.ts +812 -0
- package/dist/index.js +710 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +686 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +57 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,710 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
var reactNative = require('react-native');
|
|
5
|
+
var reactnativelyUtils = require('reactnatively-utils');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
// src/ThemeProvider.tsx
|
|
9
|
+
|
|
10
|
+
// src/tokens/colors.ts
|
|
11
|
+
var palette = {
|
|
12
|
+
blue: {
|
|
13
|
+
50: "#eff6ff",
|
|
14
|
+
100: "#dbeafe",
|
|
15
|
+
200: "#bfdbfe",
|
|
16
|
+
300: "#93c5fd",
|
|
17
|
+
400: "#60a5fa",
|
|
18
|
+
500: "#3b82f6",
|
|
19
|
+
600: "#2563eb",
|
|
20
|
+
700: "#1d4ed8",
|
|
21
|
+
800: "#1e40af",
|
|
22
|
+
900: "#1e3a8a",
|
|
23
|
+
950: "#172554"
|
|
24
|
+
},
|
|
25
|
+
indigo: {
|
|
26
|
+
50: "#eef2ff",
|
|
27
|
+
100: "#e0e7ff",
|
|
28
|
+
200: "#c7d2fe",
|
|
29
|
+
300: "#a5b4fc",
|
|
30
|
+
400: "#818cf8",
|
|
31
|
+
500: "#6366f1",
|
|
32
|
+
600: "#4f46e5",
|
|
33
|
+
700: "#4338ca",
|
|
34
|
+
800: "#3730a3",
|
|
35
|
+
900: "#312e81",
|
|
36
|
+
950: "#1e1b4b"
|
|
37
|
+
},
|
|
38
|
+
violet: {
|
|
39
|
+
50: "#f5f3ff",
|
|
40
|
+
100: "#ede9fe",
|
|
41
|
+
200: "#ddd6fe",
|
|
42
|
+
300: "#c4b5fd",
|
|
43
|
+
400: "#a78bfa",
|
|
44
|
+
500: "#8b5cf6",
|
|
45
|
+
600: "#7c3aed",
|
|
46
|
+
700: "#6d28d9",
|
|
47
|
+
800: "#5b21b6",
|
|
48
|
+
900: "#4c1d95",
|
|
49
|
+
950: "#2e1065"
|
|
50
|
+
},
|
|
51
|
+
cyan: {
|
|
52
|
+
50: "#ecfeff",
|
|
53
|
+
100: "#cffafe",
|
|
54
|
+
200: "#a5f3fc",
|
|
55
|
+
300: "#67e8f9",
|
|
56
|
+
400: "#22d3ee",
|
|
57
|
+
500: "#06b6d4",
|
|
58
|
+
600: "#0891b2",
|
|
59
|
+
700: "#0e7490",
|
|
60
|
+
800: "#155e75",
|
|
61
|
+
900: "#164e63",
|
|
62
|
+
950: "#083344"
|
|
63
|
+
},
|
|
64
|
+
emerald: {
|
|
65
|
+
50: "#ecfdf5",
|
|
66
|
+
100: "#d1fae5",
|
|
67
|
+
200: "#a7f3d0",
|
|
68
|
+
300: "#6ee7b7",
|
|
69
|
+
400: "#34d399",
|
|
70
|
+
500: "#10b981",
|
|
71
|
+
600: "#059669",
|
|
72
|
+
700: "#047857",
|
|
73
|
+
800: "#065f46",
|
|
74
|
+
900: "#064e3b",
|
|
75
|
+
950: "#022c22"
|
|
76
|
+
},
|
|
77
|
+
amber: {
|
|
78
|
+
50: "#fffbeb",
|
|
79
|
+
100: "#fef3c7",
|
|
80
|
+
200: "#fde68a",
|
|
81
|
+
300: "#fcd34d",
|
|
82
|
+
400: "#fbbf24",
|
|
83
|
+
500: "#f59e0b",
|
|
84
|
+
600: "#d97706",
|
|
85
|
+
700: "#b45309",
|
|
86
|
+
800: "#92400e",
|
|
87
|
+
900: "#78350f",
|
|
88
|
+
950: "#451a03"
|
|
89
|
+
},
|
|
90
|
+
rose: {
|
|
91
|
+
50: "#fff1f2",
|
|
92
|
+
100: "#ffe4e6",
|
|
93
|
+
200: "#fecdd3",
|
|
94
|
+
300: "#fda4af",
|
|
95
|
+
400: "#fb7185",
|
|
96
|
+
500: "#f43f5e",
|
|
97
|
+
600: "#e11d48",
|
|
98
|
+
700: "#be123c",
|
|
99
|
+
800: "#9f1239",
|
|
100
|
+
900: "#881337",
|
|
101
|
+
950: "#4c0519"
|
|
102
|
+
},
|
|
103
|
+
neutral: {
|
|
104
|
+
0: "#ffffff",
|
|
105
|
+
50: "#fafafa",
|
|
106
|
+
100: "#f5f5f5",
|
|
107
|
+
200: "#e5e5e5",
|
|
108
|
+
300: "#d4d4d4",
|
|
109
|
+
400: "#a3a3a3",
|
|
110
|
+
500: "#737373",
|
|
111
|
+
600: "#525252",
|
|
112
|
+
700: "#404040",
|
|
113
|
+
800: "#262626",
|
|
114
|
+
900: "#171717",
|
|
115
|
+
950: "#0a0a0a",
|
|
116
|
+
1e3: "#000000"
|
|
117
|
+
},
|
|
118
|
+
// Liquid Glass — raw RGBA primitives for glass layers
|
|
119
|
+
glass: {
|
|
120
|
+
white5: "rgba(255,255,255,0.05)",
|
|
121
|
+
white8: "rgba(255,255,255,0.08)",
|
|
122
|
+
white10: "rgba(255,255,255,0.10)",
|
|
123
|
+
white15: "rgba(255,255,255,0.15)",
|
|
124
|
+
white20: "rgba(255,255,255,0.20)",
|
|
125
|
+
white25: "rgba(255,255,255,0.25)",
|
|
126
|
+
white30: "rgba(255,255,255,0.30)",
|
|
127
|
+
white40: "rgba(255,255,255,0.40)",
|
|
128
|
+
white50: "rgba(255,255,255,0.50)",
|
|
129
|
+
white60: "rgba(255,255,255,0.60)",
|
|
130
|
+
white72: "rgba(255,255,255,0.72)",
|
|
131
|
+
white85: "rgba(255,255,255,0.85)",
|
|
132
|
+
black5: "rgba(0,0,0,0.05)",
|
|
133
|
+
black8: "rgba(0,0,0,0.08)",
|
|
134
|
+
black10: "rgba(0,0,0,0.10)",
|
|
135
|
+
black15: "rgba(0,0,0,0.15)",
|
|
136
|
+
black20: "rgba(0,0,0,0.20)",
|
|
137
|
+
black30: "rgba(0,0,0,0.30)",
|
|
138
|
+
black40: "rgba(0,0,0,0.40)",
|
|
139
|
+
black50: "rgba(0,0,0,0.50)",
|
|
140
|
+
black60: "rgba(0,0,0,0.60)",
|
|
141
|
+
black72: "rgba(0,0,0,0.72)",
|
|
142
|
+
black85: "rgba(0,0,0,0.85)"
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
// src/tokens/glass.ts
|
|
147
|
+
var glassTokens = {
|
|
148
|
+
// Blur intensity scale — maps to expo-blur `intensity` (0-100)
|
|
149
|
+
blur: {
|
|
150
|
+
none: 0,
|
|
151
|
+
hairline: 4,
|
|
152
|
+
subtle: 10,
|
|
153
|
+
light: 20,
|
|
154
|
+
medium: 35,
|
|
155
|
+
heavy: 55,
|
|
156
|
+
intense: 72,
|
|
157
|
+
extreme: 90
|
|
158
|
+
},
|
|
159
|
+
// Tint: semi-transparent color applied over the blur layer
|
|
160
|
+
tint: {
|
|
161
|
+
light: {
|
|
162
|
+
ultraThin: "rgba(255,255,255,0.45)",
|
|
163
|
+
thin: "rgba(255,255,255,0.60)",
|
|
164
|
+
surface: "rgba(255,255,255,0.72)",
|
|
165
|
+
elevated: "rgba(255,255,255,0.82)",
|
|
166
|
+
overlay: "rgba(255,255,255,0.92)",
|
|
167
|
+
frosted: "rgba(240,242,250,0.68)",
|
|
168
|
+
tinted: "rgba(59,130,246,0.12)"
|
|
169
|
+
},
|
|
170
|
+
dark: {
|
|
171
|
+
ultraThin: "rgba(20,20,30,0.45)",
|
|
172
|
+
thin: "rgba(20,20,30,0.58)",
|
|
173
|
+
surface: "rgba(25,25,38,0.72)",
|
|
174
|
+
elevated: "rgba(30,30,48,0.80)",
|
|
175
|
+
overlay: "rgba(15,15,25,0.88)",
|
|
176
|
+
frosted: "rgba(22,24,40,0.70)",
|
|
177
|
+
tinted: "rgba(99,102,241,0.15)"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
// Elevation: the glass depth system (0 = flat, 5 = floating modal)
|
|
181
|
+
// Each level defines the complete glass rendering recipe
|
|
182
|
+
elevation: {
|
|
183
|
+
0: {
|
|
184
|
+
blur: 0,
|
|
185
|
+
tintOpacity: 0.95,
|
|
186
|
+
shadowOpacity: 0,
|
|
187
|
+
shadowRadius: 0,
|
|
188
|
+
shadowY: 0
|
|
189
|
+
},
|
|
190
|
+
1: {
|
|
191
|
+
blur: 12,
|
|
192
|
+
tintOpacity: 0.82,
|
|
193
|
+
shadowOpacity: 0.06,
|
|
194
|
+
shadowRadius: 8,
|
|
195
|
+
shadowY: 2
|
|
196
|
+
},
|
|
197
|
+
2: {
|
|
198
|
+
blur: 24,
|
|
199
|
+
tintOpacity: 0.72,
|
|
200
|
+
shadowOpacity: 0.12,
|
|
201
|
+
shadowRadius: 16,
|
|
202
|
+
shadowY: 4
|
|
203
|
+
},
|
|
204
|
+
3: {
|
|
205
|
+
blur: 40,
|
|
206
|
+
tintOpacity: 0.65,
|
|
207
|
+
shadowOpacity: 0.18,
|
|
208
|
+
shadowRadius: 24,
|
|
209
|
+
shadowY: 8
|
|
210
|
+
},
|
|
211
|
+
4: {
|
|
212
|
+
blur: 55,
|
|
213
|
+
tintOpacity: 0.55,
|
|
214
|
+
shadowOpacity: 0.24,
|
|
215
|
+
shadowRadius: 36,
|
|
216
|
+
shadowY: 12
|
|
217
|
+
},
|
|
218
|
+
5: {
|
|
219
|
+
blur: 72,
|
|
220
|
+
tintOpacity: 0.45,
|
|
221
|
+
shadowOpacity: 0.32,
|
|
222
|
+
shadowRadius: 48,
|
|
223
|
+
shadowY: 20
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
// Highlight: top-edge shimmer — creates the "wet glass" refraction
|
|
227
|
+
highlight: {
|
|
228
|
+
none: "transparent",
|
|
229
|
+
subtle: "rgba(255,255,255,0.20)",
|
|
230
|
+
medium: "rgba(255,255,255,0.38)",
|
|
231
|
+
strong: "rgba(255,255,255,0.55)",
|
|
232
|
+
intense: "rgba(255,255,255,0.72)"
|
|
233
|
+
},
|
|
234
|
+
// Highlight gradient: gradient from highlight to transparent (vertical)
|
|
235
|
+
highlightGradientEnd: "transparent",
|
|
236
|
+
// Border: glass edge line — makes glass surfaces feel distinct
|
|
237
|
+
border: {
|
|
238
|
+
light: {
|
|
239
|
+
subtle: "rgba(255,255,255,0.20)",
|
|
240
|
+
medium: "rgba(255,255,255,0.32)",
|
|
241
|
+
strong: "rgba(255,255,255,0.50)"
|
|
242
|
+
},
|
|
243
|
+
dark: {
|
|
244
|
+
subtle: "rgba(255,255,255,0.08)",
|
|
245
|
+
medium: "rgba(255,255,255,0.14)",
|
|
246
|
+
strong: "rgba(255,255,255,0.22)"
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
// Glow: ambient glow emitted from glass surfaces
|
|
250
|
+
glow: {
|
|
251
|
+
primary: { color: "#6366f1", radius: 24, opacity: 0.35 },
|
|
252
|
+
blue: { color: "#3b82f6", radius: 24, opacity: 0.35 },
|
|
253
|
+
cyan: { color: "#06b6d4", radius: 20, opacity: 0.4 },
|
|
254
|
+
rose: { color: "#f43f5e", radius: 20, opacity: 0.35 },
|
|
255
|
+
success: { color: "#10b981", radius: 20, opacity: 0.3 },
|
|
256
|
+
warning: { color: "#f59e0b", radius: 20, opacity: 0.3 }
|
|
257
|
+
},
|
|
258
|
+
// Vibrancy mode — controls how aggressively colors pop through glass
|
|
259
|
+
vibrancy: {
|
|
260
|
+
none: { saturation: 1, brightness: 1 },
|
|
261
|
+
subtle: { saturation: 1.1, brightness: 1.02 },
|
|
262
|
+
medium: { saturation: 1.2, brightness: 1.04 },
|
|
263
|
+
vivid: { saturation: 1.4, brightness: 1.06 }
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
// src/tokens/spacing.ts
|
|
268
|
+
var spacing = {
|
|
269
|
+
0: 0,
|
|
270
|
+
px: 1,
|
|
271
|
+
0.5: 2,
|
|
272
|
+
1: 4,
|
|
273
|
+
1.5: 6,
|
|
274
|
+
2: 8,
|
|
275
|
+
2.5: 10,
|
|
276
|
+
3: 12,
|
|
277
|
+
3.5: 14,
|
|
278
|
+
4: 16,
|
|
279
|
+
5: 20,
|
|
280
|
+
6: 24,
|
|
281
|
+
7: 28,
|
|
282
|
+
8: 32,
|
|
283
|
+
9: 36,
|
|
284
|
+
10: 40,
|
|
285
|
+
11: 44,
|
|
286
|
+
12: 48,
|
|
287
|
+
14: 56,
|
|
288
|
+
16: 64,
|
|
289
|
+
20: 80,
|
|
290
|
+
24: 96,
|
|
291
|
+
28: 112,
|
|
292
|
+
32: 128,
|
|
293
|
+
36: 144,
|
|
294
|
+
40: 160,
|
|
295
|
+
48: 192,
|
|
296
|
+
56: 224,
|
|
297
|
+
64: 256
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
// src/tokens/radii.ts
|
|
301
|
+
var radii = {
|
|
302
|
+
none: 0,
|
|
303
|
+
xs: 4,
|
|
304
|
+
sm: 6,
|
|
305
|
+
md: 8,
|
|
306
|
+
lg: 12,
|
|
307
|
+
xl: 16,
|
|
308
|
+
"2xl": 20,
|
|
309
|
+
"3xl": 24,
|
|
310
|
+
"4xl": 32,
|
|
311
|
+
full: 9999
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
// src/tokens/typography.ts
|
|
315
|
+
var fontFamily = {
|
|
316
|
+
sans: "System",
|
|
317
|
+
mono: "Courier"
|
|
318
|
+
// Override with custom fonts via ThemeProvider:
|
|
319
|
+
// fontFamily: { sans: 'Inter_400Regular', ... }
|
|
320
|
+
};
|
|
321
|
+
var fontSize = {
|
|
322
|
+
"2xs": 10,
|
|
323
|
+
xs: 12,
|
|
324
|
+
sm: 13,
|
|
325
|
+
base: 15,
|
|
326
|
+
md: 15,
|
|
327
|
+
lg: 17,
|
|
328
|
+
xl: 19,
|
|
329
|
+
"2xl": 22,
|
|
330
|
+
"3xl": 26,
|
|
331
|
+
"4xl": 32,
|
|
332
|
+
"5xl": 40,
|
|
333
|
+
"6xl": 52,
|
|
334
|
+
"7xl": 64
|
|
335
|
+
};
|
|
336
|
+
var lineHeight = {
|
|
337
|
+
none: 1,
|
|
338
|
+
tight: 1.2,
|
|
339
|
+
snug: 1.35,
|
|
340
|
+
normal: 1.5,
|
|
341
|
+
relaxed: 1.625,
|
|
342
|
+
loose: 2
|
|
343
|
+
};
|
|
344
|
+
var fontWeight = {
|
|
345
|
+
thin: "100",
|
|
346
|
+
extralight: "200",
|
|
347
|
+
light: "300",
|
|
348
|
+
normal: "400",
|
|
349
|
+
medium: "500",
|
|
350
|
+
semibold: "600",
|
|
351
|
+
bold: "700",
|
|
352
|
+
extrabold: "800",
|
|
353
|
+
black: "900"
|
|
354
|
+
};
|
|
355
|
+
var letterSpacing = {
|
|
356
|
+
tighter: -0.8,
|
|
357
|
+
tight: -0.4,
|
|
358
|
+
normal: 0,
|
|
359
|
+
wide: 0.4,
|
|
360
|
+
wider: 0.8,
|
|
361
|
+
widest: 1.6
|
|
362
|
+
};
|
|
363
|
+
var typography = {
|
|
364
|
+
fontFamily,
|
|
365
|
+
fontSize,
|
|
366
|
+
lineHeight,
|
|
367
|
+
fontWeight,
|
|
368
|
+
letterSpacing
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
// src/tokens/shadows.ts
|
|
372
|
+
var shadows = {
|
|
373
|
+
none: {
|
|
374
|
+
ios: {
|
|
375
|
+
shadowColor: "transparent",
|
|
376
|
+
shadowOffset: { width: 0, height: 0 },
|
|
377
|
+
shadowOpacity: 0,
|
|
378
|
+
shadowRadius: 0
|
|
379
|
+
},
|
|
380
|
+
android: { elevation: 0 }
|
|
381
|
+
},
|
|
382
|
+
xs: {
|
|
383
|
+
ios: {
|
|
384
|
+
shadowColor: "#000",
|
|
385
|
+
shadowOffset: { width: 0, height: 1 },
|
|
386
|
+
shadowOpacity: 0.05,
|
|
387
|
+
shadowRadius: 2
|
|
388
|
+
},
|
|
389
|
+
android: { elevation: 1 }
|
|
390
|
+
},
|
|
391
|
+
sm: {
|
|
392
|
+
ios: {
|
|
393
|
+
shadowColor: "#000",
|
|
394
|
+
shadowOffset: { width: 0, height: 2 },
|
|
395
|
+
shadowOpacity: 0.08,
|
|
396
|
+
shadowRadius: 4
|
|
397
|
+
},
|
|
398
|
+
android: { elevation: 2 }
|
|
399
|
+
},
|
|
400
|
+
md: {
|
|
401
|
+
ios: {
|
|
402
|
+
shadowColor: "#000",
|
|
403
|
+
shadowOffset: { width: 0, height: 4 },
|
|
404
|
+
shadowOpacity: 0.12,
|
|
405
|
+
shadowRadius: 8
|
|
406
|
+
},
|
|
407
|
+
android: { elevation: 4 }
|
|
408
|
+
},
|
|
409
|
+
lg: {
|
|
410
|
+
ios: {
|
|
411
|
+
shadowColor: "#000",
|
|
412
|
+
shadowOffset: { width: 0, height: 8 },
|
|
413
|
+
shadowOpacity: 0.15,
|
|
414
|
+
shadowRadius: 16
|
|
415
|
+
},
|
|
416
|
+
android: { elevation: 8 }
|
|
417
|
+
},
|
|
418
|
+
xl: {
|
|
419
|
+
ios: {
|
|
420
|
+
shadowColor: "#000",
|
|
421
|
+
shadowOffset: { width: 0, height: 12 },
|
|
422
|
+
shadowOpacity: 0.18,
|
|
423
|
+
shadowRadius: 24
|
|
424
|
+
},
|
|
425
|
+
android: { elevation: 12 }
|
|
426
|
+
},
|
|
427
|
+
"2xl": {
|
|
428
|
+
ios: {
|
|
429
|
+
shadowColor: "#000",
|
|
430
|
+
shadowOffset: { width: 0, height: 20 },
|
|
431
|
+
shadowOpacity: 0.22,
|
|
432
|
+
shadowRadius: 40
|
|
433
|
+
},
|
|
434
|
+
android: { elevation: 20 }
|
|
435
|
+
},
|
|
436
|
+
// Glass-specific: colored shadows for glowing surfaces
|
|
437
|
+
glassGlow: {
|
|
438
|
+
ios: {
|
|
439
|
+
shadowColor: "#6366f1",
|
|
440
|
+
shadowOffset: { width: 0, height: 8 },
|
|
441
|
+
shadowOpacity: 0.4,
|
|
442
|
+
shadowRadius: 24
|
|
443
|
+
},
|
|
444
|
+
android: { elevation: 12 }
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
// src/tokens/motion.ts
|
|
449
|
+
var duration = {
|
|
450
|
+
instant: 50,
|
|
451
|
+
fast: 120,
|
|
452
|
+
normal: 220,
|
|
453
|
+
slow: 380,
|
|
454
|
+
verySlow: 550,
|
|
455
|
+
// Glass-specific: blur fades need slightly longer to feel smooth
|
|
456
|
+
blurIn: 280,
|
|
457
|
+
blurOut: 180,
|
|
458
|
+
// Entrance animations
|
|
459
|
+
enter: 300,
|
|
460
|
+
exit: 200
|
|
461
|
+
// Spring-based don't use duration — see springs below
|
|
462
|
+
};
|
|
463
|
+
var easing = {
|
|
464
|
+
// Cubic bezier definitions for Reanimated's `withTiming`
|
|
465
|
+
// Use `Easing.bezier(x1, y1, x2, y2)` in Reanimated code
|
|
466
|
+
standard: [0.4, 0, 0.2, 1],
|
|
467
|
+
// most transitions
|
|
468
|
+
decelerate: [0, 0, 0.2, 1],
|
|
469
|
+
// elements entering viewport
|
|
470
|
+
accelerate: [0.4, 0, 1, 1],
|
|
471
|
+
// elements leaving viewport
|
|
472
|
+
sharp: [0.4, 0, 0.6, 1]
|
|
473
|
+
// quick attention-grabbing
|
|
474
|
+
};
|
|
475
|
+
var springs = {
|
|
476
|
+
// iOS-style: fast, confident, no overshoot
|
|
477
|
+
snappy: {
|
|
478
|
+
damping: 22,
|
|
479
|
+
stiffness: 420,
|
|
480
|
+
mass: 0.8,
|
|
481
|
+
overshootClamping: false
|
|
482
|
+
},
|
|
483
|
+
// The liquid glass spring: physical, fluid, slight wobble
|
|
484
|
+
liquid: {
|
|
485
|
+
damping: 15,
|
|
486
|
+
stiffness: 280,
|
|
487
|
+
mass: 1,
|
|
488
|
+
overshootClamping: false
|
|
489
|
+
},
|
|
490
|
+
// Reveal: for blurs fading in, dialogs mounting
|
|
491
|
+
reveal: {
|
|
492
|
+
damping: 30,
|
|
493
|
+
stiffness: 200,
|
|
494
|
+
mass: 1.2,
|
|
495
|
+
overshootClamping: false
|
|
496
|
+
},
|
|
497
|
+
// Bounce: FAB, badges, notification pops
|
|
498
|
+
bounce: {
|
|
499
|
+
damping: 8,
|
|
500
|
+
stiffness: 340,
|
|
501
|
+
mass: 0.7,
|
|
502
|
+
overshootClamping: false
|
|
503
|
+
},
|
|
504
|
+
// Precise: sliders, progress — no overshoot
|
|
505
|
+
precise: {
|
|
506
|
+
damping: 40,
|
|
507
|
+
stiffness: 300,
|
|
508
|
+
mass: 1,
|
|
509
|
+
overshootClamping: true
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
var reducedMotion = {
|
|
513
|
+
duration: {
|
|
514
|
+
instant: 0,
|
|
515
|
+
fast: 0,
|
|
516
|
+
normal: 50,
|
|
517
|
+
slow: 80,
|
|
518
|
+
verySlow: 100,
|
|
519
|
+
blurIn: 80,
|
|
520
|
+
blurOut: 60,
|
|
521
|
+
enter: 80,
|
|
522
|
+
exit: 60
|
|
523
|
+
},
|
|
524
|
+
springs: {
|
|
525
|
+
snappy: { damping: 40, stiffness: 400, mass: 1 },
|
|
526
|
+
liquid: { damping: 40, stiffness: 400, mass: 1 },
|
|
527
|
+
reveal: { damping: 40, stiffness: 400, mass: 1 },
|
|
528
|
+
bounce: { damping: 40, stiffness: 400, mass: 1 },
|
|
529
|
+
precise: { damping: 40, stiffness: 400, mass: 1 }
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
var motion = { duration, easing, springs, reducedMotion };
|
|
533
|
+
|
|
534
|
+
// src/themes/base.ts
|
|
535
|
+
var lightColors = {
|
|
536
|
+
primary: palette.indigo[500],
|
|
537
|
+
primaryHover: palette.indigo[600],
|
|
538
|
+
primaryFocused: palette.indigo[400],
|
|
539
|
+
primarySubtle: palette.indigo[50],
|
|
540
|
+
primaryMuted: "rgba(99,102,241,0.12)",
|
|
541
|
+
secondary: palette.violet[500],
|
|
542
|
+
secondaryHover: palette.violet[600],
|
|
543
|
+
secondarySubtle: palette.violet[50],
|
|
544
|
+
success: palette.emerald[500],
|
|
545
|
+
successSubtle: palette.emerald[50],
|
|
546
|
+
successText: palette.emerald[700],
|
|
547
|
+
warning: palette.amber[500],
|
|
548
|
+
warningSubtle: palette.amber[50],
|
|
549
|
+
warningText: palette.amber[700],
|
|
550
|
+
error: palette.rose[500],
|
|
551
|
+
errorHover: palette.rose[600],
|
|
552
|
+
errorSubtle: palette.rose[50],
|
|
553
|
+
errorText: palette.rose[700],
|
|
554
|
+
info: palette.cyan[500],
|
|
555
|
+
infoSubtle: palette.cyan[50],
|
|
556
|
+
infoText: palette.cyan[700],
|
|
557
|
+
background: palette.neutral[50],
|
|
558
|
+
backgroundDeep: palette.neutral[100],
|
|
559
|
+
surface: palette.neutral[0],
|
|
560
|
+
surfaceRaised: palette.neutral[0],
|
|
561
|
+
surfaceOverlay: palette.neutral[0],
|
|
562
|
+
text: palette.neutral[900],
|
|
563
|
+
textSecondary: palette.neutral[600],
|
|
564
|
+
textMuted: palette.neutral[400],
|
|
565
|
+
textDisabled: palette.neutral[300],
|
|
566
|
+
textInverted: palette.neutral[0],
|
|
567
|
+
border: palette.neutral[200],
|
|
568
|
+
borderSubtle: palette.neutral[100],
|
|
569
|
+
borderStrong: palette.neutral[300],
|
|
570
|
+
neutral: palette.neutral[600],
|
|
571
|
+
neutralSubtle: palette.neutral[100]
|
|
572
|
+
};
|
|
573
|
+
var baseTheme = {
|
|
574
|
+
colors: lightColors,
|
|
575
|
+
glass: glassTokens,
|
|
576
|
+
spacing,
|
|
577
|
+
radii,
|
|
578
|
+
typography,
|
|
579
|
+
shadows,
|
|
580
|
+
motion
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
// src/themes/dark.ts
|
|
584
|
+
var darkColors = {
|
|
585
|
+
primary: palette.indigo[400],
|
|
586
|
+
primaryHover: palette.indigo[300],
|
|
587
|
+
primaryFocused: palette.indigo[500],
|
|
588
|
+
primarySubtle: "rgba(99,102,241,0.15)",
|
|
589
|
+
primaryMuted: "rgba(99,102,241,0.10)",
|
|
590
|
+
secondary: palette.violet[400],
|
|
591
|
+
secondaryHover: palette.violet[300],
|
|
592
|
+
secondarySubtle: "rgba(139,92,246,0.15)",
|
|
593
|
+
success: palette.emerald[400],
|
|
594
|
+
successSubtle: "rgba(16,185,129,0.15)",
|
|
595
|
+
successText: palette.emerald[300],
|
|
596
|
+
warning: palette.amber[400],
|
|
597
|
+
warningSubtle: "rgba(245,158,11,0.15)",
|
|
598
|
+
warningText: palette.amber[300],
|
|
599
|
+
error: palette.rose[400],
|
|
600
|
+
errorHover: palette.rose[300],
|
|
601
|
+
errorSubtle: "rgba(244,63,94,0.15)",
|
|
602
|
+
errorText: palette.rose[300],
|
|
603
|
+
info: palette.cyan[400],
|
|
604
|
+
infoSubtle: "rgba(6,182,212,0.15)",
|
|
605
|
+
infoText: palette.cyan[300],
|
|
606
|
+
background: "#0c0c14",
|
|
607
|
+
backgroundDeep: "#08080f",
|
|
608
|
+
surface: "#13131f",
|
|
609
|
+
surfaceRaised: "#1a1a2e",
|
|
610
|
+
surfaceOverlay: "rgba(13,13,25,0.95)",
|
|
611
|
+
text: palette.neutral[50],
|
|
612
|
+
textSecondary: palette.neutral[300],
|
|
613
|
+
textMuted: palette.neutral[500],
|
|
614
|
+
textDisabled: palette.neutral[700],
|
|
615
|
+
textInverted: palette.neutral[900],
|
|
616
|
+
border: palette.neutral[800],
|
|
617
|
+
borderSubtle: palette.neutral[900],
|
|
618
|
+
borderStrong: palette.neutral[700],
|
|
619
|
+
neutral: palette.neutral[400],
|
|
620
|
+
neutralSubtle: "rgba(255,255,255,0.06)"
|
|
621
|
+
};
|
|
622
|
+
var ThemeContext = react.createContext(null);
|
|
623
|
+
function ThemeProvider({
|
|
624
|
+
theme: themeOverrides,
|
|
625
|
+
colorScheme: initialPreference = "system",
|
|
626
|
+
children
|
|
627
|
+
}) {
|
|
628
|
+
const systemColorScheme = reactNative.useColorScheme() === "dark" ? "dark" : "light";
|
|
629
|
+
const [preference, setPreference] = react.useState(initialPreference);
|
|
630
|
+
const resolvedScheme = preference === "system" ? systemColorScheme : preference;
|
|
631
|
+
const setColorScheme = react.useCallback((scheme) => {
|
|
632
|
+
setPreference(scheme);
|
|
633
|
+
}, []);
|
|
634
|
+
const resolvedTheme = react.useMemo(() => {
|
|
635
|
+
let result = { ...baseTheme };
|
|
636
|
+
if (resolvedScheme === "dark") {
|
|
637
|
+
result = { ...result, colors: darkColors };
|
|
638
|
+
}
|
|
639
|
+
if (themeOverrides) {
|
|
640
|
+
result = reactnativelyUtils.deepMerge(
|
|
641
|
+
result,
|
|
642
|
+
themeOverrides
|
|
643
|
+
);
|
|
644
|
+
}
|
|
645
|
+
return result;
|
|
646
|
+
}, [themeOverrides, resolvedScheme]);
|
|
647
|
+
const value = react.useMemo(
|
|
648
|
+
() => ({
|
|
649
|
+
theme: resolvedTheme,
|
|
650
|
+
colorScheme: resolvedScheme,
|
|
651
|
+
colorSchemePreference: preference,
|
|
652
|
+
setColorScheme,
|
|
653
|
+
isDark: resolvedScheme === "dark",
|
|
654
|
+
isLight: resolvedScheme === "light"
|
|
655
|
+
}),
|
|
656
|
+
[resolvedTheme, resolvedScheme, preference, setColorScheme]
|
|
657
|
+
);
|
|
658
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value, children });
|
|
659
|
+
}
|
|
660
|
+
function useTheme() {
|
|
661
|
+
const ctx = react.useContext(ThemeContext);
|
|
662
|
+
if (!ctx) {
|
|
663
|
+
throw new Error(
|
|
664
|
+
"[Reactnatively] useTheme must be called within a <ThemeProvider>. Wrap your app root with <ThemeProvider>."
|
|
665
|
+
);
|
|
666
|
+
}
|
|
667
|
+
return ctx;
|
|
668
|
+
}
|
|
669
|
+
function useColorScheme() {
|
|
670
|
+
return useTheme().colorScheme;
|
|
671
|
+
}
|
|
672
|
+
function useIsDark() {
|
|
673
|
+
return useTheme().isDark;
|
|
674
|
+
}
|
|
675
|
+
function useToken(key) {
|
|
676
|
+
const { theme } = useTheme();
|
|
677
|
+
return theme[key];
|
|
678
|
+
}
|
|
679
|
+
function createTheme(overrides) {
|
|
680
|
+
return reactnativelyUtils.deepMerge(
|
|
681
|
+
baseTheme,
|
|
682
|
+
overrides
|
|
683
|
+
);
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
exports.ThemeProvider = ThemeProvider;
|
|
687
|
+
exports.baseTheme = baseTheme;
|
|
688
|
+
exports.createTheme = createTheme;
|
|
689
|
+
exports.duration = duration;
|
|
690
|
+
exports.easing = easing;
|
|
691
|
+
exports.fontFamily = fontFamily;
|
|
692
|
+
exports.fontSize = fontSize;
|
|
693
|
+
exports.fontWeight = fontWeight;
|
|
694
|
+
exports.glassTokens = glassTokens;
|
|
695
|
+
exports.letterSpacing = letterSpacing;
|
|
696
|
+
exports.lineHeight = lineHeight;
|
|
697
|
+
exports.motion = motion;
|
|
698
|
+
exports.palette = palette;
|
|
699
|
+
exports.radii = radii;
|
|
700
|
+
exports.reducedMotion = reducedMotion;
|
|
701
|
+
exports.shadows = shadows;
|
|
702
|
+
exports.spacing = spacing;
|
|
703
|
+
exports.springs = springs;
|
|
704
|
+
exports.typography = typography;
|
|
705
|
+
exports.useColorScheme = useColorScheme;
|
|
706
|
+
exports.useIsDark = useIsDark;
|
|
707
|
+
exports.useTheme = useTheme;
|
|
708
|
+
exports.useToken = useToken;
|
|
709
|
+
//# sourceMappingURL=index.js.map
|
|
710
|
+
//# sourceMappingURL=index.js.map
|