@oxyhq/bloom 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/react-native-css.d.js +2 -0
- package/lib/commonjs/react-native-css.d.js.map +1 -0
- package/lib/commonjs/theme/BloomThemeProvider.js +39 -7
- package/lib/commonjs/theme/BloomThemeProvider.js.map +1 -1
- package/lib/commonjs/theme/color-presets.js +118 -118
- package/lib/commonjs/theme/color-presets.js.map +1 -1
- package/lib/commonjs/theme/color-scope/index.js +28 -6
- package/lib/commonjs/theme/color-scope/index.js.map +1 -1
- package/lib/commonjs/theme/color-scope/style-builder.js +35 -0
- package/lib/commonjs/theme/color-scope/style-builder.js.map +1 -1
- package/lib/commonjs/theme/native-root-vars.js +105 -0
- package/lib/commonjs/theme/native-root-vars.js.map +1 -0
- package/lib/commonjs/theme/native-root-vars.web.js +27 -0
- package/lib/commonjs/theme/native-root-vars.web.js.map +1 -0
- package/lib/commonjs/theme/preset-vars.js +4 -1
- package/lib/commonjs/theme/preset-vars.js.map +1 -1
- package/lib/module/react-native-css.d.js +2 -0
- package/lib/module/react-native-css.d.js.map +1 -0
- package/lib/module/theme/BloomThemeProvider.js +40 -8
- package/lib/module/theme/BloomThemeProvider.js.map +1 -1
- package/lib/module/theme/color-presets.js +118 -118
- package/lib/module/theme/color-presets.js.map +1 -1
- package/lib/module/theme/color-scope/index.js +29 -7
- package/lib/module/theme/color-scope/index.js.map +1 -1
- package/lib/module/theme/color-scope/style-builder.js +35 -0
- package/lib/module/theme/color-scope/style-builder.js.map +1 -1
- package/lib/module/theme/native-root-vars.js +101 -0
- package/lib/module/theme/native-root-vars.js.map +1 -0
- package/lib/module/theme/native-root-vars.web.js +23 -0
- package/lib/module/theme/native-root-vars.web.js.map +1 -0
- package/lib/module/theme/preset-vars.js +4 -1
- package/lib/module/theme/preset-vars.js.map +1 -1
- package/lib/typescript/commonjs/icons/common.d.ts +8 -8
- package/lib/typescript/commonjs/theme/BloomThemeProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/index.d.ts +9 -2
- package/lib/typescript/commonjs/theme/color-scope/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/style-builder.d.ts +32 -0
- package/lib/typescript/commonjs/theme/color-scope/style-builder.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/native-root-vars.d.ts +89 -0
- package/lib/typescript/commonjs/theme/native-root-vars.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/native-root-vars.web.d.ts +20 -0
- package/lib/typescript/commonjs/theme/native-root-vars.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/preset-vars.d.ts.map +1 -1
- package/lib/typescript/module/icons/common.d.ts +8 -8
- package/lib/typescript/module/theme/BloomThemeProvider.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/index.d.ts +9 -2
- package/lib/typescript/module/theme/color-scope/index.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/style-builder.d.ts +32 -0
- package/lib/typescript/module/theme/color-scope/style-builder.d.ts.map +1 -1
- package/lib/typescript/module/theme/native-root-vars.d.ts +89 -0
- package/lib/typescript/module/theme/native-root-vars.d.ts.map +1 -0
- package/lib/typescript/module/theme/native-root-vars.web.d.ts +20 -0
- package/lib/typescript/module/theme/native-root-vars.web.d.ts.map +1 -0
- package/lib/typescript/module/theme/preset-vars.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/native-root-vars.test.ts +125 -0
- package/src/react-native-css.d.ts +69 -0
- package/src/theme/BloomThemeProvider.tsx +32 -6
- package/src/theme/color-presets.ts +118 -118
- package/src/theme/color-scope/index.tsx +30 -8
- package/src/theme/color-scope/style-builder.ts +40 -0
- package/src/theme/native-root-vars.ts +102 -0
- package/src/theme/native-root-vars.web.ts +22 -0
- package/src/theme/preset-vars.ts +4 -1
|
@@ -53,25 +53,25 @@ export const APP_COLOR_PRESETS: Record<AppColorName, AppColorPreset> = {
|
|
|
53
53
|
name: 'teal',
|
|
54
54
|
hex: '#005c67',
|
|
55
55
|
light: {
|
|
56
|
-
'--background': '
|
|
56
|
+
'--background': '185 8% 99%',
|
|
57
57
|
'--foreground': '0 0% 12%',
|
|
58
|
-
'--surface': '185
|
|
58
|
+
'--surface': '185 14% 97%',
|
|
59
59
|
'--surface-foreground': '0 0% 12%',
|
|
60
|
-
'--popover': '
|
|
60
|
+
'--popover': '185 12% 99%',
|
|
61
61
|
'--popover-foreground': '0 0% 12%',
|
|
62
62
|
'--primary': '185 100% 20%',
|
|
63
63
|
'--primary-foreground': '0 0% 100%',
|
|
64
|
-
'--secondary': '185
|
|
64
|
+
'--secondary': '185 12% 95%',
|
|
65
65
|
'--secondary-foreground': '0 0% 12%',
|
|
66
|
-
'--muted': '185
|
|
66
|
+
'--muted': '185 12% 95%',
|
|
67
67
|
'--muted-foreground': '185 5% 42%',
|
|
68
|
-
'--accent': '185
|
|
68
|
+
'--accent': '185 12% 95%',
|
|
69
69
|
'--accent-foreground': '0 0% 12%',
|
|
70
70
|
'--destructive': '0 84% 60%',
|
|
71
|
-
'--border': '185
|
|
72
|
-
'--input': '185
|
|
71
|
+
'--border': '185 14% 88%',
|
|
72
|
+
'--input': '185 14% 88%',
|
|
73
73
|
'--ring': '185 100% 20%',
|
|
74
|
-
'--sidebar': '185
|
|
74
|
+
'--sidebar': '185 14% 97%',
|
|
75
75
|
},
|
|
76
76
|
dark: {
|
|
77
77
|
'--background': '185 50% 5%',
|
|
@@ -100,25 +100,25 @@ export const APP_COLOR_PRESETS: Record<AppColorName, AppColorPreset> = {
|
|
|
100
100
|
name: 'blue',
|
|
101
101
|
hex: '#1D9BF0',
|
|
102
102
|
light: {
|
|
103
|
-
'--background': '
|
|
103
|
+
'--background': '205 8% 99%',
|
|
104
104
|
'--foreground': '0 0% 12%',
|
|
105
|
-
'--surface': '205
|
|
105
|
+
'--surface': '205 14% 97%',
|
|
106
106
|
'--surface-foreground': '0 0% 12%',
|
|
107
|
-
'--popover': '
|
|
107
|
+
'--popover': '205 12% 99%',
|
|
108
108
|
'--popover-foreground': '0 0% 12%',
|
|
109
109
|
'--primary': '205 87% 53%',
|
|
110
110
|
'--primary-foreground': '0 0% 100%',
|
|
111
|
-
'--secondary': '205
|
|
111
|
+
'--secondary': '205 12% 95%',
|
|
112
112
|
'--secondary-foreground': '0 0% 12%',
|
|
113
|
-
'--muted': '205
|
|
113
|
+
'--muted': '205 12% 95%',
|
|
114
114
|
'--muted-foreground': '205 5% 42%',
|
|
115
|
-
'--accent': '205
|
|
115
|
+
'--accent': '205 12% 95%',
|
|
116
116
|
'--accent-foreground': '0 0% 12%',
|
|
117
117
|
'--destructive': '0 84% 60%',
|
|
118
|
-
'--border': '205
|
|
119
|
-
'--input': '205
|
|
118
|
+
'--border': '205 14% 88%',
|
|
119
|
+
'--input': '205 14% 88%',
|
|
120
120
|
'--ring': '205 87% 53%',
|
|
121
|
-
'--sidebar': '205
|
|
121
|
+
'--sidebar': '205 14% 97%',
|
|
122
122
|
},
|
|
123
123
|
dark: {
|
|
124
124
|
'--background': '205 50% 5%',
|
|
@@ -147,25 +147,25 @@ export const APP_COLOR_PRESETS: Record<AppColorName, AppColorPreset> = {
|
|
|
147
147
|
name: 'green',
|
|
148
148
|
hex: '#10B981',
|
|
149
149
|
light: {
|
|
150
|
-
'--background': '
|
|
150
|
+
'--background': '160 8% 99%',
|
|
151
151
|
'--foreground': '0 0% 12%',
|
|
152
|
-
'--surface': '160
|
|
152
|
+
'--surface': '160 14% 97%',
|
|
153
153
|
'--surface-foreground': '0 0% 12%',
|
|
154
|
-
'--popover': '
|
|
154
|
+
'--popover': '160 12% 99%',
|
|
155
155
|
'--popover-foreground': '0 0% 12%',
|
|
156
156
|
'--primary': '160 84% 39%',
|
|
157
157
|
'--primary-foreground': '0 0% 100%',
|
|
158
|
-
'--secondary': '160
|
|
158
|
+
'--secondary': '160 12% 95%',
|
|
159
159
|
'--secondary-foreground': '0 0% 12%',
|
|
160
|
-
'--muted': '160
|
|
160
|
+
'--muted': '160 12% 95%',
|
|
161
161
|
'--muted-foreground': '160 5% 42%',
|
|
162
|
-
'--accent': '160
|
|
162
|
+
'--accent': '160 12% 95%',
|
|
163
163
|
'--accent-foreground': '0 0% 12%',
|
|
164
164
|
'--destructive': '0 84% 60%',
|
|
165
|
-
'--border': '160
|
|
166
|
-
'--input': '160
|
|
165
|
+
'--border': '160 14% 88%',
|
|
166
|
+
'--input': '160 14% 88%',
|
|
167
167
|
'--ring': '160 84% 39%',
|
|
168
|
-
'--sidebar': '160
|
|
168
|
+
'--sidebar': '160 14% 97%',
|
|
169
169
|
},
|
|
170
170
|
dark: {
|
|
171
171
|
'--background': '160 50% 5%',
|
|
@@ -194,25 +194,25 @@ export const APP_COLOR_PRESETS: Record<AppColorName, AppColorPreset> = {
|
|
|
194
194
|
name: 'amber',
|
|
195
195
|
hex: '#F59E0B',
|
|
196
196
|
light: {
|
|
197
|
-
'--background': '
|
|
197
|
+
'--background': '38 8% 99%',
|
|
198
198
|
'--foreground': '0 0% 12%',
|
|
199
|
-
'--surface': '38
|
|
199
|
+
'--surface': '38 14% 97%',
|
|
200
200
|
'--surface-foreground': '0 0% 12%',
|
|
201
|
-
'--popover': '
|
|
201
|
+
'--popover': '38 12% 99%',
|
|
202
202
|
'--popover-foreground': '0 0% 12%',
|
|
203
203
|
'--primary': '38 92% 50%',
|
|
204
204
|
'--primary-foreground': '0 0% 0%',
|
|
205
|
-
'--secondary': '38
|
|
205
|
+
'--secondary': '38 12% 95%',
|
|
206
206
|
'--secondary-foreground': '0 0% 12%',
|
|
207
|
-
'--muted': '38
|
|
207
|
+
'--muted': '38 12% 95%',
|
|
208
208
|
'--muted-foreground': '38 5% 42%',
|
|
209
|
-
'--accent': '38
|
|
209
|
+
'--accent': '38 12% 95%',
|
|
210
210
|
'--accent-foreground': '0 0% 12%',
|
|
211
211
|
'--destructive': '0 84% 60%',
|
|
212
|
-
'--border': '38
|
|
213
|
-
'--input': '38
|
|
212
|
+
'--border': '38 14% 88%',
|
|
213
|
+
'--input': '38 14% 88%',
|
|
214
214
|
'--ring': '38 92% 50%',
|
|
215
|
-
'--sidebar': '38
|
|
215
|
+
'--sidebar': '38 14% 97%',
|
|
216
216
|
},
|
|
217
217
|
dark: {
|
|
218
218
|
'--background': '38 50% 5%',
|
|
@@ -241,25 +241,25 @@ export const APP_COLOR_PRESETS: Record<AppColorName, AppColorPreset> = {
|
|
|
241
241
|
name: 'yellow',
|
|
242
242
|
hex: '#ffc300',
|
|
243
243
|
light: {
|
|
244
|
-
'--background': '
|
|
244
|
+
'--background': '46 8% 99%',
|
|
245
245
|
'--foreground': '0 0% 12%',
|
|
246
|
-
'--surface': '46
|
|
246
|
+
'--surface': '46 14% 97%',
|
|
247
247
|
'--surface-foreground': '0 0% 12%',
|
|
248
|
-
'--popover': '
|
|
248
|
+
'--popover': '46 12% 99%',
|
|
249
249
|
'--popover-foreground': '0 0% 12%',
|
|
250
250
|
'--primary': '46 100% 50%',
|
|
251
251
|
'--primary-foreground': '0 0% 0%',
|
|
252
|
-
'--secondary': '46
|
|
252
|
+
'--secondary': '46 12% 95%',
|
|
253
253
|
'--secondary-foreground': '0 0% 12%',
|
|
254
|
-
'--muted': '46
|
|
254
|
+
'--muted': '46 12% 95%',
|
|
255
255
|
'--muted-foreground': '46 5% 42%',
|
|
256
|
-
'--accent': '46
|
|
256
|
+
'--accent': '46 12% 95%',
|
|
257
257
|
'--accent-foreground': '0 0% 12%',
|
|
258
258
|
'--destructive': '0 84% 60%',
|
|
259
|
-
'--border': '46
|
|
260
|
-
'--input': '46
|
|
259
|
+
'--border': '46 14% 88%',
|
|
260
|
+
'--input': '46 14% 88%',
|
|
261
261
|
'--ring': '46 100% 50%',
|
|
262
|
-
'--sidebar': '46
|
|
262
|
+
'--sidebar': '46 14% 97%',
|
|
263
263
|
},
|
|
264
264
|
dark: {
|
|
265
265
|
'--background': '46 50% 5%',
|
|
@@ -288,25 +288,25 @@ export const APP_COLOR_PRESETS: Record<AppColorName, AppColorPreset> = {
|
|
|
288
288
|
name: 'red',
|
|
289
289
|
hex: '#EF4444',
|
|
290
290
|
light: {
|
|
291
|
-
'--background': '0
|
|
291
|
+
'--background': '0 8% 99%',
|
|
292
292
|
'--foreground': '0 0% 12%',
|
|
293
|
-
'--surface': '0
|
|
293
|
+
'--surface': '0 14% 97%',
|
|
294
294
|
'--surface-foreground': '0 0% 12%',
|
|
295
|
-
'--popover': '0
|
|
295
|
+
'--popover': '0 12% 99%',
|
|
296
296
|
'--popover-foreground': '0 0% 12%',
|
|
297
297
|
'--primary': '0 84% 60%',
|
|
298
298
|
'--primary-foreground': '0 0% 100%',
|
|
299
|
-
'--secondary': '0
|
|
299
|
+
'--secondary': '0 12% 95%',
|
|
300
300
|
'--secondary-foreground': '0 0% 12%',
|
|
301
|
-
'--muted': '0
|
|
301
|
+
'--muted': '0 12% 95%',
|
|
302
302
|
'--muted-foreground': '0 5% 42%',
|
|
303
|
-
'--accent': '0
|
|
303
|
+
'--accent': '0 12% 95%',
|
|
304
304
|
'--accent-foreground': '0 0% 12%',
|
|
305
305
|
'--destructive': '0 84% 60%',
|
|
306
|
-
'--border': '0
|
|
307
|
-
'--input': '0
|
|
306
|
+
'--border': '0 14% 88%',
|
|
307
|
+
'--input': '0 14% 88%',
|
|
308
308
|
'--ring': '0 84% 60%',
|
|
309
|
-
'--sidebar': '0
|
|
309
|
+
'--sidebar': '0 14% 97%',
|
|
310
310
|
},
|
|
311
311
|
dark: {
|
|
312
312
|
'--background': '0 50% 5%',
|
|
@@ -335,25 +335,25 @@ export const APP_COLOR_PRESETS: Record<AppColorName, AppColorPreset> = {
|
|
|
335
335
|
name: 'purple',
|
|
336
336
|
hex: '#8B5CF6',
|
|
337
337
|
light: {
|
|
338
|
-
'--background': '
|
|
338
|
+
'--background': '258 8% 99%',
|
|
339
339
|
'--foreground': '0 0% 12%',
|
|
340
|
-
'--surface': '258
|
|
340
|
+
'--surface': '258 14% 97%',
|
|
341
341
|
'--surface-foreground': '0 0% 12%',
|
|
342
|
-
'--popover': '
|
|
342
|
+
'--popover': '258 12% 99%',
|
|
343
343
|
'--popover-foreground': '0 0% 12%',
|
|
344
344
|
'--primary': '258 90% 66%',
|
|
345
345
|
'--primary-foreground': '0 0% 100%',
|
|
346
|
-
'--secondary': '258
|
|
346
|
+
'--secondary': '258 12% 95%',
|
|
347
347
|
'--secondary-foreground': '0 0% 12%',
|
|
348
|
-
'--muted': '258
|
|
348
|
+
'--muted': '258 12% 95%',
|
|
349
349
|
'--muted-foreground': '258 5% 42%',
|
|
350
|
-
'--accent': '258
|
|
350
|
+
'--accent': '258 12% 95%',
|
|
351
351
|
'--accent-foreground': '0 0% 12%',
|
|
352
352
|
'--destructive': '0 84% 60%',
|
|
353
|
-
'--border': '258
|
|
354
|
-
'--input': '258
|
|
353
|
+
'--border': '258 14% 88%',
|
|
354
|
+
'--input': '258 14% 88%',
|
|
355
355
|
'--ring': '258 90% 66%',
|
|
356
|
-
'--sidebar': '258
|
|
356
|
+
'--sidebar': '258 14% 97%',
|
|
357
357
|
},
|
|
358
358
|
dark: {
|
|
359
359
|
'--background': '258 50% 5%',
|
|
@@ -382,25 +382,25 @@ export const APP_COLOR_PRESETS: Record<AppColorName, AppColorPreset> = {
|
|
|
382
382
|
name: 'pink',
|
|
383
383
|
hex: '#EC4899',
|
|
384
384
|
light: {
|
|
385
|
-
'--background': '
|
|
385
|
+
'--background': '330 8% 99%',
|
|
386
386
|
'--foreground': '0 0% 12%',
|
|
387
|
-
'--surface': '330
|
|
387
|
+
'--surface': '330 14% 97%',
|
|
388
388
|
'--surface-foreground': '0 0% 12%',
|
|
389
|
-
'--popover': '
|
|
389
|
+
'--popover': '330 12% 99%',
|
|
390
390
|
'--popover-foreground': '0 0% 12%',
|
|
391
391
|
'--primary': '330 81% 60%',
|
|
392
392
|
'--primary-foreground': '0 0% 100%',
|
|
393
|
-
'--secondary': '330
|
|
393
|
+
'--secondary': '330 12% 95%',
|
|
394
394
|
'--secondary-foreground': '0 0% 12%',
|
|
395
|
-
'--muted': '330
|
|
395
|
+
'--muted': '330 12% 95%',
|
|
396
396
|
'--muted-foreground': '330 5% 42%',
|
|
397
|
-
'--accent': '330
|
|
397
|
+
'--accent': '330 12% 95%',
|
|
398
398
|
'--accent-foreground': '0 0% 12%',
|
|
399
399
|
'--destructive': '0 84% 60%',
|
|
400
|
-
'--border': '330
|
|
401
|
-
'--input': '330
|
|
400
|
+
'--border': '330 14% 88%',
|
|
401
|
+
'--input': '330 14% 88%',
|
|
402
402
|
'--ring': '330 81% 60%',
|
|
403
|
-
'--sidebar': '330
|
|
403
|
+
'--sidebar': '330 14% 97%',
|
|
404
404
|
},
|
|
405
405
|
dark: {
|
|
406
406
|
'--background': '330 50% 5%',
|
|
@@ -429,25 +429,25 @@ export const APP_COLOR_PRESETS: Record<AppColorName, AppColorPreset> = {
|
|
|
429
429
|
name: 'sky',
|
|
430
430
|
hex: '#0EA5E9',
|
|
431
431
|
light: {
|
|
432
|
-
'--background': '
|
|
432
|
+
'--background': '199 8% 99%',
|
|
433
433
|
'--foreground': '0 0% 12%',
|
|
434
|
-
'--surface': '199
|
|
434
|
+
'--surface': '199 14% 97%',
|
|
435
435
|
'--surface-foreground': '0 0% 12%',
|
|
436
|
-
'--popover': '
|
|
436
|
+
'--popover': '199 12% 99%',
|
|
437
437
|
'--popover-foreground': '0 0% 12%',
|
|
438
438
|
'--primary': '199 89% 48%',
|
|
439
439
|
'--primary-foreground': '0 0% 100%',
|
|
440
|
-
'--secondary': '199
|
|
440
|
+
'--secondary': '199 12% 95%',
|
|
441
441
|
'--secondary-foreground': '0 0% 12%',
|
|
442
|
-
'--muted': '199
|
|
442
|
+
'--muted': '199 12% 95%',
|
|
443
443
|
'--muted-foreground': '199 5% 42%',
|
|
444
|
-
'--accent': '199
|
|
444
|
+
'--accent': '199 12% 95%',
|
|
445
445
|
'--accent-foreground': '0 0% 12%',
|
|
446
446
|
'--destructive': '0 84% 60%',
|
|
447
|
-
'--border': '199
|
|
448
|
-
'--input': '199
|
|
447
|
+
'--border': '199 14% 88%',
|
|
448
|
+
'--input': '199 14% 88%',
|
|
449
449
|
'--ring': '199 89% 48%',
|
|
450
|
-
'--sidebar': '199
|
|
450
|
+
'--sidebar': '199 14% 97%',
|
|
451
451
|
},
|
|
452
452
|
dark: {
|
|
453
453
|
'--background': '199 50% 5%',
|
|
@@ -476,25 +476,25 @@ export const APP_COLOR_PRESETS: Record<AppColorName, AppColorPreset> = {
|
|
|
476
476
|
name: 'orange',
|
|
477
477
|
hex: '#F97316',
|
|
478
478
|
light: {
|
|
479
|
-
'--background': '
|
|
479
|
+
'--background': '25 8% 99%',
|
|
480
480
|
'--foreground': '0 0% 12%',
|
|
481
|
-
'--surface': '25
|
|
481
|
+
'--surface': '25 14% 97%',
|
|
482
482
|
'--surface-foreground': '0 0% 12%',
|
|
483
|
-
'--popover': '
|
|
483
|
+
'--popover': '25 12% 99%',
|
|
484
484
|
'--popover-foreground': '0 0% 12%',
|
|
485
485
|
'--primary': '25 95% 53%',
|
|
486
486
|
'--primary-foreground': '0 0% 100%',
|
|
487
|
-
'--secondary': '25
|
|
487
|
+
'--secondary': '25 12% 95%',
|
|
488
488
|
'--secondary-foreground': '0 0% 12%',
|
|
489
|
-
'--muted': '25
|
|
489
|
+
'--muted': '25 12% 95%',
|
|
490
490
|
'--muted-foreground': '25 5% 42%',
|
|
491
|
-
'--accent': '25
|
|
491
|
+
'--accent': '25 12% 95%',
|
|
492
492
|
'--accent-foreground': '0 0% 12%',
|
|
493
493
|
'--destructive': '0 84% 60%',
|
|
494
|
-
'--border': '25
|
|
495
|
-
'--input': '25
|
|
494
|
+
'--border': '25 14% 88%',
|
|
495
|
+
'--input': '25 14% 88%',
|
|
496
496
|
'--ring': '25 95% 53%',
|
|
497
|
-
'--sidebar': '25
|
|
497
|
+
'--sidebar': '25 14% 97%',
|
|
498
498
|
},
|
|
499
499
|
dark: {
|
|
500
500
|
'--background': '25 50% 5%',
|
|
@@ -523,25 +523,25 @@ export const APP_COLOR_PRESETS: Record<AppColorName, AppColorPreset> = {
|
|
|
523
523
|
name: 'mint',
|
|
524
524
|
hex: '#14B8A6',
|
|
525
525
|
light: {
|
|
526
|
-
'--background': '
|
|
526
|
+
'--background': '173 8% 99%',
|
|
527
527
|
'--foreground': '0 0% 12%',
|
|
528
|
-
'--surface': '173
|
|
528
|
+
'--surface': '173 14% 97%',
|
|
529
529
|
'--surface-foreground': '0 0% 12%',
|
|
530
|
-
'--popover': '
|
|
530
|
+
'--popover': '173 12% 99%',
|
|
531
531
|
'--popover-foreground': '0 0% 12%',
|
|
532
532
|
'--primary': '173 80% 40%',
|
|
533
533
|
'--primary-foreground': '0 0% 100%',
|
|
534
|
-
'--secondary': '173
|
|
534
|
+
'--secondary': '173 12% 95%',
|
|
535
535
|
'--secondary-foreground': '0 0% 12%',
|
|
536
|
-
'--muted': '173
|
|
536
|
+
'--muted': '173 12% 95%',
|
|
537
537
|
'--muted-foreground': '173 5% 42%',
|
|
538
|
-
'--accent': '173
|
|
538
|
+
'--accent': '173 12% 95%',
|
|
539
539
|
'--accent-foreground': '0 0% 12%',
|
|
540
540
|
'--destructive': '0 84% 60%',
|
|
541
|
-
'--border': '173
|
|
542
|
-
'--input': '173
|
|
541
|
+
'--border': '173 14% 88%',
|
|
542
|
+
'--input': '173 14% 88%',
|
|
543
543
|
'--ring': '173 80% 40%',
|
|
544
|
-
'--sidebar': '173
|
|
544
|
+
'--sidebar': '173 14% 97%',
|
|
545
545
|
},
|
|
546
546
|
dark: {
|
|
547
547
|
'--background': '173 50% 5%',
|
|
@@ -570,25 +570,25 @@ export const APP_COLOR_PRESETS: Record<AppColorName, AppColorPreset> = {
|
|
|
570
570
|
name: 'oxy',
|
|
571
571
|
hex: '#c46ede',
|
|
572
572
|
light: {
|
|
573
|
-
'--background': '
|
|
573
|
+
'--background': '277 8% 99%',
|
|
574
574
|
'--foreground': '0 0% 12%',
|
|
575
|
-
'--surface': '277
|
|
575
|
+
'--surface': '277 14% 97%',
|
|
576
576
|
'--surface-foreground': '0 0% 12%',
|
|
577
|
-
'--popover': '
|
|
577
|
+
'--popover': '277 12% 99%',
|
|
578
578
|
'--popover-foreground': '0 0% 12%',
|
|
579
579
|
'--primary': '277 66% 56%',
|
|
580
580
|
'--primary-foreground': '0 0% 100%',
|
|
581
|
-
'--secondary': '277
|
|
581
|
+
'--secondary': '277 12% 95%',
|
|
582
582
|
'--secondary-foreground': '0 0% 12%',
|
|
583
|
-
'--muted': '277
|
|
583
|
+
'--muted': '277 12% 95%',
|
|
584
584
|
'--muted-foreground': '277 5% 42%',
|
|
585
|
-
'--accent': '277
|
|
585
|
+
'--accent': '277 12% 95%',
|
|
586
586
|
'--accent-foreground': '0 0% 12%',
|
|
587
587
|
'--destructive': '0 84% 60%',
|
|
588
|
-
'--border': '277
|
|
589
|
-
'--input': '277
|
|
588
|
+
'--border': '277 14% 88%',
|
|
589
|
+
'--input': '277 14% 88%',
|
|
590
590
|
'--ring': '277 66% 56%',
|
|
591
|
-
'--sidebar': '277
|
|
591
|
+
'--sidebar': '277 14% 97%',
|
|
592
592
|
},
|
|
593
593
|
dark: {
|
|
594
594
|
'--background': '277 50% 5%',
|
|
@@ -616,25 +616,25 @@ export const APP_COLOR_PRESETS: Record<AppColorName, AppColorPreset> = {
|
|
|
616
616
|
name: 'faircoin',
|
|
617
617
|
hex: '#9ffb50',
|
|
618
618
|
light: {
|
|
619
|
-
'--background': '
|
|
619
|
+
'--background': '92 8% 99%',
|
|
620
620
|
'--foreground': '0 0% 12%',
|
|
621
|
-
'--surface': '92
|
|
621
|
+
'--surface': '92 16% 95%',
|
|
622
622
|
'--surface-foreground': '0 0% 12%',
|
|
623
|
-
'--popover': '
|
|
623
|
+
'--popover': '92 12% 99%',
|
|
624
624
|
'--popover-foreground': '0 0% 12%',
|
|
625
625
|
'--primary': '92 90% 25%',
|
|
626
626
|
'--primary-foreground': '0 0% 100%',
|
|
627
|
-
'--secondary': '92
|
|
627
|
+
'--secondary': '92 14% 92%',
|
|
628
628
|
'--secondary-foreground': '0 0% 12%',
|
|
629
|
-
'--muted': '92
|
|
630
|
-
'--muted-foreground': '
|
|
631
|
-
'--accent': '92
|
|
629
|
+
'--muted': '92 12% 93%',
|
|
630
|
+
'--muted-foreground': '92 5% 40%',
|
|
631
|
+
'--accent': '92 14% 92%',
|
|
632
632
|
'--accent-foreground': '0 0% 12%',
|
|
633
633
|
'--destructive': '0 84% 60%',
|
|
634
|
-
'--border': '92
|
|
635
|
-
'--input': '92
|
|
634
|
+
'--border': '92 12% 85%',
|
|
635
|
+
'--input': '92 12% 85%',
|
|
636
636
|
'--ring': '92 90% 25%',
|
|
637
|
-
'--sidebar': '92
|
|
637
|
+
'--sidebar': '92 16% 95%',
|
|
638
638
|
},
|
|
639
639
|
dark: {
|
|
640
640
|
'--background': '69 54% 8%',
|
|
@@ -4,7 +4,7 @@ import { View, type StyleProp, type ViewStyle } from 'react-native';
|
|
|
4
4
|
import { BloomThemeContext, type BloomThemeContextValue } from '../BloomThemeProvider';
|
|
5
5
|
import { buildTheme } from '../build-theme';
|
|
6
6
|
import type { AppColorName } from '../color-presets';
|
|
7
|
-
import { buildNativePresetStyle } from './style-builder';
|
|
7
|
+
import { buildNativePresetStyle, buildScopeVars, getVariableContextProvider } from './style-builder';
|
|
8
8
|
|
|
9
9
|
export interface BloomColorScopeProps {
|
|
10
10
|
/**
|
|
@@ -46,10 +46,15 @@ export function BloomColorScope({
|
|
|
46
46
|
return { ...parent, theme, colorPreset };
|
|
47
47
|
}, [colorPreset, resolvedMode, parent]);
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
// Preset vars flow to the subtree through react-native-css's real
|
|
50
|
+
// VariableContext (`VariableContextProvider`), NOT via an inline `vars()`
|
|
51
|
+
// style — under react-native-css@3 inline vars applied to a plain `<View>`
|
|
52
|
+
// (no matched className rules) are dropped silently. See `style-builder.ts`.
|
|
53
|
+
const nativeVars = useMemo(
|
|
54
|
+
() => buildScopeVars(colorPreset, resolvedMode),
|
|
51
55
|
[colorPreset, resolvedMode],
|
|
52
56
|
);
|
|
57
|
+
const VariableProvider = getVariableContextProvider();
|
|
53
58
|
|
|
54
59
|
let content: React.ReactNode;
|
|
55
60
|
if (asChild) {
|
|
@@ -59,20 +64,37 @@ export function BloomColorScope({
|
|
|
59
64
|
'BloomColorScope with `asChild` requires a single React element child that accepts a `style` prop.',
|
|
60
65
|
);
|
|
61
66
|
}
|
|
67
|
+
// The vars no longer ride on the child's `style`; merge only the caller's
|
|
68
|
+
// `style` and the child's own `style` (child last so its styles win).
|
|
62
69
|
const childStyle = child.props.style;
|
|
63
|
-
const mergedStyle: StyleProp<ViewStyle> = [
|
|
70
|
+
const mergedStyle: StyleProp<ViewStyle> = [style, childStyle];
|
|
64
71
|
content = cloneElement(child, { style: mergedStyle });
|
|
65
72
|
} else {
|
|
66
|
-
content = <View style={[{ flex: 1 },
|
|
73
|
+
content = <View style={[{ flex: 1 }, style]}>{children}</View>;
|
|
67
74
|
}
|
|
68
75
|
|
|
69
|
-
|
|
76
|
+
// Wrap the subtree in the variable provider when NativeWind is available;
|
|
77
|
+
// otherwise render as-is so we never crash on web/non-NativeWind hosts.
|
|
78
|
+
const scoped = VariableProvider ? (
|
|
79
|
+
<VariableProvider value={nativeVars}>{content}</VariableProvider>
|
|
80
|
+
) : (
|
|
81
|
+
content
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
return <BloomThemeContext.Provider value={contextValue}>{scoped}</BloomThemeContext.Provider>;
|
|
70
85
|
}
|
|
71
86
|
|
|
72
87
|
/**
|
|
73
88
|
* Escape hatch for advanced cases where the wrapping element is owned by the
|
|
74
|
-
* caller. Returns a stable native style object carrying the preset's CSS vars
|
|
75
|
-
* Returns `undefined` on web or when `nativewind`
|
|
89
|
+
* caller. Returns a stable native style object carrying the preset's CSS vars
|
|
90
|
+
* via NativeWind's `vars()`. Returns `undefined` on web or when `nativewind`
|
|
91
|
+
* is not installed.
|
|
92
|
+
*
|
|
93
|
+
* NOTE: subject to the react-native-css@3 limitation — the returned style only
|
|
94
|
+
* propagates vars to descendants when applied to an interop className component
|
|
95
|
+
* (the runtime gates propagation on matched className style rules). It is a
|
|
96
|
+
* no-op on a plain `<View>` with no `className`. For the common case prefer
|
|
97
|
+
* `<BloomColorScope>`, which wraps children in `VariableContextProvider`.
|
|
76
98
|
*/
|
|
77
99
|
export function useColorScopeStyle(colorPreset: AppColorName): StyleProp<ViewStyle> {
|
|
78
100
|
const parent = useContext(BloomThemeContext);
|
|
@@ -1,11 +1,24 @@
|
|
|
1
|
+
import type React from 'react';
|
|
1
2
|
import { Platform, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
3
|
|
|
3
4
|
import { getPresetVars } from '../preset-vars';
|
|
4
5
|
import type { AppColorName } from '../color-presets';
|
|
5
6
|
import { lazyRequire } from '../../utils/lazy-require';
|
|
6
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Component that provides inline CSS variables to a subtree via NativeWind's
|
|
10
|
+
* (react-native-css's) real `VariableContext`. The runtime strips the leading
|
|
11
|
+
* `--` from each key internally, so we feed it the full `--name -> value`
|
|
12
|
+
* record produced by `buildScopeVars`.
|
|
13
|
+
*/
|
|
14
|
+
export type VariableContextProviderComponent = React.ComponentType<{
|
|
15
|
+
value: Record<string, string>;
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}>;
|
|
18
|
+
|
|
7
19
|
interface NativeWindVarsModule {
|
|
8
20
|
vars: (record: Record<string, string>) => StyleProp<ViewStyle>;
|
|
21
|
+
VariableContextProvider?: VariableContextProviderComponent;
|
|
9
22
|
}
|
|
10
23
|
|
|
11
24
|
const getNativeWindVars = lazyRequire<NativeWindVarsModule>('nativewind');
|
|
@@ -22,11 +35,38 @@ export function buildScopeVars(
|
|
|
22
35
|
return getPresetVars(colorPreset, mode, { includeResolvedColorVars: true });
|
|
23
36
|
}
|
|
24
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Resolve NativeWind's `VariableContextProvider` — the canonical, non-deprecated
|
|
40
|
+
* react-native-css v3 API for providing inline CSS variables to a subtree. It
|
|
41
|
+
* reads the same `VariableContext` that interop className components consume, so
|
|
42
|
+
* descendants resolve `var(--primary)` etc. correctly. Returns `null` on web or
|
|
43
|
+
* when `nativewind` is not installed.
|
|
44
|
+
*
|
|
45
|
+
* This replaces the deprecated `vars()`-on-a-plain-`<View>`-style mechanism:
|
|
46
|
+
* under react-native-css@3, `vars()` returns an inline-vars marker that is only
|
|
47
|
+
* propagated to children when the host element matches className style rules
|
|
48
|
+
* (`usesVariables`/`variables`). A plain `<View>` with no `className` drops the
|
|
49
|
+
* vars silently, so the subtree renders without the preset palette.
|
|
50
|
+
*/
|
|
51
|
+
export function getVariableContextProvider(): VariableContextProviderComponent | null {
|
|
52
|
+
if (Platform.OS === 'web') return null;
|
|
53
|
+
const module = getNativeWindVars();
|
|
54
|
+
if (!module || typeof module.VariableContextProvider !== 'function') return null;
|
|
55
|
+
return module.VariableContextProvider;
|
|
56
|
+
}
|
|
57
|
+
|
|
25
58
|
/**
|
|
26
59
|
* Build a native style object carrying every CSS var of the preset, using
|
|
27
60
|
* NativeWind's `vars()` when available. Returns `undefined` on web (where the
|
|
28
61
|
* provider writes vars to `documentElement` instead) or when `nativewind` is
|
|
29
62
|
* not installed.
|
|
63
|
+
*
|
|
64
|
+
* @deprecated Under react-native-css@3, `vars()` only propagates to a subtree
|
|
65
|
+
* when applied to an interop className component (the runtime gates propagation
|
|
66
|
+
* on matched className style rules). Applied to a plain `<View>` the vars are
|
|
67
|
+
* dropped silently. Prefer wrapping children in `getVariableContextProvider()`.
|
|
68
|
+
* Retained only as the escape-hatch contract of `useColorScopeStyle`, where the
|
|
69
|
+
* caller owns the host element and is expected to be a className component.
|
|
30
70
|
*/
|
|
31
71
|
export function buildNativePresetStyle(
|
|
32
72
|
colorPreset: AppColorName,
|