@oxyhq/bloom 0.79.1 → 0.81.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 (99) hide show
  1. package/lib/commonjs/scroll/index.web.js +52 -18
  2. package/lib/commonjs/scroll/index.web.js.map +1 -1
  3. package/lib/commonjs/scroll/scrollable.web.js +9 -3
  4. package/lib/commonjs/scroll/scrollable.web.js.map +1 -1
  5. package/lib/commonjs/tabs/Tabs.js +409 -71
  6. package/lib/commonjs/tabs/Tabs.js.map +1 -1
  7. package/lib/commonjs/tabs/expo-router/RouterTabs.js +215 -0
  8. package/lib/commonjs/tabs/expo-router/RouterTabs.js.map +1 -0
  9. package/lib/commonjs/tabs/expo-router/index.js +13 -0
  10. package/lib/commonjs/tabs/expo-router/index.js.map +1 -0
  11. package/lib/commonjs/theme/color-engine/index.js +6 -0
  12. package/lib/commonjs/theme/color-engine/index.js.map +1 -1
  13. package/lib/commonjs/theme/color-engine/scheme-variants.js +29 -1
  14. package/lib/commonjs/theme/color-engine/scheme-variants.js.map +1 -1
  15. package/lib/commonjs/theme/color-policy.js +54 -10
  16. package/lib/commonjs/theme/color-policy.js.map +1 -1
  17. package/lib/commonjs/theme/color-presets.js +14 -2
  18. package/lib/commonjs/theme/color-presets.js.map +1 -1
  19. package/lib/commonjs/theme/color-scope/seed-scope.js +5 -1
  20. package/lib/commonjs/theme/color-scope/seed-scope.js.map +1 -1
  21. package/lib/module/scroll/index.web.js +52 -18
  22. package/lib/module/scroll/index.web.js.map +1 -1
  23. package/lib/module/scroll/scrollable.web.js +9 -3
  24. package/lib/module/scroll/scrollable.web.js.map +1 -1
  25. package/lib/module/tabs/Tabs.js +417 -73
  26. package/lib/module/tabs/Tabs.js.map +1 -1
  27. package/lib/module/tabs/expo-router/RouterTabs.js +210 -0
  28. package/lib/module/tabs/expo-router/RouterTabs.js.map +1 -0
  29. package/lib/module/tabs/expo-router/index.js +10 -0
  30. package/lib/module/tabs/expo-router/index.js.map +1 -0
  31. package/lib/module/theme/color-engine/index.js +1 -1
  32. package/lib/module/theme/color-engine/index.js.map +1 -1
  33. package/lib/module/theme/color-engine/scheme-variants.js +28 -1
  34. package/lib/module/theme/color-engine/scheme-variants.js.map +1 -1
  35. package/lib/module/theme/color-policy.js +53 -10
  36. package/lib/module/theme/color-policy.js.map +1 -1
  37. package/lib/module/theme/color-presets.js +14 -2
  38. package/lib/module/theme/color-presets.js.map +1 -1
  39. package/lib/module/theme/color-scope/seed-scope.js +6 -2
  40. package/lib/module/theme/color-scope/seed-scope.js.map +1 -1
  41. package/lib/typescript/commonjs/scroll/index.web.d.ts.map +1 -1
  42. package/lib/typescript/commonjs/scroll/scrollable.web.d.ts +18 -5
  43. package/lib/typescript/commonjs/scroll/scrollable.web.d.ts.map +1 -1
  44. package/lib/typescript/commonjs/tabs/Tabs.d.ts +41 -1
  45. package/lib/typescript/commonjs/tabs/Tabs.d.ts.map +1 -1
  46. package/lib/typescript/commonjs/tabs/expo-router/RouterTabs.d.ts +80 -0
  47. package/lib/typescript/commonjs/tabs/expo-router/RouterTabs.d.ts.map +1 -0
  48. package/lib/typescript/commonjs/tabs/expo-router/index.d.ts +9 -0
  49. package/lib/typescript/commonjs/tabs/expo-router/index.d.ts.map +1 -0
  50. package/lib/typescript/commonjs/tabs/types.d.ts +48 -4
  51. package/lib/typescript/commonjs/tabs/types.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/theme/color-engine/index.d.ts +1 -1
  53. package/lib/typescript/commonjs/theme/color-engine/index.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/theme/color-engine/scheme-variants.d.ts +13 -1
  55. package/lib/typescript/commonjs/theme/color-engine/scheme-variants.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/theme/color-policy.d.ts +6 -0
  57. package/lib/typescript/commonjs/theme/color-policy.d.ts.map +1 -1
  58. package/lib/typescript/commonjs/theme/color-presets.d.ts +1 -1
  59. package/lib/typescript/commonjs/theme/color-presets.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/theme/color-scope/seed-scope.d.ts.map +1 -1
  61. package/lib/typescript/module/scroll/index.web.d.ts.map +1 -1
  62. package/lib/typescript/module/scroll/scrollable.web.d.ts +18 -5
  63. package/lib/typescript/module/scroll/scrollable.web.d.ts.map +1 -1
  64. package/lib/typescript/module/tabs/Tabs.d.ts +41 -1
  65. package/lib/typescript/module/tabs/Tabs.d.ts.map +1 -1
  66. package/lib/typescript/module/tabs/expo-router/RouterTabs.d.ts +80 -0
  67. package/lib/typescript/module/tabs/expo-router/RouterTabs.d.ts.map +1 -0
  68. package/lib/typescript/module/tabs/expo-router/index.d.ts +9 -0
  69. package/lib/typescript/module/tabs/expo-router/index.d.ts.map +1 -0
  70. package/lib/typescript/module/tabs/types.d.ts +48 -4
  71. package/lib/typescript/module/tabs/types.d.ts.map +1 -1
  72. package/lib/typescript/module/theme/color-engine/index.d.ts +1 -1
  73. package/lib/typescript/module/theme/color-engine/index.d.ts.map +1 -1
  74. package/lib/typescript/module/theme/color-engine/scheme-variants.d.ts +13 -1
  75. package/lib/typescript/module/theme/color-engine/scheme-variants.d.ts.map +1 -1
  76. package/lib/typescript/module/theme/color-policy.d.ts +6 -0
  77. package/lib/typescript/module/theme/color-policy.d.ts.map +1 -1
  78. package/lib/typescript/module/theme/color-presets.d.ts +1 -1
  79. package/lib/typescript/module/theme/color-presets.d.ts.map +1 -1
  80. package/lib/typescript/module/theme/color-scope/seed-scope.d.ts.map +1 -1
  81. package/package.json +15 -1
  82. package/src/__tests__/Tabs.test.tsx +470 -7
  83. package/src/__tests__/optional-peer-imports.test.ts +5 -0
  84. package/src/__tests__/scroll-web.test.tsx +255 -2
  85. package/src/__tests__/theme.test.ts +2 -1
  86. package/src/scroll/index.web.tsx +55 -19
  87. package/src/scroll/scrollable.web.ts +30 -8
  88. package/src/tabs/Tabs.tsx +518 -83
  89. package/src/tabs/expo-router/RouterTabs.tsx +268 -0
  90. package/src/tabs/expo-router/index.ts +8 -0
  91. package/src/tabs/types.ts +48 -4
  92. package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +120 -0
  93. package/src/theme/__tests__/__snapshots__/visual-gallery.test.tsx.snap +70 -0
  94. package/src/theme/__tests__/policy-legibility.test.ts +12 -4
  95. package/src/theme/color-engine/index.ts +1 -1
  96. package/src/theme/color-engine/scheme-variants.ts +38 -1
  97. package/src/theme/color-policy.ts +68 -14
  98. package/src/theme/color-presets.ts +11 -2
  99. package/src/theme/color-scope/seed-scope.ts +6 -2
@@ -6,83 +6,337 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.TabsTrigger = exports.TabsContent = exports.Tabs = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
9
10
  var _useTheme = require("../theme/use-theme.js");
10
11
  var _usePressAnimation = require("../hooks/usePressAnimation.js");
11
12
  var _tokens = require("../styles/tokens.js");
12
13
  var _shadows = require("../design-tokens/shadows");
13
14
  var _jsxRuntime = require("react/jsx-runtime");
14
15
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
15
- const TabsContext = /*#__PURE__*/(0, _react.createContext)({
16
- value: '',
17
- onValueChange: () => {},
18
- variant: 'underline',
19
- fullWidth: false,
20
- reportTriggerLayout: () => {}
21
- });
22
- const TabsBarComponent = ({
16
+ /**
17
+ * Re-read ONE trigger's geometry from the platform and report it back.
18
+ *
19
+ * A callback rather than a return value because measuring is asynchronous on
20
+ * both platforms: react-native-web defers to a `setTimeout(0)` inside
21
+ * `UIManager.measure`, and native hops to the UI thread. Each trigger keeps its
22
+ * own host ref and hands the strip this instead, so the registry says exactly
23
+ * what it needs — a position on demand — and nothing about what a trigger
24
+ * renders.
25
+ */
26
+
27
+ /**
28
+ * Underline travel. The same spring the floating `TabBar` highlight uses, so the
29
+ * two strips read as one motion language; stated here rather than imported
30
+ * because they are separate component families and a shared constant would tie
31
+ * their feel together permanently.
32
+ */
33
+ const SLIDE_SPRING = {
34
+ duration: 420,
35
+ dampingRatio: 0.82
36
+ };
37
+
38
+ /** Visibility, not travel — the underline fades, it does not slide, in and out. */
39
+ const HIGHLIGHT_FADE = {
40
+ duration: 160
41
+ };
42
+
43
+ /**
44
+ * Fraction of the distance to the neighbour a drag must cover before releasing
45
+ * commits. Below it the underline springs home and nothing navigates.
46
+ */
47
+ const COMMIT_THRESHOLD = 0.4;
48
+
49
+ /**
50
+ * How far the underline may stray past the first/last tab, and how heavily that
51
+ * travel is damped. A rubber-band is reserved for the edge, where "there is
52
+ * nothing there" is the true message; used anywhere else it would promise a
53
+ * neighbour that is about to arrive, which is the opposite of what happens.
54
+ */
55
+ const EDGE_RUBBER_BAND_DAMPING = 0.25;
56
+ const EDGE_RUBBER_BAND_MAX = 32;
57
+
58
+ /** Above this the count renders as "99+", so a large tally cannot stretch a tab. */
59
+ const MAX_DISPLAYED_COUNT = 99;
60
+ function formatCount(count) {
61
+ return count > MAX_DISPLAYED_COUNT ? `${MAX_DISPLAYED_COUNT}+` : String(count);
62
+ }
63
+ const TabsContext = /*#__PURE__*/(0, _react.createContext)(null);
64
+
65
+ /**
66
+ * The imperative surface a horizontal drag gesture drives the underline through.
67
+ *
68
+ * It lives here rather than in the gesture's own code because every quantity the
69
+ * drag needs — where the neighbouring trigger is, how wide it is, whether there
70
+ * IS a neighbour — is measured layout the strip already holds and nothing
71
+ * outside it can see. The gesture supplies one number, the finger's delta; the
72
+ * strip decides what that means.
73
+ *
74
+ * Obtained via a `ref` on `Tabs`. The gesture belongs in the LAYOUT beside the
75
+ * strip, never inside a tab screen — a gesture mounted in a screen is destroyed
76
+ * by the navigation it commits, mid-release.
77
+ */
78
+
79
+ function useTabsContext(component) {
80
+ const ctx = (0, _react.useContext)(TabsContext);
81
+ if (!ctx) {
82
+ throw new Error(`${component} must be used within a Tabs`);
83
+ }
84
+ return ctx;
85
+ }
86
+ const TabsBarComponent = /*#__PURE__*/(0, _react.forwardRef)(function TabsBar({
23
87
  value,
24
88
  onValueChange,
89
+ hasSelection = true,
25
90
  variant = 'underline',
26
91
  fullWidth = false,
27
92
  children,
28
93
  style,
29
94
  testID
30
- }) => {
95
+ }, dragRef) {
31
96
  const theme = (0, _useTheme.useTheme)();
32
97
  const isUnderline = variant === 'underline';
33
98
 
34
- // Shared sliding underline: one indicator that translates + resizes between
35
- // triggers. Triggers report their measured {x, width}; the container drives
36
- // these Animated values imperatively (no re-render on measure or slide).
37
- const indicatorX = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
38
- const indicatorWidth = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
99
+ // One shared underline that translates + resizes between triggers. Triggers
100
+ // report their measured {x, width}; whoever owns the selection drives these
101
+ // shared values IMPERATIVELY, and `useAnimatedStyle` below only ever READS
102
+ // them. That split is what makes the animation work on web, where returning
103
+ // an animation from inside a mapper silently does nothing.
104
+ const indicatorX = (0, _reactNativeReanimated.useSharedValue)(0);
105
+ const indicatorWidth = (0, _reactNativeReanimated.useSharedValue)(0);
106
+ // Starts hidden: a strip whose active trigger has not been measured yet must
107
+ // not flash an underline at the origin on its first frame.
108
+ const indicatorOpacity = (0, _reactNativeReanimated.useSharedValue)(0);
109
+ // Live drag, added to the settled position/width rather than replacing them,
110
+ // so a release can fold the delta into the base without a visible jump.
111
+ const dragOffset = (0, _reactNativeReanimated.useSharedValue)(0);
112
+ const dragWidthDelta = (0, _reactNativeReanimated.useSharedValue)(0);
39
113
  const triggerLayoutsRef = (0, _react.useRef)({});
114
+ // How to ask each trigger where it is NOW, keyed by value. Registration order
115
+ // carries no meaning — everything that consumes the geometry orders itself by
116
+ // measured `x`, which is the only ordering that survives a reorder.
117
+ const triggerMeasuresRef = (0, _react.useRef)(new Map());
118
+ const remeasureScheduledRef = (0, _react.useRef)(false);
40
119
  const indicatorPlacedRef = (0, _react.useRef)(false);
120
+ const scrollRef = (0, _react.useRef)(null);
121
+ const viewportWidthRef = (0, _react.useRef)(0);
122
+ // The value the underline currently belongs to, from EITHER path. A ref
123
+ // because the layout callback below must see the latest selection without
124
+ // being re-created — and therefore re-firing — on every selection change.
125
+ const selectedValueRef = (0, _react.useRef)(value);
41
126
  const moveIndicator = (0, _react.useCallback)((target, animate) => {
42
127
  if (animate) {
43
- _reactNative.Animated.parallel([_reactNative.Animated.timing(indicatorX, {
44
- toValue: target.x,
45
- duration: 200,
46
- easing: _reactNative.Easing.out(_reactNative.Easing.cubic),
47
- useNativeDriver: false
48
- }), _reactNative.Animated.timing(indicatorWidth, {
49
- toValue: target.width,
50
- duration: 200,
51
- easing: _reactNative.Easing.out(_reactNative.Easing.cubic),
52
- useNativeDriver: false
53
- })]).start();
128
+ indicatorX.value = (0, _reactNativeReanimated.withSpring)(target.x, SLIDE_SPRING);
129
+ indicatorWidth.value = (0, _reactNativeReanimated.withSpring)(target.width, SLIDE_SPRING);
54
130
  } else {
55
- indicatorX.setValue(target.x);
56
- indicatorWidth.setValue(target.width);
131
+ indicatorX.value = target.x;
132
+ indicatorWidth.value = target.width;
133
+ }
134
+ // Reveal only while something IS selected. Geometry keeps arriving while
135
+ // a non-tab sibling route is showing — the measurement pass below is
136
+ // precisely what makes it arrive — and fading the underline back in there
137
+ // would re-assert a tab the reader has left. Read from the closure rather
138
+ // than a ref: a ref written in an effect is still stale at this point,
139
+ // because a child's effect runs before its parent's.
140
+ if (!hasSelection) return;
141
+ indicatorOpacity.value = (0, _reactNativeReanimated.withTiming)(1, HIGHLIGHT_FADE);
142
+ }, [indicatorX, indicatorWidth, indicatorOpacity, hasSelection]);
143
+
144
+ // Keep the active tab in view when the strip overflows its viewport. Centring
145
+ // is what makes a ROUTED strip usable: arriving at a tab that is scrolled out
146
+ // of sight — via a deep link, a Back, or simply a long tab set — must not
147
+ // look like an empty selection.
148
+ const revealTrigger = (0, _react.useCallback)((target, animate) => {
149
+ const viewport = viewportWidthRef.current;
150
+ if (fullWidth || viewport <= 0) return;
151
+ const centred = target.x + target.width / 2 - viewport / 2;
152
+ scrollRef.current?.scrollTo({
153
+ x: Math.max(0, centred),
154
+ animated: animate
155
+ });
156
+ }, [fullWidth]);
157
+ const applySelection = (0, _react.useCallback)(tabValue => {
158
+ const target = triggerLayoutsRef.current[tabValue];
159
+ // Not measured yet — `reportTriggerLayout` places it on arrival.
160
+ if (!target) return;
161
+ const animate = indicatorPlacedRef.current;
162
+ moveIndicator(target, animate);
163
+ revealTrigger(target, animate);
164
+ indicatorPlacedRef.current = true;
165
+ }, [moveIndicator, revealTrigger]);
166
+
167
+ /**
168
+ * Record where a trigger is, from whichever source measured it, and keep the
169
+ * underline glued to it.
170
+ *
171
+ * Placement here never animates: the tab did not become SELECTED, it MOVED,
172
+ * and it moved instantly because nothing animates a strip's reflow. Sliding
173
+ * the underline across would read as a selection change that never happened.
174
+ */
175
+ const applyTriggerLayout = (0, _react.useCallback)((tabValue, layout) => {
176
+ const previous = triggerLayoutsRef.current[tabValue];
177
+ // Unchanged geometry must be a no-op, not a re-place: a measurement pass
178
+ // runs after every render, and re-placing would cancel a selection slide
179
+ // mid-flight for no reason.
180
+ if (previous !== undefined && previous.x === layout.x && previous.width === layout.width) {
181
+ return;
57
182
  }
58
- }, [indicatorX, indicatorWidth]);
59
- const reportTriggerLayout = (0, _react.useCallback)((tabValue, layout) => {
60
183
  triggerLayoutsRef.current[tabValue] = layout;
61
- // Snap onto the active trigger the moment it's first measured (mount) or
62
- // when its size changes — never slide in from the origin.
63
- if (tabValue === value) {
64
- moveIndicator(layout, false);
65
- indicatorPlacedRef.current = true;
184
+ if (tabValue !== selectedValueRef.current) return;
185
+ moveIndicator(layout, false);
186
+ revealTrigger(layout, false);
187
+ indicatorPlacedRef.current = true;
188
+ }, [moveIndicator, revealTrigger]);
189
+
190
+ /**
191
+ * Re-read EVERY trigger's position from the platform.
192
+ *
193
+ * This exists because `onLayout` cannot be trusted to report a MOVE. On
194
+ * react-native-web it is backed by a single `ResizeObserver`
195
+ * (`modules/useElementLayout`), which fires for a SIZE change and never for a
196
+ * position-only one — so a trigger inserted, removed or reordered after first
197
+ * layout shifts every trigger after it while not one of them re-reports, and
198
+ * the underline stays where the stale numbers put it: silently, one tab off,
199
+ * only on the first paint after an async tab list lands. A tab whose own
200
+ * width changes has the same effect on its neighbours.
201
+ *
202
+ * So `onLayout` is demoted to a change SIGNAL and the geometry is read back
203
+ * explicitly, through the `measure` both platforms put on a host view ref. It
204
+ * answers in the view's PARENT coordinate space, which is the space the
205
+ * underline is positioned in and the same one `onLayout` reports — the two
206
+ * sources cannot disagree about what they mean.
207
+ */
208
+ const remeasureTriggers = (0, _react.useCallback)(() => {
209
+ for (const [tabValue, measure] of triggerMeasuresRef.current) {
210
+ measure(layout => {
211
+ // A strip that is mounted but not laid out — a `display: none` ancestor
212
+ // on web, an unmeasured subtree on native — measures as zero, and a
213
+ // trigger cannot genuinely be zero-wide (it always carries horizontal
214
+ // padding). Recording that would collapse the underline and throw away
215
+ // the real geometry, so the last known position stands until it is on
216
+ // screen again.
217
+ if (layout.width <= 0) return;
218
+ applyTriggerLayout(tabValue, layout);
219
+ });
66
220
  }
67
- }, [value, moveIndicator]);
221
+ }, [applyTriggerLayout]);
222
+ const scheduleRemeasure = (0, _react.useCallback)(() => {
223
+ // One pass per turn, however many signals arrive: a mount registers N
224
+ // triggers and reports N layouts, which is N+1 reasons to measure the same
225
+ // frame. A microtask, so the pass is queued before the browser paints the
226
+ // frame the change landed in.
227
+ if (remeasureScheduledRef.current) return;
228
+ remeasureScheduledRef.current = true;
229
+ queueMicrotask(() => {
230
+ remeasureScheduledRef.current = false;
231
+ remeasureTriggers();
232
+ });
233
+ }, [remeasureTriggers]);
234
+ const registerTrigger = (0, _react.useCallback)((tabValue, measure) => {
235
+ triggerMeasuresRef.current.set(tabValue, measure);
236
+ return () => {
237
+ triggerMeasuresRef.current.delete(tabValue);
238
+ // A tab that is gone must not keep a position in the geometry the drag
239
+ // controller orders itself by, or a swipe can commit to a trigger that is
240
+ // no longer on screen.
241
+ delete triggerLayoutsRef.current[tabValue];
242
+ };
243
+ }, []);
244
+ const reportTriggerLayout = (0, _react.useCallback)((tabValue, layout) => {
245
+ // Snap onto the active trigger the moment it is first measured (mount), or
246
+ // when its size changes — never slide in from the origin.
247
+ applyTriggerLayout(tabValue, layout);
248
+ // One trigger changing size moves every trigger after it, and not one of
249
+ // them will say so.
250
+ scheduleRemeasure();
251
+ }, [applyTriggerLayout, scheduleRemeasure]);
252
+ const reportFocused = (0, _react.useCallback)(tabValue => {
253
+ selectedValueRef.current = tabValue;
254
+ applySelection(tabValue);
255
+ }, [applySelection]);
68
256
 
69
- // Slide the indicator to the newly-selected trigger. Syncing an imperative
70
- // Animated value to the controlled `value` prop is a legitimate effect
71
- // (external-system sync); the first placement snaps, later changes animate.
257
+ // CONTROLLED path only: the bar owns the underline when `value` is provided.
258
+ // Syncing an imperative animation to a controlled prop is a legitimate effect
259
+ // (external-system sync). On the focus-driven path each trigger reports
260
+ // instead, so this stays out of the way and there is only ever one writer.
72
261
  (0, _react.useEffect)(() => {
73
- if (!isUnderline) return;
74
- const target = triggerLayoutsRef.current[value];
75
- if (!target) return; // not measured yet — reportTriggerLayout will place it
76
- moveIndicator(target, indicatorPlacedRef.current);
77
- indicatorPlacedRef.current = true;
78
- }, [value, isUnderline, moveIndicator]);
262
+ if (value === undefined) return;
263
+ selectedValueRef.current = value;
264
+ applySelection(value);
265
+ }, [value, applySelection]);
266
+
267
+ // Nothing is focused — fade out where it stands. Position is deliberately
268
+ // untouched: see `TabsProps.hasSelection`. Placing this AFTER the controlled
269
+ // effect is what lets a later re-selection snap back rather than travel,
270
+ // because `indicatorPlacedRef` is left alone here.
271
+ (0, _react.useEffect)(() => {
272
+ if (hasSelection) return;
273
+ indicatorOpacity.value = (0, _reactNativeReanimated.withTiming)(0, HIGHLIGHT_FADE);
274
+ }, [hasSelection, indicatorOpacity]);
275
+
276
+ // Every render of the strip is a render in which its contents may have MOVED:
277
+ // a trigger inserted, removed or reordered, or one re-rendered at a new size.
278
+ // Unconditional on purpose, rather than keyed on a signature of `children` —
279
+ // any such signature has to be built from React keys or child props, both of
280
+ // which the caller controls and neither of which is obliged to change on a
281
+ // reorder. A pass writes nothing when nothing moved, so being wrong in this
282
+ // direction costs a handful of reads and being wrong in the other direction
283
+ // is the bug.
284
+ (0, _react.useEffect)(scheduleRemeasure);
285
+ (0, _react.useImperativeHandle)(dragRef, () => ({
286
+ drag(translationX) {
287
+ const current = selectedValueRef.current;
288
+ if (current === undefined) return null;
289
+ // Ordered by measured position, so "the neighbour" means the tab next
290
+ // to it ON SCREEN. Deriving it from child order instead would be wrong
291
+ // the moment a caller reorders or conditionally renders a trigger.
292
+ const ordered = Object.entries(triggerLayoutsRef.current).sort((a, b) => a[1].x - b[1].x);
293
+ const index = ordered.findIndex(([tabValue]) => tabValue === current);
294
+ const from = ordered[index]?.[1];
295
+ if (from === undefined) return null;
296
+
297
+ // Opposite the finger: dragging LEFT reveals the NEXT tab, which is to
298
+ // the right, so that is where the underline goes.
299
+ const travel = -translationX;
300
+ const neighbour = ordered[index + (travel > 0 ? 1 : -1)];
301
+ if (neighbour === undefined) {
302
+ // First or last tab. Resist, never commit — the rubber-band is the
303
+ // honest signal that there is nothing in that direction.
304
+ const damped = Math.min(Math.abs(travel) * EDGE_RUBBER_BAND_DAMPING, EDGE_RUBBER_BAND_MAX);
305
+ dragOffset.value = Math.sign(travel) * damped;
306
+ dragWidthDelta.value = 0;
307
+ return null;
308
+ }
309
+ const [neighbourValue, to] = neighbour;
310
+ const distance = to.x - from.x;
311
+ // Clamped at the neighbour: the underline stops exactly where releasing
312
+ // would leave it, so it never promises travel the commit cannot deliver.
313
+ const progress = Math.min(Math.abs(travel) / Math.abs(distance), 1);
314
+ dragOffset.value = distance * progress;
315
+ dragWidthDelta.value = (to.width - from.width) * progress;
316
+ return progress >= COMMIT_THRESHOLD ? neighbourValue : null;
317
+ },
318
+ release(committed) {
319
+ if (committed === null) {
320
+ dragOffset.value = (0, _reactNativeReanimated.withSpring)(0, SLIDE_SPRING);
321
+ dragWidthDelta.value = (0, _reactNativeReanimated.withSpring)(0, SLIDE_SPRING);
322
+ return;
323
+ }
324
+ // Fold, do not zero — see `TabsDragController.release`.
325
+ indicatorX.value += dragOffset.value;
326
+ indicatorWidth.value += dragWidthDelta.value;
327
+ dragOffset.value = 0;
328
+ dragWidthDelta.value = 0;
329
+ }
330
+ }), [dragOffset, dragWidthDelta, indicatorX, indicatorWidth]);
79
331
  const contextValue = (0, _react.useMemo)(() => ({
80
- value,
332
+ selectedValue: value,
81
333
  onValueChange,
82
334
  variant,
83
335
  fullWidth,
84
- reportTriggerLayout
85
- }), [value, onValueChange, variant, fullWidth, reportTriggerLayout]);
336
+ registerTrigger,
337
+ reportTriggerLayout,
338
+ reportFocused
339
+ }), [value, onValueChange, variant, fullWidth, registerTrigger, reportTriggerLayout, reportFocused]);
86
340
  const containerStyle = (0, _react.useMemo)(() => {
87
341
  const base = {
88
342
  flexDirection: 'row',
@@ -107,20 +361,42 @@ const TabsBarComponent = ({
107
361
  }
108
362
  return base;
109
363
  }, [variant, theme]);
110
- const indicator = isUnderline ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
364
+
365
+ // Deps: every shared value the mapper READS is listed. On web WITHOUT the
366
+ // react-native-worklets babel plugin — the production reality for Bloom's
367
+ // Vite consumers — reanimated cannot auto-detect a worklet's reads and drives
368
+ // the mapper off this array instead: omit one and the mapper runs ONCE and
369
+ // freezes at the first frame while the shared value keeps animating
370
+ // underneath, with no error anywhere. Native (plugin present) auto-tracks and
371
+ // ignores the extras, so listing them is correct on both platforms. Same rule
372
+ // as `TabBarBase` and `BottomSheetBase`. Do NOT strip these.
373
+ const indicatorStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
374
+ // The drag deltas ADD to the settled values rather than replacing them,
375
+ // which is what lets a release fold them into the base with no jump.
376
+ width: Math.max(indicatorWidth.value + dragWidthDelta.value, 0),
377
+ opacity: indicatorOpacity.value,
378
+ transform: [{
379
+ translateX: indicatorX.value + dragOffset.value
380
+ }]
381
+ }), [indicatorWidth, dragWidthDelta, indicatorOpacity, indicatorX, dragOffset]);
382
+
383
+ // The underline is a sibling of the triggers INSIDE the scrollable content,
384
+ // so the two share one coordinate space: a trigger's `onLayout` x is already
385
+ // relative to the container the underline is absolutely positioned in. That
386
+ // is why nothing here subtracts a scroll offset — an underline parked outside
387
+ // the scroller would have to, and would lag by a frame on every scroll event.
388
+ const indicator = isUnderline ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
111
389
  pointerEvents: "none",
112
390
  testID: testID ? `${testID}-indicator` : undefined,
113
- style: {
391
+ style: [{
114
392
  position: 'absolute',
115
393
  left: 0,
116
394
  bottom: 0,
117
395
  height: 2,
118
- backgroundColor: theme.colors.primary,
119
- width: indicatorWidth,
120
- transform: [{
121
- translateX: indicatorX
122
- }]
123
- }
396
+ borderTopLeftRadius: 2,
397
+ borderTopRightRadius: 2,
398
+ backgroundColor: theme.colors.primary
399
+ }, indicatorStyle]
124
400
  }) : null;
125
401
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(TabsContext.Provider, {
126
402
  value: contextValue,
@@ -129,41 +405,85 @@ const TabsBarComponent = ({
129
405
  testID: testID,
130
406
  children: [children, indicator]
131
407
  }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
408
+ ref: scrollRef,
132
409
  horizontal: true,
133
410
  showsHorizontalScrollIndicator: false,
134
411
  contentContainerStyle: [containerStyle, style],
412
+ onLayout: e => {
413
+ viewportWidthRef.current = e.nativeEvent.layout.width;
414
+ },
135
415
  testID: testID,
136
416
  children: [children, indicator]
137
417
  })
138
418
  });
139
- };
419
+ });
140
420
  const TabComponent = ({
141
421
  value,
142
422
  label,
143
423
  icon,
424
+ count,
425
+ isFocused,
144
426
  disabled = false,
427
+ onPress: onPressProp,
145
428
  style,
146
429
  textStyle
147
430
  }) => {
148
431
  const theme = (0, _useTheme.useTheme)();
149
432
  const {
150
- value: selectedValue,
433
+ selectedValue,
151
434
  onValueChange,
152
435
  variant,
153
436
  fullWidth,
154
- reportTriggerLayout
155
- } = (0, _react.useContext)(TabsContext);
156
- const isSelected = value === selectedValue;
437
+ registerTrigger,
438
+ reportTriggerLayout,
439
+ reportFocused
440
+ } = useTabsContext('TabsTrigger');
441
+ // The two paths meet here: an explicit `isFocused` (router adapter) wins;
442
+ // otherwise selection comes from the bar's controlled `value`.
443
+ const isSelected = isFocused ?? value === selectedValue;
157
444
  const {
158
445
  scaleAnim,
159
446
  onPressIn,
160
447
  onPressOut
161
448
  } = (0, _usePressAnimation.usePressAnimation)(0.97);
449
+ const resolvedCount = count ?? 0;
450
+ const showCount = resolvedCount > 0;
451
+
452
+ // The trigger's own host view. It stays here rather than in the strip because
453
+ // the strip has no way to reach a child it did not create — it receives them
454
+ // as `children` — and because a trigger is the only thing that knows its own
455
+ // value, which is what the geometry has to be keyed by.
456
+ const nodeRef = (0, _react.useRef)(null);
457
+ const measureSelf = (0, _react.useCallback)(report => {
458
+ nodeRef.current?.measure((x, _y, width) => {
459
+ report({
460
+ x,
461
+ width
462
+ });
463
+ });
464
+ }, []);
465
+
466
+ // Registration IS the insertion/removal signal the strip acts on, so it must
467
+ // outlive nothing: the cleanup drops both the measure hook and the geometry.
468
+ (0, _react.useEffect)(() => registerTrigger(value, measureSelf), [registerTrigger, value, measureSelf]);
469
+
470
+ // FOCUS-DRIVEN path only. This covers programmatic navigation too — a deep
471
+ // link, a browser Back, a back gesture — because nothing here asks HOW the
472
+ // change happened: the trigger simply re-renders focused and the underline
473
+ // follows. On the controlled path the bar drives the underline instead, so
474
+ // this stays out of the way to avoid two writers on one shared value.
475
+ (0, _react.useEffect)(() => {
476
+ if (isFocused !== true) return;
477
+ reportFocused(value);
478
+ }, [isFocused, value, reportFocused]);
162
479
  const handlePress = (0, _react.useCallback)(() => {
163
- if (!disabled) {
164
- onValueChange(value);
165
- }
166
- }, [value, disabled, onValueChange]);
480
+ if (disabled) return;
481
+ onPressProp?.();
482
+ // On the focus-driven path navigation is the caller's job (the router
483
+ // adapter's trigger performs it), so reporting a selection here as well
484
+ // would fight the router for the same underline.
485
+ if (isFocused === undefined) onValueChange?.(value);
486
+ }, [value, disabled, onValueChange, onPressProp, isFocused]);
167
487
  const tabStyle = (0, _react.useMemo)(() => {
168
488
  const base = {
169
489
  flexDirection: 'row',
@@ -210,6 +530,7 @@ const TabComponent = ({
210
530
  return base;
211
531
  }, [variant, isSelected, theme]);
212
532
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
533
+ ref: nodeRef,
213
534
  onLayout: e => {
214
535
  const {
215
536
  x,
@@ -238,14 +559,31 @@ const TabComponent = ({
238
559
  onPressOut: onPressOut,
239
560
  disabled: disabled,
240
561
  accessibilityRole: "tab",
241
- accessibilityState: {
242
- selected: isSelected,
243
- disabled
244
- },
562
+ accessibilityLabel: showCount ? `${label}, ${resolvedCount}` : label
563
+ // `aria-selected`, and NOT a web-only spelling of `accessibilityState`.
564
+ // react-native-web's `createDOMProps` reads `aria-selected` (or the
565
+ // deprecated `accessibilitySelected`) and does not look at
566
+ // `accessibilityState` at all, so a strip that set only the latter
567
+ // announced no selection on web at all — every tab equally current.
568
+ // React Native's own `Pressable` folds `aria-selected` back into
569
+ // `accessibilityState.selected`, so this one prop serves both platforms
570
+ // and there is no second place for the answer to disagree. `disabled`
571
+ // needs no counterpart: both Pressables already derive that state from
572
+ // the `disabled` prop above.
573
+ ,
574
+ "aria-selected": isSelected,
245
575
  children: [icon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
246
576
  style: [labelStyle, textStyle],
247
577
  children: label
248
- })]
578
+ }), showCount ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
579
+ style: {
580
+ fontSize: 11,
581
+ fontWeight: '600',
582
+ color: theme.colors.textTertiary
583
+ },
584
+ numberOfLines: 1,
585
+ children: formatCount(resolvedCount)
586
+ }) : null]
249
587
  })
250
588
  });
251
589
  };
@@ -255,8 +593,8 @@ const TabPanelComponent = ({
255
593
  style
256
594
  }) => {
257
595
  const {
258
- value: selectedValue
259
- } = (0, _react.useContext)(TabsContext);
596
+ selectedValue
597
+ } = useTabsContext('TabsContent');
260
598
  if (value !== selectedValue) return null;
261
599
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
262
600
  style: style,
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useTheme","_usePressAnimation","_tokens","_shadows","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TabsContext","createContext","value","onValueChange","variant","fullWidth","reportTriggerLayout","TabsBarComponent","children","style","testID","theme","useTheme","isUnderline","indicatorX","useRef","Animated","Value","current","indicatorWidth","triggerLayoutsRef","indicatorPlacedRef","moveIndicator","useCallback","target","animate","parallel","timing","toValue","x","duration","easing","Easing","out","cubic","useNativeDriver","width","start","setValue","tabValue","layout","useEffect","contextValue","useMemo","containerStyle","base","flexDirection","alignItems","borderBottomWidth","borderBottomColor","colors","borderLight","backgroundColor","backgroundSecondary","borderRadius","sm","padding","borderWidth","borderColor","border","indicator","jsx","View","pointerEvents","undefined","position","left","bottom","height","primary","transform","translateX","Provider","jsxs","ScrollView","horizontal","showsHorizontalScrollIndicator","contentContainerStyle","TabComponent","label","icon","disabled","textStyle","selectedValue","useContext","isSelected","scaleAnim","onPressIn","onPressOut","usePressAnimation","handlePress","tabStyle","justifyContent","paddingHorizontal","space","lg","paddingVertical","gap","xs","card","assign","bloomShadowStyle","labelStyle","fontSize","fontWeight","color","primaryForeground","textSecondary","onLayout","nativeEvent","scale","flex","Pressable","opacity","onPress","accessibilityRole","accessibilityState","selected","Text","TabPanelComponent","Tabs","exports","memo","displayName","TabsTrigger","TabsContent"],"sourceRoot":"../../../src","sources":["tabs/Tabs.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AASA,IAAAC,YAAA,GAAAD,OAAA;AAYA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAA4D,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAD,wBAAAQ,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAV,uBAAA,YAAAA,CAAAQ,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CA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MAAME,WAAW,GAAAJ,OAAA,CAAAI,WAAA,gBAAG,IAAAH,WAAI,EAACH,iBAAiB,CAAC;AAClDM,WAAW,CAACF,WAAW,GAAG,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_useTheme","_usePressAnimation","_tokens","_shadows","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SLIDE_SPRING","duration","dampingRatio","HIGHLIGHT_FADE","COMMIT_THRESHOLD","EDGE_RUBBER_BAND_DAMPING","EDGE_RUBBER_BAND_MAX","MAX_DISPLAYED_COUNT","formatCount","count","String","TabsContext","createContext","useTabsContext","component","ctx","useContext","Error","TabsBarComponent","forwardRef","TabsBar","value","onValueChange","hasSelection","variant","fullWidth","children","style","testID","dragRef","theme","useTheme","isUnderline","indicatorX","useSharedValue","indicatorWidth","indicatorOpacity","dragOffset","dragWidthDelta","triggerLayoutsRef","useRef","triggerMeasuresRef","Map","remeasureScheduledRef","indicatorPlacedRef","scrollRef","viewportWidthRef","selectedValueRef","moveIndicator","useCallback","target","animate","withSpring","x","width","withTiming","revealTrigger","viewport","current","centred","scrollTo","Math","max","animated","applySelection","tabValue","applyTriggerLayout","layout","previous","undefined","remeasureTriggers","measure","scheduleRemeasure","queueMicrotask","registerTrigger","delete","reportTriggerLayout","reportFocused","useEffect","useImperativeHandle","drag","translationX","ordered","entries","sort","a","b","index","findIndex","from","travel","neighbour","damped","min","abs","sign","neighbourValue","to","distance","progress","release","committed","contextValue","useMemo","selectedValue","containerStyle","base","flexDirection","alignItems","borderBottomWidth","borderBottomColor","colors","borderLight","backgroundColor","backgroundSecondary","borderRadius","sm","padding","borderWidth","borderColor","border","indicatorStyle","useAnimatedStyle","opacity","transform","translateX","indicator","jsx","View","pointerEvents","position","left","bottom","height","borderTopLeftRadius","borderTopRightRadius","primary","Provider","jsxs","ScrollView","ref","horizontal","showsHorizontalScrollIndicator","contentContainerStyle","onLayout","nativeEvent","TabComponent","label","icon","isFocused","disabled","onPress","onPressProp","textStyle","isSelected","scaleAnim","onPressIn","onPressOut","usePressAnimation","resolvedCount","showCount","nodeRef","measureSelf","report","_y","handlePress","tabStyle","justifyContent","paddingHorizontal","space","lg","paddingVertical","gap","xs","card","assign","bloomShadowStyle","labelStyle","fontSize","fontWeight","color","primaryForeground","textSecondary","Animated","scale","flex","Pressable","accessibilityRole","accessibilityLabel","Text","textTertiary","numberOfLines","TabPanelComponent","Tabs","exports","memo","displayName","TabsTrigger","TabsContent"],"sourceRoot":"../../../src","sources":["tabs/Tabs.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAWA,IAAAC,YAAA,GAAAD,OAAA;AAeA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAQA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAA4D,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAD,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAS,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO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