@react-navigation/elements 3.0.0-alpha.2 → 3.0.0-alpha.20

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 (171) hide show
  1. package/lib/module/ActivityView.js +90 -0
  2. package/lib/module/ActivityView.js.map +1 -0
  3. package/lib/module/ActivityView.native.js +67 -0
  4. package/lib/module/ActivityView.native.js.map +1 -0
  5. package/lib/module/Badge.js +5 -4
  6. package/lib/module/Badge.js.map +1 -1
  7. package/lib/module/Button.js +7 -2
  8. package/lib/module/Button.js.map +1 -1
  9. package/lib/module/Color.js +95 -0
  10. package/lib/module/Color.js.map +1 -1
  11. package/lib/module/Container.js +11 -1
  12. package/lib/module/Container.js.map +1 -1
  13. package/lib/module/Header/Header.js +26 -11
  14. package/lib/module/Header/Header.js.map +1 -1
  15. package/lib/module/Header/HeaderBackButton.js +27 -13
  16. package/lib/module/Header/HeaderBackButton.js.map +1 -1
  17. package/lib/module/Header/HeaderIcon.js +29 -10
  18. package/lib/module/Header/HeaderIcon.js.map +1 -1
  19. package/lib/module/Header/HeaderSearchBar.js +28 -21
  20. package/lib/module/Header/HeaderSearchBar.js.map +1 -1
  21. package/lib/module/Header/getHeaderTitle.js.map +1 -1
  22. package/lib/module/Header/useHeaderHeight.js +1 -1
  23. package/lib/module/Header/useHeaderHeight.js.map +1 -1
  24. package/lib/module/Label/getLabel.js.map +1 -1
  25. package/lib/module/PlatformColor.js +1 -0
  26. package/lib/module/PlatformColor.js.map +1 -1
  27. package/lib/module/PlatformColor.native.js +1 -1
  28. package/lib/module/PlatformColor.native.js.map +1 -1
  29. package/lib/module/PlatformPressable.js.map +1 -1
  30. package/lib/module/SafeAreaProviderCompat.js +1 -1
  31. package/lib/module/SafeAreaProviderCompat.js.map +1 -1
  32. package/lib/module/Screen.js +13 -9
  33. package/lib/module/Screen.js.map +1 -1
  34. package/lib/module/index.js +1 -7
  35. package/lib/module/index.js.map +1 -1
  36. package/lib/module/internal.js +1 -1
  37. package/lib/module/internal.js.map +1 -1
  38. package/lib/module/useFrameSize.js +1 -1
  39. package/lib/module/useFrameSize.js.map +1 -1
  40. package/lib/typescript/src/ActivityView.d.ts +31 -0
  41. package/lib/typescript/src/ActivityView.d.ts.map +1 -0
  42. package/lib/typescript/src/ActivityView.native.d.ts +3 -0
  43. package/lib/typescript/src/ActivityView.native.d.ts.map +1 -0
  44. package/lib/typescript/src/Badge.d.ts +3 -3
  45. package/lib/typescript/src/Badge.d.ts.map +1 -1
  46. package/lib/typescript/src/Button.d.ts +3 -3
  47. package/lib/typescript/src/Button.d.ts.map +1 -1
  48. package/lib/typescript/src/Color.d.ts +4 -3
  49. package/lib/typescript/src/Color.d.ts.map +1 -1
  50. package/lib/typescript/src/Container.d.ts +7 -4
  51. package/lib/typescript/src/Container.d.ts.map +1 -1
  52. package/lib/typescript/src/Header/Header.d.ts +2 -2
  53. package/lib/typescript/src/Header/Header.d.ts.map +1 -1
  54. package/lib/typescript/src/Header/HeaderBackButton.d.ts +1 -1
  55. package/lib/typescript/src/Header/HeaderBackButton.d.ts.map +1 -1
  56. package/lib/typescript/src/Header/HeaderBackground.d.ts +3 -3
  57. package/lib/typescript/src/Header/HeaderBackground.d.ts.map +1 -1
  58. package/lib/typescript/src/Header/HeaderIcon.d.ts +8 -4
  59. package/lib/typescript/src/Header/HeaderIcon.d.ts.map +1 -1
  60. package/lib/typescript/src/Header/HeaderSearchBar.d.ts +4 -4
  61. package/lib/typescript/src/Header/HeaderSearchBar.d.ts.map +1 -1
  62. package/lib/typescript/src/Header/HeaderTitle.d.ts +3 -3
  63. package/lib/typescript/src/Header/HeaderTitle.d.ts.map +1 -1
  64. package/lib/typescript/src/Header/getHeaderTitle.d.ts +1 -1
  65. package/lib/typescript/src/Header/getHeaderTitle.d.ts.map +1 -1
  66. package/lib/typescript/src/Label/getLabel.d.ts +2 -2
  67. package/lib/typescript/src/Label/getLabel.d.ts.map +1 -1
  68. package/lib/typescript/src/PlatformColor.d.ts +1 -0
  69. package/lib/typescript/src/PlatformColor.d.ts.map +1 -1
  70. package/lib/typescript/src/PlatformColor.native.d.ts +1 -1
  71. package/lib/typescript/src/PlatformColor.native.d.ts.map +1 -1
  72. package/lib/typescript/src/PlatformPressable.d.ts +12 -12
  73. package/lib/typescript/src/PlatformPressable.d.ts.map +1 -1
  74. package/lib/typescript/src/Screen.d.ts +6 -6
  75. package/lib/typescript/src/Screen.d.ts.map +1 -1
  76. package/lib/typescript/src/index.d.ts +1 -2
  77. package/lib/typescript/src/index.d.ts.map +1 -1
  78. package/lib/typescript/src/internal.d.ts +1 -1
  79. package/lib/typescript/src/internal.d.ts.map +1 -1
  80. package/lib/typescript/src/types.d.ts +119 -69
  81. package/lib/typescript/src/types.d.ts.map +1 -1
  82. package/package.json +14 -13
  83. package/src/ActivityView.native.tsx +90 -0
  84. package/src/ActivityView.tsx +129 -0
  85. package/src/Badge.tsx +9 -7
  86. package/src/Button.tsx +15 -7
  87. package/src/Color.tsx +133 -3
  88. package/src/Container.tsx +20 -4
  89. package/src/Header/Header.tsx +43 -20
  90. package/src/Header/HeaderBackButton.tsx +31 -17
  91. package/src/Header/HeaderBackground.tsx +3 -3
  92. package/src/Header/HeaderIcon.tsx +49 -9
  93. package/src/Header/HeaderSearchBar.tsx +31 -22
  94. package/src/Header/HeaderTitle.tsx +3 -3
  95. package/src/Header/getHeaderTitle.tsx +4 -1
  96. package/src/Header/useHeaderHeight.tsx +1 -1
  97. package/src/Label/getLabel.tsx +1 -1
  98. package/src/PlatformColor.native.tsx +1 -1
  99. package/src/PlatformColor.tsx +4 -0
  100. package/src/PlatformPressable.tsx +12 -8
  101. package/src/SafeAreaProviderCompat.tsx +1 -1
  102. package/src/Screen.tsx +19 -19
  103. package/src/index.tsx +1 -16
  104. package/src/internal.tsx +1 -1
  105. package/src/types.tsx +153 -76
  106. package/src/useFrameSize.tsx +1 -1
  107. package/lib/module/Lazy.js +0 -42
  108. package/lib/module/Lazy.js.map +0 -1
  109. package/lib/module/assets/back-icon.ios.svg +0 -4
  110. package/lib/module/assets/back-icon@1x.android.png +0 -0
  111. package/lib/module/assets/back-icon@1x.ios.png +0 -0
  112. package/lib/module/assets/back-icon@2x.android.png +0 -0
  113. package/lib/module/assets/back-icon@2x.ios.png +0 -0
  114. package/lib/module/assets/back-icon@3x.android.png +0 -0
  115. package/lib/module/assets/back-icon@3x.ios.png +0 -0
  116. package/lib/module/assets/back-icon@4x.android.png +0 -0
  117. package/lib/module/assets/back-icon@4x.ios.png +0 -0
  118. package/lib/module/assets/clear-icon@1x.png +0 -0
  119. package/lib/module/assets/clear-icon@2x.png +0 -0
  120. package/lib/module/assets/clear-icon@3x.png +0 -0
  121. package/lib/module/assets/clear-icon@4x.png +0 -0
  122. package/lib/module/assets/close-icon@1x.png +0 -0
  123. package/lib/module/assets/close-icon@2x.png +0 -0
  124. package/lib/module/assets/close-icon@3x.png +0 -0
  125. package/lib/module/assets/close-icon@4x.png +0 -0
  126. package/lib/module/assets/search-icon-legacy@1x.ios.png +0 -0
  127. package/lib/module/assets/search-icon-legacy@2x.ios.png +0 -0
  128. package/lib/module/assets/search-icon-legacy@3x.ios.png +0 -0
  129. package/lib/module/assets/search-icon-legacy@4x.ios.png +0 -0
  130. package/lib/module/assets/search-icon.ios.svg +0 -4
  131. package/lib/module/assets/search-icon@1x.android.png +0 -0
  132. package/lib/module/assets/search-icon@1x.ios.png +0 -0
  133. package/lib/module/assets/search-icon@2x.android.png +0 -0
  134. package/lib/module/assets/search-icon@2x.ios.png +0 -0
  135. package/lib/module/assets/search-icon@3x.android.png +0 -0
  136. package/lib/module/assets/search-icon@3x.ios.png +0 -0
  137. package/lib/module/assets/search-icon@4x.android.png +0 -0
  138. package/lib/module/assets/search-icon@4x.ios.png +0 -0
  139. package/lib/typescript/src/Lazy.d.ts +0 -31
  140. package/lib/typescript/src/Lazy.d.ts.map +0 -1
  141. package/src/Lazy.tsx +0 -59
  142. package/src/assets/back-icon.ios.svg +0 -4
  143. package/src/assets/back-icon@1x.android.png +0 -0
  144. package/src/assets/back-icon@1x.ios.png +0 -0
  145. package/src/assets/back-icon@2x.android.png +0 -0
  146. package/src/assets/back-icon@2x.ios.png +0 -0
  147. package/src/assets/back-icon@3x.android.png +0 -0
  148. package/src/assets/back-icon@3x.ios.png +0 -0
  149. package/src/assets/back-icon@4x.android.png +0 -0
  150. package/src/assets/back-icon@4x.ios.png +0 -0
  151. package/src/assets/clear-icon@1x.png +0 -0
  152. package/src/assets/clear-icon@2x.png +0 -0
  153. package/src/assets/clear-icon@3x.png +0 -0
  154. package/src/assets/clear-icon@4x.png +0 -0
  155. package/src/assets/close-icon@1x.png +0 -0
  156. package/src/assets/close-icon@2x.png +0 -0
  157. package/src/assets/close-icon@3x.png +0 -0
  158. package/src/assets/close-icon@4x.png +0 -0
  159. package/src/assets/search-icon-legacy@1x.ios.png +0 -0
  160. package/src/assets/search-icon-legacy@2x.ios.png +0 -0
  161. package/src/assets/search-icon-legacy@3x.ios.png +0 -0
  162. package/src/assets/search-icon-legacy@4x.ios.png +0 -0
  163. package/src/assets/search-icon.ios.svg +0 -4
  164. package/src/assets/search-icon@1x.android.png +0 -0
  165. package/src/assets/search-icon@1x.ios.png +0 -0
  166. package/src/assets/search-icon@2x.android.png +0 -0
  167. package/src/assets/search-icon@2x.ios.png +0 -0
  168. package/src/assets/search-icon@3x.android.png +0 -0
  169. package/src/assets/search-icon@3x.ios.png +0 -0
  170. package/src/assets/search-icon@4x.android.png +0 -0
  171. package/src/assets/search-icon@4x.ios.png +0 -0
@@ -1,10 +1,49 @@
1
- import type { Animated, ColorValue, LayoutChangeEvent, StyleProp, TextInputProps, TextStyle, ViewStyle } from 'react-native';
1
+ import type { MaterialSymbolProps } from '@react-navigation/native';
2
+ import * as React from 'react';
3
+ import type { Animated, ColorValue, ImageSourcePropType, LayoutChangeEvent, StyleProp, TextInputProps, TextStyle, ViewStyle } from 'react-native';
4
+ import type { SFSymbol } from 'sf-symbols-typescript';
2
5
  import type { BlurEffectType } from './getBlurBackgroundColor';
3
6
  export type HeaderBackButtonDisplayMode = 'default' | 'generic' | 'minimal';
4
7
  export type Layout = {
5
8
  width: number;
6
9
  height: number;
7
10
  };
11
+ type IconImage = {
12
+ /**
13
+ * - `image` - Use a local image as the icon.
14
+ */
15
+ type: 'image';
16
+ /**
17
+ * Image source to use as the icon.
18
+ * - Local image: `require('./path/to/image.png')`
19
+ * - Drawable resource or xcasset: `{ uri: 'image_name' }`
20
+ */
21
+ source: ImageSourcePropType;
22
+ /**
23
+ * Whether to apply tint color to the image.
24
+ * Disabling will keep the image's original colors.
25
+ *
26
+ * Defaults to `true`.
27
+ */
28
+ tinted?: boolean;
29
+ };
30
+ type IconSfSymbol = {
31
+ /**
32
+ * - `sfSymbol` - Use an SF Symbol as the icon on iOS.
33
+ */
34
+ type: 'sfSymbol';
35
+ /**
36
+ * Name of the SF Symbol to use as the icon.
37
+ */
38
+ name: SFSymbol;
39
+ };
40
+ type IconMaterialSymbol = {
41
+ /**
42
+ * - `materialSymbol` - Use a Material Symbol as the icon on Android.
43
+ */
44
+ type: 'materialSymbol';
45
+ } & Pick<MaterialSymbolProps, 'name' | 'variant' | 'weight'>;
46
+ export type Icon = IconSfSymbol | IconMaterialSymbol | IconImage;
8
47
  export type HeaderSearchBarRef = {
9
48
  focus: () => void;
10
49
  blur: () => void;
@@ -23,59 +62,59 @@ export type HeaderSearchBarOptions = {
23
62
  * - `clearText` - removes any text present in the search bar input field
24
63
  * - `cancelSearch` - cancel the search and close the search bar
25
64
  */
26
- ref?: React.Ref<HeaderSearchBarRef>;
65
+ ref?: React.Ref<HeaderSearchBarRef> | undefined;
27
66
  /**
28
67
  * The auto-capitalization behavior
29
68
  */
30
- autoCapitalize?: 'none' | 'words' | 'sentences' | 'characters' | 'systemDefault';
69
+ autoCapitalize?: 'none' | 'words' | 'sentences' | 'characters' | 'systemDefault' | undefined;
31
70
  /**
32
71
  * Automatically focuses search input on mount
33
72
  */
34
- autoFocus?: boolean;
73
+ autoFocus?: boolean | undefined;
35
74
  /**
36
75
  * The text to be used instead of default `Cancel` button text
37
76
  *
38
77
  * @platform ios
39
78
  */
40
- cancelButtonText?: string;
79
+ cancelButtonText?: string | undefined;
41
80
  /**
42
81
  * Sets type of the input. Defaults to `text`.
43
82
  */
44
- inputType?: 'text' | 'phone' | 'number' | 'email';
83
+ inputType?: 'text' | 'phone' | 'number' | 'email' | undefined;
45
84
  /**
46
85
  * Determines how the return key should look. Defaults to `search`.
47
86
  */
48
- enterKeyHint?: TextInputProps['enterKeyHint'];
87
+ enterKeyHint?: TextInputProps['enterKeyHint'] | undefined;
49
88
  /**
50
89
  * A callback that gets called when search input has lost focus
51
90
  */
52
- onBlur?: TextInputProps['onBlur'];
91
+ onBlur?: TextInputProps['onBlur'] | undefined;
53
92
  /**
54
93
  * A callback that gets called when the text changes.
55
94
  * It receives the current text value of the search input.
56
95
  */
57
- onChange?: TextInputProps['onChange'];
96
+ onChange?: TextInputProps['onChange'] | undefined;
58
97
  /**
59
98
  * Callback that is called when the submit button is pressed.
60
99
  * It receives the current text value of the search input.
61
100
  */
62
- onSubmitEditing?: TextInputProps['onSubmitEditing'];
101
+ onSubmitEditing?: TextInputProps['onSubmitEditing'] | undefined;
63
102
  /**
64
103
  * A callback that gets called when search input is opened
65
104
  */
66
- onOpen?: () => void;
105
+ onOpen?: (() => void) | undefined;
67
106
  /**
68
107
  * A callback that gets called when search input is closed
69
108
  */
70
- onClose?: () => void;
109
+ onClose?: (() => void) | undefined;
71
110
  /**
72
111
  * A callback that gets called when search input has received focus
73
112
  */
74
- onFocus?: TextInputProps['onFocus'];
113
+ onFocus?: TextInputProps['onFocus'] | undefined;
75
114
  /**
76
115
  * Text displayed when search field is empty
77
116
  */
78
- placeholder?: string;
117
+ placeholder?: string | undefined;
79
118
  };
80
119
  export type HeaderOptions = {
81
120
  /**
@@ -85,28 +124,28 @@ export type HeaderOptions = {
85
124
  * It receives `allowFontScaling`, `tintColor`, `style` and `children` in the options object as an argument.
86
125
  * The title string is passed in `children`.
87
126
  */
88
- headerTitle?: string | ((props: HeaderTitleProps) => React.ReactNode);
127
+ headerTitle?: string | ((props: HeaderTitleProps) => React.ReactNode) | undefined;
89
128
  /**
90
129
  * How to align the the header title.
91
130
  * Defaults to `center` on iOS and `left` on Android.
92
131
  */
93
- headerTitleAlign?: 'left' | 'center';
132
+ headerTitleAlign?: 'left' | 'center' | undefined;
94
133
  /**
95
134
  * Style object for the title component.
96
135
  */
97
- headerTitleStyle?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;
136
+ headerTitleStyle?: Animated.WithAnimatedValue<StyleProp<TextStyle>> | undefined;
98
137
  /**
99
138
  * Style object for the container of the `headerTitle` element.
100
139
  */
101
- headerTitleContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
140
+ headerTitleContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>> | undefined;
102
141
  /**
103
142
  * Whether header title font should scale to respect Text Size accessibility settings. Defaults to `false`.
104
143
  */
105
- headerTitleAllowFontScaling?: boolean;
144
+ headerTitleAllowFontScaling?: boolean | undefined;
106
145
  /**
107
146
  * Options to render a search bar.
108
147
  */
109
- headerSearchBarOptions?: HeaderSearchBarOptions;
148
+ headerSearchBarOptions?: HeaderSearchBarOptions | undefined;
110
149
  /**
111
150
  * How the back button displays icon and title.
112
151
  *
@@ -117,25 +156,25 @@ export type HeaderOptions = {
117
156
  *
118
157
  * Defaults to "default" on iOS, and "minimal" on other platforms.
119
158
  */
120
- headerBackButtonDisplayMode?: HeaderBackButtonDisplayMode;
159
+ headerBackButtonDisplayMode?: HeaderBackButtonDisplayMode | undefined;
121
160
  /**
122
161
  * Style object for header back title. Supported properties:
123
162
  * - fontFamily
124
163
  * - fontSize
125
164
  */
126
165
  headerBackTitleStyle?: StyleProp<{
127
- fontFamily?: string;
128
- fontSize?: number;
129
- }>;
166
+ fontFamily?: string | undefined;
167
+ fontSize?: number | undefined;
168
+ }> | undefined;
130
169
  /**
131
170
  * Function which returns a React Element to display on the left side of the header.
132
171
  */
133
- headerLeft?: (props: HeaderBackButtonProps & {
172
+ headerLeft?: ((props: HeaderBackButtonProps & {
134
173
  /**
135
174
  * Whether it's possible to navigate back.
136
175
  */
137
- canGoBack?: boolean;
138
- }) => React.ReactNode;
176
+ canGoBack?: boolean | undefined;
177
+ }) => React.ReactNode) | undefined;
139
178
  /**
140
179
  * Whether the liquid glass background is visible for the item.
141
180
  *
@@ -144,20 +183,20 @@ export type HeaderOptions = {
144
183
  *
145
184
  * Defaults to `true`.
146
185
  */
147
- headerLeftBackgroundVisible?: boolean;
186
+ headerLeftBackgroundVisible?: boolean | undefined;
148
187
  /**
149
188
  * Style object for the container of the `headerLeft` element`.
150
189
  */
151
- headerLeftContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
190
+ headerLeftContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>> | undefined;
152
191
  /**
153
192
  * Function which returns a React Element to display on the right side of the header.
154
193
  */
155
- headerRight?: (props: {
156
- tintColor?: ColorValue;
157
- pressColor?: ColorValue;
158
- pressOpacity?: number;
194
+ headerRight?: ((props: {
195
+ tintColor?: ColorValue | undefined;
196
+ pressColor?: ColorValue | undefined;
197
+ pressOpacity?: number | undefined;
159
198
  canGoBack: boolean;
160
- }) => React.ReactNode;
199
+ }) => React.ReactNode) | undefined;
161
200
  /**
162
201
  * Whether the liquid glass background is visible for the item.
163
202
  *
@@ -166,41 +205,41 @@ export type HeaderOptions = {
166
205
  *
167
206
  * Defaults to `true`.
168
207
  */
169
- headerRightBackgroundVisible?: boolean;
208
+ headerRightBackgroundVisible?: boolean | undefined;
170
209
  /**
171
210
  * Style object for the container of the `headerRight` element.
172
211
  */
173
- headerRightContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
212
+ headerRightContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>> | undefined;
174
213
  /**
175
214
  * Color for material ripple (Android >= 5.0 only).
176
215
  */
177
- headerPressColor?: ColorValue;
216
+ headerPressColor?: ColorValue | undefined;
178
217
  /**
179
218
  * Color for material ripple (Android >= 5.0 only).
180
219
  */
181
- headerPressOpacity?: number;
220
+ headerPressOpacity?: number | undefined;
182
221
  /**
183
222
  * Tint color for the header.
184
223
  */
185
- headerTintColor?: ColorValue;
224
+ headerTintColor?: ColorValue | undefined;
186
225
  /**
187
226
  * Function which returns a React Element to render as the background of the header.
188
227
  * This is useful for using backgrounds such as an image, a gradient, blur effect etc.
189
228
  * You can use this with `headerTransparent` to render a blur view, for example, to create a translucent header.
190
229
  */
191
- headerBackground?: (props: {
230
+ headerBackground?: ((props: {
192
231
  style: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
193
- }) => React.ReactNode;
232
+ }) => React.ReactNode) | undefined;
194
233
  /**
195
234
  * Style object for the container of the `headerBackground` element.
196
235
  */
197
- headerBackgroundContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
236
+ headerBackgroundContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>> | undefined;
198
237
  /**
199
238
  * Defaults to `false`. If `true`, the header will not have a background unless you explicitly provide it with `headerBackground`.
200
239
  * The header will also float over the screen so that it overlaps the content underneath.
201
240
  * This is useful if you want to render a semi-transparent header or a blurred background.
202
241
  */
203
- headerTransparent?: boolean;
242
+ headerTransparent?: boolean | undefined;
204
243
  /**
205
244
  * Blur effect for the translucent header.
206
245
  * The `headerTransparent` option needs to be set to `true` for this to work.
@@ -209,11 +248,11 @@ export type HeaderOptions = {
209
248
  *
210
249
  * @platform web
211
250
  */
212
- headerBlurEffect?: BlurEffectType | 'none';
251
+ headerBlurEffect?: BlurEffectType | 'none' | undefined;
213
252
  /**
214
253
  * Style object for the header. You can specify a custom background color here, for example.
215
254
  */
216
- headerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
255
+ headerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>> | undefined;
217
256
  /**
218
257
  * Whether to hide the elevation shadow (Android) or the bottom border (iOS) on the header.
219
258
  *
@@ -230,13 +269,13 @@ export type HeaderOptions = {
230
269
  * If the above styles are specified in `headerStyle` along with `headerShadowVisible: false`,
231
270
  * then `headerShadowVisible: false` will take precedence.
232
271
  */
233
- headerShadowVisible?: boolean;
272
+ headerShadowVisible?: boolean | undefined;
234
273
  /**
235
274
  * Extra padding to add at the top of header to account for translucent status bar.
236
275
  * By default, it uses the top value from the safe area insets of the device.
237
276
  * Pass 0 or a custom value to disable the default behaviour, and customize the height.
238
277
  */
239
- headerStatusBarHeight?: number;
278
+ headerStatusBarHeight?: number | undefined;
240
279
  };
241
280
  export type HeaderTitleProps = {
242
281
  /**
@@ -246,57 +285,57 @@ export type HeaderTitleProps = {
246
285
  /**
247
286
  * Whether title font should scale to respect Text Size accessibility settings.
248
287
  */
249
- allowFontScaling?: boolean;
288
+ allowFontScaling?: boolean | undefined;
250
289
  /**
251
290
  * Tint color for the header.
252
291
  */
253
- tintColor?: ColorValue;
292
+ tintColor?: ColorValue | undefined;
254
293
  /**
255
294
  * Callback to trigger when the size of the title element changes.
256
295
  */
257
- onLayout?: (e: LayoutChangeEvent) => void;
296
+ onLayout?: ((e: LayoutChangeEvent) => void) | undefined;
258
297
  /**
259
298
  * Style object for the title element.
260
299
  */
261
- style?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;
300
+ style?: Animated.WithAnimatedValue<StyleProp<TextStyle>> | undefined;
262
301
  };
263
302
  export type HeaderButtonProps = {
264
303
  /**
265
304
  * Callback to call when the button is pressed.
266
305
  */
267
- onPress?: () => void;
306
+ onPress?: (() => void) | undefined;
268
307
  /**
269
308
  * The `href` to use for the anchor tag on web
270
309
  */
271
- href?: string;
310
+ href?: string | undefined;
272
311
  /**
273
312
  * Whether the button is disabled.
274
313
  */
275
- disabled?: boolean;
314
+ disabled?: boolean | undefined;
276
315
  /**
277
316
  * Accessibility label for the button for screen readers.
278
317
  */
279
- accessibilityLabel?: string;
318
+ accessibilityLabel?: string | undefined;
280
319
  /**
281
320
  * ID to locate this button in tests.
282
321
  */
283
- testID?: string;
322
+ testID?: string | undefined;
284
323
  /**
285
324
  * Tint color for the header button.
286
325
  */
287
- tintColor?: ColorValue;
326
+ tintColor?: ColorValue | undefined;
288
327
  /**
289
328
  * Color for material ripple (Android >= 5.0 only).
290
329
  */
291
- pressColor?: ColorValue;
330
+ pressColor?: ColorValue | undefined;
292
331
  /**
293
332
  * Opacity when the button is pressed, used when ripple is not supported.
294
333
  */
295
- pressOpacity?: number;
334
+ pressOpacity?: number | undefined;
296
335
  /**
297
336
  * Style object for the button.
298
337
  */
299
- style?: StyleProp<ViewStyle>;
338
+ style?: StyleProp<ViewStyle> | undefined;
300
339
  /**
301
340
  * Content to render for the button. Usually the icon.
302
341
  */
@@ -304,20 +343,30 @@ export type HeaderButtonProps = {
304
343
  };
305
344
  export type HeaderBackButtonProps = Omit<HeaderButtonProps, 'children'> & {
306
345
  /**
307
- * Function which returns a React Element to display custom image in header's back button.
346
+ * Icon to display for the back button.
347
+ *
348
+ * Supported types:
349
+ * - image: custom image source
350
+ * - sfSymbol: SF Symbol icon (iOS only)
351
+ * - materialSymbol: material symbol icon (Android only)
352
+ * - React Node: function that returns a React Element
353
+ *
354
+ * Defaults to back icon image for the platform
355
+ * - A chevron on iOS
356
+ * - An arrow on Android
308
357
  */
309
- backImage?: (props: {
310
- tintColor: ColorValue;
311
- }) => React.ReactNode;
358
+ icon?: Icon | ((props: {
359
+ tintColor: ColorValue | undefined;
360
+ }) => React.ReactNode) | undefined;
312
361
  /**
313
362
  * Label text for the button. Usually the title of the previous screen.
314
363
  * By default, this is only shown on iOS.
315
364
  */
316
- label?: string;
365
+ label?: string | undefined;
317
366
  /**
318
367
  * Label text to show when there isn't enough space for the full label.
319
368
  */
320
- truncatedLabel?: string;
369
+ truncatedLabel?: string | undefined;
321
370
  /**
322
371
  * How the back button displays icon and title.
323
372
  *
@@ -328,14 +377,15 @@ export type HeaderBackButtonProps = Omit<HeaderButtonProps, 'children'> & {
328
377
  *
329
378
  * Defaults to "default" on iOS, and "minimal" on other platforms.
330
379
  */
331
- displayMode?: HeaderBackButtonDisplayMode;
380
+ displayMode?: HeaderBackButtonDisplayMode | undefined;
332
381
  /**
333
382
  * Style object for the label.
334
383
  */
335
- labelStyle?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;
384
+ labelStyle?: Animated.WithAnimatedValue<StyleProp<TextStyle>> | undefined;
336
385
  /**
337
386
  * Whether label font should scale to respect Text Size accessibility settings.
338
387
  */
339
- allowFontScaling?: boolean;
388
+ allowFontScaling?: boolean | undefined;
340
389
  };
390
+ export {};
341
391
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,MAAM,2BAA2B,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAE5E,MAAM,MAAM,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;;;;;;;OASG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAC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ACH,UAAU,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC;IAC1E;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACxC,CAAC"}
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": "3.0.0-alpha.2",
4
+ "version": "3.0.0-alpha.20",
5
5
  "keywords": [
6
6
  "react-native",
7
7
  "react-navigation",
@@ -48,31 +48,32 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "color": "^4.2.3",
51
+ "sf-symbols-typescript": "^2.2.0",
51
52
  "use-latest-callback": "^0.3.2",
52
53
  "use-sync-external-store": "^1.5.0"
53
54
  },
54
55
  "devDependencies": {
55
56
  "@callstack/liquid-glass": "^0.6.0",
56
57
  "@jest/globals": "^30.0.0",
57
- "@react-navigation/native": "^8.0.0-alpha.2",
58
- "@testing-library/react-native": "^13.2.1",
59
- "@types/react": "~19.1.10",
58
+ "@react-navigation/native": "^8.0.0-alpha.17",
59
+ "@testing-library/react-native": "^13.3.3",
60
+ "@types/react": "~19.2.2",
60
61
  "@types/use-sync-external-store": "^1.5.0",
61
62
  "del-cli": "^6.0.0",
62
- "react": "19.1.0",
63
- "react-native": "0.81.4",
63
+ "react": "19.2.0",
64
+ "react-native": "0.83.2",
64
65
  "react-native-builder-bob": "^0.40.12",
65
- "react-native-screens": "^4.20.0",
66
- "react-test-renderer": "19.1.0",
67
- "typescript": "^5.9.2"
66
+ "react-native-screens": "^4.24.0",
67
+ "react-test-renderer": "19.2.0",
68
+ "typescript": "^6.0.2"
68
69
  },
69
70
  "peerDependencies": {
70
71
  "@callstack/liquid-glass": ">= 0.6.0",
71
- "@react-navigation/native": "^8.0.0-alpha.2",
72
- "react": ">= 19.0.0",
72
+ "@react-navigation/native": "^8.0.0-alpha.17",
73
+ "react": ">= 19.2.0",
73
74
  "react-native": "*",
74
75
  "react-native-safe-area-context": ">= 5.5.0",
75
- "react-native-screens": ">= 4.19.0"
76
+ "react-native-screens": ">= 4.24.0"
76
77
  },
77
78
  "react-native-builder-bob": {
78
79
  "source": "src",
@@ -92,5 +93,5 @@
92
93
  ]
93
94
  ]
94
95
  },
95
- "gitHead": "9664da8fff3bd7ed575bf12ddfcc47b3a42be997"
96
+ "gitHead": "97bdf9c98215e82b3c80fb3820ab072867283d54"
96
97
  }
@@ -0,0 +1,90 @@
1
+ import { Activity, useEffect, useState } from 'react';
2
+ import {
3
+ type HostComponent,
4
+ NativeComponentRegistry,
5
+ type ViewProps,
6
+ } from 'react-native';
7
+
8
+ // eslint-disable-next-line import-x/extensions
9
+ import type { Props } from './ActivityView.tsx';
10
+ import { Container } from './Container';
11
+
12
+ export function ActivityView({
13
+ mode,
14
+ visible,
15
+ delay = 500,
16
+ style,
17
+ children,
18
+ }: Props) {
19
+ const [delayedMode, setDelayedMode] = useState(mode);
20
+
21
+ useEffect(() => {
22
+ if (!delay) {
23
+ return;
24
+ }
25
+
26
+ const timer = setTimeout(() => {
27
+ setDelayedMode(mode);
28
+ }, delay);
29
+
30
+ return () => clearTimeout(timer);
31
+ }, [delay, mode]);
32
+
33
+ const display = visible ? 'flex' : 'none';
34
+ const activityMode =
35
+ mode !== 'paused' || (delay && delayedMode !== 'paused')
36
+ ? 'visible'
37
+ : 'hidden';
38
+
39
+ return (
40
+ <Activity mode={activityMode}>
41
+ <ActivityContentView style={{ display: 'contents' }}>
42
+ <Container
43
+ inert={mode !== 'normal'}
44
+ style={{
45
+ ...style,
46
+ /**
47
+ * The visibility of the nested view is controlled by `Activity`
48
+ * It'll be overridden to `display: 'none'` when `mode="hidden"` regardless of what we set
49
+ * So we set the visibility on another view instead
50
+ */
51
+ display,
52
+ }}
53
+ >
54
+ {children}
55
+ </Container>
56
+ </ActivityContentView>
57
+ </Activity>
58
+ );
59
+ }
60
+
61
+ const STYLE: Record<string, true | { process?: (arg1: any) => any }> = {
62
+ display: {
63
+ /**
64
+ * React `Activity` sets `display: 'none'` when `mode="hidden"` to unmount effects
65
+ * But we want to keep the content visible, so we switch it to `display: 'contents'`
66
+ */
67
+ process: () => 'contents',
68
+ },
69
+ };
70
+
71
+ const VIEW_CONFIG = {
72
+ uiViewClassName: 'RCTView',
73
+ validAttributes: {
74
+ style: STYLE,
75
+ },
76
+ };
77
+
78
+ type ActivityContentViewProps = Omit<ViewProps, 'style'> & {
79
+ style?:
80
+ | {
81
+ display?: 'contents' | undefined;
82
+ }
83
+ | undefined;
84
+ };
85
+
86
+ const ActivityContentView: HostComponent<ActivityContentViewProps> =
87
+ NativeComponentRegistry.get<ActivityContentViewProps>(
88
+ 'ReactNavigationActivityContentView',
89
+ () => VIEW_CONFIG
90
+ );