@react-navigation/bottom-tabs 7.0.0-alpha.2 → 7.0.0-alpha.21

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 (102) hide show
  1. package/lib/commonjs/TransitionConfigs/SceneStyleInterpolators.js +47 -0
  2. package/lib/commonjs/TransitionConfigs/SceneStyleInterpolators.js.map +1 -0
  3. package/lib/commonjs/TransitionConfigs/TransitionPresets.js +17 -0
  4. package/lib/commonjs/TransitionConfigs/TransitionPresets.js.map +1 -0
  5. package/lib/commonjs/TransitionConfigs/TransitionSpecs.js +22 -0
  6. package/lib/commonjs/TransitionConfigs/TransitionSpecs.js.map +1 -0
  7. package/lib/commonjs/index.js +9 -0
  8. package/lib/commonjs/index.js.map +1 -1
  9. package/lib/commonjs/navigators/createBottomTabNavigator.js +11 -6
  10. package/lib/commonjs/navigators/createBottomTabNavigator.js.map +1 -1
  11. package/lib/commonjs/types.js.map +1 -1
  12. package/lib/commonjs/utils/BottomTabBarHeightCallbackContext.js +3 -4
  13. package/lib/commonjs/utils/BottomTabBarHeightCallbackContext.js.map +1 -1
  14. package/lib/commonjs/utils/BottomTabBarHeightContext.js +3 -4
  15. package/lib/commonjs/utils/BottomTabBarHeightContext.js.map +1 -1
  16. package/lib/commonjs/utils/useAnimatedHashMap.js +31 -0
  17. package/lib/commonjs/utils/useAnimatedHashMap.js.map +1 -0
  18. package/lib/commonjs/utils/useBottomTabBarHeight.js +2 -2
  19. package/lib/commonjs/utils/useBottomTabBarHeight.js.map +1 -1
  20. package/lib/commonjs/utils/useIsKeyboardShown.js +2 -2
  21. package/lib/commonjs/utils/useIsKeyboardShown.js.map +1 -1
  22. package/lib/commonjs/views/Badge.js +2 -2
  23. package/lib/commonjs/views/Badge.js.map +1 -1
  24. package/lib/commonjs/views/BottomTabBar.js +65 -27
  25. package/lib/commonjs/views/BottomTabBar.js.map +1 -1
  26. package/lib/commonjs/views/BottomTabItem.js +32 -54
  27. package/lib/commonjs/views/BottomTabItem.js.map +1 -1
  28. package/lib/commonjs/views/BottomTabView.js +120 -18
  29. package/lib/commonjs/views/BottomTabView.js.map +1 -1
  30. package/lib/commonjs/views/ScreenFallback.js +10 -14
  31. package/lib/commonjs/views/ScreenFallback.js.map +1 -1
  32. package/lib/commonjs/views/TabBarIcon.js +12 -17
  33. package/lib/commonjs/views/TabBarIcon.js.map +1 -1
  34. package/lib/module/TransitionConfigs/SceneStyleInterpolators.js +40 -0
  35. package/lib/module/TransitionConfigs/SceneStyleInterpolators.js.map +1 -0
  36. package/lib/module/TransitionConfigs/TransitionPresets.js +11 -0
  37. package/lib/module/TransitionConfigs/TransitionPresets.js.map +1 -0
  38. package/lib/module/TransitionConfigs/TransitionSpecs.js +16 -0
  39. package/lib/module/TransitionConfigs/TransitionSpecs.js.map +1 -0
  40. package/lib/module/index.js +9 -0
  41. package/lib/module/index.js.map +1 -1
  42. package/lib/module/navigators/createBottomTabNavigator.js +8 -2
  43. package/lib/module/navigators/createBottomTabNavigator.js.map +1 -1
  44. package/lib/module/types.js.map +1 -1
  45. package/lib/module/utils/BottomTabBarHeightCallbackContext.js.map +1 -1
  46. package/lib/module/utils/BottomTabBarHeightContext.js.map +1 -1
  47. package/lib/module/utils/useAnimatedHashMap.js +23 -0
  48. package/lib/module/utils/useAnimatedHashMap.js.map +1 -0
  49. package/lib/module/utils/useBottomTabBarHeight.js.map +1 -1
  50. package/lib/module/utils/useIsKeyboardShown.js.map +1 -1
  51. package/lib/module/views/Badge.js.map +1 -1
  52. package/lib/module/views/BottomTabBar.js +68 -30
  53. package/lib/module/views/BottomTabBar.js.map +1 -1
  54. package/lib/module/views/BottomTabItem.js +34 -56
  55. package/lib/module/views/BottomTabItem.js.map +1 -1
  56. package/lib/module/views/BottomTabView.js +119 -17
  57. package/lib/module/views/BottomTabView.js.map +1 -1
  58. package/lib/module/views/ScreenFallback.js +8 -12
  59. package/lib/module/views/ScreenFallback.js.map +1 -1
  60. package/lib/module/views/TabBarIcon.js +12 -17
  61. package/lib/module/views/TabBarIcon.js.map +1 -1
  62. package/lib/typescript/src/TransitionConfigs/SceneStyleInterpolators.d.ts +10 -0
  63. package/lib/typescript/src/TransitionConfigs/SceneStyleInterpolators.d.ts.map +1 -0
  64. package/lib/typescript/src/TransitionConfigs/TransitionPresets.d.ts +4 -0
  65. package/lib/typescript/src/TransitionConfigs/TransitionPresets.d.ts.map +1 -0
  66. package/lib/typescript/src/TransitionConfigs/TransitionSpecs.d.ts +4 -0
  67. package/lib/typescript/src/TransitionConfigs/TransitionSpecs.d.ts.map +1 -0
  68. package/lib/typescript/src/index.d.ts +8 -1
  69. package/lib/typescript/src/index.d.ts.map +1 -1
  70. package/lib/typescript/src/navigators/createBottomTabNavigator.d.ts +15 -9
  71. package/lib/typescript/src/navigators/createBottomTabNavigator.d.ts.map +1 -1
  72. package/lib/typescript/src/types.d.ts +71 -4
  73. package/lib/typescript/src/types.d.ts.map +1 -1
  74. package/lib/typescript/src/utils/useAnimatedHashMap.d.ts +4 -0
  75. package/lib/typescript/src/utils/useAnimatedHashMap.d.ts.map +1 -0
  76. package/lib/typescript/src/views/Badge.d.ts +3 -2
  77. package/lib/typescript/src/views/Badge.d.ts.map +1 -1
  78. package/lib/typescript/src/views/BottomTabBar.d.ts +5 -4
  79. package/lib/typescript/src/views/BottomTabBar.d.ts.map +1 -1
  80. package/lib/typescript/src/views/BottomTabItem.d.ts +3 -3
  81. package/lib/typescript/src/views/BottomTabItem.d.ts.map +1 -1
  82. package/lib/typescript/src/views/BottomTabView.d.ts +2 -1
  83. package/lib/typescript/src/views/BottomTabView.d.ts.map +1 -1
  84. package/lib/typescript/src/views/ScreenFallback.d.ts +5 -5
  85. package/lib/typescript/src/views/ScreenFallback.d.ts.map +1 -1
  86. package/lib/typescript/src/views/TabBarIcon.d.ts +2 -2
  87. package/lib/typescript/src/views/TabBarIcon.d.ts.map +1 -1
  88. package/package.json +17 -18
  89. package/src/TransitionConfigs/SceneStyleInterpolators.tsx +44 -0
  90. package/src/TransitionConfigs/TransitionPresets.tsx +13 -0
  91. package/src/TransitionConfigs/TransitionSpecs.tsx +19 -0
  92. package/src/index.tsx +10 -0
  93. package/src/navigators/createBottomTabNavigator.tsx +40 -12
  94. package/src/types.tsx +102 -5
  95. package/src/utils/useAnimatedHashMap.tsx +25 -0
  96. package/src/utils/useIsKeyboardShown.tsx +1 -1
  97. package/src/views/Badge.tsx +6 -1
  98. package/src/views/BottomTabBar.tsx +125 -47
  99. package/src/views/BottomTabItem.tsx +52 -82
  100. package/src/views/BottomTabView.tsx +163 -14
  101. package/src/views/ScreenFallback.tsx +12 -13
  102. package/src/views/TabBarIcon.tsx +16 -24
@@ -1,12 +1,41 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
  import { getHeaderTitle, Header, SafeAreaProviderCompat, Screen } from '@react-navigation/elements';
3
3
  import * as React from 'react';
4
- import { Platform, StyleSheet } from 'react-native';
4
+ import { Animated, Platform, StyleSheet } from 'react-native';
5
5
  import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
6
+ import { FadeTransition, ShiftTransition } from '../TransitionConfigs/TransitionPresets';
6
7
  import { BottomTabBarHeightCallbackContext } from '../utils/BottomTabBarHeightCallbackContext';
7
8
  import { BottomTabBarHeightContext } from '../utils/BottomTabBarHeightContext';
9
+ import { useAnimatedHashMap } from '../utils/useAnimatedHashMap';
8
10
  import { BottomTabBar, getTabBarHeight } from './BottomTabBar';
9
11
  import { MaybeScreen, MaybeScreenContainer } from './ScreenFallback';
12
+ const EPSILON = 1e-5;
13
+ const STATE_INACTIVE = 0;
14
+ const STATE_TRANSITIONING_OR_BELOW_TOP = 1;
15
+ const STATE_ON_TOP = 2;
16
+ const NAMED_TRANSITIONS_PRESETS = {
17
+ fade: FadeTransition,
18
+ shift: ShiftTransition,
19
+ none: {
20
+ sceneStyleInterpolator: undefined,
21
+ transitionSpec: {
22
+ animation: 'timing',
23
+ config: {
24
+ duration: 0
25
+ }
26
+ }
27
+ }
28
+ };
29
+ const hasAnimation = options => {
30
+ const {
31
+ animation,
32
+ transitionSpec
33
+ } = options;
34
+ if (animation) {
35
+ return animation !== 'none';
36
+ }
37
+ return !transitionSpec;
38
+ };
10
39
  export function BottomTabView(props) {
11
40
  const {
12
41
  tabBar = props => /*#__PURE__*/React.createElement(BottomTabBar, props),
@@ -18,10 +47,46 @@ export function BottomTabView(props) {
18
47
  sceneContainerStyle
19
48
  } = props;
20
49
  const focusedRouteKey = state.routes[state.index].key;
50
+
51
+ /**
52
+ * List of loaded tabs, tabs will be loaded when navigated to.
53
+ */
21
54
  const [loaded, setLoaded] = React.useState([focusedRouteKey]);
22
55
  if (!loaded.includes(focusedRouteKey)) {
56
+ // Set the current tab to be loaded if it was not loaded before
23
57
  setLoaded([...loaded, focusedRouteKey]);
24
58
  }
59
+ const previousRouteKeyRef = React.useRef(focusedRouteKey);
60
+ const tabAnims = useAnimatedHashMap(state);
61
+ React.useEffect(() => {
62
+ const previousRouteKey = previousRouteKeyRef.current;
63
+ previousRouteKeyRef.current = focusedRouteKey;
64
+ const animateToIndex = () => {
65
+ Animated.parallel(state.routes.map((route, index) => {
66
+ const {
67
+ options
68
+ } = descriptors[route.key];
69
+ const {
70
+ animation = 'none',
71
+ transitionSpec = NAMED_TRANSITIONS_PRESETS[animation].transitionSpec
72
+ } = options;
73
+ let spec = transitionSpec;
74
+ if (route.key !== previousRouteKey && route.key !== focusedRouteKey) {
75
+ // Don't animate if the screen is not previous one or new one
76
+ // This will avoid flicker for screens not involved in the transition
77
+ spec = NAMED_TRANSITIONS_PRESETS.none.transitionSpec;
78
+ }
79
+ spec = spec ?? NAMED_TRANSITIONS_PRESETS.none.transitionSpec;
80
+ const toValue = index === state.index ? 0 : index >= state.index ? 1 : -1;
81
+ return Animated[spec.animation](tabAnims[route.key], {
82
+ ...spec.config,
83
+ toValue,
84
+ useNativeDriver: true
85
+ });
86
+ }).filter(Boolean)).start();
87
+ };
88
+ animateToIndex();
89
+ }, [descriptors, focusedRouteKey, state.index, state.routes, tabAnims]);
25
90
  const dimensions = SafeAreaProviderCompat.initialMetrics.frame;
26
91
  const [tabBarHeight, setTabBarHeight] = React.useState(() => getTabBarHeight({
27
92
  state,
@@ -43,32 +108,44 @@ export function BottomTabView(props) {
43
108
  descriptors: descriptors,
44
109
  navigation: navigation,
45
110
  insets: {
46
- top: (safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.top) ?? (insets === null || insets === void 0 ? void 0 : insets.top) ?? 0,
47
- right: (safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.right) ?? (insets === null || insets === void 0 ? void 0 : insets.right) ?? 0,
48
- bottom: (safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.bottom) ?? (insets === null || insets === void 0 ? void 0 : insets.bottom) ?? 0,
49
- left: (safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.left) ?? (insets === null || insets === void 0 ? void 0 : insets.left) ?? 0
111
+ top: safeAreaInsets?.top ?? insets?.top ?? 0,
112
+ right: safeAreaInsets?.right ?? insets?.right ?? 0,
113
+ bottom: safeAreaInsets?.bottom ?? insets?.bottom ?? 0,
114
+ left: safeAreaInsets?.left ?? insets?.left ?? 0
50
115
  }
51
116
  }));
52
117
  };
53
118
  const {
54
119
  routes
55
120
  } = state;
56
- return /*#__PURE__*/React.createElement(SafeAreaProviderCompat, null, /*#__PURE__*/React.createElement(MaybeScreenContainer, {
121
+
122
+ // If there is no animation, we only have 2 states: visible and invisible
123
+ const hasTwoStates = !routes.some(route => hasAnimation(descriptors[route.key].options));
124
+ const {
125
+ tabBarPosition = 'bottom'
126
+ } = descriptors[focusedRouteKey].options;
127
+ return /*#__PURE__*/React.createElement(SafeAreaProviderCompat, {
128
+ style: tabBarPosition === 'left' ? styles.start : tabBarPosition === 'right' ? styles.end : null
129
+ }, tabBarPosition === 'top' ? /*#__PURE__*/React.createElement(BottomTabBarHeightCallbackContext.Provider, {
130
+ value: setTabBarHeight
131
+ }, renderTabBar()) : null, /*#__PURE__*/React.createElement(MaybeScreenContainer, {
57
132
  enabled: detachInactiveScreens,
58
- hasTwoStates: true,
59
- style: styles.container
133
+ hasTwoStates: hasTwoStates,
134
+ style: styles.screens
60
135
  }, routes.map((route, index) => {
61
136
  const descriptor = descriptors[route.key];
62
137
  const {
63
138
  lazy = true,
64
- unmountOnBlur
139
+ unmountOnBlur,
140
+ animation = 'none',
141
+ sceneStyleInterpolator = NAMED_TRANSITIONS_PRESETS[animation].sceneStyleInterpolator
65
142
  } = descriptor.options;
66
143
  const isFocused = state.index === index;
67
144
  if (unmountOnBlur && !isFocused) {
68
145
  return null;
69
146
  }
70
- if (lazy && !loaded.includes(route.key) && !isFocused) {
71
- // Don't render a lazy screen if we've never navigated to it
147
+ if (lazy && !loaded.includes(route.key) && !isFocused && !state.preloadedRouteKeys.includes(route.key)) {
148
+ // Don't render a lazy screen if we've never navigated to it or it wasn't preloaded
72
149
  return null;
73
150
  }
74
151
  const {
@@ -87,16 +164,35 @@ export function BottomTabView(props) {
87
164
  headerStatusBarHeight,
88
165
  headerTransparent
89
166
  } = descriptor.options;
167
+ const {
168
+ sceneStyle
169
+ } = sceneStyleInterpolator?.({
170
+ current: {
171
+ progress: tabAnims[route.key]
172
+ }
173
+ }) ?? {};
174
+ const animationEnabled = hasAnimation(descriptor.options);
175
+ const activityState = isFocused ? STATE_ON_TOP // the screen is on top after the transition
176
+ : animationEnabled // is animation is not enabled, immediately move to inactive state
177
+ ? tabAnims[route.key].interpolate({
178
+ inputRange: [0, 1 - EPSILON, 1],
179
+ outputRange: [STATE_TRANSITIONING_OR_BELOW_TOP,
180
+ // screen visible during transition
181
+ STATE_TRANSITIONING_OR_BELOW_TOP, STATE_INACTIVE // the screen is detached after transition
182
+ ],
183
+
184
+ extrapolate: 'extend'
185
+ }) : STATE_INACTIVE;
90
186
  return /*#__PURE__*/React.createElement(MaybeScreen, {
91
187
  key: route.key,
92
188
  style: [StyleSheet.absoluteFill, {
93
189
  zIndex: isFocused ? 0 : -1
94
190
  }],
95
- visible: isFocused,
191
+ active: activityState,
96
192
  enabled: detachInactiveScreens,
97
193
  freezeOnBlur: freezeOnBlur
98
194
  }, /*#__PURE__*/React.createElement(BottomTabBarHeightContext.Provider, {
99
- value: tabBarHeight
195
+ value: tabBarPosition === 'bottom' ? tabBarHeight : 0
100
196
  }, /*#__PURE__*/React.createElement(Screen, {
101
197
  focused: isFocused,
102
198
  route: descriptor.route,
@@ -110,14 +206,20 @@ export function BottomTabView(props) {
110
206
  navigation: descriptor.navigation,
111
207
  options: descriptor.options
112
208
  }),
113
- style: sceneContainerStyle
209
+ style: [sceneContainerStyle, animationEnabled && sceneStyle]
114
210
  }, descriptor.render())));
115
- })), /*#__PURE__*/React.createElement(BottomTabBarHeightCallbackContext.Provider, {
211
+ })), tabBarPosition !== 'top' ? /*#__PURE__*/React.createElement(BottomTabBarHeightCallbackContext.Provider, {
116
212
  value: setTabBarHeight
117
- }, renderTabBar()));
213
+ }, renderTabBar()) : null);
118
214
  }
119
215
  const styles = StyleSheet.create({
120
- container: {
216
+ start: {
217
+ flexDirection: 'row-reverse'
218
+ },
219
+ end: {
220
+ flexDirection: 'row'
221
+ },
222
+ screens: {
121
223
  flex: 1,
122
224
  overflow: 'hidden'
123
225
  }
@@ -1 +1 @@
1
- {"version":3,"names":["getHeaderTitle","Header","SafeAreaProviderCompat","Screen","React","Platform","StyleSheet","SafeAreaInsetsContext","BottomTabBarHeightCallbackContext","BottomTabBarHeightContext","BottomTabBar","getTabBarHeight","MaybeScreen","MaybeScreenContainer","BottomTabView","props","tabBar","state","navigation","descriptors","safeAreaInsets","detachInactiveScreens","OS","sceneContainerStyle","focusedRouteKey","routes","index","key","loaded","setLoaded","useState","includes","dimensions","initialMetrics","frame","tabBarHeight","setTabBarHeight","layout","width","height","insets","style","options","tabBarStyle","renderTabBar","top","right","bottom","left","styles","container","map","route","descriptor","lazy","unmountOnBlur","isFocused","freezeOnBlur","header","name","headerShown","headerStatusBarHeight","headerTransparent","absoluteFill","zIndex","render","create","flex","overflow"],"sourceRoot":"../../../src","sources":["views/BottomTabView.tsx"],"mappings":";AAAA,SACEA,cAAc,EACdC,MAAM,EACNC,sBAAsB,EACtBC,MAAM,QACD,4BAA4B;AAKnC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AACnD,SAASC,qBAAqB,QAAQ,gCAAgC;AAUtE,SAASC,iCAAiC,QAAQ,4CAA4C;AAC9F,SAASC,yBAAyB,QAAQ,oCAAoC;AAC9E,SAASC,YAAY,EAAEC,eAAe,QAAQ,gBAAgB;AAC9D,SAASC,WAAW,EAAEC,oBAAoB,QAAQ,kBAAkB;AAQpE,OAAO,SAASC,aAAa,CAACC,KAAY,EAAE;EAC1C,MAAM;IACJC,MAAM,GAAID,KAAwB,iBAAK,oBAAC,YAAY,EAAKA,KAAK,CAAI;IAClEE,KAAK;IACLC,UAAU;IACVC,WAAW;IACXC,cAAc;IACdC,qBAAqB,GAAGhB,QAAQ,CAACiB,EAAE,KAAK,KAAK,IAC3CjB,QAAQ,CAACiB,EAAE,KAAK,SAAS,IACzBjB,QAAQ,CAACiB,EAAE,KAAK,KAAK;IACvBC;EACF,CAAC,GAAGR,KAAK;EAET,MAAMS,eAAe,GAAGP,KAAK,CAACQ,MAAM,CAACR,KAAK,CAACS,KAAK,CAAC,CAACC,GAAG;EACrD,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGzB,KAAK,CAAC0B,QAAQ,CAAC,CAACN,eAAe,CAAC,CAAC;EAE7D,IAAI,CAACI,MAAM,CAACG,QAAQ,CAACP,eAAe,CAAC,EAAE;IACrCK,SAAS,CAAC,CAAC,GAAGD,MAAM,E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M,EAAER,SAAS,GAAG,CAAC,GAAG,CAAC;MAAE,CAAC,CAAE;MACjE,OAAO,EAAEA,SAAU;MACnB,OAAO,EAAEnC,qBAAsB;MAC/B,YAAY,EAAEoC;IAAa,gBAE3B,oBAAC,yBAAyB,CAAC,QAAQ;MAAC,KAAK,EAAEtB;IAAa,gBACtD,oBAAC,MAAM;MACL,OAAO,EAAEqB,SAAU;MACnB,KAAK,EAAEH,UAAU,CAACD,KAAM;MACxB,UAAU,EAAEC,UAAU,CAACnC,UAAW;MAClC,WAAW,EAAE0C,WAAY;MACzB,qBAAqB,EAAEC,qBAAsB;MAC7C,iBAAiB,EAAEC,iBAAkB;MACrC,MAAM,EAAEJ,MAAM,CAAC;QACbrB,MAAM,EAAEL,UAAU;QAClBoB,KAAK,EAAEC,UAAU,CAACD,KAAK;QACvBlC,UAAU,EACRmC,UAAU,CAACnC,UAAoD;QACjEwB,OAAO,EAAEW,UAAU,CAACX;MACtB,CAAC,CAAE;MACH,KAAK,EAAEnB;IAAoB,GAE1B8B,UAAU,CAACY,MAAM,EAAE,CACb,CAC0B,CACzB;EAElB,CAAC,CAAC,CACmB,eACvB,oBAAC,iCAAiC,CAAC,QAAQ;IAAC,KAAK,EAAE7B;EAAgB,GAChEQ,YAAY,EAAE,CAC4B,CACtB;AAE7B;AAEA,MAAMK,MAAM,GAAG3C,UAAU,CAAC4D,MAAM,CAAC;EAC/BhB,SAAS,EAAE;IACTiB,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["getHeaderTitle","Header","SafeAreaProviderCompat","Screen","React","Animated","Platform","StyleSheet","SafeAreaInsetsContext","FadeTransition","ShiftTransition","BottomTabBarHeightCallbackContext","BottomTabBarHeightContext","useAnimatedHashMap","BottomTabBar","getTabBarHeight","MaybeScreen","MaybeScreenContainer","EPSILON","STATE_INACTIVE","STATE_TRANSITIONING_OR_BELOW_TOP","STATE_ON_TOP","NAMED_TRANSITIONS_PRESETS","fade","shift","none","sceneStyleInterpolator","undefined","transitionSpec","animation","config","duration","hasAnimation","options","BottomTabView","props","tabBar","createElement","state","navigation","descriptors","safeAreaInsets","detachInactiveScreens","OS","sceneContainerStyle","focusedRouteKey","routes","index","key","loaded","setLoaded","useState","includes","previousRouteKeyRef","useRef","tabAnims","useEffect","previousRouteKey","current","animateToIndex","parallel","map","route","spec","toValue","useNativeDriver","filter","Boolean","start","dimensions","initialMetrics","frame","tabBarHeight","setTabBarHeight","layout","width","height","insets","style","tabBarStyle","renderTabBar","Consumer","top","right","bottom","left","hasTwoStates","some","tabBarPosition","styles","end","Provider","value","enabled","screens","descriptor","lazy","unmountOnBlur","isFocused","preloadedRouteKeys","freezeOnBlur","header","_ref","_extends","title","name","headerShown","headerStatusBarHeight","headerTransparent","sceneStyle","progress","animationEnabled","activityState","interpolate","inputRange","outputRange","extrapolate","absoluteFill","zIndex","active","focused","render","create","flexDirection","flex","overflow"],"sourceRoot":"../../../src","sources":["views/BottomTabView.tsx"],"mappings":";AAAA,SACEA,cAAc,EACdC,MAAM,EACNC,sBAAsB,EACtBC,MAAM,QACD,4BAA4B;AAKnC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AAC7D,SAASC,qBAAqB,QAAQ,gCAAgC;AAEtE,SACEC,cAAc,EACdC,eAAe,QACV,wCAAwC;AAU/C,SAASC,iCAAiC,QAAQ,4CAA4C;AAC9F,SAASC,yBAAyB,QAAQ,oCAAoC;AAC9E,SAASC,kBAAkB,QAAQ,6BAA6B;AAChE,SAASC,YAAY,EAAEC,eAAe,QAAQ,gBAAgB;AAC9D,SAASC,WAAW,EAAEC,oBAAoB,QAAQ,kBAAkB;AAQpE,MAAMC,OAAO,GAAG,IAAI;AACpB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,gCAAgC,GAAG,CAAC;AAC1C,MAAMC,YAAY,GAAG,CAAC;AA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AC;EAC/BtD,KAAK,EAAE;IACLuD,aAAa,EAAE;EACjB,CAAC;EACDjC,GAAG,EAAE;IACHiC,aAAa,EAAE;EACjB,CAAC;EACD7B,OAAO,EAAE;IACP8B,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC"}
@@ -1,5 +1,4 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import { ResourceSavingView } from '@react-navigation/elements';
3
2
  import * as React from 'react';
4
3
  import { View } from 'react-native';
5
4
  let Screens;
@@ -9,12 +8,11 @@ try {
9
8
  // Ignore
10
9
  }
11
10
  export const MaybeScreenContainer = _ref => {
12
- var _Screens, _Screens$screensEnabl;
13
11
  let {
14
12
  enabled,
15
13
  ...rest
16
14
  } = _ref;
17
- if ((_Screens = Screens) !== null && _Screens !== void 0 && (_Screens$screensEnabl = _Screens.screensEnabled) !== null && _Screens$screensEnabl !== void 0 && _Screens$screensEnabl.call(_Screens)) {
15
+ if (Screens?.screensEnabled?.()) {
18
16
  return /*#__PURE__*/React.createElement(Screens.ScreenContainer, _extends({
19
17
  enabled: enabled
20
18
  }, rest));
@@ -22,19 +20,17 @@ export const MaybeScreenContainer = _ref => {
22
20
  return /*#__PURE__*/React.createElement(View, rest);
23
21
  };
24
22
  export function MaybeScreen(_ref2) {
25
- var _Screens2, _Screens2$screensEnab;
26
23
  let {
27
- visible,
28
- children,
24
+ enabled,
25
+ active,
29
26
  ...rest
30
27
  } = _ref2;
31
- if ((_Screens2 = Screens) !== null && _Screens2 !== void 0 && (_Screens2$screensEnab = _Screens2.screensEnabled) !== null && _Screens2$screensEnab !== void 0 && _Screens2$screensEnab.call(_Screens2)) {
28
+ if (Screens?.screensEnabled?.()) {
32
29
  return /*#__PURE__*/React.createElement(Screens.Screen, _extends({
33
- activityState: visible ? 2 : 0
34
- }, rest), children);
30
+ enabled: enabled,
31
+ activityState: active
32
+ }, rest));
35
33
  }
36
- return /*#__PURE__*/React.createElement(ResourceSavingView, _extends({
37
- visible: visible
38
- }, rest), children);
34
+ return /*#__PURE__*/React.createElement(View, rest);
39
35
  }
40
36
  //# sourceMappingURL=ScreenFallback.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ResourceSavingView","React","View","Screens","require","e","MaybeScreenContainer","enabled","rest","screensEnabled","MaybeScreen","visible","children"],"sourceRoot":"../../../src","sources":["views/ScreenFallback.tsx"],"mappings":";AAAA,SAASA,kBAAkB,QAAQ,4BAA4B;AAC/D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAAoBC,IAAI,QAA8B,cAAc;AAUpE,IAAIC,OAA0D;AAE9D,IAAI;EACFA,OAAO,GAAGC,OAAO,CAAC,sBAAsB,CAAC;AAC3C,CAAC,CAAC,OAAOC,CAAC,EAAE;EACV;AAAA;AAGF,OAAO,MAAMC,oBAAoB,GAAG,QAO9B;EAAA;EAAA,IAP+B;IACnCC,OAAO;IACP,GAAGC;EAKL,CAAC;EACC,gBAAIL,OAAO,8DAAP,SAASM,cAAc,kDAAvB,oCAA2B,EAAE;IAC/B,oBAAO,oBAAC,OAAO,CAAC,eAAe;MAAC,OAAO,EAAEF;IAAQ,GAAKC,IAAI,EAAI;EAChE;EAEA,oBAAO,oBAAC,IAAI,EAAKA,IAAI,CAAI;AAC3B,CAAC;AAED,OAAO,SAASE,WAAW,QAAwC;EAAA;EAAA,IAAvC;IAAEC,OAAO;IAAEC,QAAQ;IAAE,GAAGJ;EAAY,CAAC;EAC/D,iBAAIL,OAAO,+DAAP,UAASM,cAAc,kDAAvB,qCAA2B,EAAE;IAC/B,oBACE,oBAAC,OAAO,CAAC,MAAM;MAAC,aAAa,EAAEE,OAAO,GAAG,CAAC,GAAG;IAAE,GAAKH,IAAI,GACrDI,QAAQ,CACM;EAErB;EAEA,oBACE,oBAAC,kBAAkB;IAAC,OAAO,EAAED;EAAQ,GAAKH,IAAI,GAC3CI,QAAQ,CACU;AAEzB"}
1
+ {"version":3,"names":["React","View","Screens","require","e","MaybeScreenContainer","_ref","enabled","rest","screensEnabled","createElement","ScreenContainer","_extends","MaybeScreen","_ref2","active","Screen","activityState"],"sourceRoot":"../../../src","sources":["views/ScreenFallback.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAGEC,IAAI,QAGC,cAAc;AAUrB,IAAIC,OAA0D;AAE9D,IAAI;EACFA,OAAO,GAAGC,OAAO,CAAC,sBAAsB,CAAC;AAC3C,CAAC,CAAC,OAAOC,CAAC,EAAE;EACV;AAAA;AAGF,OAAO,MAAMC,oBAAoB,GAAGC,IAAA,IAO9B;EAAA,IAP+B;IACnCC,OAAO;IACP,GAAGC;EAKL,CAAC,GAAAF,IAAA;EACC,IAAIJ,OAAO,EAAEO,cAAc,GAAG,CAAC,EAAE;IAC/B,oBAAOT,KAAA,CAAAU,aAAA,CAACR,OAAO,CAACS,eAAe,EAAAC,QAAA;MAACL,OAAO,EAAEA;IAAQ,GAAKC,IAAI,CAAG,CAAC;EAChE;EAEA,oBAAOR,KAAA,CAAAU,aAAA,CAACT,IAAI,EAAKO,IAAO,CAAC;AAC3B,CAAC;AAED,OAAO,SAASK,WAAWA,CAAAC,KAAA,EAAkD;EAAA,IAAjD;IAAEP,OAAO;IAAEQ,MAAM;IAAE,GAAGP;EAAwB,CAAC,GAAAM,KAAA;EACzE,IAAIZ,OAAO,EAAEO,cAAc,GAAG,CAAC,EAAE;IAC/B,oBACET,KAAA,CAAAU,aAAA,CAACR,OAAO,CAACc,MAAM,EAAAJ,QAAA;MAACL,OAAO,EAAEA,OAAQ;MAACU,aAAa,EAAEF;IAAO,GAAKP,IAAI,CAAG,CAAC;EAEzE;EAEA,oBAAOR,KAAA,CAAAU,aAAA,CAACT,IAAI,EAAKO,IAAO,CAAC;AAC3B"}
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
3
  import { Badge } from './Badge';
4
+ const ICON_SIZE = 25;
4
5
  export function TabBarIcon(_ref) {
5
6
  let {
6
7
  route: _,
@@ -14,8 +15,6 @@ export function TabBarIcon(_ref) {
14
15
  renderIcon,
15
16
  style
16
17
  } = _ref;
17
- const size = 25;
18
-
19
18
  // We render the icon twice at the same position on top of each other:
20
19
  // active and inactive one, so we can fade between them.
21
20
  return /*#__PURE__*/React.createElement(View, {
@@ -26,7 +25,7 @@ export function TabBarIcon(_ref) {
26
25
  }]
27
26
  }, renderIcon({
28
27
  focused: true,
29
- size,
28
+ size: ICON_SIZE,
30
29
  color: activeTintColor
31
30
  })), /*#__PURE__*/React.createElement(View, {
32
31
  style: [styles.icon, {
@@ -34,12 +33,12 @@ export function TabBarIcon(_ref) {
34
33
  }]
35
34
  }, renderIcon({
36
35
  focused: false,
37
- size,
36
+ size: ICON_SIZE,
38
37
  color: inactiveTintColor
39
38
  })), /*#__PURE__*/React.createElement(Badge, {
40
39
  visible: badge != null,
41
- style: [styles.badge, horizontal ? styles.badgeHorizontal : styles.badgeVertical, badgeStyle],
42
- size: size * 3 / 4
40
+ style: [styles.badge, badgeStyle],
41
+ size: ICON_SIZE * 0.75
43
42
  }, badge));
44
43
  }
45
44
  const styles = StyleSheet.create({
@@ -54,24 +53,20 @@ const styles = StyleSheet.create({
54
53
  height: '100%',
55
54
  width: '100%',
56
55
  // Workaround for react-native >= 0.54 layout bug
57
- minWidth: 25
56
+ minWidth: ICON_SIZE
58
57
  },
59
58
  iconVertical: {
60
- flex: 1
59
+ width: ICON_SIZE,
60
+ height: ICON_SIZE
61
61
  },
62
62
  iconHorizontal: {
63
- height: '100%',
64
- marginTop: 3
63
+ width: ICON_SIZE,
64
+ height: ICON_SIZE
65
65
  },
66
66
  badge: {
67
67
  position: 'absolute',
68
- left: 3
69
- },
70
- badgeVertical: {
71
- top: 3
72
- },
73
- badgeHorizontal: {
74
- top: 7
68
+ end: -5,
69
+ top: -5
75
70
  }
76
71
  });
77
72
  //# sourceMappingURL=TabBarIcon.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","StyleSheet","View","Badge","TabBarIcon","route","_","horizontal","badge","badgeStyle","activeOpacity","inactiveOpacity","activeTintColor","inactiveTintColor","renderIcon","style","size","styles","iconHorizontal","iconVertical","icon","opacity","focused","color","badgeHorizontal","badgeVertical","create","position","alignSelf","alignItems","justifyContent","height","width","minWidth","flex","marginTop","left","top"],"sourceRoot":"../../../src","sources":["views/TabBarIcon.tsx"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAEEC,UAAU,EAEVC,IAAI,QAEC,cAAc;AAErB,SAASC,KAAK,QAAQ,SAAS;AAmB/B,OAAO,SAASC,UAAU,OAWhB;EAAA,IAXiB;IACzBC,KAAK,EAAEC,CAAC;IACRC,UAAU;IACVC,KAAK;IACLC,UAAU;IACVC,aAAa;IACbC,eAAe;IACfC,eAAe;IACfC,iBAAiB;IACjBC,UAAU;IACVC;EACK,CAAC;EACN,MAAMC,IAAI,GAAG,EAAE;;EAEf;EACA;EACA,oBACE,oBAAC,IAAI;IACH,KAAK,EAAE,CAACT,UAAU,GAAGU,MAAM,CAACC,cAAc,GAAGD,MAAM,CAACE,YAAY,EAAEJ,KAAK;EAAE,gBAEzE,oBAAC,IAAI;IAAC,KAAK,EAAE,CAACE,MAAM,CAACG,IAAI,EAAE;MAAEC,OAAO,EAAEX;IAAc,CAAC;EAAE,GACpDI,UAAU,CAAC;IACVQ,OAAO,EAAE,IAAI;IACbN,IAAI;IACJO,KAAK,EAAEX;EACT,CAAC,CAAC,CACG,eACP,oBAAC,IAAI;IAAC,KAAK,EAAE,CAACK,MAAM,CAACG,IAAI,EAAE;MAAEC,OAAO,EAAEV;IAAgB,CAAC;EAAE,GACtDG,UAAU,CAAC;IACVQ,OAAO,EAAE,KAAK;IACdN,IAAI;IACJO,KAAK,EAAEV;EACT,CAAC,CAAC,CACG,eACP,oBAAC,KAAK;IACJ,OAAO,EAAEL,KAAK,IAAI,IAAK;IACvB,KAAK,EAAE,CACLS,MAAM,CAACT,KAAK,EACZD,UAAU,GAAGU,MAAM,CAACO,eAAe,GAAGP,MAAM,CAACQ,aAAa,EAC1DhB,UAAU,CACV;IACF,IAAI,EAAGO,IAAI,GAAG,CAAC,GAAI;EAAE,GAEpBR,KAAK,CACA,CACH;AAEX;AAEA,MAAMS,MAAM,GAAGhB,UAAU,CAACyB,MAAM,CAAC;EAC/BN,IAAI,EAAE;IACJ;IACA;IACA;IACAO,QAAQ,EAAE,UAAU;IACpBC,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE,MAAM;IACb;IACAC,QAAQ,EAAE;EACZ,CAAC;EACDd,YAAY,EAAE;IACZe,IAAI,EAAE;EACR,CAAC;EACDhB,cAAc,EAAE;IACda,MAAM,EAAE,MAAM;IACdI,SAAS,EAAE;EACb,CAAC;EACD3B,KAAK,EAAE;IACLmB,QAAQ,EAAE,UAAU;IACpBS,IAAI,EAAE;EACR,CAAC;EACDX,aAAa,EAAE;IACbY,GAAG,EAAE;EACP,CAAC;EACDb,eAAe,EAAE;IACfa,GAAG,EAAE;EACP;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["React","StyleSheet","View","Badge","ICON_SIZE","TabBarIcon","_ref","route","_","horizontal","badge","badgeStyle","activeOpacity","inactiveOpacity","activeTintColor","inactiveTintColor","renderIcon","style","createElement","styles","iconHorizontal","iconVertical","icon","opacity","focused","size","color","visible","create","position","alignSelf","alignItems","justifyContent","height","width","minWidth","end","top"],"sourceRoot":"../../../src","sources":["views/TabBarIcon.tsx"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAEEC,UAAU,EAEVC,IAAI,QAEC,cAAc;AAErB,SAASC,KAAK,QAAQ,SAAS;AAmB/B,MAA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nBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE,MAAM;IACb;IACAC,QAAQ,EAAE/B;EACZ,CAAC;EACDiB,YAAY,EAAE;IACZa,KAAK,EAAE9B,SAAS;IAChB6B,MAAM,EAAE7B;EACV,CAAC;EACDgB,cAAc,EAAE;IACdc,KAAK,EAAE9B,SAAS;IAChB6B,MAAM,EAAE7B;EACV,CAAC;EACDM,KAAK,EAAE;IACLmB,QAAQ,EAAE,UAAU;IACpBO,GAAG,EAAE,CAAC,CAAC;IACPC,GAAG,EAAE,CAAC;EACR;AACF,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { BottomTabSceneInterpolatedStyle, BottomTabSceneInterpolationProps } from '../types';
2
+ /**
3
+ * Simple cross fade animation
4
+ */
5
+ export declare function forFade({ current, }: BottomTabSceneInterpolationProps): BottomTabSceneInterpolatedStyle;
6
+ /**
7
+ * Animation where the screens slightly shift to left/right
8
+ */
9
+ export declare function forShift({ current, }: BottomTabSceneInterpolationProps): BottomTabSceneInterpolatedStyle;
10
+ //# sourceMappingURL=SceneStyleInterpolators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SceneStyleInterpolators.d.ts","sourceRoot":"","sources":["../../../../src/TransitionConfigs/SceneStyleInterpolators.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,+BAA+B,EAC/B,gCAAgC,EACjC,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,wBAAgB,OAAO,CAAC,EACtB,OAAO,GACR,EAAE,gCAAgC,GAAG,+BAA+B,CASpE;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EACvB,OAAO,GACR,EAAE,gCAAgC,GAAG,+BAA+B,CAiBpE"}
@@ -0,0 +1,4 @@
1
+ import type { BottomTabTransitionPreset } from '../types';
2
+ export declare const FadeTransition: BottomTabTransitionPreset;
3
+ export declare const ShiftTransition: BottomTabTransitionPreset;
4
+ //# sourceMappingURL=TransitionPresets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransitionPresets.d.ts","sourceRoot":"","sources":["../../../../src/TransitionConfigs/TransitionPresets.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAI1D,eAAO,MAAM,cAAc,EAAE,yBAG5B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,yBAG7B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { TransitionSpec } from '../types';
2
+ export declare const FadeSpec: TransitionSpec;
3
+ export declare const ShiftSpec: TransitionSpec;
4
+ //# sourceMappingURL=TransitionSpecs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransitionSpecs.d.ts","sourceRoot":"","sources":["../../../../src/TransitionConfigs/TransitionSpecs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,eAAO,MAAM,QAAQ,EAAE,cAMtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,cAMvB,CAAC"}
@@ -1,3 +1,10 @@
1
+ import * as SceneStyleInterpolators from './TransitionConfigs/SceneStyleInterpolators';
2
+ import * as TransitionPresets from './TransitionConfigs/TransitionPresets';
3
+ import * as TransitionSpecs from './TransitionConfigs/TransitionSpecs';
4
+ /**
5
+ * Transition Presets
6
+ */
7
+ export { SceneStyleInterpolators, TransitionPresets, TransitionSpecs };
1
8
  /**
2
9
  * Navigators
3
10
  */
@@ -16,5 +23,5 @@ export { useBottomTabBarHeight } from './utils/useBottomTabBarHeight';
16
23
  /**
17
24
  * Types
18
25
  */
19
- export type { BottomTabBarButtonProps, BottomTabBarProps, BottomTabHeaderProps, BottomTabNavigationEventMap, BottomTabNavigationOptions, BottomTabNavigationProp, BottomTabScreenProps, } from './types';
26
+ export type { BottomTabBarButtonProps, BottomTabBarProps, BottomTabHeaderProps, BottomTabNavigationEventMap, BottomTabNavigationOptions, BottomTabNavigationProp, BottomTabOptionsArgs, BottomTabScreenProps, } from './types';
20
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAEjF;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;GAEG;AACH,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE;;GAEG;AACH,YAAY,EACV,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,uBAAuB,MAAM,6CAA6C,CAAC;AACvF,OAAO,KAAK,iBAAiB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AAEvE;;GAEG;AACH,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,eAAe,EAAE,CAAC;AAEvE;;GAEG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAEjF;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;GAEG;AACH,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE;;GAEG;AACH,YAAY,EACV,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
@@ -1,12 +1,18 @@
1
- import { DefaultNavigatorOptions, ParamListBase, TabNavigationState, TabRouterOptions } from '@react-navigation/native';
2
- import type { BottomTabNavigationConfig, BottomTabNavigationEventMap, BottomTabNavigationOptions } from '../types';
3
- type Props = DefaultNavigatorOptions<ParamListBase, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap> & TabRouterOptions & BottomTabNavigationConfig;
4
- declare function BottomTabNavigator({ id, initialRouteName, backBehavior, children, screenListeners, screenOptions, sceneContainerStyle, ...rest }: Props): JSX.Element;
5
- export declare const createBottomTabNavigator: {
6
- <ParamList extends ParamListBase>(): import("@react-navigation/native").TypedNavigator<ParamList, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap, typeof BottomTabNavigator>;
7
- <ParamList_1 extends ParamListBase, Config extends import("packages/core/lib/typescript/src/StaticNavigation").StaticConfig<ParamList_1, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap, typeof BottomTabNavigator>>(config: Config): import("@react-navigation/native").TypedNavigator<ParamList_1, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap, typeof BottomTabNavigator> & {
8
- config: Config;
1
+ import { type DefaultNavigatorOptions, type NavigatorTypeBagBase, type ParamListBase, type StaticConfig, type TabNavigationState, type TabRouterOptions, type TypedNavigator } from '@react-navigation/native';
2
+ import * as React from 'react';
3
+ import type { BottomTabNavigationConfig, BottomTabNavigationEventMap, BottomTabNavigationOptions, BottomTabNavigationProp } from '../types';
4
+ type Props = DefaultNavigatorOptions<ParamListBase, string | undefined, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap, BottomTabNavigationProp<ParamListBase>> & TabRouterOptions & BottomTabNavigationConfig;
5
+ declare function BottomTabNavigator({ id, initialRouteName, backBehavior, children, layout, screenListeners, screenOptions, sceneContainerStyle, UNSTABLE_getStateForRouteNamesChange, ...rest }: Props): React.JSX.Element;
6
+ export declare function createBottomTabNavigator<ParamList extends ParamListBase, NavigatorID extends string | undefined = undefined, TypeBag extends NavigatorTypeBagBase = {
7
+ ParamList: ParamList;
8
+ NavigatorID: NavigatorID;
9
+ State: TabNavigationState<ParamList>;
10
+ ScreenOptions: BottomTabNavigationOptions;
11
+ EventMap: BottomTabNavigationEventMap;
12
+ NavigationList: {
13
+ [RouteName in keyof ParamList]: BottomTabNavigationProp<ParamList, RouteName, NavigatorID>;
9
14
  };
10
- };
15
+ Navigator: typeof BottomTabNavigator;
16
+ }, Config extends StaticConfig<TypeBag> | undefined = StaticConfig<TypeBag> | undefined>(config?: Config): TypedNavigator<TypeBag, Config>;
11
17
  export {};
12
18
  //# sourceMappingURL=createBottomTabNavigator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createBottomTabNavigator.d.ts","sourceRoot":"","sources":["../../../../src/navigators/createBottomTabNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EACvB,aAAa,EAEb,kBAAkB,EAElB,gBAAgB,EAEjB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EACV,yBAAyB,EACzB,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,UAAU,CAAC;AAGlB,KAAK,KAAK,GAAG,uBAAuB,CAClC,aAAa,EACb,kBAAkB,CAAC,aAAa,CAAC,EACjC,0BAA0B,EAC1B,2BAA2B,CAC5B,GACC,gBAAgB,GAChB,yBAAyB,CAAC;AAE5B,iBAAS,kBAAkB,CAAC,EAC1B,EAAE,EACF,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,GAAG,IAAI,EACR,EAAE,KAAK,eA4BP;AAED,eAAO,MAAM,wBAAwB;;;;;CAKhB,CAAC"}
1
+ {"version":3,"file":"createBottomTabNavigator.d.ts","sourceRoot":"","sources":["../../../../src/navigators/createBottomTabNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,YAAY,EAEjB,KAAK,kBAAkB,EAEvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACV,yBAAyB,EACzB,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,UAAU,CAAC;AAGlB,KAAK,KAAK,GAAG,uBAAuB,CAClC,aAAa,EACb,MAAM,GAAG,SAAS,EAClB,kBAAkB,CAAC,aAAa,CAAC,EACjC,0BAA0B,EAC1B,2BAA2B,EAC3B,uBAAuB,CAAC,aAAa,CAAC,CACvC,GACC,gBAAgB,GAChB,yBAAyB,CAAC;AAE5B,iBAAS,kBAAkB,CAAC,EAC1B,EAAE,EACF,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,oCAAoC,EACpC,GAAG,IAAI,EACR,EAAE,KAAK,qBA8BP;AAED,wBAAgB,wBAAwB,CACtC,SAAS,SAAS,aAAa,EAC/B,WAAW,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EAClD,OAAO,SAAS,oBAAoB,GAAG;IACrC,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACrC,aAAa,EAAE,0BAA0B,CAAC;IAC1C,QAAQ,EAAE,2BAA2B,CAAC;IACtC,cAAc,EAAE;SACb,SAAS,IAAI,MAAM,SAAS,GAAG,uBAAuB,CACrD,SAAS,EACT,SAAS,EACT,WAAW,CACZ;KACF,CAAC;IACF,SAAS,EAAE,OAAO,kBAAkB,CAAC;CACtC,EACD,MAAM,SAAS,YAAY,CAAC,OAAO,CAAC,GAAG,SAAS,GAC5C,YAAY,CAAC,OAAO,CAAC,GACrB,SAAS,EACb,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAElD"}
@@ -1,7 +1,7 @@
1
- import type { HeaderOptions } from '@react-navigation/elements';
2
- import type { Descriptor, NavigationHelpers, NavigationProp, ParamListBase, RouteProp, TabActionHelpers, TabNavigationState } from '@react-navigation/native';
1
+ import type { HeaderOptions, PlatformPressable } from '@react-navigation/elements';
2
+ import type { Descriptor, NavigationHelpers, NavigationProp, ParamListBase, RouteProp, TabActionHelpers, TabNavigationState, Theme } from '@react-navigation/native';
3
3
  import type * as React from 'react';
4
- import type { Animated, GestureResponderEvent, StyleProp, TextStyle, TouchableWithoutFeedbackProps, ViewStyle } from 'react-native';
4
+ import type { Animated, GestureResponderEvent, StyleProp, TextStyle, ViewStyle } from 'react-native';
5
5
  import type { EdgeInsets } from 'react-native-safe-area-context';
6
6
  export type Layout = {
7
7
  width: number;
@@ -29,6 +29,9 @@ export type BottomTabScreenProps<ParamList extends ParamListBase, RouteName exte
29
29
  navigation: BottomTabNavigationProp<ParamList, RouteName, NavigatorID>;
30
30
  route: RouteProp<ParamList, RouteName>;
31
31
  };
32
+ export type BottomTabOptionsArgs<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = BottomTabScreenProps<ParamList, RouteName, NavigatorID> & {
33
+ theme: Theme;
34
+ };
32
35
  export type TimingKeyboardAnimationConfig = {
33
36
  animation: 'timing';
34
37
  config?: Omit<Partial<Animated.TimingAnimationConfig>, 'toValue' | 'useNativeDriver'>;
@@ -38,6 +41,7 @@ export type SpringKeyboardAnimationConfig = {
38
41
  config?: Omit<Partial<Animated.SpringAnimationConfig>, 'toValue' | 'useNativeDriver'>;
39
42
  };
40
43
  export type TabBarVisibilityAnimationConfig = TimingKeyboardAnimationConfig | SpringKeyboardAnimationConfig;
44
+ export type TabAnimationName = 'none' | 'fade' | 'shift';
41
45
  export type BottomTabNavigationOptions = HeaderOptions & {
42
46
  /**
43
47
  * Title text for the screen.
@@ -154,6 +158,10 @@ export type BottomTabNavigationOptions = HeaderOptions & {
154
158
  * You'd also need to use `useBottomTabBarHeight()` to add a bottom padding to your content.
155
159
  */
156
160
  tabBarBackground?: () => React.ReactNode;
161
+ /**
162
+ * Position of the tab bar on the screen. Defaults to `bottom`.
163
+ */
164
+ tabBarPosition?: 'bottom' | 'left' | 'right' | 'top';
157
165
  /**
158
166
  * Whether this screens should render the first time it's accessed. Defaults to `true`.
159
167
  * Set it to `false` if you want to render the screen on initial render.
@@ -181,9 +189,68 @@ export type BottomTabNavigationOptions = HeaderOptions & {
181
189
  * Only supported on iOS and Android.
182
190
  */
183
191
  freezeOnBlur?: boolean;
192
+ /**
193
+ * How the screen should animate when switching tabs.
194
+ *
195
+ * Supported values:
196
+ * - 'none': don't animate the screen (default)
197
+ * - 'fade': cross-fade the screens.
198
+ * - 'shift': shift the screens slightly shift to left/right.
199
+ */
200
+ animation?: TabAnimationName;
201
+ /**
202
+ * Function which specifies interpolated styles for bottom-tab scenes.
203
+ */
204
+ sceneStyleInterpolator?: BottomTabSceneStyleInterpolator;
205
+ /**
206
+ * Object which specifies the animation type (timing or spring) and their options (such as duration for timing).
207
+ */
208
+ transitionSpec?: TransitionSpec;
184
209
  };
185
210
  export type BottomTabDescriptor = Descriptor<BottomTabNavigationOptions, BottomTabNavigationProp<ParamListBase>, RouteProp<ParamListBase>>;
186
211
  export type BottomTabDescriptorMap = Record<string, BottomTabDescriptor>;
212
+ export type BottomTabSceneInterpolationProps = {
213
+ /**
214
+ * Values for the current screen.
215
+ */
216
+ current: {
217
+ /**
218
+ * Animated value for the current screen:
219
+ * - -1 if the index is lower than active tab,
220
+ * - 0 if they're active,
221
+ * - 1 if the index is higher than active tab
222
+ */
223
+ progress: Animated.Value;
224
+ };
225
+ };
226
+ export type BottomTabSceneInterpolatedStyle = {
227
+ /**
228
+ * Interpolated style for the view representing the scene containing screen content.
229
+ */
230
+ sceneStyle: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
231
+ };
232
+ export type BottomTabSceneStyleInterpolator = (props: BottomTabSceneInterpolationProps) => BottomTabSceneInterpolatedStyle;
233
+ export type TransitionSpec = {
234
+ animation: 'timing';
235
+ config: Omit<Animated.TimingAnimationConfig, 'toValue' | keyof Animated.AnimationConfig>;
236
+ } | {
237
+ animation: 'spring';
238
+ config: Omit<Animated.SpringAnimationConfig, 'toValue' | keyof Animated.AnimationConfig>;
239
+ };
240
+ export type BottomTabTransitionPreset = {
241
+ /**
242
+ * Whether transition animations should be enabled when switching tabs.
243
+ */
244
+ animationEnabled?: boolean;
245
+ /**
246
+ * Function which specifies interpolated styles for bottom-tab scenes.
247
+ */
248
+ sceneStyleInterpolator?: BottomTabSceneStyleInterpolator;
249
+ /**
250
+ * Object which specifies the animation type (timing or spring) and their options (such as duration for timing).
251
+ */
252
+ transitionSpec?: TransitionSpec;
253
+ };
187
254
  export type BottomTabNavigationConfig = {
188
255
  /**
189
256
  * Function that returns a React element to display as the tab bar.
@@ -234,7 +301,7 @@ export type BottomTabBarProps = {
234
301
  navigation: NavigationHelpers<ParamListBase, BottomTabNavigationEventMap>;
235
302
  insets: EdgeInsets;
236
303
  };
237
- export type BottomTabBarButtonProps = Omit<TouchableWithoutFeedbackProps, 'onPress'> & {
304
+ export type BottomTabBarButtonProps = Omit<React.ComponentProps<typeof PlatformPressable>, 'onPress'> & {
238
305
  href?: string;
239
306
  children: React.ReactNode;
240
307
  onPress?: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent) => void;