@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.
- package/lib/commonjs/TransitionConfigs/SceneStyleInterpolators.js +47 -0
- package/lib/commonjs/TransitionConfigs/SceneStyleInterpolators.js.map +1 -0
- package/lib/commonjs/TransitionConfigs/TransitionPresets.js +17 -0
- package/lib/commonjs/TransitionConfigs/TransitionPresets.js.map +1 -0
- package/lib/commonjs/TransitionConfigs/TransitionSpecs.js +22 -0
- package/lib/commonjs/TransitionConfigs/TransitionSpecs.js.map +1 -0
- package/lib/commonjs/index.js +9 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigators/createBottomTabNavigator.js +11 -6
- package/lib/commonjs/navigators/createBottomTabNavigator.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/BottomTabBarHeightCallbackContext.js +3 -4
- package/lib/commonjs/utils/BottomTabBarHeightCallbackContext.js.map +1 -1
- package/lib/commonjs/utils/BottomTabBarHeightContext.js +3 -4
- package/lib/commonjs/utils/BottomTabBarHeightContext.js.map +1 -1
- package/lib/commonjs/utils/useAnimatedHashMap.js +31 -0
- package/lib/commonjs/utils/useAnimatedHashMap.js.map +1 -0
- package/lib/commonjs/utils/useBottomTabBarHeight.js +2 -2
- package/lib/commonjs/utils/useBottomTabBarHeight.js.map +1 -1
- package/lib/commonjs/utils/useIsKeyboardShown.js +2 -2
- package/lib/commonjs/utils/useIsKeyboardShown.js.map +1 -1
- package/lib/commonjs/views/Badge.js +2 -2
- package/lib/commonjs/views/Badge.js.map +1 -1
- package/lib/commonjs/views/BottomTabBar.js +65 -27
- package/lib/commonjs/views/BottomTabBar.js.map +1 -1
- package/lib/commonjs/views/BottomTabItem.js +32 -54
- package/lib/commonjs/views/BottomTabItem.js.map +1 -1
- package/lib/commonjs/views/BottomTabView.js +120 -18
- package/lib/commonjs/views/BottomTabView.js.map +1 -1
- package/lib/commonjs/views/ScreenFallback.js +10 -14
- package/lib/commonjs/views/ScreenFallback.js.map +1 -1
- package/lib/commonjs/views/TabBarIcon.js +12 -17
- package/lib/commonjs/views/TabBarIcon.js.map +1 -1
- package/lib/module/TransitionConfigs/SceneStyleInterpolators.js +40 -0
- package/lib/module/TransitionConfigs/SceneStyleInterpolators.js.map +1 -0
- package/lib/module/TransitionConfigs/TransitionPresets.js +11 -0
- package/lib/module/TransitionConfigs/TransitionPresets.js.map +1 -0
- package/lib/module/TransitionConfigs/TransitionSpecs.js +16 -0
- package/lib/module/TransitionConfigs/TransitionSpecs.js.map +1 -0
- package/lib/module/index.js +9 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigators/createBottomTabNavigator.js +8 -2
- package/lib/module/navigators/createBottomTabNavigator.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/BottomTabBarHeightCallbackContext.js.map +1 -1
- package/lib/module/utils/BottomTabBarHeightContext.js.map +1 -1
- package/lib/module/utils/useAnimatedHashMap.js +23 -0
- package/lib/module/utils/useAnimatedHashMap.js.map +1 -0
- package/lib/module/utils/useBottomTabBarHeight.js.map +1 -1
- package/lib/module/utils/useIsKeyboardShown.js.map +1 -1
- package/lib/module/views/Badge.js.map +1 -1
- package/lib/module/views/BottomTabBar.js +68 -30
- package/lib/module/views/BottomTabBar.js.map +1 -1
- package/lib/module/views/BottomTabItem.js +34 -56
- package/lib/module/views/BottomTabItem.js.map +1 -1
- package/lib/module/views/BottomTabView.js +119 -17
- package/lib/module/views/BottomTabView.js.map +1 -1
- package/lib/module/views/ScreenFallback.js +8 -12
- package/lib/module/views/ScreenFallback.js.map +1 -1
- package/lib/module/views/TabBarIcon.js +12 -17
- package/lib/module/views/TabBarIcon.js.map +1 -1
- package/lib/typescript/src/TransitionConfigs/SceneStyleInterpolators.d.ts +10 -0
- package/lib/typescript/src/TransitionConfigs/SceneStyleInterpolators.d.ts.map +1 -0
- package/lib/typescript/src/TransitionConfigs/TransitionPresets.d.ts +4 -0
- package/lib/typescript/src/TransitionConfigs/TransitionPresets.d.ts.map +1 -0
- package/lib/typescript/src/TransitionConfigs/TransitionSpecs.d.ts +4 -0
- package/lib/typescript/src/TransitionConfigs/TransitionSpecs.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +8 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/navigators/createBottomTabNavigator.d.ts +15 -9
- package/lib/typescript/src/navigators/createBottomTabNavigator.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +71 -4
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/useAnimatedHashMap.d.ts +4 -0
- package/lib/typescript/src/utils/useAnimatedHashMap.d.ts.map +1 -0
- package/lib/typescript/src/views/Badge.d.ts +3 -2
- package/lib/typescript/src/views/Badge.d.ts.map +1 -1
- package/lib/typescript/src/views/BottomTabBar.d.ts +5 -4
- package/lib/typescript/src/views/BottomTabBar.d.ts.map +1 -1
- package/lib/typescript/src/views/BottomTabItem.d.ts +3 -3
- package/lib/typescript/src/views/BottomTabItem.d.ts.map +1 -1
- package/lib/typescript/src/views/BottomTabView.d.ts +2 -1
- package/lib/typescript/src/views/BottomTabView.d.ts.map +1 -1
- package/lib/typescript/src/views/ScreenFallback.d.ts +5 -5
- package/lib/typescript/src/views/ScreenFallback.d.ts.map +1 -1
- package/lib/typescript/src/views/TabBarIcon.d.ts +2 -2
- package/lib/typescript/src/views/TabBarIcon.d.ts.map +1 -1
- package/package.json +17 -18
- package/src/TransitionConfigs/SceneStyleInterpolators.tsx +44 -0
- package/src/TransitionConfigs/TransitionPresets.tsx +13 -0
- package/src/TransitionConfigs/TransitionSpecs.tsx +19 -0
- package/src/index.tsx +10 -0
- package/src/navigators/createBottomTabNavigator.tsx +40 -12
- package/src/types.tsx +102 -5
- package/src/utils/useAnimatedHashMap.tsx +25 -0
- package/src/utils/useIsKeyboardShown.tsx +1 -1
- package/src/views/Badge.tsx +6 -1
- package/src/views/BottomTabBar.tsx +125 -47
- package/src/views/BottomTabItem.tsx +52 -82
- package/src/views/BottomTabView.tsx +163 -14
- package/src/views/ScreenFallback.tsx +12 -13
- package/src/views/TabBarIcon.tsx +16 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,EACN,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EACV,QAAQ,EACR,qBAAqB,EACrB,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEjE,MAAM,MAAM,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvD,MAAM,MAAM,2BAA2B,GAAG;IACxC;;OAEG;IACH,QAAQ,EAAE;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,iBAAiB,EAAE,IAAI,CAAA;KAAE,CAAC;IACvD;;OAEG;IACH,YAAY,EAAE;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,YAAY,CAAC;AAEzD,MAAM,MAAM,0BAA0B,GAAG,iBAAiB,CACxD,aAAa,EACb,2BAA2B,CAC5B,GACC,gBAAgB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useAnimatedHashMap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,eAAe,kCAoBpE"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Animated, type StyleProp, type TextStyle } from 'react-native';
|
|
2
3
|
type Props = {
|
|
3
4
|
/**
|
|
4
5
|
* Whether the badge is visible
|
|
@@ -17,6 +18,6 @@ type Props = {
|
|
|
17
18
|
*/
|
|
18
19
|
style?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;
|
|
19
20
|
};
|
|
20
|
-
export declare function Badge({ children, style, visible, size, ...rest }: Props): JSX.Element | null;
|
|
21
|
+
export declare function Badge({ children, style, visible, size, ...rest }: Props): React.JSX.Element | null;
|
|
21
22
|
export {};
|
|
22
23
|
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../src/views/Badge.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../src/views/Badge.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,QAAQ,EACR,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,KAAK,KAAK,GAAG;IACX;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;CAC1D,CAAC;AAEF,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,KAAK,EACL,OAAc,EACd,IAAS,EACT,GAAG,IAAI,EACR,EAAE,KAAK,4BAuEP"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ParamListBase, TabNavigationState } from '@react-navigation/native';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { type ParamListBase, type TabNavigationState } from '@react-navigation/native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Animated, type StyleProp, type ViewStyle } from 'react-native';
|
|
4
|
+
import type { EdgeInsets } from 'react-native-safe-area-context';
|
|
4
5
|
import type { BottomTabBarProps, BottomTabDescriptorMap } from '../types';
|
|
5
6
|
type Props = BottomTabBarProps & {
|
|
6
7
|
style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
|
|
@@ -21,6 +22,6 @@ export declare const getTabBarHeight: ({ state, descriptors, dimensions, insets,
|
|
|
21
22
|
insets: EdgeInsets;
|
|
22
23
|
style: Animated.WithAnimatedValue<StyleProp<ViewStyle>> | undefined;
|
|
23
24
|
}) => number;
|
|
24
|
-
export declare function BottomTabBar({ state, navigation, descriptors, insets, style, }: Props): JSX.Element;
|
|
25
|
+
export declare function BottomTabBar({ state, navigation, descriptors, insets, style, }: Props): React.JSX.Element;
|
|
25
26
|
export {};
|
|
26
27
|
//# sourceMappingURL=BottomTabBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomTabBar.d.ts","sourceRoot":"","sources":["../../../../src/views/BottomTabBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BottomTabBar.d.ts","sourceRoot":"","sources":["../../../../src/views/BottomTabBar.tsx"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAGxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,QAAQ,EAGR,KAAK,SAAS,EAId,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAK1E,KAAK,KAAK,GAAG,iBAAiB,GAAG;IAC/B,KAAK,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;CAC1D,CAAC;AASF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;IACzC,WAAW,EAAE,sBAAsB,CAAC;IACpC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,UAAU,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C,CAAC;AA8CF,eAAO,MAAM,eAAe;YAQlB,UAAU;WACX,SAAS,iBAAiB,CAAC,UAAU,SAAS,CAAC,CAAC,GAAG,SAAS;YA+BpE,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,UAAU,EACV,WAAW,EACX,MAAM,EACN,KAAK,GACN,EAAE,KAAK,qBA+RP"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Route } from '@react-navigation/native';
|
|
1
|
+
import { type Route } from '@react-navigation/native';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { GestureResponderEvent, StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import { type GestureResponderEvent, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';
|
|
4
4
|
import type { BottomTabBarButtonProps, BottomTabDescriptor, LabelPosition } from '../types';
|
|
5
5
|
type Props = {
|
|
6
6
|
/**
|
|
@@ -45,7 +45,7 @@ type Props = {
|
|
|
45
45
|
*/
|
|
46
46
|
badgeStyle?: StyleProp<TextStyle>;
|
|
47
47
|
/**
|
|
48
|
-
* The button for the tab. Uses a `
|
|
48
|
+
* The button for the tab. Uses a `Pressable` by default.
|
|
49
49
|
*/
|
|
50
50
|
button?: (props: BottomTabBarButtonProps) => React.ReactNode;
|
|
51
51
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomTabItem.d.ts","sourceRoot":"","sources":["../../../../src/views/BottomTabItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BottomTabItem.d.ts","sourceRoot":"","sources":["../../../../src/views/BottomTabItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,KAAK,EAAY,MAAM,0BAA0B,CAAC;AAEhE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,KAAK,qBAAqB,EAE1B,KAAK,SAAS,EAEd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,EACd,MAAM,UAAU,CAAC;AAGlB,KAAK,KAAK,GAAG;IACX;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,UAAU,EAAE,mBAAmB,CAAC;IAChC;;OAEG;IACH,KAAK,EACD,MAAM,GACN,CAAC,CAAC,KAAK,EAAE;QACP,OAAO,EAAE,OAAO,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,aAAa,CAAC;QACxB,QAAQ,EAAE,MAAM,CAAC;KAClB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAC3B;;OAEG;IACH,IAAI,EAAE,CAAC,KAAK,EAAE;QACZ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KAAK,EACL,IAAI,EACJ,OAAO,EACP,UAAU,EACV,KAAK,EACL,IAAI,EACJ,KAAK,EACL,UAAU,EACV,MAqBC,EACD,kBAAkB,EAClB,MAAM,EACN,OAAO,EACP,WAAW,EACX,UAAU,EACV,eAAe,EAAE,qBAAqB,EACtC,iBAAiB,EAAE,uBAAuB,EAC1C,qBAAqC,EACrC,uBAAuC,EACvC,SAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,KAAK,GACN,EAAE,KAAK,sEA6GP"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { ParamListBase, TabNavigationState } from '@react-navigation/native';
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import type { BottomTabDescriptorMap, BottomTabNavigationConfig, BottomTabNavigationHelpers } from '../types';
|
|
3
4
|
type Props = BottomTabNavigationConfig & {
|
|
4
5
|
state: TabNavigationState<ParamListBase>;
|
|
5
6
|
navigation: BottomTabNavigationHelpers;
|
|
6
7
|
descriptors: BottomTabDescriptorMap;
|
|
7
8
|
};
|
|
8
|
-
export declare function BottomTabView(props: Props): JSX.Element;
|
|
9
|
+
export declare function BottomTabView(props: Props): React.JSX.Element;
|
|
9
10
|
export {};
|
|
10
11
|
//# sourceMappingURL=BottomTabView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomTabView.d.ts","sourceRoot":"","sources":["../../../../src/views/BottomTabView.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"BottomTabView.d.ts","sourceRoot":"","sources":["../../../../src/views/BottomTabView.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,KAAK,EAEV,sBAAsB,EAEtB,yBAAyB,EACzB,0BAA0B,EAG3B,MAAM,UAAU,CAAC;AAOlB,KAAK,KAAK,GAAG,yBAAyB,GAAG;IACvC,KAAK,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;IACzC,UAAU,EAAE,0BAA0B,CAAC;IACvC,WAAW,EAAE,sBAAsB,CAAC;CACrC,CAAC;AA6BF,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,qBA+OzC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
2
|
+
import { Animated, type StyleProp, type ViewProps, type ViewStyle } from 'react-native';
|
|
3
3
|
type Props = {
|
|
4
|
-
visible: boolean;
|
|
5
|
-
children: React.ReactNode;
|
|
6
4
|
enabled: boolean;
|
|
5
|
+
active: 0 | 1 | 2 | Animated.AnimatedInterpolation<0 | 1>;
|
|
6
|
+
children: React.ReactNode;
|
|
7
7
|
freezeOnBlur?: boolean;
|
|
8
8
|
style?: StyleProp<ViewStyle>;
|
|
9
9
|
};
|
|
@@ -11,7 +11,7 @@ export declare const MaybeScreenContainer: ({ enabled, ...rest }: ViewProps & {
|
|
|
11
11
|
enabled: boolean;
|
|
12
12
|
hasTwoStates: boolean;
|
|
13
13
|
children: React.ReactNode;
|
|
14
|
-
}) => JSX.Element;
|
|
15
|
-
export declare function MaybeScreen({
|
|
14
|
+
}) => React.JSX.Element;
|
|
15
|
+
export declare function MaybeScreen({ enabled, active, ...rest }: ViewProps & Props): React.JSX.Element;
|
|
16
16
|
export {};
|
|
17
17
|
//# sourceMappingURL=ScreenFallback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenFallback.d.ts","sourceRoot":"","sources":["../../../../src/views/ScreenFallback.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScreenFallback.d.ts","sourceRoot":"","sources":["../../../../src/views/ScreenFallback.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,QAAQ,EACR,KAAK,SAAS,EAEd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAUF,eAAO,MAAM,oBAAoB;aAItB,OAAO;kBACF,OAAO;cACX,MAAM,SAAS;uBAO1B,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,GAAG,KAAK,qBAQ1E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Route } from '@react-navigation/native';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import { type StyleProp, type TextStyle, type ViewStyle } from 'react-native';
|
|
4
4
|
type Props = {
|
|
5
5
|
route: Route<string>;
|
|
6
6
|
horizontal: boolean;
|
|
@@ -17,6 +17,6 @@ type Props = {
|
|
|
17
17
|
}) => React.ReactNode;
|
|
18
18
|
style: StyleProp<ViewStyle>;
|
|
19
19
|
};
|
|
20
|
-
export declare function TabBarIcon({ route, horizontal, badge, badgeStyle, activeOpacity, inactiveOpacity, activeTintColor, inactiveTintColor, renderIcon, style, }: Props): JSX.Element;
|
|
20
|
+
export declare function TabBarIcon({ route, horizontal, badge, badgeStyle, activeOpacity, inactiveOpacity, activeTintColor, inactiveTintColor, renderIcon, style, }: Props): React.JSX.Element;
|
|
21
21
|
export {};
|
|
22
22
|
//# sourceMappingURL=TabBarIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBarIcon.d.ts","sourceRoot":"","sources":["../../../../src/views/TabBarIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,SAAS,
|
|
1
|
+
{"version":3,"file":"TabBarIcon.d.ts","sourceRoot":"","sources":["../../../../src/views/TabBarIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAItB,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,CAAC,KAAK,EAAE;QAClB,OAAO,EAAE,OAAO,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC7B,CAAC;AAIF,wBAAgB,UAAU,CAAC,EACzB,KAAQ,EACR,UAAU,EACV,KAAK,EACL,UAAU,EACV,aAAa,EACb,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,UAAU,EACV,KAAK,GACN,EAAE,KAAK,qBA8BP"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-navigation/bottom-tabs",
|
|
3
3
|
"description": "Bottom tab navigator following iOS design guidelines",
|
|
4
|
-
"version": "7.0.0-alpha.
|
|
4
|
+
"version": "7.0.0-alpha.21",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native-component",
|
|
7
7
|
"react-component",
|
|
@@ -36,28 +36,27 @@
|
|
|
36
36
|
"clean": "del lib"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-navigation/elements": "^
|
|
39
|
+
"@react-navigation/elements": "^2.0.0-alpha.16",
|
|
40
40
|
"color": "^4.2.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@react-navigation/native": "^7.0.0-alpha.
|
|
44
|
-
"@testing-library/react-native": "^
|
|
45
|
-
"@types/color": "^3.0.
|
|
46
|
-
"@types/react": "~18.
|
|
47
|
-
"
|
|
48
|
-
"del-cli": "^5.0.0",
|
|
43
|
+
"@react-navigation/native": "^7.0.0-alpha.18",
|
|
44
|
+
"@testing-library/react-native": "^12.4.3",
|
|
45
|
+
"@types/color": "^3.0.6",
|
|
46
|
+
"@types/react": "~18.2.45",
|
|
47
|
+
"del-cli": "^5.1.0",
|
|
49
48
|
"react": "18.2.0",
|
|
50
|
-
"react-native": "0.
|
|
51
|
-
"react-native-builder-bob": "^0.
|
|
52
|
-
"react-native-safe-area-context": "4.
|
|
53
|
-
"react-native-screens": "~3.
|
|
54
|
-
"typescript": "^
|
|
49
|
+
"react-native": "0.73.2",
|
|
50
|
+
"react-native-builder-bob": "^0.23.2",
|
|
51
|
+
"react-native-safe-area-context": "4.8.2",
|
|
52
|
+
"react-native-screens": "~3.29.0",
|
|
53
|
+
"typescript": "^5.3.3"
|
|
55
54
|
},
|
|
56
55
|
"peerDependencies": {
|
|
57
|
-
"@react-navigation/native": "^
|
|
58
|
-
"react": "
|
|
59
|
-
"react-native": "
|
|
60
|
-
"react-native-safe-area-context": ">=
|
|
56
|
+
"@react-navigation/native": "^7.0.0-alpha.18",
|
|
57
|
+
"react": ">= 18.2.0",
|
|
58
|
+
"react-native": ">= 0.72.0",
|
|
59
|
+
"react-native-safe-area-context": ">= 4.0.0",
|
|
61
60
|
"react-native-screens": ">= 3.0.0"
|
|
62
61
|
},
|
|
63
62
|
"react-native-builder-bob": {
|
|
@@ -74,5 +73,5 @@
|
|
|
74
73
|
]
|
|
75
74
|
]
|
|
76
75
|
},
|
|
77
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "7ed2bc19da336560ddd07002954a4ebba4d03929"
|
|
78
77
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
BottomTabSceneInterpolatedStyle,
|
|
3
|
+
BottomTabSceneInterpolationProps,
|
|
4
|
+
} from '../types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Simple cross fade animation
|
|
8
|
+
*/
|
|
9
|
+
export function forFade({
|
|
10
|
+
current,
|
|
11
|
+
}: BottomTabSceneInterpolationProps): BottomTabSceneInterpolatedStyle {
|
|
12
|
+
return {
|
|
13
|
+
sceneStyle: {
|
|
14
|
+
opacity: current.progress.interpolate({
|
|
15
|
+
inputRange: [-1, 0, 1],
|
|
16
|
+
outputRange: [0, 1, 0],
|
|
17
|
+
}),
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Animation where the screens slightly shift to left/right
|
|
24
|
+
*/
|
|
25
|
+
export function forShift({
|
|
26
|
+
current,
|
|
27
|
+
}: BottomTabSceneInterpolationProps): BottomTabSceneInterpolatedStyle {
|
|
28
|
+
return {
|
|
29
|
+
sceneStyle: {
|
|
30
|
+
opacity: current.progress.interpolate({
|
|
31
|
+
inputRange: [-1, 0, 1],
|
|
32
|
+
outputRange: [0, 1, 0],
|
|
33
|
+
}),
|
|
34
|
+
transform: [
|
|
35
|
+
{
|
|
36
|
+
translateX: current.progress.interpolate({
|
|
37
|
+
inputRange: [-1, 0, 1],
|
|
38
|
+
outputRange: [-50, 0, 50],
|
|
39
|
+
}),
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BottomTabTransitionPreset } from '../types';
|
|
2
|
+
import { forFade, forShift } from './SceneStyleInterpolators';
|
|
3
|
+
import { FadeSpec, ShiftSpec } from './TransitionSpecs';
|
|
4
|
+
|
|
5
|
+
export const FadeTransition: BottomTabTransitionPreset = {
|
|
6
|
+
transitionSpec: FadeSpec,
|
|
7
|
+
sceneStyleInterpolator: forFade,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const ShiftTransition: BottomTabTransitionPreset = {
|
|
11
|
+
transitionSpec: ShiftSpec,
|
|
12
|
+
sceneStyleInterpolator: forShift,
|
|
13
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Easing } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { TransitionSpec } from '../types';
|
|
4
|
+
|
|
5
|
+
export const FadeSpec: TransitionSpec = {
|
|
6
|
+
animation: 'timing',
|
|
7
|
+
config: {
|
|
8
|
+
duration: 150,
|
|
9
|
+
easing: Easing.in(Easing.linear),
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const ShiftSpec: TransitionSpec = {
|
|
14
|
+
animation: 'timing',
|
|
15
|
+
config: {
|
|
16
|
+
duration: 150,
|
|
17
|
+
easing: Easing.inOut(Easing.ease),
|
|
18
|
+
},
|
|
19
|
+
};
|
package/src/index.tsx
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import * as SceneStyleInterpolators from './TransitionConfigs/SceneStyleInterpolators';
|
|
2
|
+
import * as TransitionPresets from './TransitionConfigs/TransitionPresets';
|
|
3
|
+
import * as TransitionSpecs from './TransitionConfigs/TransitionSpecs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Transition Presets
|
|
7
|
+
*/
|
|
8
|
+
export { SceneStyleInterpolators, TransitionPresets, TransitionSpecs };
|
|
9
|
+
|
|
1
10
|
/**
|
|
2
11
|
* Navigators
|
|
3
12
|
*/
|
|
@@ -26,5 +35,6 @@ export type {
|
|
|
26
35
|
BottomTabNavigationEventMap,
|
|
27
36
|
BottomTabNavigationOptions,
|
|
28
37
|
BottomTabNavigationProp,
|
|
38
|
+
BottomTabOptionsArgs,
|
|
29
39
|
BottomTabScreenProps,
|
|
30
40
|
} from './types';
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createNavigatorFactory,
|
|
3
|
-
DefaultNavigatorOptions,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
type DefaultNavigatorOptions,
|
|
4
|
+
type NavigatorTypeBagBase,
|
|
5
|
+
type ParamListBase,
|
|
6
|
+
type StaticConfig,
|
|
7
|
+
type TabActionHelpers,
|
|
8
|
+
type TabNavigationState,
|
|
7
9
|
TabRouter,
|
|
8
|
-
TabRouterOptions,
|
|
10
|
+
type TabRouterOptions,
|
|
11
|
+
type TypedNavigator,
|
|
9
12
|
useNavigationBuilder,
|
|
10
13
|
} from '@react-navigation/native';
|
|
11
14
|
import * as React from 'react';
|
|
@@ -14,14 +17,17 @@ import type {
|
|
|
14
17
|
BottomTabNavigationConfig,
|
|
15
18
|
BottomTabNavigationEventMap,
|
|
16
19
|
BottomTabNavigationOptions,
|
|
20
|
+
BottomTabNavigationProp,
|
|
17
21
|
} from '../types';
|
|
18
22
|
import { BottomTabView } from '../views/BottomTabView';
|
|
19
23
|
|
|
20
24
|
type Props = DefaultNavigatorOptions<
|
|
21
25
|
ParamListBase,
|
|
26
|
+
string | undefined,
|
|
22
27
|
TabNavigationState<ParamListBase>,
|
|
23
28
|
BottomTabNavigationOptions,
|
|
24
|
-
BottomTabNavigationEventMap
|
|
29
|
+
BottomTabNavigationEventMap,
|
|
30
|
+
BottomTabNavigationProp<ParamListBase>
|
|
25
31
|
> &
|
|
26
32
|
TabRouterOptions &
|
|
27
33
|
BottomTabNavigationConfig;
|
|
@@ -31,9 +37,11 @@ function BottomTabNavigator({
|
|
|
31
37
|
initialRouteName,
|
|
32
38
|
backBehavior,
|
|
33
39
|
children,
|
|
40
|
+
layout,
|
|
34
41
|
screenListeners,
|
|
35
42
|
screenOptions,
|
|
36
43
|
sceneContainerStyle,
|
|
44
|
+
UNSTABLE_getStateForRouteNamesChange,
|
|
37
45
|
...rest
|
|
38
46
|
}: Props) {
|
|
39
47
|
const { state, descriptors, navigation, NavigationContent } =
|
|
@@ -48,8 +56,10 @@ function BottomTabNavigator({
|
|
|
48
56
|
initialRouteName,
|
|
49
57
|
backBehavior,
|
|
50
58
|
children,
|
|
59
|
+
layout,
|
|
51
60
|
screenListeners,
|
|
52
61
|
screenOptions,
|
|
62
|
+
UNSTABLE_getStateForRouteNamesChange,
|
|
53
63
|
});
|
|
54
64
|
|
|
55
65
|
return (
|
|
@@ -65,9 +75,27 @@ function BottomTabNavigator({
|
|
|
65
75
|
);
|
|
66
76
|
}
|
|
67
77
|
|
|
68
|
-
export
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
78
|
+
export function createBottomTabNavigator<
|
|
79
|
+
ParamList extends ParamListBase,
|
|
80
|
+
NavigatorID extends string | undefined = undefined,
|
|
81
|
+
TypeBag extends NavigatorTypeBagBase = {
|
|
82
|
+
ParamList: ParamList;
|
|
83
|
+
NavigatorID: NavigatorID;
|
|
84
|
+
State: TabNavigationState<ParamList>;
|
|
85
|
+
ScreenOptions: BottomTabNavigationOptions;
|
|
86
|
+
EventMap: BottomTabNavigationEventMap;
|
|
87
|
+
NavigationList: {
|
|
88
|
+
[RouteName in keyof ParamList]: BottomTabNavigationProp<
|
|
89
|
+
ParamList,
|
|
90
|
+
RouteName,
|
|
91
|
+
NavigatorID
|
|
92
|
+
>;
|
|
93
|
+
};
|
|
94
|
+
Navigator: typeof BottomTabNavigator;
|
|
95
|
+
},
|
|
96
|
+
Config extends StaticConfig<TypeBag> | undefined =
|
|
97
|
+
| StaticConfig<TypeBag>
|
|
98
|
+
| undefined,
|
|
99
|
+
>(config?: Config): TypedNavigator<TypeBag, Config> {
|
|
100
|
+
return createNavigatorFactory(BottomTabNavigator)(config);
|
|
101
|
+
}
|
package/src/types.tsx
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
HeaderOptions,
|
|
3
|
+
PlatformPressable,
|
|
4
|
+
} from '@react-navigation/elements';
|
|
2
5
|
import type {
|
|
3
6
|
Descriptor,
|
|
4
7
|
NavigationHelpers,
|
|
@@ -7,6 +10,7 @@ import type {
|
|
|
7
10
|
RouteProp,
|
|
8
11
|
TabActionHelpers,
|
|
9
12
|
TabNavigationState,
|
|
13
|
+
Theme,
|
|
10
14
|
} from '@react-navigation/native';
|
|
11
15
|
import type * as React from 'react';
|
|
12
16
|
import type {
|
|
@@ -14,7 +18,6 @@ import type {
|
|
|
14
18
|
GestureResponderEvent,
|
|
15
19
|
StyleProp,
|
|
16
20
|
TextStyle,
|
|
17
|
-
TouchableWithoutFeedbackProps,
|
|
18
21
|
ViewStyle,
|
|
19
22
|
} from 'react-native';
|
|
20
23
|
import type { EdgeInsets } from 'react-native-safe-area-context';
|
|
@@ -43,7 +46,7 @@ export type BottomTabNavigationHelpers = NavigationHelpers<
|
|
|
43
46
|
export type BottomTabNavigationProp<
|
|
44
47
|
ParamList extends ParamListBase,
|
|
45
48
|
RouteName extends keyof ParamList = keyof ParamList,
|
|
46
|
-
NavigatorID extends string | undefined = undefined
|
|
49
|
+
NavigatorID extends string | undefined = undefined,
|
|
47
50
|
> = NavigationProp<
|
|
48
51
|
ParamList,
|
|
49
52
|
RouteName,
|
|
@@ -57,12 +60,20 @@ export type BottomTabNavigationProp<
|
|
|
57
60
|
export type BottomTabScreenProps<
|
|
58
61
|
ParamList extends ParamListBase,
|
|
59
62
|
RouteName extends keyof ParamList = keyof ParamList,
|
|
60
|
-
NavigatorID extends string | undefined = undefined
|
|
63
|
+
NavigatorID extends string | undefined = undefined,
|
|
61
64
|
> = {
|
|
62
65
|
navigation: BottomTabNavigationProp<ParamList, RouteName, NavigatorID>;
|
|
63
66
|
route: RouteProp<ParamList, RouteName>;
|
|
64
67
|
};
|
|
65
68
|
|
|
69
|
+
export type BottomTabOptionsArgs<
|
|
70
|
+
ParamList extends ParamListBase,
|
|
71
|
+
RouteName extends keyof ParamList = keyof ParamList,
|
|
72
|
+
NavigatorID extends string | undefined = undefined,
|
|
73
|
+
> = BottomTabScreenProps<ParamList, RouteName, NavigatorID> & {
|
|
74
|
+
theme: Theme;
|
|
75
|
+
};
|
|
76
|
+
|
|
66
77
|
export type TimingKeyboardAnimationConfig = {
|
|
67
78
|
animation: 'timing';
|
|
68
79
|
config?: Omit<
|
|
@@ -83,6 +94,8 @@ export type TabBarVisibilityAnimationConfig =
|
|
|
83
94
|
| TimingKeyboardAnimationConfig
|
|
84
95
|
| SpringKeyboardAnimationConfig;
|
|
85
96
|
|
|
97
|
+
export type TabAnimationName = 'none' | 'fade' | 'shift';
|
|
98
|
+
|
|
86
99
|
export type BottomTabNavigationOptions = HeaderOptions & {
|
|
87
100
|
/**
|
|
88
101
|
* Title text for the screen.
|
|
@@ -223,6 +236,11 @@ export type BottomTabNavigationOptions = HeaderOptions & {
|
|
|
223
236
|
*/
|
|
224
237
|
tabBarBackground?: () => React.ReactNode;
|
|
225
238
|
|
|
239
|
+
/**
|
|
240
|
+
* Position of the tab bar on the screen. Defaults to `bottom`.
|
|
241
|
+
*/
|
|
242
|
+
tabBarPosition?: 'bottom' | 'left' | 'right' | 'top';
|
|
243
|
+
|
|
226
244
|
/**
|
|
227
245
|
* Whether this screens should render the first time it's accessed. Defaults to `true`.
|
|
228
246
|
* Set it to `false` if you want to render the screen on initial render.
|
|
@@ -254,6 +272,26 @@ export type BottomTabNavigationOptions = HeaderOptions & {
|
|
|
254
272
|
* Only supported on iOS and Android.
|
|
255
273
|
*/
|
|
256
274
|
freezeOnBlur?: boolean;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* How the screen should animate when switching tabs.
|
|
278
|
+
*
|
|
279
|
+
* Supported values:
|
|
280
|
+
* - 'none': don't animate the screen (default)
|
|
281
|
+
* - 'fade': cross-fade the screens.
|
|
282
|
+
* - 'shift': shift the screens slightly shift to left/right.
|
|
283
|
+
*/
|
|
284
|
+
animation?: TabAnimationName;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Function which specifies interpolated styles for bottom-tab scenes.
|
|
288
|
+
*/
|
|
289
|
+
sceneStyleInterpolator?: BottomTabSceneStyleInterpolator;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Object which specifies the animation type (timing or spring) and their options (such as duration for timing).
|
|
293
|
+
*/
|
|
294
|
+
transitionSpec?: TransitionSpec;
|
|
257
295
|
};
|
|
258
296
|
|
|
259
297
|
export type BottomTabDescriptor = Descriptor<
|
|
@@ -264,6 +302,65 @@ export type BottomTabDescriptor = Descriptor<
|
|
|
264
302
|
|
|
265
303
|
export type BottomTabDescriptorMap = Record<string, BottomTabDescriptor>;
|
|
266
304
|
|
|
305
|
+
export type BottomTabSceneInterpolationProps = {
|
|
306
|
+
/**
|
|
307
|
+
* Values for the current screen.
|
|
308
|
+
*/
|
|
309
|
+
current: {
|
|
310
|
+
/**
|
|
311
|
+
* Animated value for the current screen:
|
|
312
|
+
* - -1 if the index is lower than active tab,
|
|
313
|
+
* - 0 if they're active,
|
|
314
|
+
* - 1 if the index is higher than active tab
|
|
315
|
+
*/
|
|
316
|
+
progress: Animated.Value;
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
export type BottomTabSceneInterpolatedStyle = {
|
|
321
|
+
/**
|
|
322
|
+
* Interpolated style for the view representing the scene containing screen content.
|
|
323
|
+
*/
|
|
324
|
+
sceneStyle: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
export type BottomTabSceneStyleInterpolator = (
|
|
328
|
+
props: BottomTabSceneInterpolationProps
|
|
329
|
+
) => BottomTabSceneInterpolatedStyle;
|
|
330
|
+
|
|
331
|
+
export type TransitionSpec =
|
|
332
|
+
| {
|
|
333
|
+
animation: 'timing';
|
|
334
|
+
config: Omit<
|
|
335
|
+
Animated.TimingAnimationConfig,
|
|
336
|
+
'toValue' | keyof Animated.AnimationConfig
|
|
337
|
+
>;
|
|
338
|
+
}
|
|
339
|
+
| {
|
|
340
|
+
animation: 'spring';
|
|
341
|
+
config: Omit<
|
|
342
|
+
Animated.SpringAnimationConfig,
|
|
343
|
+
'toValue' | keyof Animated.AnimationConfig
|
|
344
|
+
>;
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
export type BottomTabTransitionPreset = {
|
|
348
|
+
/**
|
|
349
|
+
* Whether transition animations should be enabled when switching tabs.
|
|
350
|
+
*/
|
|
351
|
+
animationEnabled?: boolean;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Function which specifies interpolated styles for bottom-tab scenes.
|
|
355
|
+
*/
|
|
356
|
+
sceneStyleInterpolator?: BottomTabSceneStyleInterpolator;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Object which specifies the animation type (timing or spring) and their options (such as duration for timing).
|
|
360
|
+
*/
|
|
361
|
+
transitionSpec?: TransitionSpec;
|
|
362
|
+
};
|
|
363
|
+
|
|
267
364
|
export type BottomTabNavigationConfig = {
|
|
268
365
|
/**
|
|
269
366
|
* Function that returns a React element to display as the tab bar.
|
|
@@ -318,7 +415,7 @@ export type BottomTabBarProps = {
|
|
|
318
415
|
};
|
|
319
416
|
|
|
320
417
|
export type BottomTabBarButtonProps = Omit<
|
|
321
|
-
|
|
418
|
+
React.ComponentProps<typeof PlatformPressable>,
|
|
322
419
|
'onPress'
|
|
323
420
|
> & {
|
|
324
421
|
href?: string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { NavigationState } from '@react-navigation/routers';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Animated } from 'react-native';
|
|
4
|
+
|
|
5
|
+
export function useAnimatedHashMap({ routes, index }: NavigationState) {
|
|
6
|
+
const refs = React.useRef<Record<string, Animated.Value>>({});
|
|
7
|
+
const previous = refs.current;
|
|
8
|
+
const routeKeys = Object.keys(previous);
|
|
9
|
+
|
|
10
|
+
if (
|
|
11
|
+
routes.length === routeKeys.length &&
|
|
12
|
+
routes.every((route) => routeKeys.includes(route.key))
|
|
13
|
+
) {
|
|
14
|
+
return previous;
|
|
15
|
+
}
|
|
16
|
+
refs.current = {};
|
|
17
|
+
|
|
18
|
+
routes.forEach(({ key }, i) => {
|
|
19
|
+
refs.current[key] =
|
|
20
|
+
previous[key] ??
|
|
21
|
+
new Animated.Value(i === index ? 0 : i >= index ? 1 : -1);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
return refs.current;
|
|
25
|
+
}
|