expo-router 7.0.0-canary-20251120-e46b3cc → 7.0.0-canary-20251205-756eb7a
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.
- package/android/build.gradle +2 -2
- package/build/fork/getStateFromPath-forks.d.ts +5 -10
- package/build/fork/getStateFromPath-forks.d.ts.map +1 -1
- package/build/fork/getStateFromPath-forks.js +14 -13
- package/build/fork/getStateFromPath-forks.js.map +1 -1
- package/build/fork/getStateFromPath.js +3 -3
- package/build/fork/getStateFromPath.js.map +1 -1
- package/build/fork/native-stack/createNativeStackNavigator.d.ts.map +1 -1
- package/build/fork/native-stack/createNativeStackNavigator.js +25 -7
- package/build/fork/native-stack/createNativeStackNavigator.js.map +1 -1
- package/build/fork/native-stack/descriptors-context.d.ts +8 -0
- package/build/fork/native-stack/descriptors-context.d.ts.map +1 -0
- package/build/fork/native-stack/descriptors-context.js +6 -0
- package/build/fork/native-stack/descriptors-context.js.map +1 -0
- package/build/internal/utils.d.ts +1 -0
- package/build/internal/utils.d.ts.map +1 -1
- package/build/internal/utils.js +3 -1
- package/build/internal/utils.js.map +1 -1
- package/build/layouts/StackClient.d.ts.map +1 -1
- package/build/layouts/StackClient.js +39 -5
- package/build/layouts/StackClient.js.map +1 -1
- package/build/layouts/stack-utils/StackHeaderComponent.js +6 -6
- package/build/layouts/stack-utils/StackHeaderComponent.js.map +1 -1
- package/build/layouts/stack-utils/StackHeaderTitle.d.ts.map +1 -1
- package/build/layouts/stack-utils/StackHeaderTitle.js +3 -8
- package/build/layouts/stack-utils/StackHeaderTitle.js.map +1 -1
- package/build/layouts/stack-utils/index.d.ts +0 -1
- package/build/layouts/stack-utils/index.d.ts.map +1 -1
- package/build/layouts/stack-utils/index.js +1 -3
- package/build/layouts/stack-utils/index.js.map +1 -1
- package/build/link/ExpoLink.d.ts.map +1 -1
- package/build/link/ExpoLink.js +12 -4
- package/build/link/ExpoLink.js.map +1 -1
- package/build/link/Link.d.ts +2 -0
- package/build/link/Link.d.ts.map +1 -1
- package/build/link/Link.js +2 -0
- package/build/link/Link.js.map +1 -1
- package/build/link/LinkWithPreview.d.ts +6 -1
- package/build/link/LinkWithPreview.d.ts.map +1 -1
- package/build/link/LinkWithPreview.js +10 -11
- package/build/link/LinkWithPreview.js.map +1 -1
- package/build/link/elements.d.ts +8 -0
- package/build/link/elements.d.ts.map +1 -1
- package/build/link/elements.js +7 -2
- package/build/link/elements.js.map +1 -1
- package/build/link/preview/native.d.ts +17 -0
- package/build/link/preview/native.d.ts.map +1 -1
- package/build/link/preview/native.js +22 -0
- package/build/link/preview/native.js.map +1 -1
- package/build/link/zoom/ZoomTransitionEnabler.d.ts +5 -0
- package/build/link/zoom/ZoomTransitionEnabler.d.ts.map +1 -0
- package/build/link/zoom/ZoomTransitionEnabler.ios.d.ts +5 -0
- package/build/link/zoom/ZoomTransitionEnabler.ios.d.ts.map +1 -0
- package/build/link/zoom/ZoomTransitionEnabler.ios.js +44 -0
- package/build/link/zoom/ZoomTransitionEnabler.ios.js.map +1 -0
- package/build/link/zoom/ZoomTransitionEnabler.js +13 -0
- package/build/link/zoom/ZoomTransitionEnabler.js.map +1 -0
- package/build/link/zoom/ZoomTransitionEnabler.types.d.ts +4 -0
- package/build/link/zoom/ZoomTransitionEnabler.types.d.ts.map +1 -0
- package/build/link/zoom/ZoomTransitionEnabler.types.js +3 -0
- package/build/link/zoom/ZoomTransitionEnabler.types.js.map +1 -0
- package/build/link/zoom/link-apple-zoom.d.ts +23 -0
- package/build/link/zoom/link-apple-zoom.d.ts.map +1 -0
- package/build/link/zoom/link-apple-zoom.js +40 -0
- package/build/link/zoom/link-apple-zoom.js.map +1 -0
- package/build/link/zoom/useZoomTransitionPrimitives.d.ts +6 -0
- package/build/link/zoom/useZoomTransitionPrimitives.d.ts.map +1 -0
- package/build/link/zoom/useZoomTransitionPrimitives.ios.d.ts +11 -0
- package/build/link/zoom/useZoomTransitionPrimitives.ios.d.ts.map +1 -0
- package/build/link/zoom/useZoomTransitionPrimitives.ios.js +66 -0
- package/build/link/zoom/useZoomTransitionPrimitives.ios.js.map +1 -0
- package/build/link/zoom/useZoomTransitionPrimitives.js +9 -0
- package/build/link/zoom/useZoomTransitionPrimitives.js.map +1 -0
- package/build/link/zoom/zoom-transition-context.d.ts +7 -0
- package/build/link/zoom/zoom-transition-context.d.ts.map +1 -0
- package/build/link/zoom/zoom-transition-context.js +6 -0
- package/build/link/zoom/zoom-transition-context.js.map +1 -0
- package/build/native-tabs/NativeBottomTabsNavigator.d.ts +3 -15
- package/build/native-tabs/NativeBottomTabsNavigator.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabsNavigator.js +17 -2
- package/build/native-tabs/NativeBottomTabsNavigator.js.map +1 -1
- package/build/native-tabs/NativeBottomTabsRouter.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabsRouter.js +12 -1
- package/build/native-tabs/NativeBottomTabsRouter.js.map +1 -1
- package/build/native-tabs/NativeTabTrigger.d.ts +2 -2
- package/build/native-tabs/NativeTabTrigger.d.ts.map +1 -1
- package/build/native-tabs/NativeTabTrigger.js +24 -14
- package/build/native-tabs/NativeTabTrigger.js.map +1 -1
- package/build/native-tabs/NativeTabs.d.ts +6 -3
- package/build/native-tabs/NativeTabs.d.ts.map +1 -1
- package/build/native-tabs/NativeTabs.js +7 -2
- package/build/native-tabs/NativeTabs.js.map +1 -1
- package/build/native-tabs/NativeTabsView.d.ts.map +1 -1
- package/build/native-tabs/NativeTabsView.js +26 -3
- package/build/native-tabs/NativeTabsView.js.map +1 -1
- package/build/native-tabs/appearance.d.ts.map +1 -1
- package/build/native-tabs/appearance.js +2 -4
- package/build/native-tabs/appearance.js.map +1 -1
- package/build/native-tabs/common/elements.d.ts +36 -3
- package/build/native-tabs/common/elements.d.ts.map +1 -1
- package/build/native-tabs/common/elements.js +30 -1
- package/build/native-tabs/common/elements.js.map +1 -1
- package/build/native-tabs/hooks.d.ts +45 -0
- package/build/native-tabs/hooks.d.ts.map +1 -0
- package/build/native-tabs/hooks.js +57 -0
- package/build/native-tabs/hooks.js.map +1 -0
- package/build/native-tabs/index.d.ts +1 -1
- package/build/native-tabs/index.d.ts.map +1 -1
- package/build/native-tabs/index.js.map +1 -1
- package/build/native-tabs/types.d.ts +42 -55
- package/build/native-tabs/types.d.ts.map +1 -1
- package/build/native-tabs/types.js.map +1 -1
- package/build/native-tabs/utils/bottomAccessory.d.ts +9 -0
- package/build/native-tabs/utils/bottomAccessory.d.ts.map +1 -0
- package/build/native-tabs/utils/bottomAccessory.js +17 -0
- package/build/native-tabs/utils/bottomAccessory.js.map +1 -0
- package/build/native-tabs/utils/icon.d.ts +3 -0
- package/build/native-tabs/utils/icon.d.ts.map +1 -1
- package/build/native-tabs/utils/icon.js +16 -0
- package/build/native-tabs/utils/icon.js.map +1 -1
- package/build/native-tabs/utils/index.d.ts +0 -1
- package/build/native-tabs/utils/index.d.ts.map +1 -1
- package/build/native-tabs/utils/index.js +1 -4
- package/build/native-tabs/utils/index.js.map +1 -1
- package/build/native-tabs/utils/label.d.ts.map +1 -1
- package/build/native-tabs/utils/label.js +6 -2
- package/build/native-tabs/utils/label.js.map +1 -1
- package/build/native-tabs/utils/materialIconConverter.android.d.ts +4 -0
- package/build/native-tabs/utils/materialIconConverter.android.d.ts.map +1 -0
- package/build/native-tabs/utils/materialIconConverter.android.js +10 -0
- package/build/native-tabs/utils/materialIconConverter.android.js.map +1 -0
- package/build/native-tabs/utils/materialIconConverter.d.ts +4 -0
- package/build/native-tabs/utils/materialIconConverter.d.ts.map +1 -0
- package/build/native-tabs/utils/materialIconConverter.js +8 -0
- package/build/native-tabs/utils/materialIconConverter.js.map +1 -0
- package/build/navigationParams.d.ts +5 -1
- package/build/navigationParams.d.ts.map +1 -1
- package/build/navigationParams.js +32 -8
- package/build/navigationParams.js.map +1 -1
- package/build/toolbar/elements.d.ts +24 -0
- package/build/toolbar/elements.d.ts.map +1 -0
- package/build/toolbar/elements.js +36 -0
- package/build/toolbar/elements.js.map +1 -0
- package/build/toolbar/index.d.ts +9 -0
- package/build/toolbar/index.d.ts.map +1 -0
- package/build/toolbar/index.js +12 -0
- package/build/toolbar/index.js.map +1 -0
- package/build/toolbar/native.d.ts +4 -0
- package/build/toolbar/native.d.ts.map +1 -0
- package/build/toolbar/native.ios.d.ts +4 -0
- package/build/toolbar/native.ios.d.ts.map +1 -0
- package/build/toolbar/native.ios.js +21 -0
- package/build/toolbar/native.ios.js.map +1 -0
- package/build/toolbar/native.js +11 -0
- package/build/toolbar/native.js.map +1 -0
- package/build/toolbar/native.types.d.ts +30 -0
- package/build/toolbar/native.types.d.ts.map +1 -0
- package/build/toolbar/native.types.js +3 -0
- package/build/toolbar/native.types.js.map +1 -0
- package/build/useScreens.d.ts.map +1 -1
- package/build/useScreens.js +14 -0
- package/build/useScreens.js.map +1 -1
- package/build/utils/children.d.ts +7 -0
- package/build/utils/children.d.ts.map +1 -0
- package/build/utils/children.js +24 -0
- package/build/utils/children.js.map +1 -0
- package/build/utils/style.d.ts +3 -0
- package/build/utils/style.d.ts.map +1 -0
- package/build/utils/style.js +10 -0
- package/build/utils/style.js.map +1 -0
- package/build/views/Sitemap.js +3 -2
- package/build/views/Sitemap.js.map +1 -1
- package/expo-module.config.json +2 -2
- package/ios/LinkPreview/LinkPreviewNativeActionView.swift +1 -0
- package/ios/LinkPreview/LinkPreviewNativeModule.swift +49 -1
- package/ios/LinkPreview/LinkPreviewNativeNavigation.swift +132 -70
- package/ios/LinkPreview/LinkPreviewNativeView.swift +34 -17
- package/ios/LinkPreview/LinkZoomTransition.swift +227 -0
- package/ios/Toolbar/RouterToolbarHostView.swift +140 -0
- package/ios/Toolbar/RouterToolbarItemView.swift +171 -0
- package/ios/Toolbar/RouterToolbarModule.swift +102 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.module → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.module} +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.pom → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
- package/package.json +17 -14
- package/unstable-toolbar.d.ts +1 -0
- package/unstable-toolbar.js +1 -0
- package/build/layouts/stack-utils/utils.d.ts +0 -3
- package/build/layouts/stack-utils/utils.d.ts.map +0 -1
- package/build/layouts/stack-utils/utils.js +0 -8
- package/build/layouts/stack-utils/utils.js.map +0 -1
- package/build/native-tabs/utils/children.d.ts +0 -5
- package/build/native-tabs/utils/children.d.ts.map +0 -1
- package/build/native-tabs/utils/children.js +0 -15
- package/build/native-tabs/utils/children.js.map +0 -1
- package/ios/LinkPreview/LinkPreviewNativeNavigation.h +0 -50
- package/ios/LinkPreview/LinkPreviewNativeNavigation.mm +0 -164
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.module.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc-sources.jar → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc-sources.jar.md5 → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc-sources.jar.sha1 → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc-sources.jar.sha256 → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc-sources.jar.sha512 → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.aar → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.aar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.aar.md5 → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.aar.sha1 → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.aar.sha256 → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.aar.sha512 → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.aar.sha512} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DefaultRouterOptions } from '@react-navigation/native';
|
|
2
2
|
import type { PropsWithChildren } from 'react';
|
|
3
|
-
import type { ColorValue, ImageSourcePropType, TextStyle } from 'react-native';
|
|
3
|
+
import type { ColorValue, ImageSourcePropType, StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
4
4
|
import type { BottomTabsScreenProps } from 'react-native-screens';
|
|
5
5
|
import type { SFSymbol } from 'sf-symbols-typescript';
|
|
6
6
|
export type NativeScreenProps = Partial<Omit<BottomTabsScreenProps, 'tabKey' | 'isFocused'>>;
|
|
@@ -33,6 +33,8 @@ export interface NativeTabOptions extends DefaultRouterOptions {
|
|
|
33
33
|
hidden?: boolean;
|
|
34
34
|
specialEffects?: BottomTabsScreenProps['specialEffects'];
|
|
35
35
|
nativeProps?: NativeScreenProps;
|
|
36
|
+
disableAutomaticContentInsets?: boolean;
|
|
37
|
+
contentStyle?: Pick<ViewStyle, 'backgroundColor' | 'experimental_backgroundImage' | 'padding' | 'paddingTop' | 'paddingBottom' | 'paddingLeft' | 'paddingRight' | 'paddingBlock' | 'paddingBlockEnd' | 'paddingBlockStart' | 'paddingInline' | 'paddingInlineEnd' | 'paddingInlineStart' | 'paddingEnd' | 'paddingHorizontal' | 'paddingVertical' | 'paddingStart' | 'alignContent' | 'alignItems' | 'justifyContent' | 'flexDirection' | 'gap'>;
|
|
36
38
|
}
|
|
37
39
|
export type SymbolOrImageSource = {
|
|
38
40
|
/**
|
|
@@ -51,66 +53,19 @@ export type SymbolOrImageSource = {
|
|
|
51
53
|
*/
|
|
52
54
|
src?: ImageSourcePropType | Promise<ImageSourcePropType | null>;
|
|
53
55
|
};
|
|
54
|
-
type
|
|
55
|
-
export interface NativeTabsLabelStyle {
|
|
56
|
-
/**
|
|
57
|
-
* The font family of the tab label.
|
|
58
|
-
*/
|
|
59
|
-
fontFamily?: TextStyle['fontFamily'];
|
|
60
|
-
/**
|
|
61
|
-
* The font size of the tab label.
|
|
62
|
-
*/
|
|
63
|
-
fontSize?: TextStyle['fontSize'];
|
|
64
|
-
/**
|
|
65
|
-
* The font weight of the tab label.
|
|
66
|
-
*/
|
|
67
|
-
fontWeight?: NumericFontWeight | `${NumericFontWeight}`;
|
|
68
|
-
/**
|
|
69
|
-
* The font style of the tab label.
|
|
70
|
-
*/
|
|
71
|
-
fontStyle?: TextStyle['fontStyle'];
|
|
72
|
-
/**
|
|
73
|
-
* The color of the tab label.
|
|
74
|
-
*/
|
|
75
|
-
color?: TextStyle['color'];
|
|
76
|
-
}
|
|
56
|
+
export type NativeTabsLabelStyle = Pick<TextStyle, 'fontFamily' | 'fontSize' | 'fontStyle' | 'fontWeight' | 'color'>;
|
|
77
57
|
export declare const SUPPORTED_BLUR_EFFECTS: readonly ["none", "systemDefault", "extraLight", "light", "dark", "regular", "prominent", "systemUltraThinMaterial", "systemThinMaterial", "systemMaterial", "systemThickMaterial", "systemChromeMaterial", "systemUltraThinMaterialLight", "systemThinMaterialLight", "systemMaterialLight", "systemThickMaterialLight", "systemChromeMaterialLight", "systemUltraThinMaterialDark", "systemThinMaterialDark", "systemMaterialDark", "systemThickMaterialDark", "systemChromeMaterialDark"];
|
|
78
58
|
/**
|
|
79
59
|
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiblureffect/style)
|
|
80
60
|
*/
|
|
81
61
|
export type NativeTabsBlurEffect = (typeof SUPPORTED_BLUR_EFFECTS)[number];
|
|
82
|
-
/**
|
|
83
|
-
* @platform android
|
|
84
|
-
* @platform web
|
|
85
|
-
*/
|
|
86
|
-
export interface NativeTabsActiveStyleType {
|
|
87
|
-
/**
|
|
88
|
-
* @platform android
|
|
89
|
-
* @platform web
|
|
90
|
-
*/
|
|
91
|
-
color?: ColorValue;
|
|
92
|
-
/**
|
|
93
|
-
* @platform android
|
|
94
|
-
* @platform web
|
|
95
|
-
*/
|
|
96
|
-
fontSize?: TextStyle['fontSize'];
|
|
97
|
-
/**
|
|
98
|
-
* @platform android
|
|
99
|
-
*/
|
|
100
|
-
iconColor?: ColorValue;
|
|
101
|
-
/**
|
|
102
|
-
* @platform android
|
|
103
|
-
* @platform web
|
|
104
|
-
*/
|
|
105
|
-
indicatorColor?: ColorValue;
|
|
106
|
-
}
|
|
107
62
|
export interface NativeTabsProps extends PropsWithChildren {
|
|
108
63
|
/**
|
|
109
64
|
* The style of the every tab label in the tab bar.
|
|
110
65
|
*/
|
|
111
|
-
labelStyle?: NativeTabsLabelStyle | {
|
|
112
|
-
default?: NativeTabsLabelStyle
|
|
113
|
-
selected?: NativeTabsLabelStyle
|
|
66
|
+
labelStyle?: StyleProp<NativeTabsLabelStyle> | {
|
|
67
|
+
default?: StyleProp<NativeTabsLabelStyle>;
|
|
68
|
+
selected?: StyleProp<NativeTabsLabelStyle>;
|
|
114
69
|
};
|
|
115
70
|
/**
|
|
116
71
|
* The color of every tab icon in the tab bar.
|
|
@@ -133,6 +88,12 @@ export interface NativeTabsProps extends PropsWithChildren {
|
|
|
133
88
|
* The background color of every badge in the tab bar.
|
|
134
89
|
*/
|
|
135
90
|
badgeBackgroundColor?: ColorValue;
|
|
91
|
+
/**
|
|
92
|
+
* When set to `true`, hides the tab bar.
|
|
93
|
+
*
|
|
94
|
+
* @default false
|
|
95
|
+
*/
|
|
96
|
+
hidden?: boolean;
|
|
136
97
|
/**
|
|
137
98
|
* Specifies the minimize behavior for the tab bar.
|
|
138
99
|
*
|
|
@@ -147,7 +108,7 @@ export interface NativeTabsProps extends PropsWithChildren {
|
|
|
147
108
|
* - `onScrollUp` - the tab bar minimizes when scrolling up and expands
|
|
148
109
|
* when scrolling back down
|
|
149
110
|
*
|
|
150
|
-
* @see The supported values correspond to the official [
|
|
111
|
+
* @see The supported values correspond to the official [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior).
|
|
151
112
|
*
|
|
152
113
|
* @default automatic
|
|
153
114
|
*
|
|
@@ -230,7 +191,10 @@ export interface NativeTabsProps extends PropsWithChildren {
|
|
|
230
191
|
*/
|
|
231
192
|
badgeTextColor?: ColorValue;
|
|
232
193
|
}
|
|
233
|
-
export interface
|
|
194
|
+
export interface InternalNativeTabsProps extends NativeTabsProps {
|
|
195
|
+
nonTriggerChildren?: React.ReactNode;
|
|
196
|
+
}
|
|
197
|
+
export interface NativeTabsViewProps extends Omit<InternalNativeTabsProps, 'labelStyle' | 'iconColor' | 'backgroundColor' | 'badgeBackgroundColor' | 'blurEffect' | 'indicatorColor' | 'badgeTextColor'> {
|
|
234
198
|
focusedIndex: number;
|
|
235
199
|
tabs: NativeTabsViewTabItem[];
|
|
236
200
|
onTabChange: (tabKey: string) => void;
|
|
@@ -310,10 +274,33 @@ export interface NativeTabTriggerProps {
|
|
|
310
274
|
* properties will override the system icon, but the system-defined title cannot
|
|
311
275
|
* be customized.
|
|
312
276
|
*
|
|
313
|
-
* @see
|
|
277
|
+
* @see The supported values correspond to the official [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/systemitem).
|
|
314
278
|
* @platform ios
|
|
315
279
|
*/
|
|
316
280
|
role?: NativeTabsTabBarItemRole;
|
|
281
|
+
/**
|
|
282
|
+
* The default behavior differs between iOS and Android.
|
|
283
|
+
*
|
|
284
|
+
* On **Android**, the content of a native tabs screen is automatically wrapped in a `SafeAreaView`,
|
|
285
|
+
* and the **bottom** inset is applied. Other insets must be handled manually.
|
|
286
|
+
*
|
|
287
|
+
* On **iOS**, the first scroll view nested inside a native tabs screen has
|
|
288
|
+
* [automatic content inset adjustment](https://reactnative.dev/docs/scrollview#contentinsetadjustmentbehavior-ios) enabled
|
|
289
|
+
*
|
|
290
|
+
* When this property is set to `true`, automatic content inset adjustment is disabled for the screen
|
|
291
|
+
* and must be managed manually. You can use `SafeAreaView` from `react-native-screens/experimental`
|
|
292
|
+
* to handle safe area insets.
|
|
293
|
+
*
|
|
294
|
+
* @platform android
|
|
295
|
+
* @platform ios
|
|
296
|
+
*/
|
|
297
|
+
disableAutomaticContentInsets?: boolean;
|
|
298
|
+
/**
|
|
299
|
+
* The style applied to the content of the tab
|
|
300
|
+
*
|
|
301
|
+
* Note: Only certain style properties are supported.
|
|
302
|
+
*/
|
|
303
|
+
contentStyle?: NativeTabOptions['contentStyle'];
|
|
317
304
|
}
|
|
318
305
|
declare const SUPPORTED_TAB_BAR_ITEM_ROLES: readonly ["bookmarks", "contacts", "downloads", "favorites", "featured", "history", "more", "mostRecent", "mostViewed", "recents", "search", "topRated"];
|
|
319
306
|
export type NativeTabsTabBarItemRole = (typeof SUPPORTED_TAB_BAR_ITEM_ROLES)[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/native-tabs/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/native-tab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;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,wBAAwB,CAAC;IAChC;;;;;;;;;;;;;;;OAeG;IACH,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC;;;;OAIG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,QAAA,MAAM,4BAA4B,0JAaxB,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/native-tabs/types.ts"],"names":[],"mappings":";;;AAoFa,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;AA4LE,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;AAuEX,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 { DefaultRouterOptions } 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 type NativeScreenProps = Partial<Omit<BottomTabsScreenProps, 'tabKey' | 'isFocused'>>;\n\nexport interface NativeTabOptions extends DefaultRouterOptions {\n icon?: SymbolOrImageSource;\n selectedIcon?: SymbolOrImageSource;\n title?: string;\n badgeValue?: string;\n selectedLabelStyle?: NativeTabsLabelStyle;\n labelStyle?: NativeTabsLabelStyle;\n role?: NativeTabsTabBarItemRole;\n selectedIconColor?: ColorValue;\n selectedBadgeBackgroundColor?: ColorValue;\n badgeBackgroundColor?: ColorValue;\n badgeTextColor?: ColorValue;\n backgroundColor?: ColorValue;\n blurEffect?: NativeTabsBlurEffect;\n shadowColor?: ColorValue;\n iconColor?: ColorValue;\n disableTransparentOnScrollEdge?: boolean;\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n selectedTitlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n indicatorColor?: ColorValue;\n hidden?: boolean;\n specialEffects?: BottomTabsScreenProps['specialEffects'];\n nativeProps?: NativeScreenProps;\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 | null>;\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?:\n | NativeTabsLabelStyle\n | {\n default?: NativeTabsLabelStyle;\n selected?: NativeTabsLabelStyle;\n };\n // disabledLabelStyle?: NativeTabsLabelStyle;\n /**\n * The color of every tab icon in the tab bar.\n */\n iconColor?: ColorValue | { default?: ColorValue; selected?: 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;\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 * The color of the shadow.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarappearance/shadowcolor)\n *\n * @platform iOS\n */\n shadowColor?: 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 * 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 * When set to `true`, enables the sidebarAdaptable tab bar style on iPadOS and macOS. This prop has no effect on iPhone.\n *\n * @platform iOS 18+\n */\n sidebarAdaptable?: 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\n extends Omit<\n NativeTabsProps,\n | 'labelStyle'\n | 'iconColor'\n | 'backgroundColor'\n | 'badgeBackgroundColor'\n | 'blurEffect'\n | 'indicatorColor'\n | 'badgeTextColor'\n > {\n focusedIndex: number;\n tabs: NativeTabsViewTabItem[];\n onTabChange: (tabKey: string) => void;\n}\n\nexport interface NativeTabsViewTabItem {\n options: NativeTabOptions;\n routeKey: string;\n name: string;\n contentRenderer: () => React.ReactNode;\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 * > **Note**: Marking a tab as `hidden` means it cannot be navigated to in any way.\n */\n hidden?: boolean;\n /**\n * Props passed to the underlying native tab screen implementation.\n * Use this to configure props not directly exposed by Expo Router, but available in `react-native-screens`.\n *\n * > **Note**: This will override any other props set by Expo Router and may lead to unexpected behavior.\n *\n * > **Note**: This is an unstable API and may change or be removed in minor versions.\n *\n * @platform android\n * @platform iOS\n */\n unstable_nativeProps?: NativeScreenProps;\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"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/native-tabs/types.ts"],"names":[],"mappings":";;;AAgGa,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;AA2KE,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;AA8FX,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 { DefaultRouterOptions } from '@react-navigation/native';\nimport type { PropsWithChildren } from 'react';\nimport type {\n ColorValue,\n ImageSourcePropType,\n StyleProp,\n TextStyle,\n ViewStyle,\n} from 'react-native';\nimport type { BottomTabsScreenProps } from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nexport type NativeScreenProps = Partial<Omit<BottomTabsScreenProps, 'tabKey' | 'isFocused'>>;\n\nexport interface NativeTabOptions extends DefaultRouterOptions {\n icon?: SymbolOrImageSource;\n selectedIcon?: SymbolOrImageSource;\n title?: string;\n badgeValue?: string;\n selectedLabelStyle?: NativeTabsLabelStyle;\n labelStyle?: NativeTabsLabelStyle;\n role?: NativeTabsTabBarItemRole;\n selectedIconColor?: ColorValue;\n selectedBadgeBackgroundColor?: ColorValue;\n badgeBackgroundColor?: ColorValue;\n badgeTextColor?: ColorValue;\n backgroundColor?: ColorValue;\n blurEffect?: NativeTabsBlurEffect;\n shadowColor?: ColorValue;\n iconColor?: ColorValue;\n disableTransparentOnScrollEdge?: boolean;\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n selectedTitlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n indicatorColor?: ColorValue;\n hidden?: boolean;\n specialEffects?: BottomTabsScreenProps['specialEffects'];\n nativeProps?: NativeScreenProps;\n disableAutomaticContentInsets?: boolean;\n contentStyle?: Pick<\n ViewStyle,\n | 'backgroundColor'\n | 'experimental_backgroundImage'\n | 'padding'\n | 'paddingTop'\n | 'paddingBottom'\n | 'paddingLeft'\n | 'paddingRight'\n | 'paddingBlock'\n | 'paddingBlockEnd'\n | 'paddingBlockStart'\n | 'paddingInline'\n | 'paddingInlineEnd'\n | 'paddingInlineStart'\n | 'paddingEnd'\n | 'paddingHorizontal'\n | 'paddingVertical'\n | 'paddingStart'\n | 'alignContent'\n | 'alignItems'\n | 'justifyContent'\n | 'flexDirection'\n | 'gap'\n >;\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 | null>;\n };\n\nexport type NativeTabsLabelStyle = Pick<\n TextStyle,\n 'fontFamily' | 'fontSize' | 'fontStyle' | 'fontWeight' | '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\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?:\n | StyleProp<NativeTabsLabelStyle>\n | {\n default?: StyleProp<NativeTabsLabelStyle>;\n selected?: StyleProp<NativeTabsLabelStyle>;\n };\n /**\n * The color of every tab icon in the tab bar.\n */\n iconColor?: ColorValue | { default?: ColorValue; selected?: 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;\n /**\n * The background color of every badge in the tab bar.\n */\n badgeBackgroundColor?: ColorValue;\n /**\n * When set to `true`, hides the tab bar.\n *\n * @default false\n */\n hidden?: boolean;\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 [Apple 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 * The color of the shadow.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarappearance/shadowcolor)\n *\n * @platform iOS\n */\n shadowColor?: 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 * 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 * When set to `true`, enables the sidebarAdaptable tab bar style on iPadOS and macOS. This prop has no effect on iPhone.\n *\n * @platform iOS 18+\n */\n sidebarAdaptable?: 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}\n\nexport interface InternalNativeTabsProps extends NativeTabsProps {\n nonTriggerChildren?: React.ReactNode;\n}\nexport interface NativeTabsViewProps\n extends Omit<\n InternalNativeTabsProps,\n | 'labelStyle'\n | 'iconColor'\n | 'backgroundColor'\n | 'badgeBackgroundColor'\n | 'blurEffect'\n | 'indicatorColor'\n | 'badgeTextColor'\n > {\n focusedIndex: number;\n tabs: NativeTabsViewTabItem[];\n onTabChange: (tabKey: string) => void;\n}\n\nexport interface NativeTabsViewTabItem {\n options: NativeTabOptions;\n routeKey: string;\n name: string;\n contentRenderer: () => React.ReactNode;\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 * > **Note**: Marking a tab as `hidden` means it cannot be navigated to in any way.\n */\n hidden?: boolean;\n /**\n * Props passed to the underlying native tab screen implementation.\n * Use this to configure props not directly exposed by Expo Router, but available in `react-native-screens`.\n *\n * > **Note**: This will override any other props set by Expo Router and may lead to unexpected behavior.\n *\n * > **Note**: This is an unstable API and may change or be removed in minor versions.\n *\n * @platform android\n * @platform iOS\n */\n unstable_nativeProps?: NativeScreenProps;\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 The supported values correspond to the official [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/systemitem).\n * @platform ios\n */\n role?: NativeTabsTabBarItemRole;\n /**\n * The default behavior differs between iOS and Android.\n *\n * On **Android**, the content of a native tabs screen is automatically wrapped in a `SafeAreaView`,\n * and the **bottom** inset is applied. Other insets must be handled manually.\n *\n * On **iOS**, the first scroll view nested inside a native tabs screen has\n * [automatic content inset adjustment](https://reactnative.dev/docs/scrollview#contentinsetadjustmentbehavior-ios) enabled\n *\n * When this property is set to `true`, automatic content inset adjustment is disabled for the screen\n * and must be managed manually. You can use `SafeAreaView` from `react-native-screens/experimental`\n * to handle safe area insets.\n *\n * @platform android\n * @platform ios\n */\n disableAutomaticContentInsets?: boolean;\n /**\n * The style applied to the content of the tab\n *\n * Note: Only certain style properties are supported.\n */\n contentStyle?: NativeTabOptions['contentStyle'];\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"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { BottomAccessoryFn } from 'react-native-screens';
|
|
3
|
+
import type { NativeTabsBottomAccessoryProps } from '../common/elements';
|
|
4
|
+
/**
|
|
5
|
+
* Converts `<NativeTabs.BottomAccessory>` component into a function,
|
|
6
|
+
* which can be used by `react-native-screens` to render the accessory.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useBottomAccessoryFunctionFromBottomAccessories(bottomAccessory: ReactElement<NativeTabsBottomAccessoryProps, string | React.JSXElementConstructor<any>> | undefined): BottomAccessoryFn | undefined;
|
|
9
|
+
//# sourceMappingURL=bottomAccessory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bottomAccessory.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/bottomAccessory.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAGzE;;;GAGG;AACH,wBAAgB,+CAA+C,CAC7D,eAAe,EACX,YAAY,CAAC,8BAA8B,EAAE,MAAM,GAAG,KAAK,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GACvF,SAAS,GACZ,iBAAiB,GAAG,SAAS,CAY/B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useBottomAccessoryFunctionFromBottomAccessories = useBottomAccessoryFunctionFromBottomAccessories;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const hooks_1 = require("../hooks");
|
|
6
|
+
/**
|
|
7
|
+
* Converts `<NativeTabs.BottomAccessory>` component into a function,
|
|
8
|
+
* which can be used by `react-native-screens` to render the accessory.
|
|
9
|
+
*/
|
|
10
|
+
function useBottomAccessoryFunctionFromBottomAccessories(bottomAccessory) {
|
|
11
|
+
return (0, react_1.useMemo)(() => bottomAccessory
|
|
12
|
+
? (environment) => (<hooks_1.BottomAccessoryPlacementContext value={environment}>
|
|
13
|
+
{bottomAccessory.props.children}
|
|
14
|
+
</hooks_1.BottomAccessoryPlacementContext>)
|
|
15
|
+
: undefined, [bottomAccessory]);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=bottomAccessory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bottomAccessory.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/bottomAccessory.tsx"],"names":[],"mappings":";;AAUA,0GAgBC;AA1BD,iCAAmD;AAInD,oCAA2D;AAE3D;;;GAGG;AACH,SAAgB,+CAA+C,CAC7D,eAEa;IAEb,OAAO,IAAA,eAAO,EACZ,GAAG,EAAE,CACH,eAAe;QACb,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CACf,CAAC,uCAA+B,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAClD;cAAA,CAAC,eAAe,CAAC,KAAK,CAAC,QAAQ,CACjC;YAAA,EAAE,uCAA+B,CAAC,CACnC;QACH,CAAC,CAAC,SAAS,EACf,CAAC,eAAe,CAAC,CAClB,CAAC;AACJ,CAAC","sourcesContent":["import { useMemo, type ReactElement } from 'react';\nimport type { BottomAccessoryFn } from 'react-native-screens';\n\nimport type { NativeTabsBottomAccessoryProps } from '../common/elements';\nimport { BottomAccessoryPlacementContext } from '../hooks';\n\n/**\n * Converts `<NativeTabs.BottomAccessory>` component into a function,\n * which can be used by `react-native-screens` to render the accessory.\n */\nexport function useBottomAccessoryFunctionFromBottomAccessories(\n bottomAccessory:\n | ReactElement<NativeTabsBottomAccessoryProps, string | React.JSXElementConstructor<any>>\n | undefined\n): BottomAccessoryFn | undefined {\n return useMemo<BottomAccessoryFn | undefined>(\n () =>\n bottomAccessory\n ? (environment) => (\n <BottomAccessoryPlacementContext value={environment}>\n {bottomAccessory.props.children}\n </BottomAccessoryPlacementContext>\n )\n : undefined,\n [bottomAccessory]\n );\n}\n"]}
|
|
@@ -21,5 +21,8 @@ export declare function useAwaitedScreensIcon(icon: NativeTabOptions['icon']): {
|
|
|
21
21
|
export declare function convertOptionsIconToRNScreensPropsIcon(icon: AwaitedIcon | undefined): BottomTabsScreenProps['icon'];
|
|
22
22
|
export declare function convertOptionsIconToIOSPropsIcon(icon: AwaitedIcon | undefined): PlatformIconIOS | undefined;
|
|
23
23
|
export declare function convertOptionsIconToAndroidPropsIcon(icon: AwaitedIcon): PlatformIconAndroid | undefined;
|
|
24
|
+
export declare function convertComponentSrcToImageSource(src: React.ReactElement): {
|
|
25
|
+
src: Promise<ImageSourcePropType | null>;
|
|
26
|
+
} | undefined;
|
|
24
27
|
export {};
|
|
25
28
|
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/icon.ts"],"names":[],"mappings":"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BAAmB,GAAG,SAAS,CAWjC;AAED,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,KAAK,CAAC,YAAY;;cAUvE"}
|
|
@@ -5,7 +5,10 @@ exports.useAwaitedScreensIcon = useAwaitedScreensIcon;
|
|
|
5
5
|
exports.convertOptionsIconToRNScreensPropsIcon = convertOptionsIconToRNScreensPropsIcon;
|
|
6
6
|
exports.convertOptionsIconToIOSPropsIcon = convertOptionsIconToIOSPropsIcon;
|
|
7
7
|
exports.convertOptionsIconToAndroidPropsIcon = convertOptionsIconToAndroidPropsIcon;
|
|
8
|
+
exports.convertComponentSrcToImageSource = convertComponentSrcToImageSource;
|
|
8
9
|
const react_1 = require("react");
|
|
10
|
+
const children_1 = require("../../utils/children");
|
|
11
|
+
const elements_1 = require("../common/elements");
|
|
9
12
|
function convertIconColorPropToObject(iconColor) {
|
|
10
13
|
if (iconColor) {
|
|
11
14
|
if (typeof iconColor === 'object' && ('default' in iconColor || 'selected' in iconColor)) {
|
|
@@ -74,4 +77,17 @@ function convertOptionsIconToAndroidPropsIcon(icon) {
|
|
|
74
77
|
}
|
|
75
78
|
return undefined;
|
|
76
79
|
}
|
|
80
|
+
function convertComponentSrcToImageSource(src) {
|
|
81
|
+
if ((0, children_1.isChildOfType)(src, elements_1.NativeTabsTriggerVectorIcon)) {
|
|
82
|
+
const props = src.props;
|
|
83
|
+
return { src: props.family.getImageSource(props.name, 24, 'white') };
|
|
84
|
+
}
|
|
85
|
+
else if ((0, children_1.isChildOfType)(src, elements_1.NativeTabsTriggerPromiseIcon)) {
|
|
86
|
+
return { src: src.props.loader() };
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
console.warn('Only VectorIcon is supported as a React element in Icon.src');
|
|
90
|
+
}
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
77
93
|
//# sourceMappingURL=icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/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AAC,QAAQ;SACpB,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;QACtC,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;IACxD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAgB,gCAAgC,CAAC,GAAuB;IACtE,IAAI,IAAA,wBAAa,EAAC,GAAG,EAAE,sCAA2B,CAAC,EAAE,CAAC;QACpD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;QACxB,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC;IACvE,CAAC;SAAM,IAAI,IAAA,wBAAa,EAAC,GAAG,EAAE,uCAA4B,CAAC,EAAE,CAAC;QAC5D,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;IACrC,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { useEffect, useMemo, useState } from 'react';\nimport type { ColorValue, ImageSourcePropType } from 'react-native';\nimport type {\n BottomTabsScreenProps,\n PlatformIconAndroid,\n PlatformIconIOS,\n} from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport { isChildOfType } from '../../utils/children';\nimport { NativeTabsTriggerPromiseIcon, NativeTabsTriggerVectorIcon } from '../common/elements';\nimport type { NativeTabOptions, NativeTabsProps } from '../types';\n\nexport function convertIconColorPropToObject(iconColor: NativeTabsProps['iconColor']): {\n default?: ColorValue;\n selected?: ColorValue;\n} {\n if (iconColor) {\n if (typeof iconColor === 'object' && ('default' in iconColor || 'selected' in iconColor)) {\n return iconColor;\n }\n return {\n default: iconColor as ColorValue,\n };\n }\n return {};\n}\n\ntype AwaitedIcon =\n | {\n sf?: SFSymbol;\n drawable?: string;\n }\n | {\n src?: ImageSourcePropType;\n };\n\nexport function useAwaitedScreensIcon(icon: NativeTabOptions['icon']) {\n const src = icon && typeof icon === 'object' && 'src' in icon ? icon.src : undefined;\n const [awaitedIcon, setAwaitedIcon] = useState<AwaitedIcon | undefined>(undefined);\n\n useEffect(() => {\n const loadIcon = async () => {\n if (src && src instanceof Promise) {\n const awaitedSrc = await src;\n if (awaitedSrc) {\n const currentAwaitedIcon = { src: awaitedSrc };\n setAwaitedIcon(currentAwaitedIcon);\n }\n }\n };\n loadIcon();\n // Checking `src` rather then icon here, to avoid unnecessary re-renders\n // The icon object can be recreated, while src should stay the same\n // In this case as we control `VectorIcon`, it will only change if `family` or `name` props change\n // So we should be safe with promise resolving\n }, [src]);\n\n return useMemo(() => (isAwaitedIcon(icon) ? icon : awaitedIcon), [awaitedIcon, icon]);\n}\n\nfunction isAwaitedIcon(icon: NativeTabOptions['icon']): icon is AwaitedIcon {\n return !icon || !('src' in icon && icon.src instanceof Promise);\n}\n\nexport function convertOptionsIconToRNScreensPropsIcon(\n icon: AwaitedIcon | undefined\n): BottomTabsScreenProps['icon'] {\n if (!icon) {\n return undefined;\n }\n return {\n ios: convertOptionsIconToIOSPropsIcon(icon),\n android: convertOptionsIconToAndroidPropsIcon(icon),\n };\n}\n\nexport function convertOptionsIconToIOSPropsIcon(\n icon: AwaitedIcon | undefined\n): PlatformIconIOS | undefined {\n if (icon && 'sf' in icon && icon.sf) {\n return {\n type: 'sfSymbol',\n name: icon.sf,\n };\n }\n if (icon && 'src' in icon && icon.src) {\n return { type: 'templateSource', templateSource: icon.src };\n }\n return undefined;\n}\n\nexport function convertOptionsIconToAndroidPropsIcon(\n icon: AwaitedIcon\n): PlatformIconAndroid | undefined {\n if (icon && 'drawable' in icon && icon.drawable) {\n return {\n type: 'drawableResource',\n name: icon.drawable,\n };\n }\n if (icon && 'src' in icon && icon.src) {\n return { type: 'imageSource', imageSource: icon.src };\n }\n return undefined;\n}\n\nexport function convertComponentSrcToImageSource(src: React.ReactElement) {\n if (isChildOfType(src, NativeTabsTriggerVectorIcon)) {\n const props = src.props;\n return { src: props.family.getImageSource(props.name, 24, 'white') };\n } else if (isChildOfType(src, NativeTabsTriggerPromiseIcon)) {\n return { src: src.props.loader() };\n } else {\n console.warn('Only VectorIcon is supported as a React element in Icon.src');\n }\n return undefined;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertIconColorPropToObject = exports.
|
|
3
|
+
exports.convertIconColorPropToObject = exports.convertLabelStylePropToObject = void 0;
|
|
4
4
|
var label_1 = require("./label");
|
|
5
5
|
Object.defineProperty(exports, "convertLabelStylePropToObject", { enumerable: true, get: function () { return label_1.convertLabelStylePropToObject; } });
|
|
6
|
-
var children_1 = require("./children");
|
|
7
|
-
Object.defineProperty(exports, "filterAllowedChildrenElements", { enumerable: true, get: function () { return children_1.filterAllowedChildrenElements; } });
|
|
8
|
-
Object.defineProperty(exports, "isChildOfType", { enumerable: true, get: function () { return children_1.isChildOfType; } });
|
|
9
6
|
var icon_1 = require("./icon");
|
|
10
7
|
Object.defineProperty(exports, "convertIconColorPropToObject", { enumerable: true, get: function () { return icon_1.convertIconColorPropToObject; } });
|
|
11
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/index.ts"],"names":[],"mappings":";;;AAAA,iCAAwD;AAA/C,sHAAA,6BAA6B,OAAA;AACtC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/index.ts"],"names":[],"mappings":";;;AAAA,iCAAwD;AAA/C,sHAAA,6BAA6B,OAAA;AACtC,+BAAsD;AAA7C,oHAAA,4BAA4B,OAAA","sourcesContent":["export { convertLabelStylePropToObject } from './label';\nexport { convertIconColorPropToObject } from './icon';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/label.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/label.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEtE,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,GAAG;IACxF,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC,CAaA"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertLabelStylePropToObject = convertLabelStylePropToObject;
|
|
4
|
+
const react_native_1 = require("react-native");
|
|
4
5
|
function convertLabelStylePropToObject(labelStyle) {
|
|
5
6
|
if (labelStyle) {
|
|
6
7
|
if (typeof labelStyle === 'object' && ('default' in labelStyle || 'selected' in labelStyle)) {
|
|
7
|
-
return
|
|
8
|
+
return {
|
|
9
|
+
default: labelStyle.default ? react_native_1.StyleSheet.flatten(labelStyle.default) : undefined,
|
|
10
|
+
selected: labelStyle.selected ? react_native_1.StyleSheet.flatten(labelStyle.selected) : undefined,
|
|
11
|
+
};
|
|
8
12
|
}
|
|
9
13
|
return {
|
|
10
|
-
default: labelStyle,
|
|
14
|
+
default: react_native_1.StyleSheet.flatten(labelStyle),
|
|
11
15
|
};
|
|
12
16
|
}
|
|
13
17
|
return {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/label.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/label.ts"],"names":[],"mappings":";;AAIA,sEAgBC;AApBD,+CAA0D;AAI1D,SAAgB,6BAA6B,CAAC,UAAyC;IAIrF,IAAI,UAAU,EAAE,CAAC;QACf,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,SAAS,IAAI,UAAU,IAAI,UAAU,IAAI,UAAU,CAAC,EAAE,CAAC;YAC5F,OAAO;gBACL,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAU,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;gBAChF,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,yBAAU,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;aACpF,CAAC;QACJ,CAAC;QACD,OAAO;YACL,OAAO,EAAE,yBAAU,CAAC,OAAO,CAAC,UAA6C,CAAC;SAC3E,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import { StyleSheet, type StyleProp } from 'react-native';\n\nimport type { NativeTabsLabelStyle, NativeTabsProps } from '../types';\n\nexport function convertLabelStylePropToObject(labelStyle: NativeTabsProps['labelStyle']): {\n default?: NativeTabsLabelStyle;\n selected?: NativeTabsLabelStyle;\n} {\n if (labelStyle) {\n if (typeof labelStyle === 'object' && ('default' in labelStyle || 'selected' in labelStyle)) {\n return {\n default: labelStyle.default ? StyleSheet.flatten(labelStyle.default) : undefined,\n selected: labelStyle.selected ? StyleSheet.flatten(labelStyle.selected) : undefined,\n };\n }\n return {\n default: StyleSheet.flatten(labelStyle as StyleProp<NativeTabsLabelStyle>),\n };\n }\n return {};\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { convertComponentSrcToImageSource } from './icon';
|
|
2
|
+
import { type MaterialIcon } from '../common/elements';
|
|
3
|
+
export declare function convertMaterialIconNameToImageSource(name: MaterialIcon['md']): ReturnType<typeof convertComponentSrcToImageSource>;
|
|
4
|
+
//# sourceMappingURL=materialIconConverter.android.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materialIconConverter.android.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/materialIconConverter.android.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gCAAgC,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAgC,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAErF,wBAAgB,oCAAoC,CAClD,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,GACvB,UAAU,CAAC,OAAO,gCAAgC,CAAC,CAMrD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertMaterialIconNameToImageSource = convertMaterialIconNameToImageSource;
|
|
4
|
+
const expo_symbols_1 = require("expo-symbols");
|
|
5
|
+
const icon_1 = require("./icon");
|
|
6
|
+
const elements_1 = require("../common/elements");
|
|
7
|
+
function convertMaterialIconNameToImageSource(name) {
|
|
8
|
+
return (0, icon_1.convertComponentSrcToImageSource)(<elements_1.NativeTabsTriggerPromiseIcon loader={() => (0, expo_symbols_1.unstable_getMaterialSymbolSourceAsync)(name, 24, 'white')}/>);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=materialIconConverter.android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materialIconConverter.android.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/materialIconConverter.android.tsx"],"names":[],"mappings":";;AAKA,oFAQC;AAbD,+CAAqE;AAErE,iCAA0D;AAC1D,iDAAqF;AAErF,SAAgB,oCAAoC,CAClD,IAAwB;IAExB,OAAO,IAAA,uCAAgC,EACrC,CAAC,uCAA4B,CAC3B,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,IAAA,oDAAqC,EAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC,EACvE,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { unstable_getMaterialSymbolSourceAsync } from 'expo-symbols';\n\nimport { convertComponentSrcToImageSource } from './icon';\nimport { NativeTabsTriggerPromiseIcon, type MaterialIcon } from '../common/elements';\n\nexport function convertMaterialIconNameToImageSource(\n name: MaterialIcon['md']\n): ReturnType<typeof convertComponentSrcToImageSource> {\n return convertComponentSrcToImageSource(\n <NativeTabsTriggerPromiseIcon\n loader={() => unstable_getMaterialSymbolSourceAsync(name, 24, 'white')}\n />\n );\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { convertComponentSrcToImageSource } from './icon';
|
|
2
|
+
import type { MaterialIcon } from '../common/elements';
|
|
3
|
+
export declare function convertMaterialIconNameToImageSource(name: MaterialIcon['md']): ReturnType<typeof convertComponentSrcToImageSource>;
|
|
4
|
+
//# sourceMappingURL=materialIconConverter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materialIconConverter.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/materialIconConverter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,QAAQ,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,wBAAgB,oCAAoC,CAClD,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,GACvB,UAAU,CAAC,OAAO,gCAAgC,CAAC,CAKrD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertMaterialIconNameToImageSource = convertMaterialIconNameToImageSource;
|
|
4
|
+
function convertMaterialIconNameToImageSource(name) {
|
|
5
|
+
console.warn('Using convertMaterialIconNameToImageSource on unsupported platform. This is most likely an internal expo router bug.');
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=materialIconConverter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materialIconConverter.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/materialIconConverter.tsx"],"names":[],"mappings":";;AAGA,oFAOC;AAPD,SAAgB,oCAAoC,CAClD,IAAwB;IAExB,OAAO,CAAC,IAAI,CACV,sHAAsH,CACvH,CAAC;IACF,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { convertComponentSrcToImageSource } from './icon';\nimport type { MaterialIcon } from '../common/elements';\n\nexport function convertMaterialIconNameToImageSource(\n name: MaterialIcon['md']\n): ReturnType<typeof convertComponentSrcToImageSource> {\n console.warn(\n 'Using convertMaterialIconNameToImageSource on unsupported platform. This is most likely an internal expo router bug.'\n );\n return undefined;\n}\n"]}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
export declare const INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME = "__internal_expo_router_no_animation";
|
|
2
2
|
export declare const INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME = "__internal__expo_router_is_preview_navigation";
|
|
3
|
-
declare const
|
|
3
|
+
export declare const INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME = "__internal_expo_router_zoom_transition_source_id";
|
|
4
|
+
export declare const INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME = "__internal_expo_router_zoom_transition_screen_id";
|
|
5
|
+
declare const internalExpoRouterParamNames: readonly ["__internal_expo_router_no_animation", "__internal__expo_router_is_preview_navigation", "__internal_expo_router_zoom_transition_source_id", "__internal_expo_router_zoom_transition_screen_id"];
|
|
4
6
|
export type InternalExpoRouterParamName = (typeof internalExpoRouterParamNames)[number];
|
|
5
7
|
export type InternalExpoRouterParams = Partial<Record<InternalExpoRouterParamName, unknown>>;
|
|
6
8
|
export declare function appendInternalExpoRouterParams(params: Record<string, unknown> | object | undefined, expoParams: InternalExpoRouterParams): Record<string, unknown> | undefined;
|
|
7
9
|
export declare function getInternalExpoRouterParams(_params: Record<string, unknown> | object | undefined): InternalExpoRouterParams;
|
|
10
|
+
export declare function hasParam(params: unknown, paramName: string): boolean;
|
|
11
|
+
export declare function removeParams(params: Record<string, unknown> | object | undefined, paramName: readonly string[]): Record<string, unknown> | object | undefined;
|
|
8
12
|
export declare function removeInternalExpoRouterParams(params: Record<string, unknown> | object): Record<string, unknown> | object;
|
|
9
13
|
export declare function removeInternalExpoRouterParams(params: Record<string, unknown> | object | undefined): Record<string, unknown> | object | undefined;
|
|
10
14
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigationParams.d.ts","sourceRoot":"","sources":["../src/navigationParams.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4CAA4C,wCAAwC,CAAC;AAClG,eAAO,MAAM,qDAAqD,kDACjB,CAAC;
|
|
1
|
+
{"version":3,"file":"navigationParams.d.ts","sourceRoot":"","sources":["../src/navigationParams.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4CAA4C,wCAAwC,CAAC;AAClG,eAAO,MAAM,qDAAqD,kDACjB,CAAC;AAClD,eAAO,MAAM,yDAAyD,qDAClB,CAAC;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|
|
3
|
-
exports.INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME = exports.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME = void 0;
|
|
3
|
+
exports.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME = exports.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME = exports.INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME = exports.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME = void 0;
|
|
4
4
|
exports.appendInternalExpoRouterParams = appendInternalExpoRouterParams;
|
|
5
5
|
exports.getInternalExpoRouterParams = getInternalExpoRouterParams;
|
|
6
|
+
exports.hasParam = hasParam;
|
|
7
|
+
exports.removeParams = removeParams;
|
|
6
8
|
exports.removeInternalExpoRouterParams = removeInternalExpoRouterParams;
|
|
7
9
|
exports.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME = '__internal_expo_router_no_animation';
|
|
8
10
|
exports.INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME = '__internal__expo_router_is_preview_navigation';
|
|
11
|
+
exports.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME = '__internal_expo_router_zoom_transition_source_id';
|
|
12
|
+
exports.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME = '__internal_expo_router_zoom_transition_screen_id';
|
|
9
13
|
const internalExpoRouterParamNames = [
|
|
10
14
|
exports.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME,
|
|
11
15
|
exports.INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME,
|
|
16
|
+
exports.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME,
|
|
17
|
+
exports.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME,
|
|
12
18
|
];
|
|
13
19
|
function appendInternalExpoRouterParams(params, expoParams) {
|
|
14
20
|
let newParams = {};
|
|
@@ -51,18 +57,36 @@ function getInternalExpoRouterParams(_params) {
|
|
|
51
57
|
}
|
|
52
58
|
return expoParams;
|
|
53
59
|
}
|
|
54
|
-
function
|
|
60
|
+
function hasParam(params, paramName) {
|
|
61
|
+
if (!!params && typeof params === 'object') {
|
|
62
|
+
const recordParams = params;
|
|
63
|
+
if (recordParams[paramName] !== undefined) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
if (recordParams.params && typeof recordParams.params === 'object') {
|
|
67
|
+
return hasParam(recordParams.params, paramName);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
function removeParams(params, paramName) {
|
|
55
73
|
if (!params) {
|
|
56
74
|
return undefined;
|
|
57
75
|
}
|
|
58
|
-
const
|
|
59
|
-
?
|
|
60
|
-
:
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
if (Object.keys(newNestedParams).length > 0) {
|
|
76
|
+
const nestedParams = 'params' in params && typeof params.params === 'object' && params.params
|
|
77
|
+
? params.params
|
|
78
|
+
: undefined;
|
|
79
|
+
const newNestedParams = nestedParams ? removeParams(nestedParams, paramName) : undefined;
|
|
80
|
+
const newParams = Object.fromEntries(Object.entries(params).filter(([key]) => !paramName.includes(key) && key !== 'params'));
|
|
81
|
+
if (Object.keys(newNestedParams ?? {}).length > 0) {
|
|
64
82
|
return { ...newParams, params: newNestedParams };
|
|
65
83
|
}
|
|
66
84
|
return newParams;
|
|
67
85
|
}
|
|
86
|
+
function removeInternalExpoRouterParams(params) {
|
|
87
|
+
if (!params) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
return removeParams(params, [...internalExpoRouterParamNames, 'params']);
|
|
91
|
+
}
|
|
68
92
|
//# sourceMappingURL=navigationParams.js.map
|