@react-navigation/bottom-tabs 6.4.3 → 6.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/lib/commonjs/index.js +0 -7
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/navigators/createBottomTabNavigator.js +1 -17
  4. package/lib/commonjs/navigators/createBottomTabNavigator.js.map +1 -1
  5. package/lib/commonjs/types.js.map +1 -1
  6. package/lib/commonjs/utils/BottomTabBarHeightCallbackContext.js +0 -5
  7. package/lib/commonjs/utils/BottomTabBarHeightCallbackContext.js.map +1 -1
  8. package/lib/commonjs/utils/BottomTabBarHeightContext.js +0 -5
  9. package/lib/commonjs/utils/BottomTabBarHeightContext.js.map +1 -1
  10. package/lib/commonjs/utils/useBottomTabBarHeight.js +2 -10
  11. package/lib/commonjs/utils/useBottomTabBarHeight.js.map +1 -1
  12. package/lib/commonjs/utils/useIsKeyboardShown.js +0 -9
  13. package/lib/commonjs/utils/useIsKeyboardShown.js.map +1 -1
  14. package/lib/commonjs/views/Badge.js +2 -16
  15. package/lib/commonjs/views/Badge.js.map +1 -1
  16. package/lib/commonjs/views/BottomTabBar.js +5 -51
  17. package/lib/commonjs/views/BottomTabBar.js.map +1 -1
  18. package/lib/commonjs/views/BottomTabItem.js +9 -21
  19. package/lib/commonjs/views/BottomTabItem.js.map +1 -1
  20. package/lib/commonjs/views/BottomTabView.js +15 -39
  21. package/lib/commonjs/views/BottomTabView.js.map +1 -1
  22. package/lib/commonjs/views/ScreenFallback.js +2 -18
  23. package/lib/commonjs/views/ScreenFallback.js.map +1 -1
  24. package/lib/commonjs/views/TabBarIcon.js +3 -8
  25. package/lib/commonjs/views/TabBarIcon.js.map +1 -1
  26. package/lib/module/index.js +3 -2
  27. package/lib/module/index.js.map +1 -1
  28. package/lib/module/navigators/createBottomTabNavigator.js +1 -9
  29. package/lib/module/navigators/createBottomTabNavigator.js.map +1 -1
  30. package/lib/module/types.js.map +1 -1
  31. package/lib/module/utils/BottomTabBarHeightCallbackContext.js.map +1 -1
  32. package/lib/module/utils/BottomTabBarHeightContext.js.map +1 -1
  33. package/lib/module/utils/useBottomTabBarHeight.js +1 -3
  34. package/lib/module/utils/useBottomTabBarHeight.js.map +1 -1
  35. package/lib/module/utils/useIsKeyboardShown.js +0 -4
  36. package/lib/module/utils/useIsKeyboardShown.js.map +1 -1
  37. package/lib/module/views/Badge.js +2 -6
  38. package/lib/module/views/Badge.js.map +1 -1
  39. package/lib/module/views/BottomTabBar.js +5 -29
  40. package/lib/module/views/BottomTabBar.js.map +1 -1
  41. package/lib/module/views/BottomTabItem.js +9 -13
  42. package/lib/module/views/BottomTabItem.js.map +1 -1
  43. package/lib/module/views/BottomTabView.js +15 -26
  44. package/lib/module/views/BottomTabView.js.map +1 -1
  45. package/lib/module/views/ScreenFallback.js +2 -10
  46. package/lib/module/views/ScreenFallback.js.map +1 -1
  47. package/lib/module/views/TabBarIcon.js +3 -2
  48. package/lib/module/views/TabBarIcon.js.map +1 -1
  49. package/lib/typescript/src/index.d.ts +1 -0
  50. package/lib/typescript/src/index.d.ts.map +1 -0
  51. package/lib/typescript/src/navigators/createBottomTabNavigator.d.ts +1 -0
  52. package/lib/typescript/src/navigators/createBottomTabNavigator.d.ts.map +1 -0
  53. package/lib/typescript/src/types.d.ts +3 -1
  54. package/lib/typescript/src/types.d.ts.map +1 -0
  55. package/lib/typescript/src/utils/BottomTabBarHeightCallbackContext.d.ts +1 -0
  56. package/lib/typescript/src/utils/BottomTabBarHeightCallbackContext.d.ts.map +1 -0
  57. package/lib/typescript/src/utils/BottomTabBarHeightContext.d.ts +1 -0
  58. package/lib/typescript/src/utils/BottomTabBarHeightContext.d.ts.map +1 -0
  59. package/lib/typescript/src/utils/useBottomTabBarHeight.d.ts +2 -1
  60. package/lib/typescript/src/utils/useBottomTabBarHeight.d.ts.map +1 -0
  61. package/lib/typescript/src/utils/useIsKeyboardShown.d.ts +1 -0
  62. package/lib/typescript/src/utils/useIsKeyboardShown.d.ts.map +1 -0
  63. package/lib/typescript/src/views/Badge.d.ts +1 -0
  64. package/lib/typescript/src/views/Badge.d.ts.map +1 -0
  65. package/lib/typescript/src/views/BottomTabBar.d.ts +1 -0
  66. package/lib/typescript/src/views/BottomTabBar.d.ts.map +1 -0
  67. package/lib/typescript/src/views/BottomTabItem.d.ts +8 -2
  68. package/lib/typescript/src/views/BottomTabItem.d.ts.map +1 -0
  69. package/lib/typescript/src/views/BottomTabView.d.ts +1 -0
  70. package/lib/typescript/src/views/BottomTabView.d.ts.map +1 -0
  71. package/lib/typescript/src/views/ScreenFallback.d.ts +1 -0
  72. package/lib/typescript/src/views/ScreenFallback.d.ts.map +1 -0
  73. package/lib/typescript/src/views/TabBarIcon.d.ts +1 -0
  74. package/lib/typescript/src/views/TabBarIcon.d.ts.map +1 -0
  75. package/package.json +5 -5
  76. package/src/types.tsx +2 -1
  77. package/src/utils/useBottomTabBarHeight.tsx +1 -1
  78. package/src/views/BottomTabBar.tsx +1 -0
  79. package/src/views/BottomTabItem.tsx +20 -1
@@ -39,18 +39,11 @@ Object.defineProperty(exports, "useBottomTabBarHeight", {
39
39
  return _useBottomTabBarHeight.default;
40
40
  }
41
41
  });
42
-
43
42
  var _createBottomTabNavigator = _interopRequireDefault(require("./navigators/createBottomTabNavigator"));
44
-
45
43
  var _BottomTabBar = _interopRequireDefault(require("./views/BottomTabBar"));
46
-
47
44
  var _BottomTabView = _interopRequireDefault(require("./views/BottomTabView"));
48
-
49
45
  var _BottomTabBarHeightCallbackContext = _interopRequireDefault(require("./utils/BottomTabBarHeightCallbackContext"));
50
-
51
46
  var _BottomTabBarHeightContext = _interopRequireDefault(require("./utils/BottomTabBarHeightContext"));
52
-
53
47
  var _useBottomTabBarHeight = _interopRequireDefault(require("./utils/useBottomTabBarHeight"));
54
-
55
48
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
56
49
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["/**\n * Navigators\n */\nexport { default as createBottomTabNavigator } from './navigators/createBottomTabNavigator';\n\n/**\n * Views\n */\nexport { default as BottomTabBar } from './views/BottomTabBar';\nexport { default as BottomTabView } from './views/BottomTabView';\n\n/**\n * Utilities\n */\nexport { default as BottomTabBarHeightCallbackContext } from './utils/BottomTabBarHeightCallbackContext';\nexport { default as BottomTabBarHeightContext } from './utils/BottomTabBarHeightContext';\nexport { default as useBottomTabBarHeight } from './utils/useBottomTabBarHeight';\n\n/**\n * Types\n */\nexport type {\n BottomTabBarButtonProps,\n BottomTabBarProps,\n BottomTabHeaderProps,\n BottomTabNavigationEventMap,\n BottomTabNavigationOptions,\n BottomTabNavigationProp,\n BottomTabScreenProps,\n} from './types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AACA"}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AAKA;AACA;AAKA;AACA;AACA;AAAiF"}
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _native = require("@react-navigation/native");
9
-
10
8
  var React = _interopRequireWildcard(require("react"));
11
-
12
9
  var _warnOnce = _interopRequireDefault(require("warn-once"));
13
-
14
10
  var _BottomTabView = _interopRequireDefault(require("../views/BottomTabView"));
15
-
16
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
12
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
-
20
13
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
-
22
14
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
-
24
15
  function BottomTabNavigator(_ref) {
25
16
  let {
26
17
  id,
@@ -40,10 +31,7 @@ function BottomTabNavigator(_ref) {
40
31
  ...rest
41
32
  } = restWithDeprecated;
42
33
  let defaultScreenOptions = {};
43
-
44
34
  if (tabBarOptions) {
45
- var _tabBarOptions$labelP;
46
-
47
35
  Object.assign(defaultScreenOptions, {
48
36
  tabBarHideOnKeyboard: tabBarOptions.keyboardHidesTabBar,
49
37
  tabBarActiveTintColor: tabBarOptions.activeTintColor,
@@ -55,7 +43,7 @@ function BottomTabNavigator(_ref) {
55
43
  tabBarLabelStyle: tabBarOptions.labelStyle,
56
44
  tabBarIconStyle: tabBarOptions.iconStyle,
57
45
  tabBarItemStyle: tabBarOptions.tabStyle,
58
- tabBarLabelPosition: (_tabBarOptions$labelP = tabBarOptions.labelPosition) !== null && _tabBarOptions$labelP !== void 0 ? _tabBarOptions$labelP : tabBarOptions.adaptive === false ? 'below-icon' : undefined,
46
+ tabBarLabelPosition: tabBarOptions.labelPosition ?? (tabBarOptions.adaptive === false ? 'below-icon' : undefined),
59
47
  tabBarStyle: [{
60
48
  display: tabBarOptions.tabBarVisible ? 'none' : 'flex'
61
49
  }, defaultScreenOptions.tabBarStyle]
@@ -68,12 +56,10 @@ function BottomTabNavigator(_ref) {
68
56
  });
69
57
  (0, _warnOnce.default)(tabBarOptions, `Bottom Tab Navigator: 'tabBarOptions' is deprecated. Migrate the options to 'screenOptions' instead.\n\nPlace the following in 'screenOptions' in your code to keep current behavior:\n\n${JSON.stringify(defaultScreenOptions, null, 2)}\n\nSee https://reactnavigation.org/docs/bottom-tab-navigator#options for more details.`);
70
58
  }
71
-
72
59
  if (typeof lazy === 'boolean') {
73
60
  defaultScreenOptions.lazy = lazy;
74
61
  (0, _warnOnce.default)(true, `Bottom Tab Navigator: 'lazy' in props is deprecated. Move it to 'screenOptions' instead.\n\nSee https://reactnavigation.org/docs/bottom-tab-navigator/#lazy for more details.`);
75
62
  }
76
-
77
63
  const {
78
64
  state,
79
65
  descriptors,
@@ -95,8 +81,6 @@ function BottomTabNavigator(_ref) {
95
81
  sceneContainerStyle: sceneContainerStyle
96
82
  })));
97
83
  }
98
-
99
84
  var _default = (0, _native.createNavigatorFactory)(BottomTabNavigator);
100
-
101
85
  exports.default = _default;
102
86
  //# sourceMappingURL=createBottomTabNavigator.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BottomTabNavigator","id","initialRouteName","backBehavior","children","screenListeners","screenOptions","sceneContainerStyle","restWithDeprecated","lazy","tabBarOptions","rest","defaultScreenOptions","Object","assign","tabBarHideOnKeyboard","keyboardHidesTabBar","tabBarActiveTintColor","activeTintColor","tabBarInactiveTintColor","inactiveTintColor","tabBarActiveBackgroundColor","activeBackgroundColor","tabBarInactiveBackgroundColor","inactiveBackgroundColor","tabBarAllowFontScaling","allowFontScaling","tabBarShowLabel","showLabel","tabBarLabelStyle","labelStyle","tabBarIconStyle","iconStyle","tabBarItemStyle","tabStyle","tabBarLabelPosition","labelPosition","adaptive","undefined","tabBarStyle","display","tabBarVisible","keys","forEach","key","warnOnce","JSON","stringify","state","descriptors","navigation","NavigationContent","useNavigationBuilder","TabRouter","createNavigatorFactory"],"sources":["createBottomTabNavigator.tsx"],"sourcesContent":["import {\n createNavigatorFactory,\n DefaultNavigatorOptions,\n ParamListBase,\n TabActionHelpers,\n TabNavigationState,\n TabRouter,\n TabRouterOptions,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport warnOnce from 'warn-once';\n\nimport type {\n BottomTabNavigationConfig,\n BottomTabNavigationEventMap,\n BottomTabNavigationOptions,\n} from '../types';\nimport BottomTabView from '../views/BottomTabView';\n\ntype Props = DefaultNavigatorOptions<\n ParamListBase,\n TabNavigationState<ParamListBase>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap\n> &\n TabRouterOptions &\n BottomTabNavigationConfig;\n\nfunction BottomTabNavigator({\n id,\n initialRouteName,\n backBehavior,\n children,\n screenListeners,\n screenOptions,\n sceneContainerStyle,\n ...restWithDeprecated\n}: Props) {\n const {\n // @ts-expect-error: lazy is deprecated\n lazy,\n // @ts-expect-error: tabBarOptions is deprecated\n tabBarOptions,\n ...rest\n } = restWithDeprecated;\n\n let defaultScreenOptions: BottomTabNavigationOptions = {};\n\n if (tabBarOptions) {\n Object.assign(defaultScreenOptions, {\n tabBarHideOnKeyboard: tabBarOptions.keyboardHidesTabBar,\n tabBarActiveTintColor: tabBarOptions.activeTintColor,\n tabBarInactiveTintColor: tabBarOptions.inactiveTintColor,\n tabBarActiveBackgroundColor: tabBarOptions.activeBackgroundColor,\n tabBarInactiveBackgroundColor: tabBarOptions.inactiveBackgroundColor,\n tabBarAllowFontScaling: tabBarOptions.allowFontScaling,\n tabBarShowLabel: tabBarOptions.showLabel,\n tabBarLabelStyle: tabBarOptions.labelStyle,\n tabBarIconStyle: tabBarOptions.iconStyle,\n tabBarItemStyle: tabBarOptions.tabStyle,\n tabBarLabelPosition:\n tabBarOptions.labelPosition ??\n (tabBarOptions.adaptive === false ? 'below-icon' : undefined),\n tabBarStyle: [\n { display: tabBarOptions.tabBarVisible ? 'none' : 'flex' },\n defaultScreenOptions.tabBarStyle,\n ],\n });\n\n (\n Object.keys(defaultScreenOptions) as (keyof BottomTabNavigationOptions)[]\n ).forEach((key) => {\n if (defaultScreenOptions[key] === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete defaultScreenOptions[key];\n }\n });\n\n warnOnce(\n tabBarOptions,\n `Bottom Tab Navigator: 'tabBarOptions' is deprecated. Migrate the options to 'screenOptions' instead.\\n\\nPlace the following in 'screenOptions' in your code to keep current behavior:\\n\\n${JSON.stringify(\n defaultScreenOptions,\n null,\n 2\n )}\\n\\nSee https://reactnavigation.org/docs/bottom-tab-navigator#options for more details.`\n );\n }\n\n if (typeof lazy === 'boolean') {\n defaultScreenOptions.lazy = lazy;\n\n warnOnce(\n true,\n `Bottom Tab Navigator: 'lazy' in props is deprecated. Move it to 'screenOptions' instead.\\n\\nSee https://reactnavigation.org/docs/bottom-tab-navigator/#lazy for more details.`\n );\n }\n\n const { state, descriptors, navigation, NavigationContent } =\n useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n TabActionHelpers<ParamListBase>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap\n >(TabRouter, {\n id,\n initialRouteName,\n backBehavior,\n children,\n screenListeners,\n screenOptions,\n defaultScreenOptions,\n });\n\n return (\n <NavigationContent>\n <BottomTabView\n {...rest}\n state={state}\n navigation={navigation}\n descriptors={descriptors}\n sceneContainerStyle={sceneContainerStyle}\n />\n </NavigationContent>\n );\n}\n\nexport default createNavigatorFactory<\n TabNavigationState<ParamListBase>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap,\n typeof BottomTabNavigator\n>(BottomTabNavigator);\n"],"mappings":";;;;;;;AAAA;;AAUA;;AACA;;AAOA;;;;;;;;;;AAWA,SAASA,kBAAT,OASU;EAAA,IATkB;IAC1BC,EAD0B;IAE1BC,gBAF0B;IAG1BC,YAH0B;IAI1BC,QAJ0B;IAK1BC,eAL0B;IAM1BC,aAN0B;IAO1BC,mBAP0B;IAQ1B,GAAGC;EARuB,CASlB;EACR,MAAM;IACJ;IACAC,IAFI;IAGJ;IACAC,aAJI;IAKJ,GAAGC;EALC,IAMFH,kBANJ;EAQA,IAAII,oBAAgD,GAAG,EAAvD;;EAEA,IAAIF,aAAJ,EAAmB;IAAA;;IACjBG,MAAM,CAACC,MAAP,CAAcF,oBAAd,EAAoC;MAClCG,oBAAoB,EAAEL,aAAa,CAACM,mBADF;MAElCC,qBAAqB,EAAEP,aAAa,CAACQ,eAFH;MAGlCC,uBAAuB,EAAET,aAAa,CAACU,iBAHL;MAIlCC,2BAA2B,EAAEX,aAAa,CAACY,qBAJT;MAKlCC,6BAA6B,EAAEb,aAAa,CAACc,uBALX;MAMlCC,sBAAsB,EAAEf,aAAa,CAACgB,gBANJ;MAOlCC,eAAe,EAAEjB,aAAa,CAACkB,SAPG;MAQlCC,gBAAgB,EAAEnB,aAAa,CAACoB,UARE;MASlCC,eAAe,EAAErB,aAAa,CAACsB,SATG;MAUlCC,eAAe,EAAEvB,aAAa,CAACwB,QAVG;MAWlCC,mBAAmB,2BACjBzB,aAAa,CAAC0B,aADG,yEAEhB1B,aAAa,CAAC2B,QAAd,KAA2B,KAA3B,GAAmC,YAAnC,GAAkDC,SAbnB;MAclCC,WAAW,EAAE,CACX;QAAEC,OAAO,EAAE9B,aAAa,CAAC+B,aAAd,GAA8B,MAA9B,GAAuC;MAAlD,CADW,EAEX7B,oBAAoB,CAAC2B,WAFV;IAdqB,CAApC;IAqBE1B,MAAM,CAAC6B,IAAP,CAAY9B,oBAAZ,CADF,CAEE+B,OAFF,CAEWC,GAAD,IAAS;MACjB,IAAIhC,oBAAoB,CAACgC,GAAD,CAApB,KAA8BN,SAAlC,EAA6C;QAC3C;QACA,OAAO1B,oBAAoB,CAACgC,GAAD,CAA3B;MACD;IACF,CAPD;IASA,IAAAC,iBAAA,EACEnC,aADF,EAEG,4LAA2LoC,IAAI,CAACC,SAAL,CAC1LnC,oBAD0L,EAE1L,IAF0L,EAG1L,CAH0L,CAI1L,yFANJ;EAQD;;EAED,IAAI,OAAOH,IAAP,KAAgB,SAApB,EAA+B;IAC7BG,oBAAoB,CAACH,IAArB,GAA4BA,IAA5B;IAEA,IAAAoC,iBAAA,EACE,IADF,EAEG,+KAFH;EAID;;EAED,MAAM;IAAEG,KAAF;IAASC,WAAT;IAAsBC,UAAtB;IAAkCC;EAAlC,IACJ,IAAAC,4BAAA,EAMEC,iBANF,EAMa;IACXpD,EADW;IAEXC,gBAFW;IAGXC,YAHW;IAIXC,QAJW;IAKXC,eALW;IAMXC,aANW;IAOXM;EAPW,CANb,CADF;EAiBA,oBACE,oBAAC,iBAAD,qBACE,oBAAC,sBAAD,eACMD,IADN;IAEE,KAAK,EAAEqC,KAFT;IAGE,UAAU,EAAEE,UAHd;IAIE,WAAW,EAAED,WAJf;IAKE,mBAAmB,EAAE1C;EALvB,GADF,CADF;AAWD;;eAEc,IAAA+C,8BAAA,EAKbtD,kBALa,C"}
1
+ {"version":3,"names":["BottomTabNavigator","id","initialRouteName","backBehavior","children","screenListeners","screenOptions","sceneContainerStyle","restWithDeprecated","lazy","tabBarOptions","rest","defaultScreenOptions","Object","assign","tabBarHideOnKeyboard","keyboardHidesTabBar","tabBarActiveTintColor","activeTintColor","tabBarInactiveTintColor","inactiveTintColor","tabBarActiveBackgroundColor","activeBackgroundColor","tabBarInactiveBackgroundColor","inactiveBackgroundColor","tabBarAllowFontScaling","allowFontScaling","tabBarShowLabel","showLabel","tabBarLabelStyle","labelStyle","tabBarIconStyle","iconStyle","tabBarItemStyle","tabStyle","tabBarLabelPosition","labelPosition","adaptive","undefined","tabBarStyle","display","tabBarVisible","keys","forEach","key","warnOnce","JSON","stringify","state","descriptors","navigation","NavigationContent","useNavigationBuilder","TabRouter","createNavigatorFactory"],"sourceRoot":"../../src","sources":["createBottomTabNavigator.tsx"],"mappings":";;;;;;AAAA;AAUA;AACA;AAOA;AAAmD;AAAA;AAAA;AAAA;AAWnD,SAASA,kBAAkB,OASjB;EAAA,IATkB;IAC1BC,EAAE;IACFC,gBAAgB;IAChBC,YAAY;IACZC,QAAQ;IACRC,eAAe;IACfC,aAAa;IACbC,mBAAmB;IACnB,GAAGC;EACE,CAAC;EACN,MAAM;IACJ;IACAC,IAAI;IACJ;IACAC,aAAa;IACb,GAAGC;EACL,CAAC,GAAGH,kBAAkB;EAEtB,IAAII,oBAAgD,GAAG,CAAC,CAAC;EAEzD,IAAIF,aAAa,EAAE;IACjBG,MAAM,CAACC,MAAM,CAACF,oBAAoB,EAAE;MAClCG,oBAAoB,EAAEL,aAAa,CAACM,mBAAmB;MACvDC,qBAAqB,EAAEP,aAAa,CAACQ,eAAe;MACpDC,uBAAuB,EAAET,aAAa,CAACU,iBAAiB;MACxDC,2BAA2B,EAAEX,aAAa,CAACY,qBAAqB;MAChEC,6BAA6B,EAAEb,aAAa,CAACc,uBAAuB;MACpEC,sBAAsB,EAAEf,aAAa,CAACgB,gBAAgB;MACtDC,eAAe,EAAEjB,aAAa,CAACkB,SAAS;MACxCC,gBAAgB,EAAEnB,aAAa,CAACoB,UAAU;MAC1CC,eAAe,EAAErB,aAAa,CAACsB,SAAS;MACxCC,eAAe,EAAEvB,aAAa,CAACwB,QAAQ;MACvCC,mBAAmB,EACjBzB,aAAa,CAAC0B,aAAa,KAC1B1B,aAAa,CAAC2B,QAAQ,KAAK,KAAK,GAAG,YAAY,GAAGC,SAAS,CAAC;MAC/DC,WAAW,EAAE,CACX;QAAEC,OAAO,EAAE9B,aAAa,CAAC+B,aAAa,GAAG,MAAM,GAAG;MAAO,CAAC,EAC1D7B,oBAAoB,CAAC2B,WAAW;IAEpC,CAAC,CAAC;IAGA1B,MAAM,CAAC6B,IAAI,CAAC9B,oBAAoB,CAAC,CACjC+B,OAAO,CAAEC,GAAG,IAAK;MACjB,IAAIhC,oBAAoB,CAACgC,GAAG,CAAC,KAAKN,SAAS,EAAE;QAC3C;QACA,OAAO1B,oBAAoB,CAACgC,GAAG,CAAC;MAClC;IACF,CAAC,CAAC;IAEF,IAAAC,iBAAQ,EACNnC,aAAa,EACZ,4LAA2LoC,IAAI,CAACC,SAAS,CACxMnC,oBAAoB,EACpB,IAAI,EACJ,CAAC,CACD,yFAAwF,CAC3F;EACH;EAEA,IAAI,OAAOH,IAAI,KAAK,SAAS,EAAE;IAC7BG,oBAAoB,CAACH,IAAI,GAAGA,IAAI;IAEhC,IAAAoC,iBAAQ,EACN,IAAI,EACH,+KAA8K,CAChL;EACH;EAEA,MAAM;IAAEG,KAAK;IAAEC,WAAW;IAAEC,UAAU;IAAEC;EAAkB,CAAC,GACzD,IAAAC,4BAAoB,EAMlBC,iBAAS,EAAE;IACXpD,EAAE;IACFC,gBAAgB;IAChBC,YAAY;IACZC,QAAQ;IACRC,eAAe;IACfC,aAAa;IACbM;EACF,CAAC,CAAC;EAEJ,oBACE,oBAAC,iBAAiB,qBAChB,oBAAC,sBAAa,eACRD,IAAI;IACR,KAAK,EAAEqC,KAAM;IACb,UAAU,EAAEE,UAAW;IACvB,WAAW,EAAED,WAAY;IACzB,mBAAmB,EAAE1C;EAAoB,GACzC,CACgB;AAExB;AAAC,eAEc,IAAA+C,8BAAsB,EAKnCtD,kBAAkB,CAAC;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.tsx"],"sourcesContent":["import type { HeaderOptions } from '@react-navigation/elements';\nimport type {\n Descriptor,\n NavigationHelpers,\n NavigationProp,\n ParamListBase,\n RouteProp,\n TabActionHelpers,\n TabNavigationState,\n} from '@react-navigation/native';\nimport type * as React from 'react';\nimport type {\n Animated,\n GestureResponderEvent,\n StyleProp,\n TextStyle,\n TouchableWithoutFeedbackProps,\n ViewStyle,\n} from 'react-native';\nimport type { EdgeInsets } from 'react-native-safe-area-context';\n\nexport type Layout = { width: number; height: number };\n\nexport type BottomTabNavigationEventMap = {\n /**\n * Event which fires on tapping on the tab in the tab bar.\n */\n tabPress: { data: undefined; canPreventDefault: true };\n /**\n * Event which fires on long press on the tab in the tab bar.\n */\n tabLongPress: { data: undefined };\n};\n\nexport type LabelPosition = 'beside-icon' | 'below-icon';\n\nexport type BottomTabNavigationHelpers = NavigationHelpers<\n ParamListBase,\n BottomTabNavigationEventMap\n> &\n TabActionHelpers<ParamListBase>;\n\nexport type BottomTabNavigationProp<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList = keyof ParamList,\n NavigatorID extends string | undefined = undefined\n> = NavigationProp<\n ParamList,\n RouteName,\n NavigatorID,\n TabNavigationState<ParamList>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap\n> &\n TabActionHelpers<ParamList>;\n\nexport type BottomTabScreenProps<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList = keyof ParamList,\n NavigatorID extends string | undefined = undefined\n> = {\n navigation: BottomTabNavigationProp<ParamList, RouteName, NavigatorID>;\n route: RouteProp<ParamList, RouteName>;\n};\n\nexport type TimingKeyboardAnimationConfig = {\n animation: 'timing';\n config?: Omit<\n Partial<Animated.TimingAnimationConfig>,\n 'toValue' | 'useNativeDriver'\n >;\n};\n\nexport type SpringKeyboardAnimationConfig = {\n animation: 'spring';\n config?: Omit<\n Partial<Animated.SpringAnimationConfig>,\n 'toValue' | 'useNativeDriver'\n >;\n};\n\nexport type TabBarVisibilityAnimationConfig =\n | TimingKeyboardAnimationConfig\n | SpringKeyboardAnimationConfig;\n\nexport type BottomTabNavigationOptions = HeaderOptions & {\n /**\n * Title text for the screen.\n */\n title?: string;\n\n /**\n * Title string of a tab displayed in the tab bar\n * or a function that given { focused: boolean, color: string, position: 'below-icon' | 'beside-icon' } returns a React.Node to display in tab bar.\n *\n * When undefined, scene title is used. Use `tabBarShowLabel` to hide the label.\n */\n tabBarLabel?:\n | string\n | ((props: {\n focused: boolean;\n color: string;\n position: LabelPosition;\n }) => React.ReactNode);\n\n /**\n * Whether the tab label should be visible. Defaults to `true`.\n */\n tabBarShowLabel?: boolean;\n\n /**\n * Whether the label is shown below the icon or beside the icon.\n *\n * - `below-icon`: the label is shown below the icon (typical for iPhones)\n * - `beside-icon` the label is shown next to the icon (typical for iPad)\n *\n * By default, the position is chosen automatically based on device width.\n */\n tabBarLabelPosition?: LabelPosition;\n\n /**\n * Style object for the tab label.\n */\n tabBarLabelStyle?: StyleProp<TextStyle>;\n\n /**\n * Whether label font should scale to respect Text Size accessibility settings.\n */\n tabBarAllowFontScaling?: boolean;\n\n /**\n * A function that given { focused: boolean, color: string } returns a React.Node to display in the tab bar.\n */\n tabBarIcon?: (props: {\n focused: boolean;\n color: string;\n size: number;\n }) => React.ReactNode;\n\n /**\n * Style object for the tab icon.\n */\n tabBarIconStyle?: StyleProp<TextStyle>;\n\n /**\n * Text to show in a badge on the tab icon.\n */\n tabBarBadge?: number | string;\n\n /**\n * Custom style for the tab bar badge.\n * You can specify a background color or text color here.\n */\n tabBarBadgeStyle?: StyleProp<TextStyle>;\n\n /**\n * Accessibility label for the tab button. This is read by the screen reader when the user taps the tab.\n * It's recommended to set this if you don't have a label for the tab.\n */\n tabBarAccessibilityLabel?: string;\n\n /**\n * ID to locate this tab button in tests.\n */\n tabBarTestID?: string;\n\n /**\n * Function which returns a React element to render as the tab bar button.\n * Renders `Pressable` by default.\n */\n tabBarButton?: (props: BottomTabBarButtonProps) => React.ReactNode;\n\n /**\n * Color for the icon and label in the active tab.\n */\n tabBarActiveTintColor?: string;\n\n /**\n * Color for the icon and label in the inactive tabs.\n */\n tabBarInactiveTintColor?: string;\n\n /**\n * Background color for the active tab.\n */\n tabBarActiveBackgroundColor?: string;\n\n /**\n * Background color for the inactive tabs.\n */\n tabBarInactiveBackgroundColor?: string;\n\n /**\n * Style object for the tab item container.\n */\n tabBarItemStyle?: StyleProp<ViewStyle>;\n\n /**\n * Whether the tab bar gets hidden when the keyboard is shown. Defaults to `false`.\n */\n tabBarHideOnKeyboard?: boolean;\n\n /**\n * Animation config for showing and hiding the tab bar when the keyboard is shown/hidden.\n */\n tabBarVisibilityAnimationConfig?: {\n show?: TabBarVisibilityAnimationConfig;\n hide?: TabBarVisibilityAnimationConfig;\n };\n\n /**\n * Style object for the tab bar container.\n */\n tabBarStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n\n /**\n * Function which returns a React Element to use as background for the tab bar.\n * You could render an image, a gradient, blur view etc.\n *\n * When using `BlurView`, make sure to set `position: 'absolute'` in `tabBarStyle` as well.\n * You'd also need to use `useBottomTabBarHeight()` to add a bottom padding to your content.\n */\n tabBarBackground?: () => React.ReactNode;\n\n /**\n * Whether this screens should render the first time it's accessed. Defaults to `true`.\n * Set it to `false` if you want to render the screen on initial render.\n */\n lazy?: boolean;\n\n /**\n * Function that given returns a React Element to display as a header.\n */\n header?: (props: BottomTabHeaderProps) => React.ReactNode;\n\n /**\n * Whether to show the header. Setting this to `false` hides the header.\n * Defaults to `true`.\n */\n headerShown?: boolean;\n\n /**\n * Whether this screen should be unmounted when navigating away from it.\n * Defaults to `false`.\n */\n unmountOnBlur?: boolean;\n\n /**\n * Whether inactive screens should be suspended from re-rendering. Defaults to `false`.\n * Defaults to `true` when `enableFreeze()` is run at the top of the application.\n * Requires `react-native-screens` version >=3.16.0.\n *\n * Only supported on iOS and Android.\n */\n freezeOnBlur?: boolean;\n};\n\nexport type BottomTabDescriptor = Descriptor<\n BottomTabNavigationOptions,\n BottomTabNavigationProp<ParamListBase>,\n RouteProp<ParamListBase>\n>;\n\nexport type BottomTabDescriptorMap = Record<string, BottomTabDescriptor>;\n\nexport type BottomTabNavigationConfig = {\n /**\n * Function that returns a React element to display as the tab bar.\n */\n tabBar?: (props: BottomTabBarProps) => React.ReactNode;\n /**\n * 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.\n * By default, the device's safe area insets are automatically detected. You can override the behavior with this option.\n */\n safeAreaInsets?: {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n };\n /**\n * Whether inactive screens should be detached from the view hierarchy to save memory.\n * Make sure to call `enableScreens` from `react-native-screens` to make it work.\n * Defaults to `true` on Android.\n */\n detachInactiveScreens?: boolean;\n /**\n * Style object for the component wrapping the screen content.\n */\n sceneContainerStyle?: StyleProp<ViewStyle>;\n};\n\nexport type BottomTabHeaderProps = {\n /**\n * Layout of the screen.\n */\n layout: Layout;\n /**\n * Options for the current screen.\n */\n options: BottomTabNavigationOptions;\n /**\n * Route object for the current screen.\n */\n route: RouteProp<ParamListBase>;\n /**\n * Navigation prop for the header.\n */\n navigation: BottomTabNavigationProp<ParamListBase>;\n};\n\nexport type BottomTabBarProps = {\n state: TabNavigationState<ParamListBase>;\n descriptors: BottomTabDescriptorMap;\n navigation: NavigationHelpers<ParamListBase, BottomTabNavigationEventMap>;\n insets: EdgeInsets;\n};\n\nexport type BottomTabBarButtonProps = Omit<\n TouchableWithoutFeedbackProps,\n 'onPress'\n> & {\n to?: string;\n children: React.ReactNode;\n onPress?: (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => void;\n};\n"],"mappings":""}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.tsx"],"mappings":""}
@@ -4,14 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
8
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
-
12
9
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
-
14
10
  var _default = /*#__PURE__*/React.createContext(undefined);
15
-
16
11
  exports.default = _default;
17
12
  //# sourceMappingURL=BottomTabBarHeightCallbackContext.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","createContext","undefined"],"sources":["BottomTabBarHeightCallbackContext.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport default React.createContext<((height: number) => void) | undefined>(\n undefined\n);\n"],"mappings":";;;;;;;AAAA;;;;;;4BAEeA,KAAK,CAACC,aAAN,CACbC,SADa,C"}
1
+ {"version":3,"names":["React","createContext","undefined"],"sourceRoot":"../../src","sources":["BottomTabBarHeightCallbackContext.tsx"],"mappings":";;;;;;AAAA;AAA+B;AAAA;AAAA,4BAEhBA,KAAK,CAACC,aAAa,CAChCC,SAAS,CACV;AAAA"}
@@ -4,14 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
8
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
-
12
9
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
-
14
10
  var _default = /*#__PURE__*/React.createContext(undefined);
15
-
16
11
  exports.default = _default;
17
12
  //# sourceMappingURL=BottomTabBarHeightContext.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","createContext","undefined"],"sources":["BottomTabBarHeightContext.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport default React.createContext<number | undefined>(undefined);\n"],"mappings":";;;;;;;AAAA;;;;;;4BAEeA,KAAK,CAACC,aAAN,CAAwCC,SAAxC,C"}
1
+ {"version":3,"names":["React","createContext","undefined"],"sourceRoot":"../../src","sources":["BottomTabBarHeightContext.tsx"],"mappings":";;;;;;AAAA;AAA+B;AAAA;AAAA,4BAEhBA,KAAK,CAACC,aAAa,CAAqBC,SAAS,CAAC;AAAA"}
@@ -3,25 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = useFloatingBottomTabBarHeight;
7
-
6
+ exports.default = useBottomTabBarHeight;
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
8
  var _BottomTabBarHeightContext = _interopRequireDefault(require("./BottomTabBarHeightContext"));
11
-
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
-
16
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
-
18
- function useFloatingBottomTabBarHeight() {
12
+ function useBottomTabBarHeight() {
19
13
  const height = React.useContext(_BottomTabBarHeightContext.default);
20
-
21
14
  if (height === undefined) {
22
15
  throw new Error("Couldn't find the bottom tab bar height. Are you inside a screen in Bottom Tab Navigator?");
23
16
  }
24
-
25
17
  return height;
26
18
  }
27
19
  //# sourceMappingURL=useBottomTabBarHeight.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useFloatingBottomTabBarHeight","height","React","useContext","BottomTabBarHeightContext","undefined","Error"],"sources":["useBottomTabBarHeight.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport BottomTabBarHeightContext from './BottomTabBarHeightContext';\n\nexport default function useFloatingBottomTabBarHeight() {\n const height = React.useContext(BottomTabBarHeightContext);\n\n if (height === undefined) {\n throw new Error(\n \"Couldn't find the bottom tab bar height. Are you inside a screen in Bottom Tab Navigator?\"\n );\n }\n\n return height;\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;;;AAEe,SAASA,6BAAT,GAAyC;EACtD,MAAMC,MAAM,GAAGC,KAAK,CAACC,UAAN,CAAiBC,kCAAjB,CAAf;;EAEA,IAAIH,MAAM,KAAKI,SAAf,EAA0B;IACxB,MAAM,IAAIC,KAAJ,CACJ,2FADI,CAAN;EAGD;;EAED,OAAOL,MAAP;AACD"}
1
+ {"version":3,"names":["useBottomTabBarHeight","height","React","useContext","BottomTabBarHeightContext","undefined","Error"],"sourceRoot":"../../src","sources":["useBottomTabBarHeight.tsx"],"mappings":";;;;;;AAAA;AAEA;AAAoE;AAAA;AAAA;AAErD,SAASA,qBAAqB,GAAG;EAC9C,MAAMC,MAAM,GAAGC,KAAK,CAACC,UAAU,CAACC,kCAAyB,CAAC;EAE1D,IAAIH,MAAM,KAAKI,SAAS,EAAE;IACxB,MAAM,IAAIC,KAAK,CACb,2FAA2F,CAC5F;EACH;EAEA,OAAOL,MAAM;AACf"}
@@ -4,30 +4,21 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = useIsKeyboardShown;
7
-
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
8
  var _reactNative = require("react-native");
11
-
12
9
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
-
14
10
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
-
16
11
  function useIsKeyboardShown() {
17
12
  const [isKeyboardShown, setIsKeyboardShown] = React.useState(false);
18
13
  React.useEffect(() => {
19
14
  const handleKeyboardShow = () => setIsKeyboardShown(true);
20
-
21
15
  const handleKeyboardHide = () => setIsKeyboardShown(false);
22
-
23
16
  let subscriptions;
24
-
25
17
  if (_reactNative.Platform.OS === 'ios') {
26
18
  subscriptions = [_reactNative.Keyboard.addListener('keyboardWillShow', handleKeyboardShow), _reactNative.Keyboard.addListener('keyboardWillHide', handleKeyboardHide)];
27
19
  } else {
28
20
  subscriptions = [_reactNative.Keyboard.addListener('keyboardDidShow', handleKeyboardShow), _reactNative.Keyboard.addListener('keyboardDidHide', handleKeyboardHide)];
29
21
  }
30
-
31
22
  return () => {
32
23
  subscriptions.forEach(s => s.remove());
33
24
  };
@@ -1 +1 @@
1
- {"version":3,"names":["useIsKeyboardShown","isKeyboardShown","setIsKeyboardShown","React","useState","useEffect","handleKeyboardShow","handleKeyboardHide","subscriptions","Platform","OS","Keyboard","addListener","forEach","s","remove"],"sources":["useIsKeyboardShown.tsx"],"sourcesContent":["import * as React from 'react';\nimport { EmitterSubscription, Keyboard, Platform } from 'react-native';\n\nexport default function useIsKeyboardShown() {\n const [isKeyboardShown, setIsKeyboardShown] = React.useState(false);\n\n React.useEffect(() => {\n const handleKeyboardShow = () => setIsKeyboardShown(true);\n const handleKeyboardHide = () => setIsKeyboardShown(false);\n\n let subscriptions: EmitterSubscription[];\n\n if (Platform.OS === 'ios') {\n subscriptions = [\n Keyboard.addListener('keyboardWillShow', handleKeyboardShow),\n Keyboard.addListener('keyboardWillHide', handleKeyboardHide),\n ];\n } else {\n subscriptions = [\n Keyboard.addListener('keyboardDidShow', handleKeyboardShow),\n Keyboard.addListener('keyboardDidHide', handleKeyboardHide),\n ];\n }\n\n return () => {\n subscriptions.forEach((s) => s.remove());\n };\n }, []);\n\n return isKeyboardShown;\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAEe,SAASA,kBAAT,GAA8B;EAC3C,MAAM,CAACC,eAAD,EAAkBC,kBAAlB,IAAwCC,KAAK,CAACC,QAAN,CAAe,KAAf,CAA9C;EAEAD,KAAK,CAACE,SAAN,CAAgB,MAAM;IACpB,MAAMC,kBAAkB,GAAG,MAAMJ,kBAAkB,CAAC,IAAD,CAAnD;;IACA,MAAMK,kBAAkB,GAAG,MAAML,kBAAkB,CAAC,KAAD,CAAnD;;IAEA,IAAIM,aAAJ;;IAEA,IAAIC,qBAAA,CAASC,EAAT,KAAgB,KAApB,EAA2B;MACzBF,aAAa,GAAG,CACdG,qBAAA,CAASC,WAAT,CAAqB,kBAArB,EAAyCN,kBAAzC,CADc,EAEdK,qBAAA,CAASC,WAAT,CAAqB,kBAArB,EAAyCL,kBAAzC,CAFc,CAAhB;IAID,CALD,MAKO;MACLC,aAAa,GAAG,CACdG,qBAAA,CAASC,WAAT,CAAqB,iBAArB,EAAwCN,kBAAxC,CADc,EAEdK,qBAAA,CAASC,WAAT,CAAqB,iBAArB,EAAwCL,kBAAxC,CAFc,CAAhB;IAID;;IAED,OAAO,MAAM;MACXC,aAAa,CAACK,OAAd,CAAuBC,CAAD,IAAOA,CAAC,CAACC,MAAF,EAA7B;IACD,CAFD;EAGD,CArBD,EAqBG,EArBH;EAuBA,OAAOd,eAAP;AACD"}
1
+ {"version":3,"names":["useIsKeyboardShown","isKeyboardShown","setIsKeyboardShown","React","useState","useEffect","handleKeyboardShow","handleKeyboardHide","subscriptions","Platform","OS","Keyboard","addListener","forEach","s","remove"],"sourceRoot":"../../src","sources":["useIsKeyboardShown.tsx"],"mappings":";;;;;;AAAA;AACA;AAAuE;AAAA;AAExD,SAASA,kBAAkB,GAAG;EAC3C,MAAM,CAACC,eAAe,EAAEC,kBAAkB,CAAC,GAAGC,KAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;EAEnED,KAAK,CAACE,SAAS,CAAC,MAAM;IACpB,MAAMC,kBAAkB,GAAG,MAAMJ,kBAAkB,CAAC,IAAI,CAAC;IACzD,MAAMK,kBAAkB,GAAG,MAAML,kBAAkB,CAAC,KAAK,CAAC;IAE1D,IAAIM,aAAoC;IAExC,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;MACzBF,aAAa,GAAG,CACdG,qBAAQ,CAACC,WAAW,CAAC,kBAAkB,EAAEN,kBAAkB,CAAC,EAC5DK,qBAAQ,CAACC,WAAW,CAAC,kBAAkB,EAAEL,kBAAkB,CAAC,CAC7D;IACH,CAAC,MAAM;MACLC,aAAa,GAAG,CACdG,qBAAQ,CAACC,WAAW,CAAC,iBAAiB,EAAEN,kBAAkB,CAAC,EAC3DK,qBAAQ,CAACC,WAAW,CAAC,iBAAiB,EAAEL,kBAAkB,CAAC,CAC5D;IACH;IAEA,OAAO,MAAM;MACXC,aAAa,CAACK,OAAO,CAAEC,CAAC,IAAKA,CAAC,CAACC,MAAM,EAAE,CAAC;IAC1C,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOd,eAAe;AACxB"}
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = Badge;
7
-
8
7
  var _native = require("@react-navigation/native");
9
-
10
8
  var _color = _interopRequireDefault(require("color"));
11
-
12
9
  var React = _interopRequireWildcard(require("react"));
13
-
14
10
  var _reactNative = require("react-native");
15
-
16
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
-
18
12
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
-
20
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
14
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
-
24
15
  function Badge(_ref) {
25
16
  let {
26
17
  children,
@@ -36,7 +27,6 @@ function Badge(_ref) {
36
27
  if (!rendered) {
37
28
  return;
38
29
  }
39
-
40
30
  _reactNative.Animated.timing(opacity, {
41
31
  toValue: visible ? 1 : 0,
42
32
  duration: 150,
@@ -45,24 +35,21 @@ function Badge(_ref) {
45
35
  let {
46
36
  finished
47
37
  } = _ref2;
48
-
49
38
  if (finished && !visible) {
50
39
  setRendered(false);
51
40
  }
52
41
  });
53
-
54
42
  return () => opacity.stopAnimation();
55
43
  }, [opacity, rendered, visible]);
56
-
57
44
  if (!rendered) {
58
45
  if (visible) {
59
46
  setRendered(true);
60
47
  } else {
61
48
  return null;
62
49
  }
63
- } // @ts-expect-error: backgroundColor definitely exists
64
-
50
+ }
65
51
 
52
+ // @ts-expect-error: backgroundColor definitely exists
66
53
  const {
67
54
  backgroundColor = theme.colors.notification,
68
55
  ...restStyle
@@ -90,7 +77,6 @@ function Badge(_ref) {
90
77
  }, styles.container, restStyle]
91
78
  }, rest), children);
92
79
  }
93
-
94
80
  const styles = _reactNative.StyleSheet.create({
95
81
  container: {
96
82
  alignSelf: 'flex-end',
@@ -1 +1 @@
1
- {"version":3,"names":["Badge","children","style","visible","size","rest","opacity","React","useState","Animated","Value","rendered","setRendered","theme","useTheme","useEffect","timing","toValue","duration","useNativeDriver","start","finished","stopAnimation","backgroundColor","colors","notification","restStyle","StyleSheet","flatten","textColor","color","isLight","borderRadius","fontSize","Math","floor","transform","scale","interpolate","inputRange","outputRange","lineHeight","height","minWidth","styles","container","create","alignSelf","textAlign","paddingHorizontal","overflow"],"sources":["Badge.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport color from 'color';\nimport * as React from 'react';\nimport { Animated, StyleProp, StyleSheet, TextStyle } from 'react-native';\n\ntype Props = {\n /**\n * Whether the badge is visible\n */\n visible: boolean;\n /**\n * Content of the `Badge`.\n */\n children?: string | number;\n /**\n * Size of the `Badge`.\n */\n size?: number;\n /**\n * Style object for the tab bar container.\n */\n style?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;\n};\n\nexport default function Badge({\n children,\n style,\n visible = true,\n size = 18,\n ...rest\n}: Props) {\n const [opacity] = React.useState(() => new Animated.Value(visible ? 1 : 0));\n const [rendered, setRendered] = React.useState(visible);\n\n const theme = useTheme();\n\n React.useEffect(() => {\n if (!rendered) {\n return;\n }\n\n Animated.timing(opacity, {\n toValue: visible ? 1 : 0,\n duration: 150,\n useNativeDriver: true,\n }).start(({ finished }) => {\n if (finished && !visible) {\n setRendered(false);\n }\n });\n\n return () => opacity.stopAnimation();\n }, [opacity, rendered, visible]);\n\n if (!rendered) {\n if (visible) {\n setRendered(true);\n } else {\n return null;\n }\n }\n\n // @ts-expect-error: backgroundColor definitely exists\n const { backgroundColor = theme.colors.notification, ...restStyle } =\n StyleSheet.flatten(style) || {};\n const textColor = color(backgroundColor).isLight() ? 'black' : 'white';\n\n const borderRadius = size / 2;\n const fontSize = Math.floor((size * 3) / 4);\n\n return (\n <Animated.Text\n numberOfLines={1}\n style={[\n {\n transform: [\n {\n scale: opacity.interpolate({\n inputRange: [0, 1],\n outputRange: [0.5, 1],\n }),\n },\n ],\n color: textColor,\n lineHeight: size - 1,\n height: size,\n minWidth: size,\n opacity,\n backgroundColor,\n fontSize,\n borderRadius,\n },\n styles.container,\n restStyle,\n ]}\n {...rest}\n >\n {children}\n </Animated.Text>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n alignSelf: 'flex-end',\n textAlign: 'center',\n paddingHorizontal: 4,\n overflow: 'hidden',\n },\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;;;AAqBe,SAASA,KAAT,OAML;EAAA,IANoB;IAC5BC,QAD4B;IAE5BC,KAF4B;IAG5BC,OAAO,GAAG,IAHkB;IAI5BC,IAAI,GAAG,EAJqB;IAK5B,GAAGC;EALyB,CAMpB;EACR,MAAM,CAACC,OAAD,IAAYC,KAAK,CAACC,QAAN,CAAe,MAAM,IAAIC,qBAAA,CAASC,KAAb,CAAmBP,OAAO,GAAG,CAAH,GAAO,CAAjC,CAArB,CAAlB;EACA,MAAM,CAACQ,QAAD,EAAWC,WAAX,IAA0BL,KAAK,CAACC,QAAN,CAAeL,OAAf,CAAhC;EAEA,MAAMU,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEAP,KAAK,CAACQ,SAAN,CAAgB,MAAM;IACpB,IAAI,CAACJ,QAAL,EAAe;MACb;IACD;;IAEDF,qBAAA,CAASO,MAAT,CAAgBV,OAAhB,EAAyB;MACvBW,OAAO,EAAEd,OAAO,GAAG,CAAH,GAAO,CADA;MAEvBe,QAAQ,EAAE,GAFa;MAGvBC,eAAe,EAAE;IAHM,CAAzB,EAIGC,KAJH,CAIS,SAAkB;MAAA,IAAjB;QAAEC;MAAF,CAAiB;;MACzB,IAAIA,QAAQ,IAAI,CAAClB,OAAjB,EAA0B;QACxBS,WAAW,CAAC,KAAD,CAAX;MACD;IACF,CARD;;IAUA,OAAO,MAAMN,OAAO,CAACgB,aAAR,EAAb;EACD,CAhBD,EAgBG,CAAChB,OAAD,EAAUK,QAAV,EAAoBR,OAApB,CAhBH;;EAkBA,IAAI,CAACQ,QAAL,EAAe;IACb,IAAIR,OAAJ,EAAa;MACXS,WAAW,CAAC,IAAD,CAAX;IACD,CAFD,MAEO;MACL,OAAO,IAAP;IACD;EACF,CA9BO,CAgCR;;;EACA,MAAM;IAAEW,eAAe,GAAGV,KAAK,CAACW,MAAN,CAAaC,YAAjC;IAA+C,GAAGC;EAAlD,IACJC,uBAAA,CAAWC,OAAX,CAAmB1B,KAAnB,KAA6B,EAD/B;EAEA,MAAM2B,SAAS,GAAG,IAAAC,cAAA,EAAMP,eAAN,EAAuBQ,OAAvB,KAAmC,OAAnC,GAA6C,OAA/D;EAEA,MAAMC,YAAY,GAAG5B,IAAI,GAAG,CAA5B;EACA,MAAM6B,QAAQ,GAAGC,IAAI,CAACC,KAAL,CAAY/B,IAAI,GAAG,CAAR,GAAa,CAAxB,CAAjB;EAEA,oBACE,oBAAC,qBAAD,CAAU,IAAV;IACE,aAAa,EAAE,CADjB;IAEE,KAAK,EAAE,CACL;MACEgC,SAAS,EAAE,CACT;QACEC,KAAK,EAAE/B,OAAO,CAACgC,WAAR,CAAoB;UACzBC,UAAU,EAAE,CAAC,CAAD,EAAI,CAAJ,CADa;UAEzBC,WAAW,EAAE,CAAC,GAAD,EAAM,CAAN;QAFY,CAApB;MADT,CADS,CADb;MASEV,KAAK,EAAED,SATT;MAUEY,UAAU,EAAErC,IAAI,GAAG,CAVrB;MAWEsC,MAAM,EAAEtC,IAXV;MAYEuC,QAAQ,EAAEvC,IAZZ;MAaEE,OAbF;MAcEiB,eAdF;MAeEU,QAfF;MAgBED;IAhBF,CADK,EAmBLY,MAAM,CAACC,SAnBF,EAoBLnB,SApBK;EAFT,GAwBMrB,IAxBN,GA0BGJ,QA1BH,CADF;AA8BD;;AAED,MAAM2C,MAAM,GAAGjB,uBAAA,CAAWmB,MAAX,CAAkB;EAC/BD,SAAS,EAAE;IACTE,SAAS,EAAE,UADF;IAETC,SAAS,EAAE,QAFF;IAGTC,iBAAiB,EAAE,CAHV;IAITC,QAAQ,EAAE;EAJD;AADoB,CAAlB,CAAf"}
1
+ {"version":3,"names":["Badge","children","style","visible","size","rest","opacity","React","useState","Animated","Value","rendered","setRendered","theme","useTheme","useEffect","timing","toValue","duration","useNativeDriver","start","finished","stopAnimation","backgroundColor","colors","notification","restStyle","StyleSheet","flatten","textColor","color","isLight","borderRadius","fontSize","Math","floor","transform","scale","interpolate","inputRange","outputRange","lineHeight","height","minWidth","styles","container","create","alignSelf","textAlign","paddingHorizontal","overflow"],"sourceRoot":"../../src","sources":["Badge.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAA0E;AAAA;AAAA;AAAA;AAqB3D,SAASA,KAAK,OAMnB;EAAA,IANoB;IAC5BC,QAAQ;IACRC,KAAK;IACLC,OAAO,GAAG,IAAI;IACdC,IAAI,GAAG,EAAE;IACT,GAAGC;EACE,CAAC;EACN,MAAM,CAACC,OAAO,CAAC,GAAGC,KAAK,CAACC,QAAQ,CAAC,MAAM,IAAIC,qBAAQ,CAACC,KAAK,CAACP,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;EAC3E,MAAM,CAACQ,QAAQ,EAAEC,WAAW,CAAC,GAAGL,KAAK,CAACC,QAAQ,CAACL,OAAO,CAAC;EAEvD,MAAMU,KAAK,GAAG,IAAAC,gBAAQ,GAAE;EAExBP,KAAK,CAACQ,SAAS,CAAC,MAAM;IACpB,IAAI,CAACJ,QAAQ,EAAE;MACb;IACF;IAEAF,qBAAQ,CAACO,MAAM,CAACV,OAAO,EAAE;MACvBW,OAAO,EAAEd,OAAO,GAAG,CAAC,GAAG,CAAC;MACxBe,QAAQ,EAAE,GAAG;MACbC,eAAe,EAAE;IACnB,CAAC,CAAC,CAACC,KAAK,CAAC,SAAkB;MAAA,IAAjB;QAAEC;MAAS,CAAC;MACpB,IAAIA,QAAQ,IAAI,CAAClB,OAAO,EAAE;QACxBS,WAAW,CAAC,KAAK,CAAC;MACpB;IACF,CAAC,CAAC;IAEF,OAAO,MAAMN,OAAO,CAACgB,aAAa,EAAE;EACtC,CAAC,EAAE,CAAChB,OAAO,EAAEK,QAAQ,EAAER,OAAO,CAAC,CAAC;EAEhC,IAAI,CAACQ,QAAQ,EAAE;IACb,IAAIR,OAAO,EAAE;MACXS,WAAW,CAAC,IAAI,CAAC;IACnB,CAAC,MAAM;MACL,OAAO,IAAI;IACb;EACF;;EAEA;EACA,MAAM;IAAEW,eAAe,GAAGV,KAAK,CAACW,MAAM,CAACC,YAAY;IAAE,GAAGC;EAAU,CAAC,GACjEC,uBAAU,CAACC,OAAO,CAAC1B,KAAK,CAAC,IAAI,CAAC,CAAC;EACjC,MAAM2B,SAAS,GAAG,IAAAC,cAAK,EAACP,eAAe,CAAC,CAACQ,OAAO,EAAE,GAAG,OAAO,GAAG,OAAO;EAEtE,MAAMC,YAAY,GAAG5B,IAAI,GAAG,CAAC;EAC7B,MAAM6B,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAAE/B,IAAI,GAAG,CAAC,GAAI,CAAC,CAAC;EAE3C,oBACE,oBAAC,qBAAQ,CAAC,IAAI;IACZ,aAAa,EAAE,CAAE;IACjB,KAAK,EAAE,CACL;MACEgC,SAAS,EAAE,CACT;QACEC,KAAK,EAAE/B,OAAO,CAACgC,WAAW,CAAC;UACzBC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;UAClBC,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC;QACtB,CAAC;MACH,CAAC,CACF;MACDV,KAAK,EAAED,SAAS;MAChBY,UAAU,EAAErC,IAAI,GAAG,CAAC;MACpBsC,MAAM,EAAEtC,IAAI;MACZuC,QAAQ,EAAEvC,IAAI;MACdE,OAAO;MACPiB,eAAe;MACfU,QAAQ;MACRD;IACF,CAAC,EACDY,MAAM,CAACC,SAAS,EAChBnB,SAAS;EACT,GACErB,IAAI,GAEPJ,QAAQ,CACK;AAEpB;AAEA,MAAM2C,MAAM,GAAGjB,uBAAU,CAACmB,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,SAAS,EAAE,UAAU;IACrBC,SAAS,EAAE,QAAQ;IACnBC,iBAAiB,EAAE,CAAC;IACpBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC"}
@@ -5,30 +5,19 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = BottomTabBar;
7
7
  exports.getTabBarHeight = void 0;
8
-
9
8
  var _elements = require("@react-navigation/elements");
10
-
11
9
  var _native = require("@react-navigation/native");
12
-
13
10
  var _react = _interopRequireDefault(require("react"));
14
-
15
11
  var _reactNative = require("react-native");
16
-
17
12
  var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
18
-
19
13
  var _BottomTabBarHeightCallbackContext = _interopRequireDefault(require("../utils/BottomTabBarHeightCallbackContext"));
20
-
21
14
  var _useIsKeyboardShown = _interopRequireDefault(require("../utils/useIsKeyboardShown"));
22
-
23
15
  var _BottomTabItem = _interopRequireDefault(require("./BottomTabItem"));
24
-
25
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26
-
27
17
  const DEFAULT_TABBAR_HEIGHT = 49;
28
18
  const COMPACT_TABBAR_HEIGHT = 32;
29
19
  const DEFAULT_MAX_TAB_ITEM_WIDTH = 125;
30
20
  const useNativeDriver = _reactNative.Platform.OS !== 'web';
31
-
32
21
  const shouldUseHorizontalLabels = _ref => {
33
22
  let {
34
23
  state,
@@ -39,26 +28,21 @@ const shouldUseHorizontalLabels = _ref => {
39
28
  const {
40
29
  tabBarLabelPosition
41
30
  } = descriptors[state.routes[state.index].key].options;
42
-
43
31
  if (tabBarLabelPosition) {
44
32
  switch (tabBarLabelPosition) {
45
33
  case 'beside-icon':
46
34
  return true;
47
-
48
35
  case 'below-icon':
49
36
  return false;
50
37
  }
51
38
  }
52
-
53
39
  if (layout.width >= 768) {
54
40
  // Screen size matches a tablet
55
41
  const maxTabWidth = state.routes.reduce((acc, route) => {
56
42
  const {
57
43
  tabBarItemStyle
58
44
  } = descriptors[route.key].options;
59
-
60
45
  const flattenedStyle = _reactNative.StyleSheet.flatten(tabBarItemStyle);
61
-
62
46
  if (flattenedStyle) {
63
47
  if (typeof flattenedStyle.width === 'number') {
64
48
  return acc + flattenedStyle.width;
@@ -66,7 +50,6 @@ const shouldUseHorizontalLabels = _ref => {
66
50
  return acc + flattenedStyle.maxWidth;
67
51
  }
68
52
  }
69
-
70
53
  return acc + DEFAULT_MAX_TAB_ITEM_WIDTH;
71
54
  }, 0);
72
55
  return maxTabWidth <= layout.width;
@@ -74,15 +57,12 @@ const shouldUseHorizontalLabels = _ref => {
74
57
  return dimensions.width > dimensions.height;
75
58
  }
76
59
  };
77
-
78
60
  const getPaddingBottom = insets => Math.max(insets.bottom - _reactNative.Platform.select({
79
61
  ios: 4,
80
62
  default: 0
81
63
  }), 0);
82
-
83
64
  const getTabBarHeight = _ref2 => {
84
65
  var _StyleSheet$flatten;
85
-
86
66
  let {
87
67
  state,
88
68
  descriptors,
@@ -93,11 +73,9 @@ const getTabBarHeight = _ref2 => {
93
73
  } = _ref2;
94
74
  // @ts-ignore
95
75
  const customHeight = (_StyleSheet$flatten = _reactNative.StyleSheet.flatten(style)) === null || _StyleSheet$flatten === void 0 ? void 0 : _StyleSheet$flatten.height;
96
-
97
76
  if (typeof customHeight === 'number') {
98
77
  return customHeight;
99
78
  }
100
-
101
79
  const isLandscape = dimensions.width > dimensions.height;
102
80
  const horizontalLabels = shouldUseHorizontalLabels({
103
81
  state,
@@ -106,16 +84,12 @@ const getTabBarHeight = _ref2 => {
106
84
  ...rest
107
85
  });
108
86
  const paddingBottom = getPaddingBottom(insets);
109
-
110
87
  if (_reactNative.Platform.OS === 'ios' && !_reactNative.Platform.isPad && isLandscape && horizontalLabels) {
111
88
  return COMPACT_TABBAR_HEIGHT + paddingBottom;
112
89
  }
113
-
114
90
  return DEFAULT_TABBAR_HEIGHT + paddingBottom;
115
91
  };
116
-
117
92
  exports.getTabBarHeight = getTabBarHeight;
118
-
119
93
  function BottomTabBar(_ref3) {
120
94
  let {
121
95
  state,
@@ -144,27 +118,18 @@ function BottomTabBar(_ref3) {
144
118
  } = focusedOptions;
145
119
  const dimensions = (0, _reactNativeSafeAreaContext.useSafeAreaFrame)();
146
120
  const isKeyboardShown = (0, _useIsKeyboardShown.default)();
147
-
148
121
  const onHeightChange = _react.default.useContext(_BottomTabBarHeightCallbackContext.default);
149
-
150
122
  const shouldShowTabBar = !(tabBarHideOnKeyboard && isKeyboardShown);
151
-
152
123
  const visibilityAnimationConfigRef = _react.default.useRef(tabBarVisibilityAnimationConfig);
153
-
154
124
  _react.default.useEffect(() => {
155
125
  visibilityAnimationConfigRef.current = tabBarVisibilityAnimationConfig;
156
126
  });
157
-
158
127
  const [isTabBarHidden, setIsTabBarHidden] = _react.default.useState(!shouldShowTabBar);
159
-
160
128
  const [visible] = _react.default.useState(() => new _reactNative.Animated.Value(shouldShowTabBar ? 1 : 0));
161
-
162
129
  _react.default.useEffect(() => {
163
130
  const visibilityAnimationConfig = visibilityAnimationConfigRef.current;
164
-
165
131
  if (shouldShowTabBar) {
166
132
  var _visibilityAnimationC, _visibilityAnimationC2;
167
-
168
133
  const animation = (visibilityAnimationConfig === null || visibilityAnimationConfig === void 0 ? void 0 : (_visibilityAnimationC = visibilityAnimationConfig.show) === null || _visibilityAnimationC === void 0 ? void 0 : _visibilityAnimationC.animation) === 'spring' ? _reactNative.Animated.spring : _reactNative.Animated.timing;
169
134
  animation(visible, {
170
135
  toValue: 1,
@@ -175,14 +140,12 @@ function BottomTabBar(_ref3) {
175
140
  let {
176
141
  finished
177
142
  } = _ref4;
178
-
179
143
  if (finished) {
180
144
  setIsTabBarHidden(false);
181
145
  }
182
146
  });
183
147
  } else {
184
148
  var _visibilityAnimationC3, _visibilityAnimationC4;
185
-
186
149
  setIsTabBarHidden(true);
187
150
  const animation = (visibilityAnimationConfig === null || visibilityAnimationConfig === void 0 ? void 0 : (_visibilityAnimationC3 = visibilityAnimationConfig.hide) === null || _visibilityAnimationC3 === void 0 ? void 0 : _visibilityAnimationC3.animation) === 'spring' ? _reactNative.Animated.spring : _reactNative.Animated.timing;
188
151
  animation(visible, {
@@ -192,15 +155,12 @@ function BottomTabBar(_ref3) {
192
155
  ...(visibilityAnimationConfig === null || visibilityAnimationConfig === void 0 ? void 0 : (_visibilityAnimationC4 = visibilityAnimationConfig.hide) === null || _visibilityAnimationC4 === void 0 ? void 0 : _visibilityAnimationC4.config)
193
156
  }).start();
194
157
  }
195
-
196
158
  return () => visible.stopAnimation();
197
159
  }, [visible, shouldShowTabBar]);
198
-
199
160
  const [layout, setLayout] = _react.default.useState({
200
161
  height: 0,
201
162
  width: dimensions.width
202
163
  });
203
-
204
164
  const handleLayout = e => {
205
165
  const {
206
166
  height,
@@ -218,7 +178,6 @@ function BottomTabBar(_ref3) {
218
178
  }
219
179
  });
220
180
  };
221
-
222
181
  const {
223
182
  routes
224
183
  } = state;
@@ -266,22 +225,19 @@ function BottomTabBar(_ref3) {
266
225
  accessibilityRole: "tablist",
267
226
  style: styles.content
268
227
  }, routes.map((route, index) => {
269
- var _options$tabBarIcon;
270
-
271
228
  const focused = index === state.index;
272
229
  const {
273
230
  options
274
231
  } = descriptors[route.key];
275
-
276
232
  const onPress = () => {
277
233
  const event = navigation.emit({
278
234
  type: 'tabPress',
279
235
  target: route.key,
280
236
  canPreventDefault: true
281
237
  });
282
-
283
238
  if (!focused && !event.defaultPrevented) {
284
- navigation.dispatch({ ..._native.CommonActions.navigate({
239
+ navigation.dispatch({
240
+ ..._native.CommonActions.navigate({
285
241
  name: route.name,
286
242
  merge: true
287
243
  }),
@@ -289,14 +245,12 @@ function BottomTabBar(_ref3) {
289
245
  });
290
246
  }
291
247
  };
292
-
293
248
  const onLongPress = () => {
294
249
  navigation.emit({
295
250
  type: 'tabLongPress',
296
251
  target: route.key
297
252
  });
298
253
  };
299
-
300
254
  const label = options.tabBarLabel !== undefined ? options.tabBarLabel : options.title !== undefined ? options.title : route.name;
301
255
  const accessibilityLabel = options.tabBarAccessibilityLabel !== undefined ? options.tabBarAccessibilityLabel : typeof label === 'string' && _reactNative.Platform.OS === 'ios' ? `${label}, tab, ${index + 1} of ${routes.length}` : undefined;
302
256
  return /*#__PURE__*/_react.default.createElement(_native.NavigationContext.Provider, {
@@ -306,6 +260,7 @@ function BottomTabBar(_ref3) {
306
260
  value: route
307
261
  }, /*#__PURE__*/_react.default.createElement(_BottomTabItem.default, {
308
262
  route: route,
263
+ descriptor: descriptors[route.key],
309
264
  focused: focused,
310
265
  horizontal: hasHorizontalLabels,
311
266
  onPress: onPress,
@@ -319,7 +274,7 @@ function BottomTabBar(_ref3) {
319
274
  activeBackgroundColor: tabBarActiveBackgroundColor,
320
275
  inactiveBackgroundColor: tabBarInactiveBackgroundColor,
321
276
  button: options.tabBarButton,
322
- icon: (_options$tabBarIcon = options.tabBarIcon) !== null && _options$tabBarIcon !== void 0 ? _options$tabBarIcon : _ref5 => {
277
+ icon: options.tabBarIcon ?? (_ref5 => {
323
278
  let {
324
279
  color,
325
280
  size
@@ -328,7 +283,7 @@ function BottomTabBar(_ref3) {
328
283
  color: color,
329
284
  size: size
330
285
  });
331
- },
286
+ }),
332
287
  badge: options.tabBarBadge,
333
288
  badgeStyle: options.tabBarBadgeStyle,
334
289
  label: label,
@@ -339,7 +294,6 @@ function BottomTabBar(_ref3) {
339
294
  })));
340
295
  })));
341
296
  }
342
-
343
297
  const styles = _reactNative.StyleSheet.create({
344
298
  tabBar: {
345
299
  left: 0,