@react-navigation/elements 2.9.5 → 3.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/lib/module/Badge.js +2 -2
  2. package/lib/module/Badge.js.map +1 -1
  3. package/lib/module/BlurEffectBackground.js +59 -0
  4. package/lib/module/BlurEffectBackground.js.map +1 -0
  5. package/lib/module/Button.js +7 -6
  6. package/lib/module/Button.js.map +1 -1
  7. package/lib/module/Color.js +11 -0
  8. package/lib/module/Color.js.map +1 -0
  9. package/lib/module/Container.js +42 -0
  10. package/lib/module/Container.js.map +1 -0
  11. package/lib/module/Header/Header.js +156 -97
  12. package/lib/module/Header/Header.js.map +1 -1
  13. package/lib/module/Header/HeaderBackButton.js +130 -121
  14. package/lib/module/Header/HeaderBackButton.js.map +1 -1
  15. package/lib/module/Header/HeaderBackground.js +10 -17
  16. package/lib/module/Header/HeaderBackground.js.map +1 -1
  17. package/lib/module/Header/HeaderButton.js +6 -2
  18. package/lib/module/Header/HeaderButton.js.map +1 -1
  19. package/lib/module/Header/HeaderButtonBackground.js +34 -0
  20. package/lib/module/Header/HeaderButtonBackground.js.map +1 -0
  21. package/lib/module/Header/HeaderSearchBar.js +174 -123
  22. package/lib/module/Header/HeaderSearchBar.js.map +1 -1
  23. package/lib/module/Header/HeaderTitle.js.map +1 -1
  24. package/lib/module/Header/getDefaultHeaderHeight.js +22 -10
  25. package/lib/module/Header/getDefaultHeaderHeight.js.map +1 -1
  26. package/lib/module/Label/Label.js.map +1 -1
  27. package/lib/module/LiquidGlassView.ios.js +21 -0
  28. package/lib/module/LiquidGlassView.ios.js.map +1 -0
  29. package/lib/module/LiquidGlassView.js +13 -0
  30. package/lib/module/LiquidGlassView.js.map +1 -0
  31. package/lib/module/MissingIcon.js +1 -0
  32. package/lib/module/MissingIcon.js.map +1 -1
  33. package/lib/module/PlatformColor.js +9 -0
  34. package/lib/module/PlatformColor.js.map +1 -0
  35. package/lib/module/PlatformColor.native.js +4 -0
  36. package/lib/module/PlatformColor.native.js.map +1 -0
  37. package/lib/module/PlatformPressable.js.map +1 -1
  38. package/lib/module/Screen.js +29 -23
  39. package/lib/module/Screen.js.map +1 -1
  40. package/lib/module/assets/back-icon.ios.svg +4 -0
  41. package/lib/module/assets/back-icon@1x.ios.png +0 -0
  42. package/lib/module/assets/back-icon@2x.ios.png +0 -0
  43. package/lib/module/assets/back-icon@3x.ios.png +0 -0
  44. package/lib/module/assets/back-icon@4x.ios.png +0 -0
  45. package/lib/module/assets/search-icon-legacy.png +0 -0
  46. package/lib/module/assets/search-icon-legacy@1x.ios.png +0 -0
  47. package/lib/module/assets/search-icon-legacy@2x.ios.png +0 -0
  48. package/lib/module/assets/search-icon-legacy@3x.ios.png +0 -0
  49. package/lib/module/assets/search-icon-legacy@4x.ios.png +0 -0
  50. package/lib/module/assets/search-icon.ios.svg +4 -0
  51. package/lib/module/assets/search-icon@1x.ios.png +0 -0
  52. package/lib/module/assets/search-icon@2x.ios.png +0 -0
  53. package/lib/module/assets/search-icon@3x.ios.png +0 -0
  54. package/lib/module/assets/search-icon@4x.ios.png +0 -0
  55. package/lib/module/getBlurBackgroundColor.js +48 -0
  56. package/lib/module/getBlurBackgroundColor.js.map +1 -0
  57. package/lib/module/index.js +2 -8
  58. package/lib/module/index.js.map +1 -1
  59. package/lib/module/internal.js +10 -0
  60. package/lib/module/internal.js.map +1 -0
  61. package/lib/module/useFrameSize.js +4 -4
  62. package/lib/module/useFrameSize.js.map +1 -1
  63. package/lib/typescript/src/Badge.d.ts.map +1 -1
  64. package/lib/typescript/src/BlurEffectBackground.d.ts +16 -0
  65. package/lib/typescript/src/BlurEffectBackground.d.ts.map +1 -0
  66. package/lib/typescript/src/Button.d.ts +5 -4
  67. package/lib/typescript/src/Button.d.ts.map +1 -1
  68. package/lib/typescript/src/Color.d.ts +13 -0
  69. package/lib/typescript/src/Color.d.ts.map +1 -0
  70. package/lib/typescript/src/Container.d.ts +8 -0
  71. package/lib/typescript/src/Container.d.ts.map +1 -0
  72. package/lib/typescript/src/Header/Header.d.ts +1 -5
  73. package/lib/typescript/src/Header/Header.d.ts.map +1 -1
  74. package/lib/typescript/src/Header/HeaderBackButton.d.ts +1 -1
  75. package/lib/typescript/src/Header/HeaderBackButton.d.ts.map +1 -1
  76. package/lib/typescript/src/Header/HeaderBackground.d.ts +5 -3
  77. package/lib/typescript/src/Header/HeaderBackground.d.ts.map +1 -1
  78. package/lib/typescript/src/Header/HeaderButton.d.ts +2 -0
  79. package/lib/typescript/src/Header/HeaderButton.d.ts.map +1 -1
  80. package/lib/typescript/src/Header/HeaderButtonBackground.d.ts +7 -0
  81. package/lib/typescript/src/Header/HeaderButtonBackground.d.ts.map +1 -0
  82. package/lib/typescript/src/Header/HeaderSearchBar.d.ts +5 -2
  83. package/lib/typescript/src/Header/HeaderSearchBar.d.ts.map +1 -1
  84. package/lib/typescript/src/Header/HeaderTitle.d.ts +2 -2
  85. package/lib/typescript/src/Header/HeaderTitle.d.ts.map +1 -1
  86. package/lib/typescript/src/Header/getDefaultHeaderHeight.d.ts +5 -2
  87. package/lib/typescript/src/Header/getDefaultHeaderHeight.d.ts.map +1 -1
  88. package/lib/typescript/src/Label/Label.d.ts +2 -2
  89. package/lib/typescript/src/Label/Label.d.ts.map +1 -1
  90. package/lib/typescript/src/LiquidGlassView.d.ts +9 -0
  91. package/lib/typescript/src/LiquidGlassView.d.ts.map +1 -0
  92. package/lib/typescript/src/LiquidGlassView.ios.d.ts +5 -0
  93. package/lib/typescript/src/LiquidGlassView.ios.d.ts.map +1 -0
  94. package/lib/typescript/src/MissingIcon.d.ts +2 -2
  95. package/lib/typescript/src/MissingIcon.d.ts.map +1 -1
  96. package/lib/typescript/src/PlatformColor.d.ts +7 -0
  97. package/lib/typescript/src/PlatformColor.d.ts.map +1 -0
  98. package/lib/typescript/src/PlatformColor.native.d.ts +2 -0
  99. package/lib/typescript/src/PlatformColor.native.d.ts.map +1 -0
  100. package/lib/typescript/src/PlatformPressable.d.ts +3 -3
  101. package/lib/typescript/src/PlatformPressable.d.ts.map +1 -1
  102. package/lib/typescript/src/Screen.d.ts.map +1 -1
  103. package/lib/typescript/src/getBlurBackgroundColor.d.ts +7 -0
  104. package/lib/typescript/src/getBlurBackgroundColor.d.ts.map +1 -0
  105. package/lib/typescript/src/index.d.ts +0 -6
  106. package/lib/typescript/src/index.d.ts.map +1 -1
  107. package/lib/typescript/src/internal.d.ts +8 -0
  108. package/lib/typescript/src/internal.d.ts.map +1 -0
  109. package/lib/typescript/src/types.d.ts +47 -31
  110. package/lib/typescript/src/types.d.ts.map +1 -1
  111. package/package.json +19 -17
  112. package/src/Badge.tsx +3 -2
  113. package/src/BlurEffectBackground.tsx +90 -0
  114. package/src/Button.tsx +33 -21
  115. package/src/Color.tsx +21 -0
  116. package/src/Container.tsx +44 -0
  117. package/src/Header/Header.tsx +230 -156
  118. package/src/Header/HeaderBackButton.tsx +194 -168
  119. package/src/Header/HeaderBackground.tsx +17 -19
  120. package/src/Header/HeaderButton.tsx +7 -2
  121. package/src/Header/HeaderButtonBackground.tsx +35 -0
  122. package/src/Header/HeaderSearchBar.tsx +227 -129
  123. package/src/Header/HeaderTitle.tsx +2 -1
  124. package/src/Header/getDefaultHeaderHeight.tsx +29 -18
  125. package/src/Label/Label.tsx +2 -1
  126. package/src/LiquidGlassView.ios.tsx +39 -0
  127. package/src/LiquidGlassView.tsx +20 -0
  128. package/src/MissingIcon.tsx +12 -3
  129. package/src/PlatformColor.native.tsx +1 -0
  130. package/src/PlatformColor.tsx +8 -0
  131. package/src/PlatformPressable.tsx +2 -1
  132. package/src/Screen.tsx +24 -25
  133. package/src/assets/back-icon.ios.svg +4 -0
  134. package/src/assets/back-icon@1x.ios.png +0 -0
  135. package/src/assets/back-icon@2x.ios.png +0 -0
  136. package/src/assets/back-icon@3x.ios.png +0 -0
  137. package/src/assets/back-icon@4x.ios.png +0 -0
  138. package/src/assets/search-icon-legacy.png +0 -0
  139. package/src/assets/search-icon-legacy@1x.ios.png +0 -0
  140. package/src/assets/search-icon-legacy@2x.ios.png +0 -0
  141. package/src/assets/search-icon-legacy@3x.ios.png +0 -0
  142. package/src/assets/search-icon-legacy@4x.ios.png +0 -0
  143. package/src/assets/search-icon.ios.svg +4 -0
  144. package/src/assets/search-icon@1x.ios.png +0 -0
  145. package/src/assets/search-icon@2x.ios.png +0 -0
  146. package/src/assets/search-icon@3x.ios.png +0 -0
  147. package/src/assets/search-icon@4x.ios.png +0 -0
  148. package/src/getBlurBackgroundColor.tsx +68 -0
  149. package/src/index.tsx +2 -8
  150. package/src/internal.tsx +7 -0
  151. package/src/types.tsx +50 -32
  152. package/src/useFrameSize.tsx +4 -4
  153. package/lib/module/Background.js +0 -22
  154. package/lib/module/Background.js.map +0 -1
  155. package/lib/module/MaskedView.android.js +0 -4
  156. package/lib/module/MaskedView.android.js.map +0 -1
  157. package/lib/module/MaskedView.ios.js +0 -4
  158. package/lib/module/MaskedView.ios.js.map +0 -1
  159. package/lib/module/MaskedView.js +0 -12
  160. package/lib/module/MaskedView.js.map +0 -1
  161. package/lib/module/MaskedViewNative.js +0 -30
  162. package/lib/module/MaskedViewNative.js.map +0 -1
  163. package/lib/module/ResourceSavingView.js +0 -57
  164. package/lib/module/ResourceSavingView.js.map +0 -1
  165. package/lib/module/assets/back-icon-mask.png +0 -0
  166. package/lib/typescript/src/Background.d.ts +0 -9
  167. package/lib/typescript/src/Background.d.ts.map +0 -1
  168. package/lib/typescript/src/MaskedView.android.d.ts +0 -2
  169. package/lib/typescript/src/MaskedView.android.d.ts.map +0 -1
  170. package/lib/typescript/src/MaskedView.d.ts +0 -11
  171. package/lib/typescript/src/MaskedView.d.ts.map +0 -1
  172. package/lib/typescript/src/MaskedView.ios.d.ts +0 -2
  173. package/lib/typescript/src/MaskedView.ios.d.ts.map +0 -1
  174. package/lib/typescript/src/MaskedViewNative.d.ts +0 -11
  175. package/lib/typescript/src/MaskedViewNative.d.ts.map +0 -1
  176. package/lib/typescript/src/ResourceSavingView.d.ts +0 -10
  177. package/lib/typescript/src/ResourceSavingView.d.ts.map +0 -1
  178. package/src/Background.tsx +0 -24
  179. package/src/MaskedView.android.tsx +0 -1
  180. package/src/MaskedView.ios.tsx +0 -1
  181. package/src/MaskedView.tsx +0 -13
  182. package/src/MaskedViewNative.tsx +0 -33
  183. package/src/ResourceSavingView.tsx +0 -76
  184. package/src/assets/back-icon-mask.png +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"Background.d.ts","sourceRoot":"","sources":["../../../src/Background.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,QAAQ,EACR,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,KAAK,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG;IACtC,KAAK,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IACzD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CASnD"}
@@ -1,2 +0,0 @@
1
- export { MaskedView } from './MaskedViewNative';
2
- //# sourceMappingURL=MaskedView.android.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MaskedView.android.d.ts","sourceRoot":"","sources":["../../../src/MaskedView.android.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Use a stub for MaskedView on all Platforms that don't support it.
3
- */
4
- import type * as React from 'react';
5
- type Props = {
6
- maskElement: React.ReactElement;
7
- children: React.ReactElement;
8
- };
9
- export declare function MaskedView({ children }: Props): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
10
- export {};
11
- //# sourceMappingURL=MaskedView.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MaskedView.d.ts","sourceRoot":"","sources":["../../../src/MaskedView.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,KAAK,KAAK,GAAG;IACX,WAAW,EAAE,KAAK,CAAC,YAAY,CAAC;IAChC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;CAC9B,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,0EAE7C"}
@@ -1,2 +0,0 @@
1
- export { MaskedView } from './MaskedViewNative';
2
- //# sourceMappingURL=MaskedView.ios.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MaskedView.ios.d.ts","sourceRoot":"","sources":["../../../src/MaskedView.ios.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * The native MaskedView that we explicitly re-export for supported platforms: Android, iOS.
3
- */
4
- import * as React from 'react';
5
- type MaskedViewType = typeof import('@react-native-masked-view/masked-view').default;
6
- type Props = React.ComponentProps<MaskedViewType> & {
7
- children: React.ReactElement;
8
- };
9
- export declare function MaskedView({ children, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
10
- export {};
11
- //# sourceMappingURL=MaskedViewNative.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MaskedViewNative.d.ts","sourceRoot":"","sources":["../../../src/MaskedViewNative.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,cAAc,GACjB,cAAc,uCAAuC,EAAE,OAAO,CAAC;AAEjE,KAAK,KAAK,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IAClD,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;CAC9B,CAAC;AAeF,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CAMtD"}
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
- import { type StyleProp, type ViewStyle } from 'react-native';
3
- type Props = {
4
- visible: boolean;
5
- children: React.ReactNode;
6
- style?: StyleProp<ViewStyle>;
7
- };
8
- export declare function ResourceSavingView({ visible, children, style, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
9
- export {};
10
- //# sourceMappingURL=ResourceSavingView.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ResourceSavingView.d.ts","sourceRoot":"","sources":["../../../src/ResourceSavingView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,KAAK,SAAS,EAGd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAIF,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,QAAQ,EACR,KAAK,EACL,GAAG,IAAI,EACR,EAAE,KAAK,2CAuCP"}
@@ -1,24 +0,0 @@
1
- import { useTheme } from '@react-navigation/native';
2
- import * as React from 'react';
3
- import {
4
- Animated,
5
- type StyleProp,
6
- type ViewProps,
7
- type ViewStyle,
8
- } from 'react-native';
9
-
10
- type Props = Omit<ViewProps, 'style'> & {
11
- style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
12
- children: React.ReactNode;
13
- };
14
-
15
- export function Background({ style, ...rest }: Props) {
16
- const { colors } = useTheme();
17
-
18
- return (
19
- <Animated.View
20
- {...rest}
21
- style={[{ flex: 1, backgroundColor: colors.background }, style]}
22
- />
23
- );
24
- }
@@ -1 +0,0 @@
1
- export { MaskedView } from './MaskedViewNative';
@@ -1 +0,0 @@
1
- export { MaskedView } from './MaskedViewNative';
@@ -1,13 +0,0 @@
1
- /**
2
- * Use a stub for MaskedView on all Platforms that don't support it.
3
- */
4
- import type * as React from 'react';
5
-
6
- type Props = {
7
- maskElement: React.ReactElement;
8
- children: React.ReactElement;
9
- };
10
-
11
- export function MaskedView({ children }: Props) {
12
- return children;
13
- }
@@ -1,33 +0,0 @@
1
- /**
2
- * The native MaskedView that we explicitly re-export for supported platforms: Android, iOS.
3
- */
4
- import * as React from 'react';
5
- import { UIManager } from 'react-native';
6
-
7
- type MaskedViewType =
8
- typeof import('@react-native-masked-view/masked-view').default;
9
-
10
- type Props = React.ComponentProps<MaskedViewType> & {
11
- children: React.ReactElement;
12
- };
13
-
14
- let RNCMaskedView: MaskedViewType | undefined;
15
-
16
- try {
17
- // Add try/catch to support usage even if it's not installed, since it's optional.
18
- // Newer versions of Metro will handle it properly.
19
- RNCMaskedView = require('@react-native-masked-view/masked-view').default;
20
- } catch (e) {
21
- // Ignore
22
- }
23
-
24
- const isMaskedViewAvailable =
25
- UIManager.getViewManagerConfig('RNCMaskedView') != null;
26
-
27
- export function MaskedView({ children, ...rest }: Props) {
28
- if (isMaskedViewAvailable && RNCMaskedView) {
29
- return <RNCMaskedView {...rest}>{children}</RNCMaskedView>;
30
- }
31
-
32
- return children;
33
- }
@@ -1,76 +0,0 @@
1
- import * as React from 'react';
2
- import {
3
- Platform,
4
- type StyleProp,
5
- StyleSheet,
6
- View,
7
- type ViewStyle,
8
- } from 'react-native';
9
-
10
- type Props = {
11
- visible: boolean;
12
- children: React.ReactNode;
13
- style?: StyleProp<ViewStyle>;
14
- };
15
-
16
- const FAR_FAR_AWAY = 30000; // this should be big enough to move the whole view out of its container
17
-
18
- export function ResourceSavingView({
19
- visible,
20
- children,
21
- style,
22
- ...rest
23
- }: Props) {
24
- if (Platform.OS === 'web') {
25
- return (
26
- <View
27
- // @ts-expect-error: hidden exists on web, but not in React Native
28
- hidden={!visible}
29
- style={[
30
- { display: visible ? 'flex' : 'none' },
31
- styles.container,
32
- style,
33
- ]}
34
- pointerEvents={visible ? 'auto' : 'none'}
35
- {...rest}
36
- >
37
- {children}
38
- </View>
39
- );
40
- }
41
-
42
- return (
43
- <View
44
- style={[styles.container, style]}
45
- // box-none doesn't seem to work properly on Android
46
- pointerEvents={visible ? 'auto' : 'none'}
47
- >
48
- <View
49
- collapsable={false}
50
- removeClippedSubviews={
51
- // On iOS & macOS, set removeClippedSubviews to true only when not focused
52
- // This is an workaround for a bug where the clipped view never re-appears
53
- Platform.OS === 'ios' || Platform.OS === 'macos' ? !visible : true
54
- }
55
- pointerEvents={visible ? 'auto' : 'none'}
56
- style={visible ? styles.attached : styles.detached}
57
- >
58
- {children}
59
- </View>
60
- </View>
61
- );
62
- }
63
-
64
- const styles = StyleSheet.create({
65
- container: {
66
- flex: 1,
67
- overflow: 'hidden',
68
- },
69
- attached: {
70
- flex: 1,
71
- },
72
- detached: {
73
- flex: 1,
74
- top: FAR_FAR_AWAY,
75
- },
76
- });
Binary file