@react-navigation/native-stack 7.0.0-rc.8 → 7.0.0

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 (173) hide show
  1. package/lib/commonjs/{index.cjs → index.js} +4 -4
  2. package/lib/commonjs/navigators/{createNativeStackNavigator.cjs → createNativeStackNavigator.js} +5 -3
  3. package/lib/commonjs/navigators/createNativeStackNavigator.js.map +1 -0
  4. package/lib/commonjs/package.json +1 -0
  5. package/lib/commonjs/{types.cjs → types.js} +1 -1
  6. package/lib/commonjs/utils/{debounce.cjs → debounce.js} +1 -1
  7. package/lib/commonjs/utils/{debounce.cjs.map → debounce.js.map} +1 -1
  8. package/lib/commonjs/utils/{getModalRoutesKeys.cjs → getModalRoutesKeys.js} +1 -1
  9. package/lib/commonjs/utils/{useAnimatedHeaderHeight.cjs → useAnimatedHeaderHeight.js} +1 -1
  10. package/lib/commonjs/utils/{useDismissedRouteError.cjs → useDismissedRouteError.js} +1 -1
  11. package/lib/commonjs/utils/{useInvalidPreventRemoveError.cjs → useInvalidPreventRemoveError.js} +1 -1
  12. package/lib/commonjs/views/{FontProcessor.cjs → FontProcessor.js} +1 -1
  13. package/lib/commonjs/views/{FontProcessor.native.cjs → FontProcessor.native.js} +1 -1
  14. package/lib/commonjs/views/FooterComponent.js +19 -0
  15. package/lib/commonjs/views/FooterComponent.js.map +1 -0
  16. package/lib/commonjs/views/{NativeStackView.cjs → NativeStackView.js} +46 -50
  17. package/lib/commonjs/views/NativeStackView.js.map +1 -0
  18. package/lib/commonjs/views/{NativeStackView.native.cjs → NativeStackView.native.js} +132 -145
  19. package/lib/commonjs/views/NativeStackView.native.js.map +1 -0
  20. package/lib/commonjs/views/{HeaderConfig.cjs → useHeaderConfigProps.js} +70 -49
  21. package/lib/commonjs/views/useHeaderConfigProps.js.map +1 -0
  22. package/lib/module/{index.mjs → index.js} +6 -4
  23. package/lib/module/index.js.map +1 -0
  24. package/lib/module/navigators/{createNativeStackNavigator.mjs → createNativeStackNavigator.js} +7 -3
  25. package/lib/module/navigators/createNativeStackNavigator.js.map +1 -0
  26. package/lib/module/package.json +1 -0
  27. package/lib/module/types.js +4 -0
  28. package/lib/module/utils/{debounce.mjs → debounce.js} +3 -1
  29. package/lib/module/utils/debounce.js.map +1 -0
  30. package/lib/module/utils/{getModalRoutesKeys.mjs → getModalRoutesKeys.js} +3 -1
  31. package/lib/module/utils/getModalRoutesKeys.js.map +1 -0
  32. package/lib/module/utils/{useAnimatedHeaderHeight.mjs → useAnimatedHeaderHeight.js} +3 -1
  33. package/lib/module/utils/useAnimatedHeaderHeight.js.map +1 -0
  34. package/lib/module/utils/{useDismissedRouteError.mjs → useDismissedRouteError.js} +3 -1
  35. package/lib/module/utils/useDismissedRouteError.js.map +1 -0
  36. package/lib/module/utils/{useInvalidPreventRemoveError.mjs → useInvalidPreventRemoveError.js} +3 -1
  37. package/lib/module/utils/useInvalidPreventRemoveError.js.map +1 -0
  38. package/lib/module/views/{FontProcessor.mjs → FontProcessor.js} +3 -1
  39. package/lib/module/views/{FontProcessor.mjs.map → FontProcessor.js.map} +1 -1
  40. package/lib/module/views/{FontProcessor.native.mjs → FontProcessor.native.js} +3 -1
  41. package/lib/module/views/FontProcessor.native.js.map +1 -0
  42. package/lib/module/views/FooterComponent.js +14 -0
  43. package/lib/module/views/FooterComponent.js.map +1 -0
  44. package/lib/module/views/{NativeStackView.mjs → NativeStackView.js} +50 -52
  45. package/lib/module/views/NativeStackView.js.map +1 -0
  46. package/lib/module/views/{NativeStackView.native.mjs → NativeStackView.native.js} +135 -145
  47. package/lib/module/views/NativeStackView.native.js.map +1 -0
  48. package/lib/module/views/{HeaderConfig.mjs → useHeaderConfigProps.js} +72 -49
  49. package/lib/module/views/useHeaderConfigProps.js.map +1 -0
  50. package/lib/typescript/commonjs/package.json +1 -0
  51. package/lib/typescript/{src → commonjs/src}/index.d.ts +1 -1
  52. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  53. package/lib/typescript/{src → commonjs/src}/navigators/createNativeStackNavigator.d.ts +2 -2
  54. package/lib/typescript/commonjs/src/navigators/createNativeStackNavigator.d.ts.map +1 -0
  55. package/lib/typescript/{src → commonjs/src}/types.d.ts +113 -35
  56. package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
  57. package/lib/typescript/commonjs/src/utils/debounce.d.ts.map +1 -0
  58. package/lib/typescript/commonjs/src/utils/getModalRoutesKeys.d.ts.map +1 -0
  59. package/lib/typescript/commonjs/src/utils/useAnimatedHeaderHeight.d.ts.map +1 -0
  60. package/lib/typescript/commonjs/src/utils/useDismissedRouteError.d.ts.map +1 -0
  61. package/lib/typescript/commonjs/src/utils/useInvalidPreventRemoveError.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/src/views/FontProcessor.d.ts.map +1 -0
  63. package/lib/typescript/commonjs/src/views/FontProcessor.native.d.ts.map +1 -0
  64. package/lib/typescript/commonjs/src/views/FooterComponent.d.ts +7 -0
  65. package/lib/typescript/commonjs/src/views/FooterComponent.d.ts.map +1 -0
  66. package/lib/typescript/commonjs/src/views/NativeStackView.d.ts +11 -0
  67. package/lib/typescript/commonjs/src/views/NativeStackView.d.ts.map +1 -0
  68. package/lib/typescript/commonjs/src/views/NativeStackView.native.d.ts +11 -0
  69. package/lib/typescript/commonjs/src/views/NativeStackView.native.d.ts.map +1 -0
  70. package/lib/typescript/commonjs/src/views/useHeaderConfigProps.d.ts +41 -0
  71. package/lib/typescript/commonjs/src/views/useHeaderConfigProps.d.ts.map +1 -0
  72. package/lib/typescript/commonjs/tsconfig.build.tsbuildinfo +1 -0
  73. package/lib/typescript/module/package.json +1 -0
  74. package/lib/typescript/module/src/index.d.ts +17 -0
  75. package/lib/typescript/module/src/index.d.ts.map +1 -0
  76. package/lib/typescript/module/src/navigators/createNativeStackNavigator.d.ts +16 -0
  77. package/lib/typescript/module/src/navigators/createNativeStackNavigator.d.ts.map +1 -0
  78. package/lib/typescript/module/src/types.d.ts +623 -0
  79. package/lib/typescript/module/src/types.d.ts.map +1 -0
  80. package/lib/typescript/module/src/utils/debounce.d.ts +2 -0
  81. package/lib/typescript/module/src/utils/debounce.d.ts.map +1 -0
  82. package/lib/typescript/module/src/utils/getModalRoutesKeys.d.ts +4 -0
  83. package/lib/typescript/module/src/utils/getModalRoutesKeys.d.ts.map +1 -0
  84. package/lib/typescript/module/src/utils/useAnimatedHeaderHeight.d.ts +5 -0
  85. package/lib/typescript/module/src/utils/useAnimatedHeaderHeight.d.ts.map +1 -0
  86. package/lib/typescript/module/src/utils/useDismissedRouteError.d.ts +6 -0
  87. package/lib/typescript/module/src/utils/useDismissedRouteError.d.ts.map +1 -0
  88. package/lib/typescript/module/src/utils/useInvalidPreventRemoveError.d.ts +3 -0
  89. package/lib/typescript/module/src/utils/useInvalidPreventRemoveError.d.ts.map +1 -0
  90. package/lib/typescript/module/src/views/FontProcessor.d.ts +2 -0
  91. package/lib/typescript/module/src/views/FontProcessor.d.ts.map +1 -0
  92. package/lib/typescript/module/src/views/FontProcessor.native.d.ts +2 -0
  93. package/lib/typescript/module/src/views/FontProcessor.native.d.ts.map +1 -0
  94. package/lib/typescript/module/src/views/FooterComponent.d.ts +7 -0
  95. package/lib/typescript/module/src/views/FooterComponent.d.ts.map +1 -0
  96. package/lib/typescript/module/src/views/NativeStackView.d.ts +11 -0
  97. package/lib/typescript/module/src/views/NativeStackView.d.ts.map +1 -0
  98. package/lib/typescript/module/src/views/NativeStackView.native.d.ts +11 -0
  99. package/lib/typescript/module/src/views/NativeStackView.native.d.ts.map +1 -0
  100. package/lib/typescript/module/src/views/useHeaderConfigProps.d.ts +41 -0
  101. package/lib/typescript/module/src/views/useHeaderConfigProps.d.ts.map +1 -0
  102. package/lib/typescript/module/tsconfig.build.tsbuildinfo +1 -0
  103. package/package.json +36 -19
  104. package/src/index.tsx +2 -0
  105. package/src/navigators/createNativeStackNavigator.tsx +6 -5
  106. package/src/types.tsx +107 -35
  107. package/src/utils/debounce.tsx +1 -1
  108. package/src/views/FooterComponent.tsx +10 -0
  109. package/src/views/NativeStackView.native.tsx +168 -202
  110. package/src/views/NativeStackView.tsx +62 -50
  111. package/src/views/{HeaderConfig.tsx → useHeaderConfigProps.tsx} +80 -63
  112. package/lib/commonjs/navigators/createNativeStackNavigator.cjs.map +0 -1
  113. package/lib/commonjs/views/DebugContainer.cjs +0 -22
  114. package/lib/commonjs/views/DebugContainer.cjs.map +0 -1
  115. package/lib/commonjs/views/DebugContainer.native.cjs +0 -49
  116. package/lib/commonjs/views/DebugContainer.native.cjs.map +0 -1
  117. package/lib/commonjs/views/HeaderConfig.cjs.map +0 -1
  118. package/lib/commonjs/views/NativeStackView.cjs.map +0 -1
  119. package/lib/commonjs/views/NativeStackView.native.cjs.map +0 -1
  120. package/lib/module/index.mjs.map +0 -1
  121. package/lib/module/navigators/createNativeStackNavigator.mjs.map +0 -1
  122. package/lib/module/types.mjs +0 -2
  123. package/lib/module/utils/debounce.mjs.map +0 -1
  124. package/lib/module/utils/getModalRoutesKeys.mjs.map +0 -1
  125. package/lib/module/utils/useAnimatedHeaderHeight.mjs.map +0 -1
  126. package/lib/module/utils/useDismissedRouteError.mjs.map +0 -1
  127. package/lib/module/utils/useInvalidPreventRemoveError.mjs.map +0 -1
  128. package/lib/module/views/DebugContainer.mjs +0 -14
  129. package/lib/module/views/DebugContainer.mjs.map +0 -1
  130. package/lib/module/views/DebugContainer.native.mjs +0 -38
  131. package/lib/module/views/DebugContainer.native.mjs.map +0 -1
  132. package/lib/module/views/FontProcessor.native.mjs.map +0 -1
  133. package/lib/module/views/HeaderConfig.mjs.map +0 -1
  134. package/lib/module/views/NativeStackView.mjs.map +0 -1
  135. package/lib/module/views/NativeStackView.native.mjs.map +0 -1
  136. package/lib/typescript/src/index.d.ts.map +0 -1
  137. package/lib/typescript/src/navigators/createNativeStackNavigator.d.ts.map +0 -1
  138. package/lib/typescript/src/types.d.ts.map +0 -1
  139. package/lib/typescript/src/utils/debounce.d.ts.map +0 -1
  140. package/lib/typescript/src/utils/getModalRoutesKeys.d.ts.map +0 -1
  141. package/lib/typescript/src/utils/useAnimatedHeaderHeight.d.ts.map +0 -1
  142. package/lib/typescript/src/utils/useDismissedRouteError.d.ts.map +0 -1
  143. package/lib/typescript/src/utils/useInvalidPreventRemoveError.d.ts.map +0 -1
  144. package/lib/typescript/src/views/DebugContainer.d.ts +0 -10
  145. package/lib/typescript/src/views/DebugContainer.d.ts.map +0 -1
  146. package/lib/typescript/src/views/DebugContainer.native.d.ts +0 -15
  147. package/lib/typescript/src/views/DebugContainer.native.d.ts.map +0 -1
  148. package/lib/typescript/src/views/FontProcessor.d.ts.map +0 -1
  149. package/lib/typescript/src/views/FontProcessor.native.d.ts.map +0 -1
  150. package/lib/typescript/src/views/HeaderConfig.d.ts +0 -11
  151. package/lib/typescript/src/views/HeaderConfig.d.ts.map +0 -1
  152. package/lib/typescript/src/views/NativeStackView.d.ts +0 -10
  153. package/lib/typescript/src/views/NativeStackView.d.ts.map +0 -1
  154. package/lib/typescript/src/views/NativeStackView.native.d.ts +0 -10
  155. package/lib/typescript/src/views/NativeStackView.native.d.ts.map +0 -1
  156. package/src/views/DebugContainer.native.tsx +0 -36
  157. package/src/views/DebugContainer.tsx +0 -14
  158. /package/lib/commonjs/{index.cjs.map → index.js.map} +0 -0
  159. /package/lib/commonjs/{types.cjs.map → types.js.map} +0 -0
  160. /package/lib/commonjs/utils/{getModalRoutesKeys.cjs.map → getModalRoutesKeys.js.map} +0 -0
  161. /package/lib/commonjs/utils/{useAnimatedHeaderHeight.cjs.map → useAnimatedHeaderHeight.js.map} +0 -0
  162. /package/lib/commonjs/utils/{useDismissedRouteError.cjs.map → useDismissedRouteError.js.map} +0 -0
  163. /package/lib/commonjs/utils/{useInvalidPreventRemoveError.cjs.map → useInvalidPreventRemoveError.js.map} +0 -0
  164. /package/lib/commonjs/views/{FontProcessor.cjs.map → FontProcessor.js.map} +0 -0
  165. /package/lib/commonjs/views/{FontProcessor.native.cjs.map → FontProcessor.native.js.map} +0 -0
  166. /package/lib/module/{types.mjs.map → types.js.map} +0 -0
  167. /package/lib/typescript/{src → commonjs/src}/utils/debounce.d.ts +0 -0
  168. /package/lib/typescript/{src → commonjs/src}/utils/getModalRoutesKeys.d.ts +0 -0
  169. /package/lib/typescript/{src → commonjs/src}/utils/useAnimatedHeaderHeight.d.ts +0 -0
  170. /package/lib/typescript/{src → commonjs/src}/utils/useDismissedRouteError.d.ts +0 -0
  171. /package/lib/typescript/{src → commonjs/src}/utils/useInvalidPreventRemoveError.d.ts +0 -0
  172. /package/lib/typescript/{src → commonjs/src}/views/FontProcessor.d.ts +0 -0
  173. /package/lib/typescript/{src → commonjs/src}/views/FontProcessor.native.d.ts +0 -0
package/src/types.tsx CHANGED
@@ -21,7 +21,6 @@ import type {
21
21
  ScreenProps,
22
22
  ScreenStackHeaderConfigProps,
23
23
  SearchBarProps,
24
- SheetDetentTypes,
25
24
  } from 'react-native-screens';
26
25
 
27
26
  export type NativeStackNavigationEventMap = {
@@ -37,6 +36,15 @@ export type NativeStackNavigationEventMap = {
37
36
  * Event which fires when a swipe back is canceled on iOS.
38
37
  */
39
38
  gestureCancel: { data: undefined };
39
+ /**
40
+ * Event which fires when screen is in sheet presentation & it's detent changes.
41
+ *
42
+ * In payload it caries two fields:
43
+ *
44
+ * * `index` - current detent index in the `sheetAllowedDetents` array,
45
+ * * `stable` - on Android `false` value means that the user is dragging the sheet or it is settling; on iOS it is always `true`.
46
+ */
47
+ sheetDetentChange: { data: { index: number; stable: boolean } };
40
48
  };
41
49
 
42
50
  export type NativeStackNavigationProp<
@@ -114,7 +122,7 @@ export type NativeStackHeaderRightProps = {
114
122
  /**
115
123
  * Whether it's possible to navigate back in stack.
116
124
  */
117
- canGoBack: boolean;
125
+ canGoBack?: boolean;
118
126
  };
119
127
 
120
128
  export type NativeStackHeaderLeftProps = NativeStackHeaderRightProps & {
@@ -148,29 +156,21 @@ export type NativeStackNavigationOptions = {
148
156
  /**
149
157
  * Title string used by the back button on iOS.
150
158
  * Defaults to the previous scene's title, or "Back" if there's not enough space.
151
- * Use `headerBackTitleVisible: false` to hide it.
159
+ * Use `headerBackButtonDisplayMode: "minimal"` to hide it.
152
160
  *
153
- * Only supported on iOS.
161
+ * Only supported on iOS and Web.
154
162
  *
155
- * @platform ios
163
+ * @platform ios, web
156
164
  */
157
165
  headerBackTitle?: string;
158
- /**
159
- * Whether the back button title should be visible or not.
160
- *
161
- * Only supported on iOS.
162
- *
163
- * @platform ios
164
- */
165
- headerBackTitleVisible?: boolean;
166
166
  /**
167
167
  * Style object for header back title. Supported properties:
168
168
  * - fontFamily
169
169
  * - fontSize
170
170
  *
171
- * Only supported on iOS.
171
+ * Only supported on iOS and Web.
172
172
  *
173
- * @platform ios
173
+ * @platform ios, web
174
174
  */
175
175
  headerBackTitleStyle?: StyleProp<{
176
176
  fontFamily?: string;
@@ -329,8 +329,6 @@ export type NativeStackNavigationOptions = {
329
329
  * Options to render a native search bar.
330
330
  * You also need to specify `contentInsetAdjustmentBehavior="automatic"` in your `ScrollView`, `FlatList` etc.
331
331
  * If you don't have a `ScrollView`, specify `headerTransparent: false`.
332
- *
333
- * Only supported on iOS and Android.
334
332
  */
335
333
  headerSearchBarOptions?: Omit<SearchBarProps, 'ref'>;
336
334
  /**
@@ -342,6 +340,29 @@ export type NativeStackNavigationOptions = {
342
340
  * @platform ios
343
341
  */
344
342
  headerBackButtonMenuEnabled?: boolean;
343
+ /**
344
+ * How the back button displays icon and title.
345
+ *
346
+ * Supported values:
347
+ * - "default" - Displays one of the following depending on the available space: previous screen's title, generic title (e.g. 'Back') or no title (only icon).
348
+ * - "generic" – Displays one of the following depending on the available space: generic title (e.g. 'Back') or no title (only icon).
349
+ * - "minimal" – Always displays only the icon without a title.
350
+ *
351
+ * The "generic" mode is not supported when:
352
+ * - The iOS version is lower than 14
353
+ * - Custom back title is set
354
+ * - Custom back title style is set
355
+ * - Back button menu is disabled
356
+ *
357
+ * In such cases, the "default" mode will be used instead.
358
+ *
359
+ * Defaults to "default" on iOS, and "minimal" on other platforms.
360
+ *
361
+ * Only supported on iOS and Web.
362
+ *
363
+ * @platform ios, web
364
+ */
365
+ headerBackButtonDisplayMode?: ScreenStackHeaderConfigProps['backButtonDisplayMode'];
345
366
  /**
346
367
  * Whether the home indicator should prefer to stay hidden on this screen. Defaults to `false`.
347
368
  *
@@ -444,6 +465,16 @@ export type NativeStackNavigationOptions = {
444
465
  * @platform ios
445
466
  */
446
467
  fullScreenGestureEnabled?: boolean;
468
+ /**
469
+ * Whether the full screen dismiss gesture has shadow under view during transition. The gesture uses custom transition and thus
470
+ * doesn't have a shadow by default. When enabled, a custom shadow view is added during the transition which tries to mimic the
471
+ * default iOS shadow. Defaults to `true`.
472
+ *
473
+ * This does not affect the behavior of transitions that don't use gestures, enabled by `fullScreenGestureEnabled` prop.
474
+ *
475
+ * @platform ios
476
+ */
477
+ fullScreenGestureShadowEnabled?: boolean;
447
478
  /**
448
479
  * Whether you can use gestures to dismiss this screen. Defaults to `true`.
449
480
  *
@@ -474,18 +505,21 @@ export type NativeStackNavigationOptions = {
474
505
  * Supported values:
475
506
  * - "default": use the platform default animation
476
507
  * - "fade": fade screen in or out
508
+ * - "fade_from_bottom" – performs a fade from bottom animation
477
509
  * - "flip": flip the screen, requires presentation: "modal" (iOS only)
478
510
  * - "simple_push": use the platform default animation, but without shadow and native header transition (iOS only)
479
511
  * - "slide_from_bottom": slide in the new screen from bottom
480
512
  * - "slide_from_right": slide in the new screen from right (Android only, uses default animation on iOS)
481
513
  * - "slide_from_left": slide in the new screen from left (Android only, uses default animation on iOS)
514
+ * - "ios_from_right" - iOS like slide in animation. pushes in the new screen from right to left (Android only, resolves to default transition on iOS)
515
+ * - "ios_from_left" - iOS like slide in animation. pushes in the new screen from left to right (Android only, resolves to default transition on iOS)
482
516
  * - "none": don't animate the screen
483
517
  *
484
518
  * Only supported on iOS and Android.
485
519
  */
486
520
  animation?: ScreenProps['stackAnimation'];
487
521
  /**
488
- * Changes the duration (in milliseconds) of `slide_from_bottom`, `fade_from_bottom`, `fade` and `simple_push` transitions on iOS. Defaults to `350`.
522
+ * Changes the duration (in milliseconds) of `slide_from_bottom`, `fade_from_bottom`, `fade` and `simple_push` transitions on iOS. Defaults to `500`.
489
523
  * The duration of `default` and `flip` transitions isn't customizable.
490
524
  *
491
525
  * @platform ios
@@ -509,17 +543,32 @@ export type NativeStackNavigationOptions = {
509
543
  /**
510
544
  * Describes heights where a sheet can rest.
511
545
  * Works only when `presentation` is set to `formSheet`.
512
- * Defaults to `large`.
513
546
  *
514
- * Available values:
547
+ * Heights should be described as fraction (a number from `[0, 1]` interval) of screen height / maximum detent height.
548
+ * You can pass an array of ascending values each defining allowed sheet detent. iOS accepts any number of detents,
549
+ * while **Android is limited to three**.
515
550
  *
516
- * - `large` - only large detent level will be allowed
517
- * - `medium` - only medium detent level will be allowed
518
- * - `all` - all detent levels will be allowed
551
+ * There is also possibility to specify `fitToContents` literal, which intents to set the sheet height
552
+ * to the height of its contents.
519
553
  *
520
- * @platform ios
554
+ * Please note that the array **must** be sorted in ascending order. This invariant is verified only in developement mode,
555
+ * where violation results in error.
556
+ *
557
+ * **Android is limited to up 3 values in the array** -- any surplus values, beside first three are ignored.
558
+ *
559
+ * Defaults to `[1.0]`.
521
560
  */
522
- sheetAllowedDetents?: SheetDetentTypes;
561
+ sheetAllowedDetents?: number[] | 'fitToContents';
562
+ /**
563
+ * Integer value describing elevation of the sheet, impacting shadow on the top edge of the sheet.
564
+ *
565
+ * Not dynamic - changing it after the component is rendered won't have an effect.
566
+ *
567
+ * Defaults to `24`.
568
+ *
569
+ * @platform Android
570
+ */
571
+ sheetElevation?: number;
523
572
  /**
524
573
  * Whether the sheet should expand to larger detent when scrolling.
525
574
  * Works only when `presentation` is set to `formSheet`.
@@ -535,10 +584,20 @@ export type NativeStackNavigationOptions = {
535
584
  * If set to non-negative value it will try to render sheet with provided radius, else it will apply system default.
536
585
  *
537
586
  * If left unset system default is used.
538
- *
539
- * @platform ios
540
587
  */
541
588
  sheetCornerRadius?: number;
589
+ /**
590
+ * Index of the detent the sheet should expand to after being opened.
591
+ * Works only when `stackPresentation` is set to `formSheet`.
592
+ *
593
+ * If the specified index is out of bounds of `sheetAllowedDetents` array, in dev environment more error will be thrown,
594
+ * in production the value will be reset to default value.
595
+ *
596
+ * Additionaly there is `last` value available, when set the sheet will expand initially to last (largest) detent.
597
+ *
598
+ * Defaults to `0` - which represents first detent in the detents array.
599
+ */
600
+ sheetInitialDetentIndex?: number | 'last';
542
601
  /**
543
602
  * Boolean indicating whether the sheet shows a grabber at the top.
544
603
  * Works only when `presentation` is set to `formSheet`.
@@ -549,19 +608,19 @@ export type NativeStackNavigationOptions = {
549
608
  sheetGrabberVisible?: boolean;
550
609
  /**
551
610
  * The largest sheet detent for which a view underneath won't be dimmed.
552
- * Works only when `presentation` is se tto `formSheet`.
611
+ * Works only when `presentation` is set to `formSheet`.
553
612
  *
554
- * If this prop is set to:
613
+ * This prop can be set to an number, which indicates index of detent in `sheetAllowedDetents` array for which
614
+ * there won't be a dimming view beneath the sheet.
555
615
  *
556
- * - `large` - the view underneath won't be dimmed at any detent level
557
- * - `medium` - the view underneath will be dimmed only when detent level is `large`
558
- * - `all` - the view underneath will be dimmed for any detent level
616
+ * Additionaly there are following options available:
559
617
  *
560
- * Defaults to `all`.
618
+ * * `none` - there will be dimming view for all detents levels,
619
+ * * `last` - there won't be a dimming view for any detent level.
561
620
  *
562
- * @platform ios
621
+ * Defaults to `none`, indicating that the dimming view should be always present.
563
622
  */
564
- sheetLargestUndimmedDetent?: SheetDetentTypes;
623
+ sheetLargestUndimmedDetentIndex?: number | 'none' | 'last';
565
624
  /**
566
625
  * The display orientation to use for the screen.
567
626
  *
@@ -586,6 +645,19 @@ export type NativeStackNavigationOptions = {
586
645
  * Only supported on iOS and Android.
587
646
  */
588
647
  freezeOnBlur?: boolean;
648
+ /**
649
+ * Footer component that can be used alongside formSheet stack presentation style.
650
+ *
651
+ * This option is provided, because due to implementation details it might be problematic
652
+ * to implement such layout with JS-only code.
653
+ *
654
+ * Please note that this prop is marked as unstable and might be subject of breaking changes,
655
+ * including removal, in particular when we find solution that will make implementing it with JS
656
+ * straightforward.
657
+ *
658
+ * @platform android
659
+ */
660
+ unstable_sheetFooter?: () => React.ReactNode;
589
661
  };
590
662
 
591
663
  export type NativeStackNavigatorProps = DefaultNavigatorOptions<
@@ -2,7 +2,7 @@ export function debounce<T extends (...args: any[]) => void>(
2
2
  func: T,
3
3
  duration: number
4
4
  ): T {
5
- let timeout: NodeJS.Timeout;
5
+ let timeout: ReturnType<typeof setTimeout>;
6
6
 
7
7
  return function (this: unknown, ...args) {
8
8
  clearTimeout(timeout);
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { ScreenFooter } from 'react-native-screens';
3
+
4
+ type FooterProps = {
5
+ children?: React.ReactNode;
6
+ };
7
+
8
+ export function FooterComponent({ children }: FooterProps) {
9
+ return <ScreenFooter collapsable={false}>{children}</ScreenFooter>;
10
+ }