@onekeyfe/react-native-bottom-tabs 0.0.0-stage → 6.7.0-7

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 (77) hide show
  1. package/LICENSE +46 -0
  2. package/README.md +86 -2
  3. package/android/build.gradle +119 -0
  4. package/android/gradle.properties +4 -0
  5. package/android/src/main/AndroidManifest.xml +3 -0
  6. package/android/src/main/AndroidManifestNew.xml +2 -0
  7. package/android/src/main/java/com/onekey/bottomtabs/BottomTabsPackage.kt +16 -0
  8. package/android/src/main/java/com/onekey/bottomtabs/BottomTabsView.kt +1424 -0
  9. package/android/src/main/java/com/onekey/bottomtabs/BottomTabsViewManager.kt +216 -0
  10. package/android/src/main/java/com/onekey/bottomtabs/FloatingTabBarStyle.kt +50 -0
  11. package/android/src/main/java/com/onekey/bottomtabs/ImageSource.kt +86 -0
  12. package/android/src/main/java/com/onekey/bottomtabs/TabInfo.kt +13 -0
  13. package/android/src/main/java/com/onekey/bottomtabs/Utils.kt +31 -0
  14. package/android/src/main/java/com/onekey/bottomtabs/events/OnNativeLayoutEvent.kt +20 -0
  15. package/android/src/main/java/com/onekey/bottomtabs/events/OnTabBarMeasuredEvent.kt +19 -0
  16. package/android/src/main/java/com/onekey/bottomtabs/events/PageSelectedEvent.kt +21 -0
  17. package/android/src/main/java/com/onekey/bottomtabs/events/TabDoublePressEvent.kt +19 -0
  18. package/common/cpp/react/renderer/components/RNBottomTabs/RNBottomTabsViewComponentDescriptor.h +32 -0
  19. package/common/cpp/react/renderer/components/RNBottomTabs/RNBottomTabsViewShadowNode.cpp +18 -0
  20. package/common/cpp/react/renderer/components/RNBottomTabs/RNBottomTabsViewShadowNode.h +35 -0
  21. package/common/cpp/react/renderer/components/RNBottomTabs/RNBottomTabsViewState.cpp +15 -0
  22. package/common/cpp/react/renderer/components/RNBottomTabs/RNBottomTabsViewState.h +25 -0
  23. package/docs/SPEC.md +104 -0
  24. package/ios/Extensions.swift +46 -0
  25. package/ios/RCTBottomAccessoryComponentView.h +12 -0
  26. package/ios/RCTBottomAccessoryComponentView.mm +67 -0
  27. package/ios/RCTBottomAccessoryContainerView.swift +51 -0
  28. package/ios/RCTBottomTabsComponentView.h +12 -0
  29. package/ios/RCTBottomTabsComponentView.mm +338 -0
  30. package/ios/RCTBottomTabsContainerView.swift +777 -0
  31. package/ios/RCTBottomTabsLog.h +7 -0
  32. package/ios/RCTBottomTabsLog.m +32 -0
  33. package/ios/SVG/CoreSVG.h +13 -0
  34. package/ios/SVG/CoreSVG.mm +177 -0
  35. package/ios/SVG/SvgDecoder.h +10 -0
  36. package/ios/SVG/SvgDecoder.mm +32 -0
  37. package/ios/TabBarFontSize.swift +55 -0
  38. package/lib/module/BottomAccessoryView.js +45 -0
  39. package/lib/module/BottomAccessoryViewNativeComponent.ts +27 -0
  40. package/lib/module/BottomTabs.js +323 -0
  41. package/lib/module/BottomTabsNativeComponent.ts +69 -0
  42. package/lib/module/DelayedFreeze.js +31 -0
  43. package/lib/module/NativeSVGDecoder.js +5 -0
  44. package/lib/module/SceneMap.js +28 -0
  45. package/lib/module/codegen-types.d.js +2 -0
  46. package/lib/module/index.js +20 -0
  47. package/lib/module/package.json +1 -0
  48. package/lib/module/types.js +4 -0
  49. package/lib/module/utils/BottomTabBarHeightContext.js +5 -0
  50. package/lib/module/utils/useBottomTabBarHeight.js +12 -0
  51. package/lib/typescript/package.json +1 -0
  52. package/lib/typescript/src/BottomAccessoryView.d.ts +8 -0
  53. package/lib/typescript/src/BottomAccessoryViewNativeComponent.d.ts +16 -0
  54. package/lib/typescript/src/BottomTabs.d.ts +202 -0
  55. package/lib/typescript/src/BottomTabsNativeComponent.d.ts +58 -0
  56. package/lib/typescript/src/DelayedFreeze.d.ts +9 -0
  57. package/lib/typescript/src/NativeSVGDecoder.d.ts +6 -0
  58. package/lib/typescript/src/SceneMap.d.ts +10 -0
  59. package/lib/typescript/src/index.d.ts +16 -0
  60. package/lib/typescript/src/types.d.ts +29 -0
  61. package/lib/typescript/src/utils/BottomTabBarHeightContext.d.ts +3 -0
  62. package/lib/typescript/src/utils/useBottomTabBarHeight.d.ts +2 -0
  63. package/package.json +117 -4
  64. package/react-native-bottom-tabs.podspec +36 -0
  65. package/react-native.config.js +13 -0
  66. package/src/BottomAccessoryView.tsx +58 -0
  67. package/src/BottomAccessoryViewNativeComponent.ts +27 -0
  68. package/src/BottomTabs.tsx +545 -0
  69. package/src/BottomTabsNativeComponent.ts +69 -0
  70. package/src/DelayedFreeze.tsx +33 -0
  71. package/src/NativeSVGDecoder.ts +5 -0
  72. package/src/SceneMap.tsx +34 -0
  73. package/src/codegen-types.d.ts +28 -0
  74. package/src/index.tsx +18 -0
  75. package/src/types.ts +31 -0
  76. package/src/utils/BottomTabBarHeightContext.ts +5 -0
  77. package/src/utils/useBottomTabBarHeight.ts +15 -0
@@ -0,0 +1,323 @@
1
+ "use strict";
2
+
3
+ import React, { useLayoutEffect, useRef } from 'react';
4
+ import { Image, Platform, StyleSheet, View, processColor } from 'react-native';
5
+ import { BottomTabBarHeightContext } from "./utils/BottomTabBarHeightContext.js";
6
+
7
+ // eslint-disable-next-line @react-native/no-deep-imports
8
+
9
+ import NativeBottomTabs from './BottomTabsNativeComponent';
10
+ import useLatestCallback from 'use-latest-callback';
11
+ import DelayedFreeze from "./DelayedFreeze.js";
12
+ import { BottomAccessoryView } from "./BottomAccessoryView.js";
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ const isAppleSymbol = icon => icon?.sfSymbol;
15
+ const ANDROID_MAX_TABS = 100;
16
+ const BottomTabs = ({
17
+ navigationState,
18
+ renderScene,
19
+ renderLazyPlaceholder,
20
+ onIndexChange,
21
+ onTabDoublePress,
22
+ rippleColor,
23
+ tabBarActiveTintColor: activeTintColor,
24
+ tabBarInactiveTintColor: inactiveTintColor,
25
+ getBadge = ({
26
+ route
27
+ }) => route.badge,
28
+ getBadgeBackgroundColor = ({
29
+ route
30
+ }) => route.badgeBackgroundColor,
31
+ getBadgeTextColor = ({
32
+ route
33
+ }) => route.badgeTextColor,
34
+ getLazy = ({
35
+ route
36
+ }) => route.lazy,
37
+ getLabelText = ({
38
+ route
39
+ }) => route.title,
40
+ getIcon = ({
41
+ route,
42
+ focused
43
+ }) => route.unfocusedIcon ? focused ? route.focusedIcon : route.unfocusedIcon : route.focusedIcon,
44
+ getHidden = ({
45
+ route
46
+ }) => route.hidden,
47
+ getActiveTintColor = ({
48
+ route
49
+ }) => route.activeTintColor,
50
+ getTestID = ({
51
+ route
52
+ }) => route.testID,
53
+ getRole = ({
54
+ route
55
+ }) => route.role,
56
+ getSceneStyle = ({
57
+ route
58
+ }) => route.style,
59
+ getPreventsDefault = ({
60
+ route
61
+ }) => route.preventsDefault,
62
+ hapticFeedbackEnabled = false,
63
+ labeled = Platform.OS !== 'android' ? true : undefined,
64
+ getFreezeOnBlur = ({
65
+ route
66
+ }) => route.freezeOnBlur,
67
+ tabBar: renderCustomTabBar,
68
+ tabBarStyle,
69
+ tabLabelStyle,
70
+ renderBottomAccessoryView,
71
+ activeIndicatorColor,
72
+ delayedFreeze = false,
73
+ ...props
74
+ }) => {
75
+ // @ts-ignore
76
+ const focusedKey = navigationState.routes[navigationState.index].key;
77
+ const customTabBarWrapperRef = useRef(null);
78
+ const nativeBottomTabsRef = useRef(null);
79
+ const [tabBarHeight, setTabBarHeight] = React.useState(0);
80
+ const [measuredDimensions, setMeasuredDimensions] = React.useState({
81
+ width: '100%',
82
+ height: '100%'
83
+ });
84
+ const trimmedRoutes = React.useMemo(() => {
85
+ if (Platform.OS === 'android' && navigationState.routes.length > ANDROID_MAX_TABS) {
86
+ console.warn(`BottomTabs only supports up to ${ANDROID_MAX_TABS} tabs on Android`);
87
+ return navigationState.routes.slice(0, ANDROID_MAX_TABS);
88
+ }
89
+ return navigationState.routes;
90
+ }, [navigationState.routes]);
91
+ const [loaded, setLoaded] = React.useState([focusedKey]);
92
+ if (!loaded.includes(focusedKey)) {
93
+ setLoaded(loaded => [...loaded, focusedKey]);
94
+ }
95
+ const isIOS = Platform.OS === 'ios';
96
+
97
+ // Unfocused (outline) icons — independent of focusedKey so the array stays
98
+ // stable across tab switches and the native side never reloads on switch.
99
+ const unfocusedIcons = React.useMemo(() => trimmedRoutes.map(route => getIcon({
100
+ route,
101
+ focused: false
102
+ })), [getIcon, trimmedRoutes]);
103
+ // Focused (solid) icons — also stable; handed to iOS as selectedImage.
104
+ const focusedIcons = React.useMemo(() => trimmedRoutes.map(route => getIcon({
105
+ route,
106
+ focused: true
107
+ })), [getIcon, trimmedRoutes]);
108
+ // Legacy single array driven by focusedKey. Android still swaps the icon in
109
+ // JS (it has no selectedImage equivalent).
110
+ const focusKeyedIcons = React.useMemo(() => trimmedRoutes.map(route => getIcon({
111
+ route,
112
+ focused: route.key === focusedKey
113
+ })), [focusedKey, getIcon, trimmedRoutes]);
114
+
115
+ // iOS hands both states to UIKit (image + selectedImage) so the focused
116
+ // artwork swaps natively, in sync with the selection animation, instead of
117
+ // waiting for a JS round-trip. Android keeps the focusedKey-driven array.
118
+ const icons = isIOS ? unfocusedIcons : focusKeyedIcons;
119
+ const items = React.useMemo(() => trimmedRoutes.map((route, index) => {
120
+ const icon = icons[index];
121
+ const isSfSymbol = isAppleSymbol(icon);
122
+ if (Platform.OS === 'android' && isSfSymbol) {
123
+ console.warn('SF Symbols are not supported on Android. Use require() or pass uri to load an image instead.');
124
+ }
125
+ const color = processColor(getActiveTintColor({
126
+ route
127
+ }));
128
+ const badgeBgColor = processColor(getBadgeBackgroundColor?.({
129
+ route
130
+ }));
131
+ const badgeTxtColor = processColor(getBadgeTextColor?.({
132
+ route
133
+ }));
134
+ return {
135
+ key: route.key,
136
+ title: getLabelText({
137
+ route
138
+ }) ?? route.key,
139
+ sfSymbol: isSfSymbol ? icon.sfSymbol : undefined,
140
+ badge: getBadge?.({
141
+ route
142
+ }),
143
+ badgeBackgroundColor: typeof badgeBgColor === 'number' ? badgeBgColor : undefined,
144
+ badgeTextColor: typeof badgeTxtColor === 'number' ? badgeTxtColor : undefined,
145
+ activeTintColor: typeof color === 'number' ? color : undefined,
146
+ hidden: getHidden?.({
147
+ route
148
+ }),
149
+ testID: getTestID?.({
150
+ route
151
+ }),
152
+ role: getRole?.({
153
+ route
154
+ }),
155
+ preventsDefault: getPreventsDefault?.({
156
+ route
157
+ })
158
+ };
159
+ }), [trimmedRoutes, icons, getLabelText, getBadge, getBadgeBackgroundColor, getBadgeTextColor, getActiveTintColor, getHidden, getTestID, getRole, getPreventsDefault]);
160
+ const resolvedIconAssets = React.useMemo(() => icons.map(icon => {
161
+ if (icon && !isAppleSymbol(icon)) {
162
+ // @ts-ignore - resolveAssetSource accepts ImageSourcePropType
163
+ const resolved = Image.resolveAssetSource(icon);
164
+ return {
165
+ uri: resolved?.uri ?? '',
166
+ width: resolved?.width ?? 0,
167
+ height: resolved?.height ?? 0,
168
+ scale: resolved?.scale ?? 1
169
+ };
170
+ }
171
+ return {
172
+ uri: '',
173
+ width: 0,
174
+ height: 0,
175
+ scale: 1
176
+ };
177
+ }), [icons]);
178
+
179
+ // Focused (solid) assets passed to iOS as selectedImage. iOS only — Android
180
+ // ignores selectedIcons and keeps swapping via the focusedKey array above.
181
+ const resolvedSelectedIconAssets = React.useMemo(() => focusedIcons.map(icon => {
182
+ if (icon && !isAppleSymbol(icon)) {
183
+ // @ts-ignore - resolveAssetSource accepts ImageSourcePropType
184
+ const resolved = Image.resolveAssetSource(icon);
185
+ return {
186
+ uri: resolved?.uri ?? '',
187
+ width: resolved?.width ?? 0,
188
+ height: resolved?.height ?? 0,
189
+ scale: resolved?.scale ?? 1
190
+ };
191
+ }
192
+ return {
193
+ uri: '',
194
+ width: 0,
195
+ height: 0,
196
+ scale: 1
197
+ };
198
+ }), [focusedIcons]);
199
+ const jumpTo = useLatestCallback(key => {
200
+ const index = trimmedRoutes.findIndex(route => route.key === key);
201
+ if (index === -1) {
202
+ return;
203
+ }
204
+ return onIndexChange(index);
205
+ });
206
+ const handleTabDoublePress = React.useCallback(event => {
207
+ const {
208
+ key
209
+ } = event.nativeEvent;
210
+ const index = trimmedRoutes.findIndex(route => route.key === key);
211
+ if (index !== -1) {
212
+ onTabDoublePress?.(index);
213
+ }
214
+ }, [trimmedRoutes, onTabDoublePress]);
215
+ const handlePageSelected = React.useCallback(event => {
216
+ const {
217
+ key
218
+ } = event.nativeEvent;
219
+ const accepted = jumpTo(key);
220
+ if (accepted === false) {
221
+ nativeBottomTabsRef.current?.setNativeProps({
222
+ selectedPage: focusedKey
223
+ });
224
+ }
225
+ }, [focusedKey, jumpTo]);
226
+ const handleTabBarMeasured = React.useCallback(event => {
227
+ setTabBarHeight(event.nativeEvent.height);
228
+ }, [setTabBarHeight]);
229
+ const handleNativeLayout = React.useCallback(event => {
230
+ const {
231
+ width,
232
+ height
233
+ } = event.nativeEvent;
234
+ setMeasuredDimensions({
235
+ width,
236
+ height
237
+ });
238
+ }, [setMeasuredDimensions]);
239
+ useLayoutEffect(() => {
240
+ if (renderCustomTabBar && customTabBarWrapperRef.current) {
241
+ customTabBarWrapperRef.current.measure((_x, _y, _width, height) => {
242
+ setTabBarHeight(height);
243
+ });
244
+ }
245
+ }, [renderCustomTabBar]);
246
+ return /*#__PURE__*/_jsxs(BottomTabBarHeightContext.Provider, {
247
+ value: tabBarHeight,
248
+ children: [/*#__PURE__*/_jsxs(NativeBottomTabs, {
249
+ ref: nativeBottomTabsRef,
250
+ ...props,
251
+ ...tabLabelStyle,
252
+ style: styles.fullWidth,
253
+ items: items,
254
+ icons: renderCustomTabBar ? undefined : resolvedIconAssets,
255
+ selectedIcons: isIOS && !renderCustomTabBar ? resolvedSelectedIconAssets : undefined,
256
+ selectedPage: focusedKey,
257
+ tabBarHidden: props.tabBarHidden ?? !!renderCustomTabBar,
258
+ onTabDoublePress: handleTabDoublePress,
259
+ onPageSelected: handlePageSelected,
260
+ onTabBarMeasured: handleTabBarMeasured,
261
+ onNativeLayout: handleNativeLayout,
262
+ hapticFeedbackEnabled: hapticFeedbackEnabled,
263
+ activeTintColor: activeTintColor,
264
+ inactiveTintColor: inactiveTintColor,
265
+ barTintColor: tabBarStyle?.backgroundColor,
266
+ rippleColor: rippleColor,
267
+ activeIndicatorColor: activeIndicatorColor,
268
+ labeled: labeled,
269
+ children: [trimmedRoutes.map(route => {
270
+ if (getLazy({
271
+ route
272
+ }) !== false && !loaded.includes(route.key)) {
273
+ return /*#__PURE__*/_jsx(View, {
274
+ collapsable: false,
275
+ style: styles.fullWidth,
276
+ children: renderLazyPlaceholder?.({
277
+ route
278
+ })
279
+ }, route.key);
280
+ }
281
+ const focused = route.key === focusedKey;
282
+ const freeze = !focused ? getFreezeOnBlur({
283
+ route
284
+ }) : false;
285
+ const customStyle = getSceneStyle({
286
+ route
287
+ });
288
+ return /*#__PURE__*/_jsx(View, {
289
+ style: [styles.screen, renderCustomTabBar ? styles.fullWidth : measuredDimensions, customStyle],
290
+ collapsable: false,
291
+ pointerEvents: focused ? 'auto' : 'none',
292
+ accessibilityElementsHidden: !focused,
293
+ importantForAccessibility: focused ? 'auto' : 'no-hide-descendants',
294
+ children: /*#__PURE__*/_jsx(DelayedFreeze, {
295
+ freeze: !!freeze,
296
+ delayedFreeze: delayedFreeze,
297
+ children: renderScene({
298
+ route,
299
+ jumpTo
300
+ })
301
+ })
302
+ }, route.key);
303
+ }), Platform.OS === 'ios' && parseFloat(Platform.Version) >= 26 && renderBottomAccessoryView && !renderCustomTabBar ? /*#__PURE__*/_jsx(BottomAccessoryView, {
304
+ renderBottomAccessoryView: renderBottomAccessoryView
305
+ }) : null]
306
+ }), renderCustomTabBar ? /*#__PURE__*/_jsx(View, {
307
+ ref: customTabBarWrapperRef,
308
+ children: renderCustomTabBar()
309
+ }) : null]
310
+ });
311
+ };
312
+ const styles = StyleSheet.create({
313
+ fullWidth: {
314
+ width: '100%',
315
+ height: '100%',
316
+ flex: 1
317
+ },
318
+ screen: {
319
+ position: 'absolute'
320
+ }
321
+ });
322
+ export default BottomTabs;
323
+ //# sourceMappingURL=BottomTabs.js.map
@@ -0,0 +1,69 @@
1
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
+ import type { ColorValue, ProcessedColorValue, ViewProps } from 'react-native';
3
+ import type {
4
+ DirectEventHandler,
5
+ Double,
6
+ Int32,
7
+ WithDefault,
8
+ } from 'react-native/Libraries/Types/CodegenTypes';
9
+ //@ts-ignore
10
+ import type { ImageSource } from 'react-native/Libraries/Image/ImageSource';
11
+
12
+ export type OnPageSelectedEventData = Readonly<{
13
+ key: string;
14
+ }>;
15
+
16
+ export type OnTabBarMeasured = Readonly<{
17
+ height: Int32;
18
+ }>;
19
+
20
+ export type OnNativeLayout = Readonly<{
21
+ width: Double;
22
+ height: Double;
23
+ }>;
24
+
25
+ export type BottomTabsItems = ReadonlyArray<{
26
+ key: string;
27
+ title: string;
28
+ sfSymbol?: string;
29
+ badge?: string;
30
+ badgeBackgroundColor?: ProcessedColorValue | null;
31
+ badgeTextColor?: ProcessedColorValue | null;
32
+ activeTintColor?: ProcessedColorValue | null;
33
+ hidden?: boolean;
34
+ testID?: string;
35
+ role?: string;
36
+ preventsDefault?: boolean;
37
+ }>;
38
+
39
+ export interface BottomTabsNativeProps extends ViewProps {
40
+ items: BottomTabsItems;
41
+ selectedPage: string;
42
+ onPageSelected?: DirectEventHandler<OnPageSelectedEventData>;
43
+ onTabDoublePress?: DirectEventHandler<OnPageSelectedEventData>;
44
+ onTabBarMeasured?: DirectEventHandler<OnTabBarMeasured>;
45
+ onNativeLayout?: DirectEventHandler<OnNativeLayout>;
46
+ icons?: ReadonlyArray<ImageSource>;
47
+ selectedIcons?: ReadonlyArray<ImageSource>;
48
+ tabBarHidden?: boolean;
49
+ labeled?: boolean;
50
+ sidebarAdaptable?: boolean;
51
+ scrollEdgeAppearance?: string;
52
+ barTintColor?: ColorValue;
53
+ translucent?: WithDefault<boolean, true>;
54
+ rippleColor?: ColorValue;
55
+ activeTintColor?: ColorValue;
56
+ inactiveTintColor?: ColorValue;
57
+ disablePageAnimations?: boolean;
58
+ activeIndicatorColor?: ColorValue;
59
+ hapticFeedbackEnabled?: boolean;
60
+ minimizeBehavior?: string;
61
+ fontFamily?: string;
62
+ fontWeight?: string;
63
+ fontSize?: Int32;
64
+ ignoreBottomInsets?: boolean;
65
+ androidTabBarStyle?: WithDefault<'default' | 'floating', 'default'>;
66
+ ignoreKeyboardInsets?: WithDefault<boolean, true>;
67
+ }
68
+
69
+ export default codegenNativeComponent<BottomTabsNativeProps>('RNBottomTabsView');
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { Freeze } from 'react-freeze';
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ const ANIMATION_DELAY = 200;
7
+ function DelayedFreeze({
8
+ freeze,
9
+ delayedFreeze,
10
+ children
11
+ }) {
12
+ const [freezeState, setFreezeState] = React.useState(false);
13
+ React.useEffect(() => {
14
+ if (!delayedFreeze) {
15
+ return;
16
+ }
17
+ const id = setTimeout(() => {
18
+ setFreezeState(freeze);
19
+ }, ANIMATION_DELAY);
20
+ return () => {
21
+ clearTimeout(id);
22
+ };
23
+ }, [freeze, delayedFreeze]);
24
+ const shouldFreeze = delayedFreeze ? freeze ? freezeState : false : freeze;
25
+ return /*#__PURE__*/_jsx(Freeze, {
26
+ freeze: shouldFreeze,
27
+ children: children
28
+ });
29
+ }
30
+ export default DelayedFreeze;
31
+ //# sourceMappingURL=DelayedFreeze.js.map
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ import { TurboModuleRegistry } from 'react-native';
4
+ export default TurboModuleRegistry.getEnforcing('SvgDecoder');
5
+ //# sourceMappingURL=NativeSVGDecoder.js.map
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ import * as React from 'react';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const SceneComponent = /*#__PURE__*/React.memo(({
6
+ component,
7
+ ...rest
8
+ }) => {
9
+ return /*#__PURE__*/React.createElement(component, rest);
10
+ });
11
+ SceneComponent.displayName = 'SceneComponent';
12
+ export function SceneMap(scenes) {
13
+ return ({
14
+ route,
15
+ jumpTo
16
+ }) => {
17
+ const component = scenes[route.key];
18
+ if (!component) {
19
+ return null;
20
+ }
21
+ return /*#__PURE__*/_jsx(SceneComponent, {
22
+ jumpTo: jumpTo,
23
+ component: component,
24
+ route: route
25
+ }, route.key);
26
+ };
27
+ }
28
+ //# sourceMappingURL=SceneMap.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=codegen-types.d.js.map
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ import BottomTabs from "./BottomTabs.js";
4
+
5
+ /**
6
+ * Views
7
+ */
8
+ export default BottomTabs;
9
+
10
+ /**
11
+ * Utilities
12
+ */
13
+ export { SceneMap } from "./SceneMap.js";
14
+ export { useBottomTabBarHeight } from "./utils/useBottomTabBarHeight.js";
15
+ export { BottomTabBarHeightContext } from "./utils/BottomTabBarHeightContext.js";
16
+
17
+ /**
18
+ * Types
19
+ */
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ import * as React from 'react';
4
+ export const BottomTabBarHeightContext = /*#__PURE__*/React.createContext(undefined);
5
+ //# sourceMappingURL=BottomTabBarHeightContext.js.map
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ import * as React from 'react';
4
+ import { BottomTabBarHeightContext } from "./BottomTabBarHeightContext.js";
5
+ export function useBottomTabBarHeight() {
6
+ const height = React.useContext(BottomTabBarHeightContext);
7
+ if (height === undefined) {
8
+ throw new Error("Couldn't find the bottom tab bar height. Are you inside a screen in Native Bottom Tab Navigator?");
9
+ }
10
+ return height;
11
+ }
12
+ //# sourceMappingURL=useBottomTabBarHeight.js.map
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export interface RNBottomTabsAccessoryViewProps {
3
+ renderBottomAccessoryView: (props: {
4
+ placement: 'inline' | 'expanded' | 'none';
5
+ }) => React.ReactNode;
6
+ }
7
+ export declare const BottomAccessoryView: (props: RNBottomTabsAccessoryViewProps) => import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=BottomAccessoryView.d.ts.map
@@ -0,0 +1,16 @@
1
+ import type { ViewProps } from 'react-native';
2
+ import type { DirectEventHandler, Double } from 'react-native/Libraries/Types/CodegenTypes';
3
+ export type OnNativeLayout = Readonly<{
4
+ width: Double;
5
+ height: Double;
6
+ }>;
7
+ export type OnPlacementChanged = Readonly<{
8
+ placement: string;
9
+ }>;
10
+ export interface BottomAccessoryViewNativeProps extends ViewProps {
11
+ onNativeLayout?: DirectEventHandler<OnNativeLayout>;
12
+ onPlacementChanged?: DirectEventHandler<OnPlacementChanged>;
13
+ }
14
+ declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<BottomAccessoryViewNativeProps>;
15
+ export default _default;
16
+ //# sourceMappingURL=BottomAccessoryViewNativeComponent.d.ts.map