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