@flipova/foundation 2.2.0 → 2.3.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/CHANGELOG.md +12 -0
- package/components/ui/gluestack-ui-provider/config.ts +69 -2
- package/components/ui/gluestack-ui-provider/index.tsx +57 -7
- package/components/ui/gluestack-ui-provider/index.web.tsx +38 -10
- package/components/ui/gluestack-ui-provider/script.ts +12 -5
- package/components/ui/gluestack-ui-provider/theme-context.ts +51 -0
- package/components/ui/gluestack-ui-provider/useGluestackColors.ts +17 -2
- package/design/canonical.index.txt +15 -1
- package/design/manifest.xml +2 -0
- package/design/schema.xsd +11 -0
- package/design/themes.xml +175 -2
- package/design/tools/npm.js +3 -3
- package/design/tools/sources/.generate/config.py +60 -2
- package/dist/{chunk-HF2IPXOT.mjs → chunk-B277QSR5.mjs} +101 -10
- package/dist/chunk-B277QSR5.mjs.map +1 -0
- package/dist/{chunk-TDW7UKG6.js → chunk-GD37RFBR.js} +105 -9
- package/dist/chunk-GD37RFBR.js.map +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +309 -289
- package/dist/index.mjs +1 -1
- package/dist/ui/index.d.mts +597 -533
- package/dist/ui/index.d.ts +597 -533
- package/dist/ui/index.js +309 -289
- package/dist/ui/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-HF2IPXOT.mjs.map +0 -1
- package/dist/chunk-TDW7UKG6.js.map +0 -1
package/design/themes.xml
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
default="light">
|
|
30
30
|
<items>
|
|
31
31
|
<!-- Light Theme -->
|
|
32
|
-
<theme id="light" mode="light">
|
|
32
|
+
<theme id="light" mode="light" variant="default">
|
|
33
33
|
<roleMap>
|
|
34
34
|
<role id="background">
|
|
35
35
|
<ref>$ref.tokens.color.gray.50</ref>
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
</roleMap>
|
|
116
116
|
</theme>
|
|
117
117
|
<!-- Dark Theme -->
|
|
118
|
-
<theme id="dark" mode="dark">
|
|
118
|
+
<theme id="dark" mode="dark" variant="default">
|
|
119
119
|
<roleMap>
|
|
120
120
|
<role id="background">
|
|
121
121
|
<ref>$ref.tokens.color.gray.900</ref>
|
|
@@ -200,5 +200,178 @@
|
|
|
200
200
|
</role>
|
|
201
201
|
</roleMap>
|
|
202
202
|
</theme>
|
|
203
|
+
<!-- Spring variant: a seasonal light/dark PAIR. Same roles, seasonal
|
|
204
|
+
greens, so the app can offer it as a theme and still honour the
|
|
205
|
+
light/dark mode the user picked. -->
|
|
206
|
+
<theme id="spring-light" mode="light" variant="spring">
|
|
207
|
+
<roleMap>
|
|
208
|
+
<role id="background">
|
|
209
|
+
<ref>$ref.tokens.color.success.50</ref>
|
|
210
|
+
</role>
|
|
211
|
+
<role id="foreground">
|
|
212
|
+
<ref>$ref.tokens.color.success.900</ref>
|
|
213
|
+
</role>
|
|
214
|
+
<role id="card">
|
|
215
|
+
<ref>$ref.tokens.color.white</ref>
|
|
216
|
+
</role>
|
|
217
|
+
<role id="card-foreground">
|
|
218
|
+
<ref>$ref.tokens.color.success.900</ref>
|
|
219
|
+
</role>
|
|
220
|
+
<role id="popover">
|
|
221
|
+
<ref>$ref.tokens.color.white</ref>
|
|
222
|
+
</role>
|
|
223
|
+
<role id="popover-foreground">
|
|
224
|
+
<ref>$ref.tokens.color.success.900</ref>
|
|
225
|
+
</role>
|
|
226
|
+
<role id="primary">
|
|
227
|
+
<ref>$ref.tokens.color.success.600</ref>
|
|
228
|
+
</role>
|
|
229
|
+
<role id="primary-foreground">
|
|
230
|
+
<ref>$ref.tokens.color.white</ref>
|
|
231
|
+
</role>
|
|
232
|
+
<role id="secondary">
|
|
233
|
+
<ref>$ref.tokens.color.success.500</ref>
|
|
234
|
+
</role>
|
|
235
|
+
<role id="secondary-foreground">
|
|
236
|
+
<ref>$ref.tokens.color.white</ref>
|
|
237
|
+
</role>
|
|
238
|
+
<role id="muted">
|
|
239
|
+
<ref>$ref.tokens.color.success.100</ref>
|
|
240
|
+
</role>
|
|
241
|
+
<role id="muted-foreground">
|
|
242
|
+
<ref>$ref.tokens.color.success.700</ref>
|
|
243
|
+
</role>
|
|
244
|
+
<role id="accent">
|
|
245
|
+
<ref>$ref.tokens.color.success.200</ref>
|
|
246
|
+
</role>
|
|
247
|
+
<role id="accent-foreground">
|
|
248
|
+
<ref>$ref.tokens.color.success.900</ref>
|
|
249
|
+
</role>
|
|
250
|
+
<role id="destructive">
|
|
251
|
+
<ref>$ref.tokens.color.error.600</ref>
|
|
252
|
+
</role>
|
|
253
|
+
<role id="destructive-foreground">
|
|
254
|
+
<ref>$ref.tokens.color.white</ref>
|
|
255
|
+
</role>
|
|
256
|
+
<role id="border">
|
|
257
|
+
<ref>$ref.tokens.color.success.200</ref>
|
|
258
|
+
</role>
|
|
259
|
+
<role id="input">
|
|
260
|
+
<ref>$ref.tokens.color.success.200</ref>
|
|
261
|
+
</role>
|
|
262
|
+
<role id="ring">
|
|
263
|
+
<ref>$ref.tokens.color.success.400</ref>
|
|
264
|
+
</role>
|
|
265
|
+
<role id="success">
|
|
266
|
+
<ref>$ref.tokens.color.success.600</ref>
|
|
267
|
+
</role>
|
|
268
|
+
<role id="success-foreground">
|
|
269
|
+
<ref>$ref.tokens.color.white</ref>
|
|
270
|
+
</role>
|
|
271
|
+
<role id="warning">
|
|
272
|
+
<ref>$ref.tokens.color.warning.600</ref>
|
|
273
|
+
</role>
|
|
274
|
+
<role id="warning-foreground">
|
|
275
|
+
<ref>$ref.tokens.color.white</ref>
|
|
276
|
+
</role>
|
|
277
|
+
<role id="error">
|
|
278
|
+
<ref>$ref.tokens.color.error.600</ref>
|
|
279
|
+
</role>
|
|
280
|
+
<role id="error-foreground">
|
|
281
|
+
<ref>$ref.tokens.color.white</ref>
|
|
282
|
+
</role>
|
|
283
|
+
<role id="info">
|
|
284
|
+
<ref>$ref.tokens.color.info.600</ref>
|
|
285
|
+
</role>
|
|
286
|
+
<role id="info-foreground">
|
|
287
|
+
<ref>$ref.tokens.color.white</ref>
|
|
288
|
+
</role>
|
|
289
|
+
</roleMap>
|
|
290
|
+
</theme>
|
|
291
|
+
<theme id="spring-dark" mode="dark" variant="spring">
|
|
292
|
+
<roleMap>
|
|
293
|
+
<role id="background">
|
|
294
|
+
<ref>$ref.tokens.color.success.950</ref>
|
|
295
|
+
</role>
|
|
296
|
+
<role id="foreground">
|
|
297
|
+
<ref>$ref.tokens.color.success.50</ref>
|
|
298
|
+
</role>
|
|
299
|
+
<role id="card">
|
|
300
|
+
<ref>$ref.tokens.color.success.900</ref>
|
|
301
|
+
</role>
|
|
302
|
+
<role id="card-foreground">
|
|
303
|
+
<ref>$ref.tokens.color.success.50</ref>
|
|
304
|
+
</role>
|
|
305
|
+
<role id="popover">
|
|
306
|
+
<ref>$ref.tokens.color.success.900</ref>
|
|
307
|
+
</role>
|
|
308
|
+
<role id="popover-foreground">
|
|
309
|
+
<ref>$ref.tokens.color.success.50</ref>
|
|
310
|
+
</role>
|
|
311
|
+
<role id="primary">
|
|
312
|
+
<ref>$ref.tokens.color.success.400</ref>
|
|
313
|
+
</role>
|
|
314
|
+
<role id="primary-foreground">
|
|
315
|
+
<ref>$ref.tokens.color.success.950</ref>
|
|
316
|
+
</role>
|
|
317
|
+
<role id="secondary">
|
|
318
|
+
<ref>$ref.tokens.color.success.300</ref>
|
|
319
|
+
</role>
|
|
320
|
+
<role id="secondary-foreground">
|
|
321
|
+
<ref>$ref.tokens.color.success.950</ref>
|
|
322
|
+
</role>
|
|
323
|
+
<role id="muted">
|
|
324
|
+
<ref>$ref.tokens.color.success.900</ref>
|
|
325
|
+
</role>
|
|
326
|
+
<role id="muted-foreground">
|
|
327
|
+
<ref>$ref.tokens.color.success.200</ref>
|
|
328
|
+
</role>
|
|
329
|
+
<role id="accent">
|
|
330
|
+
<ref>$ref.tokens.color.success.800</ref>
|
|
331
|
+
</role>
|
|
332
|
+
<role id="accent-foreground">
|
|
333
|
+
<ref>$ref.tokens.color.success.50</ref>
|
|
334
|
+
</role>
|
|
335
|
+
<role id="destructive">
|
|
336
|
+
<ref>$ref.tokens.color.error.500</ref>
|
|
337
|
+
</role>
|
|
338
|
+
<role id="destructive-foreground">
|
|
339
|
+
<ref>$ref.tokens.color.white</ref>
|
|
340
|
+
</role>
|
|
341
|
+
<role id="border">
|
|
342
|
+
<ref>$ref.tokens.color.success.800</ref>
|
|
343
|
+
</role>
|
|
344
|
+
<role id="input">
|
|
345
|
+
<ref>$ref.tokens.color.success.800</ref>
|
|
346
|
+
</role>
|
|
347
|
+
<role id="ring">
|
|
348
|
+
<ref>$ref.tokens.color.success.300</ref>
|
|
349
|
+
</role>
|
|
350
|
+
<role id="success">
|
|
351
|
+
<ref>$ref.tokens.color.success.400</ref>
|
|
352
|
+
</role>
|
|
353
|
+
<role id="success-foreground">
|
|
354
|
+
<ref>$ref.tokens.color.success.950</ref>
|
|
355
|
+
</role>
|
|
356
|
+
<role id="warning">
|
|
357
|
+
<ref>$ref.tokens.color.warning.400</ref>
|
|
358
|
+
</role>
|
|
359
|
+
<role id="warning-foreground">
|
|
360
|
+
<ref>$ref.tokens.color.success.950</ref>
|
|
361
|
+
</role>
|
|
362
|
+
<role id="error">
|
|
363
|
+
<ref>$ref.tokens.color.error.400</ref>
|
|
364
|
+
</role>
|
|
365
|
+
<role id="error-foreground">
|
|
366
|
+
<ref>$ref.tokens.color.success.950</ref>
|
|
367
|
+
</role>
|
|
368
|
+
<role id="info">
|
|
369
|
+
<ref>$ref.tokens.color.info.400</ref>
|
|
370
|
+
</role>
|
|
371
|
+
<role id="info-foreground">
|
|
372
|
+
<ref>$ref.tokens.color.success.950</ref>
|
|
373
|
+
</role>
|
|
374
|
+
</roleMap>
|
|
375
|
+
</theme>
|
|
203
376
|
</items>
|
|
204
377
|
</themes>
|
package/design/tools/npm.js
CHANGED
|
@@ -210,13 +210,13 @@ const ADOPTED_OUTPUTS = {
|
|
|
210
210
|
const PROVIDER = `// theme/provider.tsx
|
|
211
211
|
// Generated by \`npx flipova-design adopt\` -- safe to edit.
|
|
212
212
|
//
|
|
213
|
-
// The theme
|
|
213
|
+
// The theme is regenerated from your own registries (design/*.xml) into
|
|
214
214
|
// theme/config.ts and theme/tokens.js. This provider is the wiring between them
|
|
215
215
|
// and the components of @flipova/foundation.
|
|
216
216
|
import { createGluestackUIProvider } from '@flipova/foundation/ui';
|
|
217
|
-
import
|
|
217
|
+
import * as theme from './config';
|
|
218
218
|
|
|
219
|
-
export const AppThemeProvider = createGluestackUIProvider(
|
|
219
|
+
export const AppThemeProvider = createGluestackUIProvider(theme);
|
|
220
220
|
export default AppThemeProvider;
|
|
221
221
|
`;
|
|
222
222
|
|
|
@@ -99,13 +99,65 @@ def theme_role_ids(man: ManifestModel) -> list[str]:
|
|
|
99
99
|
return reference
|
|
100
100
|
|
|
101
101
|
|
|
102
|
+
_JS_IDENT = re.compile(r"^[A-Za-z_$][A-Za-z0-9_$]*$")
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def _js_key(name: str) -> str:
|
|
106
|
+
"""Quote an object key unless it is a bare JS identifier.
|
|
107
|
+
|
|
108
|
+
A theme id is free-form ("spring-light", "high-contrast"), but `spring-light`
|
|
109
|
+
is not a valid unquoted object key: emitting it bare produces a syntax error.
|
|
110
|
+
"""
|
|
111
|
+
return name if _JS_IDENT.match(name) else "'" + name.replace("'", "\\'") + "'"
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def theme_variants(man: ManifestModel) -> list[tuple[str, str, str]]:
|
|
115
|
+
"""[(variant, mode, theme_id), ...] in themes.xml order.
|
|
116
|
+
|
|
117
|
+
A variant is a light/dark PAIR, so the runtime can resolve a (variant, mode)
|
|
118
|
+
request to a theme id. The table is emitted rather than rebuilt at runtime so
|
|
119
|
+
a theme id never has to follow a naming convention: a variant may be spelled
|
|
120
|
+
`spring` with themes `spring-light`/`spring-dark`, or anything else at all.
|
|
121
|
+
"""
|
|
122
|
+
themes_path = man.ctx.catalog_files.get("themes")
|
|
123
|
+
if themes_path is None or not themes_path.exists():
|
|
124
|
+
raise SystemExit("manifest: no themes catalog file found")
|
|
125
|
+
root = etree.parse(str(themes_path)).getroot()
|
|
126
|
+
out: list[tuple[str, str, str]] = []
|
|
127
|
+
for theme in root.findall(q("items") + "/" + q("theme")):
|
|
128
|
+
tid = (theme.get("id") or "").strip()
|
|
129
|
+
mode = (theme.get("mode") or "").strip()
|
|
130
|
+
variant = (theme.get("variant") or "default").strip() or "default"
|
|
131
|
+
out.append((variant, mode, tid))
|
|
132
|
+
return out
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def _render_variant_table(variants: list[tuple[str, str, str]]) -> list[str]:
|
|
136
|
+
"""`export const variants = { spring: { light: 'spring-light', ... } }`."""
|
|
137
|
+
ordered: dict[str, list[tuple[str, str]]] = {}
|
|
138
|
+
for variant, mode, tid in variants:
|
|
139
|
+
entries = ordered.setdefault(variant, [])
|
|
140
|
+
if any(m == mode for m, _ in entries):
|
|
141
|
+
raise SystemExit(
|
|
142
|
+
f"theme variant {variant!r} declares the mode {mode!r} twice: "
|
|
143
|
+
"a variant is a light/dark pair, so it has exactly one theme per mode"
|
|
144
|
+
)
|
|
145
|
+
entries.append((mode, tid))
|
|
146
|
+
lines = ["export const variants = {"]
|
|
147
|
+
for variant in sorted(ordered):
|
|
148
|
+
pairs = ", ".join(f"{_js_key(mode)}: '{tid}'" for mode, tid in sorted(ordered[variant]))
|
|
149
|
+
lines.append(f" {_js_key(variant)}: {{ {pairs} }},")
|
|
150
|
+
lines.append("};")
|
|
151
|
+
return lines
|
|
152
|
+
|
|
153
|
+
|
|
102
154
|
def render_gluestack_config(man: ManifestModel) -> str:
|
|
103
155
|
themes = theme_role_colours(man)
|
|
104
156
|
lines = list(_HEADER)
|
|
105
157
|
lines.append("// Raw color values (space-separated RGB) - edit design/themes.xml and regenerate")
|
|
106
158
|
lines.append("export const colors = {")
|
|
107
159
|
for tid, roles in themes:
|
|
108
|
-
lines.append(f" {tid}: {{")
|
|
160
|
+
lines.append(f" {_js_key(tid)}: {{")
|
|
109
161
|
for rid, triplet in roles:
|
|
110
162
|
lines.append(f" '--{rid}': '{triplet}',")
|
|
111
163
|
lines.append(" },")
|
|
@@ -114,6 +166,12 @@ def render_gluestack_config(man: ManifestModel) -> str:
|
|
|
114
166
|
lines.append("// Config for nativewind vars() - used by the provider")
|
|
115
167
|
lines.append("export const config = {")
|
|
116
168
|
for tid, _ in themes:
|
|
117
|
-
|
|
169
|
+
# Bracket access, always: a quoted key ("spring-light") is not valid
|
|
170
|
+
# after a dot, so `colors.something` would only work by luck.
|
|
171
|
+
lines.append(f" {_js_key(tid)}: vars(colors['{tid}']),")
|
|
118
172
|
lines.append("};")
|
|
173
|
+
lines.append("")
|
|
174
|
+
lines.append("// Theme variants: variant -> mode -> theme id, from the `variant` attribute in")
|
|
175
|
+
lines.append("// design/themes.xml. `default` holds the base light/dark pair.")
|
|
176
|
+
lines.extend(_render_variant_table(theme_variants(man)))
|
|
119
177
|
return "\n".join(lines) + "\n"
|
|
@@ -3837,12 +3837,86 @@ var colors = {
|
|
|
3837
3837
|
"--error-foreground": "255 255 255",
|
|
3838
3838
|
"--info": "14 165 233",
|
|
3839
3839
|
"--info-foreground": "255 255 255"
|
|
3840
|
+
},
|
|
3841
|
+
"spring-light": {
|
|
3842
|
+
"--background": "240 253 244",
|
|
3843
|
+
"--foreground": "20 83 45",
|
|
3844
|
+
"--card": "255 255 255",
|
|
3845
|
+
"--card-foreground": "20 83 45",
|
|
3846
|
+
"--popover": "255 255 255",
|
|
3847
|
+
"--popover-foreground": "20 83 45",
|
|
3848
|
+
"--primary": "22 163 74",
|
|
3849
|
+
"--primary-foreground": "255 255 255",
|
|
3850
|
+
"--secondary": "34 197 94",
|
|
3851
|
+
"--secondary-foreground": "255 255 255",
|
|
3852
|
+
"--muted": "220 252 231",
|
|
3853
|
+
"--muted-foreground": "21 128 61",
|
|
3854
|
+
"--accent": "187 247 208",
|
|
3855
|
+
"--accent-foreground": "20 83 45",
|
|
3856
|
+
"--destructive": "220 38 38",
|
|
3857
|
+
"--destructive-foreground": "255 255 255",
|
|
3858
|
+
"--border": "187 247 208",
|
|
3859
|
+
"--input": "187 247 208",
|
|
3860
|
+
"--ring": "74 222 128",
|
|
3861
|
+
"--success": "22 163 74",
|
|
3862
|
+
"--success-foreground": "255 255 255",
|
|
3863
|
+
"--warning": "217 119 6",
|
|
3864
|
+
"--warning-foreground": "255 255 255",
|
|
3865
|
+
"--error": "220 38 38",
|
|
3866
|
+
"--error-foreground": "255 255 255",
|
|
3867
|
+
"--info": "2 132 199",
|
|
3868
|
+
"--info-foreground": "255 255 255"
|
|
3869
|
+
},
|
|
3870
|
+
"spring-dark": {
|
|
3871
|
+
"--background": "5 46 22",
|
|
3872
|
+
"--foreground": "240 253 244",
|
|
3873
|
+
"--card": "20 83 45",
|
|
3874
|
+
"--card-foreground": "240 253 244",
|
|
3875
|
+
"--popover": "20 83 45",
|
|
3876
|
+
"--popover-foreground": "240 253 244",
|
|
3877
|
+
"--primary": "74 222 128",
|
|
3878
|
+
"--primary-foreground": "5 46 22",
|
|
3879
|
+
"--secondary": "134 239 172",
|
|
3880
|
+
"--secondary-foreground": "5 46 22",
|
|
3881
|
+
"--muted": "20 83 45",
|
|
3882
|
+
"--muted-foreground": "187 247 208",
|
|
3883
|
+
"--accent": "22 101 52",
|
|
3884
|
+
"--accent-foreground": "240 253 244",
|
|
3885
|
+
"--destructive": "239 68 68",
|
|
3886
|
+
"--destructive-foreground": "255 255 255",
|
|
3887
|
+
"--border": "22 101 52",
|
|
3888
|
+
"--input": "22 101 52",
|
|
3889
|
+
"--ring": "134 239 172",
|
|
3890
|
+
"--success": "74 222 128",
|
|
3891
|
+
"--success-foreground": "5 46 22",
|
|
3892
|
+
"--warning": "251 191 36",
|
|
3893
|
+
"--warning-foreground": "5 46 22",
|
|
3894
|
+
"--error": "248 113 113",
|
|
3895
|
+
"--error-foreground": "5 46 22",
|
|
3896
|
+
"--info": "56 189 248",
|
|
3897
|
+
"--info-foreground": "5 46 22"
|
|
3840
3898
|
}
|
|
3841
3899
|
};
|
|
3842
3900
|
var config = {
|
|
3843
|
-
light: vars(colors
|
|
3844
|
-
dark: vars(colors
|
|
3901
|
+
light: vars(colors["light"]),
|
|
3902
|
+
dark: vars(colors["dark"]),
|
|
3903
|
+
"spring-light": vars(colors["spring-light"]),
|
|
3904
|
+
"spring-dark": vars(colors["spring-dark"])
|
|
3845
3905
|
};
|
|
3906
|
+
var variants = {
|
|
3907
|
+
default: { dark: "dark", light: "light" },
|
|
3908
|
+
spring: { dark: "spring-dark", light: "spring-light" }
|
|
3909
|
+
};
|
|
3910
|
+
var ThemeContext = createContext(null);
|
|
3911
|
+
var useMountedColors = () => useContext(ThemeContext);
|
|
3912
|
+
var MountedThemeContext = createContext(null);
|
|
3913
|
+
var useMountedTheme = () => useContext(MountedThemeContext);
|
|
3914
|
+
function resolveThemeId(variants2, variant, mode) {
|
|
3915
|
+
const mapped = variant ? variants2?.[variant]?.[mode] : void 0;
|
|
3916
|
+
return mapped ?? mode;
|
|
3917
|
+
}
|
|
3918
|
+
|
|
3919
|
+
// components/ui/gluestack-ui-provider/useGluestackColors.ts
|
|
3846
3920
|
function toCamelCase(str) {
|
|
3847
3921
|
return str.replace(/^--/, "").replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
3848
3922
|
}
|
|
@@ -3858,9 +3932,12 @@ function rgbToHex(rgbString) {
|
|
|
3858
3932
|
}
|
|
3859
3933
|
function useGluestackColors() {
|
|
3860
3934
|
const { colorScheme } = useColorScheme();
|
|
3861
|
-
const theme =
|
|
3935
|
+
const theme = useMountedColors() ?? colors;
|
|
3936
|
+
const mounted = useMountedTheme();
|
|
3937
|
+
const palettes = theme;
|
|
3938
|
+
const palette = palettes[mounted?.themeId ?? ""] ?? palettes[colorScheme || "light"] ?? palettes[mounted?.themeIds[0] ?? ""] ?? {};
|
|
3862
3939
|
const result = {};
|
|
3863
|
-
Object.entries(
|
|
3940
|
+
Object.entries(palette).forEach(([key, value]) => {
|
|
3864
3941
|
const camelKey = toCamelCase(key);
|
|
3865
3942
|
result[camelKey] = rgbToHex(value);
|
|
3866
3943
|
});
|
|
@@ -3888,28 +3965,42 @@ function useCalendarTheme() {
|
|
|
3888
3965
|
var useGluestackColors2 = useGluestackColors;
|
|
3889
3966
|
var useCalendarTheme2 = useCalendarTheme;
|
|
3890
3967
|
function createGluestackUIProvider(theme) {
|
|
3968
|
+
const vars2 = theme.config ?? theme.colors;
|
|
3969
|
+
const variantMap = theme.variants;
|
|
3970
|
+
const themeIds = Object.keys(vars2);
|
|
3891
3971
|
return function ThemedProvider({
|
|
3892
3972
|
mode = "light",
|
|
3973
|
+
variant,
|
|
3893
3974
|
...props
|
|
3894
3975
|
}) {
|
|
3895
3976
|
const { colorScheme, setColorScheme } = useColorScheme();
|
|
3896
3977
|
useEffect(() => {
|
|
3897
3978
|
setColorScheme(mode);
|
|
3898
3979
|
}, [mode]);
|
|
3980
|
+
const resolvedMode = mode === "system" ? colorScheme ?? "light" : mode;
|
|
3981
|
+
const themeId = resolveThemeId(variantMap, variant, resolvedMode);
|
|
3982
|
+
const mountedTheme = React48.useMemo(
|
|
3983
|
+
() => ({ themeId, themeIds }),
|
|
3984
|
+
[themeId, themeIds]
|
|
3985
|
+
);
|
|
3899
3986
|
return /* @__PURE__ */ jsx(
|
|
3900
3987
|
View,
|
|
3901
3988
|
{
|
|
3902
3989
|
style: [
|
|
3903
|
-
|
|
3990
|
+
vars2[themeId],
|
|
3904
3991
|
{ flex: 1, height: "100%", width: "100%" },
|
|
3905
3992
|
props.style
|
|
3906
3993
|
],
|
|
3907
|
-
children: /* @__PURE__ */ jsx(OverlayProvider, { children: /* @__PURE__ */ jsx(ToastProvider, { children: props.children }) })
|
|
3994
|
+
children: /* @__PURE__ */ jsx(ThemeContext.Provider, { value: theme.colors, children: /* @__PURE__ */ jsx(MountedThemeContext.Provider, { value: mountedTheme, children: /* @__PURE__ */ jsx(OverlayProvider, { children: /* @__PURE__ */ jsx(ToastProvider, { children: props.children }) }) }) })
|
|
3908
3995
|
}
|
|
3909
3996
|
);
|
|
3910
3997
|
};
|
|
3911
3998
|
}
|
|
3912
|
-
var GluestackUIProvider = createGluestackUIProvider(
|
|
3999
|
+
var GluestackUIProvider = createGluestackUIProvider({
|
|
4000
|
+
colors,
|
|
4001
|
+
config,
|
|
4002
|
+
variants
|
|
4003
|
+
});
|
|
3913
4004
|
var gridBaseStyle = isWeb ? "grid grid-cols-12" : "box-border flex-row flex-wrap justify-start";
|
|
3914
4005
|
var gridItemBaseStyle = isWeb ? "w-auto col-span-1" : "";
|
|
3915
4006
|
var gridStyle = tva({
|
|
@@ -9399,6 +9490,6 @@ var VStack = React48.forwardRef(
|
|
|
9399
9490
|
);
|
|
9400
9491
|
VStack.displayName = "VStack";
|
|
9401
9492
|
|
|
9402
|
-
export { Accordion, AccordionContent, AccordionContentText, AccordionHeader, AccordionIcon, AccordionItem, AccordionTitleText, AccordionTrigger, Actionsheet, ActionsheetBackdrop, ActionsheetContent, ActionsheetDragIndicator, ActionsheetDragIndicatorWrapper, ActionsheetFlatList, ActionsheetIcon, ActionsheetItem, ActionsheetItemText, ActionsheetScrollView, ActionsheetSectionHeaderText, ActionsheetSectionList, ActionsheetVirtualizedList, AddIcon, Alert, AlertCircleIcon, AlertDialog, AlertDialogBackdrop, AlertDialogBody, AlertDialogCloseButton, AlertDialogContent, AlertDialogFooter, AlertDialogHeader, AlertIcon, AlertText, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, AtSignIcon, Avatar, AvatarBadge, AvatarFallback, AvatarFallbackText, AvatarGroup, AvatarImage, Badge, BadgeIcon, BadgeText, BellIcon, BottomSheet, BottomSheetBackdrop, BottomSheetContent, BottomSheetDragIndicator, BottomSheetFlatList, BottomSheetFooter, BottomSheetItem, BottomSheetItemText, BottomSheetPortal, BottomSheetScrollView, BottomSheetSectionList, BottomSheetTextInput, BottomSheetTrigger, Box, Button, ButtonGroup, ButtonIcon, ButtonSpinner, ButtonText, Calendar, CalendarBody, CalendarDay, CalendarDayIndicator, CalendarDayText, CalendarDaysIcon, CalendarFooter, CalendarGrid, CalendarHeader, CalendarHeaderMonthSelect, CalendarHeaderNextButton, CalendarHeaderPrevButton, CalendarHeaderTitle, CalendarHeaderYearSelect, CalendarWeek, CalendarWeekDay, CalendarWeekDaysHeader, CalendarWeekNumber, Card, Center, CheckCircleIcon, CheckIcon, Checkbox, CheckboxGroup, CheckboxIcon, CheckboxIndicator, CheckboxLabel, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsUpDownIcon, CircleIcon, ClockIcon, CloseCircleIcon, CloseIcon, CopyIcon, DateTimePicker, DateTimePickerIcon, DateTimePickerInput, DateTimePickerTrigger, Divider, DownloadIcon, Drawer, DrawerBackdrop, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, DrawerHeader, EditIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, Fab, FabIcon, FabLabel, FavouriteIcon, FlatList3 as FlatList, FormControl, FormControlError, FormControlErrorIcon, FormControlErrorText, FormControlHelper, FormControlHelperText, FormControlLabel, FormControlLabelAstrick, FormControlLabelText, GlassContainer, GlassView, GlobeIcon, GluestackUIProvider, Grid, GridItem, GripVerticalIcon, HStack, Heading, HelpCircleIcon, Icon, Image2 as Image, ImageBackground, ImageViewer, ImageViewerCloseButton, ImageViewerContent, ImageViewerCounter, ImageViewerNavigation, ImageViewerTrigger, InfoIcon, Input, InputField, InputIcon, InputSlot, Link, LinkIcon, LinkText, LoaderIcon, LockIcon, MailIcon, Menu, MenuIcon, MenuItem, MenuItemLabel, MenuSeparator, MessageCircleIcon, Modal2 as Modal, ModalBackdrop, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, MoonIcon, PaperclipIcon, PhoneIcon, PlayIcon, Popover, PopoverArrow, PopoverBackdrop, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, Portal, Pressable18 as Pressable, Progress, ProgressFilledTrack, Radio, RadioGroup, RadioIcon, RadioIndicator, RadioLabel, RemoveIcon, Repeat1Icon, RepeatIcon, SearchIcon, Select, SelectBackdrop, SelectContent, SelectDragIndicator, SelectDragIndicatorWrapper, SelectFlatList, SelectIcon, SelectInput, SelectItem, SelectPortal, SelectScrollView, SelectSectionHeaderText, SelectSectionList, SelectTrigger, SelectVirtualizedList, SettingsIcon, ShareIcon, Skeleton, SkeletonText, SlashIcon, Slider, SliderFilledTrack, SliderThumb, SliderTrack, Spinner, StarIcon, SunIcon, Switch, Table, TableBody, TableCaption, TableData, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsContentWrapper, TabsIndicator, TabsList, TabsTrigger, TabsTriggerIcon, TabsTriggerText, Text21 as Text, Textarea, TextareaInput, ThreeDotsIcon, Toast, ToastDescription, ToastTitle, Tooltip, TooltipContent, TooltipText, TrashIcon, UIActionsheet, UIAlert, UIFormControl, UIIcon10 as UIIcon, UILink, UIMenu, UIProgress, UISlider, UITooltip, UnlockIcon, VStack, createGluestackUIProvider, createIconUI, useCalendarTheme2 as useCalendarTheme, useGluestackColors2 as useGluestackColors, useToast };
|
|
9403
|
-
//# sourceMappingURL=chunk-
|
|
9404
|
-
//# sourceMappingURL=chunk-
|
|
9493
|
+
export { Accordion, AccordionContent, AccordionContentText, AccordionHeader, AccordionIcon, AccordionItem, AccordionTitleText, AccordionTrigger, Actionsheet, ActionsheetBackdrop, ActionsheetContent, ActionsheetDragIndicator, ActionsheetDragIndicatorWrapper, ActionsheetFlatList, ActionsheetIcon, ActionsheetItem, ActionsheetItemText, ActionsheetScrollView, ActionsheetSectionHeaderText, ActionsheetSectionList, ActionsheetVirtualizedList, AddIcon, Alert, AlertCircleIcon, AlertDialog, AlertDialogBackdrop, AlertDialogBody, AlertDialogCloseButton, AlertDialogContent, AlertDialogFooter, AlertDialogHeader, AlertIcon, AlertText, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, AtSignIcon, Avatar, AvatarBadge, AvatarFallback, AvatarFallbackText, AvatarGroup, AvatarImage, Badge, BadgeIcon, BadgeText, BellIcon, BottomSheet, BottomSheetBackdrop, BottomSheetContent, BottomSheetDragIndicator, BottomSheetFlatList, BottomSheetFooter, BottomSheetItem, BottomSheetItemText, BottomSheetPortal, BottomSheetScrollView, BottomSheetSectionList, BottomSheetTextInput, BottomSheetTrigger, Box, Button, ButtonGroup, ButtonIcon, ButtonSpinner, ButtonText, Calendar, CalendarBody, CalendarDay, CalendarDayIndicator, CalendarDayText, CalendarDaysIcon, CalendarFooter, CalendarGrid, CalendarHeader, CalendarHeaderMonthSelect, CalendarHeaderNextButton, CalendarHeaderPrevButton, CalendarHeaderTitle, CalendarHeaderYearSelect, CalendarWeek, CalendarWeekDay, CalendarWeekDaysHeader, CalendarWeekNumber, Card, Center, CheckCircleIcon, CheckIcon, Checkbox, CheckboxGroup, CheckboxIcon, CheckboxIndicator, CheckboxLabel, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsUpDownIcon, CircleIcon, ClockIcon, CloseCircleIcon, CloseIcon, CopyIcon, DateTimePicker, DateTimePickerIcon, DateTimePickerInput, DateTimePickerTrigger, Divider, DownloadIcon, Drawer, DrawerBackdrop, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, DrawerHeader, EditIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, Fab, FabIcon, FabLabel, FavouriteIcon, FlatList3 as FlatList, FormControl, FormControlError, FormControlErrorIcon, FormControlErrorText, FormControlHelper, FormControlHelperText, FormControlLabel, FormControlLabelAstrick, FormControlLabelText, GlassContainer, GlassView, GlobeIcon, GluestackUIProvider, Grid, GridItem, GripVerticalIcon, HStack, Heading, HelpCircleIcon, Icon, Image2 as Image, ImageBackground, ImageViewer, ImageViewerCloseButton, ImageViewerContent, ImageViewerCounter, ImageViewerNavigation, ImageViewerTrigger, InfoIcon, Input, InputField, InputIcon, InputSlot, Link, LinkIcon, LinkText, LoaderIcon, LockIcon, MailIcon, Menu, MenuIcon, MenuItem, MenuItemLabel, MenuSeparator, MessageCircleIcon, Modal2 as Modal, ModalBackdrop, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, MoonIcon, MountedThemeContext, PaperclipIcon, PhoneIcon, PlayIcon, Popover, PopoverArrow, PopoverBackdrop, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, Portal, Pressable18 as Pressable, Progress, ProgressFilledTrack, Radio, RadioGroup, RadioIcon, RadioIndicator, RadioLabel, RemoveIcon, Repeat1Icon, RepeatIcon, SearchIcon, Select, SelectBackdrop, SelectContent, SelectDragIndicator, SelectDragIndicatorWrapper, SelectFlatList, SelectIcon, SelectInput, SelectItem, SelectPortal, SelectScrollView, SelectSectionHeaderText, SelectSectionList, SelectTrigger, SelectVirtualizedList, SettingsIcon, ShareIcon, Skeleton, SkeletonText, SlashIcon, Slider, SliderFilledTrack, SliderThumb, SliderTrack, Spinner, StarIcon, SunIcon, Switch, Table, TableBody, TableCaption, TableData, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsContentWrapper, TabsIndicator, TabsList, TabsTrigger, TabsTriggerIcon, TabsTriggerText, Text21 as Text, Textarea, TextareaInput, ThemeContext, ThreeDotsIcon, Toast, ToastDescription, ToastTitle, Tooltip, TooltipContent, TooltipText, TrashIcon, UIActionsheet, UIAlert, UIFormControl, UIIcon10 as UIIcon, UILink, UIMenu, UIProgress, UISlider, UITooltip, UnlockIcon, VStack, createGluestackUIProvider, createIconUI, resolveThemeId, useCalendarTheme2 as useCalendarTheme, useGluestackColors2 as useGluestackColors, useMountedColors, useMountedTheme, useToast };
|
|
9494
|
+
//# sourceMappingURL=chunk-B277QSR5.mjs.map
|
|
9495
|
+
//# sourceMappingURL=chunk-B277QSR5.mjs.map
|