@react-navigation/elements 2.0.0-rc.2 → 2.0.0-rc.21
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/lib/commonjs/Background.js +4 -3
- package/lib/commonjs/Background.js.map +1 -1
- package/lib/commonjs/Button.js +29 -56
- package/lib/commonjs/Button.js.map +1 -1
- package/lib/commonjs/Header/Header.js +143 -62
- package/lib/commonjs/Header/Header.js.map +1 -1
- package/lib/commonjs/Header/HeaderBackButton.js +74 -76
- package/lib/commonjs/Header/HeaderBackButton.js.map +1 -1
- package/lib/commonjs/Header/HeaderBackContext.js +1 -1
- package/lib/commonjs/Header/HeaderBackground.js +9 -7
- package/lib/commonjs/Header/HeaderBackground.js.map +1 -1
- package/lib/commonjs/Header/HeaderButton.js +6 -7
- package/lib/commonjs/Header/HeaderButton.js.map +1 -1
- package/lib/commonjs/Header/HeaderHeightContext.js +1 -1
- package/lib/commonjs/Header/HeaderIcon.js +44 -0
- package/lib/commonjs/Header/HeaderIcon.js.map +1 -0
- package/lib/commonjs/Header/HeaderSearchBar.js +267 -0
- package/lib/commonjs/Header/HeaderSearchBar.js.map +1 -0
- package/lib/commonjs/Header/HeaderShownContext.js +1 -1
- package/lib/commonjs/Header/HeaderTitle.js +5 -8
- package/lib/commonjs/Header/HeaderTitle.js.map +1 -1
- package/lib/commonjs/Header/useHeaderHeight.js +1 -1
- package/lib/commonjs/Label/Label.js +6 -9
- package/lib/commonjs/Label/Label.js.map +1 -1
- package/lib/commonjs/MaskedView.android.js +1 -1
- package/lib/commonjs/MaskedView.ios.js +1 -1
- package/lib/commonjs/MaskedViewNative.js +5 -1
- package/lib/commonjs/MaskedViewNative.js.map +1 -1
- package/lib/commonjs/MissingIcon.js +6 -9
- package/lib/commonjs/MissingIcon.js.map +1 -1
- package/lib/commonjs/PlatformPressable.js +61 -6
- package/lib/commonjs/PlatformPressable.js.map +1 -1
- package/lib/commonjs/ResourceSavingView.js +19 -15
- package/lib/commonjs/ResourceSavingView.js.map +1 -1
- package/lib/commonjs/SafeAreaProviderCompat.js +26 -19
- package/lib/commonjs/SafeAreaProviderCompat.js.map +1 -1
- package/lib/commonjs/Screen.js +38 -28
- package/lib/commonjs/Screen.js.map +1 -1
- package/lib/commonjs/Text.js +6 -7
- package/lib/commonjs/Text.js.map +1 -1
- package/lib/commonjs/assets/back-icon-mask.png +0 -0
- package/lib/commonjs/assets/back-icon@4x.ios.png +0 -0
- package/lib/commonjs/assets/clear-icon.png +0 -0
- package/lib/commonjs/assets/clear-icon@1x.png +0 -0
- package/lib/commonjs/assets/clear-icon@2x.png +0 -0
- package/lib/commonjs/assets/clear-icon@3x.png +0 -0
- package/lib/commonjs/assets/clear-icon@4x.png +0 -0
- package/lib/commonjs/assets/close-icon.png +0 -0
- package/lib/commonjs/assets/close-icon@1x.png +0 -0
- package/lib/commonjs/assets/close-icon@2x.png +0 -0
- package/lib/commonjs/assets/close-icon@3x.png +0 -0
- package/lib/commonjs/assets/close-icon@4x.png +0 -0
- package/lib/commonjs/assets/search-icon.png +0 -0
- package/lib/commonjs/assets/search-icon@1x.android.png +0 -0
- package/lib/commonjs/assets/search-icon@1x.ios.png +0 -0
- package/lib/commonjs/assets/search-icon@2x.android.png +0 -0
- package/lib/commonjs/assets/search-icon@2x.ios.png +0 -0
- package/lib/commonjs/assets/search-icon@3x.android.png +0 -0
- package/lib/commonjs/assets/search-icon@3x.ios.png +0 -0
- package/lib/commonjs/assets/search-icon@4x.android.png +0 -0
- package/lib/commonjs/assets/search-icon@4x.ios.png +0 -0
- package/lib/commonjs/index.js +30 -28
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/package.json +1 -0
- package/lib/module/Background.js +6 -3
- package/lib/module/Background.js.map +1 -1
- package/lib/module/Button.js +31 -56
- package/lib/module/Button.js.map +1 -1
- package/lib/module/Header/Header.js +144 -62
- package/lib/module/Header/Header.js.map +1 -1
- package/lib/module/Header/HeaderBackButton.js +75 -76
- package/lib/module/Header/HeaderBackButton.js.map +1 -1
- package/lib/module/Header/HeaderBackContext.js +3 -1
- package/lib/module/Header/HeaderBackContext.js.map +1 -1
- package/lib/module/Header/HeaderBackground.js +11 -7
- package/lib/module/Header/HeaderBackground.js.map +1 -1
- package/lib/module/Header/HeaderButton.js +8 -5
- package/lib/module/Header/HeaderButton.js.map +1 -1
- package/lib/module/Header/HeaderHeightContext.js +3 -1
- package/lib/module/Header/HeaderHeightContext.js.map +1 -1
- package/lib/module/Header/HeaderIcon.js +39 -0
- package/lib/module/Header/HeaderIcon.js.map +1 -0
- package/lib/module/Header/HeaderSearchBar.js +260 -0
- package/lib/module/Header/HeaderSearchBar.js.map +1 -0
- package/lib/module/Header/HeaderShownContext.js +3 -1
- package/lib/module/Header/HeaderShownContext.js.map +1 -1
- package/lib/module/Header/HeaderTitle.js +7 -6
- package/lib/module/Header/HeaderTitle.js.map +1 -1
- package/lib/module/Header/getDefaultHeaderHeight.js +2 -0
- package/lib/module/Header/getDefaultHeaderHeight.js.map +1 -1
- package/lib/module/Header/getHeaderTitle.js +2 -0
- package/lib/module/Header/getHeaderTitle.js.map +1 -1
- package/lib/module/Header/useHeaderHeight.js +3 -1
- package/lib/module/Header/useHeaderHeight.js.map +1 -1
- package/lib/module/Label/Label.js +8 -7
- package/lib/module/Label/Label.js.map +1 -1
- package/lib/module/Label/getLabel.js +2 -0
- package/lib/module/Label/getLabel.js.map +1 -1
- package/lib/module/MaskedView.android.js +3 -1
- package/lib/module/MaskedView.android.js.map +1 -1
- package/lib/module/MaskedView.ios.js +3 -1
- package/lib/module/MaskedView.ios.js.map +1 -1
- package/lib/module/MaskedView.js +2 -0
- package/lib/module/MaskedView.js.map +1 -1
- package/lib/module/MaskedViewNative.js +7 -1
- package/lib/module/MaskedViewNative.js.map +1 -1
- package/lib/module/MissingIcon.js +9 -7
- package/lib/module/MissingIcon.js.map +1 -1
- package/lib/module/PlatformPressable.js +63 -6
- package/lib/module/PlatformPressable.js.map +1 -1
- package/lib/module/ResourceSavingView.js +21 -15
- package/lib/module/ResourceSavingView.js.map +1 -1
- package/lib/module/SafeAreaProviderCompat.js +28 -19
- package/lib/module/SafeAreaProviderCompat.js.map +1 -1
- package/lib/module/Screen.js +40 -28
- package/lib/module/Screen.js.map +1 -1
- package/lib/module/Text.js +7 -6
- package/lib/module/Text.js.map +1 -1
- package/lib/module/assets/back-icon-mask.png +0 -0
- package/lib/module/assets/back-icon@4x.ios.png +0 -0
- package/lib/module/assets/clear-icon.png +0 -0
- package/lib/module/assets/clear-icon@1x.png +0 -0
- package/lib/module/assets/clear-icon@2x.png +0 -0
- package/lib/module/assets/clear-icon@3x.png +0 -0
- package/lib/module/assets/clear-icon@4x.png +0 -0
- package/lib/module/assets/close-icon.png +0 -0
- package/lib/module/assets/close-icon@1x.png +0 -0
- package/lib/module/assets/close-icon@2x.png +0 -0
- package/lib/module/assets/close-icon@3x.png +0 -0
- package/lib/module/assets/close-icon@4x.png +0 -0
- package/lib/module/assets/search-icon.png +0 -0
- package/lib/module/assets/search-icon@1x.android.png +0 -0
- package/lib/module/assets/search-icon@1x.ios.png +0 -0
- package/lib/module/assets/search-icon@2x.android.png +0 -0
- package/lib/module/assets/search-icon@2x.ios.png +0 -0
- package/lib/module/assets/search-icon@3x.android.png +0 -0
- package/lib/module/assets/search-icon@3x.ios.png +0 -0
- package/lib/module/assets/search-icon@4x.android.png +0 -0
- package/lib/module/assets/search-icon@4x.ios.png +0 -0
- package/lib/module/getDefaultSidebarWidth.js +2 -0
- package/lib/module/getDefaultSidebarWidth.js.map +1 -1
- package/lib/module/getNamedContext.js +2 -0
- package/lib/module/getNamedContext.js.map +1 -1
- package/lib/module/index.js +31 -28
- package/lib/module/index.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/module/types.js +2 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/{src → commonjs/src}/Background.d.ts +1 -1
- package/lib/typescript/commonjs/src/Background.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Button.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Header/Header.d.ts +31 -0
- package/lib/typescript/commonjs/src/Header/Header.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Header/HeaderBackButton.d.ts +3 -0
- package/lib/typescript/commonjs/src/Header/HeaderBackButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Header/HeaderBackContext.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/Header/HeaderBackground.d.ts +1 -1
- package/lib/typescript/commonjs/src/Header/HeaderBackground.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/Header/HeaderButton.d.ts +1 -2
- package/lib/typescript/commonjs/src/Header/HeaderButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Header/HeaderHeightContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Header/HeaderIcon.d.ts +5 -0
- package/lib/typescript/commonjs/src/Header/HeaderIcon.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Header/HeaderSearchBar.d.ts +10 -0
- package/lib/typescript/commonjs/src/Header/HeaderSearchBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Header/HeaderShownContext.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/Header/HeaderTitle.d.ts +1 -2
- package/lib/typescript/commonjs/src/Header/HeaderTitle.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Header/getDefaultHeaderHeight.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Header/getHeaderTitle.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Header/useHeaderHeight.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/Label/Label.d.ts +1 -2
- package/lib/typescript/commonjs/src/Label/Label.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Label/getLabel.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/MaskedView.android.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/MaskedView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/MaskedView.ios.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/MaskedViewNative.d.ts +1 -1
- package/lib/typescript/commonjs/src/MaskedViewNative.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/MissingIcon.d.ts +1 -2
- package/lib/typescript/commonjs/src/MissingIcon.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/PlatformPressable.d.ts +8 -1
- package/lib/typescript/commonjs/src/PlatformPressable.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/ResourceSavingView.d.ts +1 -1
- package/lib/typescript/commonjs/src/ResourceSavingView.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/SafeAreaProviderCompat.d.ts +1 -1
- package/lib/typescript/commonjs/src/SafeAreaProviderCompat.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/Screen.d.ts +1 -1
- package/lib/typescript/commonjs/src/Screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Text.d.ts +3 -0
- package/lib/typescript/commonjs/src/Text.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/getDefaultSidebarWidth.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/getNamedContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/types.d.ts +73 -10
- package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/tsconfig.build.tsbuildinfo +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/Background.d.ts +9 -0
- package/lib/typescript/module/src/Background.d.ts.map +1 -0
- package/lib/typescript/module/src/Button.d.ts +13 -0
- package/lib/typescript/module/src/Button.d.ts.map +1 -0
- package/lib/typescript/module/src/Header/Header.d.ts +31 -0
- package/lib/typescript/module/src/Header/Header.d.ts.map +1 -0
- package/lib/typescript/module/src/Header/HeaderBackButton.d.ts +3 -0
- package/lib/typescript/module/src/Header/HeaderBackButton.d.ts.map +1 -0
- package/lib/typescript/module/src/Header/HeaderBackContext.d.ts +5 -0
- package/lib/typescript/module/src/Header/HeaderBackContext.d.ts.map +1 -0
- package/lib/typescript/module/src/Header/HeaderBackground.d.ts +9 -0
- package/lib/typescript/module/src/Header/HeaderBackground.d.ts.map +1 -0
- package/lib/typescript/module/src/Header/HeaderButton.d.ts +3 -0
- package/lib/typescript/module/src/Header/HeaderButton.d.ts.map +1 -0
- package/lib/typescript/module/src/Header/HeaderHeightContext.d.ts +2 -0
- package/lib/typescript/module/src/Header/HeaderHeightContext.d.ts.map +1 -0
- package/lib/typescript/module/src/Header/HeaderIcon.d.ts +5 -0
- package/lib/typescript/module/src/Header/HeaderIcon.d.ts.map +1 -0
- package/lib/typescript/module/src/Header/HeaderSearchBar.d.ts +10 -0
- package/lib/typescript/module/src/Header/HeaderSearchBar.d.ts.map +1 -0
- package/lib/typescript/module/src/Header/HeaderShownContext.d.ts +2 -0
- package/lib/typescript/module/src/Header/HeaderShownContext.d.ts.map +1 -0
- package/lib/typescript/module/src/Header/HeaderTitle.d.ts +9 -0
- package/lib/typescript/module/src/Header/HeaderTitle.d.ts.map +1 -0
- package/lib/typescript/module/src/Header/getDefaultHeaderHeight.d.ts +3 -0
- package/lib/typescript/module/src/Header/getDefaultHeaderHeight.d.ts.map +1 -0
- package/lib/typescript/module/src/Header/getHeaderTitle.d.ts +6 -0
- package/lib/typescript/module/src/Header/getHeaderTitle.d.ts.map +1 -0
- package/lib/typescript/module/src/Header/useHeaderHeight.d.ts +2 -0
- package/lib/typescript/module/src/Header/useHeaderHeight.d.ts.map +1 -0
- package/lib/typescript/module/src/Label/Label.d.ts +9 -0
- package/lib/typescript/module/src/Label/Label.d.ts.map +1 -0
- package/lib/typescript/module/src/Label/getLabel.d.ts +5 -0
- package/lib/typescript/module/src/Label/getLabel.d.ts.map +1 -0
- package/lib/typescript/module/src/MaskedView.android.d.ts +2 -0
- package/lib/typescript/module/src/MaskedView.android.d.ts.map +1 -0
- package/lib/typescript/module/src/MaskedView.d.ts +11 -0
- package/lib/typescript/module/src/MaskedView.d.ts.map +1 -0
- package/lib/typescript/module/src/MaskedView.ios.d.ts +2 -0
- package/lib/typescript/module/src/MaskedView.ios.d.ts.map +1 -0
- package/lib/typescript/module/src/MaskedViewNative.d.ts +11 -0
- package/lib/typescript/module/src/MaskedViewNative.d.ts.map +1 -0
- package/lib/typescript/module/src/MissingIcon.d.ts +9 -0
- package/lib/typescript/module/src/MissingIcon.d.ts.map +1 -0
- package/lib/typescript/module/src/PlatformPressable.d.ts +21 -0
- package/lib/typescript/module/src/PlatformPressable.d.ts.map +1 -0
- package/lib/typescript/module/src/ResourceSavingView.d.ts +10 -0
- package/lib/typescript/module/src/ResourceSavingView.d.ts.map +1 -0
- package/lib/typescript/module/src/SafeAreaProviderCompat.d.ts +13 -0
- package/lib/typescript/module/src/SafeAreaProviderCompat.d.ts.map +1 -0
- package/lib/typescript/module/src/Screen.d.ts +18 -0
- package/lib/typescript/module/src/Screen.d.ts.map +1 -0
- package/lib/typescript/module/src/Text.d.ts +3 -0
- package/lib/typescript/module/src/Text.d.ts.map +1 -0
- package/lib/typescript/module/src/getDefaultSidebarWidth.d.ts +4 -0
- package/lib/typescript/module/src/getDefaultSidebarWidth.d.ts.map +1 -0
- package/lib/typescript/module/src/getNamedContext.d.ts +6 -0
- package/lib/typescript/module/src/getNamedContext.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +25 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/types.d.ts +289 -0
- package/lib/typescript/module/src/types.d.ts.map +1 -0
- package/lib/typescript/module/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +42 -13
- package/src/Button.tsx +3 -40
- package/src/Header/Header.tsx +157 -60
- package/src/Header/HeaderBackButton.tsx +87 -81
- package/src/Header/HeaderBackground.tsx +3 -3
- package/src/Header/HeaderButton.tsx +0 -1
- package/src/Header/HeaderIcon.tsx +36 -0
- package/src/Header/HeaderSearchBar.tsx +283 -0
- package/src/Header/HeaderTitle.tsx +0 -1
- package/src/Label/Label.tsx +0 -1
- package/src/MissingIcon.tsx +3 -4
- package/src/PlatformPressable.tsx +71 -2
- package/src/SafeAreaProviderCompat.tsx +1 -0
- package/src/Screen.tsx +19 -14
- package/src/Text.tsx +1 -3
- package/src/assets/back-icon-mask.png +0 -0
- package/src/assets/back-icon@4x.ios.png +0 -0
- package/src/assets/clear-icon.png +0 -0
- package/src/assets/clear-icon@1x.png +0 -0
- package/src/assets/clear-icon@2x.png +0 -0
- package/src/assets/clear-icon@3x.png +0 -0
- package/src/assets/clear-icon@4x.png +0 -0
- package/src/assets/close-icon.png +0 -0
- package/src/assets/close-icon@1x.png +0 -0
- package/src/assets/close-icon@2x.png +0 -0
- package/src/assets/close-icon@3x.png +0 -0
- package/src/assets/close-icon@4x.png +0 -0
- package/src/assets/search-icon.png +0 -0
- package/src/assets/search-icon@1x.android.png +0 -0
- package/src/assets/search-icon@1x.ios.png +0 -0
- package/src/assets/search-icon@2x.android.png +0 -0
- package/src/assets/search-icon@2x.ios.png +0 -0
- package/src/assets/search-icon@3x.android.png +0 -0
- package/src/assets/search-icon@3x.ios.png +0 -0
- package/src/assets/search-icon@4x.android.png +0 -0
- package/src/assets/search-icon@4x.ios.png +0 -0
- package/src/index.tsx +11 -4
- package/src/types.tsx +77 -10
- package/lib/typescript/src/Background.d.ts.map +0 -1
- package/lib/typescript/src/Button.d.ts.map +0 -1
- package/lib/typescript/src/Header/Header.d.ts +0 -19
- package/lib/typescript/src/Header/Header.d.ts.map +0 -1
- package/lib/typescript/src/Header/HeaderBackButton.d.ts +0 -4
- package/lib/typescript/src/Header/HeaderBackButton.d.ts.map +0 -1
- package/lib/typescript/src/Header/HeaderBackContext.d.ts.map +0 -1
- package/lib/typescript/src/Header/HeaderBackground.d.ts.map +0 -1
- package/lib/typescript/src/Header/HeaderButton.d.ts.map +0 -1
- package/lib/typescript/src/Header/HeaderHeightContext.d.ts.map +0 -1
- package/lib/typescript/src/Header/HeaderShownContext.d.ts.map +0 -1
- package/lib/typescript/src/Header/HeaderTitle.d.ts.map +0 -1
- package/lib/typescript/src/Header/getDefaultHeaderHeight.d.ts.map +0 -1
- package/lib/typescript/src/Header/getHeaderTitle.d.ts.map +0 -1
- package/lib/typescript/src/Header/useHeaderHeight.d.ts.map +0 -1
- package/lib/typescript/src/Label/Label.d.ts.map +0 -1
- package/lib/typescript/src/Label/getLabel.d.ts.map +0 -1
- package/lib/typescript/src/MaskedView.android.d.ts.map +0 -1
- package/lib/typescript/src/MaskedView.d.ts.map +0 -1
- package/lib/typescript/src/MaskedView.ios.d.ts.map +0 -1
- package/lib/typescript/src/MaskedViewNative.d.ts.map +0 -1
- package/lib/typescript/src/MissingIcon.d.ts.map +0 -1
- package/lib/typescript/src/PlatformPressable.d.ts.map +0 -1
- package/lib/typescript/src/ResourceSavingView.d.ts.map +0 -1
- package/lib/typescript/src/SafeAreaProviderCompat.d.ts.map +0 -1
- package/lib/typescript/src/Screen.d.ts.map +0 -1
- package/lib/typescript/src/Text.d.ts +0 -4
- package/lib/typescript/src/Text.d.ts.map +0 -1
- package/lib/typescript/src/getDefaultSidebarWidth.d.ts.map +0 -1
- package/lib/typescript/src/getNamedContext.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/types.d.ts.map +0 -1
- /package/lib/typescript/{src → commonjs/src}/Button.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/Header/HeaderBackContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/Header/HeaderHeightContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/Header/HeaderShownContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/Header/getDefaultHeaderHeight.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/Header/getHeaderTitle.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/Header/useHeaderHeight.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/Label/getLabel.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/MaskedView.android.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/MaskedView.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/MaskedView.ios.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/getDefaultSidebarWidth.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/getNamedContext.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/index.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-navigation/elements",
|
|
3
3
|
"description": "UI Components for React Navigation",
|
|
4
|
-
"version": "2.0.0-rc.
|
|
4
|
+
"version": "2.0.0-rc.21",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
7
7
|
"react-navigation",
|
|
@@ -18,11 +18,22 @@
|
|
|
18
18
|
"url": "https://github.com/react-navigation/react-navigation/issues"
|
|
19
19
|
},
|
|
20
20
|
"homepage": "https://reactnavigation.org",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
21
|
+
"source": "./src/index.tsx",
|
|
22
|
+
"main": "./lib/commonjs/index.js",
|
|
23
|
+
"module": "./lib/module/index.js",
|
|
24
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"import": {
|
|
28
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
|
29
|
+
"default": "./lib/module/index.js"
|
|
30
|
+
},
|
|
31
|
+
"require": {
|
|
32
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
33
|
+
"default": "./lib/commonjs/index.js"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
26
37
|
"files": [
|
|
27
38
|
"src",
|
|
28
39
|
"lib",
|
|
@@ -40,35 +51,53 @@
|
|
|
40
51
|
"color": "^4.2.3"
|
|
41
52
|
},
|
|
42
53
|
"devDependencies": {
|
|
54
|
+
"@jest/globals": "^29.7.0",
|
|
43
55
|
"@react-native-masked-view/masked-view": "0.3.1",
|
|
44
|
-
"@react-navigation/native": "^7.0.0-rc.
|
|
56
|
+
"@react-navigation/native": "^7.0.0-rc.18",
|
|
45
57
|
"@testing-library/react-native": "^12.4.3",
|
|
46
58
|
"@types/react": "~18.2.79",
|
|
47
59
|
"del-cli": "^5.1.0",
|
|
48
60
|
"react": "18.2.0",
|
|
49
61
|
"react-native": "0.74.2",
|
|
50
|
-
"react-native-builder-bob": "^0.
|
|
62
|
+
"react-native-builder-bob": "^0.29.0",
|
|
51
63
|
"typescript": "^5.5.2"
|
|
52
64
|
},
|
|
53
65
|
"peerDependencies": {
|
|
54
|
-
"@react-
|
|
66
|
+
"@react-native-masked-view/masked-view": ">= 0.2.0",
|
|
67
|
+
"@react-navigation/native": "^7.0.0-rc.18",
|
|
55
68
|
"react": ">= 18.2.0",
|
|
56
69
|
"react-native": ">= 0.72.0",
|
|
57
70
|
"react-native-safe-area-context": ">= 4.0.0"
|
|
58
71
|
},
|
|
72
|
+
"peerDependenciesMeta": {
|
|
73
|
+
"@react-native-masked-view/masked-view": {
|
|
74
|
+
"optional": true
|
|
75
|
+
}
|
|
76
|
+
},
|
|
59
77
|
"react-native-builder-bob": {
|
|
60
78
|
"source": "src",
|
|
61
79
|
"output": "lib",
|
|
62
80
|
"targets": [
|
|
63
|
-
|
|
64
|
-
|
|
81
|
+
[
|
|
82
|
+
"commonjs",
|
|
83
|
+
{
|
|
84
|
+
"esm": true
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
[
|
|
88
|
+
"module",
|
|
89
|
+
{
|
|
90
|
+
"esm": true
|
|
91
|
+
}
|
|
92
|
+
],
|
|
65
93
|
[
|
|
66
94
|
"typescript",
|
|
67
95
|
{
|
|
68
|
-
"project": "tsconfig.build.json"
|
|
96
|
+
"project": "tsconfig.build.json",
|
|
97
|
+
"esm": true
|
|
69
98
|
}
|
|
70
99
|
]
|
|
71
100
|
]
|
|
72
101
|
},
|
|
73
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "f1b77a90eee4444e990aa86d7feecffff85d020b"
|
|
74
103
|
}
|
package/src/Button.tsx
CHANGED
|
@@ -89,15 +89,15 @@ function ButtonBase({
|
|
|
89
89
|
return (
|
|
90
90
|
<PlatformPressable
|
|
91
91
|
{...rest}
|
|
92
|
-
pressOpacity={Platform.OS === 'ios' ? undefined : 1}
|
|
93
|
-
style={[{ backgroundColor }, styles.button, style]}
|
|
94
92
|
android_ripple={{
|
|
95
93
|
radius: BUTTON_RADIUS,
|
|
96
94
|
color: Color(textColor).fade(0.85).string(),
|
|
97
95
|
...android_ripple,
|
|
98
96
|
}}
|
|
97
|
+
pressOpacity={Platform.OS === 'ios' ? undefined : 1}
|
|
98
|
+
hoverEffect={{ color: textColor }}
|
|
99
|
+
style={[{ backgroundColor }, styles.button, style]}
|
|
99
100
|
>
|
|
100
|
-
{Platform.OS === 'web' ? <HoverEffect color={textColor} /> : null}
|
|
101
101
|
<Text style={[{ color: textColor }, fonts.regular, styles.text]}>
|
|
102
102
|
{children}
|
|
103
103
|
</Text>
|
|
@@ -105,43 +105,6 @@ function ButtonBase({
|
|
|
105
105
|
);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
const CLASS_NAME = '__react-navigation_elements_Button_hover';
|
|
109
|
-
|
|
110
|
-
const css = String.raw;
|
|
111
|
-
const cssText = css`
|
|
112
|
-
.${CLASS_NAME} {
|
|
113
|
-
position: absolute;
|
|
114
|
-
top: 0;
|
|
115
|
-
left: 0;
|
|
116
|
-
right: 0;
|
|
117
|
-
bottom: 0;
|
|
118
|
-
border-radius: ${BUTTON_RADIUS}px;
|
|
119
|
-
pointer-events: none;
|
|
120
|
-
opacity: 0;
|
|
121
|
-
transition: opacity 0.15s;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
button:hover > .${CLASS_NAME} {
|
|
125
|
-
opacity: 0.08;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
button:active > .${CLASS_NAME} {
|
|
129
|
-
opacity: 0.15;
|
|
130
|
-
}
|
|
131
|
-
`;
|
|
132
|
-
|
|
133
|
-
const HoverEffect = ({ color }: { color: string }) => {
|
|
134
|
-
return (
|
|
135
|
-
<>
|
|
136
|
-
<style
|
|
137
|
-
// eslint-disable-next-line react/no-danger
|
|
138
|
-
dangerouslySetInnerHTML={{ __html: cssText }}
|
|
139
|
-
/>
|
|
140
|
-
<div className={CLASS_NAME} style={{ backgroundColor: color }} />
|
|
141
|
-
</>
|
|
142
|
-
);
|
|
143
|
-
};
|
|
144
|
-
|
|
145
108
|
const styles = StyleSheet.create({
|
|
146
109
|
button: {
|
|
147
110
|
paddingHorizontal: 24,
|
package/src/Header/Header.tsx
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { useNavigation, useTheme } from '@react-navigation/native';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import {
|
|
3
4
|
Animated,
|
|
5
|
+
type LayoutChangeEvent,
|
|
4
6
|
Platform,
|
|
5
7
|
StyleSheet,
|
|
6
8
|
View,
|
|
@@ -11,9 +13,14 @@ import {
|
|
|
11
13
|
useSafeAreaInsets,
|
|
12
14
|
} from 'react-native-safe-area-context';
|
|
13
15
|
|
|
16
|
+
import searchIcon from '../assets/search-icon.png';
|
|
14
17
|
import type { HeaderOptions, Layout } from '../types';
|
|
15
18
|
import { getDefaultHeaderHeight } from './getDefaultHeaderHeight';
|
|
19
|
+
import { HeaderBackButton } from './HeaderBackButton';
|
|
16
20
|
import { HeaderBackground } from './HeaderBackground';
|
|
21
|
+
import { HeaderButton } from './HeaderButton';
|
|
22
|
+
import { HeaderIcon } from './HeaderIcon';
|
|
23
|
+
import { HeaderSearchBar } from './HeaderSearchBar';
|
|
17
24
|
import { HeaderShownContext } from './HeaderShownContext';
|
|
18
25
|
import { HeaderTitle } from './HeaderTitle';
|
|
19
26
|
|
|
@@ -21,6 +28,19 @@ import { HeaderTitle } from './HeaderTitle';
|
|
|
21
28
|
const IPAD_MINI_MEDIUM_WIDTH = 414;
|
|
22
29
|
|
|
23
30
|
type Props = HeaderOptions & {
|
|
31
|
+
/**
|
|
32
|
+
* Options for the back button.
|
|
33
|
+
*/
|
|
34
|
+
back?: {
|
|
35
|
+
/**
|
|
36
|
+
* Title of the previous screen.
|
|
37
|
+
*/
|
|
38
|
+
title: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* The `href` to use for the anchor tag on web
|
|
41
|
+
*/
|
|
42
|
+
href: string | undefined;
|
|
43
|
+
};
|
|
24
44
|
/**
|
|
25
45
|
* Whether the header is in a modal
|
|
26
46
|
*/
|
|
@@ -54,20 +74,42 @@ const warnIfHeaderStylesDefined = (styles: Record<string, any>) => {
|
|
|
54
74
|
export function Header(props: Props) {
|
|
55
75
|
const insets = useSafeAreaInsets();
|
|
56
76
|
const frame = useSafeAreaFrame();
|
|
77
|
+
const { colors } = useTheme();
|
|
57
78
|
|
|
79
|
+
const navigation = useNavigation();
|
|
58
80
|
const isParentHeaderShown = React.useContext(HeaderShownContext);
|
|
59
81
|
|
|
82
|
+
const [searchBarVisible, setSearchBarVisible] = React.useState(false);
|
|
83
|
+
const [titleLayout, setTitleLayout] = React.useState<Layout | undefined>(
|
|
84
|
+
undefined
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const onTitleLayout = (e: LayoutChangeEvent) => {
|
|
88
|
+
const { height, width } = e.nativeEvent.layout;
|
|
89
|
+
|
|
90
|
+
setTitleLayout((titleLayout) => {
|
|
91
|
+
if (
|
|
92
|
+
titleLayout &&
|
|
93
|
+
height === titleLayout.height &&
|
|
94
|
+
width === titleLayout.width
|
|
95
|
+
) {
|
|
96
|
+
return titleLayout;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return { height, width };
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
|
|
60
103
|
const {
|
|
104
|
+
// eslint-disable-next-line @eslint-react/no-unstable-default-props
|
|
61
105
|
layout = frame,
|
|
62
106
|
modal = false,
|
|
107
|
+
back,
|
|
63
108
|
title,
|
|
64
109
|
headerTitle: customTitle,
|
|
65
|
-
headerTitleAlign = Platform.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}),
|
|
69
|
-
headerLeft,
|
|
70
|
-
headerLeftLabelVisible,
|
|
110
|
+
headerTitleAlign = Platform.OS === 'ios' ? 'center' : 'left',
|
|
111
|
+
headerLeft = back ? (props) => <HeaderBackButton {...props} /> : undefined,
|
|
112
|
+
headerSearchBarOptions,
|
|
71
113
|
headerTransparent,
|
|
72
114
|
headerTintColor,
|
|
73
115
|
headerBackground,
|
|
@@ -77,11 +119,14 @@ export function Header(props: Props) {
|
|
|
77
119
|
headerLeftContainerStyle: leftContainerStyle,
|
|
78
120
|
headerRightContainerStyle: rightContainerStyle,
|
|
79
121
|
headerTitleContainerStyle: titleContainerStyle,
|
|
122
|
+
headerBackButtonDisplayMode = Platform.OS === 'ios' ? 'default' : 'minimal',
|
|
123
|
+
headerBackTitleStyle,
|
|
80
124
|
headerBackgroundContainerStyle: backgroundContainerStyle,
|
|
81
125
|
headerStyle: customHeaderStyle,
|
|
82
126
|
headerShadowVisible,
|
|
83
127
|
headerPressColor,
|
|
84
128
|
headerPressOpacity,
|
|
129
|
+
// eslint-disable-next-line @eslint-react/no-unstable-default-props
|
|
85
130
|
headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top,
|
|
86
131
|
} = props;
|
|
87
132
|
|
|
@@ -194,20 +239,35 @@ export function Header(props: Props) {
|
|
|
194
239
|
},
|
|
195
240
|
];
|
|
196
241
|
|
|
242
|
+
const iconTintColor =
|
|
243
|
+
headerTintColor ??
|
|
244
|
+
Platform.select({
|
|
245
|
+
ios: colors.primary,
|
|
246
|
+
default: colors.text,
|
|
247
|
+
});
|
|
248
|
+
|
|
197
249
|
const leftButton = headerLeft
|
|
198
250
|
? headerLeft({
|
|
199
|
-
tintColor:
|
|
251
|
+
tintColor: iconTintColor,
|
|
200
252
|
pressColor: headerPressColor,
|
|
201
253
|
pressOpacity: headerPressOpacity,
|
|
202
|
-
|
|
254
|
+
displayMode: headerBackButtonDisplayMode,
|
|
255
|
+
titleLayout,
|
|
256
|
+
screenLayout: layout,
|
|
257
|
+
canGoBack: Boolean(back),
|
|
258
|
+
onPress: back ? navigation.goBack : undefined,
|
|
259
|
+
label: back?.title,
|
|
260
|
+
labelStyle: headerBackTitleStyle,
|
|
261
|
+
href: back?.href,
|
|
203
262
|
})
|
|
204
263
|
: null;
|
|
205
264
|
|
|
206
265
|
const rightButton = headerRight
|
|
207
266
|
? headerRight({
|
|
208
|
-
tintColor:
|
|
267
|
+
tintColor: iconTintColor,
|
|
209
268
|
pressColor: headerPressColor,
|
|
210
269
|
pressOpacity: headerPressOpacity,
|
|
270
|
+
canGoBack: Boolean(back),
|
|
211
271
|
})
|
|
212
272
|
: null;
|
|
213
273
|
|
|
@@ -254,53 +314,88 @@ export function Header(props: Props) {
|
|
|
254
314
|
>
|
|
255
315
|
{leftButton}
|
|
256
316
|
</Animated.View>
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
?
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
317
|
+
{Platform.OS === 'ios' || !searchBarVisible ? (
|
|
318
|
+
<>
|
|
319
|
+
<Animated.View
|
|
320
|
+
pointerEvents="box-none"
|
|
321
|
+
style={[
|
|
322
|
+
styles.title,
|
|
323
|
+
{
|
|
324
|
+
// Avoid the title from going offscreen or overlapping buttons
|
|
325
|
+
maxWidth:
|
|
326
|
+
headerTitleAlign === 'center'
|
|
327
|
+
? layout.width -
|
|
328
|
+
((leftButton
|
|
329
|
+
? headerBackButtonDisplayMode !== 'minimal'
|
|
330
|
+
? 80
|
|
331
|
+
: 32
|
|
332
|
+
: 16) +
|
|
333
|
+
(rightButton ? 16 : 0) +
|
|
334
|
+
Math.max(insets.left, insets.right)) *
|
|
335
|
+
2
|
|
336
|
+
: layout.width -
|
|
337
|
+
((leftButton ? 52 : 16) +
|
|
338
|
+
(rightButton ? 52 : 16) +
|
|
339
|
+
insets.left -
|
|
340
|
+
insets.right),
|
|
341
|
+
},
|
|
342
|
+
headerTitleAlign === 'left' && leftButton
|
|
343
|
+
? { marginStart: 4 }
|
|
344
|
+
: { marginStart: 16 },
|
|
345
|
+
titleContainerStyle,
|
|
346
|
+
]}
|
|
347
|
+
>
|
|
348
|
+
{headerTitle({
|
|
349
|
+
children: title,
|
|
350
|
+
allowFontScaling: titleAllowFontScaling,
|
|
351
|
+
tintColor: headerTintColor,
|
|
352
|
+
onLayout: onTitleLayout,
|
|
353
|
+
style: titleStyle,
|
|
354
|
+
})}
|
|
355
|
+
</Animated.View>
|
|
356
|
+
<Animated.View
|
|
357
|
+
pointerEvents="box-none"
|
|
358
|
+
style={[
|
|
359
|
+
styles.end,
|
|
360
|
+
styles.expand,
|
|
361
|
+
{ marginEnd: insets.right },
|
|
362
|
+
rightContainerStyle,
|
|
363
|
+
]}
|
|
364
|
+
>
|
|
365
|
+
{rightButton}
|
|
366
|
+
{headerSearchBarOptions ? (
|
|
367
|
+
<HeaderButton
|
|
368
|
+
tintColor={iconTintColor}
|
|
369
|
+
pressColor={headerPressColor}
|
|
370
|
+
pressOpacity={headerPressOpacity}
|
|
371
|
+
onPress={() => setSearchBarVisible(true)}
|
|
372
|
+
>
|
|
373
|
+
<HeaderIcon
|
|
374
|
+
style={
|
|
375
|
+
Boolean(iconTintColor) && { tintColor: iconTintColor }
|
|
376
|
+
}
|
|
377
|
+
source={searchIcon}
|
|
378
|
+
/>
|
|
379
|
+
</HeaderButton>
|
|
380
|
+
) : null}
|
|
381
|
+
</Animated.View>
|
|
382
|
+
</>
|
|
383
|
+
) : null}
|
|
384
|
+
{Platform.OS === 'ios' || searchBarVisible ? (
|
|
385
|
+
<HeaderSearchBar
|
|
386
|
+
{...headerSearchBarOptions}
|
|
387
|
+
visible={searchBarVisible}
|
|
388
|
+
onClose={() => {
|
|
389
|
+
setSearchBarVisible(false);
|
|
390
|
+
headerSearchBarOptions?.onClose?.();
|
|
391
|
+
}}
|
|
392
|
+
style={[
|
|
393
|
+
Platform.OS === 'ios'
|
|
394
|
+
? [StyleSheet.absoluteFill, { backgroundColor: colors.card }]
|
|
395
|
+
: !leftButton && { marginStart: 8 },
|
|
396
|
+
]}
|
|
397
|
+
/>
|
|
398
|
+
) : null}
|
|
304
399
|
</View>
|
|
305
400
|
</Animated.View>
|
|
306
401
|
);
|
|
@@ -319,12 +414,14 @@ const styles = StyleSheet.create({
|
|
|
319
414
|
justifyContent: 'center',
|
|
320
415
|
},
|
|
321
416
|
start: {
|
|
322
|
-
|
|
323
|
-
alignItems: '
|
|
417
|
+
flexDirection: 'row',
|
|
418
|
+
alignItems: 'center',
|
|
419
|
+
justifyContent: 'flex-start',
|
|
324
420
|
},
|
|
325
421
|
end: {
|
|
326
|
-
|
|
327
|
-
alignItems: '
|
|
422
|
+
flexDirection: 'row',
|
|
423
|
+
alignItems: 'center',
|
|
424
|
+
justifyContent: 'flex-end',
|
|
328
425
|
},
|
|
329
426
|
expand: {
|
|
330
427
|
flexGrow: 1,
|