@soundtrackio/react-native-bottom-tabs 1.4.0

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 (125) hide show
  1. package/README.md +32 -0
  2. package/android/build.gradle +132 -0
  3. package/android/gradle.properties +5 -0
  4. package/android/src/main/AndroidManifest.xml +3 -0
  5. package/android/src/main/AndroidManifestNew.xml +2 -0
  6. package/android/src/main/java/com/rcttabview/ImageSource.kt +86 -0
  7. package/android/src/main/java/com/rcttabview/LatestRequestTracker.kt +19 -0
  8. package/android/src/main/java/com/rcttabview/RCTTabView.kt +689 -0
  9. package/android/src/main/java/com/rcttabview/RCTTabViewManager.kt +222 -0
  10. package/android/src/main/java/com/rcttabview/RCTTabViewPackage.kt +19 -0
  11. package/android/src/main/java/com/rcttabview/RCTTabViewPrewarm.kt +40 -0
  12. package/android/src/main/java/com/rcttabview/RebuildBatch.kt +31 -0
  13. package/android/src/main/java/com/rcttabview/TabBarVisibility.kt +14 -0
  14. package/android/src/main/java/com/rcttabview/Utils.kt +31 -0
  15. package/android/src/main/java/com/rcttabview/events/OnNativeLayoutEvent.kt +25 -0
  16. package/android/src/main/java/com/rcttabview/events/OnTabBarMeasuredEvent.kt +24 -0
  17. package/android/src/main/java/com/rcttabview/events/PageSelectedEvent.kt +32 -0
  18. package/android/src/main/java/com/rcttabview/events/TabLongPressedEvent.kt +24 -0
  19. package/android/src/test/java/com/rcttabview/LatestRequestTrackerTest.kt +37 -0
  20. package/android/src/test/java/com/rcttabview/RebuildBatchTest.kt +44 -0
  21. package/android/src/test/java/com/rcttabview/TabBarVisibilityTest.kt +58 -0
  22. package/app.plugin.js +1 -0
  23. package/common/cpp/react/renderer/components/RNCTabView/RNCTabViewComponentDescriptor.h +33 -0
  24. package/common/cpp/react/renderer/components/RNCTabView/RNCTabViewShadowNode.cpp +19 -0
  25. package/common/cpp/react/renderer/components/RNCTabView/RNCTabViewShadowNode.h +35 -0
  26. package/common/cpp/react/renderer/components/RNCTabView/RNCTabViewState.cpp +15 -0
  27. package/common/cpp/react/renderer/components/RNCTabView/RNCTabViewState.h +25 -0
  28. package/ios/BottomAccessoryProvider.swift +27 -0
  29. package/ios/Extensions.swift +101 -0
  30. package/ios/PlatformAliases.swift +43 -0
  31. package/ios/RCTBottomAccessoryComponentView.h +17 -0
  32. package/ios/RCTBottomAccessoryComponentView.mm +76 -0
  33. package/ios/RCTTabViewComponentView.h +16 -0
  34. package/ios/RCTTabViewComponentView.mm +285 -0
  35. package/ios/RepresentableView.swift +55 -0
  36. package/ios/SVG/CoreSVG.h +19 -0
  37. package/ios/SVG/CoreSVG.mm +177 -0
  38. package/ios/SVG/SvgDecoder.h +10 -0
  39. package/ios/SVG/SvgDecoder.mm +38 -0
  40. package/ios/TabAppearModifier.swift +38 -0
  41. package/ios/TabBarFontSize.swift +88 -0
  42. package/ios/TabItem.swift +35 -0
  43. package/ios/TabItemEventModifier.swift +163 -0
  44. package/ios/TabView/AnyTabView.swift +7 -0
  45. package/ios/TabView/LegacyTabView.swift +70 -0
  46. package/ios/TabView/NewTabView.swift +138 -0
  47. package/ios/TabViewImpl.swift +566 -0
  48. package/ios/TabViewProps.swift +109 -0
  49. package/ios/TabViewProvider.swift +368 -0
  50. package/ios/react-native-bottom-tabs-Bridging-Header.h +4 -0
  51. package/lib/module/BottomAccessoryView.js +47 -0
  52. package/lib/module/BottomAccessoryView.js.map +1 -0
  53. package/lib/module/BottomAccessoryViewNativeComponent.ts +27 -0
  54. package/lib/module/DelayedFreeze.js +31 -0
  55. package/lib/module/DelayedFreeze.js.map +1 -0
  56. package/lib/module/NativeSVGDecoder.js +5 -0
  57. package/lib/module/NativeSVGDecoder.js.map +1 -0
  58. package/lib/module/SceneMap.js +28 -0
  59. package/lib/module/SceneMap.js.map +1 -0
  60. package/lib/module/TabView.js +294 -0
  61. package/lib/module/TabView.js.map +1 -0
  62. package/lib/module/TabViewNativeComponent.ts +73 -0
  63. package/lib/module/expo.js +35 -0
  64. package/lib/module/expo.js.map +1 -0
  65. package/lib/module/index.js +20 -0
  66. package/lib/module/index.js.map +1 -0
  67. package/lib/module/package.json +1 -0
  68. package/lib/module/types.js +4 -0
  69. package/lib/module/types.js.map +1 -0
  70. package/lib/module/utils/BottomTabBarHeightContext.js +5 -0
  71. package/lib/module/utils/BottomTabBarHeightContext.js.map +1 -0
  72. package/lib/module/utils/useBottomTabBarHeight.js +12 -0
  73. package/lib/module/utils/useBottomTabBarHeight.js.map +1 -0
  74. package/lib/typescript/package.json +1 -0
  75. package/lib/typescript/src/BottomAccessoryView.d.ts +7 -0
  76. package/lib/typescript/src/BottomAccessoryView.d.ts.map +1 -0
  77. package/lib/typescript/src/BottomAccessoryView.js +24 -0
  78. package/lib/typescript/src/BottomAccessoryViewNativeComponent.d.ts +15 -0
  79. package/lib/typescript/src/BottomAccessoryViewNativeComponent.d.ts.map +1 -0
  80. package/lib/typescript/src/BottomAccessoryViewNativeComponent.js +4 -0
  81. package/lib/typescript/src/DelayedFreeze.d.ts +7 -0
  82. package/lib/typescript/src/DelayedFreeze.d.ts.map +1 -0
  83. package/lib/typescript/src/DelayedFreeze.js +21 -0
  84. package/lib/typescript/src/NativeSVGDecoder.d.ts +5 -0
  85. package/lib/typescript/src/NativeSVGDecoder.d.ts.map +1 -0
  86. package/lib/typescript/src/NativeSVGDecoder.js +2 -0
  87. package/lib/typescript/src/SceneMap.d.ts +9 -0
  88. package/lib/typescript/src/SceneMap.d.ts.map +1 -0
  89. package/lib/typescript/src/SceneMap.js +15 -0
  90. package/lib/typescript/src/TabView.d.ts +219 -0
  91. package/lib/typescript/src/TabView.d.ts.map +1 -0
  92. package/lib/typescript/src/TabView.js +157 -0
  93. package/lib/typescript/src/TabViewNativeComponent.d.ts +59 -0
  94. package/lib/typescript/src/TabViewNativeComponent.d.ts.map +1 -0
  95. package/lib/typescript/src/TabViewNativeComponent.js +4 -0
  96. package/lib/typescript/src/expo.d.ts +6 -0
  97. package/lib/typescript/src/expo.d.ts.map +1 -0
  98. package/lib/typescript/src/expo.js +34 -0
  99. package/lib/typescript/src/index.d.ts +15 -0
  100. package/lib/typescript/src/index.d.ts.map +1 -0
  101. package/lib/typescript/src/index.js +11 -0
  102. package/lib/typescript/src/types.d.ts +31 -0
  103. package/lib/typescript/src/types.d.ts.map +1 -0
  104. package/lib/typescript/src/types.js +1 -0
  105. package/lib/typescript/src/utils/BottomTabBarHeightContext.d.ts +2 -0
  106. package/lib/typescript/src/utils/BottomTabBarHeightContext.d.ts.map +1 -0
  107. package/lib/typescript/src/utils/BottomTabBarHeightContext.js +2 -0
  108. package/lib/typescript/src/utils/useBottomTabBarHeight.d.ts +1 -0
  109. package/lib/typescript/src/utils/useBottomTabBarHeight.d.ts.map +1 -0
  110. package/lib/typescript/src/utils/useBottomTabBarHeight.js +9 -0
  111. package/lib/typescript/tsconfig.tsbuildinfo +1 -0
  112. package/package.json +135 -0
  113. package/react-native-bottom-tabs.podspec +43 -0
  114. package/src/BottomAccessoryView.tsx +59 -0
  115. package/src/BottomAccessoryViewNativeComponent.ts +27 -0
  116. package/src/DelayedFreeze.tsx +31 -0
  117. package/src/NativeSVGDecoder.ts +5 -0
  118. package/src/SceneMap.tsx +34 -0
  119. package/src/TabView.tsx +558 -0
  120. package/src/TabViewNativeComponent.ts +73 -0
  121. package/src/expo.ts +58 -0
  122. package/src/index.tsx +23 -0
  123. package/src/types.ts +36 -0
  124. package/src/utils/BottomTabBarHeightContext.ts +5 -0
  125. package/src/utils/useBottomTabBarHeight.ts +15 -0
@@ -0,0 +1,219 @@
1
+ import React from 'react';
2
+ import { type ColorValue, type StyleProp, type ViewStyle } from 'react-native';
3
+ import type { ImageSource } from 'react-native/Libraries/Image/ImageSource';
4
+ import type { AppleIcon, BaseRoute, IconRenderingMode, LayoutDirection, NavigationState, TabRole } from './types';
5
+ import { type BottomAccessoryViewProps } from './BottomAccessoryView';
6
+ interface Props<Route extends BaseRoute> {
7
+ labeled?: boolean;
8
+ /**
9
+ * A tab bar style that adapts to each platform.
10
+ *
11
+ * that varies depending on the platform:
12
+ * Tab views using the sidebar adaptable style have an appearance
13
+ * - iPadOS displays a top tab bar that can adapt into a sidebar.
14
+ * - iOS displays a bottom tab bar.
15
+ * - macOS and tvOS always show a sidebar.
16
+ * - visionOS shows an ornament and also shows a sidebar for secondary tabs within a `TabSection`.
17
+ */
18
+ sidebarAdaptable?: boolean;
19
+ /**
20
+ * Whether to disable page animations between tabs. (iOS only) Defaults to `false`.
21
+ */
22
+ disablePageAnimations?: boolean;
23
+ /**
24
+ * Whether to enable haptic feedback. Defaults to `false`.
25
+ */
26
+ hapticFeedbackEnabled?: boolean;
27
+ /**
28
+ * Describes the appearance attributes for the tabBar to use when an observable scroll view is scrolled to the bottom. (iOS only)
29
+ */
30
+ scrollEdgeAppearance?: 'default' | 'opaque' | 'transparent';
31
+ /**
32
+ * Behavior for minimizing the tab bar. (iOS 26+)
33
+ */
34
+ minimizeBehavior?: 'automatic' | 'onScrollDown' | 'onScrollUp' | 'never';
35
+ /**
36
+ * Active tab color.
37
+ */
38
+ tabBarActiveTintColor?: ColorValue;
39
+ /**
40
+ * Inactive tab color.
41
+ * Has no effect on iOS 26 and above (Liquid Glass).
42
+ */
43
+ tabBarInactiveTintColor?: ColorValue;
44
+ /**
45
+ * Enables the experimental iOS 26 Liquid Glass tint color workaround that bakes tab labels into images.
46
+ * This has many drawbacks, such as affecting icon sizing when labels have different widths, bad positioning of badges, and possibly breaking accessibility features.
47
+ *
48
+ * @platform ios
49
+ */
50
+ experimental_bakedTintColors?: boolean;
51
+ /**
52
+ * State for the tab view.
53
+ *
54
+ * The state should contain a `routes` prop which is an array of objects containing `key` and `title` props, such as `{ key: 'music', title: 'Music' }`.
55
+ *
56
+ */
57
+ navigationState: NavigationState<Route>;
58
+ /**
59
+ * Function which takes an object with the route and returns a React element.
60
+ */
61
+ renderScene: (props: {
62
+ route: Route;
63
+ jumpTo: (key: string) => void;
64
+ }) => React.ReactNode | null;
65
+ /**
66
+ * Callback which is called on tab change, receives the index of the new tab as argument.
67
+ */
68
+ onIndexChange: (index: number) => void;
69
+ /**
70
+ * Callback which is called on long press on tab, receives the index of the tab as argument.
71
+ */
72
+ onTabLongPress?: (index: number) => void;
73
+ /**
74
+ * Get lazy for the current screen. Uses true by default.
75
+ */
76
+ getLazy?: (props: {
77
+ route: Route;
78
+ }) => boolean | undefined;
79
+ /**
80
+ * Get label text for the tab, uses `route.title` by default.
81
+ */
82
+ getLabelText?: (props: {
83
+ route: Route;
84
+ }) => string | undefined;
85
+ /**
86
+ * Get badge for the tab, uses `route.badge` by default.
87
+ */
88
+ getBadge?: (props: {
89
+ route: Route;
90
+ }) => string | undefined;
91
+ /**
92
+ * Get badge background color for the tab, uses `route.badgeBackgroundColor` by default. (Android only)
93
+ */
94
+ getBadgeBackgroundColor?: (props: {
95
+ route: Route;
96
+ }) => ColorValue | undefined;
97
+ /**
98
+ * Get badge text color for the tab, uses `route.badgeTextColor` by default. (Android only)
99
+ */
100
+ getBadgeTextColor?: (props: {
101
+ route: Route;
102
+ }) => ColorValue | undefined;
103
+ /**
104
+ * Get active tint color for the tab, uses `route.activeTintColor` by default.
105
+ */
106
+ getActiveTintColor?: (props: {
107
+ route: Route;
108
+ }) => ColorValue | undefined;
109
+ /**
110
+ * Determines whether the tab prevents default action (switching tabs) on press, uses `route.preventsDefault` by default.
111
+ */
112
+ getPreventsDefault?: (props: {
113
+ route: Route;
114
+ }) => boolean | undefined;
115
+ /**
116
+ * Get icon for the tab, uses `route.focusedIcon` by default.
117
+ */
118
+ getIcon?: (props: {
119
+ route: Route;
120
+ focused: boolean;
121
+ }) => ImageSource | AppleIcon | undefined | null;
122
+ /**
123
+ * Get the rendering mode for the tab icon, uses `route.iconRenderingMode` by default.
124
+ *
125
+ * Use `original` to preserve multicolor image icons instead of applying the native tab tint.
126
+ */
127
+ getIconRenderingMode?: (props: {
128
+ route: Route;
129
+ }) => IconRenderingMode | undefined;
130
+ /**
131
+ * Get hidden for the tab, uses `route.hidden` by default.
132
+ * If `true`, the tab will be hidden.
133
+ */
134
+ getHidden?: (props: {
135
+ route: Route;
136
+ }) => boolean | undefined;
137
+ /**
138
+ * Get testID for the tab, uses `route.testID` by default.
139
+ */
140
+ getTestID?: (props: {
141
+ route: Route;
142
+ }) => string | undefined;
143
+ /**
144
+ * Get role for the tab, uses `route.role` by default. (iOS only)
145
+ */
146
+ getRole?: (props: {
147
+ route: Route;
148
+ }) => TabRole | undefined;
149
+ /**
150
+ * Custom tab bar to render. Set to `null` to hide the tab bar completely.
151
+ */
152
+ tabBar?: () => React.ReactNode;
153
+ /**
154
+ * Get freezeOnBlur for the current screen. Uses false by default.
155
+ */
156
+ getFreezeOnBlur?: (props: {
157
+ route: Route;
158
+ }) => boolean | undefined;
159
+ /**
160
+ * Get style for the scene, uses `route.style` by default.
161
+ */
162
+ getSceneStyle?: (props: {
163
+ route: Route;
164
+ }) => StyleProp<ViewStyle>;
165
+ tabBarStyle?: {
166
+ /**
167
+ * Background color of the tab bar.
168
+ */
169
+ backgroundColor?: ColorValue;
170
+ };
171
+ /**
172
+ * A Boolean value that indicates whether the tab bar is translucent. (iOS only)
173
+ */
174
+ translucent?: boolean;
175
+ rippleColor?: ColorValue;
176
+ /**
177
+ * Color of tab indicator. (Android only)
178
+ */
179
+ activeIndicatorColor?: ColorValue;
180
+ tabLabelStyle?: {
181
+ /**
182
+ * Font family for the tab labels.
183
+ */
184
+ fontFamily?: string;
185
+ /**
186
+ * Font weight for the tab labels.
187
+ */
188
+ fontWeight?: string;
189
+ /**
190
+ * Font size for the tab labels.
191
+ */
192
+ fontSize?: number;
193
+ };
194
+ /**
195
+ * A function that returns a React element to display as bottom accessory view.
196
+ * iOS 26+ only.
197
+ *
198
+ * @platform ios
199
+ */
200
+ renderBottomAccessoryView?: BottomAccessoryViewProps['renderBottomAccessoryView'];
201
+ /**
202
+ * The direction of the layout.
203
+ * @default 'locale'
204
+ */
205
+ layoutDirection?: LayoutDirection;
206
+ /**
207
+ * Whether to hide the native tab bar.
208
+ */
209
+ tabBarHidden?: boolean;
210
+ /**
211
+ * Whether to hide the tab bar while the keyboard is shown. Android only:
212
+ * with `adjustResize` the bar is otherwise lifted above the keyboard.
213
+ *
214
+ * @platform android
215
+ */
216
+ tabBarHideOnKeyboard?: boolean;
217
+ }
218
+ declare const TabView: <Route extends BaseRoute>({ navigationState, renderScene, onIndexChange, onTabLongPress, rippleColor, tabBarActiveTintColor: activeTintColor, tabBarInactiveTintColor: inactiveTintColor, getBadge, getBadgeBackgroundColor, getBadgeTextColor, getLazy, getLabelText, getIcon, getHidden, getActiveTintColor, getTestID, getRole, getIconRenderingMode, getSceneStyle, getPreventsDefault, hapticFeedbackEnabled, labeled, getFreezeOnBlur, tabBar: renderCustomTabBar, tabBarHidden, tabBarHideOnKeyboard, tabBarStyle, tabLabelStyle, renderBottomAccessoryView, layoutDirection, experimental_bakedTintColors: experimentalBakedTintColors, ...props }: Props<Route>) => import("react/jsx-runtime").JSX.Element;
219
+ export default TabView;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabView.d.ts","sourceRoot":"","sources":["../../../src/TabView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAOvD,OAAO,EACL,KAAK,UAAU,EAIf,KAAK,SAAS,EAGd,KAAK,SAAS,EAEf,MAAM,cAAc,CAAC;AAItB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAG5E,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,OAAO,EACR,MAAM,SAAS,CAAC;AAEjB,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,uBAAuB,CAAC;AAK/B,UAAU,KAAK,CAAC,KAAK,SAAS,SAAS;IAIrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,qBAAqB,C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AK,CAAA;KAAE,KAAK,OAAO,GAAG,SAAS,CAAC;IAEnE;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,KAAK,SAAS,CAAC,SAAS,CAAC,CAAC;IAElE,WAAW,CAAC,EAAE;QACZ;;WAEG;QACH,eAAe,CAAC,EAAE,UAAU,CAAC;KAC9B,CAAC;IAEF;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB;;OAEG;IACH,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,aAAa,CAAC,EAAE;QACd;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,wBAAwB,CAAC,2BAA2B,CAAC,CAAC;IAClF;;;OAGG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAID,QAAA,MAAM,OAAO,GAAI,KAAK,SAAS,SAAS,EAAE,kmBAyCvC,KAAK,CAAC,KAAK,CAAC,4CAgQd,CAAC;AAaF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,157 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useLayoutEffect, useRef } from 'react';
3
+ import { Image, Platform, StyleSheet, View, processColor, } from 'react-native';
4
+ import { BottomTabBarHeightContext } from './utils/BottomTabBarHeightContext';
5
+ import NativeTabView from './TabViewNativeComponent';
6
+ import useLatestCallback from 'use-latest-callback';
7
+ import DelayedFreeze from './DelayedFreeze';
8
+ import { BottomAccessoryView, } from './BottomAccessoryView';
9
+ const isAppleSymbol = (icon) => icon?.sfSymbol;
10
+ const ANDROID_MAX_TABS = 100;
11
+ const TabView = ({ navigationState, renderScene, onIndexChange, onTabLongPress, rippleColor, tabBarActiveTintColor: activeTintColor, tabBarInactiveTintColor: inactiveTintColor, getBadge = ({ route }) => route.badge, getBadgeBackgroundColor = ({ route }) => route.badgeBackgroundColor, getBadgeTextColor = ({ route }) => route.badgeTextColor, getLazy = ({ route }) => route.lazy, getLabelText = ({ route }) => route.title, getIcon = ({ route, focused }) => route.unfocusedIcon
12
+ ? focused
13
+ ? route.focusedIcon
14
+ : route.unfocusedIcon
15
+ : route.focusedIcon, getHidden = ({ route }) => route.hidden, getActiveTintColor = ({ route }) => route.activeTintColor, getTestID = ({ route }) => route.testID, getRole = ({ route }) => route.role, getIconRenderingMode = ({ route }) => route.iconRenderingMode, getSceneStyle = ({ route }) => route.style, getPreventsDefault = ({ route }) => route.preventsDefault, hapticFeedbackEnabled = false,
16
+ // Android's native behavior is to show labels when there are less than 4 tabs. We leave it as undefined to use the platform default behavior.
17
+ labeled = Platform.OS !== 'android' ? true : undefined, getFreezeOnBlur = ({ route }) => route.freezeOnBlur, tabBar: renderCustomTabBar, tabBarHidden, tabBarHideOnKeyboard, tabBarStyle, tabLabelStyle, renderBottomAccessoryView, layoutDirection = 'locale', experimental_bakedTintColors: experimentalBakedTintColors = false, ...props }) => {
18
+ // @ts-ignore
19
+ const focusedKey = navigationState.routes[navigationState.index].key;
20
+ const customTabBarWrapperRef = useRef(null);
21
+ const [tabBarHeight, setTabBarHeight] = React.useState(0);
22
+ const [measuredDimensions, setMeasuredDimensions] = React.useState({ width: '100%', height: '100%' });
23
+ const trimmedRoutes = React.useMemo(() => {
24
+ if (Platform.OS === 'android' &&
25
+ navigationState.routes.length > ANDROID_MAX_TABS) {
26
+ console.warn(`TabView only supports up to ${ANDROID_MAX_TABS} tabs on Android`);
27
+ return navigationState.routes.slice(0, ANDROID_MAX_TABS);
28
+ }
29
+ return navigationState.routes;
30
+ }, [navigationState.routes]);
31
+ /**
32
+ * List of loaded tabs, tabs will be loaded when navigated to.
33
+ */
34
+ const [loaded, setLoaded] = React.useState([focusedKey]);
35
+ if (!loaded.includes(focusedKey)) {
36
+ // Set the current tab to be loaded if it was not loaded before
37
+ setLoaded((loaded) => [...loaded, focusedKey]);
38
+ }
39
+ const icons = React.useMemo(() => trimmedRoutes.map((route) => getIcon({
40
+ route,
41
+ // iOS uses UITabBarItem.selectedImage for selected and Liquid Glass hover states.
42
+ // Keep the base image unfocused so a selected tab can render unfocused while another tab is hovered.
43
+ focused: Platform.OS === 'ios' ? false : route.key === focusedKey,
44
+ })), [focusedKey, getIcon, trimmedRoutes]);
45
+ const focusedIcons = React.useMemo(() => trimmedRoutes.map((route) => getIcon({
46
+ route,
47
+ focused: true,
48
+ })), [getIcon, trimmedRoutes]);
49
+ const items = React.useMemo(() => trimmedRoutes.map((route, index) => {
50
+ const icon = icons[index];
51
+ const isSfSymbol = isAppleSymbol(icon);
52
+ const focusedIcon = focusedIcons[index];
53
+ const isFocusedSfSymbol = isAppleSymbol(focusedIcon);
54
+ if (Platform.OS === 'android' && isSfSymbol) {
55
+ console.warn('SF Symbols are not supported on Android. Use require() or pass uri to load an image instead.');
56
+ }
57
+ return {
58
+ key: route.key,
59
+ title: getLabelText({ route }) ?? route.key,
60
+ sfSymbol: isSfSymbol ? icon.sfSymbol : undefined,
61
+ focusedSfSymbol: isFocusedSfSymbol ? focusedIcon.sfSymbol : undefined,
62
+ badge: getBadge?.({ route }),
63
+ badgeBackgroundColor: processColor(getBadgeBackgroundColor?.({ route })),
64
+ badgeTextColor: processColor(getBadgeTextColor?.({ route })),
65
+ activeTintColor: processColor(getActiveTintColor({ route })),
66
+ iconRenderingMode: getIconRenderingMode({ route }),
67
+ hidden: getHidden?.({ route }),
68
+ testID: getTestID?.({ route }),
69
+ role: getRole?.({ route }),
70
+ preventsDefault: getPreventsDefault?.({ route }),
71
+ };
72
+ }), [
73
+ trimmedRoutes,
74
+ icons,
75
+ focusedIcons,
76
+ getLabelText,
77
+ getBadge,
78
+ getBadgeBackgroundColor,
79
+ getBadgeTextColor,
80
+ getActiveTintColor,
81
+ getIconRenderingMode,
82
+ getHidden,
83
+ getTestID,
84
+ getRole,
85
+ getPreventsDefault,
86
+ ]);
87
+ const resolvedIconAssets = React.useMemo(() =>
88
+ // Pass empty object for icons that are not provided to avoid index mismatch on native side.
89
+ icons.map((icon) => icon && !isAppleSymbol(icon)
90
+ ? // @ts-expect-error: TODO: Migrate of deep imports
91
+ Image.resolveAssetSource(icon)
92
+ : { uri: '' }), [icons]);
93
+ const resolvedFocusedIconAssets = React.useMemo(() =>
94
+ // Pass empty object for icons that are not provided to avoid index mismatch on native side.
95
+ focusedIcons.map((icon) => icon && !isAppleSymbol(icon)
96
+ ? // @ts-expect-error: TODO: Migrate of deep imports
97
+ Image.resolveAssetSource(icon)
98
+ : { uri: '' }), [focusedIcons]);
99
+ const jumpTo = useLatestCallback((key) => {
100
+ const index = trimmedRoutes.findIndex((route) => route.key === key);
101
+ onIndexChange(index);
102
+ });
103
+ const handleTabLongPress = React.useCallback(({ nativeEvent: { key } }) => {
104
+ const index = trimmedRoutes.findIndex((route) => route.key === key);
105
+ onTabLongPress?.(index);
106
+ }, [trimmedRoutes, onTabLongPress]);
107
+ const handlePageSelected = React.useCallback(({ nativeEvent: { key } }) => {
108
+ jumpTo(key);
109
+ }, [jumpTo]);
110
+ const handleTabBarMeasured = React.useCallback(({ nativeEvent: { height } }) => {
111
+ setTabBarHeight(height);
112
+ }, [setTabBarHeight]);
113
+ const handleNativeLayout = React.useCallback(({ nativeEvent: { width, height } }) => {
114
+ setMeasuredDimensions({ width, height });
115
+ }, [setMeasuredDimensions]);
116
+ useLayoutEffect(() => {
117
+ // If we are rendering a custom tab bar, we need to measure it to set the tab bar height.
118
+ if (renderCustomTabBar && customTabBarWrapperRef.current) {
119
+ customTabBarWrapperRef.current.measure((_x, _y, _width, height) => {
120
+ setTabBarHeight(height);
121
+ });
122
+ }
123
+ }, [renderCustomTabBar]);
124
+ return (_jsxs(BottomTabBarHeightContext.Provider, { value: tabBarHeight, children: [_jsxs(NativeTabView, { ...props, ...tabLabelStyle, style: styles.fullWidth, items: items,
125
+ // When rendering a custom tab bar, icons can be React elements, which will not be properly resolved.
126
+ icons: renderCustomTabBar ? undefined : resolvedIconAssets, focusedIcons: renderCustomTabBar ? undefined : resolvedFocusedIconAssets, selectedPage: focusedKey, tabBarHidden: tabBarHidden ?? !!renderCustomTabBar, tabBarHideOnKeyboard: tabBarHideOnKeyboard, onTabLongPress: handleTabLongPress, onPageSelected: handlePageSelected, onTabBarMeasured: handleTabBarMeasured, onNativeLayout: handleNativeLayout, hapticFeedbackEnabled: hapticFeedbackEnabled, layoutDirection: layoutDirection, activeTintColor: activeTintColor, inactiveTintColor: inactiveTintColor, experimentalBakedTintColors: experimentalBakedTintColors, barTintColor: tabBarStyle?.backgroundColor, rippleColor: rippleColor, labeled: labeled, children: [trimmedRoutes.map((route) => {
127
+ if (getLazy({ route }) !== false && !loaded.includes(route.key)) {
128
+ // Don't render a screen if we've never navigated to it
129
+ return (_jsx(View, { collapsable: false, style: styles.fullWidth }, route.key));
130
+ }
131
+ const focused = route.key === focusedKey;
132
+ const freeze = !focused ? getFreezeOnBlur({ route }) : false;
133
+ const customStyle = getSceneStyle({ route });
134
+ return (_jsx(View, { style: [
135
+ styles.screen,
136
+ renderCustomTabBar ? styles.fullWidth : measuredDimensions,
137
+ customStyle,
138
+ ], collapsable: false, pointerEvents: focused ? 'auto' : 'none', accessibilityElementsHidden: !focused, importantForAccessibility: focused ? 'auto' : 'no-hide-descendants', children: _jsx(DelayedFreeze, { freeze: !!freeze, children: renderScene({
139
+ route,
140
+ jumpTo,
141
+ }) }) }, route.key));
142
+ }), Platform.OS === 'ios' &&
143
+ parseFloat(Platform.Version) >= 26 &&
144
+ renderBottomAccessoryView &&
145
+ !renderCustomTabBar ? (_jsx(BottomAccessoryView, { renderBottomAccessoryView: renderBottomAccessoryView })) : null] }), renderCustomTabBar ? (_jsx(View, { ref: customTabBarWrapperRef, children: renderCustomTabBar() })) : null] }));
146
+ };
147
+ const styles = StyleSheet.create({
148
+ fullWidth: {
149
+ width: '100%',
150
+ height: '100%',
151
+ flex: 1,
152
+ },
153
+ screen: {
154
+ position: 'absolute',
155
+ },
156
+ });
157
+ export default TabView;
@@ -0,0 +1,59 @@
1
+ import type { ColorValue, ProcessedColorValue, ViewProps } from 'react-native';
2
+ import type { DirectEventHandler, Double, Int32, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
3
+ import type { ImageSource } from 'react-native/Libraries/Image/ImageSource';
4
+ export type OnPageSelectedEventData = Readonly<{
5
+ key: string;
6
+ }>;
7
+ export type OnTabBarMeasured = Readonly<{
8
+ height: Int32;
9
+ }>;
10
+ export type OnNativeLayout = Readonly<{
11
+ width: Double;
12
+ height: Double;
13
+ }>;
14
+ export type TabViewItems = ReadonlyArray<{
15
+ key: string;
16
+ title: string;
17
+ sfSymbol?: string;
18
+ focusedSfSymbol?: string;
19
+ badge?: string;
20
+ badgeBackgroundColor?: ProcessedColorValue | null;
21
+ badgeTextColor?: ProcessedColorValue | null;
22
+ activeTintColor?: ProcessedColorValue | null;
23
+ iconRenderingMode?: string;
24
+ hidden?: boolean;
25
+ testID?: string;
26
+ role?: string;
27
+ preventsDefault?: boolean;
28
+ }>;
29
+ export interface TabViewProps extends ViewProps {
30
+ items: TabViewItems;
31
+ selectedPage: string;
32
+ onPageSelected?: DirectEventHandler<OnPageSelectedEventData>;
33
+ onTabLongPress?: DirectEventHandler<OnPageSelectedEventData>;
34
+ onTabBarMeasured?: DirectEventHandler<OnTabBarMeasured>;
35
+ onNativeLayout?: DirectEventHandler<OnNativeLayout>;
36
+ icons?: ReadonlyArray<ImageSource>;
37
+ focusedIcons?: ReadonlyArray<ImageSource>;
38
+ tabBarHidden?: boolean;
39
+ tabBarHideOnKeyboard?: boolean;
40
+ labeled?: boolean;
41
+ sidebarAdaptable?: boolean;
42
+ scrollEdgeAppearance?: string;
43
+ barTintColor?: ColorValue;
44
+ translucent?: WithDefault<boolean, true>;
45
+ rippleColor?: ColorValue;
46
+ activeTintColor?: ColorValue;
47
+ inactiveTintColor?: ColorValue;
48
+ experimentalBakedTintColors?: WithDefault<boolean, false>;
49
+ disablePageAnimations?: boolean;
50
+ activeIndicatorColor?: ColorValue;
51
+ hapticFeedbackEnabled?: boolean;
52
+ layoutDirection?: string;
53
+ minimizeBehavior?: string;
54
+ fontFamily?: string;
55
+ fontWeight?: string;
56
+ fontSize?: Int32;
57
+ }
58
+ declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<TabViewProps>;
59
+ export default _default;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/TabViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EACV,kBAAkB,EAClB,MAAM,EACN,KAAK,EACL,WAAW,EACZ,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAE5E,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,GAAG,EAAE,MAAM,CAAC;CACb,CAAC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,MAAM,EAAE,KAAK,CAAC;CACf,CAAC,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM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EAAE,UAAU,CAAC;IAC7B,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B,2BAA2B,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC1D,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;;AAED,wBAEG"}
@@ -0,0 +1,4 @@
1
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
+ export default codegenNativeComponent('RNCTabView', {
3
+ interfaceOnly: true,
4
+ });
@@ -0,0 +1,6 @@
1
+ import { type ConfigPlugin } from '@expo/config-plugins';
2
+ type ConfigProps = {
3
+ theme: 'material2' | 'material3' | 'material3-dynamic' | 'material3-expressive';
4
+ };
5
+ declare const _default: ConfigPlugin<ConfigProps>;
6
+ export default _default;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expo.d.ts","sourceRoot":"","sources":["../../../src/expo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAiBzD,KAAK,WAAW,GAAG;IAKjB,KAAK,EACD,WAAW,GACX,WAAW,GACX,mBAAmB,GACnB,sBAAsB,CAAC;CAC5B,CAAC;;AA2BF,wBAGE"}
@@ -0,0 +1,34 @@
1
+ import {} from '@expo/config-plugins';
2
+ import { createRequire } from 'node:module';
3
+ const require = createRequire(import.meta.url);
4
+ const ConfigPlugins = require('@expo/config-plugins');
5
+ const { createRunOncePlugin, withAndroidStyles } = ConfigPlugins;
6
+ const MATERIAL3_THEME_DYANMIC = 'Theme.Material3.DynamicColors.DayNight.NoActionBar';
7
+ const MATERIAL3_THEME = 'Theme.Material3.DayNight.NoActionBar';
8
+ const MATERIAL2_THEME = 'Theme.MaterialComponents.DayNight.NoActionBar';
9
+ const MATERIAL3_EXPRESSIVE_THEME = 'Theme.Material3Expressive.DayNight.NoActionBar';
10
+ const withMaterial3Theme = (config, options) => {
11
+ const theme = options?.theme;
12
+ return withAndroidStyles(config, (stylesConfig) => {
13
+ stylesConfig.modResults.resources.style =
14
+ stylesConfig.modResults.resources.style?.map((style) => {
15
+ if (style.$.name === 'AppTheme') {
16
+ if (theme === 'material3-dynamic') {
17
+ style.$.parent = MATERIAL3_THEME_DYANMIC;
18
+ }
19
+ else if (theme === 'material2') {
20
+ style.$.parent = MATERIAL2_THEME;
21
+ }
22
+ else if (theme === 'material3-expressive') {
23
+ style.$.parent = MATERIAL3_EXPRESSIVE_THEME;
24
+ }
25
+ else {
26
+ style.$.parent = MATERIAL3_THEME;
27
+ }
28
+ }
29
+ return style;
30
+ });
31
+ return stylesConfig;
32
+ });
33
+ };
34
+ export default createRunOncePlugin(withMaterial3Theme, 'react-native-bottom-tabs');
@@ -0,0 +1,15 @@
1
+ import TabView from './TabView';
2
+ /**
3
+ * Views
4
+ */
5
+ export default TabView;
6
+ /**
7
+ * Utilities
8
+ */
9
+ export { SceneMap } from './SceneMap';
10
+ export { useBottomTabBarHeight } from './utils/useBottomTabBarHeight';
11
+ export { BottomTabBarHeightContext } from './utils/BottomTabBarHeightContext';
12
+ /**
13
+ * Types
14
+ */
15
+ export type { AppleIcon, IconRenderingMode, LayoutDirection, TabRole, } from './types';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC;;GAEG;AACH,eAAe,OAAO,CAAC;AAEvB;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAE9E;;GAEG;AACH,YAAY,EACV,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,OAAO,GACR,MAAM,SAAS,CAAC"}
@@ -0,0 +1,11 @@
1
+ import TabView from './TabView';
2
+ /**
3
+ * Views
4
+ */
5
+ export default TabView;
6
+ /**
7
+ * Utilities
8
+ */
9
+ export { SceneMap } from './SceneMap';
10
+ export { useBottomTabBarHeight } from './utils/useBottomTabBarHeight';
11
+ export { BottomTabBarHeightContext } from './utils/BottomTabBarHeightContext';
@@ -0,0 +1,31 @@
1
+ import type { ImageSourcePropType, StyleProp, ViewStyle } from 'react-native';
2
+ import type { SFSymbol } from 'sf-symbols-typescript';
3
+ export type IconSource = string | ImageSourcePropType;
4
+ export type AppleIcon = {
5
+ sfSymbol: SFSymbol;
6
+ };
7
+ export type TabRole = 'search';
8
+ export type IconRenderingMode = 'automatic' | 'original';
9
+ export type LayoutDirection = 'ltr' | 'rtl' | 'locale';
10
+ export type BaseRoute = {
11
+ key: string;
12
+ title?: string;
13
+ badge?: string;
14
+ badgeBackgroundColor?: string;
15
+ badgeTextColor?: string;
16
+ lazy?: boolean;
17
+ focusedIcon?: ImageSourcePropType | AppleIcon;
18
+ unfocusedIcon?: ImageSourcePropType | AppleIcon;
19
+ iconRenderingMode?: IconRenderingMode;
20
+ activeTintColor?: string;
21
+ hidden?: boolean;
22
+ testID?: string;
23
+ role?: TabRole;
24
+ freezeOnBlur?: boolean;
25
+ style?: StyleProp<ViewStyle>;
26
+ preventsDefault?: boolean;
27
+ };
28
+ export type NavigationState<Route extends BaseRoute> = {
29
+ index: number;
30
+ routes: Route[];
31
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,SAAS,EA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
1
+ import * as React from 'react';
2
+ export declare const BottomTabBarHeightContext: React.Context<number | undefined>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomTabBarHeightContext.d.ts","sourceRoot":"","sources":["../../../../src/utils/BottomTabBarHeightContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,eAAO,MAAM,yBAAyB,mCAE1B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export const BottomTabBarHeightContext = React.createContext(undefined);
@@ -0,0 +1 @@
1
+ export declare function useBottomTabBarHeight(): number;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBottomTabBarHeight.d.ts","sourceRoot":"","sources":["../../../../src/utils/useBottomTabBarHeight.ts"],"names":[],"mappings":"AAIA,wBAAgB,qBAAqB,WAUpC"}
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import { BottomTabBarHeightContext } from './BottomTabBarHeightContext';
3
+ export function useBottomTabBarHeight() {
4
+ const height = React.useContext(BottomTabBarHeightContext);
5
+ if (height === undefined) {
6
+ throw new Error("Couldn't find the bottom tab bar height. Are you inside a screen in Native Bottom Tab Navigator?");
7
+ }
8
+ return height;
9
+ }