{"version":3,"sources":["BottomTabBar.tsx"],"names":["React","View","Animated","StyleSheet","Platform","NavigationContext","NavigationRouteContext","CommonActions","useTheme","useLinkBuilder","useSafeArea","BottomTabItem","BottomTabBarHeightCallbackContext","useWindowDimensions","useIsKeyboardShown","DEFAULT_TABBAR_HEIGHT","COMPACT_TABBAR_HEIGHT","DEFAULT_MAX_TAB_ITEM_WIDTH","useNativeDriver","OS","shouldUseHorizontalLabels","state","layout","dimensions","adaptive","labelPosition","tabStyle","width","maxTabItemWidth","flattenedStyle","flatten","maxWidth","routes","length","height","getPaddingBottom","insets","Math","max","bottom","select","ios","default","getTabBarHeight","style","rest","customHeight","isLandscape","horizontalLabels","paddingBottom","isPad","BottomTabBar","navigation","descriptors","activeBackgroundColor","activeTintColor","allowFontScaling","inactiveBackgroundColor","inactiveTintColor","keyboardHidesTabBar","labelStyle","iconStyle","safeAreaInsets","showLabel","colors","buildLink","focusedRoute","index","focusedDescriptor","key","focusedOptions","options","isKeyboardShown","onHeightChange","useContext","shouldShowTabBar","tabBarVisible","visibilityAnimationConfigRef","useRef","tabBarVisibilityAnimationConfig","useEffect","current","isTabBarHidden","setIsTabBarHidden","useState","visible","Value","visibilityAnimationConfig","animation","show","spring","timing","toValue","duration","config","start","finished","hide","setLayout","handleLayout","e","nativeEvent","topBorderWidth","styles","tabBar","borderTopWidth","defaultInsets","top","right","left","tabBarHeight","hasHorizontalLabels","backgroundColor","card","borderTopColor","border","transform","translateY","interpolate","inputRange","outputRange","hairlineWidth","position","paddingHorizontal","content","map","route","focused","onPress","event","emit","type","target","canPreventDefault","defaultPrevented","dispatch","navigate","name","onLongPress","label","tabBarLabel","undefined","title","accessibilityLabel","tabBarAccessibilityLabel","params","tabBarTestID","tabBarButton","tabBarIcon","tabBarBadge","tabBarBadgeStyle","create","elevation","flex","flexDirection"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACEC,IADF,EAEEC,QAFF,EAGEC,UAHF,EAIEC,QAJF,QAQO,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AZzB;AAaE,MAAA,uBAAuB,EAAEG,uBAb3B;AAcE,MAAA,MAAM,EAAEc,OAAO,CAAC4E,YAdlB;AAeE,MAAA,IAAI,EAAE5E,OAAO,CAAC6E,UAfhB;AAgBE,MAAA,KAAK,EAAE7E,OAAO,CAAC8E,WAhBjB;AAiBE,MAAA,UAAU,EAAE9E,OAAO,CAAC+E,gBAjBtB;AAkBE,MAAA,KAAK,EAAEX,KAlBT;AAmBE,MAAA,SAAS,EAAE5E,SAnBb;AAoBE,MAAA,UAAU,EAAEH,UApBd;AAqBE,MAAA,SAAS,EAAEC,SArBb;AAsBE,MAAA,KAAK,EAAEnC;AAtBT,MADF,CAJF,CADF;AAiCD,GAzEA,CADH,CAhCF,CADF;AA+GD;AAED,MAAM6E,MAAM,GAAGpG,UAAU,CAACoJ,MAAX,CAAkB;AAC/B/C,EAAAA,MAAM,EAAE;AACNK,IAAAA,IAAI,EAAE,CADA;AAEND,IAAAA,KAAK,EAAE,CAFD;AAGNrE,IAAAA,MAAM,EAAE,CAHF;AAINkE,IAAAA,cAAc,EAAEtG,UAAU,CAACsH,aAJrB;AAKN+B,IAAAA,SAAS,EAAE;AALL,GADuB;AAQ/B5B,EAAAA,OAAO,EAAE;AACP6B,IAAAA,IAAI,EAAE,CADC;AAEPC,IAAAA,aAAa,EAAE;AAFR;AARsB,CAAlB,CAAf","sourcesContent":["import React from 'react';\nimport {\n View,\n Animated,\n StyleSheet,\n Platform,\n LayoutChangeEvent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport {\n NavigationContext,\n NavigationRouteContext,\n TabNavigationState,\n ParamListBase,\n CommonActions,\n useTheme,\n useLinkBuilder,\n} from '@react-navigation/native';\nimport { useSafeArea, EdgeInsets } from 'react-native-safe-area-context';\n\nimport BottomTabItem from './BottomTabItem';\nimport BottomTabBarHeightCallbackContext from '../utils/BottomTabBarHeightCallbackContext';\nimport useWindowDimensions from '../utils/useWindowDimensions';\nimport useIsKeyboardShown from '../utils/useIsKeyboardShown';\nimport type { BottomTabBarProps, LabelPosition } from '../types';\n\ntype Props = BottomTabBarProps & {\n activeTintColor?: string;\n inactiveTintColor?: string;\n};\n\nconst DEFAULT_TABBAR_HEIGHT = 49;\nconst COMPACT_TABBAR_HEIGHT = 32;\nconst DEFAULT_MAX_TAB_ITEM_WIDTH = 125;\n\nconst useNativeDriver = Platform.OS !== 'web';\n\ntype Options = {\n state: TabNavigationState;\n layout: { height: number; width: number };\n dimensions: { height: number; width: number };\n tabStyle: StyleProp;\n labelPosition: LabelPosition | undefined;\n adaptive: boolean | undefined;\n};\n\nconst shouldUseHorizontalLabels = ({\n state,\n layout,\n dimensions,\n adaptive = true,\n labelPosition,\n tabStyle,\n}: Options) => {\n if (labelPosition) {\n return labelPosition === 'beside-icon';\n }\n\n if (!adaptive) {\n return false;\n }\n\n if (layout.width >= 768) {\n // Screen size matches a tablet\n let maxTabItemWidth = DEFAULT_MAX_TAB_ITEM_WIDTH;\n\n const flattenedStyle = StyleSheet.flatten(tabStyle);\n\n if (flattenedStyle) {\n if (typeof flattenedStyle.width === 'number') {\n maxTabItemWidth = flattenedStyle.width;\n } else if (typeof flattenedStyle.maxWidth === 'number') {\n maxTabItemWidth = flattenedStyle.maxWidth;\n }\n }\n\n return state.routes.length * maxTabItemWidth <= layout.width;\n } else {\n return dimensions.width > dimensions.height;\n }\n};\n\nconst getPaddingBottom = (insets: EdgeInsets) =>\n Math.max(insets.bottom - Platform.select({ ios: 4, default: 0 }), 0);\n\nexport const getTabBarHeight = ({\n dimensions,\n insets,\n style,\n ...rest\n}: Options & {\n insets: EdgeInsets;\n style: Animated.WithAnimatedValue>;\n}) => {\n // @ts-ignore\n const customHeight = StyleSheet.flatten(style)?.height;\n\n if (typeof customHeight === 'number') {\n return customHeight;\n }\n\n const isLandscape = dimensions.width > dimensions.height;\n const horizontalLabels = shouldUseHorizontalLabels({ dimensions, ...rest });\n const paddingBottom = getPaddingBottom(insets);\n\n if (\n Platform.OS === 'ios' &&\n !Platform.isPad &&\n isLandscape &&\n horizontalLabels\n ) {\n return COMPACT_TABBAR_HEIGHT + paddingBottom;\n }\n\n return DEFAULT_TABBAR_HEIGHT + paddingBottom;\n};\n\nexport default function BottomTabBar({\n state,\n navigation,\n descriptors,\n activeBackgroundColor,\n activeTintColor,\n adaptive,\n allowFontScaling,\n inactiveBackgroundColor,\n inactiveTintColor,\n keyboardHidesTabBar = false,\n labelPosition,\n labelStyle,\n iconStyle,\n safeAreaInsets,\n showLabel,\n style,\n tabStyle,\n}: Props) {\n const { colors } = useTheme();\n const buildLink = useLinkBuilder();\n\n const focusedRoute = state.routes[state.index];\n const focusedDescriptor = descriptors[focusedRoute.key];\n const focusedOptions = focusedDescriptor.options;\n\n const dimensions = useWindowDimensions();\n const isKeyboardShown = useIsKeyboardShown();\n\n const onHeightChange = React.useContext(BottomTabBarHeightCallbackContext);\n\n const shouldShowTabBar =\n focusedOptions.tabBarVisible !== false &&\n !(keyboardHidesTabBar && isKeyboardShown);\n\n const visibilityAnimationConfigRef = React.useRef(\n focusedOptions.tabBarVisibilityAnimationConfig\n );\n\n React.useEffect(() => {\n visibilityAnimationConfigRef.current =\n focusedOptions.tabBarVisibilityAnimationConfig;\n });\n\n const [isTabBarHidden, setIsTabBarHidden] = React.useState(!shouldShowTabBar);\n\n const [visible] = React.useState(\n () => new Animated.Value(shouldShowTabBar ? 1 : 0)\n );\n\n React.useEffect(() => {\n const visibilityAnimationConfig = visibilityAnimationConfigRef.current;\n\n if (shouldShowTabBar) {\n const animation =\n visibilityAnimationConfig?.show?.animation === 'spring'\n ? Animated.spring\n : Animated.timing;\n\n animation(visible, {\n toValue: 1,\n useNativeDriver,\n duration: 250,\n ...visibilityAnimationConfig?.show?.config,\n }).start(({ finished }) => {\n if (finished) {\n setIsTabBarHidden(false);\n }\n });\n } else {\n setIsTabBarHidden(true);\n\n const animation =\n visibilityAnimationConfig?.hide?.animation === 'spring'\n ? Animated.spring\n : Animated.timing;\n\n animation(visible, {\n toValue: 0,\n useNativeDriver,\n duration: 200,\n ...visibilityAnimationConfig?.hide?.config,\n }).start();\n }\n }, [visible, shouldShowTabBar]);\n\n const [layout, setLayout] = React.useState({\n height: 0,\n width: dimensions.width,\n });\n\n const handleLayout = (e: LayoutChangeEvent) => {\n const { height, width } = e.nativeEvent.layout;\n\n const topBorderWidth =\n // @ts-ignore\n StyleSheet.flatten([styles.tabBar, style])?.borderTopWidth;\n\n onHeightChange?.(\n height +\n paddingBottom +\n (typeof topBorderWidth === 'number' ? topBorderWidth : 0)\n );\n\n setLayout((layout) => {\n if (height === layout.height && width === layout.width) {\n return layout;\n } else {\n return {\n height,\n width,\n };\n }\n });\n };\n\n const { routes } = state;\n\n const defaultInsets = useSafeArea();\n\n const insets = {\n top: safeAreaInsets?.top ?? defaultInsets.top,\n right: safeAreaInsets?.right ?? defaultInsets.right,\n bottom: safeAreaInsets?.bottom ?? defaultInsets.bottom,\n left: safeAreaInsets?.left ?? defaultInsets.left,\n };\n\n const paddingBottom = getPaddingBottom(insets);\n const tabBarHeight = getTabBarHeight({\n state,\n insets,\n dimensions,\n layout,\n adaptive,\n labelPosition,\n tabStyle,\n style,\n });\n\n const hasHorizontalLabels = shouldUseHorizontalLabels({\n state,\n dimensions,\n layout,\n adaptive,\n labelPosition,\n tabStyle,\n });\n\n return (\n \n \n {routes.map((route, index) => {\n const focused = index === state.index;\n const { options } = descriptors[route.key];\n\n const onPress = () => {\n const event = navigation.emit({\n type: 'tabPress',\n target: route.key,\n canPreventDefault: true,\n });\n\n if (!focused && !event.defaultPrevented) {\n navigation.dispatch({\n ...CommonActions.navigate(route.name),\n target: state.key,\n });\n }\n };\n\n const onLongPress = () => {\n navigation.emit({\n type: 'tabLongPress',\n target: route.key,\n });\n };\n\n const label =\n options.tabBarLabel !== undefined\n ? options.tabBarLabel\n : options.title !== undefined\n ? options.title\n : route.name;\n\n const accessibilityLabel =\n options.tabBarAccessibilityLabel !== undefined\n ? options.tabBarAccessibilityLabel\n : typeof label === 'string'\n ? `${label}, tab, ${index + 1} of ${routes.length}`\n : undefined;\n\n return (\n \n \n \n \n \n );\n })}\n \n \n );\n}\n\nconst styles = StyleSheet.create({\n tabBar: {\n left: 0,\n right: 0,\n bottom: 0,\n borderTopWidth: StyleSheet.hairlineWidth,\n elevation: 8,\n },\n content: {\n flex: 1,\n flexDirection: 'row',\n },\n});\n"]}