@oxyhq/bloom 0.68.0 → 0.69.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.
Files changed (116) hide show
  1. package/lib/commonjs/animated-check/AnimatedCheck.js +22 -93
  2. package/lib/commonjs/animated-check/AnimatedCheck.js.map +1 -1
  3. package/lib/commonjs/avatar/Avatar.js +6 -24
  4. package/lib/commonjs/avatar/Avatar.js.map +1 -1
  5. package/lib/commonjs/avatar/AvatarRing.js +14 -30
  6. package/lib/commonjs/avatar/AvatarRing.js.map +1 -1
  7. package/lib/commonjs/bottom-sheet/index.js +9 -4
  8. package/lib/commonjs/bottom-sheet/index.js.map +1 -1
  9. package/lib/commonjs/connection-status/index.js +16 -7
  10. package/lib/commonjs/connection-status/index.js.map +1 -1
  11. package/lib/commonjs/connection-status/netinfo.js +119 -0
  12. package/lib/commonjs/connection-status/netinfo.js.map +1 -0
  13. package/lib/commonjs/hooks/haptics-module.js +109 -0
  14. package/lib/commonjs/hooks/haptics-module.js.map +1 -0
  15. package/lib/commonjs/hooks/useHaptics.js +6 -8
  16. package/lib/commonjs/hooks/useHaptics.js.map +1 -1
  17. package/lib/commonjs/loading/SpinnerIcon.js +22 -55
  18. package/lib/commonjs/loading/SpinnerIcon.js.map +1 -1
  19. package/lib/commonjs/theme/adaptive-colors.js +20 -4
  20. package/lib/commonjs/theme/adaptive-colors.js.map +1 -1
  21. package/lib/commonjs/theme/color-scope/style-builder.js +107 -6
  22. package/lib/commonjs/theme/color-scope/style-builder.js.map +1 -1
  23. package/lib/commonjs/theme/init-css-interop.js +13 -11
  24. package/lib/commonjs/theme/init-css-interop.js.map +1 -1
  25. package/lib/module/animated-check/AnimatedCheck.js +22 -91
  26. package/lib/module/animated-check/AnimatedCheck.js.map +1 -1
  27. package/lib/module/avatar/Avatar.js +1 -19
  28. package/lib/module/avatar/Avatar.js.map +1 -1
  29. package/lib/module/avatar/AvatarRing.js +7 -23
  30. package/lib/module/avatar/AvatarRing.js.map +1 -1
  31. package/lib/module/bottom-sheet/index.js +9 -4
  32. package/lib/module/bottom-sheet/index.js.map +1 -1
  33. package/lib/module/connection-status/index.js +16 -6
  34. package/lib/module/connection-status/index.js.map +1 -1
  35. package/lib/module/connection-status/netinfo.js +114 -0
  36. package/lib/module/connection-status/netinfo.js.map +1 -0
  37. package/lib/module/hooks/haptics-module.js +104 -0
  38. package/lib/module/hooks/haptics-module.js.map +1 -0
  39. package/lib/module/hooks/useHaptics.js +7 -11
  40. package/lib/module/hooks/useHaptics.js.map +1 -1
  41. package/lib/module/loading/SpinnerIcon.js +13 -46
  42. package/lib/module/loading/SpinnerIcon.js.map +1 -1
  43. package/lib/module/loading/index.web.js +2 -2
  44. package/lib/module/theme/adaptive-colors.js +20 -4
  45. package/lib/module/theme/adaptive-colors.js.map +1 -1
  46. package/lib/module/theme/color-scope/style-builder.js +107 -6
  47. package/lib/module/theme/color-scope/style-builder.js.map +1 -1
  48. package/lib/module/theme/init-css-interop.js +13 -11
  49. package/lib/module/theme/init-css-interop.js.map +1 -1
  50. package/lib/typescript/commonjs/animated-check/AnimatedCheck.d.ts.map +1 -1
  51. package/lib/typescript/commonjs/avatar/Avatar.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/avatar/AvatarRing.d.ts.map +1 -1
  53. package/lib/typescript/commonjs/bottom-sheet/index.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/connection-status/index.d.ts.map +1 -1
  55. package/lib/typescript/commonjs/connection-status/netinfo.d.ts +69 -0
  56. package/lib/typescript/commonjs/connection-status/netinfo.d.ts.map +1 -0
  57. package/lib/typescript/commonjs/hooks/haptics-module.d.ts +58 -0
  58. package/lib/typescript/commonjs/hooks/haptics-module.d.ts.map +1 -0
  59. package/lib/typescript/commonjs/hooks/useHaptics.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/loading/SpinnerIcon.d.ts +9 -2
  61. package/lib/typescript/commonjs/loading/SpinnerIcon.d.ts.map +1 -1
  62. package/lib/typescript/commonjs/theme/adaptive-colors.d.ts.map +1 -1
  63. package/lib/typescript/commonjs/theme/color-scope/style-builder.d.ts.map +1 -1
  64. package/lib/typescript/commonjs/theme/init-css-interop.d.ts.map +1 -1
  65. package/lib/typescript/module/animated-check/AnimatedCheck.d.ts.map +1 -1
  66. package/lib/typescript/module/avatar/Avatar.d.ts.map +1 -1
  67. package/lib/typescript/module/avatar/AvatarRing.d.ts.map +1 -1
  68. package/lib/typescript/module/bottom-sheet/index.d.ts.map +1 -1
  69. package/lib/typescript/module/connection-status/index.d.ts.map +1 -1
  70. package/lib/typescript/module/connection-status/netinfo.d.ts +69 -0
  71. package/lib/typescript/module/connection-status/netinfo.d.ts.map +1 -0
  72. package/lib/typescript/module/hooks/haptics-module.d.ts +58 -0
  73. package/lib/typescript/module/hooks/haptics-module.d.ts.map +1 -0
  74. package/lib/typescript/module/hooks/useHaptics.d.ts.map +1 -1
  75. package/lib/typescript/module/loading/SpinnerIcon.d.ts +9 -2
  76. package/lib/typescript/module/loading/SpinnerIcon.d.ts.map +1 -1
  77. package/lib/typescript/module/theme/adaptive-colors.d.ts.map +1 -1
  78. package/lib/typescript/module/theme/color-scope/style-builder.d.ts.map +1 -1
  79. package/lib/typescript/module/theme/init-css-interop.d.ts.map +1 -1
  80. package/package.json +2 -2
  81. package/src/__tests__/color-scope-nativewind.test.ts +135 -0
  82. package/src/__tests__/connection-status-netinfo.test.tsx +203 -0
  83. package/src/__tests__/optional-peer-imports.test.ts +406 -0
  84. package/src/__tests__/svg-required-peer.test.tsx +75 -0
  85. package/src/__tests__/useHaptics.test.tsx +203 -16
  86. package/src/animated-check/AnimatedCheck.tsx +19 -86
  87. package/src/avatar/Avatar.tsx +1 -11
  88. package/src/avatar/AvatarRing.tsx +7 -15
  89. package/src/bottom-sheet/index.tsx +9 -4
  90. package/src/connection-status/index.tsx +16 -6
  91. package/src/connection-status/netinfo.ts +131 -0
  92. package/src/hooks/haptics-module.ts +118 -0
  93. package/src/hooks/useHaptics.tsx +6 -9
  94. package/src/loading/SpinnerIcon.tsx +13 -52
  95. package/src/loading/index.web.ts +2 -2
  96. package/src/theme/adaptive-colors.ts +20 -4
  97. package/src/theme/color-scope/style-builder.ts +118 -6
  98. package/src/theme/init-css-interop.ts +13 -11
  99. package/lib/commonjs/avatar/svg-module.js +0 -15
  100. package/lib/commonjs/avatar/svg-module.js.map +0 -1
  101. package/lib/commonjs/utils/lazy-require.js +0 -37
  102. package/lib/commonjs/utils/lazy-require.js.map +0 -1
  103. package/lib/module/avatar/svg-module.js +0 -11
  104. package/lib/module/avatar/svg-module.js.map +0 -1
  105. package/lib/module/utils/lazy-require.js +0 -33
  106. package/lib/module/utils/lazy-require.js.map +0 -1
  107. package/lib/typescript/commonjs/avatar/svg-module.d.ts +0 -8
  108. package/lib/typescript/commonjs/avatar/svg-module.d.ts.map +0 -1
  109. package/lib/typescript/commonjs/utils/lazy-require.d.ts +0 -15
  110. package/lib/typescript/commonjs/utils/lazy-require.d.ts.map +0 -1
  111. package/lib/typescript/module/avatar/svg-module.d.ts +0 -8
  112. package/lib/typescript/module/avatar/svg-module.d.ts.map +0 -1
  113. package/lib/typescript/module/utils/lazy-require.d.ts +0 -15
  114. package/lib/typescript/module/utils/lazy-require.d.ts.map +0 -1
  115. package/src/avatar/svg-module.ts +0 -11
  116. package/src/utils/lazy-require.ts +0 -31
@@ -2,7 +2,48 @@
2
2
 
3
3
  import { Platform } from 'react-native';
4
4
  import { CANONICAL_TOKENS, getResolvedTokens } from "../token-registry.js";
5
- import { lazyRequire } from "../../utils/lazy-require.js";
5
+
6
+ /**
7
+ * The optional-peer boundary for `nativewind`.
8
+ *
9
+ * The consumer's OWN nativewind has to be the one that answers: its version
10
+ * decides which var mechanism exists (`VariableContextProvider` under
11
+ * NativeWind 5 / react-native-css@3, `vars()` before it), and a scope built
12
+ * against a second copy would publish into a context nothing reads. That rules
13
+ * out reaching for Bloom's own `react-native-css` dependency, and an optional
14
+ * peer rules out a static import — Metro resolves those eagerly, so an app
15
+ * without nativewind would fail to BUILD rather than degrade.
16
+ *
17
+ * What is left is the one dynamic shape Metro understands: `require()` of a
18
+ * STRING LITERAL as a DIRECT statement of a `try` block, collected as an
19
+ * optional dependency. Both halves matter, and both were verified against metro
20
+ * 0.83.5's own `collectDependencies`:
21
+ *
22
+ * - The shape this replaced — the deleted `utils/lazy-require.ts`, which took
23
+ * the specifier as a function PARAMETER — is not statically evaluable, so
24
+ * Metro collected no dependency at all and rewrote the call into a thrower
25
+ * ("Dynamic require defined at line N; not supported by Metro"). It resolved
26
+ * NOTHING from a consumer's `node_modules` whether or not nativewind was
27
+ * installed, and `BloomColorScope` could never scope NativeWind classes on a
28
+ * device.
29
+ * - `isOptionalDependency` returns at the first BlockStatement above the call,
30
+ * so one `if`/`else` of nesting inside the try loses the optional marking and
31
+ * an absent nativewind fails the BUILD. Hence the `typeof require` guard
32
+ * below sits outside the try.
33
+ *
34
+ * `require` may not exist at all (this file also backs the `import` condition,
35
+ * i.e. an ESM build under Node), hence that guard. Both callers below return
36
+ * before loading on web, where the vars are written to `document.documentElement`
37
+ * instead.
38
+ *
39
+ * @see connection-status/netinfo.ts — the same boundary for netinfo.
40
+ */
41
+
42
+ /**
43
+ * Declared locally rather than taken from the ambient `NodeRequire`, which
44
+ * returns `any`: `unknown` forces the module handle to be narrowed below instead
45
+ * of leaking an untyped value into the caller.
46
+ */
6
47
 
7
48
  /**
8
49
  * Component that provides inline CSS variables to a subtree via NativeWind's
@@ -11,7 +52,57 @@ import { lazyRequire } from "../../utils/lazy-require.js";
11
52
  * record produced by `buildScopeVars`.
12
53
  */
13
54
 
14
- const getNativeWindVars = lazyRequire('nativewind');
55
+ /**
56
+ * The slice of nativewind's surface Bloom uses. Hand-written so no nativewind
57
+ * type reaches Bloom's emitted declarations — a consumer that skips the optional
58
+ * peer must not inherit a TS7016 from Bloom's own `.d.ts`.
59
+ */
60
+
61
+ /** `undefined` until the first load attempt, then the module or `null`. */
62
+ let nativeWindModule;
63
+ /** Why the scope cannot be applied, quoted verbatim in the dev warning. */
64
+ let unavailableReason = '';
65
+ let hasWarned = false;
66
+
67
+ /** The nativewind module, or `null` when the optional peer is not installed. */
68
+ function loadNativeWindVars() {
69
+ if (nativeWindModule !== undefined) return nativeWindModule;
70
+ nativeWindModule = null;
71
+
72
+ // The `typeof require` guard sits OUTSIDE the try on purpose — see the second
73
+ // constraint above. Nested one `if`/`else` deeper, the require stops counting
74
+ // as optional and an app without nativewind fails to BUILD.
75
+ if (typeof require === 'undefined') {
76
+ unavailableReason = 'this bundle has no CommonJS `require`';
77
+ return nativeWindModule;
78
+ }
79
+ try {
80
+ const loaded = require('nativewind');
81
+ if (typeof loaded?.vars === 'function') {
82
+ nativeWindModule = loaded;
83
+ } else {
84
+ unavailableReason = 'the module resolved without a `vars` export';
85
+ }
86
+ } catch (error) {
87
+ unavailableReason = error instanceof Error ? error.message : String(error);
88
+ }
89
+ return nativeWindModule;
90
+ }
91
+
92
+ /**
93
+ * One warning per module lifetime, and none in production — the same mechanism
94
+ * as `connection-status/netinfo.ts`. A scope that does not scope is invisible:
95
+ * the subtree keeps rendering, just in the app-wide palette instead of the
96
+ * requested one.
97
+ */
98
+ function warnScopeInert(detail) {
99
+ if (process.env.NODE_ENV === 'production' || hasWarned) return;
100
+ hasWarned = true;
101
+ // Internal Bloom diagnostic: only the consumer's package.json can fix this,
102
+ // so it names the package and the install command.
103
+ // eslint-disable-next-line no-console
104
+ console.warn(`[Bloom] BloomColorScope cannot scope NativeWind classes on native: ${detail} ` + 'Descendants keep resolving `var(--primary)` and friends against the ' + 'app-wide preset. Install the optional peer (`npx expo install nativewind`) ' + `to enable scoped presets. Reason: ${unavailableReason}`);
105
+ }
15
106
 
16
107
  /**
17
108
  * Build the CSS custom-property map for a preset, ready to be applied to a
@@ -52,8 +143,15 @@ export function buildScopeVars(colorPreset, mode, accents) {
52
143
  */
53
144
  export function getVariableContextProvider() {
54
145
  if (Platform.OS === 'web') return null;
55
- const module = getNativeWindVars();
56
- if (!module || typeof module.VariableContextProvider !== 'function') return null;
146
+ const module = loadNativeWindVars();
147
+ if (!module) {
148
+ warnScopeInert('the optional peer `nativewind` could not be loaded.');
149
+ return null;
150
+ }
151
+ if (typeof module.VariableContextProvider !== 'function') {
152
+ warnScopeInert('the installed `nativewind` exports no `VariableContextProvider` (the ' + 'NativeWind 5 / react-native-css@3 API this needs).');
153
+ return null;
154
+ }
57
155
  return module.VariableContextProvider;
58
156
  }
59
157
 
@@ -72,8 +170,11 @@ export function getVariableContextProvider() {
72
170
  */
73
171
  export function buildNativePresetStyle(colorPreset, mode) {
74
172
  if (Platform.OS === 'web') return undefined;
75
- const module = getNativeWindVars();
76
- if (!module || typeof module.vars !== 'function') return undefined;
173
+ const module = loadNativeWindVars();
174
+ if (!module) {
175
+ warnScopeInert('the optional peer `nativewind` could not be loaded.');
176
+ return undefined;
177
+ }
77
178
  return module.vars(buildScopeVars(colorPreset, mode));
78
179
  }
79
180
  //# sourceMappingURL=style-builder.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","CANONICAL_TOKENS","getResolvedTokens","lazyRequire","getNativeWindVars","buildScopeVars","colorPreset","mode","accents","tokens","vars","token","value","undefined","getVariableContextProvider","OS","module","VariableContextProvider","buildNativePresetStyle"],"sourceRoot":"../../../../src","sources":["theme/color-scope/style-builder.ts"],"mappings":";;AACA,SAASA,QAAQ,QAAwC,cAAc;AAEvE,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,sBAAmB;AAGvE,SAASC,WAAW,QAAQ,6BAA0B;;AAEtD;AACA;AACA;AACA;AACA;AACA;;AAWA,MAAMC,iBAAiB,GAAGD,WAAW,CAAuB,YAAY,CAAC;;AAEzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,cAAcA,CAC5BC,WAAyB,EACzBC,IAAsB,EACtBC,OAAyB,EACD;EACxB,MAAMC,MAAM,GAAGP,iBAAiB,CAACI,WAAW,EAAEC,IAAI,EAAEC,OAAO,CAAC;EAC5D,MAAME,IAA4B,GAAG;IAAE,GAAGD;EAAO,CAAC;EAElD,KAAK,MAAME,KAAK,IAAIV,gBAAgB,EAAE;IACpC,MAAMW,KAAK,GAAGH,MAAM,CAAC,KAAKE,KAAK,EAAE,CAAC;IAClC,IAAIC,KAAK,KAAKC,SAAS,EAAE;MACvBH,IAAI,CAAC,WAAWC,KAAK,EAAE,CAAC,GAAGC,KAAK;IAClC;EACF;EAEA,OAAOF,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,0BAA0BA,CAAA,EAA4C;EACpF,IAAId,QAAQ,CAACe,EAAE,KAAK,KAAK,EAAE,OAAO,IAAI;EACtC,MAAMC,MAAM,GAAGZ,iBAAiB,CAAC,CAAC;EAClC,IAAI,CAACY,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,CACpCZ,WAAyB,EACzBC,IAAsB,EACA;EACtB,IAAIP,QAAQ,CAACe,EAAE,KAAK,KAAK,EAAE,OAAOF,SAAS;EAC3C,MAAMG,MAAM,GAAGZ,iBAAiB,CAAC,CAAC;EAClC,IAAI,CAACY,MAAM,IAAI,OAAOA,MAAM,CAACN,IAAI,KAAK,UAAU,EAAE,OAAOG,SAAS;EAClE,OAAOG,MAAM,CAACN,IAAI,CAACL,cAAc,CAACC,WAAW,EAAEC,IAAI,CAAC,CAAC;AACvD","ignoreList":[]}
1
+ {"version":3,"names":["Platform","CANONICAL_TOKENS","getResolvedTokens","nativeWindModule","unavailableReason","hasWarned","loadNativeWindVars","undefined","require","loaded","vars","error","Error","message","String","warnScopeInert","detail","process","env","NODE_ENV","console","warn","buildScopeVars","colorPreset","mode","accents","tokens","token","value","getVariableContextProvider","OS","module","VariableContextProvider","buildNativePresetStyle"],"sourceRoot":"../../../../src","sources":["theme/color-scope/style-builder.ts"],"mappings":"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","ignoreList":[]}
@@ -66,20 +66,22 @@ function tryCallSetFlag() {
66
66
  let mod;
67
67
  // `require` does not exist in an ES module, so guard before touching it —
68
68
  // an unguarded reference is a ReferenceError, not a resolution failure.
69
- // Matches the pattern used by every other optional-module load in Bloom
70
- // (`utils/lazy-require.ts`, `theme/adaptive-colors.ts`,
71
- // `bottom-sheet/index.tsx`).
72
69
  if (typeof require === 'undefined') return;
73
70
  try {
74
- // Dynamic require: css-interop is not a Bloom dependency. If the host
75
- // app ships it (via NativeWind or directly), this resolves. Otherwise
76
- // the require throws and we silently move on — there is nothing to
77
- // initialize because css-interop is not in the bundle.
71
+ // Dynamic require: css-interop is neither a Bloom dependency nor a declared
72
+ // peer. The specifier goes through a variable to keep a plain-text
73
+ // `require('react-native-css-interop')` out of the file, so bundlers that
74
+ // scan for one do not try to resolve (and warn about, or fail on) a module
75
+ // Bloom never asked for.
78
76
  //
79
- // The specifier goes through a variable on purpose: a literal
80
- // `require('react-native-css-interop')` is statically analysable, so
81
- // bundlers try to resolve (and warn about, or fail on) a module that is
82
- // intentionally absent. The indirection keeps this a pure runtime lookup.
77
+ // Metro is not among them: its dependency collector EVALUATES the argument,
78
+ // folds this `const`, and treats the call exactly as it would a literal —
79
+ // optional, because it is a direct statement of a `try` block. So the
80
+ // indirection buys nothing under Metro and costs nothing either. It is not a
81
+ // pattern to copy: a specifier Metro cannot evaluate (a function parameter,
82
+ // a computed value) collects no dependency at all and is rewritten into a
83
+ // thrower, which is how `lazyRequire` silently killed four subsystems. See
84
+ // `connection-status/netinfo.ts` for the shape a real peer must use.
83
85
  const moduleName = 'react-native-css-interop';
84
86
  // eslint-disable-next-line @typescript-eslint/no-require-imports
85
87
  mod = require(moduleName);
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","initialized","warned","CSS_VAR_NAME","CSS_VAR_VALUE","warnOnce","message","error","console","warn","setWebCssVariable","document","root","documentElement","current","style","getPropertyValue","setProperty","tryCallSetFlag","mod","require","moduleName","setFlag","StyleSheet","call","initCssInteropDarkMode","OS"],"sourceRoot":"../../../src","sources":["theme/init-css-interop.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;;AAEvC;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,IAAIC,WAAW,GAAG,KAAK;AACvB,IAAIC,MAAM,GAAG,KAAK;AAElB,MAAMC,YAAY,GAAG,wBAAwB;AAC7C,MAAMC,aAAa,GAAG,YAAY;AAUlC,SAASC,QAAQA,CAACC,OAAe,EAAEC,KAAe,EAAQ;EACxD,IAAIL,MAAM,EAAE;EACZA,MAAM,GAAG,IAAI;EACb;EACA;EACA;EACAM,OAAO,CAACC,IAAI,CAAC,WAAWH,OAAO,EAAE,EAAEC,KAAK,IAAI,EAAE,CAAC;AACjD;AAEA,SAASG,iBAAiBA,CAAA,EAAS;EACjC,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE;EACrC,MAAMC,IAAI,GAAGD,QAAQ,CAACE,eAAe;EACrC,IAAI,CAACD,IAAI,EAAE;EACX;EACA;EACA;EACA,MAAME,OAAO,GAAGF,IAAI,CAACG,KAAK,CAACC,gBAAgB,CAACb,YAAY,CAAC;EACzD,IAAIW,OAAO,EAAE;EACbF,IAAI,CAACG,KAAK,CAACE,WAAW,CAACd,YAAY,EAAEC,aAAa,CAAC;AACrD;AAEA,SAASc,cAAcA,CAAA,EAAS;EAC9B,IAAIC,GAAiC;EACrC;EACA;EACA;EACA;EACA;EACA,IAAI,OAAOC,OAAO,KAAK,WAAW,EAAE;EACpC,IAAI;IACF;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,MAAMC,UAAU,GAAG,0BAA0B;IAC7C;IACAF,GAAG,GAAGC,OAAO,CAACC,UAAU,CAAqB;EAC/C,CAAC,CAAC,MAAM;IACN;EACF;EAEA,MAAMC,OAAO,GAAGH,GAAG,EAAEI,UAAU,EAAED,OAAO;EACxC,IAAI,OAAOA,OAAO,KAAK,UAAU,EAAE;IACjC;IACA;IACA;IACA;IACA;EACF;EAEA,IAAI;IACFA,OAAO,CAACE,IAAI,CAACL,GAAG,EAAEI,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC;EACpD,CAAC,CAAC,OAAOhB,KAAK,EAAE;IACdF,QAAQ,CACN,0EAA0E,GACxE,kDAAkD,EACpDE,KACF,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASkB,sBAAsBA,CAAA,EAAS;EAC7C,IAAIxB,WAAW,EAAE;EACjBA,WAAW,GAAG,IAAI;EAElB,IAAID,QAAQ,CAAC0B,EAAE,KAAK,KAAK,EAAE;IACzBhB,iBAAiB,CAAC,CAAC;EACrB;EAEAQ,cAAc,CAAC,CAAC;AAClB;;AAEA;AACA;AACA;AACAO,sBAAsB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Platform","initialized","warned","CSS_VAR_NAME","CSS_VAR_VALUE","warnOnce","message","error","console","warn","setWebCssVariable","document","root","documentElement","current","style","getPropertyValue","setProperty","tryCallSetFlag","mod","require","moduleName","setFlag","StyleSheet","call","initCssInteropDarkMode","OS"],"sourceRoot":"../../../src","sources":["theme/init-css-interop.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;;AAEvC;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,IAAIC,WAAW,GAAG,KAAK;AACvB,IAAIC,MAAM,GAAG,KAAK;AAElB,MAAMC,YAAY,GAAG,wBAAwB;AAC7C,MAAMC,aAAa,GAAG,YAAY;AAUlC,SAASC,QAAQA,CAACC,OAAe,EAAEC,KAAe,EAAQ;EACxD,IAAIL,MAAM,EAAE;EACZA,MAAM,GAAG,IAAI;EACb;EACA;EACA;EACAM,OAAO,CAACC,IAAI,CAAC,WAAWH,OAAO,EAAE,EAAEC,KAAK,IAAI,EAAE,CAAC;AACjD;AAEA,SAASG,iBAAiBA,CAAA,EAAS;EACjC,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE;EACrC,MAAMC,IAAI,GAAGD,QAAQ,CAACE,eAAe;EACrC,IAAI,CAACD,IAAI,EAAE;EACX;EACA;EACA;EACA,MAAME,OAAO,GAAGF,IAAI,CAACG,KAAK,CAACC,gBAAgB,CAACb,YAAY,CAAC;EACzD,IAAIW,OAAO,EAAE;EACbF,IAAI,CAACG,KAAK,CAACE,WAAW,CAACd,YAAY,EAAEC,aAAa,CAAC;AACrD;AAEA,SAASc,cAAcA,CAAA,EAAS;EAC9B,IAAIC,GAAiC;EACrC;EACA;EACA,IAAI,OAAOC,OAAO,KAAK,WAAW,EAAE;EACpC,IAAI;IACF;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,MAAMC,UAAU,GAAG,0BAA0B;IAC7C;IACAF,GAAG,GAAGC,OAAO,CAACC,UAAU,CAAqB;EAC/C,CAAC,CAAC,MAAM;IACN;EACF;EAEA,MAAMC,OAAO,GAAGH,GAAG,EAAEI,UAAU,EAAED,OAAO;EACxC,IAAI,OAAOA,OAAO,KAAK,UAAU,EAAE;IACjC;IACA;IACA;IACA;IACA;EACF;EAEA,IAAI;IACFA,OAAO,CAACE,IAAI,CAACL,GAAG,EAAEI,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC;EACpD,CAAC,CAAC,OAAOhB,KAAK,EAAE;IACdF,QAAQ,CACN,0EAA0E,GACxE,kDAAkD,EACpDE,KACF,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASkB,sBAAsBA,CAAA,EAAS;EAC7C,IAAIxB,WAAW,EAAE;EACjBA,WAAW,GAAG,IAAI;EAElB,IAAID,QAAQ,CAAC0B,EAAE,KAAK,KAAK,EAAE;IACzBhB,iBAAiB,CAAC,CAAC;EACrB;EAEAQ,cAAc,CAAC,CAAC;AAClB;;AAEA;AACA;AACA;AACAO,sBAAsB,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"AnimatedCheck.d.ts","sourceRoot":"","sources":["../../../../src/animated-check/AnimatedCheck.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgE,MAAM,OAAO,CAAC;AAgCrF,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA8GD;;;;GAIG;AACH,eAAO,MAAM,aAAa,6FAWzB,CAAC"}
1
+ {"version":3,"file":"AnimatedCheck.d.ts","sourceRoot":"","sources":["../../../../src/animated-check/AnimatedCheck.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AA4B5E,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAQD;;;;GAIG;AACH,eAAO,MAAM,aAAa,6FAyDzB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAY/D,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,SAAS,CAAC;AA8X7D,eAAO,MAAM,MAAM,yCAAwB,CAAC"}
1
+ {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAY/D,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,SAAS,CAAC;AAoX7D,eAAO,MAAM,MAAM,yCAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarRing.d.ts","sourceRoot":"","sources":["../../../../src/avatar/AvatarRing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAM7C,OAAO,KAAK,EAAE,2BAA2B,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAOxE;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjF;AAED,UAAU,eAAe;IACvB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,KAAK,EAAE,WAAW,CAAC;IACnB,uDAAuD;IACvD,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ,sDAAsD;IACtD,iBAAiB,EAAE,2BAA2B,CAAC;CAChD;AAmID,eAAO,MAAM,UAAU,6CAA4B,CAAC"}
1
+ {"version":3,"file":"AvatarRing.d.ts","sourceRoot":"","sources":["../../../../src/avatar/AvatarRing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAM7C,OAAO,KAAK,EAAE,2BAA2B,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAOxE;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjF;AAED,UAAU,eAAe;IACvB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,KAAK,EAAE,WAAW,CAAC;IACnB,uDAAuD;IACvD,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ,sDAAsD;IACtD,iBAAiB,EAAE,2BAA2B,CAAC;CAChD;AA2HD,eAAO,MAAM,UAAU,6CAA4B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bottom-sheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAEH,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAEtB,MAAM,mBAAmB,CAAC;AA8E3B,QAAA,MAAM,WAAW,yFAEf,CAAC;AAUH,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC;AACjD,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bottom-sheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAEH,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAEtB,MAAM,mBAAmB,CAAC;AAmF3B,QAAA,MAAM,WAAW,yFAEf,CAAC;AAUH,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC;AACjD,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/connection-status/index.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAA6B,KAAK,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAEvF,YAAY,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAE5D,mDAAmD;AACnD,wBAAgB,sBAAsB,CAAC,KAAK,GAAE,2BAAgC,GAAG,IAAI,CAcpF;yBAde,sBAAsB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/connection-status/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAA6B,KAAK,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAEvF,YAAY,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAE5D,mDAAmD;AACnD,wBAAgB,sBAAsB,CAAC,KAAK,GAAE,2BAAgC,GAAG,IAAI,CAsBpF;yBAtBe,sBAAsB"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * The optional-peer boundary for `@react-native-community/netinfo`.
3
+ *
4
+ * netinfo is an OPTIONAL peer, and a static `import` contradicts that: an
5
+ * optional peer that is omitted does not degrade, it fails to RESOLVE, and Metro
6
+ * aborts the whole bundle with `Unable to resolve module
7
+ * @react-native-community/netinfo` — naming a package the app never mentions.
8
+ * Bloom's other optional-peer static imports are immune by accident (`expo-font`
9
+ * ships inside `expo`; `react-dom` is required by react-native-web), but netinfo
10
+ * arrives with nothing, so for this one the failure is real.
11
+ *
12
+ * Metro treats a `require()` of a STRING LITERAL inside a `try` block as an
13
+ * optional dependency: it resolves the real module when installed, and writes
14
+ * `null` into the dependency map when it is not, so the failure moves from build
15
+ * time to the `catch` below. Three constraints the shape has to respect, each
16
+ * checked against metro 0.83.5's own `collectDependencies`:
17
+ *
18
+ * - The specifier must be STATICALLY EVALUABLE, and a literal is the only form
19
+ * worth relying on. Metro rewrites a require it cannot evaluate — the
20
+ * specifier arriving as a function parameter, say — into a thrower ("Dynamic
21
+ * require defined at line N; not supported by Metro"), collecting no
22
+ * dependency at all, so it resolves nothing whether or not the package is
23
+ * installed. That is the defect that made Bloom's haptics, spinner and
24
+ * native color scoping silently dead before it was swept out.
25
+ * - The require must be a DIRECT statement of the try block.
26
+ * `isOptionalDependency` walks up from the call and returns at the first
27
+ * BlockStatement it meets, marking the dependency optional only if that
28
+ * block belongs to a `try`. One `if`/`else` of nesting is enough to lose it,
29
+ * and a non-optional dependency that cannot be resolved fails the BUILD —
30
+ * precisely what this boundary exists to avoid. Hence the `typeof require`
31
+ * guard below sits outside the try rather than inside it.
32
+ * - `require` may not exist at all (this file also backs the `import`
33
+ * condition, i.e. an ESM build under Node), hence that guard.
34
+ *
35
+ * The caller degrades to inert rather than throwing: an absent netinfo costs the
36
+ * outage toast and nothing else, and crashing an app root over a missing
37
+ * cosmetic affordance would be a worse trade than the build failure this
38
+ * replaces. The degradation is silent by construction — a connection toast that
39
+ * never appears looks exactly like a connection that never dropped — so
40
+ * {@link warnNetInfoUnavailable} names the missing package once, in dev.
41
+ */
42
+ /** The slice of netinfo's state this component reads. */
43
+ export interface NetInfoStateLike {
44
+ isConnected: boolean | null;
45
+ isInternetReachable: boolean | null | undefined;
46
+ }
47
+ /**
48
+ * The slice of netinfo's module surface this component calls.
49
+ *
50
+ * Hand-written rather than `typeof import('@react-native-community/netinfo')` so
51
+ * no netinfo type reaches Bloom's emitted declarations — a consumer that skips
52
+ * the optional peer must not inherit a TS7016 from Bloom's own `.d.ts`. The two
53
+ * are kept in step by the assignability check in
54
+ * `__tests__/connection-status-netinfo.test.tsx`, which is excluded from the
55
+ * build and so may name the real package.
56
+ */
57
+ export interface NetInfoLike {
58
+ addEventListener: (listener: (state: NetInfoStateLike) => void) => () => void;
59
+ }
60
+ /** The netinfo module, or `null` when the optional peer is not installed. */
61
+ export declare function loadNetInfo(): NetInfoLike | null;
62
+ /**
63
+ * One warning per module lifetime, and none in production — the same mechanism
64
+ * as `toast/use-single-outlet-guard.ts`. Metro and Vite/Rolldown both fold the
65
+ * `NODE_ENV` check statically, so a production bundle keeps neither the branch
66
+ * nor the message.
67
+ */
68
+ export declare function warnNetInfoUnavailable(): void;
69
+ //# sourceMappingURL=netinfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"netinfo.d.ts","sourceRoot":"","sources":["../../../../src/connection-status/netinfo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AASH,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5B,mBAAmB,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;CACjD;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;CAC/E;AAQD,6EAA6E;AAC7E,wBAAgB,WAAW,IAAI,WAAW,GAAG,IAAI,CAiChD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAa7C"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * The optional-peer boundary for `expo-haptics`.
3
+ *
4
+ * The load has to be dynamic — an optional peer that is omitted does not
5
+ * degrade when it is imported statically, it fails to RESOLVE and Metro aborts
6
+ * the whole bundle naming a package the app never mentions. But it also has to
7
+ * be dynamic in the ONE shape Metro understands: a `require()` of a STRING
8
+ * LITERAL inside a `try` block, which Metro collects as an optional dependency
9
+ * (resolving the real module when installed, writing `null` into the dependency
10
+ * map when it is not, so the failure lands in the `catch` below at evaluation
11
+ * time instead of at build time).
12
+ *
13
+ * The shape this replaced — the deleted `utils/lazy-require.ts`, which took the
14
+ * specifier as a function PARAMETER — satisfied neither. Metro can only collect
15
+ * a dependency whose specifier it can evaluate statically; a parameter it
16
+ * cannot, so it collected nothing and rewrote the call into a thrower ("Dynamic
17
+ * require defined at line N; not supported by Metro"). From a consumer's
18
+ * `node_modules` that resolved NOTHING, installed or not: `expo-haptics` was
19
+ * never loaded on any device and every haptic in Bloom was a silent no-op. It
20
+ * only ever worked under jest, which is CommonJS with a real dynamic `require`.
21
+ *
22
+ * `require` may also not exist at all (this file backs the `import` condition
23
+ * too, i.e. an ESM build under Node), hence the `typeof` guard.
24
+ *
25
+ * A missing haptic is invisible — indistinguishable from a device with haptics
26
+ * turned off — so {@link warnHapticsUnavailable} names the package once, in dev.
27
+ *
28
+ * @see connection-status/netinfo.ts — the same boundary for netinfo.
29
+ */
30
+ /**
31
+ * The slice of expo-haptics' module surface this hook calls.
32
+ *
33
+ * Hand-written rather than `typeof import('expo-haptics')` so no expo-haptics
34
+ * type reaches Bloom's emitted declarations — a consumer that skips the optional
35
+ * peer must not inherit a TS7016 from Bloom's own `.d.ts`. The two are kept in
36
+ * step by the assignability check in `__tests__/useHaptics.test.tsx`, which is
37
+ * excluded from the build and so may name the real package.
38
+ *
39
+ * `impactAsync` is declared in METHOD syntax deliberately: `strictFunctionTypes`
40
+ * exempts method parameters from contravariance, which is what keeps the real
41
+ * `(style?: ImpactFeedbackStyle) => Promise<void>` assignable to a `string`
42
+ * parameter here. The widening cannot admit a bad value in practice — the only
43
+ * arguments passed are read straight back out of `ImpactFeedbackStyle`.
44
+ */
45
+ export interface HapticsLike {
46
+ ImpactFeedbackStyle: Record<'Light' | 'Medium' | 'Heavy', string>;
47
+ impactAsync(style?: string): Promise<void>;
48
+ }
49
+ /** The expo-haptics module, or `null` when the optional peer is not installed. */
50
+ export declare function loadHaptics(): HapticsLike | null;
51
+ /**
52
+ * One warning per module lifetime, and none in production — the same mechanism
53
+ * as `connection-status/netinfo.ts` and `toast/use-single-outlet-guard.ts`.
54
+ * Metro and Vite/Rolldown both fold the `NODE_ENV` check statically, so a
55
+ * production bundle keeps neither the branch nor the message.
56
+ */
57
+ export declare function warnHapticsUnavailable(): void;
58
+ //# sourceMappingURL=haptics-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"haptics-module.d.ts","sourceRoot":"","sources":["../../../../src/hooks/haptics-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AASH;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,WAAW;IAC1B,mBAAmB,EAAE,MAAM,CAAC,OAAO,GAAG,QAAQ,GAAG,OAAO,EAAE,MAAM,CAAC,CAAC;IAClE,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAQD,kFAAkF;AAClF,wBAAgB,WAAW,IAAI,WAAW,GAAG,IAAI,CAiChD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAY7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"useHaptics.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useHaptics.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0D,MAAM,OAAO,CAAC;AAW/E,6CAA6C;AAC7C,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAQ1D,MAAM,WAAW,yBAAyB;IACxC,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,OAAc,EAAE,QAAQ,EAAE,EAAE,yBAAyB,2CAG3F;yBAHe,oBAAoB;;;AAOpC;;;;;;;;GAQG;AACH,wBAAgB,UAAU,IAAI,CAAC,QAAQ,CAAC,EAAE,cAAc,KAAK,IAAI,CAqBhE"}
1
+ {"version":3,"file":"useHaptics.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useHaptics.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0D,MAAM,OAAO,CAAC;AAK/E,6CAA6C;AAC7C,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAQ1D,MAAM,WAAW,yBAAyB;IACxC,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,OAAc,EAAE,QAAQ,EAAE,EAAE,yBAAyB,2CAG3F;yBAHe,oBAAoB;;;AAOpC;;;;;;;;GAQG;AACH,wBAAgB,UAAU,IAAI,CAAC,QAAQ,CAAC,EAAE,cAAc,KAAK,IAAI,CAwBhE"}
@@ -8,8 +8,15 @@ interface SpinnerIconProps {
8
8
  }
9
9
  /**
10
10
  * iOS-style SVG spinner with 8 rotating rectangles and an opacity gradient trail.
11
- * Requires react-native-svg (lazy) and react-native-reanimated (static).
12
- * Falls back to ActivityIndicator if react-native-svg is missing.
11
+ *
12
+ * `react-native-svg` and `react-native-reanimated` are both REQUIRED peers and
13
+ * both are imported statically. Reanimated in particular must never be loaded at
14
+ * runtime: the worklets Babel plugin performs build-time closure analysis
15
+ * (`__closure` metadata) that fails on a runtime require, which crashes the UI
16
+ * thread with "Tried to synchronously call a non-worklet function `addListener`".
17
+ *
18
+ * Native only — `SpinnerIcon.web.tsx` draws the same shape with CSS, so this
19
+ * file is never reached by a web bundler.
13
20
  */
14
21
  export declare const SpinnerIcon: React.FC<SpinnerIconProps>;
15
22
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"SpinnerIcon.d.ts","sourceRoot":"","sources":["../../../../src/loading/SpinnerIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAqBjE,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAwED;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAqBlD,CAAC"}
1
+ {"version":3,"file":"SpinnerIcon.d.ts","sourceRoot":"","sources":["../../../../src/loading/SpinnerIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAU9C,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAwDlD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"adaptive-colors.d.ts","sourceRoot":"","sources":["../../../../src/theme/adaptive-colors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAgG3C,wBAAgB,iBAAiB,IAAI,WAAW,GAAG,IAAI,CAItD"}
1
+ {"version":3,"file":"adaptive-colors.d.ts","sourceRoot":"","sources":["../../../../src/theme/adaptive-colors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAgH3C,wBAAgB,iBAAiB,IAAI,WAAW,GAAG,IAAI,CAItD"}
@@ -1 +1 @@
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;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD;;;;;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;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,EACtB,OAAO,CAAC,EAAE,eAAe,GACxB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYxB;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"}
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;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AA6CtD;;;;;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;AAkEH;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,EACtB,OAAO,CAAC,EAAE,eAAe,GACxB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYxB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,IAAI,gCAAgC,GAAG,IAAI,CAepF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,GACrB,SAAS,CAAC,SAAS,CAAC,CAQtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"init-css-interop.d.ts","sourceRoot":"","sources":["../../../../src/theme/init-css-interop.ts"],"names":[],"mappings":"AAuHA;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAS7C"}
1
+ {"version":3,"file":"init-css-interop.d.ts","sourceRoot":"","sources":["../../../../src/theme/init-css-interop.ts"],"names":[],"mappings":"AAyHA;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAS7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"AnimatedCheck.d.ts","sourceRoot":"","sources":["../../../../src/animated-check/AnimatedCheck.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgE,MAAM,OAAO,CAAC;AAgCrF,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA8GD;;;;GAIG;AACH,eAAO,MAAM,aAAa,6FAWzB,CAAC"}
1
+ {"version":3,"file":"AnimatedCheck.d.ts","sourceRoot":"","sources":["../../../../src/animated-check/AnimatedCheck.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AA4B5E,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAQD;;;;GAIG;AACH,eAAO,MAAM,aAAa,6FAyDzB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAY/D,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,SAAS,CAAC;AA8X7D,eAAO,MAAM,MAAM,yCAAwB,CAAC"}
1
+ {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAY/D,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,SAAS,CAAC;AAoX7D,eAAO,MAAM,MAAM,yCAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarRing.d.ts","sourceRoot":"","sources":["../../../../src/avatar/AvatarRing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAM7C,OAAO,KAAK,EAAE,2BAA2B,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAOxE;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjF;AAED,UAAU,eAAe;IACvB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,KAAK,EAAE,WAAW,CAAC;IACnB,uDAAuD;IACvD,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ,sDAAsD;IACtD,iBAAiB,EAAE,2BAA2B,CAAC;CAChD;AAmID,eAAO,MAAM,UAAU,6CAA4B,CAAC"}
1
+ {"version":3,"file":"AvatarRing.d.ts","sourceRoot":"","sources":["../../../../src/avatar/AvatarRing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAM7C,OAAO,KAAK,EAAE,2BAA2B,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAOxE;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjF;AAED,UAAU,eAAe;IACvB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,KAAK,EAAE,WAAW,CAAC;IACnB,uDAAuD;IACvD,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ,sDAAsD;IACtD,iBAAiB,EAAE,2BAA2B,CAAC;CAChD;AA2HD,eAAO,MAAM,UAAU,6CAA4B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bottom-sheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAEH,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAEtB,MAAM,mBAAmB,CAAC;AA8E3B,QAAA,MAAM,WAAW,yFAEf,CAAC;AAUH,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC;AACjD,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bottom-sheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAEH,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAEtB,MAAM,mBAAmB,CAAC;AAmF3B,QAAA,MAAM,WAAW,yFAEf,CAAC;AAUH,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC;AACjD,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/connection-status/index.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAA6B,KAAK,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAEvF,YAAY,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAE5D,mDAAmD;AACnD,wBAAgB,sBAAsB,CAAC,KAAK,GAAE,2BAAgC,GAAG,IAAI,CAcpF;yBAde,sBAAsB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/connection-status/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAA6B,KAAK,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAEvF,YAAY,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAE5D,mDAAmD;AACnD,wBAAgB,sBAAsB,CAAC,KAAK,GAAE,2BAAgC,GAAG,IAAI,CAsBpF;yBAtBe,sBAAsB"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * The optional-peer boundary for `@react-native-community/netinfo`.
3
+ *
4
+ * netinfo is an OPTIONAL peer, and a static `import` contradicts that: an
5
+ * optional peer that is omitted does not degrade, it fails to RESOLVE, and Metro
6
+ * aborts the whole bundle with `Unable to resolve module
7
+ * @react-native-community/netinfo` — naming a package the app never mentions.
8
+ * Bloom's other optional-peer static imports are immune by accident (`expo-font`
9
+ * ships inside `expo`; `react-dom` is required by react-native-web), but netinfo
10
+ * arrives with nothing, so for this one the failure is real.
11
+ *
12
+ * Metro treats a `require()` of a STRING LITERAL inside a `try` block as an
13
+ * optional dependency: it resolves the real module when installed, and writes
14
+ * `null` into the dependency map when it is not, so the failure moves from build
15
+ * time to the `catch` below. Three constraints the shape has to respect, each
16
+ * checked against metro 0.83.5's own `collectDependencies`:
17
+ *
18
+ * - The specifier must be STATICALLY EVALUABLE, and a literal is the only form
19
+ * worth relying on. Metro rewrites a require it cannot evaluate — the
20
+ * specifier arriving as a function parameter, say — into a thrower ("Dynamic
21
+ * require defined at line N; not supported by Metro"), collecting no
22
+ * dependency at all, so it resolves nothing whether or not the package is
23
+ * installed. That is the defect that made Bloom's haptics, spinner and
24
+ * native color scoping silently dead before it was swept out.
25
+ * - The require must be a DIRECT statement of the try block.
26
+ * `isOptionalDependency` walks up from the call and returns at the first
27
+ * BlockStatement it meets, marking the dependency optional only if that
28
+ * block belongs to a `try`. One `if`/`else` of nesting is enough to lose it,
29
+ * and a non-optional dependency that cannot be resolved fails the BUILD —
30
+ * precisely what this boundary exists to avoid. Hence the `typeof require`
31
+ * guard below sits outside the try rather than inside it.
32
+ * - `require` may not exist at all (this file also backs the `import`
33
+ * condition, i.e. an ESM build under Node), hence that guard.
34
+ *
35
+ * The caller degrades to inert rather than throwing: an absent netinfo costs the
36
+ * outage toast and nothing else, and crashing an app root over a missing
37
+ * cosmetic affordance would be a worse trade than the build failure this
38
+ * replaces. The degradation is silent by construction — a connection toast that
39
+ * never appears looks exactly like a connection that never dropped — so
40
+ * {@link warnNetInfoUnavailable} names the missing package once, in dev.
41
+ */
42
+ /** The slice of netinfo's state this component reads. */
43
+ export interface NetInfoStateLike {
44
+ isConnected: boolean | null;
45
+ isInternetReachable: boolean | null | undefined;
46
+ }
47
+ /**
48
+ * The slice of netinfo's module surface this component calls.
49
+ *
50
+ * Hand-written rather than `typeof import('@react-native-community/netinfo')` so
51
+ * no netinfo type reaches Bloom's emitted declarations — a consumer that skips
52
+ * the optional peer must not inherit a TS7016 from Bloom's own `.d.ts`. The two
53
+ * are kept in step by the assignability check in
54
+ * `__tests__/connection-status-netinfo.test.tsx`, which is excluded from the
55
+ * build and so may name the real package.
56
+ */
57
+ export interface NetInfoLike {
58
+ addEventListener: (listener: (state: NetInfoStateLike) => void) => () => void;
59
+ }
60
+ /** The netinfo module, or `null` when the optional peer is not installed. */
61
+ export declare function loadNetInfo(): NetInfoLike | null;
62
+ /**
63
+ * One warning per module lifetime, and none in production — the same mechanism
64
+ * as `toast/use-single-outlet-guard.ts`. Metro and Vite/Rolldown both fold the
65
+ * `NODE_ENV` check statically, so a production bundle keeps neither the branch
66
+ * nor the message.
67
+ */
68
+ export declare function warnNetInfoUnavailable(): void;
69
+ //# sourceMappingURL=netinfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"netinfo.d.ts","sourceRoot":"","sources":["../../../../src/connection-status/netinfo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AASH,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5B,mBAAmB,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;CACjD;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;CAC/E;AAQD,6EAA6E;AAC7E,wBAAgB,WAAW,IAAI,WAAW,GAAG,IAAI,CAiChD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAa7C"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * The optional-peer boundary for `expo-haptics`.
3
+ *
4
+ * The load has to be dynamic — an optional peer that is omitted does not
5
+ * degrade when it is imported statically, it fails to RESOLVE and Metro aborts
6
+ * the whole bundle naming a package the app never mentions. But it also has to
7
+ * be dynamic in the ONE shape Metro understands: a `require()` of a STRING
8
+ * LITERAL inside a `try` block, which Metro collects as an optional dependency
9
+ * (resolving the real module when installed, writing `null` into the dependency
10
+ * map when it is not, so the failure lands in the `catch` below at evaluation
11
+ * time instead of at build time).
12
+ *
13
+ * The shape this replaced — the deleted `utils/lazy-require.ts`, which took the
14
+ * specifier as a function PARAMETER — satisfied neither. Metro can only collect
15
+ * a dependency whose specifier it can evaluate statically; a parameter it
16
+ * cannot, so it collected nothing and rewrote the call into a thrower ("Dynamic
17
+ * require defined at line N; not supported by Metro"). From a consumer's
18
+ * `node_modules` that resolved NOTHING, installed or not: `expo-haptics` was
19
+ * never loaded on any device and every haptic in Bloom was a silent no-op. It
20
+ * only ever worked under jest, which is CommonJS with a real dynamic `require`.
21
+ *
22
+ * `require` may also not exist at all (this file backs the `import` condition
23
+ * too, i.e. an ESM build under Node), hence the `typeof` guard.
24
+ *
25
+ * A missing haptic is invisible — indistinguishable from a device with haptics
26
+ * turned off — so {@link warnHapticsUnavailable} names the package once, in dev.
27
+ *
28
+ * @see connection-status/netinfo.ts — the same boundary for netinfo.
29
+ */
30
+ /**
31
+ * The slice of expo-haptics' module surface this hook calls.
32
+ *
33
+ * Hand-written rather than `typeof import('expo-haptics')` so no expo-haptics
34
+ * type reaches Bloom's emitted declarations — a consumer that skips the optional
35
+ * peer must not inherit a TS7016 from Bloom's own `.d.ts`. The two are kept in
36
+ * step by the assignability check in `__tests__/useHaptics.test.tsx`, which is
37
+ * excluded from the build and so may name the real package.
38
+ *
39
+ * `impactAsync` is declared in METHOD syntax deliberately: `strictFunctionTypes`
40
+ * exempts method parameters from contravariance, which is what keeps the real
41
+ * `(style?: ImpactFeedbackStyle) => Promise<void>` assignable to a `string`
42
+ * parameter here. The widening cannot admit a bad value in practice — the only
43
+ * arguments passed are read straight back out of `ImpactFeedbackStyle`.
44
+ */
45
+ export interface HapticsLike {
46
+ ImpactFeedbackStyle: Record<'Light' | 'Medium' | 'Heavy', string>;
47
+ impactAsync(style?: string): Promise<void>;
48
+ }
49
+ /** The expo-haptics module, or `null` when the optional peer is not installed. */
50
+ export declare function loadHaptics(): HapticsLike | null;
51
+ /**
52
+ * One warning per module lifetime, and none in production — the same mechanism
53
+ * as `connection-status/netinfo.ts` and `toast/use-single-outlet-guard.ts`.
54
+ * Metro and Vite/Rolldown both fold the `NODE_ENV` check statically, so a
55
+ * production bundle keeps neither the branch nor the message.
56
+ */
57
+ export declare function warnHapticsUnavailable(): void;
58
+ //# sourceMappingURL=haptics-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"haptics-module.d.ts","sourceRoot":"","sources":["../../../../src/hooks/haptics-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AASH;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,WAAW;IAC1B,mBAAmB,EAAE,MAAM,CAAC,OAAO,GAAG,QAAQ,GAAG,OAAO,EAAE,MAAM,CAAC,CAAC;IAClE,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAQD,kFAAkF;AAClF,wBAAgB,WAAW,IAAI,WAAW,GAAG,IAAI,CAiChD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAY7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"useHaptics.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useHaptics.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0D,MAAM,OAAO,CAAC;AAW/E,6CAA6C;AAC7C,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAQ1D,MAAM,WAAW,yBAAyB;IACxC,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,OAAc,EAAE,QAAQ,EAAE,EAAE,yBAAyB,2CAG3F;yBAHe,oBAAoB;;;AAOpC;;;;;;;;GAQG;AACH,wBAAgB,UAAU,IAAI,CAAC,QAAQ,CAAC,EAAE,cAAc,KAAK,IAAI,CAqBhE"}
1
+ {"version":3,"file":"useHaptics.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useHaptics.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0D,MAAM,OAAO,CAAC;AAK/E,6CAA6C;AAC7C,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAQ1D,MAAM,WAAW,yBAAyB;IACxC,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,OAAc,EAAE,QAAQ,EAAE,EAAE,yBAAyB,2CAG3F;yBAHe,oBAAoB;;;AAOpC;;;;;;;;GAQG;AACH,wBAAgB,UAAU,IAAI,CAAC,QAAQ,CAAC,EAAE,cAAc,KAAK,IAAI,CAwBhE"}
@@ -8,8 +8,15 @@ interface SpinnerIconProps {
8
8
  }
9
9
  /**
10
10
  * iOS-style SVG spinner with 8 rotating rectangles and an opacity gradient trail.
11
- * Requires react-native-svg (lazy) and react-native-reanimated (static).
12
- * Falls back to ActivityIndicator if react-native-svg is missing.
11
+ *
12
+ * `react-native-svg` and `react-native-reanimated` are both REQUIRED peers and
13
+ * both are imported statically. Reanimated in particular must never be loaded at
14
+ * runtime: the worklets Babel plugin performs build-time closure analysis
15
+ * (`__closure` metadata) that fails on a runtime require, which crashes the UI
16
+ * thread with "Tried to synchronously call a non-worklet function `addListener`".
17
+ *
18
+ * Native only — `SpinnerIcon.web.tsx` draws the same shape with CSS, so this
19
+ * file is never reached by a web bundler.
13
20
  */
14
21
  export declare const SpinnerIcon: React.FC<SpinnerIconProps>;
15
22
  export {};