@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.
Files changed (64) hide show
  1. package/lib/commonjs/react-native-css.d.js +2 -0
  2. package/lib/commonjs/react-native-css.d.js.map +1 -0
  3. package/lib/commonjs/theme/BloomThemeProvider.js +39 -7
  4. package/lib/commonjs/theme/BloomThemeProvider.js.map +1 -1
  5. package/lib/commonjs/theme/color-presets.js +118 -118
  6. package/lib/commonjs/theme/color-presets.js.map +1 -1
  7. package/lib/commonjs/theme/color-scope/index.js +28 -6
  8. package/lib/commonjs/theme/color-scope/index.js.map +1 -1
  9. package/lib/commonjs/theme/color-scope/style-builder.js +35 -0
  10. package/lib/commonjs/theme/color-scope/style-builder.js.map +1 -1
  11. package/lib/commonjs/theme/native-root-vars.js +105 -0
  12. package/lib/commonjs/theme/native-root-vars.js.map +1 -0
  13. package/lib/commonjs/theme/native-root-vars.web.js +27 -0
  14. package/lib/commonjs/theme/native-root-vars.web.js.map +1 -0
  15. package/lib/commonjs/theme/preset-vars.js +4 -1
  16. package/lib/commonjs/theme/preset-vars.js.map +1 -1
  17. package/lib/module/react-native-css.d.js +2 -0
  18. package/lib/module/react-native-css.d.js.map +1 -0
  19. package/lib/module/theme/BloomThemeProvider.js +40 -8
  20. package/lib/module/theme/BloomThemeProvider.js.map +1 -1
  21. package/lib/module/theme/color-presets.js +118 -118
  22. package/lib/module/theme/color-presets.js.map +1 -1
  23. package/lib/module/theme/color-scope/index.js +29 -7
  24. package/lib/module/theme/color-scope/index.js.map +1 -1
  25. package/lib/module/theme/color-scope/style-builder.js +35 -0
  26. package/lib/module/theme/color-scope/style-builder.js.map +1 -1
  27. package/lib/module/theme/native-root-vars.js +101 -0
  28. package/lib/module/theme/native-root-vars.js.map +1 -0
  29. package/lib/module/theme/native-root-vars.web.js +23 -0
  30. package/lib/module/theme/native-root-vars.web.js.map +1 -0
  31. package/lib/module/theme/preset-vars.js +4 -1
  32. package/lib/module/theme/preset-vars.js.map +1 -1
  33. package/lib/typescript/commonjs/icons/common.d.ts +8 -8
  34. package/lib/typescript/commonjs/theme/BloomThemeProvider.d.ts.map +1 -1
  35. package/lib/typescript/commonjs/theme/color-scope/index.d.ts +9 -2
  36. package/lib/typescript/commonjs/theme/color-scope/index.d.ts.map +1 -1
  37. package/lib/typescript/commonjs/theme/color-scope/style-builder.d.ts +32 -0
  38. package/lib/typescript/commonjs/theme/color-scope/style-builder.d.ts.map +1 -1
  39. package/lib/typescript/commonjs/theme/native-root-vars.d.ts +89 -0
  40. package/lib/typescript/commonjs/theme/native-root-vars.d.ts.map +1 -0
  41. package/lib/typescript/commonjs/theme/native-root-vars.web.d.ts +20 -0
  42. package/lib/typescript/commonjs/theme/native-root-vars.web.d.ts.map +1 -0
  43. package/lib/typescript/commonjs/theme/preset-vars.d.ts.map +1 -1
  44. package/lib/typescript/module/icons/common.d.ts +8 -8
  45. package/lib/typescript/module/theme/BloomThemeProvider.d.ts.map +1 -1
  46. package/lib/typescript/module/theme/color-scope/index.d.ts +9 -2
  47. package/lib/typescript/module/theme/color-scope/index.d.ts.map +1 -1
  48. package/lib/typescript/module/theme/color-scope/style-builder.d.ts +32 -0
  49. package/lib/typescript/module/theme/color-scope/style-builder.d.ts.map +1 -1
  50. package/lib/typescript/module/theme/native-root-vars.d.ts +89 -0
  51. package/lib/typescript/module/theme/native-root-vars.d.ts.map +1 -0
  52. package/lib/typescript/module/theme/native-root-vars.web.d.ts +20 -0
  53. package/lib/typescript/module/theme/native-root-vars.web.d.ts.map +1 -0
  54. package/lib/typescript/module/theme/preset-vars.d.ts.map +1 -1
  55. package/package.json +1 -1
  56. package/src/__tests__/native-root-vars.test.ts +125 -0
  57. package/src/react-native-css.d.ts +69 -0
  58. package/src/theme/BloomThemeProvider.tsx +32 -6
  59. package/src/theme/color-presets.ts +118 -118
  60. package/src/theme/color-scope/index.tsx +30 -8
  61. package/src/theme/color-scope/style-builder.ts +40 -0
  62. package/src/theme/native-root-vars.ts +102 -0
  63. package/src/theme/native-root-vars.web.ts +22 -0
  64. package/src/theme/preset-vars.ts +4 -1
@@ -3,6 +3,14 @@
3
3
  import { Platform } from 'react-native';
4
4
  import { getPresetVars } from "../preset-vars.js";
5
5
  import { lazyRequire } from "../../utils/lazy-require.js";
6
+
7
+ /**
8
+ * Component that provides inline CSS variables to a subtree via NativeWind's
9
+ * (react-native-css's) real `VariableContext`. The runtime strips the leading
10
+ * `--` from each key internally, so we feed it the full `--name -> value`
11
+ * record produced by `buildScopeVars`.
12
+ */
13
+
6
14
  const getNativeWindVars = lazyRequire('nativewind');
7
15
 
8
16
  /**
@@ -16,11 +24,38 @@ export function buildScopeVars(colorPreset, mode) {
16
24
  });
17
25
  }
18
26
 
27
+ /**
28
+ * Resolve NativeWind's `VariableContextProvider` — the canonical, non-deprecated
29
+ * react-native-css v3 API for providing inline CSS variables to a subtree. It
30
+ * reads the same `VariableContext` that interop className components consume, so
31
+ * descendants resolve `var(--primary)` etc. correctly. Returns `null` on web or
32
+ * when `nativewind` is not installed.
33
+ *
34
+ * This replaces the deprecated `vars()`-on-a-plain-`<View>`-style mechanism:
35
+ * under react-native-css@3, `vars()` returns an inline-vars marker that is only
36
+ * propagated to children when the host element matches className style rules
37
+ * (`usesVariables`/`variables`). A plain `<View>` with no `className` drops the
38
+ * vars silently, so the subtree renders without the preset palette.
39
+ */
40
+ export function getVariableContextProvider() {
41
+ if (Platform.OS === 'web') return null;
42
+ const module = getNativeWindVars();
43
+ if (!module || typeof module.VariableContextProvider !== 'function') return null;
44
+ return module.VariableContextProvider;
45
+ }
46
+
19
47
  /**
20
48
  * Build a native style object carrying every CSS var of the preset, using
21
49
  * NativeWind's `vars()` when available. Returns `undefined` on web (where the
22
50
  * provider writes vars to `documentElement` instead) or when `nativewind` is
23
51
  * not installed.
52
+ *
53
+ * @deprecated Under react-native-css@3, `vars()` only propagates to a subtree
54
+ * when applied to an interop className component (the runtime gates propagation
55
+ * on matched className style rules). Applied to a plain `<View>` the vars are
56
+ * dropped silently. Prefer wrapping children in `getVariableContextProvider()`.
57
+ * Retained only as the escape-hatch contract of `useColorScopeStyle`, where the
58
+ * caller owns the host element and is expected to be a className component.
24
59
  */
25
60
  export function buildNativePresetStyle(colorPreset, mode) {
26
61
  if (Platform.OS === 'web') return undefined;
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","getPresetVars","lazyRequire","getNativeWindVars","buildScopeVars","colorPreset","mode","includeResolvedColorVars","buildNativePresetStyle","OS","undefined","module","vars"],"sourceRoot":"../../../../src","sources":["theme/color-scope/style-builder.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAwC,cAAc;AAEvE,SAASC,aAAa,QAAQ,mBAAgB;AAE9C,SAASC,WAAW,QAAQ,6BAA0B;AAMtD,MAAMC,iBAAiB,GAAGD,WAAW,CAAuB,YAAY,CAAC;;AAEzE;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,cAAcA,CAC5BC,WAAyB,EACzBC,IAAsB,EACE;EACxB,OAAOL,aAAa,CAACI,WAAW,EAAEC,IAAI,EAAE;IAAEC,wBAAwB,EAAE;EAAK,CAAC,CAAC;AAC7E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CACpCH,WAAyB,EACzBC,IAAsB,EACA;EACtB,IAAIN,QAAQ,CAACS,EAAE,KAAK,KAAK,EAAE,OAAOC,SAAS;EAC3C,MAAMC,MAAM,GAAGR,iBAAiB,CAAC,CAAC;EAClC,IAAI,CAACQ,MAAM,IAAI,OAAOA,MAAM,CAACC,IAAI,KAAK,UAAU,EAAE,OAAOF,SAAS;EAClE,OAAOC,MAAM,CAACC,IAAI,CAACR,cAAc,CAACC,WAAW,EAAEC,IAAI,CAAC,CAAC;AACvD","ignoreList":[]}
1
+ {"version":3,"names":["Platform","getPresetVars","lazyRequire","getNativeWindVars","buildScopeVars","colorPreset","mode","includeResolvedColorVars","getVariableContextProvider","OS","module","VariableContextProvider","buildNativePresetStyle","undefined","vars"],"sourceRoot":"../../../../src","sources":["theme/color-scope/style-builder.ts"],"mappings":";;AACA,SAASA,QAAQ,QAAwC,cAAc;AAEvE,SAASC,aAAa,QAAQ,mBAAgB;AAE9C,SAASC,WAAW,QAAQ,6BAA0B;;AAEtD;AACA;AACA;AACA;AACA;AACA;;AAWA,MAAMC,iBAAiB,GAAGD,WAAW,CAAuB,YAAY,CAAC;;AAEzE;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,cAAcA,CAC5BC,WAAyB,EACzBC,IAAsB,EACE;EACxB,OAAOL,aAAa,CAACI,WAAW,EAAEC,IAAI,EAAE;IAAEC,wBAAwB,EAAE;EAAK,CAAC,CAAC;AAC7E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,0BAA0BA,CAAA,EAA4C;EACpF,IAAIR,QAAQ,CAACS,EAAE,KAAK,KAAK,EAAE,OAAO,IAAI;EACtC,MAAMC,MAAM,GAAGP,iBAAiB,CAAC,CAAC;EAClC,IAAI,CAACO,MAAM,IAAI,OAAOA,MAAM,CAACC,uBAAuB,KAAK,UAAU,EAAE,OAAO,IAAI;EAChF,OAAOD,MAAM,CAACC,uBAAuB;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CACpCP,WAAyB,EACzBC,IAAsB,EACA;EACtB,IAAIN,QAAQ,CAACS,EAAE,KAAK,KAAK,EAAE,OAAOI,SAAS;EAC3C,MAAMH,MAAM,GAAGP,iBAAiB,CAAC,CAAC;EAClC,IAAI,CAACO,MAAM,IAAI,OAAOA,MAAM,CAACI,IAAI,KAAK,UAAU,EAAE,OAAOD,SAAS;EAClE,OAAOH,MAAM,CAACI,IAAI,CAACV,cAAc,CAACC,WAAW,EAAEC,IAAI,CAAC,CAAC;AACvD","ignoreList":[]}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+
3
+ import { rootVariables } from 'react-native-css/native-internal';
4
+ import { buildScopeVars } from "./color-scope/style-builder.js";
5
+ /**
6
+ * Publish the active color preset's CSS custom properties into react-native-css's
7
+ * GLOBAL root-variable family so they reach the ENTIRE native app tree — including
8
+ * content rendered outside the React subtree of `BloomThemeProvider`: expo-router
9
+ * navigator screens, `Portal`s, `Dialog`/`BottomSheet` overlays, and any other host
10
+ * that paints through a separate React root.
11
+ *
12
+ * Why a global write is required (native only)
13
+ * --------------------------------------------
14
+ * react-native-css resolves a `var(--x)` reference (its `varResolver`) in this order:
15
+ * 1. `name in inheritedVariables` — the React-context-inherited vars. This is what
16
+ * `VariableContextProvider` populates, but it is React-context-scoped, so it only
17
+ * reaches *direct descendants* of the provider in the React tree.
18
+ * 2. `inlineVariables[name]` — same-component inline vars.
19
+ * 3. `variables[name]` — resolved inherited vars.
20
+ * 4. `universalVariables(name)` — a GLOBAL observable family.
21
+ * 5. `rootVariables(name)` — a GLOBAL observable family.
22
+ * 6. the declared fallback.
23
+ *
24
+ * `BloomThemeProvider`'s `VariableContextProvider` only feeds path #1, so the navigator
25
+ * host and every portal/modal — which render outside that subtree — never see the
26
+ * preset vars and fall through to `rootVariables`/`universalVariables`. By default those
27
+ * families hold only react-native-css's own `__rn-css-rem`/`__rn-css-color` entries
28
+ * (Bloom's `global.css` defines the `hsl(var(--primary))` indirection but not the HSL
29
+ * triples themselves — those are injected at runtime), so the whole tree below the
30
+ * navigator renders monochrome. Writing the triples into `rootVariables` here is the
31
+ * exact same mechanism react-native-css uses for compiled `:root {}` / `@theme` vars
32
+ * (`StyleCollection.inject` does `rootVariables(name).set(valueArray)`), so portaled
33
+ * content resolves the palette identically regardless of React-tree position.
34
+ *
35
+ * Why a STATIC `import`, not a runtime `require` (critical)
36
+ * ---------------------------------------------------------
37
+ * react-native-css@3.0.7 ships both a `dist/commonjs` and a `dist/module` build, and
38
+ * Metro bundles BOTH. In `native-internal/root.js` the variable families are plain
39
+ * module-local consts — NOT `globalThis`-guarded the way `StyleCollection` is — so the
40
+ * commonjs `root.js` and the module `root.js` each instantiate their OWN separate
41
+ * `rootVariables` family. The react-native-css renderer (`react-native-css/src/components/View.tsx`
42
+ * → `varResolver`) imports its `root.js` via ESM `import`, i.e. the MODULE build. A
43
+ * runtime `require('react-native-css/native-internal')` resolves the package's `require`
44
+ * export condition → the COMMONJS build → a DIFFERENT family the renderer never
45
+ * subscribes to, so the writes are a silent no-op on device. A static top-level
46
+ * `import` resolves the `import` condition → the MODULE build → the renderer's instance.
47
+ *
48
+ * This plain file is the NATIVE/default variant (Metro selects it on iOS/Android,
49
+ * which have no `.native` override here); the web variant lives in the sibling
50
+ * `native-root-vars.web.ts` no-op, which web bundlers pick over this one. So the
51
+ * static `react-native-css/native-internal` import below is never pulled into a web
52
+ * bundle — only into native. This mirrors Bloom's existing platform-split convention
53
+ * (`color-scope/index.tsx` + `color-scope/index.web.tsx`, `FontLoader.native.tsx`).
54
+ *
55
+ * Keying contract (verified against react-native-css@3.0.7)
56
+ * ---------------------------------------------------------
57
+ * The `rootVariables` family is keyed by the BARE variable name, WITHOUT the leading
58
+ * `--`. The compiler strips it uniformly: a `:root { --primary: ... }` declaration is
59
+ * stored via `rule.v.push([property.slice(2), value])` then routed into
60
+ * `shared.rootVariables[name]`, and `@property --x` goes through
61
+ * `name.startsWith("--") ? name.slice(2) : name`. The lookup side matches: a `var(--x)`
62
+ * reference compiles to `[{}, "var", ident.slice(2)]`, so `varResolver` looks up the
63
+ * bare name. `buildScopeVars` returns keys WITH the `--` prefix, so we strip it before
64
+ * writing each entry.
65
+ *
66
+ * Value shape
67
+ * -----------
68
+ * Each entry is a `VariableValue[]` — an array of `[value, mediaCondition?]` tuples.
69
+ * Bloom's preset vars are unconditional, so each is a single-element `[[value]]`, e.g.
70
+ * `rootVariables('primary').set([['205 87% 53%']])`. This is the same shape the compiler
71
+ * emits for unconditional `:root` vars.
72
+ *
73
+ * This is native-only and additive: the `VariableContextProvider` wrapper stays (it is
74
+ * the correct, scoped mechanism for `BloomColorScope` subtree overrides and harmlessly
75
+ * covers direct descendants). The web fork (`native-root-vars.web.ts`) no-ops — web
76
+ * writes the same vars to `document.documentElement` via `applyColorPresetVars`.
77
+ */
78
+
79
+ /**
80
+ * Write the preset's CSS vars to react-native-css's global `rootVariables` family
81
+ * so the whole native tree (navigator screens + portals/modals/bottom-sheets)
82
+ * resolves the active palette.
83
+ *
84
+ * Each `.set` notifies its own observers synchronously (react-native-css only
85
+ * batches notifications inside its own `StyleCollection.inject`; outside it,
86
+ * `observableBatch.current` is unset so every `.set` runs observers immediately),
87
+ * so sequential writes correctly trigger a re-render when the preset/mode changes.
88
+ *
89
+ * Defensive guard: if a host ships a react-native-css build that doesn't expose
90
+ * `rootVariables` as a callable (it always does on @3), we bail rather than throw.
91
+ */
92
+ export function applyNativeRootVars(colorPreset, mode) {
93
+ if (typeof rootVariables !== 'function') return;
94
+ const vars = buildScopeVars(colorPreset, mode);
95
+ for (const [key, value] of Object.entries(vars)) {
96
+ // The family is keyed by the bare name; `buildScopeVars` keys include `--`.
97
+ const name = key.startsWith('--') ? key.slice(2) : key;
98
+ rootVariables(name).set([[value]]);
99
+ }
100
+ }
101
+ //# sourceMappingURL=native-root-vars.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["rootVariables","buildScopeVars","applyNativeRootVars","colorPreset","mode","vars","key","value","Object","entries","name","startsWith","slice","set"],"sourceRoot":"../../../src","sources":["theme/native-root-vars.ts"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,kCAAkC;AAEhE,SAASC,cAAc,QAAQ,gCAA6B;AAG5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAACC,WAAyB,EAAEC,IAAsB,EAAQ;EAC3F,IAAI,OAAOJ,aAAa,KAAK,UAAU,EAAE;EAEzC,MAAMK,IAAI,GAAGJ,cAAc,CAACE,WAAW,EAAEC,IAAI,CAAC;EAC9C,KAAK,MAAM,CAACE,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACJ,IAAI,CAAC,EAAE;IAC/C;IACA,MAAMK,IAAI,GAAGJ,GAAG,CAACK,UAAU,CAAC,IAAI,CAAC,GAAGL,GAAG,CAACM,KAAK,CAAC,CAAC,CAAC,GAAGN,GAAG;IACtDN,aAAa,CAACU,IAAI,CAAC,CAACG,GAAG,CAAC,CAAC,CAACN,KAAK,CAAC,CAAC,CAAC;EACpC;AACF","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Web fork of `applyNativeRootVars` — a no-op.
5
+ *
6
+ * On web, `BloomThemeProvider` already writes the active preset's CSS vars to
7
+ * `document.documentElement` via `applyColorPresetVars`, which the browser /
8
+ * react-native-web resolve natively. The native/default variant — the plain
9
+ * sibling `native-root-vars.ts` — instead publishes those vars into
10
+ * react-native-css's GLOBAL `rootVariables` family.
11
+ *
12
+ * Keeping the native variant's `react-native-css/native-internal` import out of
13
+ * the web bundle is the whole reason this is a platform-split module: web (and
14
+ * any non-NativeWind host) picks this `.web` fork over the plain file and so
15
+ * never statically pulls react-native-css internals.
16
+ *
17
+ * The signature is intentionally identical to the plain variant so the import
18
+ * site in `BloomThemeProvider` is platform-agnostic.
19
+ */
20
+ export function applyNativeRootVars(_colorPreset, _mode) {
21
+ // Intentionally empty — web applies preset vars to `document.documentElement`.
22
+ }
23
+ //# sourceMappingURL=native-root-vars.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["applyNativeRootVars","_colorPreset","_mode"],"sourceRoot":"../../../src","sources":["theme/native-root-vars.web.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,mBAAmBA,CAACC,YAA0B,EAAEC,KAAuB,EAAQ;EAC7F;AAAA","ignoreList":[]}
@@ -49,7 +49,10 @@ export function getPresetVars(colorName, mode, options = {}) {
49
49
  const isDark = mode === 'dark';
50
50
  const extended = {
51
51
  ...base,
52
- '--card': isDark ? `${hue} 30% 10%` : '0 0% 100%',
52
+ // Light cards carry the same faint preset tint as `--popover` (H 12% 99%)
53
+ // so they read as part of the preset family rather than a pure-white slab —
54
+ // mirroring how dark cards (H 30% 10%) carry the accent hue into near-black.
55
+ '--card': isDark ? `${hue} 30% 10%` : `${hue} 12% 99%`,
53
56
  '--card-foreground': foreground,
54
57
  '--chart-1': `${hue} ${sat}% 85%`,
55
58
  '--chart-2': `${hue} ${sat}% 75%`,
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","APP_COLOR_PRESETS","extractHue","hslVar","parseInt","split","extractSat","RESOLVED_COLOR_MAP","getPresetVars","colorName","mode","options","preset","base","light","dark","get","key","primary","foreground","hue","sat","Math","min","isDark","extended","includeResolvedColorVars","resolved","rawKey","colorKey","Object","entries","value","applyPresetVarsToDocument","OS","document","vars","root","documentElement","style","setProperty"],"sourceRoot":"../../../src","sources":["theme/preset-vars.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,iBAAiB,QAA8C,oBAAiB;AAEzF,SAASC,UAAUA,CAACC,MAAc,EAAU;EAC1C,OAAOC,QAAQ,CAACD,MAAM,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,E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MAAM,CAACG,MAAM,EAAEC,QAAQ,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACxB,kBAAkB,CAAC,EAAE;IACnE,MAAMyB,KAAK,GAAGP,QAAQ,CAACG,MAAM,CAAC;IAC9B,IAAII,KAAK,EAAEL,QAAQ,CAACE,QAAQ,CAAC,GAAG,OAAOG,KAAK,GAAG;EACjD;EACA,OAAOL,QAAQ;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,yBAAyBA,CACvCxB,SAAuB,EACvBC,IAAsB,EACtBC,OAA2B,EACrB;EACN,IAAIX,QAAQ,CAACkC,EAAE,KAAK,KAAK,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE;EAE9D,MAAMC,IAAI,GAAG5B,aAAa,CAACC,SAAS,EAAEC,IAAI,EAAEC,OAAO,CAAC;EACpD,MAAM0B,IAAI,GAAGF,QAAQ,CAACG,eAAe,CAACC,KAAK;EAC3C,KAAK,MAAM,CAACtB,GAAG,EAAEe,KAAK,CAAC,IAAIF,MAAM,CAACC,OAAO,CAACK,IAAI,CAAC,EAAE;IAC/CC,IAAI,CAACG,WAAW,CAACvB,GAAG,EAAEe,KAAK,CAAC;EAC9B;AACF","ignoreList":[]}
1
+ {"version":3,"names":["Platform","APP_COLOR_PRESETS","extractHue","hslVar","parseInt","split","extractSat","RESOLVED_COLOR_MAP","getPresetVars","colorName","mode","options","preset","base","light","dark","get","key","primary","foreground","hue","sat","Math","min","isDark","extended","includeResolvedColorVars","resolved","rawKey","colorKey","Object","entries","value","applyPresetVarsToDocument","OS","document","vars","root","documentElement","style","setProperty"],"sourceRoot":"../../../src","sources":["theme/preset-vars.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,iBAAiB,QAA8C,oBAAiB;AAEzF,SAASC,UAAUA,CAACC,MAAc,EAAU;EAC1C,OAAOC,QAAQ,CAACD,MAAM,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CA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GAAG;IAAE,GAAGF;EAAS,CAAC;EAC9C,KAAK,MAAM,CAACG,MAAM,EAAEC,QAAQ,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACxB,kBAAkB,CAAC,EAAE;IACnE,MAAMyB,KAAK,GAAGP,QAAQ,CAACG,MAAM,CAAC;IAC9B,IAAII,KAAK,EAAEL,QAAQ,CAACE,QAAQ,CAAC,GAAG,OAAOG,KAAK,GAAG;EACjD;EACA,OAAOL,QAAQ;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,yBAAyBA,CACvCxB,SAAuB,EACvBC,IAAsB,EACtBC,OAA2B,EACrB;EACN,IAAIX,QAAQ,CAACkC,EAAE,KAAK,KAAK,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE;EAE9D,MAAMC,IAAI,GAAG5B,aAAa,CAACC,SAAS,EAAEC,IAAI,EAAEC,OAAO,CAAC;EACpD,MAAM0B,IAAI,GAAGF,QAAQ,CAACG,eAAe,CAACC,KAAK;EAC3C,KAAK,MAAM,CAACtB,GAAG,EAAEe,KAAK,CAAC,IAAIF,MAAM,CAACC,OAAO,CAACK,IAAI,CAAC,EAAE;IAC/CC,IAAI,CAACG,WAAW,CAACvB,GAAG,EAAEe,KAAK,CAAC;EAC9B;AACF","ignoreList":[]}
@@ -37,14 +37,6 @@ export declare function useCommonSVGProps(props: Props): {
37
37
  title?: string | undefined;
38
38
  children?: React.ReactNode;
39
39
  filter?: string | undefined;
40
- color?: ColorValue | undefined;
41
- scale?: import("react-native-svg").NumberArray | undefined;
42
- scaleX?: import("react-native-svg").NumberProp | undefined;
43
- scaleY?: import("react-native-svg").NumberProp | undefined;
44
- translateX?: import("react-native-svg").NumberProp | undefined;
45
- translateY?: import("react-native-svg").NumberProp | undefined;
46
- skewX?: import("react-native-svg").NumberProp | undefined;
47
- skewY?: import("react-native-svg").NumberProp | undefined;
48
40
  hitSlop?: number | import("react-native").Insets | undefined;
49
41
  id?: string | undefined;
50
42
  needsOffscreenAlphaCompositing?: boolean | undefined | undefined;
@@ -136,6 +128,14 @@ export declare function useCommonSVGProps(props: Props): {
136
128
  accessibilityShowsLargeContentViewer?: boolean | undefined | undefined;
137
129
  accessibilityLargeContentTitle?: string | undefined | undefined;
138
130
  accessibilityRespondsToUserInteraction?: boolean | undefined | undefined;
131
+ color?: ColorValue | undefined;
132
+ scale?: import("react-native-svg").NumberArray | undefined;
133
+ scaleX?: import("react-native-svg").NumberProp | undefined;
134
+ scaleY?: import("react-native-svg").NumberProp | undefined;
135
+ translateX?: import("react-native-svg").NumberProp | undefined;
136
+ translateY?: import("react-native-svg").NumberProp | undefined;
137
+ skewX?: import("react-native-svg").NumberProp | undefined;
138
+ skewY?: import("react-native-svg").NumberProp | undefined;
139
139
  fontSize?: import("react-native-svg").NumberProp | undefined;
140
140
  fontWeight?: import("react-native-svg").FontWeight | undefined;
141
141
  fontStyle?: import("react-native-svg").FontStyle | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"BloomThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/theme/BloomThemeProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAQN,MAAM,OAAO,CAAC;AACf,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAKL,KAAK,iBAAiB,EAEvB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAKhD,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,YAAY,CAAC;IAC1B,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACnC,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK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AAC;IACzB,iDAAiD;IACjD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE9B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wDAAwD;IACxD,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEjC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE1C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAkJD,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EAAE,cAAc,EACpB,WAAW,EAAE,gBAAgB,EAC7B,WAA0B,EAC1B,kBAAmC,EACnC,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,OAAO,EACP,cAAc,EACd,WAAW,EACX,KAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,QAAQ,GACT,EAAE,uBAAuB,2CAwFzB"}
@@ -19,8 +19,15 @@ export interface BloomColorScopeProps {
19
19
  export declare function BloomColorScope({ colorPreset, asChild, style, children, }: BloomColorScopeProps): import("react/jsx-runtime").JSX.Element;
20
20
  /**
21
21
  * Escape hatch for advanced cases where the wrapping element is owned by the
22
- * caller. Returns a stable native style object carrying the preset's CSS vars.
23
- * Returns `undefined` on web or when `nativewind` is not installed.
22
+ * caller. Returns a stable native style object carrying the preset's CSS vars
23
+ * via NativeWind's `vars()`. Returns `undefined` on web or when `nativewind`
24
+ * is not installed.
25
+ *
26
+ * NOTE: subject to the react-native-css@3 limitation — the returned style only
27
+ * propagates vars to descendants when applied to an interop className component
28
+ * (the runtime gates propagation on matched className style rules). It is a
29
+ * no-op on a plain `<View>` with no `className`. For the common case prefer
30
+ * `<BloomColorScope>`, which wraps children in `VariableContextProvider`.
24
31
  */
25
32
  export declare function useColorScopeStyle(colorPreset: AppColorName): StyleProp<ViewStyle>;
26
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC;IACtC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0GAA0G;IAC1G,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAMD,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,oBAAoB,2CAoCtB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,CAUlF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC;IACtC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0GAA0G;IAC1G,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAMD,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,oBAAoB,2CAmDtB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,CAUlF"}
@@ -1,16 +1,48 @@
1
+ import type React from 'react';
1
2
  import { type StyleProp, type ViewStyle } from 'react-native';
2
3
  import type { AppColorName } from '../color-presets';
4
+ /**
5
+ * Component that provides inline CSS variables to a subtree via NativeWind's
6
+ * (react-native-css's) real `VariableContext`. The runtime strips the leading
7
+ * `--` from each key internally, so we feed it the full `--name -> value`
8
+ * record produced by `buildScopeVars`.
9
+ */
10
+ export type VariableContextProviderComponent = React.ComponentType<{
11
+ value: Record<string, string>;
12
+ children: React.ReactNode;
13
+ }>;
3
14
  /**
4
15
  * Build the CSS custom-property map for a preset, ready to be applied to a
5
16
  * subtree. Always includes the resolved `--color-*` vars so Tailwind v4
6
17
  * `@theme` utilities (e.g. `bg-background`) honour the scope.
7
18
  */
8
19
  export declare function buildScopeVars(colorPreset: AppColorName, mode: 'light' | 'dark'): Record<string, string>;
20
+ /**
21
+ * Resolve NativeWind's `VariableContextProvider` — the canonical, non-deprecated
22
+ * react-native-css v3 API for providing inline CSS variables to a subtree. It
23
+ * reads the same `VariableContext` that interop className components consume, so
24
+ * descendants resolve `var(--primary)` etc. correctly. Returns `null` on web or
25
+ * when `nativewind` is not installed.
26
+ *
27
+ * This replaces the deprecated `vars()`-on-a-plain-`<View>`-style mechanism:
28
+ * under react-native-css@3, `vars()` returns an inline-vars marker that is only
29
+ * propagated to children when the host element matches className style rules
30
+ * (`usesVariables`/`variables`). A plain `<View>` with no `className` drops the
31
+ * vars silently, so the subtree renders without the preset palette.
32
+ */
33
+ export declare function getVariableContextProvider(): VariableContextProviderComponent | null;
9
34
  /**
10
35
  * Build a native style object carrying every CSS var of the preset, using
11
36
  * NativeWind's `vars()` when available. Returns `undefined` on web (where the
12
37
  * provider writes vars to `documentElement` instead) or when `nativewind` is
13
38
  * not installed.
39
+ *
40
+ * @deprecated Under react-native-css@3, `vars()` only propagates to a subtree
41
+ * when applied to an interop className component (the runtime gates propagation
42
+ * on matched className style rules). Applied to a plain `<View>` the vars are
43
+ * dropped silently. Prefer wrapping children in `getVariableContextProvider()`.
44
+ * Retained only as the escape-hatch contract of `useColorScopeStyle`, where the
45
+ * caller owns the host element and is expected to be a className component.
14
46
  */
15
47
  export declare function buildNativePresetStyle(colorPreset: AppColorName, mode: 'light' | 'dark'): StyleProp<ViewStyle>;
16
48
  //# sourceMappingURL=style-builder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"style-builder.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/style-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AASrD;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,GACrB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,GACrB,SAAS,CAAC,SAAS,CAAC,CAKtB"}
1
+ {"version":3,"file":"style-builder.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/style-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAY,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD;;;;;GAKG;AACH,MAAM,MAAM,gCAAgC,GAAG,KAAK,CAAC,aAAa,CAAC;IACjE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC,CAAC;AASH;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,GACrB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,IAAI,gCAAgC,GAAG,IAAI,CAKpF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,GACrB,SAAS,CAAC,SAAS,CAAC,CAKtB"}
@@ -0,0 +1,89 @@
1
+ import { type AppColorName } from './color-presets';
2
+ /**
3
+ * Publish the active color preset's CSS custom properties into react-native-css's
4
+ * GLOBAL root-variable family so they reach the ENTIRE native app tree — including
5
+ * content rendered outside the React subtree of `BloomThemeProvider`: expo-router
6
+ * navigator screens, `Portal`s, `Dialog`/`BottomSheet` overlays, and any other host
7
+ * that paints through a separate React root.
8
+ *
9
+ * Why a global write is required (native only)
10
+ * --------------------------------------------
11
+ * react-native-css resolves a `var(--x)` reference (its `varResolver`) in this order:
12
+ * 1. `name in inheritedVariables` — the React-context-inherited vars. This is what
13
+ * `VariableContextProvider` populates, but it is React-context-scoped, so it only
14
+ * reaches *direct descendants* of the provider in the React tree.
15
+ * 2. `inlineVariables[name]` — same-component inline vars.
16
+ * 3. `variables[name]` — resolved inherited vars.
17
+ * 4. `universalVariables(name)` — a GLOBAL observable family.
18
+ * 5. `rootVariables(name)` — a GLOBAL observable family.
19
+ * 6. the declared fallback.
20
+ *
21
+ * `BloomThemeProvider`'s `VariableContextProvider` only feeds path #1, so the navigator
22
+ * host and every portal/modal — which render outside that subtree — never see the
23
+ * preset vars and fall through to `rootVariables`/`universalVariables`. By default those
24
+ * families hold only react-native-css's own `__rn-css-rem`/`__rn-css-color` entries
25
+ * (Bloom's `global.css` defines the `hsl(var(--primary))` indirection but not the HSL
26
+ * triples themselves — those are injected at runtime), so the whole tree below the
27
+ * navigator renders monochrome. Writing the triples into `rootVariables` here is the
28
+ * exact same mechanism react-native-css uses for compiled `:root {}` / `@theme` vars
29
+ * (`StyleCollection.inject` does `rootVariables(name).set(valueArray)`), so portaled
30
+ * content resolves the palette identically regardless of React-tree position.
31
+ *
32
+ * Why a STATIC `import`, not a runtime `require` (critical)
33
+ * ---------------------------------------------------------
34
+ * react-native-css@3.0.7 ships both a `dist/commonjs` and a `dist/module` build, and
35
+ * Metro bundles BOTH. In `native-internal/root.js` the variable families are plain
36
+ * module-local consts — NOT `globalThis`-guarded the way `StyleCollection` is — so the
37
+ * commonjs `root.js` and the module `root.js` each instantiate their OWN separate
38
+ * `rootVariables` family. The react-native-css renderer (`react-native-css/src/components/View.tsx`
39
+ * → `varResolver`) imports its `root.js` via ESM `import`, i.e. the MODULE build. A
40
+ * runtime `require('react-native-css/native-internal')` resolves the package's `require`
41
+ * export condition → the COMMONJS build → a DIFFERENT family the renderer never
42
+ * subscribes to, so the writes are a silent no-op on device. A static top-level
43
+ * `import` resolves the `import` condition → the MODULE build → the renderer's instance.
44
+ *
45
+ * This plain file is the NATIVE/default variant (Metro selects it on iOS/Android,
46
+ * which have no `.native` override here); the web variant lives in the sibling
47
+ * `native-root-vars.web.ts` no-op, which web bundlers pick over this one. So the
48
+ * static `react-native-css/native-internal` import below is never pulled into a web
49
+ * bundle — only into native. This mirrors Bloom's existing platform-split convention
50
+ * (`color-scope/index.tsx` + `color-scope/index.web.tsx`, `FontLoader.native.tsx`).
51
+ *
52
+ * Keying contract (verified against react-native-css@3.0.7)
53
+ * ---------------------------------------------------------
54
+ * The `rootVariables` family is keyed by the BARE variable name, WITHOUT the leading
55
+ * `--`. The compiler strips it uniformly: a `:root { --primary: ... }` declaration is
56
+ * stored via `rule.v.push([property.slice(2), value])` then routed into
57
+ * `shared.rootVariables[name]`, and `@property --x` goes through
58
+ * `name.startsWith("--") ? name.slice(2) : name`. The lookup side matches: a `var(--x)`
59
+ * reference compiles to `[{}, "var", ident.slice(2)]`, so `varResolver` looks up the
60
+ * bare name. `buildScopeVars` returns keys WITH the `--` prefix, so we strip it before
61
+ * writing each entry.
62
+ *
63
+ * Value shape
64
+ * -----------
65
+ * Each entry is a `VariableValue[]` — an array of `[value, mediaCondition?]` tuples.
66
+ * Bloom's preset vars are unconditional, so each is a single-element `[[value]]`, e.g.
67
+ * `rootVariables('primary').set([['205 87% 53%']])`. This is the same shape the compiler
68
+ * emits for unconditional `:root` vars.
69
+ *
70
+ * This is native-only and additive: the `VariableContextProvider` wrapper stays (it is
71
+ * the correct, scoped mechanism for `BloomColorScope` subtree overrides and harmlessly
72
+ * covers direct descendants). The web fork (`native-root-vars.web.ts`) no-ops — web
73
+ * writes the same vars to `document.documentElement` via `applyColorPresetVars`.
74
+ */
75
+ /**
76
+ * Write the preset's CSS vars to react-native-css's global `rootVariables` family
77
+ * so the whole native tree (navigator screens + portals/modals/bottom-sheets)
78
+ * resolves the active palette.
79
+ *
80
+ * Each `.set` notifies its own observers synchronously (react-native-css only
81
+ * batches notifications inside its own `StyleCollection.inject`; outside it,
82
+ * `observableBatch.current` is unset so every `.set` runs observers immediately),
83
+ * so sequential writes correctly trigger a re-render when the preset/mode changes.
84
+ *
85
+ * Defensive guard: if a host ships a react-native-css build that doesn't expose
86
+ * `rootVariables` as a callable (it always does on @3), we bail rather than throw.
87
+ */
88
+ export declare function applyNativeRootVars(colorPreset: AppColorName, mode: 'light' | 'dark'): void;
89
+ //# sourceMappingURL=native-root-vars.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-root-vars.d.ts","sourceRoot":"","sources":["../../../../src/theme/native-root-vars.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAEH;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAS3F"}
@@ -0,0 +1,20 @@
1
+ import { type AppColorName } from './color-presets';
2
+ /**
3
+ * Web fork of `applyNativeRootVars` — a no-op.
4
+ *
5
+ * On web, `BloomThemeProvider` already writes the active preset's CSS vars to
6
+ * `document.documentElement` via `applyColorPresetVars`, which the browser /
7
+ * react-native-web resolve natively. The native/default variant — the plain
8
+ * sibling `native-root-vars.ts` — instead publishes those vars into
9
+ * react-native-css's GLOBAL `rootVariables` family.
10
+ *
11
+ * Keeping the native variant's `react-native-css/native-internal` import out of
12
+ * the web bundle is the whole reason this is a platform-split module: web (and
13
+ * any non-NativeWind host) picks this `.web` fork over the plain file and so
14
+ * never statically pulls react-native-css internals.
15
+ *
16
+ * The signature is intentionally identical to the plain variant so the import
17
+ * site in `BloomThemeProvider` is platform-agnostic.
18
+ */
19
+ export declare function applyNativeRootVars(_colorPreset: AppColorName, _mode: 'light' | 'dark'): void;
20
+ //# sourceMappingURL=native-root-vars.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-root-vars.web.d.ts","sourceRoot":"","sources":["../../../../src/theme/native-root-vars.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAE7F"}
@@ -1 +1 @@
1
- {"version":3,"file":"preset-vars.d.ts","sourceRoot":"","sources":["../../../../src/theme/preset-vars.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAiC1F,MAAM,WAAW,iBAAiB;IAChC;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,YAAY,EACvB,IAAI,EAAE,OAAO,GAAG,MAAM,EACtB,OAAO,GAAE,iBAAsB,GAC9B,YAAY,CAqCd;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,YAAY,EACvB,IAAI,EAAE,OAAO,GAAG,MAAM,EACtB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,IAAI,CAQN"}
1
+ {"version":3,"file":"preset-vars.d.ts","sourceRoot":"","sources":["../../../../src/theme/preset-vars.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAiC1F,MAAM,WAAW,iBAAiB;IAChC;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,YAAY,EACvB,IAAI,EAAE,OAAO,GAAG,MAAM,EACtB,OAAO,GAAE,iBAAsB,GAC9B,YAAY,CAwCd;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,YAAY,EACvB,IAAI,EAAE,OAAO,GAAG,MAAM,EACtB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,IAAI,CAQN"}
@@ -37,14 +37,6 @@ export declare function useCommonSVGProps(props: Props): {
37
37
  title?: string | undefined;
38
38
  children?: React.ReactNode;
39
39
  filter?: string | undefined;
40
- color?: ColorValue | undefined;
41
- scale?: import("react-native-svg").NumberArray | undefined;
42
- scaleX?: import("react-native-svg").NumberProp | undefined;
43
- scaleY?: import("react-native-svg").NumberProp | undefined;
44
- translateX?: import("react-native-svg").NumberProp | undefined;
45
- translateY?: import("react-native-svg").NumberProp | undefined;
46
- skewX?: import("react-native-svg").NumberProp | undefined;
47
- skewY?: import("react-native-svg").NumberProp | undefined;
48
40
  hitSlop?: number | import("react-native").Insets | undefined;
49
41
  id?: string | undefined;
50
42
  needsOffscreenAlphaCompositing?: boolean | undefined | undefined;
@@ -136,6 +128,14 @@ export declare function useCommonSVGProps(props: Props): {
136
128
  accessibilityShowsLargeContentViewer?: boolean | undefined | undefined;
137
129
  accessibilityLargeContentTitle?: string | undefined | undefined;
138
130
  accessibilityRespondsToUserInteraction?: boolean | undefined | undefined;
131
+ color?: ColorValue | undefined;
132
+ scale?: import("react-native-svg").NumberArray | undefined;
133
+ scaleX?: import("react-native-svg").NumberProp | undefined;
134
+ scaleY?: import("react-native-svg").NumberProp | undefined;
135
+ translateX?: import("react-native-svg").NumberProp | undefined;
136
+ translateY?: import("react-native-svg").NumberProp | undefined;
137
+ skewX?: import("react-native-svg").NumberProp | undefined;
138
+ skewY?: import("react-native-svg").NumberProp | undefined;
139
139
  fontSize?: import("react-native-svg").NumberProp | undefined;
140
140
  fontWeight?: import("react-native-svg").FontWeight | undefined;
141
141
  fontStyle?: import("react-native-svg").FontStyle | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"BloomThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/theme/BloomThemeProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAQN,MAAM,OAAO,CAAC;AACf,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAKL,KAAK,iBAAiB,EAEvB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAKhD,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,YAAY,CA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MAAM,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iDAAiD;IACjD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE9B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wDAAwD;IACxD,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEjC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE1C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAkJD,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EAAE,cAAc,EACpB,WAAW,EAAE,gBAAgB,EAC7B,WAA0B,EAC1B,kBAAmC,EACnC,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,OAAO,EACP,cAAc,EACd,WAAW,EACX,KAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,QAAQ,GACT,EAAE,uBAAuB,2CAwFzB"}
@@ -19,8 +19,15 @@ export interface BloomColorScopeProps {
19
19
  export declare function BloomColorScope({ colorPreset, asChild, style, children, }: BloomColorScopeProps): import("react/jsx-runtime").JSX.Element;
20
20
  /**
21
21
  * Escape hatch for advanced cases where the wrapping element is owned by the
22
- * caller. Returns a stable native style object carrying the preset's CSS vars.
23
- * Returns `undefined` on web or when `nativewind` is not installed.
22
+ * caller. Returns a stable native style object carrying the preset's CSS vars
23
+ * via NativeWind's `vars()`. Returns `undefined` on web or when `nativewind`
24
+ * is not installed.
25
+ *
26
+ * NOTE: subject to the react-native-css@3 limitation — the returned style only
27
+ * propagates vars to descendants when applied to an interop className component
28
+ * (the runtime gates propagation on matched className style rules). It is a
29
+ * no-op on a plain `<View>` with no `className`. For the common case prefer
30
+ * `<BloomColorScope>`, which wraps children in `VariableContextProvider`.
24
31
  */
25
32
  export declare function useColorScopeStyle(colorPreset: AppColorName): StyleProp<ViewStyle>;
26
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC;IACtC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0GAA0G;IAC1G,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAMD,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,oBAAoB,2CAoCtB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,CAUlF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC;IACtC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0GAA0G;IAC1G,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAMD,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,oBAAoB,2CAmDtB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,CAUlF"}
@@ -1,16 +1,48 @@
1
+ import type React from 'react';
1
2
  import { type StyleProp, type ViewStyle } from 'react-native';
2
3
  import type { AppColorName } from '../color-presets';
4
+ /**
5
+ * Component that provides inline CSS variables to a subtree via NativeWind's
6
+ * (react-native-css's) real `VariableContext`. The runtime strips the leading
7
+ * `--` from each key internally, so we feed it the full `--name -> value`
8
+ * record produced by `buildScopeVars`.
9
+ */
10
+ export type VariableContextProviderComponent = React.ComponentType<{
11
+ value: Record<string, string>;
12
+ children: React.ReactNode;
13
+ }>;
3
14
  /**
4
15
  * Build the CSS custom-property map for a preset, ready to be applied to a
5
16
  * subtree. Always includes the resolved `--color-*` vars so Tailwind v4
6
17
  * `@theme` utilities (e.g. `bg-background`) honour the scope.
7
18
  */
8
19
  export declare function buildScopeVars(colorPreset: AppColorName, mode: 'light' | 'dark'): Record<string, string>;
20
+ /**
21
+ * Resolve NativeWind's `VariableContextProvider` — the canonical, non-deprecated
22
+ * react-native-css v3 API for providing inline CSS variables to a subtree. It
23
+ * reads the same `VariableContext` that interop className components consume, so
24
+ * descendants resolve `var(--primary)` etc. correctly. Returns `null` on web or
25
+ * when `nativewind` is not installed.
26
+ *
27
+ * This replaces the deprecated `vars()`-on-a-plain-`<View>`-style mechanism:
28
+ * under react-native-css@3, `vars()` returns an inline-vars marker that is only
29
+ * propagated to children when the host element matches className style rules
30
+ * (`usesVariables`/`variables`). A plain `<View>` with no `className` drops the
31
+ * vars silently, so the subtree renders without the preset palette.
32
+ */
33
+ export declare function getVariableContextProvider(): VariableContextProviderComponent | null;
9
34
  /**
10
35
  * Build a native style object carrying every CSS var of the preset, using
11
36
  * NativeWind's `vars()` when available. Returns `undefined` on web (where the
12
37
  * provider writes vars to `documentElement` instead) or when `nativewind` is
13
38
  * not installed.
39
+ *
40
+ * @deprecated Under react-native-css@3, `vars()` only propagates to a subtree
41
+ * when applied to an interop className component (the runtime gates propagation
42
+ * on matched className style rules). Applied to a plain `<View>` the vars are
43
+ * dropped silently. Prefer wrapping children in `getVariableContextProvider()`.
44
+ * Retained only as the escape-hatch contract of `useColorScopeStyle`, where the
45
+ * caller owns the host element and is expected to be a className component.
14
46
  */
15
47
  export declare function buildNativePresetStyle(colorPreset: AppColorName, mode: 'light' | 'dark'): StyleProp<ViewStyle>;
16
48
  //# sourceMappingURL=style-builder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"style-builder.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/style-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AASrD;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,GACrB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,GACrB,SAAS,CAAC,SAAS,CAAC,CAKtB"}
1
+ {"version":3,"file":"style-builder.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/style-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAY,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD;;;;;GAKG;AACH,MAAM,MAAM,gCAAgC,GAAG,KAAK,CAAC,aAAa,CAAC;IACjE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC,CAAC;AASH;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,GACrB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,IAAI,gCAAgC,GAAG,IAAI,CAKpF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,GACrB,SAAS,CAAC,SAAS,CAAC,CAKtB"}