first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

21
node_modules/@react-navigation/bottom-tabs/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 React Navigation Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

5
node_modules/@react-navigation/bottom-tabs/README.md generated vendored Normal file
View File

@@ -0,0 +1,5 @@
# `@react-navigation/bottom-tabs`
Bottom tab navigator for React Navigation following iOS design guidelines.
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/bottom-tab-navigator/).

View File

@@ -0,0 +1,40 @@
"use strict";
/**
* Simple cross fade animation
*/
export function forFade({
current
}) {
return {
sceneStyle: {
opacity: current.progress.interpolate({
inputRange: [-1, 0, 1],
outputRange: [0, 1, 0]
})
}
};
}
/**
* Animation where the screens slightly shift to left/right
*/
export function forShift({
current
}) {
return {
sceneStyle: {
opacity: current.progress.interpolate({
inputRange: [-1, 0, 1],
outputRange: [0, 1, 0]
}),
transform: [{
translateX: current.progress.interpolate({
inputRange: [-1, 0, 1],
outputRange: [-50, 0, 50]
})
}]
}
};
}
//# sourceMappingURL=SceneStyleInterpolators.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["forFade","current","sceneStyle","opacity","progress","interpolate","inputRange","outputRange","forShift","transform","translateX"],"sourceRoot":"../../../src","sources":["TransitionConfigs/SceneStyleInterpolators.tsx"],"mappings":";;AAKA;AACA;AACA;AACA,OAAO,SAASA,OAAOA,CAAC;EACtBC;AACgC,CAAC,EAAmC;EACpE,OAAO;IACLC,UAAU,EAAE;MACVC,OAAO,EAAEF,OAAO,CAACG,QAAQ,CAACC,WAAW,CAAC;QACpCC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACtBC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;MACvB,CAAC;IACH;EACF,CAAC;AACH;;AAEA;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAAC;EACvBP;AACgC,CAAC,EAAmC;EACpE,OAAO;IACLC,UAAU,EAAE;MACVC,OAAO,EAAEF,OAAO,CAACG,QAAQ,CAACC,WAAW,CAAC;QACpCC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACtBC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;MACvB,CAAC,CAAC;MACFE,SAAS,EAAE,CACT;QACEC,UAAU,EAAET,OAAO,CAACG,QAAQ,CAACC,WAAW,CAAC;UACvCC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;UACtBC,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE;QAC1B,CAAC;MACH,CAAC;IAEL;EACF,CAAC;AACH","ignoreList":[]}

View File

@@ -0,0 +1,13 @@
"use strict";
import { forFade, forShift } from "./SceneStyleInterpolators.js";
import { FadeSpec, ShiftSpec } from "./TransitionSpecs.js";
export const FadeTransition = {
transitionSpec: FadeSpec,
sceneStyleInterpolator: forFade
};
export const ShiftTransition = {
transitionSpec: ShiftSpec,
sceneStyleInterpolator: forShift
};
//# sourceMappingURL=TransitionPresets.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["forFade","forShift","FadeSpec","ShiftSpec","FadeTransition","transitionSpec","sceneStyleInterpolator","ShiftTransition"],"sourceRoot":"../../../src","sources":["TransitionConfigs/TransitionPresets.tsx"],"mappings":";;AACA,SAASA,OAAO,EAAEC,QAAQ,QAAQ,8BAA2B;AAC7D,SAASC,QAAQ,EAAEC,SAAS,QAAQ,sBAAmB;AAEvD,OAAO,MAAMC,cAAyC,GAAG;EACvDC,cAAc,EAAEH,QAAQ;EACxBI,sBAAsB,EAAEN;AAC1B,CAAC;AAED,OAAO,MAAMO,eAA0C,GAAG;EACxDF,cAAc,EAAEF,SAAS;EACzBG,sBAAsB,EAAEL;AAC1B,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,18 @@
"use strict";
import { Easing } from 'react-native';
export const FadeSpec = {
animation: 'timing',
config: {
duration: 150,
easing: Easing.in(Easing.linear)
}
};
export const ShiftSpec = {
animation: 'timing',
config: {
duration: 150,
easing: Easing.inOut(Easing.ease)
}
};
//# sourceMappingURL=TransitionSpecs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["Easing","FadeSpec","animation","config","duration","easing","in","linear","ShiftSpec","inOut","ease"],"sourceRoot":"../../../src","sources":["TransitionConfigs/TransitionSpecs.tsx"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,cAAc;AAIrC,OAAO,MAAMC,QAAwB,GAAG;EACtCC,SAAS,EAAE,QAAQ;EACnBC,MAAM,EAAE;IACNC,QAAQ,EAAE,GAAG;IACbC,MAAM,EAAEL,MAAM,CAACM,EAAE,CAACN,MAAM,CAACO,MAAM;EACjC;AACF,CAAC;AAED,OAAO,MAAMC,SAAyB,GAAG;EACvCN,SAAS,EAAE,QAAQ;EACnBC,MAAM,EAAE;IACNC,QAAQ,EAAE,GAAG;IACbC,MAAM,EAAEL,MAAM,CAACS,KAAK,CAACT,MAAM,CAACU,IAAI;EAClC;AACF,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,33 @@
"use strict";
import * as SceneStyleInterpolators from "./TransitionConfigs/SceneStyleInterpolators.js";
import * as TransitionPresets from "./TransitionConfigs/TransitionPresets.js";
import * as TransitionSpecs from "./TransitionConfigs/TransitionSpecs.js";
/**
* Transition Presets
*/
export { SceneStyleInterpolators, TransitionPresets, TransitionSpecs };
/**
* Navigators
*/
export { createBottomTabNavigator } from "./navigators/createBottomTabNavigator.js";
/**
* Views
*/
export { BottomTabBar } from "./views/BottomTabBar.js";
export { BottomTabView } from "./views/BottomTabView.js";
/**
* Utilities
*/
export { BottomTabBarHeightCallbackContext } from "./utils/BottomTabBarHeightCallbackContext.js";
export { BottomTabBarHeightContext } from "./utils/BottomTabBarHeightContext.js";
export { useBottomTabBarHeight } from "./utils/useBottomTabBarHeight.js";
/**
* Types
*/
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["SceneStyleInterpolators","TransitionPresets","TransitionSpecs","createBottomTabNavigator","BottomTabBar","BottomTabView","BottomTabBarHeightCallbackContext","BottomTabBarHeightContext","useBottomTabBarHeight"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAO,KAAKA,uBAAuB,MAAM,gDAA6C;AACtF,OAAO,KAAKC,iBAAiB,MAAM,0CAAuC;AAC1E,OAAO,KAAKC,eAAe,MAAM,wCAAqC;;AAEtE;AACA;AACA;AACA,SAASF,uBAAuB,EAAEC,iBAAiB,EAAEC,eAAe;;AAEpE;AACA;AACA;AACA,SAASC,wBAAwB,QAAQ,0CAAuC;;AAEhF;AACA;AACA;AACA,SAASC,YAAY,QAAQ,yBAAsB;AACnD,SAASC,aAAa,QAAQ,0BAAuB;;AAErD;AACA;AACA;AACA,SAASC,iCAAiC,QAAQ,8CAA2C;AAC7F,SAASC,yBAAyB,QAAQ,sCAAmC;AAC7E,SAASC,qBAAqB,QAAQ,kCAA+B;;AAErE;AACA;AACA","ignoreList":[]}

View File

@@ -0,0 +1,48 @@
"use strict";
import { createNavigatorFactory, TabRouter, useNavigationBuilder } from '@react-navigation/native';
import { BottomTabView } from "../views/BottomTabView.js";
import { jsx as _jsx } from "react/jsx-runtime";
function BottomTabNavigator({
id,
initialRouteName,
backBehavior,
UNSTABLE_routeNamesChangeBehavior,
children,
layout,
screenListeners,
screenOptions,
screenLayout,
UNSTABLE_router,
...rest
}) {
const {
state,
descriptors,
navigation,
NavigationContent
} = useNavigationBuilder(TabRouter, {
id,
initialRouteName,
backBehavior,
UNSTABLE_routeNamesChangeBehavior,
children,
layout,
screenListeners,
screenOptions,
screenLayout,
UNSTABLE_router
});
return /*#__PURE__*/_jsx(NavigationContent, {
children: /*#__PURE__*/_jsx(BottomTabView, {
...rest,
state: state,
navigation: navigation,
descriptors: descriptors
})
});
}
export function createBottomTabNavigator(config) {
return createNavigatorFactory(BottomTabNavigator)(config);
}
//# sourceMappingURL=createBottomTabNavigator.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["createNavigatorFactory","TabRouter","useNavigationBuilder","BottomTabView","jsx","_jsx","BottomTabNavigator","id","initialRouteName","backBehavior","UNSTABLE_routeNamesChangeBehavior","children","layout","screenListeners","screenOptions","screenLayout","UNSTABLE_router","rest","state","descriptors","navigation","NavigationContent","createBottomTabNavigator","config"],"sourceRoot":"../../../src","sources":["navigators/createBottomTabNavigator.tsx"],"mappings":";;AAAA,SACEA,sBAAsB,EAMtBC,SAAS,EAGTC,oBAAoB,QACf,0BAA0B;AAQjC,SAASC,aAAa,QAAQ,2BAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEvD,SAASC,kBAAkBA,CAAC;EAC1BC,EAAE;EACFC,gBAAgB;EAChBC,YAAY;EACZC,iCAAiC;EACjCC,QAAQ;EACRC,MAAM;EACNC,eAAe;EACfC,aAAa;EACbC,YAAY;EACZC,eAAe;EACf,GAAGC;AACoB,CAAC,EAAE;EAC1B,MAAM;IAAEC,KAAK;IAAEC,WAAW;IAAEC,UAAU;IAAEC;EAAkB,CAAC,GACzDnB,oBAAoB,CAMlBD,SAAS,EAAE;IACXM,EAAE;IACFC,gBAAgB;IAChBC,YAAY;IACZC,iCAAiC;IACjCC,QAAQ;IACRC,MAAM;IACNC,eAAe;IACfC,aAAa;IACbC,YAAY;IACZC;EACF,CAAC,CAAC;EAEJ,oBACEX,IAAA,CAACgB,iBAAiB;IAAAV,QAAA,eAChBN,IAAA,CAACF,aAAa;MAAA,GACRc,IAAI;MACRC,KAAK,EAAEA,KAAM;MACbE,UAAU,EAAEA,UAAW;MACvBD,WAAW,EAAEA;IAAY,CAC1B;EAAC,CACe,CAAC;AAExB;AAEA,OAAO,SAASG,wBAAwBA,CAmBtCC,MAAe,EAAmC;EAClD,OAAOvB,sBAAsB,CAACM,kBAAkB,CAAC,CAACiB,MAAM,CAAC;AAC3D","ignoreList":[]}

View File

@@ -0,0 +1 @@
{"type":"module"}

View File

@@ -0,0 +1,4 @@
"use strict";
export {};
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.tsx"],"mappings":"","ignoreList":[]}

View File

@@ -0,0 +1,6 @@
"use strict";
export function NativeBottomTabView(_) {
throw new Error('Native Bottom Tabs are not supported on this platform.');
}
//# sourceMappingURL=NativeBottomTabView.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["NativeBottomTabView","_","Error"],"sourceRoot":"../../../src","sources":["unstable/NativeBottomTabView.tsx"],"mappings":";;AAiBA,OAAO,SAASA,mBAAmBA,CAACC,CAAQ,EAAE;EAC5C,MAAM,IAAIC,KAAK,CAAC,wDAAwD,CAAC;AAC3E","ignoreList":[]}

View File

@@ -0,0 +1,328 @@
"use strict";
import { getLabel, Lazy, SafeAreaProviderCompat, Screen as ScreenContent } from '@react-navigation/elements';
import { CommonActions, NavigationMetaContext, StackActions, useTheme } from '@react-navigation/native';
import Color from 'color';
import * as React from 'react';
import { Platform, PlatformColor } from 'react-native';
import { Tabs } from 'react-native-screens';
import { NativeScreen } from "./NativeScreen/NativeScreen.js";
import { jsx as _jsx } from "react/jsx-runtime";
const meta = {
type: 'native-tabs'
};
export function NativeBottomTabView({
state,
navigation,
descriptors
}) {
const {
dark,
colors,
fonts
} = useTheme();
const focusedRouteKey = state.routes[state.index].key;
const previousRouteKeyRef = React.useRef(focusedRouteKey);
React.useEffect(() => {
const previousRouteKey = previousRouteKeyRef.current;
if (previousRouteKey !== focusedRouteKey && descriptors[previousRouteKey]?.options.popToTopOnBlur) {
const prevRoute = state.routes.find(route => route.key === previousRouteKey);
if (prevRoute?.state?.type === 'stack' && prevRoute.state.key) {
const popToTopAction = {
...StackActions.popToTop(),
target: prevRoute.state.key
};
navigation.dispatch(popToTopAction);
}
}
previousRouteKeyRef.current = focusedRouteKey;
}, [descriptors, focusedRouteKey, navigation, state.index, state.routes]);
const currentOptions = descriptors[state.routes[state.index].key]?.options;
const {
fontFamily = Platform.select({
ios: fonts.medium.fontFamily,
default: fonts.regular.fontFamily
}),
fontWeight = Platform.select({
ios: fonts.medium.fontWeight,
default: fonts.regular.fontWeight
}),
fontSize,
fontStyle,
color: fontColor
} = currentOptions.tabBarLabelStyle || {};
const activeTintColor = currentOptions.tabBarActiveTintColor ?? colors.primary;
const inactiveTintColor = currentOptions.tabBarInactiveTintColor ?? Platform.select({
ios: PlatformColor('label'),
default: colors.text
});
const activeIndicatorColor = currentOptions?.tabBarActiveIndicatorColor ?? typeof activeTintColor === 'string' ? Color(activeTintColor)?.alpha(0.1).string() : undefined;
const onTransitionStart = ({
closing,
route
}) => {
navigation.emit({
type: 'transitionStart',
data: {
closing
},
target: route.key
});
};
const onTransitionEnd = ({
closing,
route
}) => {
navigation.emit({
type: 'transitionEnd',
data: {
closing
},
target: route.key
});
};
const tabBarControllerMode = currentOptions.tabBarControllerMode === 'auto' ? 'automatic' : currentOptions.tabBarControllerMode;
const tabBarMinimizeBehavior = currentOptions.tabBarMinimizeBehavior === 'auto' ? 'automatic' : currentOptions.tabBarMinimizeBehavior;
const shouldHideTabBar = currentOptions.tabBarStyle?.display === 'none';
const bottomAccessory = currentOptions.bottomAccessory;
return /*#__PURE__*/_jsx(SafeAreaProviderCompat, {
children: /*#__PURE__*/_jsx(Tabs.Host, {
bottomAccessory: bottomAccessory ? environment => bottomAccessory({
placement: environment
}) : undefined,
tabBarHidden: shouldHideTabBar,
tabBarItemLabelVisibilityMode: currentOptions?.tabBarLabelVisibilityMode,
tabBarControllerMode: tabBarControllerMode,
tabBarMinimizeBehavior: tabBarMinimizeBehavior,
tabBarTintColor: activeTintColor,
tabBarItemIconColor: inactiveTintColor,
tabBarItemIconColorActive: activeTintColor,
tabBarItemTitleFontColor: inactiveTintColor ?? fontColor,
tabBarItemTitleFontColorActive: activeTintColor,
tabBarItemTitleFontFamily: fontFamily,
tabBarItemTitleFontWeight: fontWeight,
tabBarItemTitleFontSize: fontSize,
tabBarItemTitleFontSizeActive: fontSize,
tabBarItemTitleFontStyle: fontStyle,
tabBarBackgroundColor: currentOptions.tabBarStyle?.backgroundColor ?? colors.card,
tabBarItemActiveIndicatorColor: activeIndicatorColor,
tabBarItemActiveIndicatorEnabled: currentOptions?.tabBarActiveIndicatorEnabled,
tabBarItemRippleColor: currentOptions?.tabBarRippleColor,
experimentalControlNavigationStateInJS: false,
onNativeFocusChange: e => {
const route = state.routes.find(route => route.key === e.nativeEvent.tabKey);
if (route) {
navigation.emit({
type: 'tabPress',
target: route.key
});
const isFocused = state.index === state.routes.findIndex(r => r.key === route.key);
if (!isFocused) {
navigation.dispatch({
...CommonActions.navigate(route.name, route.params),
target: state.key
});
}
}
},
children: state.routes.map((route, index) => {
const {
options,
render,
navigation
} = descriptors[route.key];
const isFocused = state.index === index;
const isPreloaded = state.preloadedRouteKeys.includes(route.key);
const {
title,
lazy = true,
tabBarLabel,
tabBarBadgeStyle,
tabBarIcon,
tabBarBadge,
tabBarSystemItem,
tabBarBlurEffect = dark ? 'systemMaterialDark' : 'systemMaterial',
tabBarStyle,
overrideScrollViewContentInsetAdjustmentBehavior
} = options;
const {
backgroundColor: tabBarBackgroundColor,
shadowColor: tabBarShadowColor
} = tabBarStyle || {};
const tabTitle =
// On iOS, `systemItem` already provides a localized label
// So we should only use `tabBarLabel` if explicitly provided
Platform.OS === 'ios' && tabBarSystemItem != null ? tabBarLabel : getLabel({
label: tabBarLabel,
title
}, route.name);
const badgeBackgroundColor = tabBarBadgeStyle?.backgroundColor ?? colors.notification;
const badgeTextColor = tabBarBadgeStyle?.color ?? (typeof badgeBackgroundColor === 'string' ? Color(badgeBackgroundColor).isLight() ? 'black' : 'white' : undefined);
const tabItemAppearance = {
tabBarItemTitleFontFamily: fontFamily,
tabBarItemTitleFontSize: fontSize,
tabBarItemTitleFontWeight: fontWeight,
tabBarItemTitleFontStyle: fontStyle,
tabBarItemTitleFontColor: inactiveTintColor ?? fontColor,
tabBarItemIconColor: inactiveTintColor,
tabBarItemBadgeBackgroundColor: badgeBackgroundColor
};
const icon = typeof tabBarIcon === 'function' ? getPlatformIcon(tabBarIcon({
focused: false
})) : tabBarIcon != null ? getPlatformIcon(tabBarIcon) : undefined;
const selectedIcon = typeof tabBarIcon === 'function' ? getPlatformIcon(tabBarIcon({
focused: true
})) : undefined;
return /*#__PURE__*/_jsx(Tabs.Screen, {
onWillDisappear: () => onTransitionStart({
closing: true,
route
}),
onWillAppear: () => onTransitionStart({
closing: false,
route
}),
onDidAppear: () => onTransitionEnd({
closing: false,
route
}),
onDidDisappear: () => onTransitionEnd({
closing: true,
route
}),
tabKey: route.key,
icon: icon,
selectedIcon: selectedIcon?.ios ?? selectedIcon?.shared,
tabBarItemBadgeBackgroundColor: badgeBackgroundColor,
tabBarItemBadgeTextColor: badgeTextColor,
badgeValue: tabBarBadge?.toString(),
systemItem: tabBarSystemItem,
isFocused: isFocused,
title: tabTitle,
scrollEdgeAppearance: {
tabBarBackgroundColor,
tabBarShadowColor,
tabBarBlurEffect,
stacked: {
normal: tabItemAppearance
},
inline: {
normal: tabItemAppearance
},
compactInline: {
normal: tabItemAppearance
}
},
standardAppearance: {
tabBarBackgroundColor,
tabBarShadowColor,
tabBarBlurEffect,
stacked: {
normal: tabItemAppearance
},
inline: {
normal: tabItemAppearance
},
compactInline: {
normal: tabItemAppearance
}
},
specialEffects: {
repeatedTabSelection: {
popToRoot: true,
scrollToTop: true
}
},
overrideScrollViewContentInsetAdjustmentBehavior: overrideScrollViewContentInsetAdjustmentBehavior,
experimental_userInterfaceStyle: dark ? 'dark' : 'light',
children: /*#__PURE__*/_jsx(Lazy, {
enabled: lazy,
visible: isFocused || isPreloaded,
children: /*#__PURE__*/_jsx(ScreenWithHeader, {
isFocused: isFocused,
route: route,
navigation: navigation,
options: options,
children: /*#__PURE__*/_jsx(NavigationMetaContext.Provider, {
value: meta,
children: render()
})
})
})
}, route.key);
})
})
});
}
function ScreenWithHeader({
isFocused,
route,
navigation,
options,
children
}) {
const {
headerTransparent,
header: renderCustomHeader,
headerShown = renderCustomHeader != null
} = options;
const hasNativeHeader = headerShown && renderCustomHeader == null;
const [wasNativeHeaderShown] = React.useState(hasNativeHeader);
React.useEffect(() => {
if (wasNativeHeaderShown !== hasNativeHeader) {
throw new Error(`Changing 'headerShown' or 'header' options dynamically is not supported when using native header.`);
}
}, [wasNativeHeaderShown, hasNativeHeader]);
if (hasNativeHeader) {
return /*#__PURE__*/_jsx(NativeScreen, {
route: route,
navigation: navigation,
options: options,
children: children
});
}
return /*#__PURE__*/_jsx(ScreenContent, {
focused: isFocused,
route: route,
navigation: navigation,
headerShown: headerShown,
headerTransparent: headerTransparent,
header: renderCustomHeader?.({
route,
navigation,
options
}),
children: children
});
}
function getPlatformIcon(icon) {
switch (icon.type) {
case 'sfSymbol':
return {
ios: icon,
android: undefined,
shared: undefined
};
case 'image':
return {
ios: icon.tinted === false ? {
type: 'imageSource',
imageSource: icon.source
} : {
type: 'templateSource',
templateSource: icon.source
},
android: undefined,
shared: {
type: 'imageSource',
imageSource: icon.source
}
};
default:
{
const _exhaustiveCheck = icon;
return _exhaustiveCheck;
}
}
}
//# sourceMappingURL=NativeBottomTabView.native.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,152 @@
"use strict";
import { getDefaultHeaderHeight, HeaderHeightContext, HeaderShownContext, useFrameSize } from '@react-navigation/elements';
import * as React from 'react';
import { Animated, Platform, StyleSheet, useAnimatedValue, View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { ScreenStack, ScreenStackItem } from 'react-native-screens';
import { debounce } from "./debounce.js";
import { AnimatedHeaderHeightContext } from "./useAnimatedHeaderHeight.js";
import { useHeaderConfig } from "./useHeaderConfig.js";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const ANDROID_DEFAULT_HEADER_HEIGHT = 56;
export function NativeScreen({
route,
navigation,
options,
children
}) {
const {
header: renderCustomHeader,
headerShown = renderCustomHeader != null,
headerTransparent,
headerBackground
} = options;
const isModal = false;
const insets = useSafeAreaInsets();
// Modals are fullscreen in landscape only on iPhone
const isIPhone = Platform.OS === 'ios' && !(Platform.isPad || Platform.isTV);
const isParentHeaderShown = React.useContext(HeaderShownContext);
const parentHeaderHeight = React.useContext(HeaderHeightContext);
const isLandscape = useFrameSize(frame => frame.width > frame.height);
const topInset = isParentHeaderShown || Platform.OS === 'ios' && isModal || isIPhone && isLandscape ? 0 : insets.top;
const defaultHeaderHeight = useFrameSize(frame => Platform.select({
// FIXME: Currently screens isn't using Material 3
// So our `getDefaultHeaderHeight` doesn't return the correct value
// So we hardcode the value here for now until screens is updated
android: ANDROID_DEFAULT_HEADER_HEIGHT + topInset,
default: getDefaultHeaderHeight(frame, isModal, topInset)
}));
const [headerHeight, setHeaderHeight] = React.useState(defaultHeaderHeight);
// eslint-disable-next-line react-hooks/exhaustive-deps
const setHeaderHeightDebounced = React.useCallback(
// Debounce the header height updates to avoid excessive re-renders
debounce(setHeaderHeight, 100), []);
const hasCustomHeader = renderCustomHeader != null;
const animatedHeaderHeight = useAnimatedValue(defaultHeaderHeight);
const headerTopInsetEnabled = topInset !== 0;
const onHeaderHeightChange = Animated.event([{
nativeEvent: {
headerHeight: animatedHeaderHeight
}
}], {
useNativeDriver: true,
listener: e => {
if (hasCustomHeader) {
// If we have a custom header, don't use native header height
return;
}
if (e.nativeEvent && typeof e.nativeEvent === 'object' && 'headerHeight' in e.nativeEvent && typeof e.nativeEvent.headerHeight === 'number') {
const headerHeight = e.nativeEvent.headerHeight;
// Only debounce if header has large title or search bar
// As it's the only case where the header height can change frequently
const doesHeaderAnimate = Platform.OS === 'ios' && (options.headerLargeTitleEnabled || options.headerSearchBarOptions);
if (doesHeaderAnimate) {
setHeaderHeightDebounced(headerHeight);
} else {
setHeaderHeight(headerHeight);
}
}
}
});
const headerConfig = useHeaderConfig({
...options,
route,
headerHeight,
headerShown: hasCustomHeader ? false : headerShown === true,
headerTopInsetEnabled
});
return /*#__PURE__*/_jsx(ScreenStack, {
style: styles.container,
children: /*#__PURE__*/_jsx(ScreenStackItem, {
screenId: route.key
// Needed to show search bar in tab bar with systemItem=search
,
stackPresentation: "push",
headerConfig: headerConfig,
onHeaderHeightChange: onHeaderHeightChange,
children: /*#__PURE__*/_jsx(AnimatedHeaderHeightContext.Provider, {
value: animatedHeaderHeight,
children: /*#__PURE__*/_jsxs(HeaderHeightContext.Provider, {
value: headerShown ? headerHeight : parentHeaderHeight ?? 0,
children: [headerBackground != null ?
/*#__PURE__*/
/**
* To show a custom header background, we render it at the top of the screen below the header
* The header also needs to be positioned absolutely (with `translucent` style)
*/
_jsx(View, {
style: [styles.background, headerTransparent ? styles.translucent : null, {
height: headerHeight
}],
children: headerBackground()
}) : null, hasCustomHeader && headerShown ? /*#__PURE__*/_jsx(View, {
onLayout: e => {
const headerHeight = e.nativeEvent.layout.height;
setHeaderHeight(headerHeight);
animatedHeaderHeight.setValue(headerHeight);
},
style: [styles.header, headerTransparent ? styles.absolute : null],
children: renderCustomHeader?.({
route,
navigation,
options
})
}) : null, /*#__PURE__*/_jsx(HeaderShownContext.Provider, {
value: isParentHeaderShown || headerShown,
children: children
})]
})
})
})
});
}
const styles = StyleSheet.create({
container: {
flex: 1
},
header: {
zIndex: 1
},
absolute: {
position: 'absolute',
top: 0,
start: 0,
end: 0
},
translucent: {
position: 'absolute',
top: 0,
start: 0,
end: 0,
zIndex: 1,
elevation: 1
},
background: {
overflow: 'hidden'
}
});
//# sourceMappingURL=NativeScreen.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,12 @@
"use strict";
export function debounce(func, duration) {
let timeout;
return function (...args) {
clearTimeout(timeout);
timeout = setTimeout(() => {
func.apply(this, args);
}, duration);
};
}
//# sourceMappingURL=debounce.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["debounce","func","duration","timeout","args","clearTimeout","setTimeout","apply"],"sourceRoot":"../../../../src","sources":["unstable/NativeScreen/debounce.tsx"],"mappings":";;AAAA,OAAO,SAASA,QAAQA,CACtBC,IAAO,EACPC,QAAgB,EACb;EACH,IAAIC,OAAsC;EAE1C,OAAO,UAAyB,GAAGC,IAAI,EAAE;IACvCC,YAAY,CAACF,OAAO,CAAC;IAErBA,OAAO,GAAGG,UAAU,CAAC,MAAM;MACzBL,IAAI,CAACM,KAAK,CAAC,IAAI,EAAEH,IAAI,CAAC;IACxB,CAAC,EAAEF,QAAQ,CAAC;EACd,CAAC;AACH","ignoreList":[]}

View File

@@ -0,0 +1,4 @@
"use strict";
export {};
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["unstable/NativeScreen/types.ts"],"mappings":"","ignoreList":[]}

View File

@@ -0,0 +1,12 @@
"use strict";
import * as React from 'react';
export const AnimatedHeaderHeightContext = /*#__PURE__*/React.createContext(undefined);
export function useAnimatedHeaderHeight() {
const animatedValue = React.useContext(AnimatedHeaderHeightContext);
if (animatedValue === undefined) {
throw new Error("Couldn't find the header height. Are you inside a screen in a native stack navigator?");
}
return animatedValue;
}
//# sourceMappingURL=useAnimatedHeaderHeight.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","AnimatedHeaderHeightContext","createContext","undefined","useAnimatedHeaderHeight","animatedValue","useContext","Error"],"sourceRoot":"../../../../src","sources":["unstable/NativeScreen/useAnimatedHeaderHeight.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,OAAO,MAAMC,2BAA2B,gBAAGD,KAAK,CAACE,aAAa,CAE5DC,SAAS,CAAC;AAEZ,OAAO,SAASC,uBAAuBA,CAAA,EAAG;EACxC,MAAMC,aAAa,GAAGL,KAAK,CAACM,UAAU,CAACL,2BAA2B,CAAC;EAEnE,IAAII,aAAa,KAAKF,SAAS,EAAE;IAC/B,MAAM,IAAII,KAAK,CACb,uFACF,CAAC;EACH;EAEA,OAAOF,aAAa;AACtB","ignoreList":[]}

View File

@@ -0,0 +1,304 @@
"use strict";
import { getHeaderTitle, HeaderTitle } from '@react-navigation/elements';
import { useLocale, useTheme } from '@react-navigation/native';
import Color from 'color';
import { Platform, StyleSheet, View } from 'react-native';
import { isSearchBarAvailableForCurrentPlatform, ScreenStackHeaderCenterView, ScreenStackHeaderLeftView, ScreenStackHeaderRightView, ScreenStackHeaderSearchBarView, SearchBar } from 'react-native-screens';
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
const processBarButtonItems = (items, colors, fonts) => {
return items?.map((item, index) => {
if (item.type === 'custom') {
// Handled with `ScreenStackHeaderLeftView` or `ScreenStackHeaderRightView`
return null;
}
if (item.type === 'spacing') {
if (item.spacing == null) {
throw new Error(`Spacing item must have a 'spacing' property defined: ${JSON.stringify(item)}`);
}
return item;
}
if (item.type === 'button' || item.type === 'menu') {
if (item.type === 'menu' && item.menu == null) {
throw new Error(`Menu item must have a 'menu' property defined: ${JSON.stringify(item)}`);
}
const {
badge,
label,
labelStyle,
icon,
...rest
} = item;
let processedItem = {
...rest,
index,
title: label,
titleStyle: {
...fonts.regular,
...labelStyle
},
icon: icon?.type === 'image' ? icon.tinted === false ? {
type: 'imageSource',
imageSource: icon.source
} : {
type: 'templateSource',
templateSource: icon.source
} : icon
};
if (processedItem.type === 'menu' && item.type === 'menu') {
const {
multiselectable,
layout
} = item.menu;
processedItem = {
...processedItem,
menu: {
...processedItem.menu,
singleSelection: !multiselectable,
displayAsPalette: layout === 'palette',
items: item.menu.items.map(getMenuItem)
}
};
}
if (badge) {
const badgeBackgroundColor = badge.style?.backgroundColor ?? colors.notification;
const badgeTextColor = typeof badgeBackgroundColor === 'string' && Color(badgeBackgroundColor)?.isLight() ? 'black' : 'white';
processedItem = {
...processedItem,
badge: {
...badge,
value: String(badge.value),
style: {
backgroundColor: badgeBackgroundColor,
color: badgeTextColor,
...fonts.regular,
...badge.style
}
}
};
}
return processedItem;
}
throw new Error(`Invalid item type: ${JSON.stringify(item)}. Valid types are 'button', 'menu', 'custom' and 'spacing'.`);
}).filter(item => item != null);
};
const getMenuItem = item => {
if (item.type === 'submenu') {
const {
label,
inline,
layout,
items,
multiselectable,
...rest
} = item;
return {
...rest,
title: label,
displayAsPalette: layout === 'palette',
displayInline: inline,
singleSelection: !multiselectable,
items: items.map(getMenuItem)
};
}
const {
label,
description,
...rest
} = item;
return {
...rest,
title: label,
subtitle: description
};
};
export function useHeaderConfig({
headerShadowVisible,
headerLargeStyle,
headerLargeTitleEnabled,
headerLargeTitleShadowVisible,
headerLargeTitleStyle,
headerBackground,
headerLeft,
headerRight,
headerShown,
headerStyle,
headerBlurEffect,
headerTintColor,
headerTitle,
headerTitleAlign,
headerTitleStyle,
headerTransparent,
headerSearchBarOptions,
headerTopInsetEnabled,
route,
title,
unstable_headerLeftItems: headerLeftItems,
unstable_headerRightItems: headerRightItems
}) {
const {
direction
} = useLocale();
const {
colors,
fonts,
dark
} = useTheme();
const tintColor = headerTintColor ?? (Platform.OS === 'ios' ? colors.primary : colors.text);
const headerLargeTitleStyleFlattened = StyleSheet.flatten([Platform.select({
ios: fonts.heavy,
default: fonts.medium
}), headerLargeTitleStyle]) || {};
const headerTitleStyleFlattened = StyleSheet.flatten([Platform.select({
ios: fonts.bold,
default: fonts.medium
}), headerTitleStyle]) || {};
const headerStyleFlattened = StyleSheet.flatten(headerStyle) || {};
const headerLargeStyleFlattened = StyleSheet.flatten(headerLargeStyle) || {};
const titleText = getHeaderTitle({
title,
headerTitle
}, route.name);
const titleColor = 'color' in headerTitleStyleFlattened ? headerTitleStyleFlattened.color : headerTintColor ?? colors.text;
const titleFontSize = 'fontSize' in headerTitleStyleFlattened ? headerTitleStyleFlattened.fontSize : undefined;
const titleFontFamily = headerTitleStyleFlattened.fontFamily;
const titleFontWeight = headerTitleStyleFlattened.fontWeight;
const largeTitleFontFamily = headerLargeTitleStyleFlattened.fontFamily;
const largeTitleBackgroundColor = headerLargeStyleFlattened.backgroundColor;
const largeTitleColor = 'color' in headerLargeTitleStyleFlattened ? headerLargeTitleStyleFlattened.color : undefined;
const largeTitleFontSize = 'fontSize' in headerLargeTitleStyleFlattened ? headerLargeTitleStyleFlattened.fontSize : undefined;
const largeTitleFontWeight = headerLargeTitleStyleFlattened.fontWeight;
const headerTitleStyleSupported = {
color: titleColor
};
if (headerTitleStyleFlattened.fontFamily != null) {
headerTitleStyleSupported.fontFamily = headerTitleStyleFlattened.fontFamily;
}
if (titleFontSize != null) {
headerTitleStyleSupported.fontSize = titleFontSize;
}
if (titleFontWeight != null) {
headerTitleStyleSupported.fontWeight = titleFontWeight;
}
const headerBackgroundColor = headerStyleFlattened.backgroundColor ?? (headerBackground != null || headerTransparent ? 'transparent' : colors.card);
const headerLeftElement = headerLeft?.({
tintColor
});
const headerRightElement = headerRight?.({
tintColor
});
const headerTitleElement = typeof headerTitle === 'function' ? headerTitle({
tintColor,
children: titleText
}) : null;
const hasHeaderSearchBar = isSearchBarAvailableForCurrentPlatform && headerSearchBarOptions != null;
const translucent = headerBackground != null || headerTransparent ||
// When using a SearchBar or large title, the header needs to be translucent for it to work on iOS
(hasHeaderSearchBar || headerLargeTitleEnabled) && Platform.OS === 'ios' && headerTransparent !== false;
const isCenterViewRenderedAndroid = headerTitleAlign === 'center';
const leftItems = headerLeftItems?.({
tintColor
});
let rightItems = headerRightItems?.({
tintColor
});
if (rightItems) {
// iOS renders right items in reverse order
// So we need to reverse them here to match the order
rightItems = [...rightItems].reverse();
}
const children = /*#__PURE__*/_jsxs(_Fragment, {
children: [Platform.OS === 'ios' ? /*#__PURE__*/_jsxs(_Fragment, {
children: [leftItems ? leftItems.map((item, index) => {
if (item.type === 'custom') {
return /*#__PURE__*/_jsx(ScreenStackHeaderLeftView
// eslint-disable-next-line @eslint-react/no-array-index-key
, {
hidesSharedBackground: item.hidesSharedBackground,
children: item.element
}, index);
}
return null;
}) : headerLeftElement != null ? /*#__PURE__*/_jsx(ScreenStackHeaderLeftView, {
children: headerLeftElement
}) : null, headerTitleElement != null ? /*#__PURE__*/_jsx(ScreenStackHeaderCenterView, {
children: headerTitleElement
}) : null]
}) : /*#__PURE__*/_jsxs(_Fragment, {
children: [headerLeftElement != null || typeof headerTitle === 'function' ?
/*#__PURE__*/
// The style passed to header left, together with title element being wrapped
// in flex view is reqruied for proper header layout, in particular,
// for the text truncation to work.
_jsxs(ScreenStackHeaderLeftView, {
style: !isCenterViewRenderedAndroid ? {
flex: 1
} : null,
children: [headerLeftElement, headerTitleAlign !== 'center' ? typeof headerTitle === 'function' ? /*#__PURE__*/_jsx(View, {
style: {
flex: 1
},
children: headerTitleElement
}) : /*#__PURE__*/_jsx(View, {
style: {
flex: 1
},
children: /*#__PURE__*/_jsx(HeaderTitle, {
tintColor: tintColor,
style: headerTitleStyleSupported,
children: titleText
})
}) : null]
}) : null, isCenterViewRenderedAndroid ? /*#__PURE__*/_jsx(ScreenStackHeaderCenterView, {
children: typeof headerTitle === 'function' ? headerTitleElement : /*#__PURE__*/_jsx(HeaderTitle, {
tintColor: tintColor,
style: headerTitleStyleSupported,
children: titleText
})
}) : null]
}), Platform.OS === 'ios' && rightItems ? rightItems.map((item, index) => {
if (item.type === 'custom') {
return /*#__PURE__*/_jsx(ScreenStackHeaderRightView
// eslint-disable-next-line @eslint-react/no-array-index-key
, {
hidesSharedBackground: item.hidesSharedBackground,
children: item.element
}, index);
}
return null;
}) : headerRightElement != null ? /*#__PURE__*/_jsx(ScreenStackHeaderRightView, {
children: headerRightElement
}) : null, hasHeaderSearchBar ? /*#__PURE__*/_jsx(ScreenStackHeaderSearchBarView, {
children: /*#__PURE__*/_jsx(SearchBar, {
...headerSearchBarOptions
})
}) : null]
});
return {
backgroundColor: headerBackgroundColor,
blurEffect: headerBlurEffect,
color: tintColor,
direction,
hidden: headerShown === false,
hideShadow: headerShadowVisible === false || headerBackground != null || headerTransparent && headerShadowVisible !== true,
largeTitle: headerLargeTitleEnabled,
largeTitleBackgroundColor,
largeTitleColor,
largeTitleFontFamily,
largeTitleFontSize,
largeTitleFontWeight,
largeTitleHideShadow: headerLargeTitleShadowVisible === false,
title: titleText,
titleColor,
titleFontFamily,
titleFontSize,
titleFontWeight: String(titleFontWeight),
topInsetEnabled: headerTopInsetEnabled,
translucent: translucent === true,
children,
headerLeftBarButtonItems: processBarButtonItems(leftItems, colors, fonts),
headerRightBarButtonItems: processBarButtonItems(rightItems, colors, fonts),
experimental_userInterfaceStyle: dark ? 'dark' : 'light'
};
}
//# sourceMappingURL=useHeaderConfig.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,6 @@
"use strict";
export const createNativeBottomTabNavigator = () => {
throw new Error('Native Bottom Tabs are not supported on this platform.');
};
//# sourceMappingURL=createNativeBottomTabNavigator.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["createNativeBottomTabNavigator","Error"],"sourceRoot":"../../../src","sources":["unstable/createNativeBottomTabNavigator.tsx"],"mappings":";;AAAA,OAAO,MAAMA,8BAAuH,GAClIA,CAAA,KAAM;EACJ,MAAM,IAAIC,KAAK,CAAC,wDAAwD,CAAC;AAC3E,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,65 @@
"use strict";
import { createNavigatorFactory, StackActions, TabRouter, useNavigationBuilder } from '@react-navigation/native';
import * as React from 'react';
import { NativeBottomTabView } from "./NativeBottomTabView.native.js";
import { jsx as _jsx } from "react/jsx-runtime";
function NativeBottomTabNavigator({
id,
initialRouteName,
backBehavior,
children,
layout,
screenListeners,
screenOptions,
screenLayout,
UNSTABLE_router,
UNSTABLE_routeNamesChangeBehavior,
...rest
}) {
const {
state,
navigation,
descriptors,
NavigationContent
} = useNavigationBuilder(TabRouter, {
id,
initialRouteName,
backBehavior,
children,
layout,
screenListeners,
screenOptions,
screenLayout,
UNSTABLE_router,
UNSTABLE_routeNamesChangeBehavior
});
const focusedRouteKey = state.routes[state.index].key;
const previousRouteKeyRef = React.useRef(focusedRouteKey);
React.useEffect(() => {
const previousRouteKey = previousRouteKeyRef.current;
if (previousRouteKey !== focusedRouteKey && descriptors[previousRouteKey]?.options.popToTopOnBlur) {
const prevRoute = state.routes.find(route => route.key === previousRouteKey);
if (prevRoute?.state?.type === 'stack' && prevRoute.state.key) {
const popToTopAction = {
...StackActions.popToTop(),
target: prevRoute.state.key
};
navigation.dispatch(popToTopAction);
}
}
previousRouteKeyRef.current = focusedRouteKey;
}, [descriptors, focusedRouteKey, navigation, state.index, state.routes]);
return /*#__PURE__*/_jsx(NavigationContent, {
children: /*#__PURE__*/_jsx(NativeBottomTabView, {
...rest,
state: state,
navigation: navigation,
descriptors: descriptors
})
});
}
export function createNativeBottomTabNavigator(config) {
return createNavigatorFactory(NativeBottomTabNavigator)(config);
}
//# sourceMappingURL=createNativeBottomTabNavigator.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["createNavigatorFactory","StackActions","TabRouter","useNavigationBuilder","React","NativeBottomTabView","jsx","_jsx","NativeBottomTabNavigator","id","initialRouteName","backBehavior","children","layout","screenListeners","screenOptions","screenLayout","UNSTABLE_router","UNSTABLE_routeNamesChangeBehavior","rest","state","navigation","descriptors","NavigationContent","focusedRouteKey","routes","index","key","previousRouteKeyRef","useRef","useEffect","previousRouteKey","current","options","popToTopOnBlur","prevRoute","find","route","type","popToTopAction","popToTop","target","dispatch","createNativeBottomTabNavigator","config"],"sourceRoot":"../../../src","sources":["unstable/createNativeBottomTabNavigator.native.tsx"],"mappings":";;AAAA,SACEA,sBAAsB,EAGtBC,YAAY,EAIZC,SAAS,EAGTC,oBAAoB,QACf,0BAA0B;AACjC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAE9B,SAASC,mBAAmB,QAAQ,iCAA8B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQnE,SAASC,wBAAwBA,CAAC;EAChCC,EAAE;EACFC,gBAAgB;EAChBC,YAAY;EACZC,QAAQ;EACRC,MAAM;EACNC,eAAe;EACfC,aAAa;EACbC,YAAY;EACZC,eAAe;EACfC,iCAAiC;EACjC,GAAGC;AAC0B,CAAC,EAAE;EAChC,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC,WAAW;IAAEC;EAAkB,CAAC,GACzDpB,oBAAoB,CAMlBD,SAAS,EAAE;IACXO,EAAE;IACFC,gBAAgB;IAChBC,YAAY;IACZC,QAAQ;IACRC,MAAM;IACNC,eAAe;IACfC,aAAa;IACbC,YAAY;IACZC,eAAe;IACfC;EACF,CAAC,CAAC;EAEJ,MAAMM,eAAe,GAAGJ,KAAK,CAACK,MAAM,CAACL,KAAK,CAACM,KAAK,CAAC,CAACC,GAAG;EACrD,MAAMC,mBAAmB,GAAGxB,KAAK,CAACyB,MAAM,CAACL,eAAe,CAAC;EAEzDpB,KAAK,CAAC0B,SAAS,CAAC,MAAM;IACpB,MAAMC,gBAAgB,GAAGH,mBAAmB,CAACI,OAAO;IAEpD,IACED,gBAAgB,KAAKP,eAAe,IACpCF,WAAW,CAACS,gBAAgB,CAAC,EAAEE,OAAO,CAACC,cAAc,EACrD;MACA,MAAMC,SAAS,GAAGf,KAAK,CAACK,MAAM,CAACW,IAAI,CAChCC,KAAK,IAAKA,KAAK,CAACV,GAAG,KAAKI,gBAC3B,CAAC;MAED,IAAII,SAAS,EAAEf,KAAK,EAAEkB,IAAI,KAAK,OAAO,IAAIH,SAAS,CAACf,KAAK,CAACO,GAAG,EAAE;QAC7D,MAAMY,cAAc,GAAG;UACrB,GAAGtC,YAAY,CAACuC,QAAQ,CAAC,CAAC;UAC1BC,MAAM,EAAEN,SAAS,CAACf,KAAK,CAACO;QAC1B,CAAC;QACDN,UAAU,CAACqB,QAAQ,CAACH,cAAc,CAAC;MACrC;IACF;IAEAX,mBAAmB,CAACI,OAAO,GAAGR,eAAe;EAC/C,CAAC,EAAE,CAACF,WAAW,EAAEE,eAAe,EAAEH,UAAU,EAAED,KAAK,CAACM,KAAK,EAAEN,KAAK,CAACK,MAAM,CAAC,CAAC;EAEzE,oBACElB,IAAA,CAACgB,iBAAiB;IAAAX,QAAA,eAChBL,IAAA,CAACF,mBAAmB;MAAA,GACdc,IAAI;MACRC,KAAK,EAAEA,KAAM;MACbC,UAAU,EAAEA,UAAW;MACvBC,WAAW,EAAEA;IAAY,CAC1B;EAAC,CACe,CAAC;AAExB;AAEA,OAAO,SAASqB,8BAA8BA,CAmB5CC,MAAe,EAAmC;EAClD,OAAO5C,sBAAsB,CAACQ,wBAAwB,CAAC,CAACoC,MAAM,CAAC;AACjE","ignoreList":[]}

View File

@@ -0,0 +1,16 @@
"use strict";
/**
* Navigators
*/
export { createNativeBottomTabNavigator } from './createNativeBottomTabNavigator';
/**
* Views
*/
export { NativeBottomTabView } from './NativeBottomTabView';
/**
* Types
*/
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["createNativeBottomTabNavigator","NativeBottomTabView"],"sourceRoot":"../../../src","sources":["unstable/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,8BAA8B,QAAQ,kCAAkC;;AAEjF;AACA;AACA;AACA,SAASC,mBAAmB,QAAQ,uBAAuB;;AAE3D;AACA;AACA","ignoreList":[]}

View File

@@ -0,0 +1,4 @@
"use strict";
export {};
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["unstable/types.tsx"],"mappings":"","ignoreList":[]}

View File

@@ -0,0 +1,5 @@
"use strict";
import * as React from 'react';
export const BottomTabBarHeightCallbackContext = /*#__PURE__*/React.createContext(undefined);
//# sourceMappingURL=BottomTabBarHeightCallbackContext.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","BottomTabBarHeightCallbackContext","createContext","undefined"],"sourceRoot":"../../../src","sources":["utils/BottomTabBarHeightCallbackContext.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,OAAO,MAAMC,iCAAiC,gBAAGD,KAAK,CAACE,aAAa,CAElEC,SAAS,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,5 @@
"use strict";
import * as React from 'react';
export const BottomTabBarHeightContext = /*#__PURE__*/React.createContext(undefined);
//# sourceMappingURL=BottomTabBarHeightContext.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","BottomTabBarHeightContext","createContext","undefined"],"sourceRoot":"../../../src","sources":["utils/BottomTabBarHeightContext.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,OAAO,MAAMC,yBAAyB,gBAAGD,KAAK,CAACE,aAAa,CAE1DC,SAAS,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,23 @@
"use strict";
import * as React from 'react';
import { Animated } from 'react-native';
export function useAnimatedHashMap({
routes,
index
}) {
const refs = React.useRef({});
const previous = refs.current;
const routeKeys = Object.keys(previous);
if (routes.length === routeKeys.length && routes.every(route => routeKeys.includes(route.key))) {
return previous;
}
refs.current = {};
routes.forEach(({
key
}, i) => {
refs.current[key] = previous[key] ?? new Animated.Value(i === index ? 0 : i >= index ? 1 : -1);
});
return refs.current;
}
//# sourceMappingURL=useAnimatedHashMap.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","Animated","useAnimatedHashMap","routes","index","refs","useRef","previous","current","routeKeys","Object","keys","length","every","route","includes","key","forEach","i","Value"],"sourceRoot":"../../../src","sources":["utils/useAnimatedHashMap.tsx"],"mappings":";;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,cAAc;AAEvC,OAAO,SAASC,kBAAkBA,CAAC;EAAEC,MAAM;EAAEC;AAAuB,CAAC,EAAE;EACrE,MAAMC,IAAI,GAAGL,KAAK,CAACM,MAAM,CAAiC,CAAC,CAAC,CAAC;EAC7D,MAAMC,QAAQ,GAAGF,IAAI,CAACG,OAAO;EAC7B,MAAMC,SAAS,GAAGC,MAAM,CAACC,IAAI,CAACJ,QAAQ,CAAC;EAEvC,IACEJ,MAAM,CAACS,MAAM,KAAKH,SAAS,CAACG,MAAM,IAClCT,MAAM,CAACU,KAAK,CAAEC,KAAK,IAAKL,SAAS,CAACM,QAAQ,CAACD,KAAK,CAACE,GAAG,CAAC,CAAC,EACtD;IACA,OAAOT,QAAQ;EACjB;EACAF,IAAI,CAACG,OAAO,GAAG,CAAC,CAAC;EAEjBL,MAAM,CAACc,OAAO,CAAC,CAAC;IAAED;EAAI,CAAC,EAAEE,CAAC,KAAK;IAC7Bb,IAAI,CAACG,OAAO,CAACQ,GAAG,CAAC,GACfT,QAAQ,CAACS,GAAG,CAAC,IACb,IAAIf,QAAQ,CAACkB,KAAK,CAACD,CAAC,KAAKd,KAAK,GAAG,CAAC,GAAGc,CAAC,IAAId,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;EAC7D,CAAC,CAAC;EAEF,OAAOC,IAAI,CAACG,OAAO;AACrB","ignoreList":[]}

View File

@@ -0,0 +1,12 @@
"use strict";
import * as React from 'react';
import { BottomTabBarHeightContext } from "./BottomTabBarHeightContext.js";
export function useBottomTabBarHeight() {
const height = React.useContext(BottomTabBarHeightContext);
if (height === undefined) {
throw new Error("Couldn't find the bottom tab bar height. Are you inside a screen in Bottom Tab Navigator?");
}
return height;
}
//# sourceMappingURL=useBottomTabBarHeight.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","BottomTabBarHeightContext","useBottomTabBarHeight","height","useContext","undefined","Error"],"sourceRoot":"../../../src","sources":["utils/useBottomTabBarHeight.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,yBAAyB,QAAQ,gCAA6B;AAEvE,OAAO,SAASC,qBAAqBA,CAAA,EAAG;EACtC,MAAMC,MAAM,GAAGH,KAAK,CAACI,UAAU,CAACH,yBAAyB,CAAC;EAE1D,IAAIE,MAAM,KAAKE,SAAS,EAAE;IACxB,MAAM,IAAIC,KAAK,CACb,2FACF,CAAC;EACH;EAEA,OAAOH,MAAM;AACf","ignoreList":[]}

View File

@@ -0,0 +1,22 @@
"use strict";
import * as React from 'react';
import { Keyboard, Platform } from 'react-native';
export function useIsKeyboardShown() {
const [isKeyboardShown, setIsKeyboardShown] = React.useState(false);
React.useEffect(() => {
const handleKeyboardShow = () => setIsKeyboardShown(true);
const handleKeyboardHide = () => setIsKeyboardShown(false);
let subscriptions;
if (Platform.OS === 'ios') {
subscriptions = [Keyboard.addListener('keyboardWillShow', handleKeyboardShow), Keyboard.addListener('keyboardWillHide', handleKeyboardHide)];
} else {
subscriptions = [Keyboard.addListener('keyboardDidShow', handleKeyboardShow), Keyboard.addListener('keyboardDidHide', handleKeyboardHide)];
}
return () => {
subscriptions.forEach(s => s.remove());
};
}, []);
return isKeyboardShown;
}
//# sourceMappingURL=useIsKeyboardShown.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","Keyboard","Platform","useIsKeyboardShown","isKeyboardShown","setIsKeyboardShown","useState","useEffect","handleKeyboardShow","handleKeyboardHide","subscriptions","OS","addListener","forEach","s","remove"],"sourceRoot":"../../../src","sources":["utils/useIsKeyboardShown.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAAmCC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAE3E,OAAO,SAASC,kBAAkBA,CAAA,EAAG;EACnC,MAAM,CAACC,eAAe,EAAEC,kBAAkB,CAAC,GAAGL,KAAK,CAACM,QAAQ,CAAC,KAAK,CAAC;EAEnEN,KAAK,CAACO,SAAS,CAAC,MAAM;IACpB,MAAMC,kBAAkB,GAAGA,CAAA,KAAMH,kBAAkB,CAAC,IAAI,CAAC;IACzD,MAAMI,kBAAkB,GAAGA,CAAA,KAAMJ,kBAAkB,CAAC,KAAK,CAAC;IAE1D,IAAIK,aAAoC;IAExC,IAAIR,QAAQ,CAACS,EAAE,KAAK,KAAK,EAAE;MACzBD,aAAa,GAAG,CACdT,QAAQ,CAACW,WAAW,CAAC,kBAAkB,EAAEJ,kBAAkB,CAAC,EAC5DP,QAAQ,CAACW,WAAW,CAAC,kBAAkB,EAAEH,kBAAkB,CAAC,CAC7D;IACH,CAAC,MAAM;MACLC,aAAa,GAAG,CACdT,QAAQ,CAACW,WAAW,CAAC,iBAAiB,EAAEJ,kBAAkB,CAAC,EAC3DP,QAAQ,CAACW,WAAW,CAAC,iBAAiB,EAAEH,kBAAkB,CAAC,CAC5D;IACH;IAEA,OAAO,MAAM;MACXC,aAAa,CAACG,OAAO,CAAEC,CAAC,IAAKA,CAAC,CAACC,MAAM,CAAC,CAAC,CAAC;IAC1C,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOX,eAAe;AACxB","ignoreList":[]}

View File

@@ -0,0 +1,366 @@
"use strict";
import { getDefaultSidebarWidth, getLabel, MissingIcon, useFrameSize } from '@react-navigation/elements';
import { CommonActions, NavigationProvider, useLinkBuilder, useLocale, useTheme } from '@react-navigation/native';
import React from 'react';
import { Animated, Platform, StyleSheet, View } from 'react-native';
import { BottomTabBarHeightCallbackContext } from "../utils/BottomTabBarHeightCallbackContext.js";
import { useIsKeyboardShown } from "../utils/useIsKeyboardShown.js";
import { BottomTabItem } from "./BottomTabItem.js";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const TABBAR_HEIGHT_UIKIT = 49;
const TABBAR_HEIGHT_UIKIT_COMPACT = 32;
const SPACING_UIKIT = 15;
const SPACING_MATERIAL = 12;
const DEFAULT_MAX_TAB_ITEM_WIDTH = 125;
const useNativeDriver = Platform.OS !== 'web';
const shouldUseHorizontalLabels = ({
state,
descriptors,
dimensions
}) => {
const {
tabBarLabelPosition
} = descriptors[state.routes[state.index].key].options;
if (tabBarLabelPosition) {
switch (tabBarLabelPosition) {
case 'beside-icon':
return true;
case 'below-icon':
return false;
}
}
if (dimensions.width >= 768) {
// Screen size matches a tablet
const maxTabWidth = state.routes.reduce((acc, route) => {
const {
tabBarItemStyle
} = descriptors[route.key].options;
const flattenedStyle = StyleSheet.flatten(tabBarItemStyle);
if (flattenedStyle) {
if (typeof flattenedStyle.width === 'number') {
return acc + flattenedStyle.width;
} else if (typeof flattenedStyle.maxWidth === 'number') {
return acc + flattenedStyle.maxWidth;
}
}
return acc + DEFAULT_MAX_TAB_ITEM_WIDTH;
}, 0);
return maxTabWidth <= dimensions.width;
} else {
return dimensions.width > dimensions.height;
}
};
const isCompact = ({
state,
descriptors,
dimensions
}) => {
const {
tabBarPosition,
tabBarVariant
} = descriptors[state.routes[state.index].key].options;
if (tabBarPosition === 'left' || tabBarPosition === 'right' || tabBarVariant === 'material') {
return false;
}
const isLandscape = dimensions.width > dimensions.height;
const horizontalLabels = shouldUseHorizontalLabels({
state,
descriptors,
dimensions
});
if (Platform.OS === 'ios' && !Platform.isPad && isLandscape && horizontalLabels) {
return true;
}
return false;
};
export const getTabBarHeight = ({
state,
descriptors,
dimensions,
insets,
style
}) => {
const {
tabBarPosition
} = descriptors[state.routes[state.index].key].options;
const flattenedStyle = StyleSheet.flatten(style);
const customHeight = flattenedStyle && 'height' in flattenedStyle ? flattenedStyle.height : undefined;
if (typeof customHeight === 'number') {
return customHeight;
}
const inset = insets[tabBarPosition === 'top' ? 'top' : 'bottom'];
if (isCompact({
state,
descriptors,
dimensions
})) {
return TABBAR_HEIGHT_UIKIT_COMPACT + inset;
}
return TABBAR_HEIGHT_UIKIT + inset;
};
export function BottomTabBar({
state,
navigation,
descriptors,
insets,
style
}) {
const {
colors
} = useTheme();
const {
direction
} = useLocale();
const {
buildHref
} = useLinkBuilder();
const focusedRoute = state.routes[state.index];
const focusedDescriptor = descriptors[focusedRoute.key];
const focusedOptions = focusedDescriptor.options;
const {
tabBarPosition = 'bottom',
tabBarShowLabel,
tabBarLabelPosition,
tabBarHideOnKeyboard = false,
tabBarVisibilityAnimationConfig,
tabBarVariant = 'uikit',
tabBarStyle,
tabBarBackground,
tabBarActiveTintColor,
tabBarInactiveTintColor,
tabBarActiveBackgroundColor,
tabBarInactiveBackgroundColor
} = focusedOptions;
if (tabBarVariant === 'material' && tabBarPosition !== 'left' && tabBarPosition !== 'right') {
throw new Error("The 'material' variant for tab bar is only supported when 'tabBarPosition' is set to 'left' or 'right'.");
}
if (tabBarLabelPosition === 'below-icon' && tabBarVariant === 'uikit' && (tabBarPosition === 'left' || tabBarPosition === 'right')) {
throw new Error("The 'below-icon' label position for tab bar is only supported when 'tabBarPosition' is set to 'top' or 'bottom' when using the 'uikit' variant.");
}
const isKeyboardShown = useIsKeyboardShown();
const onHeightChange = React.useContext(BottomTabBarHeightCallbackContext);
const shouldShowTabBar = !(tabBarHideOnKeyboard && isKeyboardShown);
const visibilityAnimationConfigRef = React.useRef(tabBarVisibilityAnimationConfig);
React.useEffect(() => {
visibilityAnimationConfigRef.current = tabBarVisibilityAnimationConfig;
});
const [isTabBarHidden, setIsTabBarHidden] = React.useState(!shouldShowTabBar);
const [visible] = React.useState(() => new Animated.Value(shouldShowTabBar ? 1 : 0));
React.useEffect(() => {
const visibilityAnimationConfig = visibilityAnimationConfigRef.current;
if (shouldShowTabBar) {
const animation = visibilityAnimationConfig?.show?.animation === 'spring' ? Animated.spring : Animated.timing;
animation(visible, {
toValue: 1,
useNativeDriver,
duration: 250,
...visibilityAnimationConfig?.show?.config
}).start(({
finished
}) => {
if (finished) {
setIsTabBarHidden(false);
}
});
} else {
// eslint-disable-next-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect
setIsTabBarHidden(true);
const animation = visibilityAnimationConfig?.hide?.animation === 'spring' ? Animated.spring : Animated.timing;
animation(visible, {
toValue: 0,
useNativeDriver,
duration: 200,
...visibilityAnimationConfig?.hide?.config
}).start();
}
return () => visible.stopAnimation();
}, [visible, shouldShowTabBar]);
const [layout, setLayout] = React.useState({
height: 0
});
const handleLayout = e => {
const {
height
} = e.nativeEvent.layout;
onHeightChange?.(height);
setLayout(layout => {
if (height === layout.height) {
return layout;
} else {
return {
height
};
}
});
};
const {
routes
} = state;
const tabBarHeight = useFrameSize(dimensions => getTabBarHeight({
state,
descriptors,
insets,
dimensions,
style: [tabBarStyle, style]
}));
const hasHorizontalLabels = useFrameSize(dimensions => shouldUseHorizontalLabels({
state,
descriptors,
dimensions
}));
const compact = useFrameSize(dimensions => isCompact({
state,
descriptors,
dimensions
}));
const sidebar = tabBarPosition === 'left' || tabBarPosition === 'right';
const spacing = tabBarVariant === 'material' ? SPACING_MATERIAL : SPACING_UIKIT;
const minSidebarWidth = useFrameSize(size => sidebar && hasHorizontalLabels ? getDefaultSidebarWidth(size) : 0);
const tabBarBackgroundElement = tabBarBackground?.();
return /*#__PURE__*/_jsxs(Animated.View, {
style: [tabBarPosition === 'left' ? styles.start : tabBarPosition === 'right' ? styles.end : styles.bottom, (Platform.OS === 'web' ? tabBarPosition === 'right' : direction === 'rtl' && tabBarPosition === 'left' || direction !== 'rtl' && tabBarPosition === 'right') ? {
borderLeftWidth: StyleSheet.hairlineWidth
} : (Platform.OS === 'web' ? tabBarPosition === 'left' : direction === 'rtl' && tabBarPosition === 'right' || direction !== 'rtl' && tabBarPosition === 'left') ? {
borderRightWidth: StyleSheet.hairlineWidth
} : tabBarPosition === 'top' ? {
borderBottomWidth: StyleSheet.hairlineWidth
} : {
borderTopWidth: StyleSheet.hairlineWidth
}, {
backgroundColor: tabBarBackgroundElement != null ? 'transparent' : colors.card,
borderColor: colors.border
}, sidebar ? {
paddingTop: (hasHorizontalLabels ? spacing : spacing / 2) + insets.top,
paddingBottom: (hasHorizontalLabels ? spacing : spacing / 2) + insets.bottom,
paddingStart: spacing + (tabBarPosition === 'left' ? insets.left : 0),
paddingEnd: spacing + (tabBarPosition === 'right' ? insets.right : 0),
minWidth: minSidebarWidth
} : [{
transform: [{
translateY: visible.interpolate({
inputRange: [0, 1],
outputRange: [layout.height + insets[tabBarPosition === 'top' ? 'top' : 'bottom'] + StyleSheet.hairlineWidth, 0]
})
}],
// Absolutely position the tab bar so that the content is below it
// This is needed to avoid gap at bottom when the tab bar is hidden
position: isTabBarHidden ? 'absolute' : undefined
}, {
height: tabBarHeight,
paddingBottom: tabBarPosition === 'bottom' ? insets.bottom : 0,
paddingTop: tabBarPosition === 'top' ? insets.top : 0,
paddingHorizontal: Math.max(insets.left, insets.right)
}], tabBarStyle],
pointerEvents: isTabBarHidden ? 'none' : 'auto',
onLayout: sidebar ? undefined : handleLayout,
children: [/*#__PURE__*/_jsx(View, {
pointerEvents: "none",
style: StyleSheet.absoluteFill,
children: tabBarBackgroundElement
}), /*#__PURE__*/_jsx(View, {
role: "tablist",
style: sidebar ? styles.sideContent : styles.bottomContent,
children: routes.map((route, index) => {
const focused = index === state.index;
const {
options
} = descriptors[route.key];
const onPress = () => {
const event = navigation.emit({
type: 'tabPress',
target: route.key,
canPreventDefault: true
});
if (!focused && !event.defaultPrevented) {
navigation.dispatch({
...CommonActions.navigate(route),
target: state.key
});
}
};
const onLongPress = () => {
navigation.emit({
type: 'tabLongPress',
target: route.key
});
};
const label = typeof options.tabBarLabel === 'function' ? options.tabBarLabel : getLabel({
label: options.tabBarLabel,
title: options.title
}, route.name);
const accessibilityLabel = options.tabBarAccessibilityLabel !== undefined ? options.tabBarAccessibilityLabel : typeof label === 'string' && Platform.OS === 'ios' ? `${label}, tab, ${index + 1} of ${routes.length}` : undefined;
return /*#__PURE__*/_jsx(NavigationProvider, {
route: route,
navigation: descriptors[route.key].navigation,
children: /*#__PURE__*/_jsx(BottomTabItem, {
href: buildHref(route.name, route.params),
route: route,
descriptor: descriptors[route.key],
focused: focused,
horizontal: hasHorizontalLabels,
compact: compact,
sidebar: sidebar,
variant: tabBarVariant,
onPress: onPress,
onLongPress: onLongPress,
accessibilityLabel: accessibilityLabel,
testID: options.tabBarButtonTestID,
allowFontScaling: options.tabBarAllowFontScaling,
activeTintColor: tabBarActiveTintColor,
inactiveTintColor: tabBarInactiveTintColor,
activeBackgroundColor: tabBarActiveBackgroundColor,
inactiveBackgroundColor: tabBarInactiveBackgroundColor,
button: options.tabBarButton,
icon: options.tabBarIcon ?? (({
color,
size
}) => /*#__PURE__*/_jsx(MissingIcon, {
color: color,
size: size
})),
badge: options.tabBarBadge,
badgeStyle: options.tabBarBadgeStyle,
label: label,
showLabel: tabBarShowLabel,
labelStyle: options.tabBarLabelStyle,
iconStyle: options.tabBarIconStyle,
style: [sidebar ? {
marginVertical: hasHorizontalLabels ? tabBarVariant === 'material' ? 0 : 1 : spacing / 2
} : styles.bottomItem, options.tabBarItemStyle]
})
}, route.key);
})
})]
});
}
const styles = StyleSheet.create({
start: {
top: 0,
bottom: 0,
start: 0
},
end: {
top: 0,
bottom: 0,
end: 0
},
bottom: {
start: 0,
end: 0,
bottom: 0,
elevation: 8
},
bottomContent: {
flex: 1,
flexDirection: 'row'
},
sideContent: {
flex: 1,
flexDirection: 'column'
},
bottomItem: {
flex: 1
}
});
//# sourceMappingURL=BottomTabBar.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,219 @@
"use strict";
import { getLabel, Label, PlatformPressable } from '@react-navigation/elements';
import { useTheme } from '@react-navigation/native';
import Color from 'color';
import React from 'react';
import { Platform, StyleSheet, View } from 'react-native';
import { TabBarIcon } from "./TabBarIcon.js";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const renderButtonDefault = props => /*#__PURE__*/_jsx(PlatformPressable, {
...props
});
const SUPPORTS_LARGE_CONTENT_VIEWER = Platform.OS === 'ios' && parseInt(Platform.Version, 10) >= 13;
export function BottomTabItem({
route,
href,
focused,
descriptor,
label,
icon,
badge,
badgeStyle,
button = renderButtonDefault,
accessibilityLabel,
testID,
onPress,
onLongPress,
horizontal,
compact,
sidebar,
variant,
activeTintColor: customActiveTintColor,
inactiveTintColor: customInactiveTintColor,
activeBackgroundColor: customActiveBackgroundColor,
inactiveBackgroundColor = 'transparent',
showLabel = true,
// On iOS 13+, we use `largeContentTitle` for accessibility
// So we don't need the font to scale up
// https://developer.apple.com/documentation/uikit/uiview/3183939-largecontenttitle
allowFontScaling = SUPPORTS_LARGE_CONTENT_VIEWER ? false : undefined,
labelStyle,
iconStyle,
style
}) {
const {
colors,
fonts
} = useTheme();
const activeTintColor = customActiveTintColor ?? (variant === 'uikit' && sidebar && horizontal ? Color(colors.primary).isDark() ? 'white' : Color(colors.primary).darken(0.71).string() : colors.primary);
const inactiveTintColor = customInactiveTintColor === undefined ? variant === 'material' ? Color(colors.text).alpha(0.68).rgb().string() : Color(colors.text).mix(Color(colors.card), 0.5).hex() : customInactiveTintColor;
const activeBackgroundColor = customActiveBackgroundColor ?? (variant === 'material' ? Color(activeTintColor).alpha(0.12).rgb().string() : sidebar && horizontal ? colors.primary : 'transparent');
const {
options
} = descriptor;
const labelString = getLabel({
label: typeof options.tabBarLabel === 'string' ? options.tabBarLabel : undefined,
title: options.title
}, route.name);
let labelInactiveTintColor = inactiveTintColor;
let iconInactiveTintColor = inactiveTintColor;
if (variant === 'uikit' && sidebar && horizontal && customInactiveTintColor === undefined) {
iconInactiveTintColor = colors.primary;
labelInactiveTintColor = colors.text;
}
const renderLabel = ({
focused
}) => {
if (showLabel === false) {
return null;
}
const color = focused ? activeTintColor : labelInactiveTintColor;
if (typeof label !== 'string') {
return label({
focused,
color,
position: horizontal ? 'beside-icon' : 'below-icon',
children: labelString
});
}
return /*#__PURE__*/_jsx(Label, {
style: [horizontal ? [styles.labelBeside, variant === 'material' ? styles.labelSidebarMaterial : sidebar ? styles.labelSidebarUiKit : compact ? styles.labelBesideUikitCompact : styles.labelBesideUikit, icon == null && {
marginStart: 0
}] : styles.labelBeneath, compact || variant === 'uikit' && sidebar && horizontal ? fonts.regular : fonts.medium, labelStyle],
allowFontScaling: allowFontScaling,
tintColor: color,
children: label
});
};
const renderIcon = ({
focused
}) => {
if (icon === undefined) {
return null;
}
const activeOpacity = focused ? 1 : 0;
const inactiveOpacity = focused ? 0 : 1;
return /*#__PURE__*/_jsx(TabBarIcon, {
route: route,
variant: variant,
size: compact ? 'compact' : 'regular',
badge: badge,
badgeStyle: badgeStyle,
activeOpacity: activeOpacity,
allowFontScaling: allowFontScaling,
inactiveOpacity: inactiveOpacity,
activeTintColor: activeTintColor,
inactiveTintColor: iconInactiveTintColor,
renderIcon: icon,
style: iconStyle
});
};
const scene = {
route,
focused
};
const backgroundColor = focused ? activeBackgroundColor : inactiveBackgroundColor;
const {
flex
} = StyleSheet.flatten(style || {});
const borderRadius = variant === 'material' ? horizontal ? 56 : 16 : sidebar && horizontal ? 10 : 0;
return /*#__PURE__*/_jsx(View, {
style: [
// Clip ripple effect on Android
{
borderRadius,
overflow: variant === 'material' ? 'hidden' : 'visible'
}, style],
children: button({
href,
onPress,
onLongPress,
testID,
'aria-label': accessibilityLabel,
'accessibilityLargeContentTitle': labelString,
'accessibilityShowsLargeContentViewer': true,
// FIXME: role: 'tab' doesn't seem to work as expected on iOS
'role': Platform.select({
ios: 'button',
default: 'tab'
}),
'aria-selected': focused,
'android_ripple': {
borderless: true
},
'hoverEffect': variant === 'material' || sidebar && horizontal ? {
color: colors.text
} : undefined,
'pressOpacity': 1,
'style': [styles.tab, {
flex,
backgroundColor,
borderRadius
}, sidebar ? variant === 'material' ? horizontal ? styles.tabBarSidebarMaterial : styles.tabVerticalMaterial : horizontal ? styles.tabBarSidebarUiKit : styles.tabVerticalUiKit : variant === 'material' ? styles.tabVerticalMaterial : horizontal ? styles.tabHorizontalUiKit : styles.tabVerticalUiKit],
'children': /*#__PURE__*/_jsxs(React.Fragment, {
children: [renderIcon(scene), renderLabel(scene)]
})
})
});
}
const styles = StyleSheet.create({
tab: {
alignItems: 'center',
// Roundness for iPad hover effect
borderRadius: 10,
borderCurve: 'continuous'
},
tabVerticalUiKit: {
justifyContent: 'flex-start',
flexDirection: 'column',
padding: 5
},
tabVerticalMaterial: {
padding: 10
},
tabHorizontalUiKit: {
justifyContent: 'center',
alignItems: 'center',
flexDirection: 'row',
padding: 5
},
tabBarSidebarUiKit: {
justifyContent: 'flex-start',
alignItems: 'center',
flexDirection: 'row',
paddingVertical: 7,
paddingHorizontal: 5
},
tabBarSidebarMaterial: {
justifyContent: 'flex-start',
alignItems: 'center',
flexDirection: 'row',
paddingVertical: 15,
paddingStart: 16,
paddingEnd: 24
},
labelSidebarMaterial: {
marginStart: 12
},
labelSidebarUiKit: {
fontSize: 17,
marginStart: 10
},
labelBeneath: {
fontSize: 10
},
labelBeside: {
marginEnd: 12,
lineHeight: 24
},
labelBesideUikit: {
fontSize: 13,
marginStart: 5
},
labelBesideUikitCompact: {
fontSize: 12,
marginStart: 5
}
});
//# sourceMappingURL=BottomTabItem.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,255 @@
"use strict";
import { getHeaderTitle, Header, SafeAreaProviderCompat, Screen } from '@react-navigation/elements';
import { StackActions } from '@react-navigation/native';
import * as React from 'react';
import { Animated, Platform, StyleSheet } from 'react-native';
import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
import { FadeTransition, ShiftTransition } from "../TransitionConfigs/TransitionPresets.js";
import { BottomTabBarHeightCallbackContext } from "../utils/BottomTabBarHeightCallbackContext.js";
import { BottomTabBarHeightContext } from "../utils/BottomTabBarHeightContext.js";
import { useAnimatedHashMap } from "../utils/useAnimatedHashMap.js";
import { BottomTabBar, getTabBarHeight } from "./BottomTabBar.js";
import { MaybeScreen, MaybeScreenContainer } from "./ScreenFallback.js";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const EPSILON = 1e-5;
const STATE_INACTIVE = 0;
const STATE_TRANSITIONING_OR_BELOW_TOP = 1;
const STATE_ON_TOP = 2;
const NAMED_TRANSITIONS_PRESETS = {
fade: FadeTransition,
shift: ShiftTransition,
none: {
sceneStyleInterpolator: undefined,
transitionSpec: {
animation: 'timing',
config: {
duration: 0
}
}
}
};
const useNativeDriver = Platform.OS !== 'web';
const hasAnimation = options => {
const {
animation,
transitionSpec
} = options;
if (animation) {
return animation !== 'none';
}
return Boolean(transitionSpec);
};
const renderTabBarDefault = props => /*#__PURE__*/_jsx(BottomTabBar, {
...props
});
export function BottomTabView(props) {
const {
tabBar = renderTabBarDefault,
state,
navigation,
descriptors,
safeAreaInsets,
detachInactiveScreens = Platform.OS === 'web' || Platform.OS === 'android' || Platform.OS === 'ios'
} = props;
const focusedRouteKey = state.routes[state.index].key;
/**
* List of loaded tabs, tabs will be loaded when navigated to.
*/
const [loaded, setLoaded] = React.useState([focusedRouteKey]);
if (!loaded.includes(focusedRouteKey)) {
// Set the current tab to be loaded if it was not loaded before
setLoaded([...loaded, focusedRouteKey]);
}
const previousRouteKeyRef = React.useRef(focusedRouteKey);
const tabAnims = useAnimatedHashMap(state);
React.useEffect(() => {
const previousRouteKey = previousRouteKeyRef.current;
let popToTopAction;
if (previousRouteKey !== focusedRouteKey && descriptors[previousRouteKey]?.options.popToTopOnBlur) {
const prevRoute = state.routes.find(route => route.key === previousRouteKey);
if (prevRoute?.state?.type === 'stack' && prevRoute.state.key) {
popToTopAction = {
...StackActions.popToTop(),
target: prevRoute.state.key
};
}
}
const animateToIndex = () => {
if (previousRouteKey !== focusedRouteKey) {
navigation.emit({
type: 'transitionStart',
target: focusedRouteKey
});
}
Animated.parallel(state.routes.map((route, index) => {
const {
options
} = descriptors[route.key];
const {
animation = 'none',
transitionSpec = NAMED_TRANSITIONS_PRESETS[animation].transitionSpec
} = options;
let spec = transitionSpec;
if (route.key !== previousRouteKey && route.key !== focusedRouteKey) {
// Don't animate if the screen is not previous one or new one
// This will avoid flicker for screens not involved in the transition
spec = NAMED_TRANSITIONS_PRESETS.none.transitionSpec;
}
spec = spec ?? NAMED_TRANSITIONS_PRESETS.none.transitionSpec;
const toValue = index === state.index ? 0 : index >= state.index ? 1 : -1;
return Animated[spec.animation](tabAnims[route.key], {
...spec.config,
toValue,
useNativeDriver
});
}).filter(Boolean)).start(({
finished
}) => {
if (finished && popToTopAction) {
navigation.dispatch(popToTopAction);
}
if (previousRouteKey !== focusedRouteKey) {
navigation.emit({
type: 'transitionEnd',
target: focusedRouteKey
});
}
});
};
animateToIndex();
previousRouteKeyRef.current = focusedRouteKey;
}, [descriptors, focusedRouteKey, navigation, state.index, state.routes, tabAnims]);
const dimensions = SafeAreaProviderCompat.initialMetrics.frame;
const [tabBarHeight, setTabBarHeight] = React.useState(() => getTabBarHeight({
state,
descriptors,
dimensions,
insets: {
...SafeAreaProviderCompat.initialMetrics.insets,
...props.safeAreaInsets
},
style: descriptors[state.routes[state.index].key].options.tabBarStyle
}));
const renderTabBar = () => {
return /*#__PURE__*/_jsx(SafeAreaInsetsContext.Consumer, {
children: insets => tabBar({
state: state,
descriptors: descriptors,
navigation: navigation,
insets: {
top: safeAreaInsets?.top ?? insets?.top ?? 0,
right: safeAreaInsets?.right ?? insets?.right ?? 0,
bottom: safeAreaInsets?.bottom ?? insets?.bottom ?? 0,
left: safeAreaInsets?.left ?? insets?.left ?? 0
}
})
});
};
const {
routes
} = state;
// If there is no animation, we only have 2 states: visible and invisible
const hasTwoStates = !routes.some(route => hasAnimation(descriptors[route.key].options));
const {
tabBarPosition = 'bottom'
} = descriptors[focusedRouteKey].options;
const tabBarElement = /*#__PURE__*/_jsx(BottomTabBarHeightCallbackContext.Provider, {
value: setTabBarHeight,
children: renderTabBar()
}, "tabbar");
return /*#__PURE__*/_jsxs(SafeAreaProviderCompat, {
style: {
flexDirection: tabBarPosition === 'left' || tabBarPosition === 'right' ? 'row' : 'column'
},
children: [tabBarPosition === 'top' || tabBarPosition === 'left' ? tabBarElement : null, /*#__PURE__*/_jsx(MaybeScreenContainer, {
enabled: detachInactiveScreens,
hasTwoStates: hasTwoStates,
style: styles.screens,
children: routes.map((route, index) => {
const descriptor = descriptors[route.key];
const {
lazy = true,
animation = 'none',
sceneStyleInterpolator = NAMED_TRANSITIONS_PRESETS[animation].sceneStyleInterpolator
} = descriptor.options;
const isFocused = state.index === index;
const isPreloaded = state.preloadedRouteKeys.includes(route.key);
if (lazy && !loaded.includes(route.key) && !isFocused && !isPreloaded) {
// Don't render a lazy screen if we've never navigated to it or it wasn't preloaded
return null;
}
const {
freezeOnBlur,
header = ({
layout,
options
}) => /*#__PURE__*/_jsx(Header, {
...options,
layout: layout,
title: getHeaderTitle(options, route.name)
}),
headerShown,
headerStatusBarHeight,
headerTransparent,
sceneStyle: customSceneStyle
} = descriptor.options;
const {
sceneStyle
} = sceneStyleInterpolator?.({
current: {
progress: tabAnims[route.key]
}
}) ?? {};
const animationEnabled = hasAnimation(descriptor.options);
const activityState = isFocused ? STATE_ON_TOP // the screen is on top after the transition
: animationEnabled // is animation is not enabled, immediately move to inactive state
? tabAnims[route.key].interpolate({
inputRange: [0, 1 - EPSILON, 1],
outputRange: [STATE_TRANSITIONING_OR_BELOW_TOP,
// screen visible during transition
STATE_TRANSITIONING_OR_BELOW_TOP, STATE_INACTIVE // the screen is detached after transition
],
extrapolate: 'extend'
}) : STATE_INACTIVE;
return /*#__PURE__*/_jsx(MaybeScreen, {
style: [StyleSheet.absoluteFill, {
zIndex: isFocused ? 0 : -1
}],
active: activityState,
enabled: detachInactiveScreens,
freezeOnBlur: freezeOnBlur,
shouldFreeze: activityState === STATE_INACTIVE && !isPreloaded,
children: /*#__PURE__*/_jsx(BottomTabBarHeightContext.Provider, {
value: tabBarPosition === 'bottom' ? tabBarHeight : 0,
children: /*#__PURE__*/_jsx(Screen, {
focused: isFocused,
route: descriptor.route,
navigation: descriptor.navigation,
headerShown: headerShown,
headerStatusBarHeight: headerStatusBarHeight,
headerTransparent: headerTransparent,
header: header({
layout: dimensions,
route: descriptor.route,
navigation: descriptor.navigation,
options: descriptor.options
}),
style: [customSceneStyle, animationEnabled && sceneStyle],
children: descriptor.render()
})
})
}, route.key);
})
}, "screens"), tabBarPosition === 'bottom' || tabBarPosition === 'right' ? tabBarElement : null]
});
}
const styles = StyleSheet.create({
screens: {
flex: 1,
overflow: 'hidden'
}
});
//# sourceMappingURL=BottomTabView.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,42 @@
"use strict";
import * as React from 'react';
import { View } from 'react-native';
import { jsx as _jsx } from "react/jsx-runtime";
let Screens;
try {
Screens = require('react-native-screens');
} catch (e) {
// Ignore
}
export const MaybeScreenContainer = ({
enabled,
...rest
}) => {
if (Screens?.screensEnabled?.()) {
return /*#__PURE__*/_jsx(Screens.ScreenContainer, {
enabled: enabled,
...rest
});
}
return /*#__PURE__*/_jsx(View, {
...rest
});
};
export function MaybeScreen({
enabled,
active,
...rest
}) {
if (Screens?.screensEnabled?.()) {
return /*#__PURE__*/_jsx(Screens.Screen, {
enabled: enabled,
activityState: active,
...rest
});
}
return /*#__PURE__*/_jsx(View, {
...rest
});
}
//# sourceMappingURL=ScreenFallback.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","View","jsx","_jsx","Screens","require","e","MaybeScreenContainer","enabled","rest","screensEnabled","ScreenContainer","MaybeScreen","active","Screen","activityState"],"sourceRoot":"../../../src","sources":["views/ScreenFallback.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAGEC,IAAI,QAGC,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAWtB,IAAIC,OAA0D;AAE9D,IAAI;EACFA,OAAO,GAAGC,OAAO,CAAC,sBAAsB,CAAC;AAC3C,CAAC,CAAC,OAAOC,CAAC,EAAE;EACV;AAAA;AAGF,OAAO,MAAMC,oBAAoB,GAAGA,CAAC;EACnCC,OAAO;EACP,GAAGC;AAKL,CAAC,KAAK;EACJ,IAAIL,OAAO,EAAEM,cAAc,GAAG,CAAC,EAAE;IAC/B,oBAAOP,IAAA,CAACC,OAAO,CAACO,eAAe;MAACH,OAAO,EAAEA,OAAQ;MAAA,GAAKC;IAAI,CAAG,CAAC;EAChE;EAEA,oBAAON,IAAA,CAACF,IAAI;IAAA,GAAKQ;EAAI,CAAG,CAAC;AAC3B,CAAC;AAED,OAAO,SAASG,WAAWA,CAAC;EAAEJ,OAAO;EAAEK,MAAM;EAAE,GAAGJ;AAAwB,CAAC,EAAE;EAC3E,IAAIL,OAAO,EAAEM,cAAc,GAAG,CAAC,EAAE;IAC/B,oBACEP,IAAA,CAACC,OAAO,CAACU,MAAM;MAACN,OAAO,EAAEA,OAAQ;MAACO,aAAa,EAAEF,MAAO;MAAA,GAAKJ;IAAI,CAAG,CAAC;EAEzE;EAEA,oBAAON,IAAA,CAACF,IAAI;IAAA,GAAKQ;EAAI,CAAG,CAAC;AAC3B","ignoreList":[]}

View File

@@ -0,0 +1,97 @@
"use strict";
import { Badge } from '@react-navigation/elements';
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
/**
* Icon sizes taken from Apple HIG
* https://developer.apple.com/design/human-interface-guidelines/tab-bars
*/
const ICON_SIZE_WIDE = 31;
const ICON_SIZE_WIDE_COMPACT = 23;
const ICON_SIZE_TALL = 28;
const ICON_SIZE_TALL_COMPACT = 20;
const ICON_SIZE_ROUND = 25;
const ICON_SIZE_ROUND_COMPACT = 18;
const ICON_SIZE_MATERIAL = 24;
export function TabBarIcon({
route: _,
variant,
size,
badge,
badgeStyle,
activeOpacity,
inactiveOpacity,
activeTintColor,
inactiveTintColor,
renderIcon,
allowFontScaling,
style
}) {
const iconSize = variant === 'material' ? ICON_SIZE_MATERIAL : size === 'compact' ? ICON_SIZE_ROUND_COMPACT : ICON_SIZE_ROUND;
// We render the icon twice at the same position on top of each other:
// active and inactive one, so we can fade between them.
return /*#__PURE__*/_jsxs(View, {
style: [variant === 'material' ? styles.wrapperMaterial : size === 'compact' ? styles.wrapperUikitCompact : styles.wrapperUikit, style],
children: [/*#__PURE__*/_jsx(View, {
style: [styles.icon, {
opacity: activeOpacity,
// Workaround for react-native >= 0.54 layout bug
minWidth: iconSize
}],
children: renderIcon({
focused: true,
size: iconSize,
color: activeTintColor
})
}), /*#__PURE__*/_jsx(View, {
style: [styles.icon, {
opacity: inactiveOpacity
}],
children: renderIcon({
focused: false,
size: iconSize,
color: inactiveTintColor
})
}), /*#__PURE__*/_jsx(Badge, {
visible: badge != null,
size: iconSize * 0.75,
allowFontScaling: allowFontScaling,
style: [styles.badge, badgeStyle],
children: badge
})]
});
}
const styles = StyleSheet.create({
icon: {
// We render the icon twice at the same position on top of each other:
// active and inactive one, so we can fade between them:
// Cover the whole iconContainer:
position: 'absolute',
alignSelf: 'center',
alignItems: 'center',
justifyContent: 'center',
height: '100%',
width: '100%'
},
wrapperUikit: {
width: ICON_SIZE_WIDE,
height: ICON_SIZE_TALL
},
wrapperUikitCompact: {
width: ICON_SIZE_WIDE_COMPACT,
height: ICON_SIZE_TALL_COMPACT
},
wrapperMaterial: {
width: ICON_SIZE_MATERIAL,
height: ICON_SIZE_MATERIAL
},
badge: {
position: 'absolute',
end: -3,
top: -3
}
});
//# sourceMappingURL=TabBarIcon.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["Badge","React","StyleSheet","View","jsx","_jsx","jsxs","_jsxs","ICON_SIZE_WIDE","ICON_SIZE_WIDE_COMPACT","ICON_SIZE_TALL","ICON_SIZE_TALL_COMPACT","ICON_SIZE_ROUND","ICON_SIZE_ROUND_COMPACT","ICON_SIZE_MATERIAL","TabBarIcon","route","_","variant","size","badge","badgeStyle","activeOpacity","inactiveOpacity","activeTintColor","inactiveTintColor","renderIcon","allowFontScaling","style","iconSize","styles","wrapperMaterial","wrapperUikitCompact","wrapperUikit","children","icon","opacity","minWidth","focused","color","visible","create","position","alignSelf","alignItems","justifyContent","height","width","end","top"],"sourceRoot":"../../../src","sources":["views/TabBarIcon.tsx"],"mappings":";;AAAA,SAASA,KAAK,QAAQ,4BAA4B;AAElD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAEEC,UAAU,EAEVC,IAAI,QAEC,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAqBtB;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAG,EAAE;AACzB,MAAMC,sBAAsB,GAAG,EAAE;AACjC,MAAMC,cAAc,GAAG,EAAE;AACzB,MAAMC,sBAAsB,GAAG,EAAE;AACjC,MAAMC,eAAe,GAAG,EAAE;AAC1B,MAAMC,uBAAuB,GAAG,EAAE;AAClC,MAAMC,kBAAkB,GAAG,EAAE;AAE7B,OAAO,SAASC,UAAUA,CAAC;EACzBC,KAAK,EAAEC,CAAC;EACRC,OAAO;EACPC,IAAI;EACJC,KAAK;EACLC,UAAU;EACVC,aAAa;EACbC,eAAe;EACfC,eAAe;EACfC,iBAAiB;EACjBC,UAAU;EACVC,gBAAgB;EAChBC;AACK,CAAC,EAAE;EACR,MAAMC,QAAQ,GACZX,OAAO,KAAK,UAAU,GAClBJ,kBAAkB,GAClBK,IAAI,KAAK,SAAS,GAChBN,uBAAuB,GACvBD,eAAe;;EAEvB;EACA;EACA,oBACEL,KAAA,CAACJ,IAAI;IACHyB,KAAK,EAAE,CACLV,OAAO,KAAK,UAAU,GAClBY,MAAM,CAACC,eAAe,GACtBZ,IAAI,KAAK,SAAS,GAChBW,MAAM,CAACE,mBAAmB,GAC1BF,MAAM,CAACG,YAAY,EACzBL,KAAK,CACL;IAAAM,QAAA,gBAEF7B,IAAA,CAACF,IAAI;MACHyB,KAAK,EAAE,CACLE,MAAM,CAACK,IAAI,EACX;QACEC,OAAO,EAAEd,aAAa;QACtB;QACAe,QAAQ,EAAER;MACZ,CAAC,CACD;MAAAK,QAAA,EAEDR,UAAU,CAAC;QACVY,OAAO,EAAE,IAAI;QACbnB,IAAI,EAAEU,QAAQ;QACdU,KAAK,EAAEf;MACT,CAAC;IAAC,CACE,CAAC,eACPnB,IAAA,CAACF,IAAI;MAACyB,KAAK,EAAE,CAACE,MAAM,CAACK,IAAI,EAAE;QAAEC,OAAO,EAAEb;MAAgB,CAAC,CAAE;MAAAW,QAAA,EACtDR,UAAU,CAAC;QACVY,OAAO,EAAE,KAAK;QACdnB,IAAI,EAAEU,QAAQ;QACdU,KAAK,EAAEd;MACT,CAAC;IAAC,CACE,CAAC,eACPpB,IAAA,CAACL,KAAK;MACJwC,OAAO,EAAEpB,KAAK,IAAI,IAAK;MACvBD,IAAI,EAAEU,QAAQ,GAAG,IAAK;MACtBF,gBAAgB,EAAEA,gBAAiB;MACnCC,KAAK,EAAE,CAACE,MAAM,CAACV,KAAK,EAAEC,UAAU,CAAE;MAAAa,QAAA,EAEjCd;IAAK,CACD,CAAC;EAAA,CACJ,CAAC;AAEX;AAEA,MAAMU,MAAM,GAAG5B,UAAU,CAACuC,MAAM,CAAC;EAC/BN,IAAI,EAAE;IACJ;IACA;IACA;IACAO,QAAQ,EAAE,UAAU;IACpBC,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE;EACT,CAAC;EACDd,YAAY,EAAE;IACZc,KAAK,EAAEvC,cAAc;IACrBsC,MAAM,EAAEpC;EACV,CAAC;EACDsB,mBAAmB,EAAE;IACnBe,KAAK,EAAEtC,sBAAsB;IAC7BqC,MAAM,EAAEnC;EACV,CAAC;EACDoB,eAAe,EAAE;IACfgB,KAAK,EAAEjC,kBAAkB;IACzBgC,MAAM,EAAEhC;EACV,CAAC;EACDM,KAAK,EAAE;IACLsB,QAAQ,EAAE,UAAU;IACpBM,GAAG,EAAE,CAAC,CAAC;IACPC,GAAG,EAAE,CAAC;EACR;AACF,CAAC,CAAC","ignoreList":[]}

View File

@@ -0,0 +1 @@
{"type":"module"}

View File

@@ -0,0 +1,10 @@
import type { BottomTabSceneInterpolatedStyle, BottomTabSceneInterpolationProps } from '../types';
/**
* Simple cross fade animation
*/
export declare function forFade({ current, }: BottomTabSceneInterpolationProps): BottomTabSceneInterpolatedStyle;
/**
* Animation where the screens slightly shift to left/right
*/
export declare function forShift({ current, }: BottomTabSceneInterpolationProps): BottomTabSceneInterpolatedStyle;
//# sourceMappingURL=SceneStyleInterpolators.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SceneStyleInterpolators.d.ts","sourceRoot":"","sources":["../../../../src/TransitionConfigs/SceneStyleInterpolators.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,+BAA+B,EAC/B,gCAAgC,EACjC,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,wBAAgB,OAAO,CAAC,EACtB,OAAO,GACR,EAAE,gCAAgC,GAAG,+BAA+B,CASpE;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EACvB,OAAO,GACR,EAAE,gCAAgC,GAAG,+BAA+B,CAiBpE"}

View File

@@ -0,0 +1,4 @@
import type { BottomTabTransitionPreset } from '../types';
export declare const FadeTransition: BottomTabTransitionPreset;
export declare const ShiftTransition: BottomTabTransitionPreset;
//# sourceMappingURL=TransitionPresets.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TransitionPresets.d.ts","sourceRoot":"","sources":["../../../../src/TransitionConfigs/TransitionPresets.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAI1D,eAAO,MAAM,cAAc,EAAE,yBAG5B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,yBAG7B,CAAC"}

View File

@@ -0,0 +1,4 @@
import type { TransitionSpec } from '../types';
export declare const FadeSpec: TransitionSpec;
export declare const ShiftSpec: TransitionSpec;
//# sourceMappingURL=TransitionSpecs.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TransitionSpecs.d.ts","sourceRoot":"","sources":["../../../../src/TransitionConfigs/TransitionSpecs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,eAAO,MAAM,QAAQ,EAAE,cAMtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,cAMvB,CAAC"}

View File

@@ -0,0 +1,27 @@
import * as SceneStyleInterpolators from './TransitionConfigs/SceneStyleInterpolators';
import * as TransitionPresets from './TransitionConfigs/TransitionPresets';
import * as TransitionSpecs from './TransitionConfigs/TransitionSpecs';
/**
* Transition Presets
*/
export { SceneStyleInterpolators, TransitionPresets, TransitionSpecs };
/**
* Navigators
*/
export { createBottomTabNavigator } from './navigators/createBottomTabNavigator';
/**
* Views
*/
export { BottomTabBar } from './views/BottomTabBar';
export { BottomTabView } from './views/BottomTabView';
/**
* Utilities
*/
export { BottomTabBarHeightCallbackContext } from './utils/BottomTabBarHeightCallbackContext';
export { BottomTabBarHeightContext } from './utils/BottomTabBarHeightContext';
export { useBottomTabBarHeight } from './utils/useBottomTabBarHeight';
/**
* Types
*/
export type { BottomTabBarButtonProps, BottomTabBarProps, BottomTabHeaderProps, BottomTabNavigationEventMap, BottomTabNavigationOptions, BottomTabNavigationProp, BottomTabNavigatorProps, BottomTabOptionsArgs, BottomTabScreenProps, } from './types';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,uBAAuB,MAAM,6CAA6C,CAAC;AACvF,OAAO,KAAK,iBAAiB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AAEvE;;GAEG;AACH,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,eAAe,EAAE,CAAC;AAEvE;;GAEG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAEjF;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;GAEG;AACH,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE;;GAEG;AACH,YAAY,EACV,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,SAAS,CAAC"}

View File

@@ -0,0 +1,16 @@
import { type NavigatorTypeBagBase, type ParamListBase, type StaticConfig, type TabNavigationState, type TypedNavigator } from '@react-navigation/native';
import type { BottomTabNavigationEventMap, BottomTabNavigationOptions, BottomTabNavigationProp, BottomTabNavigatorProps } from '../types';
declare function BottomTabNavigator({ id, initialRouteName, backBehavior, UNSTABLE_routeNamesChangeBehavior, children, layout, screenListeners, screenOptions, screenLayout, UNSTABLE_router, ...rest }: BottomTabNavigatorProps): import("react/jsx-runtime").JSX.Element;
export declare function createBottomTabNavigator<const ParamList extends ParamListBase, const NavigatorID extends string | undefined = string | undefined, const TypeBag extends NavigatorTypeBagBase = {
ParamList: ParamList;
NavigatorID: NavigatorID;
State: TabNavigationState<ParamList>;
ScreenOptions: BottomTabNavigationOptions;
EventMap: BottomTabNavigationEventMap;
NavigationList: {
[RouteName in keyof ParamList]: BottomTabNavigationProp<ParamList, RouteName, NavigatorID>;
};
Navigator: typeof BottomTabNavigator;
}, const Config extends StaticConfig<TypeBag> = StaticConfig<TypeBag>>(config?: Config): TypedNavigator<TypeBag, Config>;
export {};
//# sourceMappingURL=createBottomTabNavigator.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"createBottomTabNavigator.d.ts","sourceRoot":"","sources":["../../../../src/navigators/createBottomTabNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,YAAY,EAEjB,KAAK,kBAAkB,EAGvB,KAAK,cAAc,EAEpB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,UAAU,CAAC;AAGlB,iBAAS,kBAAkB,CAAC,EAC1B,EAAE,EACF,gBAAgB,EAChB,YAAY,EACZ,iCAAiC,EACjC,QAAQ,EACR,MAAM,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,eAAe,EACf,GAAG,IAAI,EACR,EAAE,uBAAuB,2CA+BzB;AAED,wBAAgB,wBAAwB,CACtC,KAAK,CAAC,SAAS,SAAS,aAAa,EACrC,KAAK,CAAC,WAAW,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,EACjE,KAAK,CAAC,OAAO,SAAS,oBAAoB,GAAG;IAC3C,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACrC,aAAa,EAAE,0BAA0B,CAAC;IAC1C,QAAQ,EAAE,2BAA2B,CAAC;IACtC,cAAc,EAAE;SACb,SAAS,IAAI,MAAM,SAAS,GAAG,uBAAuB,CACrD,SAAS,EACT,SAAS,EACT,WAAW,CACZ;KACF,CAAC;IACF,SAAS,EAAE,OAAO,kBAAkB,CAAC;CACtC,EACD,KAAK,CAAC,MAAM,SAAS,YAAY,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,EAClE,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAElD"}

View File

@@ -0,0 +1,328 @@
import type { HeaderOptions, PlatformPressable } from '@react-navigation/elements';
import type { DefaultNavigatorOptions, Descriptor, NavigationHelpers, NavigationProp, ParamListBase, RouteProp, TabActionHelpers, TabNavigationState, TabRouterOptions, Theme } from '@react-navigation/native';
import type * as React from 'react';
import type { Animated, GestureResponderEvent, StyleProp, TextStyle, ViewStyle } from 'react-native';
import type { EdgeInsets } from 'react-native-safe-area-context';
export type Layout = {
width: number;
height: number;
};
export type Variant = 'uikit' | 'material';
export type BottomTabNavigationEventMap = {
/**
* Event which fires on tapping on the tab in the tab bar.
*/
tabPress: {
data: undefined;
canPreventDefault: true;
};
/**
* Event which fires on long press on the tab in the tab bar.
*/
tabLongPress: {
data: undefined;
};
/**
* Event which fires when a transition animation starts.
*/
transitionStart: {
data: undefined;
};
/**
* Event which fires when a transition animation ends.
*/
transitionEnd: {
data: undefined;
};
};
export type LabelPosition = 'beside-icon' | 'below-icon';
export type BottomTabNavigationHelpers = NavigationHelpers<ParamListBase, BottomTabNavigationEventMap> & TabActionHelpers<ParamListBase>;
export type BottomTabNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = NavigationProp<ParamList, RouteName, NavigatorID, TabNavigationState<ParamList>, BottomTabNavigationOptions, BottomTabNavigationEventMap> & TabActionHelpers<ParamList>;
export type BottomTabScreenProps<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = {
navigation: BottomTabNavigationProp<ParamList, RouteName, NavigatorID>;
route: RouteProp<ParamList, RouteName>;
};
export type BottomTabOptionsArgs<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = BottomTabScreenProps<ParamList, RouteName, NavigatorID> & {
theme: Theme;
};
export type TimingKeyboardAnimationConfig = {
animation: 'timing';
config?: Omit<Partial<Animated.TimingAnimationConfig>, 'toValue' | 'useNativeDriver'>;
};
export type SpringKeyboardAnimationConfig = {
animation: 'spring';
config?: Omit<Partial<Animated.SpringAnimationConfig>, 'toValue' | 'useNativeDriver'>;
};
export type TabBarVisibilityAnimationConfig = TimingKeyboardAnimationConfig | SpringKeyboardAnimationConfig;
export type TabAnimationName = 'none' | 'fade' | 'shift';
export type BottomTabNavigationOptions = HeaderOptions & {
/**
* Title text for the screen.
*/
title?: string;
/**
* Title string of a tab displayed in the tab bar
* or a function that given { focused: boolean, color: string, position: 'below-icon' | 'beside-icon', children: string } returns a React.Node to display in tab bar.
*
* When undefined, scene title is used. Use `tabBarShowLabel` to hide the label.
*/
tabBarLabel?: string | ((props: {
focused: boolean;
color: string;
position: LabelPosition;
children: string;
}) => React.ReactNode);
/**
* Whether the tab label should be visible. Defaults to `true`.
*/
tabBarShowLabel?: boolean;
/**
* Whether the label is shown below the icon or beside the icon.
*
* - `below-icon`: the label is shown below the icon (typical for iPhones)
* - `beside-icon` the label is shown next to the icon (typical for iPad)
*
* By default, the position is chosen automatically based on device width.
*/
tabBarLabelPosition?: LabelPosition;
/**
* Style object for the tab label.
*/
tabBarLabelStyle?: StyleProp<TextStyle>;
/**
* Whether label font should scale to respect Text Size accessibility settings.
*/
tabBarAllowFontScaling?: boolean;
/**
* A function that given { focused: boolean, color: string } returns a React.Node to display in the tab bar.
*/
tabBarIcon?: (props: {
focused: boolean;
color: string;
size: number;
}) => React.ReactNode;
/**
* Style object for the tab icon.
*/
tabBarIconStyle?: StyleProp<TextStyle>;
/**
* Text to show in a badge on the tab icon.
*/
tabBarBadge?: number | string;
/**
* Custom style for the tab bar badge.
* You can specify a background color or text color here.
*/
tabBarBadgeStyle?: StyleProp<TextStyle>;
/**
* Accessibility label for the tab button. This is read by the screen reader when the user taps the tab.
* It's recommended to set this if you don't have a label for the tab.
*/
tabBarAccessibilityLabel?: string;
/**
* ID to locate this tab button in tests.
*/
tabBarButtonTestID?: string;
/**
* Function which returns a React element to render as the tab bar button.
* Renders `PlatformPressable` by default.
*/
tabBarButton?: (props: BottomTabBarButtonProps) => React.ReactNode;
/**
* Color for the icon and label in the active tab.
*/
tabBarActiveTintColor?: string;
/**
* Color for the icon and label in the inactive tabs.
*/
tabBarInactiveTintColor?: string;
/**
* Background color for the active tab.
*/
tabBarActiveBackgroundColor?: string;
/**
* Background color for the inactive tabs.
*/
tabBarInactiveBackgroundColor?: string;
/**
* Style object for the tab item container.
*/
tabBarItemStyle?: StyleProp<ViewStyle>;
/**
* Whether the tab bar gets hidden when the keyboard is shown. Defaults to `false`.
*/
tabBarHideOnKeyboard?: boolean;
/**
* Animation config for showing and hiding the tab bar when the keyboard is shown/hidden.
*/
tabBarVisibilityAnimationConfig?: {
show?: TabBarVisibilityAnimationConfig;
hide?: TabBarVisibilityAnimationConfig;
};
/**
* Variant of the tab bar. Defaults to `uikit`.
*/
tabBarVariant?: Variant;
/**
* Style object for the tab bar container.
*/
tabBarStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
/**
* Function which returns a React Element to use as background for the tab bar.
* You could render an image, a gradient, blur view etc.
*
* When using `BlurView`, make sure to set `position: 'absolute'` in `tabBarStyle` as well.
* You'd also need to use `useBottomTabBarHeight()` to add a bottom padding to your content.
*/
tabBarBackground?: () => React.ReactNode;
/**
* Position of the tab bar on the screen. Defaults to `bottom`.
*/
tabBarPosition?: 'bottom' | 'left' | 'right' | 'top';
/**
* Whether this screens should render the first time it's accessed. Defaults to `true`.
* Set it to `false` if you want to render the screen on initial render.
*/
lazy?: boolean;
/**
* Function that given returns a React Element to display as a header.
*/
header?: (props: BottomTabHeaderProps) => React.ReactNode;
/**
* Whether to show the header. Setting this to `false` hides the header.
* Defaults to `true`.
*/
headerShown?: boolean;
/**
* Whether any nested stack should be popped to top when navigating away from the tab.
* Defaults to `false`.
*/
popToTopOnBlur?: boolean;
/**
* Whether inactive screens should be suspended from re-rendering. Defaults to `false`.
* Defaults to `true` when `enableFreeze()` is run at the top of the application.
* Requires `react-native-screens` version >=3.16.0.
*
* Only supported on iOS and Android.
*/
freezeOnBlur?: boolean;
/**
* Style object for the component wrapping the screen content.
*/
sceneStyle?: StyleProp<ViewStyle>;
/**
* How the screen should animate when switching tabs.
*
* Supported values:
* - 'none': don't animate the screen (default)
* - 'fade': cross-fade the screens.
* - 'shift': shift the screens slightly shift to left/right.
*/
animation?: TabAnimationName;
/**
* Function which specifies interpolated styles for bottom-tab scenes.
*/
sceneStyleInterpolator?: BottomTabSceneStyleInterpolator;
/**
* Object which specifies the animation type (timing or spring) and their options (such as duration for timing).
*/
transitionSpec?: TransitionSpec;
};
export type BottomTabDescriptor = Descriptor<BottomTabNavigationOptions, BottomTabNavigationProp<ParamListBase>, RouteProp<ParamListBase>>;
export type BottomTabDescriptorMap = Record<string, BottomTabDescriptor>;
export type BottomTabSceneInterpolationProps = {
/**
* Values for the current screen.
*/
current: {
/**
* Animated value for the current screen:
* - -1 if the index is lower than active tab,
* - 0 if they're active,
* - 1 if the index is higher than active tab
*/
progress: Animated.Value;
};
};
export type BottomTabSceneInterpolatedStyle = {
/**
* Interpolated style for the view representing the scene containing screen content.
*/
sceneStyle: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
};
export type BottomTabSceneStyleInterpolator = (props: BottomTabSceneInterpolationProps) => BottomTabSceneInterpolatedStyle;
export type TransitionSpec = {
animation: 'timing';
config: Omit<Animated.TimingAnimationConfig, 'toValue' | keyof Animated.AnimationConfig>;
} | {
animation: 'spring';
config: Omit<Animated.SpringAnimationConfig, 'toValue' | keyof Animated.AnimationConfig>;
};
export type BottomTabTransitionPreset = {
/**
* Whether transition animations should be enabled when switching tabs.
*/
animationEnabled?: boolean;
/**
* Function which specifies interpolated styles for bottom-tab scenes.
*/
sceneStyleInterpolator?: BottomTabSceneStyleInterpolator;
/**
* Object which specifies the animation type (timing or spring) and their options (such as duration for timing).
*/
transitionSpec?: TransitionSpec;
};
export type BottomTabNavigationConfig = {
/**
* Function that returns a React element to display as the tab bar.
*/
tabBar?: (props: BottomTabBarProps) => React.ReactNode;
/**
* Safe area insets for the tab bar. This is used to avoid elements like the navigation bar on Android and bottom safe area on iOS.
* By default, the device's safe area insets are automatically detected. You can override the behavior with this option.
*/
safeAreaInsets?: {
top?: number;
right?: number;
bottom?: number;
left?: number;
};
/**
* Whether inactive screens should be detached from the view hierarchy to save memory.
* Make sure to call `enableScreens` from `react-native-screens` to make it work.
* Defaults to `true` on Android.
*/
detachInactiveScreens?: boolean;
};
export type BottomTabHeaderProps = {
/**
* Layout of the screen.
*/
layout: Layout;
/**
* Options for the current screen.
*/
options: BottomTabNavigationOptions;
/**
* Route object for the current screen.
*/
route: RouteProp<ParamListBase>;
/**
* Navigation prop for the header.
*/
navigation: BottomTabNavigationProp<ParamListBase>;
};
export type BottomTabBarProps = {
state: TabNavigationState<ParamListBase>;
descriptors: BottomTabDescriptorMap;
navigation: NavigationHelpers<ParamListBase, BottomTabNavigationEventMap>;
insets: EdgeInsets;
};
export type BottomTabBarButtonProps = Omit<React.ComponentProps<typeof PlatformPressable>, 'style'> & {
href?: string;
children: React.ReactNode;
style?: StyleProp<ViewStyle>;
onPress?: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent) => void;
};
export type BottomTabNavigatorProps = DefaultNavigatorOptions<ParamListBase, string | undefined, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap, BottomTabNavigationProp<ParamListBase>> & TabRouterOptions & BottomTabNavigationConfig;
//# sourceMappingURL=types.d.ts.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,10 @@
import { type ParamListBase, type TabNavigationState } from '@react-navigation/native';
import type { NativeBottomTabDescriptorMap, NativeBottomTabNavigationConfig, NativeBottomTabNavigationHelpers } from './types';
type Props = NativeBottomTabNavigationConfig & {
state: TabNavigationState<ParamListBase>;
navigation: NativeBottomTabNavigationHelpers;
descriptors: NativeBottomTabDescriptorMap;
};
export declare function NativeBottomTabView(_: Props): void;
export {};
//# sourceMappingURL=NativeBottomTabView.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"NativeBottomTabView.d.ts","sourceRoot":"","sources":["../../../../src/unstable/NativeBottomTabView.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACV,4BAA4B,EAC5B,+BAA+B,EAC/B,gCAAgC,EACjC,MAAM,SAAS,CAAC;AAEjB,KAAK,KAAK,GAAG,+BAA+B,GAAG;IAC7C,KAAK,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;IACzC,UAAU,EAAE,gCAAgC,CAAC;IAC7C,WAAW,EAAE,4BAA4B,CAAC;CAC3C,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,KAAK,QAE3C"}

View File

@@ -0,0 +1,10 @@
import { type ParamListBase, type TabNavigationState } from '@react-navigation/native';
import type { NativeBottomTabDescriptorMap, NativeBottomTabNavigationConfig, NativeBottomTabNavigationHelpers } from './types';
type Props = NativeBottomTabNavigationConfig & {
state: TabNavigationState<ParamListBase>;
navigation: NativeBottomTabNavigationHelpers;
descriptors: NativeBottomTabDescriptorMap;
};
export declare function NativeBottomTabView({ state, navigation, descriptors }: Props): import("react/jsx-runtime").JSX.Element;
export {};
//# sourceMappingURL=NativeBottomTabView.native.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"NativeBottomTabView.native.d.ts","sourceRoot":"","sources":["../../../../src/unstable/NativeBottomTabView.native.tsx"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,aAAa,EAGlB,KAAK,kBAAkB,EAExB,MAAM,0BAA0B,CAAC;AAWlC,OAAO,KAAK,EACV,4BAA4B,EAE5B,+BAA+B,EAC/B,gCAAgC,EAGjC,MAAM,SAAS,CAAC;AAEjB,KAAK,KAAK,GAAG,+BAA+B,GAAG;IAC7C,KAAK,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;IACzC,UAAU,EAAE,gCAAgC,CAAC;IAC7C,WAAW,EAAE,4BAA4B,CAAC;CAC3C,CAAC;AAMF,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,KAAK,2CAyS5E"}

View File

@@ -0,0 +1,8 @@
import * as React from 'react';
import type { NativeBottomTabHeaderProps } from '../types';
type Props = NativeBottomTabHeaderProps & {
children: React.ReactNode;
};
export declare function NativeScreen({ route, navigation, options, children }: Props): import("react/jsx-runtime").JSX.Element;
export {};
//# sourceMappingURL=NativeScreen.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"NativeScreen.d.ts","sourceRoot":"","sources":["../../../../../src/unstable/NativeScreen/NativeScreen.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAK3D,KAAK,KAAK,GAAG,0BAA0B,GAAG;IACxC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAIF,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,KAAK,2CA6J3E"}

View File

@@ -0,0 +1,2 @@
export declare function debounce<T extends (...args: any[]) => void>(func: T, duration: number): T;
//# sourceMappingURL=debounce.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../../../src/unstable/NativeScreen/debounce.tsx"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EACzD,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,MAAM,GACf,CAAC,CAUH"}

View File

@@ -0,0 +1,523 @@
import * as React from 'react';
import type { ColorValue, ImageSourcePropType, StyleProp, TextStyle } from 'react-native';
import type { ScreenStackHeaderConfigProps, SearchBarProps } from 'react-native-screens';
import type { SFSymbol } from 'sf-symbols-typescript';
import type { NativeBottomTabHeaderProps } from '../types';
export type NativeHeaderOptions = {
/**
* String that can be displayed in the header as a fallback for `headerTitle`.
*/
title?: string;
/**
* Style of the header when a large title is shown
* The large title is shown if `headerLargeTitle` is `true` and
* the edge of any scrollable content reaches the matching edge of the header.
*
* Supported properties:
* - backgroundColor
*
* Only supported on iOS.
*
* @platform ios
*/
headerLargeStyle?: StyleProp<{
backgroundColor?: ColorValue;
}>;
/**
* Whether to enable header with large title which collapses to regular header on scroll.
*
* For large title to collapse on scroll, the content of the screen should be wrapped in a scrollable view such as `ScrollView` or `FlatList`.
* If the scrollable area doesn't fill the screen, the large title won't collapse on scroll.
* You also need to specify `contentInsetAdjustmentBehavior="automatic"` in your `ScrollView`, `FlatList` etc.
*
* Only supported on iOS.
*
* @platform ios
*/
headerLargeTitleEnabled?: boolean;
/**
* Whether drop shadow of header is visible when a large title is shown.
*
* Only supported on iOS.
*
* @platform ios
*/
headerLargeTitleShadowVisible?: boolean;
/**
* Style object for large title in header. Supported properties:
* - fontFamily
* - fontSize
* - fontWeight
* - color
*
* Only supported on iOS.
*
* @platform ios
*/
headerLargeTitleStyle?: StyleProp<{
fontFamily?: string;
fontSize?: number;
fontWeight?: string;
color?: ColorValue;
}>;
/**
* Style object for header. Supported properties:
* - backgroundColor
*/
headerStyle?: StyleProp<{
backgroundColor?: ColorValue;
}>;
/**
* Whether to hide the elevation shadow (Android) or the bottom border (iOS) on the header.
*/
headerShadowVisible?: boolean;
/**
* Boolean indicating whether the navigation bar is translucent.
* Setting this to `true` makes the header absolutely positioned,
* and changes the background color to `transparent` unless specified in `headerStyle`.
*/
headerTransparent?: boolean;
/**
* Blur effect for the translucent header.
* The `headerTransparent` option needs to be set to `true` for this to work.
*
* Only supported on iOS.
*
* @platform ios
*/
headerBlurEffect?: ScreenStackHeaderConfigProps['blurEffect'];
/**
* Tint color for the header. Changes the color of back button and title.
*/
headerTintColor?: string;
/**
* Function which returns a React Element to render as the background of the header.
* This is useful for using backgrounds such as an image, a gradient, blur effect etc.
* You can use this with `headerTransparent` to render content underneath a translucent header.
*/
headerBackground?: () => React.ReactNode;
/**
* Function which returns a React Element to display on the left side of the header.
* This replaces the back button. See `headerBackVisible` to show the back button along side left element.
* Will be overriden by `headerLeftItems` on iOS.
*/
headerLeft?: (props: NativeScreenHeaderItemProps) => React.ReactNode;
/**
* Function which returns a React Element to display on the right side of the header.
* Will be overriden by `headerRightItems` on iOS.
*/
headerRight?: (props: NativeScreenHeaderItemProps) => React.ReactNode;
/**
* Function which returns an array of items to display as on the left side of the header.
* Overrides `headerLeft`.
*
* This is an unstable API and might change in the future.
*
* @platform ios
*/
unstable_headerLeftItems?: (props: NativeScreenHeaderItemProps) => NativeScreenHeaderItem[];
/**
* Function which returns an array of items to display as on the right side of the header.
* Overrides `headerRight`.
*
* This is an unstable API and might change in the future.
*
* @platform ios
*/
unstable_headerRightItems?: (props: NativeScreenHeaderItemProps) => NativeScreenHeaderItem[];
/**
* String or a function that returns a React Element to be used by the header.
* Defaults to screen `title` or route name.
*
* When a function is passed, it receives `tintColor` and`children` in the options object as an argument.
* The title string is passed in `children`.
*
* Note that if you render a custom element by passing a function, animations for the title won't work.
*/
headerTitle?: string | ((props: {
/**
* The title text of the header.
*/
children: string;
/**
* Tint color for the header.
*/
tintColor?: string;
}) => React.ReactNode);
/**
* How to align the the header title.
* Defaults to `left` on platforms other than iOS.
*
* Not supported on iOS. It's always `center` on iOS and cannot be changed.
*/
headerTitleAlign?: 'left' | 'center';
/**
* Style object for header title. Supported properties:
* - fontFamily
* - fontSize
* - fontWeight
* - color
*/
headerTitleStyle?: StyleProp<Pick<TextStyle, 'fontFamily' | 'fontSize' | 'fontWeight'> & {
color?: string;
}>;
/**
* Options to render a native search bar.
* You also need to specify `contentInsetAdjustmentBehavior="automatic"` in your `ScrollView`, `FlatList` etc.
* If you don't have a `ScrollView`, specify `headerTransparent: false`.
*/
headerSearchBarOptions?: SearchBarProps;
/**
* Whether to show the header. Setting this to `false` hides the header.
* Defaults to `true`.
*/
headerShown?: boolean;
/**
* Function that given returns a React Element to display as a header.
*/
header?: (props: NativeBottomTabHeaderProps) => React.ReactNode;
};
export type NativeScreenHeaderItemProps = {
/**
* Tint color for the header.
*/
tintColor?: ColorValue;
};
/**
* A button item in the header.
*/
export type NativeScreenHeaderItemButton = SharedHeaderItem & {
/**
* Type of the item.
*/
type: 'button';
/**
* Function to call when the item is pressed.
*/
onPress: () => void;
/**
* Whether the item is in a selected state.
*
* Read more: https://developer.apple.com/documentation/uikit/uibarbuttonitem/isselected
*/
selected?: boolean;
};
/**
* An action item in a menu.
*/
export type NativeScreenHeaderItemMenuAction = {
type: 'action';
/**
* Label for the menu item.
*/
label: string;
/**
* The secondary text displayed alongside the label of the menu item.
*/
description?: string;
/**
* Icon for the menu item.
*/
icon?: IconIOSSfSymbol;
/**
* Function to call when the menu item is pressed.
*/
onPress: () => void;
/**
* The state of an action- or command-based menu item.
*
* Read more: https://developer.apple.com/documentation/uikit/uimenuelement/state
*/
state?: 'on' | 'off' | 'mixed';
/**
* Whether to apply disabled style to the item.
*
* Read more: https://developer.apple.com/documentation/uikit/uimenuelement/attributes/disabled
*/
disabled?: boolean;
/**
* Whether to apply destructive style to the item.
*
* Read more: https://developer.apple.com/documentation/uikit/uimenuelement/attributes/destructive
*/
destructive?: boolean;
/**
* Whether to apply hidden style to the item.
*
* Read more: https://developer.apple.com/documentation/uikit/uimenuelement/attributes/hidden
*/
hidden?: boolean;
/**
* Whether to keep the menu presented after firing the elements action.
*
* Read more: https://developer.apple.com/documentation/uikit/uimenuelement/attributes/keepsmenupresented
*/
keepsMenuPresented?: boolean;
/**
* An elaborated title that explains the purpose of the action.
*
* On iOS, the system displays this title in the discoverability heads-up display (HUD).
* If this is not set, the HUD displays the title property.
*
* Read more: https://developer.apple.com/documentation/uikit/uiaction/discoverabilitytitle
*/
discoverabilityLabel?: string;
};
/**
* A submenu item that contains other menu items.
*/
export type NativeScreenHeaderItemMenuSubmenu = {
type: 'submenu';
/**
* Label for the submenu item.
*/
label: string;
/**
* Icon for the submenu item.
*/
icon?: IconIOSSfSymbol;
/**
* Whether the menu is displayed inline with the parent menu.
* By default, submenus are displayed after expanding the parent menu item.
* Inline menus are displayed as part of the parent menu as a section.
*
* Defaults to `false`.
*
* Read more: https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayinline
*/
inline?: boolean;
/**
* How the submenu items are displayed.
* - `default`: menu items are displayed normally.
* - `palette`: menu items are displayed in a horizontal row.
*
* Defaults to `default`.
*
* Read more: https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette
*/
layout?: 'default' | 'palette';
/**
* Whether to apply destructive style to the menu item.
*
* Read more: https://developer.apple.com/documentation/uikit/uimenuelement/attributes/destructive
*/
destructive?: boolean;
/**
* Whether multiple items in the submenu can be selected, i.e. in "on" state.
*
* Defaults to `false`.
*
* Read more: https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/singleselection
*/
multiselectable?: boolean;
/**
* Array of menu items (actions or submenus).
*/
items: NativeScreenHeaderItemMenu['menu']['items'];
};
/**
* An item that shows a menu when pressed.
*/
export type NativeScreenHeaderItemMenu = SharedHeaderItem & {
type: 'menu';
/**
* Whether the menu is a selection menu.
* Tapping an item in a selection menu will add a checkmark to the selected item.
*
* Read more: https://developer.apple.com/documentation/uikit/uibarbuttonitem/changesselectionasprimaryaction
*/
changesSelectionAsPrimaryAction?: boolean;
/**
* Menu for the item.
*/
menu: {
/**
* Optional title to show on top of the menu.
*/
title?: string;
/**
* Whether multiple items in the submenu can be selected, i.e. in "on" state.
*
* Defaults to `false`.
*
* Read more: https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/singleselection
*/
multiselectable?: boolean;
/**
* How the submenu items are displayed.
* - `default`: menu items are displayed normally.
* - `palette`: menu items are displayed in a horizontal row.
*
* Defaults to `default`.
*
* Read more: https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette
*/
layout?: 'default' | 'palette';
/**
* Array of menu items (actions or submenus).
*/
items: (NativeScreenHeaderItemMenuAction | NativeScreenHeaderItemMenuSubmenu)[];
};
};
/**
* An item to add spacing between other items in the header.
*/
export type NativeScreenHeaderItemSpacing = {
type: 'spacing';
/**
* The amount of spacing to add.
*/
spacing: number;
};
/**
* A custom item to display any React Element in the header.
*/
export type NativeScreenHeaderItemCustom = {
type: 'custom';
/**
* A React Element to display as the item.
*/
element: React.ReactElement;
/**
* Whether the background this item may share with other items in the bar should be hidden.
* Only available from iOS 26.0 and later.
*
* Read more: https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground
*/
hidesSharedBackground?: boolean;
};
/**
* An item that can be displayed in the header.
* It can be a button, a menu, spacing, or a custom element.
*
* On iOS 26, when showing items on the right side of the header,
* if the items don't fit the available space, they will be collapsed into a menu automatically.
* Items with `type: 'custom'` will not be included in this automatic collapsing behavior.
*/
export type NativeScreenHeaderItem = NativeScreenHeaderItemButton | NativeScreenHeaderItemMenu | NativeScreenHeaderItemSpacing | NativeScreenHeaderItemCustom;
type IconImage = {
/**
* - `image` - Use a local image as the icon.
*/
type: 'image';
/**
* Image source to use as the icon.
* e.g., `require('./path/to/image.png')`
*/
source: ImageSourcePropType;
/**
* Whether to apply tint color to the icon.
* Defaults to `true`.
*
* @platform ios
*/
tinted?: boolean;
};
type IconIOSSfSymbol = {
/**
* - `sfSymbol` - Use an SF Symbol as the icon on iOS.
*/
type: 'sfSymbol';
/**
* Name of the SF Symbol to use as the icon.
*
* @platform ios
*/
name: SFSymbol;
};
type IconIOS = IconIOSSfSymbol | IconImage;
type SharedHeaderItem = {
/**
* Label of the item.
*/
label: string;
/**
* Style for the item label.
*/
labelStyle?: {
fontFamily?: string;
fontSize?: number;
fontWeight?: string;
color?: ColorValue;
};
/**
* Icon for the item
*/
icon?: IconIOS;
/**
* The variant of the item.
* "prominent" only available from iOS 26.0 and later.
*
* Read more: https://developer.apple.com/documentation/uikit/uibarbuttonitem/style-swift.property
*/
variant?: 'plain' | 'done' | 'prominent';
/**
* The tint color to apply to the item.
*
* Read more: https://developer.apple.com/documentation/uikit/uibarbuttonitem/tintcolor
*/
tintColor?: ColorValue;
/**
* Whether the item is in a disabled state.
*/
disabled?: boolean;
/**
* The width of the item.
*
* Read more: https://developer.apple.com/documentation/uikit/uibarbuttonitem/width
*/
width?: number;
/**
* Whether the background this item may share with other items in the bar should be hidden.
* Only available from iOS 26.0 and later.
*
* Read more: https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground
*/
hidesSharedBackground?: boolean;
/**
* Whether this item can share a background with other items.
* Only available from iOS 26.0 and later.
*
* Read more: https://developer.apple.com/documentation/uikit/uibarbuttonitem/sharesbackground
*/
sharesBackground?: boolean;
/**
* An identifier used to match items across transitions.
* Only available from iOS 26.0 and later.
*
* Read more: https://developer.apple.com/documentation/uikit/uibarbuttonitem/identifier
*/
identifier?: string;
/**
* A badge to display on a item.
* Only available from iOS 26.0 and later.
*
* Read more: https://developer.apple.com/documentation/uikit/uibarbuttonitembadge
*/
badge?: {
/**
* The text to display in the badge.
*/
value: number | string;
/**
* Style of the badge.
*/
style?: {
color?: ColorValue;
backgroundColor?: ColorValue;
fontFamily?: string;
fontSize?: number;
fontWeight?: string;
};
};
/**
* Accessibility label for the item.
*/
accessibilityLabel?: string;
/**
* Accessibility hint for the item.
*/
accessibilityHint?: string;
};
export {};
//# sourceMappingURL=types.d.ts.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
import * as React from 'react';
import type { Animated } from 'react-native';
export declare const AnimatedHeaderHeightContext: React.Context<Animated.AnimatedInterpolation<number> | undefined>;
export declare function useAnimatedHeaderHeight(): Animated.AnimatedInterpolation<number>;
//# sourceMappingURL=useAnimatedHeaderHeight.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"useAnimatedHeaderHeight.d.ts","sourceRoot":"","sources":["../../../../../src/unstable/NativeScreen/useAnimatedHeaderHeight.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,eAAO,MAAM,2BAA2B,mEAE5B,CAAC;AAEb,wBAAgB,uBAAuB,2CAUtC"}

View File

@@ -0,0 +1,11 @@
import { type Route } from '@react-navigation/native';
import { type ScreenStackHeaderConfigProps } from 'react-native-screens';
import type { NativeHeaderOptions } from './types';
type Props = NativeHeaderOptions & {
headerTopInsetEnabled: boolean;
headerHeight: number;
route: Route<string>;
};
export declare function useHeaderConfig({ headerShadowVisible, headerLargeStyle, headerLargeTitleEnabled, headerLargeTitleShadowVisible, headerLargeTitleStyle, headerBackground, headerLeft, headerRight, headerShown, headerStyle, headerBlurEffect, headerTintColor, headerTitle, headerTitleAlign, headerTitleStyle, headerTransparent, headerSearchBarOptions, headerTopInsetEnabled, route, title, unstable_headerLeftItems: headerLeftItems, unstable_headerRightItems: headerRightItems, }: Props): ScreenStackHeaderConfigProps;
export {};
//# sourceMappingURL=useHeaderConfig.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"useHeaderConfig.d.ts","sourceRoot":"","sources":["../../../../../src/unstable/NativeScreen/useHeaderConfig.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,KAAK,EAIX,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAML,KAAK,4BAA4B,EAKlC,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EACV,mBAAmB,EAIpB,MAAM,SAAS,CAAC;AAEjB,KAAK,KAAK,GAAG,mBAAmB,GAAG;IACjC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACtB,CAAC;AAoIF,wBAAgB,eAAe,CAAC,EAC9B,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,6BAA6B,EAC7B,qBAAqB,EACrB,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,EACL,KAAK,EACL,wBAAwB,EAAE,eAAe,EACzC,yBAAyB,EAAE,gBAAgB,GAC5C,EAAE,KAAK,GAAG,4BAA4B,CAqPtC"}

View File

@@ -0,0 +1,2 @@
export declare const createNativeBottomTabNavigator: typeof import('./createNativeBottomTabNavigator.native').createNativeBottomTabNavigator;
//# sourceMappingURL=createNativeBottomTabNavigator.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"createNativeBottomTabNavigator.d.ts","sourceRoot":"","sources":["../../../../src/unstable/createNativeBottomTabNavigator.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,EAAE,cAAc,yCAAyC,EAAE,8BAGnG,CAAC"}

View File

@@ -0,0 +1,16 @@
import { type NavigatorTypeBagBase, type ParamListBase, type StaticConfig, type TabNavigationState, type TypedNavigator } from '@react-navigation/native';
import type { NativeBottomTabNavigationEventMap, NativeBottomTabNavigationOptions, NativeBottomTabNavigationProp, NativeBottomTabNavigatorProps } from './types';
declare function NativeBottomTabNavigator({ id, initialRouteName, backBehavior, children, layout, screenListeners, screenOptions, screenLayout, UNSTABLE_router, UNSTABLE_routeNamesChangeBehavior, ...rest }: NativeBottomTabNavigatorProps): import("react/jsx-runtime").JSX.Element;
export declare function createNativeBottomTabNavigator<const ParamList extends ParamListBase, const NavigatorID extends string | undefined = string | undefined, const TypeBag extends NavigatorTypeBagBase = {
ParamList: ParamList;
NavigatorID: NavigatorID;
State: TabNavigationState<ParamList>;
ScreenOptions: NativeBottomTabNavigationOptions;
EventMap: NativeBottomTabNavigationEventMap;
NavigationList: {
[RouteName in keyof ParamList]: NativeBottomTabNavigationProp<ParamList, RouteName, NavigatorID>;
};
Navigator: typeof NativeBottomTabNavigator;
}, const Config extends StaticConfig<TypeBag> = StaticConfig<TypeBag>>(config?: Config): TypedNavigator<TypeBag, Config>;
export {};
//# sourceMappingURL=createNativeBottomTabNavigator.native.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"createNativeBottomTabNavigator.native.d.ts","sourceRoot":"","sources":["../../../../src/unstable/createNativeBottomTabNavigator.native.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAElB,KAAK,YAAY,EAEjB,KAAK,kBAAkB,EAGvB,KAAK,cAAc,EAEpB,MAAM,0BAA0B,CAAC;AAIlC,OAAO,KAAK,EACV,iCAAiC,EACjC,gCAAgC,EAChC,6BAA6B,EAC7B,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AAEjB,iBAAS,wBAAwB,CAAC,EAChC,EAAE,EACF,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,eAAe,EACf,iCAAiC,EACjC,GAAG,IAAI,EACR,EAAE,6BAA6B,2CAyD/B;AAED,wBAAgB,8BAA8B,CAC5C,KAAK,CAAC,SAAS,SAAS,aAAa,EACrC,KAAK,CAAC,WAAW,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,EACjE,KAAK,CAAC,OAAO,SAAS,oBAAoB,GAAG;IAC3C,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACrC,aAAa,EAAE,gCAAgC,CAAC;IAChD,QAAQ,EAAE,iCAAiC,CAAC;IAC5C,cAAc,EAAE;SACb,SAAS,IAAI,MAAM,SAAS,GAAG,6BAA6B,CAC3D,SAAS,EACT,SAAS,EACT,WAAW,CACZ;KACF,CAAC;IACF,SAAS,EAAE,OAAO,wBAAwB,CAAC;CAC5C,EACD,KAAK,CAAC,MAAM,SAAS,YAAY,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,EAClE,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAElD"}

View File

@@ -0,0 +1,13 @@
/**
* Navigators
*/
export { createNativeBottomTabNavigator } from './createNativeBottomTabNavigator';
/**
* Views
*/
export { NativeBottomTabView } from './NativeBottomTabView';
/**
* Types
*/
export type { NativeBottomTabBarProps, NativeBottomTabIcon, NativeBottomTabNavigationEventMap, NativeBottomTabNavigationOptions, NativeBottomTabNavigationProp, NativeBottomTabNavigatorProps, NativeBottomTabOptionsArgs, NativeBottomTabScreenProps, } from './types';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/unstable/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAElF;;GAEG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;GAEG;AACH,YAAY,EACV,uBAAuB,EACvB,mBAAmB,EACnB,iCAAiC,EACjC,gCAAgC,EAChC,6BAA6B,EAC7B,6BAA6B,EAC7B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,SAAS,CAAC"}

View File

@@ -0,0 +1,333 @@
import type { DefaultNavigatorOptions, Descriptor, NavigationHelpers, NavigationProp, ParamListBase, RouteProp, TabActionHelpers, TabNavigationState, TabRouterOptions, Theme } from '@react-navigation/native';
import type { ColorValue, ImageSourcePropType, TextStyle } from 'react-native';
import type { EdgeInsets } from 'react-native-safe-area-context';
import type { TabBarItemLabelVisibilityMode, TabsScreenBlurEffect, TabsSystemItem } from 'react-native-screens';
import type { SFSymbol } from 'sf-symbols-typescript';
import type { NativeHeaderOptions } from './NativeScreen/types';
export type Layout = {
width: number;
height: number;
};
export type NativeBottomTabNavigationEventMap = {
/**
* Event which fires on tapping on the tab in the tab bar.
*/
tabPress: {
data: undefined;
canPreventDefault: false;
};
/**
* Event which fires when a transition animation starts.
*/
transitionStart: {
data: {
closing: boolean;
};
};
/**
* Event which fires when a transition animation ends.
*/
transitionEnd: {
data: {
closing: boolean;
};
};
};
export type NativeBottomTabNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = NavigationProp<ParamList, RouteName, NavigatorID, TabNavigationState<ParamList>, NativeBottomTabNavigationOptions, NativeBottomTabNavigationEventMap> & TabActionHelpers<ParamList>;
export type NativeBottomTabScreenProps<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = {
navigation: NativeBottomTabNavigationProp<ParamList, RouteName, NavigatorID>;
route: RouteProp<ParamList, RouteName>;
};
export type NativeBottomTabOptionsArgs<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = NativeBottomTabScreenProps<ParamList, RouteName, NavigatorID> & {
theme: Theme;
};
type IconImage = {
/**
* - `image` - Use a local image as the icon.
*/
type: 'image';
/**
* Image source to use as the icon.
* - Local image: `require('./path/to/image.png')`
* - Drawable resource or xcasset: `{ uri: 'image_name' }`
*/
source: ImageSourcePropType;
/**
* Whether to apply tint color to the image.
* Disabling will keep the image's original colors.
*
* Defaults to `true`.
*
* @platform ios
*/
tinted?: boolean;
};
type IconIOSSfSymbol = {
/**
* - `sfSymbol` - Use an SF Symbol as the icon on iOS.
*/
type: 'sfSymbol';
/**
* Name of the SF Symbol to use as the icon.
*
* @platform ios
*/
name: SFSymbol;
};
export type NativeBottomTabIcon = IconIOSSfSymbol | IconImage;
export type NativeBottomTabNavigationOptions = NativeHeaderOptions & {
/**
* Title text for the screen.
*/
title?: string;
/**
* Uses iOS built-in tab bar items with standard iOS styling and localized titles.
* If set to `search`, it's positioned next to the tab bar on iOS 26 and above.
*
* The `tabBarIcon` and `tabBarLabel` options will override the icon and label from the system item.
* If you want to keep the system behavior on iOS, but need to provide icon and label for other platforms,
* Use `Platform.OS` or `Platform.select` to conditionally set `undefined` for `tabBarIcon` and `tabBarLabel` on iOS.
*
* @platform ios
*/
tabBarSystemItem?: TabsSystemItem;
/**
* Title string of the tab displayed in the tab bar
*
* Overrides the label provided by `tabBarSystemItem` on iOS.
*
* If not provided, or set to `undefined`:
* - The system values are used if `tabBarSystemItem` is set on iOS.
* - Otherwise, it falls back to the `title` or route name.
*/
tabBarLabel?: string;
/**
* Label visibility mode for the tab bar items.
*
* The following values are currently supported:
*
* - `auto` - the system decides when to show or hide labels
* - `selected` - labels are shown only for the selected tab
* - `labeled` - labels are always shown
* - `unlabeled` - labels are never shown
*
* Defaults to `auto`.
*
* @platform android
*/
tabBarLabelVisibilityMode?: TabBarItemLabelVisibilityMode;
/**
* Style object for the tab label.
*/
tabBarLabelStyle?: Pick<TextStyle, 'fontFamily' | 'fontSize' | 'fontWeight' | 'fontStyle' | 'color'>;
/**
* Icon to display for the tab.
*
* Showing a different icon for focused tab is only supported on iOS.
*
* Overrides the icon provided by `tabBarSystemItem` on iOS.
*/
tabBarIcon?: NativeBottomTabIcon | ((props: {
focused: boolean;
}) => NativeBottomTabIcon);
/**
* Text to show in a badge on the tab icon.
*/
tabBarBadge?: number | string;
/**
* Custom style for the tab bar badge.
* You can specify a background color or text color here.
* - on iOS, you can only set the background color.
* - on Android, you can set both background and text colors.
*/
tabBarBadgeStyle?: {
backgroundColor?: ColorValue;
color?: ColorValue;
};
/**
* Color for the icon and label in the active tab.
*/
tabBarActiveTintColor?: ColorValue;
/**
* Color for the icon and label in the inactive tabs.
*
* @platform android
*/
tabBarInactiveTintColor?: ColorValue;
/**
* Background color of the active indicator.
*
* @platform android
*/
tabBarActiveIndicatorColor?: ColorValue;
/**
* Specifies if the active indicator should be used. Defaults to `true`.
*
* @platform android
*/
tabBarActiveIndicatorEnabled?: boolean;
/**
* Color of tab bar item's ripple effect.
*
* @platform android
*/
tabBarRippleColor?: ColorValue;
/**
* Style object for the tab bar container.
*/
tabBarStyle?: {
/**
* Background color of the tab bar.
*
* Only supported on Android and iOS 18 and below.
*/
backgroundColor?: ColorValue;
/**
* Shadow color of the tab bar.
*
* Only supported on iOS 18 and below.
*/
shadowColor?: ColorValue;
/**
* Whether the tab bar is visible.
* Setting this to `'none'` hides the tab bar.
*/
display?: 'flex' | 'none';
};
/**
* Blur effect applied to the tab bar when tab screen is selected.
*
* Works with backgroundColor's alpha < 1.
*
* Only supported on iOS 18 and lower.
*
* The following values are currently supported:
*
* - `none` - disables blur effect
* - `systemDefault` - uses UIKit's default tab bar blur effect
* - one of styles mapped from UIKit's UIBlurEffectStyle, e.g. `systemUltraThinMaterial`
*
* Defaults to `systemDefault`.
*
* Complete list of possible blur effect styles is available in the official UIKit documentation:
* @see {@link https://developer.apple.com/documentation/uikit/uiblureffect/style|UIBlurEffect.Style}
*
* @platform ios
*/
tabBarBlurEffect?: TabsScreenBlurEffect;
/**
* Display mode for the tab bar.
*
* Available starting from iOS 18.
* Not supported on tvOS.
*
* The following values are currently supported:
*
* - `auto` - the system sets the display mode based on the tabs content
* - `tabBar` - the system displays the content only as a tab bar
* - `tabSidebar` - the tab bar is displayed as a sidebar
*
* Defaults to `auto`.
*
* @see {@link https://developer.apple.com/documentation/uikit/uitabbarcontroller/mode|UITabBarController.Mode}
*
* @platform ios
*/
tabBarControllerMode?: 'auto' | 'tabBar' | 'tabSidebar';
/**
* Minimize behavior for the tab bar.
*
* Available starting from iOS 26.
*
* The following values are currently supported:
*
* - `auto` - resolves to the system default minimize behavior
* - `never` - the tab bar does not minimize
* - `onScrollDown` - the tab bar minimizes when scrolling down and
* expands when scrolling back up
* - `onScrollUp` - the tab bar minimizes when scrolling up and expands
* when scrolling back down
*
* Defaults to `auto`.
*
* The supported values correspond to the official UIKit documentation:
* @see {@link https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior|UITabBarController.MinimizeBehavior}
*
* @platform ios
*/
tabBarMinimizeBehavior?: 'auto' | 'never' | 'onScrollDown' | 'onScrollUp';
/**
* Function which returns a React element to display as an accessory view.
*
* Accepts a `placement` parameter which can be one of the following values:
* - `regular` - at bottom of the screen, above the tab bar if tab bar is at the bottom
* - `inline` - inline with the collapsed bottom tab bar (e.g. when minimized based on `tabBarMinimizeBehavior`)
*
* Note: the content is rendered twice for both placements, but only one is visible at a time based on the tab bar state.
* Any shared state should be stored outside of the component to keep both versions in sync.
*
* Available starting from iOS 26.
*
* @platform ios
*/
bottomAccessory?: (options: {
placement: 'regular' | 'inline';
}) => React.ReactNode;
/**
* Specifies whether `contentInsetAdjustmentBehavior` of the `ScrollView`
* in the screen is automatically adjusted.
*
* `react-native`'s `ScrollView`s has `contentInsetAdjustmentBehavior` set to `never` by default.
* To provide a better UX, it is overridden to `automatic` - so it respects the tab bar.
* Otherwise, content can get hidden behind the tab bar as it's translucent on iOS 26+.
*
* Note that this only affects the `ScrollView` in first descendant chain of the screen,
* i.e., first view of each nested view is checked until a `ScrollView` is found.
*
* To disable this behavior for specific screens, set this option to `false`.
*
* Only supported with `native` implementation.
*
* Defaults to `true`.
*
* @platform ios
*/
overrideScrollViewContentInsetAdjustmentBehavior?: boolean;
/**
* Whether this screens should render the first time it's accessed. Defaults to `true`.
* Set it to `false` if you want to render the screen on initial render.
*/
lazy?: boolean;
/**
* Whether any nested stack should be popped to top when navigating away from the tab.
* Defaults to `false`.
*/
popToTopOnBlur?: boolean;
};
export type NativeBottomTabDescriptor = Descriptor<NativeBottomTabNavigationOptions, NativeBottomTabNavigationProp<ParamListBase>, RouteProp<ParamListBase>>;
export type NativeBottomTabDescriptorMap = Record<string, NativeBottomTabDescriptor>;
export type NativeBottomTabNavigationConfig = {};
export type NativeBottomTabBarProps = {
state: TabNavigationState<ParamListBase>;
descriptors: NativeBottomTabDescriptorMap;
navigation: NavigationHelpers<ParamListBase, NativeBottomTabNavigationEventMap>;
insets: EdgeInsets;
};
export type NativeBottomTabNavigatorProps = DefaultNavigatorOptions<ParamListBase, string | undefined, TabNavigationState<ParamListBase>, NativeBottomTabNavigationOptions, NativeBottomTabNavigationEventMap, NativeBottomTabNavigationProp<ParamListBase>> & TabRouterOptions & NativeBottomTabNavigationConfig;
export type NativeBottomTabNavigationHelpers = NavigationHelpers<ParamListBase, NativeBottomTabNavigationEventMap> & TabActionHelpers<ParamListBase>;
export type NativeBottomTabHeaderProps = {
/**
* Options for the current screen.
*/
options: NativeBottomTabNavigationOptions;
/**
* Route object for the current screen.
*/
route: RouteProp<ParamListBase>;
/**
* Navigation prop for the header.
*/
navigation: NativeBottomTabNavigationProp<ParamListBase>;
};
export {};
//# sourceMappingURL=types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/unstable/types.tsx"],"names":[],"mappings":"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"}

View File

@@ -0,0 +1,3 @@
import * as React from 'react';
export declare const BottomTabBarHeightCallbackContext: React.Context<((height: number) => void) | undefined>;
//# sourceMappingURL=BottomTabBarHeightCallbackContext.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"BottomTabBarHeightCallbackContext.d.ts","sourceRoot":"","sources":["../../../../src/utils/BottomTabBarHeightCallbackContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,eAAO,MAAM,iCAAiC,0BAClC,MAAM,KAAK,IAAI,cACf,CAAC"}

View File

@@ -0,0 +1,3 @@
import * as React from 'react';
export declare const BottomTabBarHeightContext: React.Context<number | undefined>;
//# sourceMappingURL=BottomTabBarHeightContext.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"BottomTabBarHeightContext.d.ts","sourceRoot":"","sources":["../../../../src/utils/BottomTabBarHeightContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,eAAO,MAAM,yBAAyB,mCAE1B,CAAC"}

View File

@@ -0,0 +1,4 @@
import type { NavigationState } from '@react-navigation/routers';
import { Animated } from 'react-native';
export declare function useAnimatedHashMap({ routes, index }: NavigationState): Record<string, Animated.Value>;
//# sourceMappingURL=useAnimatedHashMap.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"useAnimatedHashMap.d.ts","sourceRoot":"","sources":["../../../../src/utils/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"}

View File

@@ -0,0 +1,2 @@
export declare function useBottomTabBarHeight(): number;
//# sourceMappingURL=useBottomTabBarHeight.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"useBottomTabBarHeight.d.ts","sourceRoot":"","sources":["../../../../src/utils/useBottomTabBarHeight.tsx"],"names":[],"mappings":"AAIA,wBAAgB,qBAAqB,WAUpC"}

Some files were not shown because too many files have changed in this diff Show More