expo-router 6.0.0-beta.1 → 6.0.0-beta.10

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 (103) hide show
  1. package/assets/modal.module.css +15 -14
  2. package/assets/native-tabs.module.css +1 -1
  3. package/build/fork/extractPathFromURL.d.ts.map +1 -1
  4. package/build/fork/extractPathFromURL.js +4 -0
  5. package/build/fork/extractPathFromURL.js.map +1 -1
  6. package/build/fork/getPathFromState.d.ts.map +1 -1
  7. package/build/fork/getPathFromState.js +2 -0
  8. package/build/fork/getPathFromState.js.map +1 -1
  9. package/build/global-state/routing.d.ts.map +1 -1
  10. package/build/global-state/routing.js +12 -3
  11. package/build/global-state/routing.js.map +1 -1
  12. package/build/layouts/StackClient.d.ts +12 -7
  13. package/build/layouts/StackClient.d.ts.map +1 -1
  14. package/build/layouts/StackClient.js +27 -25
  15. package/build/layouts/StackClient.js.map +1 -1
  16. package/build/link/ExpoLink.d.ts.map +1 -1
  17. package/build/link/ExpoLink.js +4 -1
  18. package/build/link/ExpoLink.js.map +1 -1
  19. package/build/link/LinkWithPreview.d.ts.map +1 -1
  20. package/build/link/LinkWithPreview.js +18 -23
  21. package/build/link/LinkWithPreview.js.map +1 -1
  22. package/build/link/elements.d.ts +1 -1
  23. package/build/link/elements.js +1 -1
  24. package/build/link/elements.js.map +1 -1
  25. package/build/link/preview/native.d.ts +0 -2
  26. package/build/link/preview/native.d.ts.map +1 -1
  27. package/build/link/preview/native.js +0 -10
  28. package/build/link/preview/native.js.map +1 -1
  29. package/build/link/preview/utils.d.ts.map +1 -1
  30. package/build/link/preview/utils.js +5 -2
  31. package/build/link/preview/utils.js.map +1 -1
  32. package/build/modal/web/ModalStackRouteDrawer.js +9 -10
  33. package/build/modal/web/ModalStackRouteDrawer.js.map +1 -1
  34. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.d.ts +1 -0
  35. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.d.ts.map +1 -1
  36. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.js +45 -6
  37. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.js.map +1 -1
  38. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.d.ts.map +1 -1
  39. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.js +6 -27
  40. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.js.map +1 -1
  41. package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.d.ts +11 -3
  42. package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.d.ts.map +1 -1
  43. package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.js +154 -62
  44. package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.js.map +1 -1
  45. package/build/native-tabs/NativeBottomTabs/NativeTabs.d.ts +3 -2
  46. package/build/native-tabs/NativeBottomTabs/NativeTabs.d.ts.map +1 -1
  47. package/build/native-tabs/NativeBottomTabs/NativeTabsTriggerTabBar.d.ts +24 -0
  48. package/build/native-tabs/NativeBottomTabs/NativeTabsTriggerTabBar.d.ts.map +1 -0
  49. package/build/native-tabs/NativeBottomTabs/NativeTabsTriggerTabBar.js +28 -0
  50. package/build/native-tabs/NativeBottomTabs/NativeTabsTriggerTabBar.js.map +1 -0
  51. package/build/native-tabs/NativeBottomTabs/NativeTabsView.d.ts +1 -1
  52. package/build/native-tabs/NativeBottomTabs/NativeTabsView.d.ts.map +1 -1
  53. package/build/native-tabs/NativeBottomTabs/NativeTabsView.js +115 -30
  54. package/build/native-tabs/NativeBottomTabs/NativeTabsView.js.map +1 -1
  55. package/build/native-tabs/NativeBottomTabs/NativeTabsView.web.d.ts.map +1 -1
  56. package/build/native-tabs/NativeBottomTabs/NativeTabsView.web.js +57 -27
  57. package/build/native-tabs/NativeBottomTabs/NativeTabsView.web.js.map +1 -1
  58. package/build/native-tabs/NativeBottomTabs/appearance.d.ts +20 -0
  59. package/build/native-tabs/NativeBottomTabs/appearance.d.ts.map +1 -0
  60. package/build/native-tabs/NativeBottomTabs/appearance.js +119 -0
  61. package/build/native-tabs/NativeBottomTabs/appearance.js.map +1 -0
  62. package/build/native-tabs/NativeBottomTabs/types.d.ts +298 -59
  63. package/build/native-tabs/NativeBottomTabs/types.d.ts.map +1 -1
  64. package/build/native-tabs/NativeBottomTabs/types.js +51 -0
  65. package/build/native-tabs/NativeBottomTabs/types.js.map +1 -1
  66. package/build/native-tabs/common/elements.d.ts +84 -21
  67. package/build/native-tabs/common/elements.d.ts.map +1 -1
  68. package/build/native-tabs/common/elements.js +23 -0
  69. package/build/native-tabs/common/elements.js.map +1 -1
  70. package/build/native-tabs/index.d.ts +2 -1
  71. package/build/native-tabs/index.d.ts.map +1 -1
  72. package/build/native-tabs/index.js +3 -1
  73. package/build/native-tabs/index.js.map +1 -1
  74. package/build/navigationParams.d.ts +9 -0
  75. package/build/navigationParams.d.ts.map +1 -0
  76. package/build/navigationParams.js +67 -0
  77. package/build/navigationParams.js.map +1 -0
  78. package/build/testing-library/index.d.ts +15 -4
  79. package/build/testing-library/index.d.ts.map +1 -1
  80. package/build/testing-library/index.js +31 -28
  81. package/build/testing-library/index.js.map +1 -1
  82. package/build/typed-routes/generate.d.ts +2 -1
  83. package/build/typed-routes/generate.d.ts.map +1 -1
  84. package/build/typed-routes/generate.js +3 -1
  85. package/build/typed-routes/generate.js.map +1 -1
  86. package/build/ui/Slot.d.ts +5 -1
  87. package/build/ui/Slot.d.ts.map +1 -1
  88. package/build/ui/Slot.js.map +1 -1
  89. package/build/ui/Tabs.d.ts.map +1 -1
  90. package/build/ui/Tabs.js +1 -1
  91. package/build/ui/Tabs.js.map +1 -1
  92. package/build/ui/common.d.ts +2 -3
  93. package/build/ui/common.d.ts.map +1 -1
  94. package/build/ui/common.js +1 -3
  95. package/build/ui/common.js.map +1 -1
  96. package/build/useFocusEffect.js +1 -1
  97. package/build/useFocusEffect.js.map +1 -1
  98. package/ios/ExpoHead.podspec +2 -0
  99. package/ios/LinkPreview/LinkPreviewNativeModule.swift +7 -9
  100. package/ios/LinkPreview/LinkPreviewNativeView.swift +13 -28
  101. package/package.json +10 -11
  102. package/ios/LinkPreview/LinkPreviewNativeTriggerView.swift +0 -9
  103. package/plugin/tsconfig.tsbuildinfo +0 -1
@@ -1,3 +1,54 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS = exports.SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES = exports.SUPPORTED_BLUR_EFFECTS = void 0;
4
+ exports.SUPPORTED_BLUR_EFFECTS = [
5
+ 'none',
6
+ 'systemDefault',
7
+ 'extraLight',
8
+ 'light',
9
+ 'dark',
10
+ 'regular',
11
+ 'prominent',
12
+ 'systemUltraThinMaterial',
13
+ 'systemThinMaterial',
14
+ 'systemMaterial',
15
+ 'systemThickMaterial',
16
+ 'systemChromeMaterial',
17
+ 'systemUltraThinMaterialLight',
18
+ 'systemThinMaterialLight',
19
+ 'systemMaterialLight',
20
+ 'systemThickMaterialLight',
21
+ 'systemChromeMaterialLight',
22
+ 'systemUltraThinMaterialDark',
23
+ 'systemThinMaterialDark',
24
+ 'systemMaterialDark',
25
+ 'systemThickMaterialDark',
26
+ 'systemChromeMaterialDark',
27
+ ];
28
+ exports.SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES = [
29
+ 'auto',
30
+ 'selected',
31
+ 'labeled',
32
+ 'unlabeled',
33
+ ];
34
+ exports.SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS = [
35
+ 'automatic',
36
+ 'never',
37
+ 'onScrollDown',
38
+ 'onScrollUp',
39
+ ];
40
+ const SUPPORTED_TAB_BAR_ITEM_ROLES = [
41
+ 'bookmarks',
42
+ 'contacts',
43
+ 'downloads',
44
+ 'favorites',
45
+ 'featured',
46
+ 'history',
47
+ 'more',
48
+ 'mostRecent',
49
+ 'mostViewed',
50
+ 'recents',
51
+ 'search',
52
+ 'topRated',
53
+ ];
3
54
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n DefaultRouterOptions,\n ParamListBase,\n TabNavigationState,\n TabRouterOptions,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport type { PropsWithChildren } from 'react';\nimport type { ColorValue, ImageSourcePropType, TextStyle } from 'react-native';\nimport type {\n BottomTabsProps,\n BottomTabsScreenProps,\n TabBarItemLabelVisibilityMode,\n} from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nexport type NativeTabOptions = Omit<\n BottomTabsScreenProps,\n | 'children'\n | 'placeholder'\n | 'onWillAppear'\n | 'onDidAppear'\n | 'onWillDisappear'\n | 'onDidDisappear'\n | 'isFocused'\n | 'tabKey'\n | 'icon'\n | 'selectedIcon'\n | 'iconResourceName'\n | 'specialEffects'\n> &\n DefaultRouterOptions & {\n /**\n * The icon to display in the tab bar.\n * @platform android\n * @platform iOS\n */\n icon?: SfSymbolOrImageSource & {\n /**\n * The name of the drawable resource to use as an icon.\n * @platform android\n */\n drawable?: string;\n };\n /**\n * The icon to display when the tab is selected.\n * @platform iOS\n */\n selectedIcon?: SfSymbolOrImageSource;\n };\n\nexport type SfSymbolOrImageSource =\n | {\n /**\n * The name of the SF Symbol to use as an icon.\n * @platform iOS\n */\n sf?: SFSymbol;\n }\n | {\n /**\n * The image source to use as an icon.\n * @platform iOS\n */\n src?: ImageSourcePropType;\n };\n\nexport interface ExtendedNativeTabOptions extends NativeTabOptions {\n /**\n * If true, the tab will be hidden from the tab bar.\n */\n hidden?: boolean;\n specialEffects?: BottomTabsScreenProps['specialEffects'];\n}\n\ntype NumericFontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n\nexport interface NativeTabsStyleType {\n fontFamily?: TextStyle['fontFamily'];\n fontSize?: TextStyle['fontSize'];\n fontWeight?: NumericFontWeight | `${NumericFontWeight}`;\n fontStyle?: TextStyle['fontStyle'];\n color?: TextStyle['color'];\n /**\n * @platform android\n * @platform iOS\n * @platform tvOS\n */\n iconColor?: ColorValue;\n backgroundColor?: ColorValue;\n /**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/titlepositionadjustment)\n *\n * @platform iOS\n */\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * @platform iOS\n */\n blurEffect?: BottomTabsScreenProps['tabBarBlurEffect'];\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n tintColor?: ColorValue;\n badgeBackgroundColor?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n badgeTextColor?: ColorValue;\n /**\n * @platform android\n */\n rippleColor?: ColorValue;\n /**\n * @platform android\n */\n labelVisibilityMode?: TabBarItemLabelVisibilityMode;\n /**\n * @platform android\n * @platform web\n */\n '&:active'?: NativeTabsActiveStyleType;\n}\n\nexport interface NativeTabsActiveStyleType {\n /**\n * @platform android\n * @platform web\n */\n color?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n fontSize?: TextStyle['fontSize'];\n /**\n * @platform android\n */\n iconColor?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n}\n\nexport interface NativeTabsProps extends PropsWithChildren {\n style?: NativeTabsStyleType;\n /**\n * https://developer.apple.com/documentation/uikit/uitabbarcontroller/tabbarminimizebehavior\n *\n * Supported values:\n * - `none` - The tab bar does not minimize.\n * - `onScrollUp` - The tab bar minimizes when scrolling up, and expands when scrolling back down. Recommended if the scroll view content is aligned to the bottom.\n * - `onScrollDown` - The tab bar minimizes when scrolling down, and expands when scrolling back up.\n * - `automatic` - Resolves to the system default minimize behavior.\n *\n * @default automatic\n *\n * @platform iOS 26\n */\n minimizeBehavior?: BottomTabsProps['tabBarMinimizeBehavior'];\n /**\n * Disables the active indicator for the tab bar.\n *\n * @platform android\n */\n disableIndicator?: boolean;\n /**\n * The behavior when navigating back with the back button.\n *\n * @platform android\n */\n backBehavior?: 'none' | 'initialRoute' | 'history';\n}\n\nexport interface NativeTabsViewProps extends NativeTabsProps {\n focusedIndex: number;\n builder: ReturnType<\n typeof useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n Record<string, (...args: any) => void>,\n NativeTabOptions,\n Record<string, any>\n >\n >;\n}\n\nexport interface NativeTabTriggerProps {\n /**\n * The name of the route.\n *\n * This is required when used inside a Layout component.\n *\n * When used in a route it has no effect.\n */\n name?: string;\n /**\n * If true, the tab will be hidden from the tab bar.\n */\n hidden?: boolean;\n /**\n * The options for the trigger.\n *\n * Use `Icon`, `Label`, and `Badge` components as children to customize the tab, rather then raw options.\n */\n options?: NativeTabOptions;\n /**\n * If true, the tab will not pop stack to the root when selected again.\n * @default false\n *\n * @platform ios\n */\n disablePopToTop?: boolean;\n /**\n * If true, the tab will not scroll to the top when selected again.\n * @default false\n *\n * @platform ios\n */\n disableScrollToTop?: boolean;\n /**\n * The children of the trigger.\n *\n * Use `Icon`, `Label`, and `Badge` components to customize the tab.\n */\n children?: React.ReactNode;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/types.ts"],"names":[],"mappings":";;;AA0La,QAAA,sBAAsB,GAAG;IACpC,MAAM;IACN,eAAe;IACf,YAAY;IACZ,OAAO;IACP,MAAM;IACN,SAAS;IACT,WAAW;IACX,yBAAyB;IACzB,oBAAoB;IACpB,gBAAgB;IAChB,qBAAqB;IACrB,sBAAsB;IACtB,8BAA8B;IAC9B,yBAAyB;IACzB,qBAAqB;IACrB,0BAA0B;IAC1B,2BAA2B;IAC3B,6BAA6B;IAC7B,wBAAwB;IACxB,oBAAoB;IACpB,yBAAyB;IACzB,0BAA0B;CAClB,CAAC;AA+JE,QAAA,6CAA6C,GAAG;IAC3D,MAAM;IACN,UAAU;IACV,SAAS;IACT,WAAW;CACH,CAAC;AAUE,QAAA,oCAAoC,GAAG;IAClD,WAAW;IACX,OAAO;IACP,cAAc;IACd,YAAY;CACJ,CAAC;AA+DX,MAAM,4BAA4B,GAAG;IACnC,WAAW;IACX,UAAU;IACV,WAAW;IACX,WAAW;IACX,UAAU;IACV,SAAS;IACT,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,UAAU;CACF,CAAC","sourcesContent":["import type {\n DefaultRouterOptions,\n ParamListBase,\n TabNavigationState,\n TabRouterOptions,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport type { PropsWithChildren } from 'react';\nimport type { ColorValue, ImageSourcePropType, TextStyle } from 'react-native';\nimport type { BottomTabsScreenProps } from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nexport interface NativeTabOptions extends DefaultRouterOptions {\n /**\n * The icon to display in the tab bar.\n * @platform android\n * @platform iOS\n */\n icon?: SymbolOrImageSource;\n /**\n * The icon to display when the tab is selected.\n * @platform iOS\n */\n selectedIcon?: SymbolOrImageSource;\n /**\n * Title of the tab screen, displayed in the tab bar item.\n *\n * @platform android\n * @platform iOS\n */\n title?: string;\n /**\n * Specifies content of tab bar item badge.\n *\n * On Android, the value is interpreted in the following order:\n * - If the string can be parsed to integer, displays the value as a number\n * - Otherwise if the string is empty, displays \"small dot\" badge\n * - Otherwise, displays the value as a text\n *\n * On iOS, badge is displayed as regular string.\n *\n * @platform android\n * @platform ios\n */\n badgeValue?: string;\n /**\n * The style of the tab label when the tab is selected.\n */\n selectedLabelStyle?: NativeTabsLabelStyle;\n /**\n * The style of all the tab labels, when the tab is selected\n */\n labelStyle?: NativeTabsLabelStyle;\n /**\n * System-provided tab bar item with predefined icon and title\n *\n * Uses Apple's built-in tab bar items (e.g., bookmarks, contacts, downloads) with\n * standard iOS styling and localized titles. Custom `icon` or `selectedIcon`\n * properties will override the system icon, but the system-defined title cannot\n * be customized.\n *\n * @see {@link https://developer.apple.com/documentation/uikit/uitabbaritem/systemitem|UITabBarItem.SystemItem}\n * @platform ios\n */\n role?: NativeTabsTabBarItemRole;\n /**\n * The color of the icon when the tab is selected.\n */\n selectedIconColor?: ColorValue;\n /**\n * The color of the badge when the tab is selected.\n */\n selectedBadgeBackgroundColor?: ColorValue;\n /**\n * The color of all the badges when the tab is selected.\n */\n badgeBackgroundColor?: ColorValue;\n /**\n * The color of the badge text.\n *\n * @platform android\n * @platform web\n */\n badgeTextColor?: ColorValue;\n /**\n * The color of the background when the tab is selected.\n */\n backgroundColor?: ColorValue;\n /**\n * The blur effect to apply when the tab is selected.\n *\n * @platform iOS\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * The color of the icon when the tab is selected.\n *\n * On iOS 26+ you can change the icon color in the scroll edge state.\n */\n iconColor?: ColorValue;\n /**\n * When set to `true`, the tab bar will not become transparent when scrolled to the edge.\n *\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n /**\n * The position adjustment for all the labels when the tab is selected.\n *\n * @platform iOS\n */\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * The position adjustment for the label when the tab is selected.\n *\n * @platform iOS\n */\n selectedTitlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * The color of the tab indicator.\n *\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n}\n\nexport type SymbolOrImageSource =\n | {\n /**\n * The name of the SF Symbol to use as an icon.\n * @platform iOS\n */\n sf?: SFSymbol;\n /**\n * The name of the drawable resource to use as an icon.\n * @platform android\n */\n drawable?: string;\n }\n | {\n /**\n * The image source to use as an icon.\n */\n src?: ImageSourcePropType | Promise<ImageSourcePropType>;\n };\n\nexport interface ExtendedNativeTabOptions extends NativeTabOptions {\n /**\n * If true, the tab will be hidden from the tab bar.\n */\n hidden?: boolean;\n specialEffects?: BottomTabsScreenProps['specialEffects'];\n}\n\ntype NumericFontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n\nexport interface NativeTabsLabelStyle {\n /**\n * The font family of the tab label.\n */\n fontFamily?: TextStyle['fontFamily'];\n /**\n * The font size of the tab label.\n */\n fontSize?: TextStyle['fontSize'];\n /**\n * The font weight of the tab label.\n */\n fontWeight?: NumericFontWeight | `${NumericFontWeight}`;\n /**\n * The font style of the tab label.\n */\n fontStyle?: TextStyle['fontStyle'];\n /**\n * The color of the tab label.\n */\n color?: TextStyle['color'];\n}\n\nexport const SUPPORTED_BLUR_EFFECTS = [\n 'none',\n 'systemDefault',\n 'extraLight',\n 'light',\n 'dark',\n 'regular',\n 'prominent',\n 'systemUltraThinMaterial',\n 'systemThinMaterial',\n 'systemMaterial',\n 'systemThickMaterial',\n 'systemChromeMaterial',\n 'systemUltraThinMaterialLight',\n 'systemThinMaterialLight',\n 'systemMaterialLight',\n 'systemThickMaterialLight',\n 'systemChromeMaterialLight',\n 'systemUltraThinMaterialDark',\n 'systemThinMaterialDark',\n 'systemMaterialDark',\n 'systemThickMaterialDark',\n 'systemChromeMaterialDark',\n] as const;\n\n/**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiblureffect/style)\n */\nexport type NativeTabsBlurEffect = (typeof SUPPORTED_BLUR_EFFECTS)[number];\n\n/**\n * @platform android\n * @platform web\n */\nexport interface NativeTabsActiveStyleType {\n /**\n * @platform android\n * @platform web\n */\n color?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n fontSize?: TextStyle['fontSize'];\n /**\n * @platform android\n */\n iconColor?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n}\n\nexport interface NativeTabsProps extends PropsWithChildren {\n // #region common props\n /**\n * The style of the every tab label in the tab bar.\n */\n labelStyle?: NativeTabsLabelStyle;\n // disabledLabelStyle?: NativeTabsLabelStyle;\n /**\n * The color of every tab icon in the tab bar.\n */\n iconColor?: ColorValue;\n /**\n * The tint color of the tab icon.\n *\n * Can be overridden by icon color and label color for each tab individually.\n */\n tintColor?: ColorValue;\n /**\n * The background color of the tab bar.\n */\n backgroundColor?: ColorValue | null;\n /**\n * The background color of every badge in the tab bar.\n */\n badgeBackgroundColor?: ColorValue;\n // #endregion common props\n // #region iOS props\n /**\n * Specifies the minimize behavior for the tab bar.\n *\n * Available starting from iOS 26.\n *\n * The following values are currently supported:\n *\n * - `automatic` - resolves to the system default minimize behavior\n * - `never` - the tab bar does not minimize\n * - `onScrollDown` - the tab bar minimizes when scrolling down and\n * expands when scrolling back up\n * - `onScrollUp` - the tab bar minimizes when scrolling up and expands\n * when scrolling back down\n *\n * @see The supported values correspond to the official [UIKit documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior).\n *\n * @default automatic\n *\n * @platform iOS 26+\n */\n minimizeBehavior?: NativeTabsTabBarMinimizeBehavior;\n /**\n * The blur effect applied to the tab bar.\n *\n * @platform iOS\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/titlepositionadjustment)\n *\n * @platform iOS\n */\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * When set to `true`, the tab bar will not become transparent when scrolled to the edge.\n *\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n // #endregion iOS props\n // #region android props\n /**\n * Disables the active indicator for the tab bar.\n *\n * @platform android\n */\n disableIndicator?: boolean;\n /**\n * The behavior when navigating back with the back button.\n *\n * @platform android\n */\n backBehavior?: 'none' | 'initialRoute' | 'history';\n /**\n * The visibility mode of the tab item label.\n *\n * @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)\n *\n * @platform android\n */\n labelVisibilityMode?: NativeTabsTabBarItemLabelVisibilityMode;\n /**\n * The color of the ripple effect when the tab is pressed.\n *\n * @platform android\n */\n rippleColor?: ColorValue;\n /**\n * The color of the tab indicator.\n *\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n /**\n * The color of the badge text.\n *\n * @platform android\n * @platform web\n */\n badgeTextColor?: ColorValue;\n // #endregion android props\n}\nexport interface NativeTabsViewProps extends NativeTabsProps {\n focusedIndex: number;\n builder: ReturnType<\n typeof useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n Record<string, (...args: any) => void>,\n NativeTabOptions,\n Record<string, any>\n >\n >;\n}\n\nexport const SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES = [\n 'auto',\n 'selected',\n 'labeled',\n 'unlabeled',\n] as const;\n\n/**\n * @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)\n *\n * @platform android\n */\nexport type NativeTabsTabBarItemLabelVisibilityMode =\n (typeof SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES)[number];\n\nexport const SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS = [\n 'automatic',\n 'never',\n 'onScrollDown',\n 'onScrollUp',\n] as const;\n\n/**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior)\n *\n * @platform iOS 26\n */\nexport type NativeTabsTabBarMinimizeBehavior =\n (typeof SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS)[number];\n\nexport interface NativeTabTriggerProps {\n /**\n * The name of the route.\n *\n * This is required when used inside a Layout component.\n *\n * When used in a route it has no effect.\n */\n name?: string;\n /**\n * If true, the tab will be hidden from the tab bar.\n */\n hidden?: boolean;\n /**\n * The options for the trigger.\n *\n * Use `Icon`, `Label`, and `Badge` components as children to customize the tab, rather then raw options.\n */\n options?: NativeTabOptions;\n /**\n * If true, the tab will not pop stack to the root when selected again.\n *\n * @default false\n * @platform iOS\n */\n disablePopToTop?: boolean;\n /**\n * If true, the tab will not scroll to the top when selected again.\n * @default false\n *\n * @platform iOS\n */\n disableScrollToTop?: boolean;\n /**\n * The children of the trigger.\n *\n * Use `Icon`, `Label`, and `Badge` components to customize the tab.\n */\n children?: React.ReactNode;\n /**\n * System-provided tab bar item with predefined icon and title\n *\n * Uses Apple's built-in tab bar items (e.g., bookmarks, contacts, downloads) with\n * standard iOS styling and localized titles. Custom `icon` or `selectedIcon`\n * properties will override the system icon, but the system-defined title cannot\n * be customized.\n *\n * @see {@link https://developer.apple.com/documentation/uikit/uitabbaritem/systemitem|UITabBarItem.SystemItem}\n * @platform ios\n */\n role?: NativeTabsTabBarItemRole;\n}\n\nconst SUPPORTED_TAB_BAR_ITEM_ROLES = [\n 'bookmarks',\n 'contacts',\n 'downloads',\n 'favorites',\n 'featured',\n 'history',\n 'more',\n 'mostRecent',\n 'mostViewed',\n 'recents',\n 'search',\n 'topRated',\n] as const;\n\nexport type NativeTabsTabBarItemRole = (typeof SUPPORTED_TAB_BAR_ITEM_ROLES)[number];\n\nexport interface NativeTabsTriggerTabBarProps {\n /**\n * The style of the every tab label in the tab bar.\n *\n * @platform iOS\n * @platform web\n */\n labelStyle?: NativeTabsLabelStyle;\n /**\n * The background color of the tab bar, when the tab is selected\n */\n backgroundColor?: ColorValue;\n /**\n * The color of every tab icon, when the tab is selected\n *\n * @platform iOS\n */\n iconColor?: ColorValue;\n /**\n * The background color of every badge in the tab bar.\n *\n * @platform iOS\n * @platform web\n */\n badgeBackgroundColor?: ColorValue;\n /**\n * The blur effect applied to the tab bar, when the tab is selected\n *\n * @platform iOS\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * When set to `true`, the tab bar will not become transparent when scrolled to the edge.\n *\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n /**\n * The color of the badge text.\n *\n * @platform web\n */\n badgeTextColor?: ColorValue;\n /**\n * The color of the tab indicator.\n *\n * @platform web\n */\n indicatorColor?: ColorValue;\n}\n"]}
@@ -1,10 +1,12 @@
1
- import type { ImageSourcePropType } from 'react-native';
1
+ import type { ColorValue, ImageSourcePropType } from 'react-native';
2
2
  import type { SFSymbol } from 'sf-symbols-typescript';
3
+ import type { NativeTabsLabelStyle } from '../NativeBottomTabs/types';
3
4
  export interface LabelProps {
4
5
  /**
5
6
  * The text to display as the label for the tab.
6
7
  */
7
8
  children?: string;
9
+ selectedStyle?: NativeTabsLabelStyle;
8
10
  /**
9
11
  * If true, the label will be hidden.
10
12
  * @default false
@@ -15,42 +17,65 @@ export declare function Label(props: LabelProps): null;
15
17
  export interface SourceIconCombination {
16
18
  /**
17
19
  * The image source to use as an icon.
20
+ *
21
+ * The value can be provided in two ways:
22
+ * - As an image source
23
+ * - As an object specifying the default and selected states
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * <Icon src={require('./path/to/icon.png')} />
28
+ * ```
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * <Icon src={{ default: require('./path/to/icon.png'), selected: require('./path/to/icon-selected.png') }} />
33
+ * ```
34
+ *
35
+ * @platform Android
18
36
  * @platform iOS
19
37
  */
20
- src?: ImageSourcePropType;
21
- /**
22
- * The image source to use as an icon when the tab is selected.
23
- * @platform iOS
24
- */
25
- selectedSrc?: ImageSourcePropType;
26
- /**
27
- * The name of the drawable resource to use as an icon.
28
- * @platform android
29
- */
30
- drawable?: string;
38
+ src?: ImageSourcePropType | React.ReactElement | {
39
+ default?: ImageSourcePropType | React.ReactElement;
40
+ selected: ImageSourcePropType | React.ReactElement;
41
+ };
42
+ drawable?: never;
31
43
  sf?: never;
32
- selectedSf?: never;
33
44
  }
34
45
  export interface NamedIconCombination {
35
46
  /**
36
47
  * The name of the SF Symbol to use as an icon.
48
+ *
49
+ * The value can be provided in two ways:
50
+ * - As a string with the SF Symbol name
51
+ * - As an object specifying the default and selected states
52
+ *
53
+ * @example
54
+ * ```tsx
55
+ * <Icon sf="magnifyingglass" />
56
+ * ```
57
+ *
58
+ * @example
59
+ * ```tsx
60
+ * <Icon sf={{ default: "house", selected: "house.fill" }} />
61
+ * ```
62
+ *
37
63
  * @platform iOS
38
64
  */
39
- sf?: SFSymbol;
40
- /**
41
- * The name of the SF Symbol to use as an icon when the tab is selected.
42
- * @platform iOS
43
- */
44
- selectedSf?: SFSymbol;
65
+ sf?: SFSymbol | {
66
+ default?: SFSymbol;
67
+ selected: SFSymbol;
68
+ };
45
69
  /**
46
70
  * The name of the drawable resource to use as an icon.
47
71
  * @platform android
48
72
  */
49
73
  drawable?: string;
50
74
  src?: never;
51
- selectedSrc?: never;
52
75
  }
53
- export type IconProps = NamedIconCombination | SourceIconCombination;
76
+ export type IconProps = {
77
+ selectedColor?: ColorValue;
78
+ } & (NamedIconCombination | SourceIconCombination);
54
79
  /**
55
80
  * Renders an icon for the tab.
56
81
  *
@@ -58,6 +83,43 @@ export type IconProps = NamedIconCombination | SourceIconCombination;
58
83
  * @platform android
59
84
  */
60
85
  export declare function Icon(props: IconProps): null;
86
+ export interface VectorIconProps<NameT extends string> {
87
+ /**
88
+ * The family of the vector icon.
89
+ *
90
+ * @example
91
+ * ```tsx
92
+ * import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';
93
+ * ```
94
+ */
95
+ family: {
96
+ getImageSource: (name: NameT, size: number, color: ColorValue) => Promise<ImageSourcePropType>;
97
+ };
98
+ /**
99
+ * The name of the vector icon.
100
+ */
101
+ name: NameT;
102
+ }
103
+ /**
104
+ * Helper component which can be used to load vector icons for `NativeTabs`.
105
+ *
106
+ * @example
107
+ * ```tsx
108
+ * import { NativeTabs, VectorIcon } from 'expo-router';
109
+ * import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';
110
+ *
111
+ * export default Layout(){
112
+ * return (
113
+ * <NativeTabs>
114
+ * <NativeTabs.Trigger name="index">
115
+ * <Icon src={<VectorIcon family={MaterialCommunityIcons} name="home" />} />
116
+ * </NativeTabs.Trigger>
117
+ * </NativeTabs>
118
+ * );
119
+ * }
120
+ * ```
121
+ */
122
+ export declare function VectorIcon<NameT extends string>(props: VectorIconProps<NameT>): null;
61
123
  export interface BadgeProps {
62
124
  /**
63
125
  * The text to display as the badge for the tab.
@@ -69,6 +131,7 @@ export interface BadgeProps {
69
131
  * @default false
70
132
  */
71
133
  hidden?: boolean;
134
+ selectedBackgroundColor?: ColorValue;
72
135
  }
73
136
  export declare function Badge(props: BadgeProps): null;
74
137
  //# sourceMappingURL=elements.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/common/elements.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,QAEtC;AAED,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,GAAG,CAAC,EAAE,mBAAmB,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAElC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,KAAK,CAAC;IACX,UAAU,CAAC,EAAE,KAAK,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,EAAE,CAAC,EAAE,QAAQ,CAAC;IACd;;;OAGG;IACH,UAAU,CAAC,EAAE,QAAQ,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB;AAED,MAAM,MAAM,SAAS,GAAG,oBAAoB,GAAG,qBAAqB,CAAC;AAErE;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,QAEpC;AAED,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAA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AAa,CAAC,EAAE,UAAU,CAAA;CAAE,GAAG,CACrD,oBAAoB,GACpB,qBAAqB,CACxB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,QAEpC;AAED,MAAM,WAAW,eAAe,CAAC,KAAK,SAAS,MAAM;IACnD;;;;;;;OAOG;IACH,MAAM,EAAE;QACN,cAAc,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;KAChG,CAAC;IACF;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;CACb;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAC,KAAK,SAAS,MAAM,EAAE,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,QAE7E;AAED,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uBAAuB,CAAC,EAAE,UAAU,CAAC;CACtC;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,QAEtC"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Label = Label;
4
4
  exports.Icon = Icon;
5
+ exports.VectorIcon = VectorIcon;
5
6
  exports.Badge = Badge;
6
7
  function Label(props) {
7
8
  return null;
@@ -15,6 +16,28 @@ function Label(props) {
15
16
  function Icon(props) {
16
17
  return null;
17
18
  }
19
+ /**
20
+ * Helper component which can be used to load vector icons for `NativeTabs`.
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * import { NativeTabs, VectorIcon } from 'expo-router';
25
+ * import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';
26
+ *
27
+ * export default Layout(){
28
+ * return (
29
+ * <NativeTabs>
30
+ * <NativeTabs.Trigger name="index">
31
+ * <Icon src={<VectorIcon family={MaterialCommunityIcons} name="home" />} />
32
+ * </NativeTabs.Trigger>
33
+ * </NativeTabs>
34
+ * );
35
+ * }
36
+ * ```
37
+ */
38
+ function VectorIcon(props) {
39
+ return null;
40
+ }
18
41
  function Badge(props) {
19
42
  return null;
20
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../src/native-tabs/common/elements.tsx"],"names":[],"mappings":";;AAgBA,sBAEC;AAmDD,oBAEC;AAgBD,sBAEC;AAzED,SAAgB,KAAK,CAAC,KAAiB;IACrC,OAAO,IAAI,CAAC;AACd,CAAC;AA6CD;;;;;GAKG;AACH,SAAgB,IAAI,CAAC,KAAgB;IACnC,OAAO,IAAI,CAAC;AACd,CAAC;AAgBD,SAAgB,KAAK,CAAC,KAAiB;IACrC,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { ImageSourcePropType } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nexport interface LabelProps {\n /**\n * The text to display as the label for the tab.\n */\n children?: string;\n\n /**\n * If true, the label will be hidden.\n * @default false\n */\n hidden?: boolean;\n}\n\nexport function Label(props: LabelProps) {\n return null;\n}\n\nexport interface SourceIconCombination {\n /**\n * The image source to use as an icon.\n * @platform iOS\n */\n src?: ImageSourcePropType;\n /**\n * The image source to use as an icon when the tab is selected.\n * @platform iOS\n */\n selectedSrc?: ImageSourcePropType;\n // TODO: Remove this when custom icons can be used on Android\n /**\n * The name of the drawable resource to use as an icon.\n * @platform android\n */\n drawable?: string;\n sf?: never;\n selectedSf?: never;\n}\n\nexport interface NamedIconCombination {\n /**\n * The name of the SF Symbol to use as an icon.\n * @platform iOS\n */\n sf?: SFSymbol;\n /**\n * The name of the SF Symbol to use as an icon when the tab is selected.\n * @platform iOS\n */\n selectedSf?: SFSymbol;\n /**\n * The name of the drawable resource to use as an icon.\n * @platform android\n */\n drawable?: string;\n src?: never;\n selectedSrc?: never;\n}\n\nexport type IconProps = NamedIconCombination | SourceIconCombination;\n\n/**\n * Renders an icon for the tab.\n *\n * @platform ios\n * @platform android\n */\nexport function Icon(props: IconProps) {\n return null;\n}\n\nexport interface BadgeProps {\n /**\n * The text to display as the badge for the tab.\n * If not provided, the badge will not be displayed.\n */\n children?: string;\n\n /**\n * If true, the badge will be hidden.\n * @default false\n */\n hidden?: boolean;\n}\n\nexport function Badge(props: BadgeProps) {\n return null;\n}\n"]}
1
+ {"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../src/native-tabs/common/elements.tsx"],"names":[],"mappings":";;AAkBA,sBAEC;AA0ED,oBAEC;AAuCD,gCAEC;AAiBD,sBAEC;AA1ID,SAAgB,KAAK,CAAC,KAAiB;IACrC,OAAO,IAAI,CAAC;AACd,CAAC;AAoED;;;;;GAKG;AACH,SAAgB,IAAI,CAAC,KAAgB;IACnC,OAAO,IAAI,CAAC;AACd,CAAC;AAoBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,UAAU,CAAuB,KAA6B;IAC5E,OAAO,IAAI,CAAC;AACd,CAAC;AAiBD,SAAgB,KAAK,CAAC,KAAiB;IACrC,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { ColorValue, ImageSourcePropType } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport type { NativeTabsLabelStyle } from '../NativeBottomTabs/types';\n\nexport interface LabelProps {\n /**\n * The text to display as the label for the tab.\n */\n children?: string;\n selectedStyle?: NativeTabsLabelStyle;\n /**\n * If true, the label will be hidden.\n * @default false\n */\n hidden?: boolean;\n}\n\nexport function Label(props: LabelProps) {\n return null;\n}\n\nexport interface SourceIconCombination {\n /**\n * The image source to use as an icon.\n *\n * The value can be provided in two ways:\n * - As an image source\n * - As an object specifying the default and selected states\n *\n * @example\n * ```tsx\n * <Icon src={require('./path/to/icon.png')} />\n * ```\n *\n * @example\n * ```tsx\n * <Icon src={{ default: require('./path/to/icon.png'), selected: require('./path/to/icon-selected.png') }} />\n * ```\n *\n * @platform Android\n * @platform iOS\n */\n src?:\n | ImageSourcePropType\n | React.ReactElement\n | {\n default?: ImageSourcePropType | React.ReactElement;\n selected: ImageSourcePropType | React.ReactElement;\n };\n drawable?: never;\n sf?: never;\n}\n\nexport interface NamedIconCombination {\n /**\n * The name of the SF Symbol to use as an icon.\n *\n * The value can be provided in two ways:\n * - As a string with the SF Symbol name\n * - As an object specifying the default and selected states\n *\n * @example\n * ```tsx\n * <Icon sf=\"magnifyingglass\" />\n * ```\n *\n * @example\n * ```tsx\n * <Icon sf={{ default: \"house\", selected: \"house.fill\" }} />\n * ```\n *\n * @platform iOS\n */\n sf?: SFSymbol | { default?: SFSymbol; selected: SFSymbol };\n /**\n * The name of the drawable resource to use as an icon.\n * @platform android\n */\n drawable?: string;\n src?: never;\n}\n\nexport type IconProps = { selectedColor?: ColorValue } & (\n | NamedIconCombination\n | SourceIconCombination\n);\n\n/**\n * Renders an icon for the tab.\n *\n * @platform ios\n * @platform android\n */\nexport function Icon(props: IconProps) {\n return null;\n}\n\nexport interface VectorIconProps<NameT extends string> {\n /**\n * The family of the vector icon.\n *\n * @example\n * ```tsx\n * import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';\n * ```\n */\n family: {\n getImageSource: (name: NameT, size: number, color: ColorValue) => Promise<ImageSourcePropType>;\n };\n /**\n * The name of the vector icon.\n */\n name: NameT;\n}\n\n/**\n * Helper component which can be used to load vector icons for `NativeTabs`.\n *\n * @example\n * ```tsx\n * import { NativeTabs, VectorIcon } from 'expo-router';\n * import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';\n *\n * export default Layout(){\n * return (\n * <NativeTabs>\n * <NativeTabs.Trigger name=\"index\">\n * <Icon src={<VectorIcon family={MaterialCommunityIcons} name=\"home\" />} />\n * </NativeTabs.Trigger>\n * </NativeTabs>\n * );\n * }\n * ```\n */\nexport function VectorIcon<NameT extends string>(props: VectorIconProps<NameT>) {\n return null;\n}\n\nexport interface BadgeProps {\n /**\n * The text to display as the badge for the tab.\n * If not provided, the badge will not be displayed.\n */\n children?: string;\n\n /**\n * If true, the badge will be hidden.\n * @default false\n */\n hidden?: boolean;\n selectedBackgroundColor?: ColorValue;\n}\n\nexport function Badge(props: BadgeProps) {\n return null;\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  export * from './common/elements';
2
- export type { NativeTabsProps, NativeTabTriggerProps, NativeTabsStyleType, NativeTabsActiveStyleType, NativeTabOptions, SfSymbolOrImageSource, } from './NativeBottomTabs/types';
2
+ export type { NativeTabsProps, NativeTabTriggerProps, NativeTabsLabelStyle, NativeTabsActiveStyleType, NativeTabOptions, SymbolOrImageSource, NativeTabsTabBarItemLabelVisibilityMode, NativeTabsBlurEffect, NativeTabsTabBarMinimizeBehavior, NativeTabsTabBarItemRole, NativeTabsTriggerTabBarProps, } from './NativeBottomTabs/types';
3
+ export { NativeTabsTriggerTabBar } from './NativeBottomTabs/NativeTabsTriggerTabBar';
3
4
  export { NativeTabTrigger } from './NativeBottomTabs/NativeTabTrigger';
4
5
  export { NativeTabs } from './NativeBottomTabs/NativeTabs';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/native-tabs/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/native-tabs/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,uCAAuC,EACvC,oBAAoB,EACpB,gCAAgC,EAChC,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC"}
@@ -14,8 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.NativeTabs = exports.NativeTabTrigger = void 0;
17
+ exports.NativeTabs = exports.NativeTabTrigger = exports.NativeTabsTriggerTabBar = void 0;
18
18
  __exportStar(require("./common/elements"), exports);
19
+ var NativeTabsTriggerTabBar_1 = require("./NativeBottomTabs/NativeTabsTriggerTabBar");
20
+ Object.defineProperty(exports, "NativeTabsTriggerTabBar", { enumerable: true, get: function () { return NativeTabsTriggerTabBar_1.NativeTabsTriggerTabBar; } });
19
21
  var NativeTabTrigger_1 = require("./NativeBottomTabs/NativeTabTrigger");
20
22
  Object.defineProperty(exports, "NativeTabTrigger", { enumerable: true, get: function () { return NativeTabTrigger_1.NativeTabTrigger; } });
21
23
  var NativeTabs_1 = require("./NativeBottomTabs/NativeTabs");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/native-tabs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAkC;AASlC,wEAAuE;AAA9D,oHAAA,gBAAgB,OAAA;AACzB,4DAA2D;AAAlD,wGAAA,UAAU,OAAA","sourcesContent":["export * from './common/elements';\nexport type {\n NativeTabsProps,\n NativeTabTriggerProps,\n NativeTabsStyleType,\n NativeTabsActiveStyleType,\n NativeTabOptions,\n SfSymbolOrImageSource,\n} from './NativeBottomTabs/types';\nexport { NativeTabTrigger } from './NativeBottomTabs/NativeTabTrigger';\nexport { NativeTabs } from './NativeBottomTabs/NativeTabs';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/native-tabs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAkC;AAclC,sFAAqF;AAA5E,kIAAA,uBAAuB,OAAA;AAChC,wEAAuE;AAA9D,oHAAA,gBAAgB,OAAA;AACzB,4DAA2D;AAAlD,wGAAA,UAAU,OAAA","sourcesContent":["export * from './common/elements';\nexport type {\n NativeTabsProps,\n NativeTabTriggerProps,\n NativeTabsLabelStyle,\n NativeTabsActiveStyleType,\n NativeTabOptions,\n SymbolOrImageSource,\n NativeTabsTabBarItemLabelVisibilityMode,\n NativeTabsBlurEffect,\n NativeTabsTabBarMinimizeBehavior,\n NativeTabsTabBarItemRole,\n NativeTabsTriggerTabBarProps,\n} from './NativeBottomTabs/types';\nexport { NativeTabsTriggerTabBar } from './NativeBottomTabs/NativeTabsTriggerTabBar';\nexport { NativeTabTrigger } from './NativeBottomTabs/NativeTabTrigger';\nexport { NativeTabs } from './NativeBottomTabs/NativeTabs';\n"]}
@@ -0,0 +1,9 @@
1
+ declare const internalExpoRouterParamNames: readonly ["__internal_expo_router_no_animation", "__internal__expo_router_is_preview_navigation"];
2
+ export type InternalExpoRouterParamName = (typeof internalExpoRouterParamNames)[number];
3
+ export type InternalExpoRouterParams = Partial<Record<InternalExpoRouterParamName, unknown>>;
4
+ export declare function appendInternalExpoRouterParams(params: Record<string, unknown> | object | undefined, expoParams: InternalExpoRouterParams): Record<string, unknown> | undefined;
5
+ export declare function getInternalExpoRouterParams(_params: Record<string, unknown> | object | undefined): InternalExpoRouterParams;
6
+ export declare function removeInternalExpoRouterParams(params: Record<string, unknown> | object): Record<string, unknown> | object;
7
+ export declare function removeInternalExpoRouterParams(params: Record<string, unknown> | object | undefined): Record<string, unknown> | object | undefined;
8
+ export {};
9
+ //# sourceMappingURL=navigationParams.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigationParams.d.ts","sourceRoot":"","sources":["../src/navigationParams.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,4BAA4B,mGAGxB,CAAC;AAEX,MAAM,MAAM,2BAA2B,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AACxF,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,2BAA2B,EAAE,OAAO,CAAC,CAAC,CAAC;AAE7F,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,SAAS,EACpD,UAAU,EAAE,wBAAwB,uCAyBrC;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,SAAS,GACpD,wBAAwB,CAiB1B;AAED,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GACvC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;AACpC,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,SAAS,GACnD,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.appendInternalExpoRouterParams = appendInternalExpoRouterParams;
4
+ exports.getInternalExpoRouterParams = getInternalExpoRouterParams;
5
+ exports.removeInternalExpoRouterParams = removeInternalExpoRouterParams;
6
+ const INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME = '__internal_expo_router_no_animation';
7
+ const INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME = '__internal__expo_router_is_preview_navigation';
8
+ const internalExpoRouterParamNames = [
9
+ INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME,
10
+ INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME,
11
+ ];
12
+ function appendInternalExpoRouterParams(params, expoParams) {
13
+ let newParams = {};
14
+ // Using nested params is a workaround for the issue with the preview key not being passed to the params
15
+ // https://github.com/Ubax/react-navigation/blob/main/packages/core/src/useNavigationBuilder.tsx#L573
16
+ // Another solution would be to propagate the preview key in the useNavigationBuilder,
17
+ // but that would require us to fork the @react-navigation/core package.
18
+ let nestedParams = {};
19
+ if (params) {
20
+ newParams = { ...params };
21
+ if ('params' in params) {
22
+ if (typeof params.params === 'object' && params.params) {
23
+ nestedParams = params.params;
24
+ }
25
+ }
26
+ }
27
+ nestedParams = { ...nestedParams, ...expoParams };
28
+ newParams = { ...newParams, ...expoParams };
29
+ if (Object.keys(nestedParams).length > 0) {
30
+ newParams.params = nestedParams;
31
+ }
32
+ if (Object.keys(newParams).length === 0 && params === undefined) {
33
+ return undefined;
34
+ }
35
+ return newParams;
36
+ }
37
+ function getInternalExpoRouterParams(_params) {
38
+ const expoParams = {};
39
+ const params = _params ? _params : {};
40
+ const nestedParams = 'params' in params && typeof params.params === 'object' && params.params
41
+ ? params.params
42
+ : {};
43
+ for (const key of internalExpoRouterParamNames) {
44
+ if (key in params) {
45
+ expoParams[key] = params[key];
46
+ }
47
+ else if (key in nestedParams) {
48
+ expoParams[key] = nestedParams[key];
49
+ }
50
+ }
51
+ return expoParams;
52
+ }
53
+ function removeInternalExpoRouterParams(params) {
54
+ if (!params) {
55
+ return undefined;
56
+ }
57
+ const newNestedParams = 'params' in params && typeof params.params === 'object' && params.params
58
+ ? Object.fromEntries(Object.entries(params.params).filter(([key]) => !internalExpoRouterParamNames.includes(key)))
59
+ : {};
60
+ const newParams = Object.fromEntries(Object.entries(params).filter(([key]) => !internalExpoRouterParamNames.includes(key) &&
61
+ key !== 'params'));
62
+ if (Object.keys(newNestedParams).length > 0) {
63
+ return { ...newParams, params: newNestedParams };
64
+ }
65
+ return newParams;
66
+ }
67
+ //# sourceMappingURL=navigationParams.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigationParams.js","sourceRoot":"","sources":["../src/navigationParams.ts"],"names":[],"mappings":";;AAYA,wEA2BC;AAED,kEAmBC;AAQD,wEAyBC;AA7FD,MAAM,4CAA4C,GAAG,qCAAqC,CAAC;AAC3F,MAAM,qDAAqD,GACzD,+CAA+C,CAAC;AAElD,MAAM,4BAA4B,GAAG;IACnC,4CAA4C;IAC5C,qDAAqD;CAC7C,CAAC;AAKX,SAAgB,8BAA8B,CAC5C,MAAoD,EACpD,UAAoC;IAEpC,IAAI,SAAS,GAA4B,EAAE,CAAC;IAC5C,wGAAwG;IACxG,qGAAqG;IACrG,sFAAsF;IACtF,wEAAwE;IACxE,IAAI,YAAY,GAA4B,EAAE,CAAC;IAC/C,IAAI,MAAM,EAAE,CAAC;QACX,SAAS,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;QAC1B,IAAI,QAAQ,IAAI,MAAM,EAAE,CAAC;YACvB,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBACvD,YAAY,GAAG,MAAM,CAAC,MAAiC,CAAC;YAC1D,CAAC;QACH,CAAC;IACH,CAAC;IACD,YAAY,GAAG,EAAE,GAAG,YAAY,EAAE,GAAG,UAAU,EAAE,CAAC;IAClD,SAAS,GAAG,EAAE,GAAG,SAAS,EAAE,GAAG,UAAU,EAAE,CAAC;IAC5C,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzC,SAAS,CAAC,MAAM,GAAG,YAAY,CAAC;IAClC,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,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,CAAC,CAAC,EAAE,CAAC;IACT,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAClC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAC3B,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CACR,CAAC,4BAA4B,CAAC,QAAQ,CAAC,GAAkC,CAAC;QAC1E,GAAG,KAAK,QAAQ,CACnB,CACF,CAAC;IACF,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5C,OAAO,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;IACnD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["const INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME = '__internal_expo_router_no_animation';\nconst INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME =\n '__internal__expo_router_is_preview_navigation';\n\nconst internalExpoRouterParamNames = [\n INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME,\n] as const;\n\nexport type InternalExpoRouterParamName = (typeof internalExpoRouterParamNames)[number];\nexport type InternalExpoRouterParams = Partial<Record<InternalExpoRouterParamName, unknown>>;\n\nexport function appendInternalExpoRouterParams(\n params: Record<string, unknown> | object | undefined,\n expoParams: InternalExpoRouterParams\n) {\n let newParams: Record<string, unknown> = {};\n // Using nested params is a workaround for the issue with the preview key not being passed to the params\n // https://github.com/Ubax/react-navigation/blob/main/packages/core/src/useNavigationBuilder.tsx#L573\n // Another solution would be to propagate the preview key in the useNavigationBuilder,\n // but that would require us to fork the @react-navigation/core package.\n let nestedParams: Record<string, unknown> = {};\n if (params) {\n newParams = { ...params };\n if ('params' in params) {\n if (typeof params.params === 'object' && params.params) {\n nestedParams = params.params as Record<string, unknown>;\n }\n }\n }\n nestedParams = { ...nestedParams, ...expoParams };\n newParams = { ...newParams, ...expoParams };\n if (Object.keys(nestedParams).length > 0) {\n newParams.params = nestedParams;\n }\n if (Object.keys(newParams).length === 0 && params === undefined) {\n return undefined;\n }\n return newParams;\n}\n\nexport function getInternalExpoRouterParams(\n _params: Record<string, unknown> | object | undefined\n): InternalExpoRouterParams {\n const expoParams: InternalExpoRouterParams = {};\n const params: Record<string, unknown> = _params ? (_params as Record<string, unknown>) : {};\n const nestedParams: Record<string, unknown> =\n 'params' in params && typeof params.params === 'object' && params.params\n ? (params.params as Record<string, unknown>)\n : {};\n\n for (const key of internalExpoRouterParamNames) {\n if (key in params) {\n expoParams[key] = params[key];\n } else if (key in nestedParams) {\n expoParams[key] = nestedParams[key];\n }\n }\n\n return expoParams;\n}\n\nexport function removeInternalExpoRouterParams(\n params: Record<string, unknown> | object\n): Record<string, unknown> | object;\nexport function removeInternalExpoRouterParams(\n params: Record<string, unknown> | object | undefined\n): Record<string, unknown> | object | undefined;\nexport function removeInternalExpoRouterParams(\n params: Record<string, unknown> | object | undefined\n): Record<string, unknown> | object | undefined {\n if (!params) {\n return undefined;\n }\n const newNestedParams =\n 'params' in params && typeof params.params === 'object' && params.params\n ? Object.fromEntries(\n Object.entries(params.params).filter(\n ([key]) => !internalExpoRouterParamNames.includes(key as InternalExpoRouterParamName)\n )\n )\n : {};\n const newParams = Object.fromEntries(\n Object.entries(params).filter(\n ([key]) =>\n !internalExpoRouterParamNames.includes(key as InternalExpoRouterParamName) &&\n key !== 'params'\n )\n );\n if (Object.keys(newNestedParams).length > 0) {\n return { ...newParams, params: newNestedParams };\n }\n return newParams;\n}\n"]}
@@ -1,15 +1,26 @@
1
1
  import './expect';
2
2
  import './mocks';
3
- import { render } from '@testing-library/react-native';
3
+ import React from 'react';
4
4
  import { MockContextConfig, getMockConfig, getMockContext } from './mock-config';
5
5
  import { ExpoLinkingOptions } from '../getLinkingConfig';
6
6
  import { ReactNavigationState } from '../global-state/router-store';
7
- export * from '@testing-library/react-native';
8
- export type RenderRouterOptions = Parameters<typeof render>[1] & {
7
+ declare const rnTestingLibrary: typeof import("@testing-library/react-native");
8
+ export type * from '@testing-library/react-native';
9
+ export declare const act: typeof React.act, cleanup: typeof import("@testing-library/react-native").cleanup, fireEvent: typeof import("@testing-library/react-native").fireEvent, waitFor: typeof import("@testing-library/react-native").waitFor, waitForElementToBeRemoved: typeof import("@testing-library/react-native").waitForElementToBeRemoved, within: typeof import("@testing-library/react-native").within, configure: typeof import("@testing-library/react-native").configure, resetToDefaults: typeof import("@testing-library/react-native").resetToDefaults, isHiddenFromAccessibility: typeof import("@testing-library/react-native").isHiddenFromAccessibility, isInaccessible: typeof import("@testing-library/react-native").isHiddenFromAccessibility, getDefaultNormalizer: typeof import("@testing-library/react-native").getDefaultNormalizer, renderHook: typeof import("@testing-library/react-native").renderHook, userEvent: {
10
+ setup: typeof import("@testing-library/react-native/build/user-event/setup").setup;
11
+ press: (element: import("react-test-renderer").ReactTestInstance) => Promise<void>;
12
+ longPress: (element: import("react-test-renderer").ReactTestInstance, options?: import("@testing-library/react-native/build/user-event/press").PressOptions) => Promise<void>;
13
+ type: (element: import("react-test-renderer").ReactTestInstance, text: string, options?: import("@testing-library/react-native/build/user-event/type").TypeOptions) => Promise<void>;
14
+ clear: (element: import("react-test-renderer").ReactTestInstance) => Promise<void>;
15
+ paste: (element: import("react-test-renderer").ReactTestInstance, text: string) => Promise<void>;
16
+ scrollTo: (element: import("react-test-renderer").ReactTestInstance, options: import("@testing-library/react-native/build/user-event/scroll").ScrollToOptions) => Promise<void>;
17
+ };
18
+ export declare let screen: typeof rnTestingLibrary.screen;
19
+ export type RenderRouterOptions = Parameters<typeof rnTestingLibrary.render>[1] & {
9
20
  initialUrl?: any;
10
21
  linking?: Partial<ExpoLinkingOptions>;
11
22
  };
12
- type Result = ReturnType<typeof render> & {
23
+ type Result = ReturnType<typeof rnTestingLibrary.render> & {
13
24
  getPathname(): string;
14
25
  getPathnameWithParams(): string;
15
26
  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AAE,CAAC;IACxB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IACrD,cAAc,IAAI,oBAAoB,GAAG,SAAS,CAAC;CACpD,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC;AAE5D,wBAAgB,YAAY,CAC1B,OAAO,GAAE,iBAA2B,EACpC,EAAE,UAAgB,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,GAAE,mBAAwB,GAClE,MAAM,CAmCR;AAED,eAAO,MAAM,UAAU;IACrB,yDAAyD;mBAC1C,MAAM;IAIrB,yDAAyD;eAC9C,MAAM;IAIjB,6DAA6D;kBAC/C,MAAM;IAIpB,oDAAoD;gBACxC,MAAM;IAOlB,qEAAqE;;IAIrE,wEAAwE;sBACtD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,MAAM;IAMvD,qEAAqE;;CAItE,CAAC"}
@@ -1,18 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
17
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
4
  };
@@ -21,7 +7,6 @@ exports.testRouter = exports.getMockContext = exports.getMockConfig = void 0;
21
7
  exports.renderRouter = renderRouter;
22
8
  require("./expect");
23
9
  require("./mocks");
24
- const react_native_1 = require("@testing-library/react-native");
25
10
  const react_1 = __importDefault(require("react"));
26
11
  const mock_config_1 = require("./mock-config");
27
12
  Object.defineProperty(exports, "getMockConfig", { enumerable: true, get: function () { return mock_config_1.getMockConfig; } });
@@ -29,14 +14,32 @@ Object.defineProperty(exports, "getMockContext", { enumerable: true, get: functi
29
14
  const ExpoRoot_1 = require("../ExpoRoot");
30
15
  const router_store_1 = require("../global-state/router-store");
31
16
  const imperative_api_1 = require("../imperative-api");
32
- // re-export everything
33
- __exportStar(require("@testing-library/react-native"), exports);
17
+ const rnTestingLibrary = (() => {
18
+ try {
19
+ return require('@testing-library/react-native');
20
+ }
21
+ catch (error) {
22
+ if ('code' in error && error.code === 'MODULE_NOT_FOUND') {
23
+ const newError = new Error(`[expo-router/testing-library] "@testing-library/react-native" failed to import. You need to install it to use expo-router's testing library.`);
24
+ newError.stack = error.stack;
25
+ newError.cause = error;
26
+ throw newError;
27
+ }
28
+ throw error;
29
+ }
30
+ })();
31
+ Object.assign(exports, rnTestingLibrary);
32
+ Object.defineProperty(exports, 'screen', {
33
+ get() {
34
+ return rnTestingLibrary.screen;
35
+ },
36
+ });
34
37
  function renderRouter(context = './app', { initialUrl = '/', linking, ...options } = {}) {
35
38
  jest.useFakeTimers();
36
39
  const mockContext = (0, mock_config_1.getMockContext)(context);
37
40
  // Force the render to be synchronous
38
41
  process.env.EXPO_ROUTER_IMPORT_MODE = 'sync';
39
- const result = (0, react_native_1.render)(<ExpoRoot_1.ExpoRoot context={mockContext} location={initialUrl} linking={linking}/>, options);
42
+ const result = rnTestingLibrary.render(<ExpoRoot_1.ExpoRoot context={mockContext} location={initialUrl} linking={linking}/>, options);
40
43
  /**
41
44
  * This is a hack to ensure that React Navigation's state updates are processed before we run assertions.
42
45
  * Some updates are async and we need to wait for them to complete, otherwise will we get a false positive.
@@ -63,25 +66,25 @@ function renderRouter(context = './app', { initialUrl = '/', linking, ...options
63
66
  exports.testRouter = {
64
67
  /** Navigate to the provided pathname and the pathname */
65
68
  navigate(path) {
66
- (0, react_native_1.act)(() => imperative_api_1.router.navigate(path));
67
- expect(react_native_1.screen).toHavePathnameWithParams(path);
69
+ rnTestingLibrary.act(() => imperative_api_1.router.navigate(path));
70
+ expect(rnTestingLibrary.screen).toHavePathnameWithParams(path);
68
71
  },
69
72
  /** Push the provided pathname and assert the pathname */
70
73
  push(path) {
71
- (0, react_native_1.act)(() => imperative_api_1.router.push(path));
72
- expect(react_native_1.screen).toHavePathnameWithParams(path);
74
+ rnTestingLibrary.act(() => imperative_api_1.router.push(path));
75
+ expect(rnTestingLibrary.screen).toHavePathnameWithParams(path);
73
76
  },
74
77
  /** Replace with provided pathname and assert the pathname */
75
78
  replace(path) {
76
- (0, react_native_1.act)(() => imperative_api_1.router.replace(path));
77
- expect(react_native_1.screen).toHavePathnameWithParams(path);
79
+ rnTestingLibrary.act(() => imperative_api_1.router.replace(path));
80
+ expect(rnTestingLibrary.screen).toHavePathnameWithParams(path);
78
81
  },
79
82
  /** Go back in history and asset the new pathname */
80
83
  back(path) {
81
84
  expect(imperative_api_1.router.canGoBack()).toBe(true);
82
- (0, react_native_1.act)(() => imperative_api_1.router.back());
85
+ rnTestingLibrary.act(() => imperative_api_1.router.back());
83
86
  if (path) {
84
- expect(react_native_1.screen).toHavePathnameWithParams(path);
87
+ expect(rnTestingLibrary.screen).toHavePathnameWithParams(path);
85
88
  }
86
89
  },
87
90
  /** If there's history that supports invoking the `back` function. */
@@ -92,12 +95,12 @@ exports.testRouter = {
92
95
  setParams(params, path) {
93
96
  imperative_api_1.router.setParams(params);
94
97
  if (path) {
95
- expect(react_native_1.screen).toHavePathnameWithParams(path);
98
+ expect(exports.screen).toHavePathnameWithParams(path);
96
99
  }
97
100
  },
98
101
  /** If there's history that supports invoking the `back` function. */
99
102
  dismissAll() {
100
- (0, react_native_1.act)(() => imperative_api_1.router.dismissAll());
103
+ rnTestingLibrary.act(() => imperative_api_1.router.dismissAll());
101
104
  },
102
105
  };
103
106
  //# sourceMappingURL=index.js.map