@ledgerhq/lumen-ui-rnative 0.1.73 → 0.1.75
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.
- package/dist/module/lib/Components/core/DotSymbol/DotSymbol.js +1 -1
- package/dist/module/lib/Components/core/Spot/Spot.js +1 -1
- package/dist/module/lib/Components/core/TabBar/TabBar.js +298 -133
- package/dist/module/lib/Components/core/TabBar/TabBar.js.map +1 -1
- package/dist/module/lib/Components/core/TabBar/TabBarContext.js.map +1 -1
- package/dist/module/lib/Components/internal/BaseTag/BaseTag.js.map +1 -1
- package/dist/module/lib/Components/symbols/icons/BadgeVerified.js +49 -0
- package/dist/module/lib/Components/symbols/icons/BadgeVerified.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/BadgeVerifiedFill.js +47 -0
- package/dist/module/lib/Components/symbols/icons/BadgeVerifiedFill.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Building.js +49 -0
- package/dist/module/lib/Components/symbols/icons/Building.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Play.js +48 -0
- package/dist/module/lib/Components/symbols/icons/Play.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Sort.js +49 -0
- package/dist/module/lib/Components/symbols/icons/Sort.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/TextEdit.js +49 -0
- package/dist/module/lib/Components/symbols/icons/TextEdit.js.map +1 -0
- package/dist/module/lib/Components/symbols/index.js +6 -0
- package/dist/module/lib/Components/symbols/index.js.map +1 -1
- package/dist/typescript/src/lib/Components/core/TabBar/TabBar.d.ts +3 -2
- package/dist/typescript/src/lib/Components/core/TabBar/TabBar.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/TabBar/TabBarContext.d.ts +3 -0
- package/dist/typescript/src/lib/Components/core/TabBar/TabBarContext.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/TabBar/types.d.ts +8 -0
- package/dist/typescript/src/lib/Components/core/TabBar/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/Tag/types.d.ts +3 -22
- package/dist/typescript/src/lib/Components/core/Tag/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/internal/BaseTag/BaseTag.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/internal/BaseTag/types.d.ts +23 -2
- package/dist/typescript/src/lib/Components/internal/BaseTag/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/symbols/icons/BadgeVerified.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/BadgeVerified.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/BadgeVerifiedFill.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/BadgeVerifiedFill.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Building.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Building.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Play.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Play.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Sort.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Sort.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/TextEdit.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/TextEdit.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/index.d.ts +6 -0
- package/dist/typescript/src/lib/Components/symbols/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/lib/Components/core/DotSymbol/DotSymbol.tsx +1 -1
- package/src/lib/Components/core/Spot/Spot.tsx +1 -1
- package/src/lib/Components/core/TabBar/TabBar.tsx +212 -109
- package/src/lib/Components/core/TabBar/TabBarContext.tsx +3 -0
- package/src/lib/Components/core/TabBar/types.ts +9 -0
- package/src/lib/Components/core/Tag/types.ts +3 -30
- package/src/lib/Components/internal/BaseTag/BaseTag.tsx +2 -3
- package/src/lib/Components/internal/BaseTag/types.ts +32 -2
- package/src/lib/Components/symbols/icons/BadgeVerified.tsx +44 -0
- package/src/lib/Components/symbols/icons/BadgeVerifiedFill.tsx +42 -0
- package/src/lib/Components/symbols/icons/Building.tsx +44 -0
- package/src/lib/Components/symbols/icons/Play.tsx +43 -0
- package/src/lib/Components/symbols/icons/Sort.tsx +44 -0
- package/src/lib/Components/symbols/icons/TextEdit.tsx +44 -0
- package/src/lib/Components/symbols/index.ts +6 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { BlurView } from '@sbaiahmed1/react-native-blur';
|
|
4
|
-
import { Children, isValidElement, useEffect
|
|
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
|
|
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\":\"
|
|
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\":\"
|
|
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\":\"
|
|
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,198 @@ 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
|
|
133
|
-
code: "function
|
|
218
|
+
const _worklet_8753718797100_init_data = {
|
|
219
|
+
code: "function TabBarTsx6(){const{interpolate,densityProgress,compactInset,TAB_BAR_COMPACT_HEIGHT,expandedHeight}=this.__closure;const inset=interpolate(densityProgress.value,[0,1],[compactInset,0]);return{height:interpolate(densityProgress.value,[0,1],[TAB_BAR_COMPACT_HEIGHT,expandedHeight]),marginLeft:inset,marginRight:inset};}",
|
|
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\",\"compactInset\",\"TAB_BAR_COMPACT_HEIGHT\",\"expandedHeight\",\"__closure\",\"inset\",\"value\",\"height\",\"marginLeft\",\"marginRight\"],\"sources\":[\"/home/runner/work/lumen/lumen/libs/ui-rnative/src/lib/Components/core/TabBar/TabBar.tsx\"],\"mappings\":\"AAoNoC,SAAAA,UAAMA,CAAA,QAAAC,WAAA,CAAAC,eAAA,CAAAC,YAAA,CAAAC,sBAAA,CAAAC,cAAA,OAAAC,SAAA,CACtC,KAAM,CAAAC,KAAK,CAAGN,WAAW,CAACC,eAAe,CAACM,KAAK,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAACL,YAAY,CAAE,CAAC,CAAC,CAAC,CAC3E,MAAO,CACLM,MAAM,CAAER,WAAW,CACjBC,eAAe,CAACM,KAAK,CACrB,CAAC,CAAC,CAAE,CAAC,CAAC,CACN,CAACJ,sBAAsB,CAAEC,cAAc,CACzC,CAAC,CACDK,UAAU,CAAEH,KAAK,CACjBI,WAAW,CAAEJ,KACf,CAAC,CACH\",\"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\":[\"
|
|
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\":\"AAkOI,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
|
|
228
|
+
const useTabBarAnimations = ({
|
|
138
229
|
active,
|
|
230
|
+
density,
|
|
139
231
|
children
|
|
140
232
|
}) => {
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const
|
|
145
|
-
const
|
|
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
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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 (
|
|
178
|
-
|
|
179
|
-
pillProgress.value = withTiming(activeIndex * itemWidth.value, timingConfig);
|
|
264
|
+
if (activeIndex >= 0) {
|
|
265
|
+
pillIndex.value = withTiming(activeIndex, pillTimingConfig);
|
|
180
266
|
}
|
|
181
|
-
}, [activeIndex,
|
|
182
|
-
useEffect(() =>
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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_8753718797100_init_data,
|
|
281
|
+
interpolate,
|
|
282
|
+
densityProgress,
|
|
283
|
+
compactInset,
|
|
284
|
+
TAB_BAR_COMPACT_HEIGHT,
|
|
285
|
+
expandedHeight
|
|
189
286
|
}) {
|
|
190
|
-
const _e = [new global.Error(), -
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
287
|
+
const _e = [new global.Error(), -6, -27];
|
|
288
|
+
const TabBarTsx6 = function () {
|
|
289
|
+
const inset = interpolate(densityProgress.value, [0, 1], [compactInset, 0]);
|
|
290
|
+
return {
|
|
291
|
+
height: interpolate(densityProgress.value, [0, 1], [TAB_BAR_COMPACT_HEIGHT, expandedHeight]),
|
|
292
|
+
marginLeft: inset,
|
|
293
|
+
marginRight: inset
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
TabBarTsx6.__closure = {
|
|
297
|
+
interpolate,
|
|
298
|
+
densityProgress,
|
|
299
|
+
compactInset,
|
|
300
|
+
TAB_BAR_COMPACT_HEIGHT,
|
|
301
|
+
expandedHeight
|
|
302
|
+
};
|
|
303
|
+
TabBarTsx6.__workletHash = 8753718797100;
|
|
304
|
+
TabBarTsx6.__pluginVersion = "0.10.1";
|
|
305
|
+
TabBarTsx6.__initData = _worklet_8753718797100_init_data;
|
|
306
|
+
TabBarTsx6.__stackDetails = _e;
|
|
307
|
+
return TabBarTsx6;
|
|
308
|
+
}({
|
|
309
|
+
_worklet_8753718797100_init_data,
|
|
310
|
+
interpolate,
|
|
311
|
+
densityProgress,
|
|
312
|
+
compactInset,
|
|
313
|
+
TAB_BAR_COMPACT_HEIGHT,
|
|
314
|
+
expandedHeight
|
|
315
|
+
}), [densityProgress, compactInset, expandedHeight]);
|
|
316
|
+
const pillStyle = useAnimatedStyle(function TabBarTsx7Factory({
|
|
317
|
+
_worklet_8468015130326_init_data,
|
|
318
|
+
count,
|
|
319
|
+
pillIndex
|
|
320
|
+
}) {
|
|
321
|
+
const _e = [new global.Error(), -3, -27];
|
|
322
|
+
const TabBarTsx7 = () => ({
|
|
323
|
+
width: `${100 / count}%`,
|
|
324
|
+
left: `${pillIndex.value * 100 / count}%`
|
|
197
325
|
});
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
itemHeight,
|
|
202
|
-
PILL_INSET
|
|
326
|
+
TabBarTsx7.__closure = {
|
|
327
|
+
count,
|
|
328
|
+
pillIndex
|
|
203
329
|
};
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
return
|
|
330
|
+
TabBarTsx7.__workletHash = 8468015130326;
|
|
331
|
+
TabBarTsx7.__pluginVersion = "0.10.1";
|
|
332
|
+
TabBarTsx7.__initData = _worklet_8468015130326_init_data;
|
|
333
|
+
TabBarTsx7.__stackDetails = _e;
|
|
334
|
+
return TabBarTsx7;
|
|
209
335
|
}({
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
PILL_INSET
|
|
215
|
-
}), [pillProgress, itemWidth, itemHeight]);
|
|
336
|
+
_worklet_8468015130326_init_data,
|
|
337
|
+
count,
|
|
338
|
+
pillIndex
|
|
339
|
+
}), [pillIndex, count]);
|
|
216
340
|
return {
|
|
217
|
-
|
|
218
|
-
|
|
341
|
+
densityProgress,
|
|
342
|
+
labelOpacity,
|
|
343
|
+
barStyle,
|
|
344
|
+
pillStyle
|
|
219
345
|
};
|
|
220
346
|
};
|
|
221
347
|
export function TabBarItem({
|
|
@@ -227,9 +353,12 @@ export function TabBarItem({
|
|
|
227
353
|
...props
|
|
228
354
|
}) {
|
|
229
355
|
const styles = useStyles();
|
|
356
|
+
const labelLineHeight = useLabelLineHeight();
|
|
230
357
|
const {
|
|
231
358
|
active,
|
|
232
|
-
onTabPress
|
|
359
|
+
onTabPress,
|
|
360
|
+
densityProgress,
|
|
361
|
+
labelOpacity
|
|
233
362
|
} = useTabBarContext();
|
|
234
363
|
const isActive = active === value;
|
|
235
364
|
const Icon = icon ?? Placeholder;
|
|
@@ -239,14 +368,19 @@ export function TabBarItem({
|
|
|
239
368
|
onPressOut,
|
|
240
369
|
scaleStyle,
|
|
241
370
|
activeIconStyle,
|
|
242
|
-
inactiveIconStyle
|
|
371
|
+
inactiveIconStyle,
|
|
372
|
+
contentStyle,
|
|
373
|
+
labelStyle
|
|
243
374
|
} = useTabBarItemAnimations({
|
|
244
|
-
isActive
|
|
375
|
+
isActive,
|
|
376
|
+
densityProgress,
|
|
377
|
+
labelOpacity,
|
|
378
|
+
iconShift: label ? (ICON_LABEL_GAP + labelLineHeight.scaled) / 2 : 0
|
|
245
379
|
});
|
|
246
380
|
function onPress() {
|
|
247
381
|
onTabPress(value);
|
|
248
382
|
}
|
|
249
|
-
return /*#__PURE__*/
|
|
383
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
250
384
|
style: StyleSheet.flatten([styles.item, style]),
|
|
251
385
|
onPress: onPress,
|
|
252
386
|
onPressIn: onPressIn,
|
|
@@ -257,27 +391,33 @@ export function TabBarItem({
|
|
|
257
391
|
selected: isActive
|
|
258
392
|
},
|
|
259
393
|
...props,
|
|
260
|
-
children:
|
|
261
|
-
style:
|
|
262
|
-
children: /*#__PURE__*/
|
|
263
|
-
style:
|
|
264
|
-
children:
|
|
265
|
-
style:
|
|
266
|
-
children: /*#__PURE__*/_jsx(
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
394
|
+
children: /*#__PURE__*/_jsxs(Animated.View, {
|
|
395
|
+
style: [styles.itemContent, contentStyle],
|
|
396
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
397
|
+
style: scaleStyle,
|
|
398
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
|
399
|
+
style: styles.itemIconContainer,
|
|
400
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
401
|
+
style: [styles.itemIcon, inactiveIconStyle],
|
|
402
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
403
|
+
size: ICON_SIZE
|
|
404
|
+
})
|
|
405
|
+
}), /*#__PURE__*/_jsx(Animated.View, {
|
|
406
|
+
style: [styles.itemIcon, activeIconStyle],
|
|
407
|
+
children: /*#__PURE__*/_jsx(ActiveIcon, {
|
|
408
|
+
size: ICON_SIZE
|
|
409
|
+
})
|
|
410
|
+
})]
|
|
411
|
+
})
|
|
412
|
+
}), label && /*#__PURE__*/_jsx(Animated.View, {
|
|
413
|
+
style: [styles.itemLabel, labelStyle],
|
|
414
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
415
|
+
style: [styles.itemText, isActive && styles.activeItemText],
|
|
416
|
+
numberOfLines: 1,
|
|
417
|
+
children: label
|
|
418
|
+
})
|
|
419
|
+
})]
|
|
420
|
+
})
|
|
281
421
|
});
|
|
282
422
|
}
|
|
283
423
|
|
|
@@ -302,6 +442,7 @@ export function TabBarItem({
|
|
|
302
442
|
export function TabBar({
|
|
303
443
|
active,
|
|
304
444
|
onTabPress,
|
|
445
|
+
density = 'expanded',
|
|
305
446
|
children,
|
|
306
447
|
...props
|
|
307
448
|
}) {
|
|
@@ -311,39 +452,47 @@ export function TabBar({
|
|
|
311
452
|
colorScheme
|
|
312
453
|
} = useTheme();
|
|
313
454
|
const {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
455
|
+
densityProgress,
|
|
456
|
+
labelOpacity,
|
|
457
|
+
barStyle,
|
|
458
|
+
pillStyle
|
|
459
|
+
} = useTabBarAnimations({
|
|
317
460
|
active,
|
|
461
|
+
density,
|
|
318
462
|
children
|
|
319
463
|
});
|
|
320
464
|
return /*#__PURE__*/_jsx(TabBarContextProvider, {
|
|
321
465
|
value: {
|
|
322
466
|
active,
|
|
323
|
-
onTabPress: value => onTabPress(value)
|
|
467
|
+
onTabPress: value => onTabPress(value),
|
|
468
|
+
densityProgress,
|
|
469
|
+
labelOpacity
|
|
324
470
|
},
|
|
325
|
-
children: /*#__PURE__*/
|
|
326
|
-
style: styles.container,
|
|
327
|
-
onLayout: onLayout,
|
|
471
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
328
472
|
accessibilityRole: "tablist",
|
|
329
473
|
...props,
|
|
330
|
-
children:
|
|
331
|
-
style: styles.
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
474
|
+
children: /*#__PURE__*/_jsxs(Animated.View, {
|
|
475
|
+
style: [styles.container, barStyle],
|
|
476
|
+
children: [children, RuntimeConstants.isAndroid ? /*#__PURE__*/_jsx(View, {
|
|
477
|
+
style: styles.fallbackBackground
|
|
478
|
+
}) : /*#__PURE__*/_jsx(BlurView, {
|
|
479
|
+
style: styles.blur,
|
|
480
|
+
blurAmount: theme.blur.lg,
|
|
481
|
+
blurType: colorScheme === 'dark' ? 'dark' : 'light',
|
|
482
|
+
overlayColor: colorScheme === 'dark' ? 'rgba(0,0,0,0.15)' : 'rgba(255,255,255,0.2)',
|
|
483
|
+
reducedTransparencyFallbackColor: styles.fallbackBackground.backgroundColor
|
|
484
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
485
|
+
style: styles.pillTrack,
|
|
486
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
487
|
+
style: [styles.pill, pillStyle]
|
|
488
|
+
})
|
|
489
|
+
})]
|
|
490
|
+
})
|
|
341
491
|
})
|
|
342
492
|
});
|
|
343
493
|
}
|
|
344
494
|
const useStyles = () => useStyleSheet(t => ({
|
|
345
495
|
container: {
|
|
346
|
-
minHeight: TAB_BAR_HEIGHT,
|
|
347
496
|
flexDirection: 'row',
|
|
348
497
|
justifyContent: 'center',
|
|
349
498
|
padding: t.spacings.s4,
|
|
@@ -371,32 +520,48 @@ const useStyles = () => useStyleSheet(t => ({
|
|
|
371
520
|
},
|
|
372
521
|
item: {
|
|
373
522
|
flex: 1,
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
justifyContent: 'center'
|
|
377
|
-
|
|
523
|
+
alignSelf: 'stretch',
|
|
524
|
+
marginVertical: -t.spacings.s4,
|
|
525
|
+
justifyContent: 'center'
|
|
526
|
+
},
|
|
527
|
+
itemContent: {
|
|
528
|
+
alignItems: 'center'
|
|
529
|
+
},
|
|
530
|
+
itemLabel: {
|
|
531
|
+
position: 'absolute',
|
|
532
|
+
top: ICON_SIZE + ICON_LABEL_GAP,
|
|
533
|
+
left: 0,
|
|
534
|
+
right: 0,
|
|
535
|
+
alignItems: 'center'
|
|
378
536
|
},
|
|
379
537
|
itemText: {
|
|
380
538
|
...t.typographies.body4,
|
|
381
|
-
paddingHorizontal: t.spacings.
|
|
539
|
+
paddingHorizontal: t.spacings.s8,
|
|
382
540
|
color: t.colors.text.base
|
|
383
541
|
},
|
|
384
542
|
itemIcon: {
|
|
385
543
|
position: 'absolute'
|
|
386
544
|
},
|
|
387
545
|
itemIconContainer: {
|
|
388
|
-
width:
|
|
389
|
-
height:
|
|
546
|
+
width: ICON_SIZE,
|
|
547
|
+
height: ICON_SIZE,
|
|
390
548
|
position: 'relative'
|
|
391
549
|
},
|
|
392
550
|
activeItemText: {
|
|
393
551
|
...t.typographies.body4SemiBold
|
|
394
552
|
},
|
|
395
|
-
|
|
553
|
+
pillTrack: {
|
|
396
554
|
position: 'absolute',
|
|
397
555
|
pointerEvents: 'none',
|
|
398
556
|
top: PILL_INSET,
|
|
557
|
+
bottom: PILL_INSET,
|
|
399
558
|
left: PILL_INSET,
|
|
559
|
+
right: PILL_INSET
|
|
560
|
+
},
|
|
561
|
+
pill: {
|
|
562
|
+
position: 'absolute',
|
|
563
|
+
top: 0,
|
|
564
|
+
bottom: 0,
|
|
400
565
|
borderRadius: t.borderRadius.full,
|
|
401
566
|
backgroundColor: t.colors.bg.mutedTransparent
|
|
402
567
|
}
|