@ledgerhq/lumen-ui-rnative 0.1.73 → 0.1.74

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 (26) hide show
  1. package/dist/module/lib/Components/core/DotSymbol/DotSymbol.js +1 -1
  2. package/dist/module/lib/Components/core/Spot/Spot.js +1 -1
  3. package/dist/module/lib/Components/core/TabBar/TabBar.js +293 -132
  4. package/dist/module/lib/Components/core/TabBar/TabBar.js.map +1 -1
  5. package/dist/module/lib/Components/core/TabBar/TabBarContext.js.map +1 -1
  6. package/dist/module/lib/Components/internal/BaseTag/BaseTag.js.map +1 -1
  7. package/dist/typescript/src/lib/Components/core/TabBar/TabBar.d.ts +3 -2
  8. package/dist/typescript/src/lib/Components/core/TabBar/TabBar.d.ts.map +1 -1
  9. package/dist/typescript/src/lib/Components/core/TabBar/TabBarContext.d.ts +3 -0
  10. package/dist/typescript/src/lib/Components/core/TabBar/TabBarContext.d.ts.map +1 -1
  11. package/dist/typescript/src/lib/Components/core/TabBar/types.d.ts +8 -0
  12. package/dist/typescript/src/lib/Components/core/TabBar/types.d.ts.map +1 -1
  13. package/dist/typescript/src/lib/Components/core/Tag/types.d.ts +3 -22
  14. package/dist/typescript/src/lib/Components/core/Tag/types.d.ts.map +1 -1
  15. package/dist/typescript/src/lib/Components/internal/BaseTag/BaseTag.d.ts.map +1 -1
  16. package/dist/typescript/src/lib/Components/internal/BaseTag/types.d.ts +23 -2
  17. package/dist/typescript/src/lib/Components/internal/BaseTag/types.d.ts.map +1 -1
  18. package/package.json +1 -1
  19. package/src/lib/Components/core/DotSymbol/DotSymbol.tsx +1 -1
  20. package/src/lib/Components/core/Spot/Spot.tsx +1 -1
  21. package/src/lib/Components/core/TabBar/TabBar.tsx +213 -107
  22. package/src/lib/Components/core/TabBar/TabBarContext.tsx +3 -0
  23. package/src/lib/Components/core/TabBar/types.ts +9 -0
  24. package/src/lib/Components/core/Tag/types.ts +3 -30
  25. package/src/lib/Components/internal/BaseTag/BaseTag.tsx +2 -3
  26. package/src/lib/Components/internal/BaseTag/types.ts +32 -2
@@ -13,7 +13,7 @@ const dotSquareRadiusMap = {
13
13
  16: 5,
14
14
  20: 6,
15
15
  24: 8,
16
- 32: 10
16
+ 32: 12
17
17
  };
18
18
  const offsetBySize = {
19
19
  8: -2,
@@ -6,7 +6,7 @@ import { Box } from "../../primitives/index.js";
6
6
  import { useSpotStyles } from "./useSpotStyles.js";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  const iconSizeMap = {
9
- 32: 12,
9
+ 32: 16,
10
10
  40: 16,
11
11
  48: 20,
12
12
  56: 24,
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
 
3
3
  import { BlurView } from '@sbaiahmed1/react-native-blur';
4
- import { Children, isValidElement, useEffect, useMemo, useRef } from 'react';
5
- import { StyleSheet, Text, View } from 'react-native';
6
- import Animated, { cancelAnimation, useAnimatedStyle, useSharedValue, withDelay, withSequence, withTiming } from 'react-native-reanimated';
4
+ import { Children, isValidElement, useEffect } from 'react';
5
+ import { StyleSheet, Text, useWindowDimensions, View } from 'react-native';
6
+ import Animated, { cancelAnimation, interpolate, useAnimatedStyle, useSharedValue, withDelay, withSequence, withTiming } from 'react-native-reanimated';
7
7
  import { useStyleSheet, useTheme } from "../../../../styles/index.js";
8
8
  import { triggerHapticFeedback } from "../../../Haptics/index.js";
9
9
  import { RuntimeConstants } from "../../../utils/index.js";
@@ -12,25 +12,54 @@ import { Box, Pressable } from "../../primitives/index.js";
12
12
  import { Placeholder } from "../../symbols/index.js";
13
13
  import { TabBarContextProvider, useTabBarContext } from "./TabBarContext.js";
14
14
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
- export const TAB_BAR_HEIGHT = 60;
15
+ export const TAB_BAR_EXPANDED_HEIGHT = 60;
16
+ export const TAB_BAR_COMPACT_HEIGHT = 44;
16
17
  const PILL_INSET = 4;
18
+ const ICON_SIZE = 20;
19
+ const ICON_LABEL_GAP = 4;
20
+ const useLabelLineHeight = () => {
21
+ const {
22
+ theme
23
+ } = useTheme();
24
+ const {
25
+ fontScale
26
+ } = useWindowDimensions();
27
+ const base = theme.typographies.body4.lineHeight ?? 0;
28
+ return {
29
+ base,
30
+ scaled: base * fontScale
31
+ };
32
+ };
17
33
  const _worklet_12151274743312_init_data = {
18
34
  code: "function TabBarTsx1(){const{pressProgress}=this.__closure;return{transform:[{scale:pressProgress.value}]};}",
19
35
  location: "/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx",
20
- sourceMap: "{\"version\":3,\"names\":[\"TabBarTsx1\",\"pressProgress\",\"__closure\",\"transform\",\"scale\",\"value\"],\"sources\":[\"/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx\"],\"mappings\":\"AAkEI,SAAAA,WAAA,QAAAC,aAAA,OAAAC,SAAA,OAAO,CACLC,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAEH,aAAa,CAACI,KAAM,CAAC,CAC5C,CAAC\",\"ignoreList\":[]}"
36
+ sourceMap: "{\"version\":3,\"names\":[\"TabBarTsx1\",\"pressProgress\",\"__closure\",\"transform\",\"scale\",\"value\"],\"sources\":[\"/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx\"],\"mappings\":\"AAuFI,SAAAA,WAAA,QAAAC,aAAA,OAAAC,SAAA,OAAO,CACLC,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAEH,aAAa,CAACI,KAAM,CAAC,CAC5C,CAAC\",\"ignoreList\":[]}"
21
37
  };
22
38
  const _worklet_7396791557540_init_data = {
23
39
  code: "function TabBarTsx2(){const{activeProgress}=this.__closure;return{opacity:activeProgress.value};}",
24
40
  location: "/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx",
25
- sourceMap: "{\"version\":3,\"names\":[\"TabBarTsx2\",\"activeProgress\",\"__closure\",\"opacity\",\"value\"],\"sources\":[\"/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx\"],\"mappings\":\"AAyEI,SAAAA,WAAA,QAAAC,cAAA,OAAAC,SAAA,OAAO,CACLC,OAAO,CAAEF,cAAc,CAACG,KAC1B,CAAC\",\"ignoreList\":[]}"
41
+ sourceMap: "{\"version\":3,\"names\":[\"TabBarTsx2\",\"activeProgress\",\"__closure\",\"opacity\",\"value\"],\"sources\":[\"/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx\"],\"mappings\":\"AA8FI,SAAAA,WAAA,QAAAC,cAAA,OAAAC,SAAA,OAAO,CACLC,OAAO,CAAEF,cAAc,CAACG,KAC1B,CAAC\",\"ignoreList\":[]}"
26
42
  };
27
43
  const _worklet_11977595001241_init_data = {
28
44
  code: "function TabBarTsx3(){const{activeProgress}=this.__closure;return{opacity:1-activeProgress.value};}",
29
45
  location: "/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx",
30
- sourceMap: "{\"version\":3,\"names\":[\"TabBarTsx3\",\"activeProgress\",\"__closure\",\"opacity\",\"value\"],\"sources\":[\"/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx\"],\"mappings\":\"AAgFI,SAAAA,WAAA,QAAAC,cAAA,OAAAC,SAAA,OAAO,CACLC,OAAO,CAAE,CAAC,CAAGF,cAAc,CAACG,KAC9B,CAAC\",\"ignoreList\":[]}"
46
+ sourceMap: "{\"version\":3,\"names\":[\"TabBarTsx3\",\"activeProgress\",\"__closure\",\"opacity\",\"value\"],\"sources\":[\"/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx\"],\"mappings\":\"AAqGI,SAAAA,WAAA,QAAAC,cAAA,OAAAC,SAAA,OAAO,CACLC,OAAO,CAAE,CAAC,CAAGF,cAAc,CAACG,KAC9B,CAAC\",\"ignoreList\":[]}"
47
+ };
48
+ const _worklet_13573149629465_init_data = {
49
+ code: "function TabBarTsx4(){const{iconShift,densityProgress}=this.__closure;return{transform:[{translateY:-iconShift*densityProgress.value}]};}",
50
+ location: "/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx",
51
+ sourceMap: "{\"version\":3,\"names\":[\"TabBarTsx4\",\"iconShift\",\"densityProgress\",\"__closure\",\"transform\",\"translateY\",\"value\"],\"sources\":[\"/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx\"],\"mappings\":\"AA4GI,SAAAA,WAAA,QAAAC,SAAA,CAAAC,eAAA,OAAAC,SAAA,OAAO,CACLC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAE,CAACJ,SAAS,CAAGC,eAAe,CAACI,KAAM,CAAC,CAChE,CAAC\",\"ignoreList\":[]}"
52
+ };
53
+ const _worklet_9323961691555_init_data = {
54
+ code: "function TabBarTsx5(){const{labelOpacity,ICON_LABEL_GAP,densityProgress}=this.__closure;return{opacity:labelOpacity.value,transform:[{translateY:-ICON_LABEL_GAP*(1-densityProgress.value)}]};}",
55
+ location: "/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx",
56
+ sourceMap: "{\"version\":3,\"names\":[\"TabBarTsx5\",\"labelOpacity\",\"ICON_LABEL_GAP\",\"densityProgress\",\"__closure\",\"opacity\",\"value\",\"transform\",\"translateY\"],\"sources\":[\"/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx\"],\"mappings\":\"AAmHI,SAAAA,WAAA,QAAAC,YAAA,CAAAC,cAAA,CAAAC,eAAA,OAAAC,SAAA,OAAO,CACLC,OAAO,CAAEJ,YAAY,CAACK,KAAK,CAE3BC,SAAS,CAAE,CACT,CAAEC,UAAU,CAAE,CAACN,cAAc,EAAI,CAAC,CAAGC,eAAe,CAACG,KAAK,CAAE,CAAC,CAEjE,CAAC\",\"ignoreList\":[]}"
31
57
  };
32
58
  const useTabBarItemAnimations = ({
33
- isActive
59
+ isActive,
60
+ densityProgress,
61
+ labelOpacity,
62
+ iconShift
34
63
  }) => {
35
64
  const activeProgress = useSharedValue(isActive ? 1 : 0);
36
65
  const pressProgress = useSharedValue(1);
@@ -121,101 +150,194 @@ const useTabBarItemAnimations = ({
121
150
  _worklet_11977595001241_init_data,
122
151
  activeProgress
123
152
  }), [activeProgress]);
153
+ const contentStyle = useAnimatedStyle(function TabBarTsx4Factory({
154
+ _worklet_13573149629465_init_data,
155
+ iconShift,
156
+ densityProgress
157
+ }) {
158
+ const _e = [new global.Error(), -3, -27];
159
+ const TabBarTsx4 = () => ({
160
+ transform: [{
161
+ translateY: -iconShift * densityProgress.value
162
+ }]
163
+ });
164
+ TabBarTsx4.__closure = {
165
+ iconShift,
166
+ densityProgress
167
+ };
168
+ TabBarTsx4.__workletHash = 13573149629465;
169
+ TabBarTsx4.__pluginVersion = "0.10.1";
170
+ TabBarTsx4.__initData = _worklet_13573149629465_init_data;
171
+ TabBarTsx4.__stackDetails = _e;
172
+ return TabBarTsx4;
173
+ }({
174
+ _worklet_13573149629465_init_data,
175
+ iconShift,
176
+ densityProgress
177
+ }), [densityProgress, iconShift]);
178
+ const labelStyle = useAnimatedStyle(function TabBarTsx5Factory({
179
+ _worklet_9323961691555_init_data,
180
+ labelOpacity,
181
+ ICON_LABEL_GAP,
182
+ densityProgress
183
+ }) {
184
+ const _e = [new global.Error(), -4, -27];
185
+ const TabBarTsx5 = () => ({
186
+ opacity: labelOpacity.value,
187
+ // Closes the icon/label gap as the bar collapses.
188
+ transform: [{
189
+ translateY: -ICON_LABEL_GAP * (1 - densityProgress.value)
190
+ }]
191
+ });
192
+ TabBarTsx5.__closure = {
193
+ labelOpacity,
194
+ ICON_LABEL_GAP,
195
+ densityProgress
196
+ };
197
+ TabBarTsx5.__workletHash = 9323961691555;
198
+ TabBarTsx5.__pluginVersion = "0.10.1";
199
+ TabBarTsx5.__initData = _worklet_9323961691555_init_data;
200
+ TabBarTsx5.__stackDetails = _e;
201
+ return TabBarTsx5;
202
+ }({
203
+ _worklet_9323961691555_init_data,
204
+ labelOpacity,
205
+ ICON_LABEL_GAP,
206
+ densityProgress
207
+ }), [labelOpacity, densityProgress]);
124
208
  return {
125
209
  onPressIn,
126
210
  onPressOut,
127
211
  scaleStyle,
128
212
  activeIconStyle,
129
- inactiveIconStyle
213
+ inactiveIconStyle,
214
+ contentStyle,
215
+ labelStyle
130
216
  };
131
217
  };
132
- const _worklet_12147453282099_init_data = {
133
- code: "function TabBarTsx4(){const{pillProgress,itemWidth,itemHeight,PILL_INSET}=this.__closure;return{transform:[{translateX:pillProgress.value}],width:itemWidth.value,height:itemHeight.value-PILL_INSET*2};}",
218
+ const _worklet_7081946983_init_data = {
219
+ code: "function TabBarTsx6(){const{interpolate,densityProgress,TAB_BAR_COMPACT_HEIGHT,expandedHeight,compactInset}=this.__closure;return{height:interpolate(densityProgress.value,[0,1],[TAB_BAR_COMPACT_HEIGHT,expandedHeight]),marginHorizontal:interpolate(densityProgress.value,[0,1],[compactInset,0])};}",
220
+ location: "/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx",
221
+ sourceMap: "{\"version\":3,\"names\":[\"TabBarTsx6\",\"interpolate\",\"densityProgress\",\"TAB_BAR_COMPACT_HEIGHT\",\"expandedHeight\",\"compactInset\",\"__closure\",\"height\",\"value\",\"marginHorizontal\"],\"sources\":[\"/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx\"],\"mappings\":\"AAqNI,SAAAA,WAAA,QAAAC,WAAA,CAAAC,eAAA,CAAAC,sBAAA,CAAAC,cAAA,CAAAC,YAAA,OAAAC,SAAA,OAAO,CACLC,MAAM,CAAEN,WAAW,CACjBC,eAAe,CAACM,KAAK,CACrB,CAAC,CAAC,CAAE,CAAC,CAAC,CACN,CAACL,sBAAsB,CAAEC,cAAc,CACzC,CAAC,CACDK,gBAAgB,CAAER,WAAW,CAC3BC,eAAe,CAACM,KAAK,CACrB,CAAC,CAAC,CAAE,CAAC,CAAC,CACN,CAACH,YAAY,CAAE,CAAC,CAClB,CACF,CAAC\",\"ignoreList\":[]}"
222
+ };
223
+ const _worklet_8468015130326_init_data = {
224
+ code: "function TabBarTsx7(){const{count,pillIndex}=this.__closure;return{width:100/count+\"%\",left:pillIndex.value*100/count+\"%\"};}",
134
225
  location: "/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx",
135
- sourceMap: "{\"version\":3,\"names\":[\"TabBarTsx4\",\"pillProgress\",\"itemWidth\",\"itemHeight\",\"PILL_INSET\",\"__closure\",\"transform\",\"translateX\",\"value\",\"width\",\"height\"],\"sources\":[\"/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx\"],\"mappings\":\"AA0JI,SAAAA,WAAA,QAAAC,YAAA,CAAAC,SAAA,CAAAC,UAAA,CAAAC,UAAA,OAAAC,SAAA,OAAO,CACLC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEN,YAAY,CAACO,KAAM,CAAC,CAAC,CAC/CC,KAAK,CAAEP,SAAS,CAACM,KAAK,CACtBE,MAAM,CAAEP,UAAU,CAACK,KAAK,CAAGJ,UAAU,CAAG,CAC1C,CAAC\",\"ignoreList\":[]}"
226
+ sourceMap: "{\"version\":3,\"names\":[\"TabBarTsx7\",\"count\",\"pillIndex\",\"__closure\",\"width\",\"left\",\"value\"],\"sources\":[\"/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx\"],\"mappings\":\"AAqOI,SAAAA,WAAA,QAAAC,KAAA,CAAAC,SAAA,OAAAC,SAAA,OAAO,CACLC,KAAK,CAAK,GAAG,CAAGH,KAAK,IAAG,CACxBI,IAAI,CAAMH,SAAS,CAACI,KAAK,CAAG,GAAG,CAAIL,KAAK,IAC1C,CAAC\",\"ignoreList\":[]}"
136
227
  };
137
- const useTabBarPillLayout = ({
228
+ const useTabBarAnimations = ({
138
229
  active,
230
+ density,
139
231
  children
140
232
  }) => {
141
- const pillProgress = useSharedValue(0);
142
- const itemWidth = useSharedValue(0);
143
- const itemHeight = useSharedValue(0);
144
- const hasLayoutRef = useRef(false);
145
- const timingConfig = useTimingConfig({
233
+ const {
234
+ theme
235
+ } = useTheme();
236
+ const items = Children.toArray(children).filter(isValidElement);
237
+ const count = items.length;
238
+ const activeIndex = items.findIndex(item => item.props.value === active);
239
+ const isExpanded = density === 'expanded';
240
+ const pillIndex = useSharedValue(Math.max(activeIndex, 0));
241
+ const densityProgress = useSharedValue(isExpanded ? 1 : 0);
242
+ const labelOpacity = useSharedValue(isExpanded ? 1 : 0);
243
+ const pillTimingConfig = useTimingConfig({
146
244
  duration: 300,
147
245
  easing: 'easeInOut'
148
246
  });
149
- const activeIndex = useMemo(() => {
150
- return Children.toArray(children).findIndex(child => {
151
- if (/*#__PURE__*/isValidElement(child)) {
152
- return child.props.value === active;
153
- }
154
- return false;
155
- });
156
- }, [active, children]);
157
- const activeIndexRef = useRef(activeIndex);
158
- activeIndexRef.current = activeIndex;
159
- const onLayout = e => {
160
- const {
161
- width,
162
- height
163
- } = e.nativeEvent.layout;
164
- const count = Children.count(children);
165
- const slotWidth = (width - PILL_INSET * 2) / count;
166
- itemWidth.value = slotWidth;
167
- itemHeight.value = height;
168
- if (!hasLayoutRef.current) {
169
- hasLayoutRef.current = true;
170
- const index = activeIndexRef.current;
171
- if (index >= 0) {
172
- pillProgress.value = index * slotWidth;
173
- }
174
- }
175
- };
247
+ const densityTimingConfig = useTimingConfig({
248
+ duration: 300,
249
+ easing: 'easeOut'
250
+ });
251
+ const labelOutTimingConfig = useTimingConfig({
252
+ duration: 150,
253
+ easing: 'easeOut'
254
+ });
255
+ const labelInTimingConfig = useTimingConfig({
256
+ duration: 200,
257
+ easing: 'easeOut'
258
+ });
259
+ const labelInDelay = theme.motion.delays[75];
260
+ const compactInset = theme.spacings.s32;
261
+ const labelLineHeight = useLabelLineHeight();
262
+ const expandedHeight = TAB_BAR_EXPANDED_HEIGHT + Math.max(labelLineHeight.scaled - labelLineHeight.base, 0);
176
263
  useEffect(() => {
177
- if (!hasLayoutRef.current) return;
178
- if (activeIndex >= 0 && itemWidth.value > 0) {
179
- pillProgress.value = withTiming(activeIndex * itemWidth.value, timingConfig);
264
+ if (activeIndex >= 0) {
265
+ pillIndex.value = withTiming(activeIndex, pillTimingConfig);
180
266
  }
181
- }, [activeIndex, itemWidth, pillProgress, timingConfig]);
182
- useEffect(() => () => cancelAnimation(pillProgress), [pillProgress]);
183
- const animatedPillStyle = useAnimatedStyle(function TabBarTsx4Factory({
184
- _worklet_12147453282099_init_data,
185
- pillProgress,
186
- itemWidth,
187
- itemHeight,
188
- PILL_INSET
267
+ }, [activeIndex, pillIndex, pillTimingConfig]);
268
+ useEffect(() => {
269
+ densityProgress.value = withTiming(isExpanded ? 1 : 0, densityTimingConfig);
270
+ // Labels leave quickly, but only come back once the bar has started
271
+ // making room for them.
272
+ labelOpacity.value = isExpanded ? withDelay(labelInDelay, withTiming(1, labelInTimingConfig)) : withTiming(0, labelOutTimingConfig);
273
+ }, [isExpanded, densityProgress, labelOpacity, densityTimingConfig, labelInTimingConfig, labelOutTimingConfig, labelInDelay]);
274
+ useEffect(() => () => {
275
+ cancelAnimation(pillIndex);
276
+ cancelAnimation(densityProgress);
277
+ cancelAnimation(labelOpacity);
278
+ }, [pillIndex, densityProgress, labelOpacity]);
279
+ const barStyle = useAnimatedStyle(function TabBarTsx6Factory({
280
+ _worklet_7081946983_init_data,
281
+ interpolate,
282
+ densityProgress,
283
+ TAB_BAR_COMPACT_HEIGHT,
284
+ expandedHeight,
285
+ compactInset
189
286
  }) {
190
- const _e = [new global.Error(), -5, -27];
191
- const TabBarTsx4 = () => ({
192
- transform: [{
193
- translateX: pillProgress.value
194
- }],
195
- width: itemWidth.value,
196
- height: itemHeight.value - PILL_INSET * 2
287
+ const _e = [new global.Error(), -6, -27];
288
+ const TabBarTsx6 = () => ({
289
+ height: interpolate(densityProgress.value, [0, 1], [TAB_BAR_COMPACT_HEIGHT, expandedHeight]),
290
+ marginHorizontal: interpolate(densityProgress.value, [0, 1], [compactInset, 0])
197
291
  });
198
- TabBarTsx4.__closure = {
199
- pillProgress,
200
- itemWidth,
201
- itemHeight,
202
- PILL_INSET
292
+ TabBarTsx6.__closure = {
293
+ interpolate,
294
+ densityProgress,
295
+ TAB_BAR_COMPACT_HEIGHT,
296
+ expandedHeight,
297
+ compactInset
203
298
  };
204
- TabBarTsx4.__workletHash = 12147453282099;
205
- TabBarTsx4.__pluginVersion = "0.10.1";
206
- TabBarTsx4.__initData = _worklet_12147453282099_init_data;
207
- TabBarTsx4.__stackDetails = _e;
208
- return TabBarTsx4;
299
+ TabBarTsx6.__workletHash = 7081946983;
300
+ TabBarTsx6.__pluginVersion = "0.10.1";
301
+ TabBarTsx6.__initData = _worklet_7081946983_init_data;
302
+ TabBarTsx6.__stackDetails = _e;
303
+ return TabBarTsx6;
304
+ }({
305
+ _worklet_7081946983_init_data,
306
+ interpolate,
307
+ densityProgress,
308
+ TAB_BAR_COMPACT_HEIGHT,
309
+ expandedHeight,
310
+ compactInset
311
+ }), [densityProgress, compactInset, expandedHeight]);
312
+ const pillStyle = useAnimatedStyle(function TabBarTsx7Factory({
313
+ _worklet_8468015130326_init_data,
314
+ count,
315
+ pillIndex
316
+ }) {
317
+ const _e = [new global.Error(), -3, -27];
318
+ const TabBarTsx7 = () => ({
319
+ width: `${100 / count}%`,
320
+ left: `${pillIndex.value * 100 / count}%`
321
+ });
322
+ TabBarTsx7.__closure = {
323
+ count,
324
+ pillIndex
325
+ };
326
+ TabBarTsx7.__workletHash = 8468015130326;
327
+ TabBarTsx7.__pluginVersion = "0.10.1";
328
+ TabBarTsx7.__initData = _worklet_8468015130326_init_data;
329
+ TabBarTsx7.__stackDetails = _e;
330
+ return TabBarTsx7;
209
331
  }({
210
- _worklet_12147453282099_init_data,
211
- pillProgress,
212
- itemWidth,
213
- itemHeight,
214
- PILL_INSET
215
- }), [pillProgress, itemWidth, itemHeight]);
332
+ _worklet_8468015130326_init_data,
333
+ count,
334
+ pillIndex
335
+ }), [pillIndex, count]);
216
336
  return {
217
- onLayout,
218
- animatedPillStyle
337
+ densityProgress,
338
+ labelOpacity,
339
+ barStyle,
340
+ pillStyle
219
341
  };
220
342
  };
221
343
  export function TabBarItem({
@@ -227,9 +349,12 @@ export function TabBarItem({
227
349
  ...props
228
350
  }) {
229
351
  const styles = useStyles();
352
+ const labelLineHeight = useLabelLineHeight();
230
353
  const {
231
354
  active,
232
- onTabPress
355
+ onTabPress,
356
+ densityProgress,
357
+ labelOpacity
233
358
  } = useTabBarContext();
234
359
  const isActive = active === value;
235
360
  const Icon = icon ?? Placeholder;
@@ -239,14 +364,19 @@ export function TabBarItem({
239
364
  onPressOut,
240
365
  scaleStyle,
241
366
  activeIconStyle,
242
- inactiveIconStyle
367
+ inactiveIconStyle,
368
+ contentStyle,
369
+ labelStyle
243
370
  } = useTabBarItemAnimations({
244
- isActive
371
+ isActive,
372
+ densityProgress,
373
+ labelOpacity,
374
+ iconShift: label ? (ICON_LABEL_GAP + labelLineHeight.scaled) / 2 : 0
245
375
  });
246
376
  function onPress() {
247
377
  onTabPress(value);
248
378
  }
249
- return /*#__PURE__*/_jsxs(Pressable, {
379
+ return /*#__PURE__*/_jsx(Pressable, {
250
380
  style: StyleSheet.flatten([styles.item, style]),
251
381
  onPress: onPress,
252
382
  onPressIn: onPressIn,
@@ -257,27 +387,33 @@ export function TabBarItem({
257
387
  selected: isActive
258
388
  },
259
389
  ...props,
260
- children: [/*#__PURE__*/_jsx(Animated.View, {
261
- style: scaleStyle,
262
- children: /*#__PURE__*/_jsxs(Box, {
263
- style: styles.itemIconContainer,
264
- children: [/*#__PURE__*/_jsx(Animated.View, {
265
- style: [styles.itemIcon, inactiveIconStyle],
266
- children: /*#__PURE__*/_jsx(Icon, {
267
- size: 20
268
- })
269
- }), /*#__PURE__*/_jsx(Animated.View, {
270
- style: [styles.itemIcon, activeIconStyle],
271
- children: /*#__PURE__*/_jsx(ActiveIcon, {
272
- size: 20
273
- })
274
- })]
275
- })
276
- }), label && /*#__PURE__*/_jsx(Text, {
277
- style: [styles.itemText, isActive && styles.activeItemText],
278
- numberOfLines: 1,
279
- children: label
280
- })]
390
+ children: /*#__PURE__*/_jsxs(Animated.View, {
391
+ style: [styles.itemContent, contentStyle],
392
+ children: [/*#__PURE__*/_jsx(Animated.View, {
393
+ style: scaleStyle,
394
+ children: /*#__PURE__*/_jsxs(Box, {
395
+ style: styles.itemIconContainer,
396
+ children: [/*#__PURE__*/_jsx(Animated.View, {
397
+ style: [styles.itemIcon, inactiveIconStyle],
398
+ children: /*#__PURE__*/_jsx(Icon, {
399
+ size: ICON_SIZE
400
+ })
401
+ }), /*#__PURE__*/_jsx(Animated.View, {
402
+ style: [styles.itemIcon, activeIconStyle],
403
+ children: /*#__PURE__*/_jsx(ActiveIcon, {
404
+ size: ICON_SIZE
405
+ })
406
+ })]
407
+ })
408
+ }), label && /*#__PURE__*/_jsx(Animated.View, {
409
+ style: [styles.itemLabel, labelStyle],
410
+ children: /*#__PURE__*/_jsx(Text, {
411
+ style: [styles.itemText, isActive && styles.activeItemText],
412
+ numberOfLines: 1,
413
+ children: label
414
+ })
415
+ })]
416
+ })
281
417
  });
282
418
  }
283
419
 
@@ -302,6 +438,7 @@ export function TabBarItem({
302
438
  export function TabBar({
303
439
  active,
304
440
  onTabPress,
441
+ density = 'expanded',
305
442
  children,
306
443
  ...props
307
444
  }) {
@@ -311,39 +448,47 @@ export function TabBar({
311
448
  colorScheme
312
449
  } = useTheme();
313
450
  const {
314
- onLayout,
315
- animatedPillStyle
316
- } = useTabBarPillLayout({
451
+ densityProgress,
452
+ labelOpacity,
453
+ barStyle,
454
+ pillStyle
455
+ } = useTabBarAnimations({
317
456
  active,
457
+ density,
318
458
  children
319
459
  });
320
460
  return /*#__PURE__*/_jsx(TabBarContextProvider, {
321
461
  value: {
322
462
  active,
323
- onTabPress: value => onTabPress(value)
463
+ onTabPress: value => onTabPress(value),
464
+ densityProgress,
465
+ labelOpacity
324
466
  },
325
- children: /*#__PURE__*/_jsxs(Box, {
326
- style: styles.container,
327
- onLayout: onLayout,
467
+ children: /*#__PURE__*/_jsx(Box, {
328
468
  accessibilityRole: "tablist",
329
469
  ...props,
330
- children: [children, RuntimeConstants.isAndroid ? /*#__PURE__*/_jsx(View, {
331
- style: styles.fallbackBackground
332
- }) : /*#__PURE__*/_jsx(BlurView, {
333
- style: styles.blur,
334
- blurAmount: theme.blur.lg,
335
- blurType: colorScheme === 'dark' ? 'dark' : 'light',
336
- overlayColor: colorScheme === 'dark' ? 'rgba(0,0,0,0.15)' : 'rgba(255,255,255,0.2)',
337
- reducedTransparencyFallbackColor: styles.fallbackBackground.backgroundColor
338
- }), /*#__PURE__*/_jsx(Animated.View, {
339
- style: [styles.pill, animatedPillStyle]
340
- })]
470
+ children: /*#__PURE__*/_jsxs(Animated.View, {
471
+ style: [styles.container, barStyle],
472
+ children: [children, RuntimeConstants.isAndroid ? /*#__PURE__*/_jsx(View, {
473
+ style: styles.fallbackBackground
474
+ }) : /*#__PURE__*/_jsx(BlurView, {
475
+ style: styles.blur,
476
+ blurAmount: theme.blur.lg,
477
+ blurType: colorScheme === 'dark' ? 'dark' : 'light',
478
+ overlayColor: colorScheme === 'dark' ? 'rgba(0,0,0,0.15)' : 'rgba(255,255,255,0.2)',
479
+ reducedTransparencyFallbackColor: styles.fallbackBackground.backgroundColor
480
+ }), /*#__PURE__*/_jsx(View, {
481
+ style: styles.pillTrack,
482
+ children: /*#__PURE__*/_jsx(Animated.View, {
483
+ style: [styles.pill, pillStyle]
484
+ })
485
+ })]
486
+ })
341
487
  })
342
488
  });
343
489
  }
344
490
  const useStyles = () => useStyleSheet(t => ({
345
491
  container: {
346
- minHeight: TAB_BAR_HEIGHT,
347
492
  flexDirection: 'row',
348
493
  justifyContent: 'center',
349
494
  padding: t.spacings.s4,
@@ -371,10 +516,19 @@ const useStyles = () => useStyleSheet(t => ({
371
516
  },
372
517
  item: {
373
518
  flex: 1,
374
- paddingVertical: t.spacings.s4,
375
- alignItems: 'center',
376
- justifyContent: 'center',
377
- gap: t.spacings.s2
519
+ alignSelf: 'stretch',
520
+ marginVertical: -t.spacings.s4,
521
+ justifyContent: 'center'
522
+ },
523
+ itemContent: {
524
+ alignItems: 'center'
525
+ },
526
+ itemLabel: {
527
+ position: 'absolute',
528
+ top: ICON_SIZE + ICON_LABEL_GAP,
529
+ left: 0,
530
+ right: 0,
531
+ alignItems: 'center'
378
532
  },
379
533
  itemText: {
380
534
  ...t.typographies.body4,
@@ -385,18 +539,25 @@ const useStyles = () => useStyleSheet(t => ({
385
539
  position: 'absolute'
386
540
  },
387
541
  itemIconContainer: {
388
- width: 20,
389
- height: 20,
542
+ width: ICON_SIZE,
543
+ height: ICON_SIZE,
390
544
  position: 'relative'
391
545
  },
392
546
  activeItemText: {
393
547
  ...t.typographies.body4SemiBold
394
548
  },
395
- pill: {
549
+ pillTrack: {
396
550
  position: 'absolute',
397
551
  pointerEvents: 'none',
398
552
  top: PILL_INSET,
553
+ bottom: PILL_INSET,
399
554
  left: PILL_INSET,
555
+ right: PILL_INSET
556
+ },
557
+ pill: {
558
+ position: 'absolute',
559
+ top: 0,
560
+ bottom: 0,
400
561
  borderRadius: t.borderRadius.full,
401
562
  backgroundColor: t.colors.bg.mutedTransparent
402
563
  }