@lodev09/react-native-true-sheet 4.0.0-beta.2 → 4.0.0-beta.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 (203) hide show
  1. package/README.md +25 -4
  2. package/android/build.gradle +22 -1
  3. package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerView.kt +50 -16
  4. package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentView.kt +302 -184
  5. package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentViewManager.kt +5 -1
  6. package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterView.kt +21 -110
  7. package/android/src/main/java/com/lodev09/truesheet/TrueSheetOverlayView.kt +116 -0
  8. package/android/src/main/java/com/lodev09/truesheet/TrueSheetOverlayViewManager.kt +45 -0
  9. package/android/src/main/java/com/lodev09/truesheet/TrueSheetPackage.kt +2 -1
  10. package/android/src/main/java/com/lodev09/truesheet/TrueSheetStateUpdater.kt +18 -0
  11. package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +119 -50
  12. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +360 -163
  13. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +54 -12
  14. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetBottomSheetView.kt +22 -9
  15. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetCoordinatorLayout.kt +84 -5
  16. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDetentCalculator.kt +104 -39
  17. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDimView.kt +3 -0
  18. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetOverlayRootView.kt +137 -0
  19. package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetLifecycleEvents.kt +15 -0
  20. package/android/src/main/java/com/lodev09/truesheet/utils/KeyboardUtils.kt +15 -2
  21. package/android/src/main/java/com/lodev09/truesheet/utils/ScreenUtils.kt +0 -12
  22. package/android/src/main/java/com/lodev09/truesheet/utils/ViewUtils.kt +19 -7
  23. package/android/src/main/jni/TrueSheetSpec.h +1 -0
  24. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewComponentDescriptor.h +1 -9
  25. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.cpp +110 -30
  26. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.h +30 -7
  27. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.cpp +2 -2
  28. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.h +9 -8
  29. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewComponentDescriptor.h +3 -5
  30. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewShadowNode.cpp +9 -3
  31. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewShadowNode.h +3 -6
  32. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewState.cpp +1 -1
  33. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewState.h +4 -6
  34. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetInsets.cpp +1 -1
  35. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetInsets.h +1 -1
  36. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetLayoutUtils.h +43 -0
  37. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetOverlayViewComponentDescriptor.h +21 -0
  38. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetOverlayViewShadowNode.cpp +17 -0
  39. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetOverlayViewShadowNode.h +33 -0
  40. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewComponentDescriptor.h +3 -5
  41. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.cpp +7 -40
  42. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.h +3 -7
  43. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewState.cpp +3 -5
  44. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewState.h +4 -5
  45. package/ios/TrueSheetContainerView.h +27 -7
  46. package/ios/TrueSheetContainerView.mm +31 -11
  47. package/ios/TrueSheetContentView.h +43 -15
  48. package/ios/TrueSheetContentView.mm +211 -189
  49. package/ios/TrueSheetFooterView.h +6 -0
  50. package/ios/TrueSheetFooterView.mm +93 -17
  51. package/ios/TrueSheetModule.h +2 -7
  52. package/ios/TrueSheetModule.mm +7 -16
  53. package/ios/TrueSheetOverlayView.h +32 -0
  54. package/ios/TrueSheetOverlayView.mm +161 -0
  55. package/ios/TrueSheetView.mm +212 -55
  56. package/ios/TrueSheetViewController.h +31 -3
  57. package/ios/TrueSheetViewController.mm +393 -94
  58. package/ios/core/TrueSheetBlurView.h +0 -2
  59. package/ios/core/TrueSheetBlurView.mm +3 -36
  60. package/ios/core/TrueSheetDetentCalculator.h +7 -1
  61. package/ios/core/TrueSheetDetentCalculator.mm +27 -4
  62. package/ios/core/TrueSheetGrabberView.mm +13 -3
  63. package/ios/core/TrueSheetKeyboardObserver.mm +2 -0
  64. package/ios/core/TrueSheetOverlayContainerView.h +31 -0
  65. package/ios/core/TrueSheetOverlayContainerView.mm +35 -0
  66. package/ios/events/TrueSheetLifecycleEvents.h +2 -0
  67. package/ios/events/TrueSheetLifecycleEvents.mm +8 -0
  68. package/ios/tvos/TrueSheetStubs.mm +12 -0
  69. package/ios/utils/UIView+ScrollEdgeInteraction.h +1 -0
  70. package/ios/utils/UIView+ScrollEdgeInteraction.mm +24 -2
  71. package/lib/module/TrueSheet.js +173 -39
  72. package/lib/module/TrueSheet.js.map +1 -1
  73. package/lib/module/TrueSheet.web.js +218 -243
  74. package/lib/module/TrueSheet.web.js.map +1 -1
  75. package/lib/module/TrueSheetBackground.js +15 -0
  76. package/lib/module/TrueSheetBackground.js.map +1 -0
  77. package/lib/module/TrueSheetOverlay.js +30 -0
  78. package/lib/module/TrueSheetOverlay.js.map +1 -0
  79. package/lib/module/TrueSheetOverlay.web.js +35 -0
  80. package/lib/module/TrueSheetOverlay.web.js.map +1 -0
  81. package/lib/module/TrueSheetPeek.web.js +20 -15
  82. package/lib/module/TrueSheetPeek.web.js.map +1 -1
  83. package/lib/module/detentBackgrounds.js +21 -0
  84. package/lib/module/detentBackgrounds.js.map +1 -0
  85. package/lib/module/fabric/TrueSheetContentViewNativeComponent.ts +1 -1
  86. package/lib/module/fabric/TrueSheetOverlayViewNativeComponent.ts +12 -0
  87. package/lib/module/fabric/TrueSheetViewNativeComponent.ts +14 -10
  88. package/lib/module/index.js +1 -0
  89. package/lib/module/index.js.map +1 -1
  90. package/lib/module/mocks/index.js +18 -2
  91. package/lib/module/mocks/index.js.map +1 -1
  92. package/lib/module/mocks/navigationExpoRouter.js.map +1 -1
  93. package/lib/module/navigation/base-types.js +2 -0
  94. package/lib/module/navigation/base-types.js.map +1 -0
  95. package/lib/module/navigation/createTrueSheetRouter.js +0 -9
  96. package/lib/module/navigation/createTrueSheetRouter.js.map +1 -1
  97. package/lib/module/navigation/expo-router/base-types.js +2 -0
  98. package/lib/module/navigation/expo-router/base-types.js.map +1 -0
  99. package/lib/module/navigation/expo-router/index.js +10 -7
  100. package/lib/module/navigation/expo-router/index.js.map +1 -1
  101. package/lib/module/navigation/expo-router/types.js +4 -0
  102. package/lib/module/navigation/expo-router/types.js.map +1 -0
  103. package/lib/module/navigation/index.js.map +1 -1
  104. package/lib/module/navigation/screen/useSheetScreenState.js +1 -0
  105. package/lib/module/navigation/screen/useSheetScreenState.js.map +1 -1
  106. package/lib/module/web/constants.js +1 -1
  107. package/lib/module/web/constants.js.map +1 -1
  108. package/lib/module/web/layout.js +168 -0
  109. package/lib/module/web/layout.js.map +1 -0
  110. package/lib/module/web/vaul/constants.js +4 -0
  111. package/lib/module/web/vaul/constants.js.map +1 -1
  112. package/lib/module/web/vaul/context.js.map +1 -1
  113. package/lib/module/web/vaul/helpers.js +1 -0
  114. package/lib/module/web/vaul/helpers.js.map +1 -1
  115. package/lib/module/web/vaul/index.js +44 -6
  116. package/lib/module/web/vaul/index.js.map +1 -1
  117. package/lib/module/web/vaul/use-snap-points.js +6 -8
  118. package/lib/module/web/vaul/use-snap-points.js.map +1 -1
  119. package/lib/typescript/src/TrueSheet.d.ts +6 -0
  120. package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
  121. package/lib/typescript/src/TrueSheet.types.d.ts +135 -34
  122. package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -1
  123. package/lib/typescript/src/TrueSheet.web.d.ts.map +1 -1
  124. package/lib/typescript/src/TrueSheetBackground.d.ts +3 -0
  125. package/lib/typescript/src/TrueSheetBackground.d.ts.map +1 -0
  126. package/lib/typescript/src/TrueSheetOverlay.d.ts +8 -0
  127. package/lib/typescript/src/TrueSheetOverlay.d.ts.map +1 -0
  128. package/lib/typescript/src/TrueSheetOverlay.web.d.ts +8 -0
  129. package/lib/typescript/src/TrueSheetOverlay.web.d.ts.map +1 -0
  130. package/lib/typescript/src/TrueSheetPeek.web.d.ts +8 -4
  131. package/lib/typescript/src/TrueSheetPeek.web.d.ts.map +1 -1
  132. package/lib/typescript/src/detentBackgrounds.d.ts +10 -0
  133. package/lib/typescript/src/detentBackgrounds.d.ts.map +1 -0
  134. package/lib/typescript/src/fabric/TrueSheetOverlayViewNativeComponent.d.ts +6 -0
  135. package/lib/typescript/src/fabric/TrueSheetOverlayViewNativeComponent.d.ts.map +1 -0
  136. package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts +11 -7
  137. package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
  138. package/lib/typescript/src/index.d.ts +1 -0
  139. package/lib/typescript/src/index.d.ts.map +1 -1
  140. package/lib/typescript/src/mocks/index.d.ts +4 -0
  141. package/lib/typescript/src/mocks/index.d.ts.map +1 -1
  142. package/lib/typescript/src/mocks/navigationExpoRouter.d.ts +3 -3
  143. package/lib/typescript/src/mocks/navigationExpoRouter.d.ts.map +1 -1
  144. package/lib/typescript/src/navigation/base-types.d.ts +9 -0
  145. package/lib/typescript/src/navigation/base-types.d.ts.map +1 -0
  146. package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts +2 -13
  147. package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts.map +1 -1
  148. package/lib/typescript/src/navigation/expo-router/base-types.d.ts +8 -0
  149. package/lib/typescript/src/navigation/expo-router/base-types.d.ts.map +1 -0
  150. package/lib/typescript/src/navigation/expo-router/index.d.ts +8 -6
  151. package/lib/typescript/src/navigation/expo-router/index.d.ts.map +1 -1
  152. package/lib/typescript/src/navigation/expo-router/types.d.ts +44 -0
  153. package/lib/typescript/src/navigation/expo-router/types.d.ts.map +1 -0
  154. package/lib/typescript/src/navigation/index.d.ts +3 -4
  155. package/lib/typescript/src/navigation/index.d.ts.map +1 -1
  156. package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts +2 -1
  157. package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts.map +1 -1
  158. package/lib/typescript/src/navigation/types.d.ts +41 -5
  159. package/lib/typescript/src/navigation/types.d.ts.map +1 -1
  160. package/lib/typescript/src/web/constants.d.ts +1 -1
  161. package/lib/typescript/src/web/constants.d.ts.map +1 -1
  162. package/lib/typescript/src/web/layout.d.ts +19 -0
  163. package/lib/typescript/src/web/layout.d.ts.map +1 -0
  164. package/lib/typescript/src/web/vaul/constants.d.ts +1 -0
  165. package/lib/typescript/src/web/vaul/constants.d.ts.map +1 -1
  166. package/lib/typescript/src/web/vaul/context.d.ts +1 -0
  167. package/lib/typescript/src/web/vaul/context.d.ts.map +1 -1
  168. package/lib/typescript/src/web/vaul/helpers.d.ts +1 -0
  169. package/lib/typescript/src/web/vaul/helpers.d.ts.map +1 -1
  170. package/lib/typescript/src/web/vaul/index.d.ts +7 -1
  171. package/lib/typescript/src/web/vaul/index.d.ts.map +1 -1
  172. package/lib/typescript/src/web/vaul/use-snap-points.d.ts.map +1 -1
  173. package/package.json +17 -8
  174. package/react-native.config.js +1 -0
  175. package/src/TrueSheet.tsx +206 -48
  176. package/src/TrueSheet.types.ts +142 -35
  177. package/src/TrueSheet.web.tsx +270 -290
  178. package/src/TrueSheetBackground.tsx +17 -0
  179. package/src/TrueSheetOverlay.tsx +24 -0
  180. package/src/TrueSheetOverlay.web.tsx +33 -0
  181. package/src/TrueSheetPeek.web.tsx +25 -23
  182. package/src/detentBackgrounds.ts +24 -0
  183. package/src/fabric/TrueSheetContentViewNativeComponent.ts +1 -1
  184. package/src/fabric/TrueSheetOverlayViewNativeComponent.ts +12 -0
  185. package/src/fabric/TrueSheetViewNativeComponent.ts +14 -10
  186. package/src/index.ts +1 -0
  187. package/src/mocks/index.ts +17 -2
  188. package/src/mocks/navigationExpoRouter.ts +6 -5
  189. package/src/navigation/base-types.ts +20 -0
  190. package/src/navigation/createTrueSheetRouter.ts +5 -33
  191. package/src/navigation/expo-router/base-types.ts +18 -0
  192. package/src/navigation/expo-router/index.ts +28 -30
  193. package/src/navigation/expo-router/types.ts +116 -0
  194. package/src/navigation/index.ts +6 -7
  195. package/src/navigation/screen/useSheetScreenState.ts +2 -0
  196. package/src/navigation/types.ts +75 -22
  197. package/src/web/constants.ts +1 -1
  198. package/src/web/layout.ts +196 -0
  199. package/src/web/vaul/constants.ts +4 -0
  200. package/src/web/vaul/context.ts +1 -0
  201. package/src/web/vaul/helpers.ts +5 -0
  202. package/src/web/vaul/index.tsx +67 -5
  203. package/src/web/vaul/use-snap-points.ts +6 -14
@@ -1,4 +1,4 @@
1
- import type { ComponentType, ReactElement } from 'react';
1
+ import type { Component, ComponentType, ReactElement, ReactNode, RefObject } from 'react';
2
2
  import type {
3
3
  ColorValue,
4
4
  NativeSyntheticEvent,
@@ -36,6 +36,7 @@ export type WillPresentEvent = NativeSyntheticEvent<DetentInfoEventPayload>;
36
36
  export type DidPresentEvent = NativeSyntheticEvent<DetentInfoEventPayload>;
37
37
  export type WillDismissEvent = NativeSyntheticEvent<null>;
38
38
  export type DidDismissEvent = NativeSyntheticEvent<null>;
39
+ export type DismissAttemptEvent = NativeSyntheticEvent<null>;
39
40
  export type DragBeginEvent = NativeSyntheticEvent<DetentInfoEventPayload>;
40
41
  export type DragChangeEvent = NativeSyntheticEvent<DetentInfoEventPayload>;
41
42
  export type DragEndEvent = NativeSyntheticEvent<DetentInfoEventPayload>;
@@ -161,10 +162,44 @@ export interface AccessibilityOptions {
161
162
  */
162
163
  export type ScrollEdgeEffect = 'automatic' | 'hard' | 'soft' | 'hidden';
163
164
 
165
+ /**
166
+ * What the sheet insets the bottom of a plugged scrollable's content for.
167
+ * See `ScrollableOptions.contentInsetAdjustment`.
168
+ */
169
+ export type ContentInsetAdjustment = 'automatic' | 'safe-area' | 'footer' | 'never';
170
+
164
171
  /**
165
172
  * Options for scrollable behavior.
166
173
  */
167
174
  export interface ScrollableOptions {
175
+ /**
176
+ * What the sheet insets the bottom of the scroll content for, so the last
177
+ * item clears whatever covers the scroll view's bottom edge.
178
+ *
179
+ * - `'automatic'`: The bottom safe-area inset while the content can scroll
180
+ * (home indicator on iOS, navigation bar on Android), plus the height of
181
+ * an `absolute` footer floating over the scroll view. The footer then
182
+ * counts toward the `auto` detent so the content ends above it.
183
+ * - `'safe-area'`: The safe-area inset only — content scrolls under an
184
+ * absolute footer.
185
+ * - `'footer'`: The absolute footer only — you pad for the safe area.
186
+ * - `'never'`: No inset — you pad the content yourself.
187
+ *
188
+ * The safe-area inset only applies while the sheet's `insetAdjustment` is
189
+ * `'automatic'`; a relative footer absorbs it instead. The footer inset is
190
+ * independent of `insetAdjustment` — it only covers the part of the footer
191
+ * overlapping the scroll view, and stacks with the keyboard inset while the
192
+ * footer rises above the keyboard.
193
+ *
194
+ * On iOS, the safe-area inset sets the scroll view's native
195
+ * [`contentInsetAdjustmentBehavior`](https://developer.apple.com/documentation/uikit/uiscrollview/contentinsetadjustmentbehavior)
196
+ * to `automatic` while it's plugged into the sheet; Android and Web apply
197
+ * the inset themselves.
198
+ *
199
+ * @default 'automatic'
200
+ */
201
+ contentInsetAdjustment?: ContentInsetAdjustment;
202
+
168
203
  /**
169
204
  * Extra offset when scrolling to the focused input when keyboard appears.
170
205
  *
@@ -172,6 +207,18 @@ export interface ScrollableOptions {
172
207
  */
173
208
  keyboardScrollOffset?: number;
174
209
 
210
+ /**
211
+ * Adjusts the bottom inset applied to the scrollable when the keyboard is shown.
212
+ * Positive values increase the inset; negative values reduce it.
213
+ * Pass `-insets.bottom` to cancel out safe-area padding already included in
214
+ * the content's `paddingBottom`.
215
+ * Does not affect the auto scroll of the focused input — it always targets
216
+ * the keyboard edge.
217
+ *
218
+ * @default 0
219
+ */
220
+ keyboardOffset?: number;
221
+
175
222
  /**
176
223
  * Whether scrolling the content expands the sheet to the next detent.
177
224
  * When `false`, only the grabber can expand the sheet.
@@ -241,28 +288,19 @@ export interface FooterOptions {
241
288
  * @default 0
242
289
  */
243
290
  keyboardOffset?: number;
244
- }
245
291
 
246
- /**
247
- * Options for customizing the blur effect.
248
- * Only applies when `backgroundBlur` is set.
249
- *
250
- * @platform ios
251
- */
252
- export interface BlurOptions {
253
292
  /**
254
- * The intensity of the blur effect (0-100).
255
- * Uses system default if not provided.
256
- */
257
- intensity?: number;
258
- /**
259
- * Enables or disables user interaction on the blur view.
260
- * Disabling this can help with visual artifacts (flash) on iOS 18+
261
- * when touching the sheet content with blur enabled.
293
+ * Whether an `absolute` footer rises above the keyboard when it opens.
294
+ * Set to `false` to keep the footer pinned to the sheet's bottom edge behind the keyboard.
295
+ * With footer inset adjustment enabled, any uncovered portion still adds scroll padding
296
+ * and contributes to the expanded `auto` height.
297
+ * The pinned footer keeps its safe-area padding and ignores `keyboardOffset`.
298
+ * A `relative` footer never rises, so this has no effect.
262
299
  *
300
+ * @platform ios, android
263
301
  * @default true
264
302
  */
265
- interaction?: boolean;
303
+ avoidKeyboard?: boolean;
266
304
  }
267
305
 
268
306
  /**
@@ -308,6 +346,11 @@ export type BackgroundBlur =
308
346
  | 'system-thick-material-dark'
309
347
  | 'system-chrome-material-dark';
310
348
 
349
+ export type DetentBackground =
350
+ | string
351
+ | { color: ColorValue; blur?: never }
352
+ | { blur: BackgroundBlur; color?: never };
353
+
311
354
  /**
312
355
  * Supported Sheet detent.
313
356
  */
@@ -397,6 +440,21 @@ export interface TrueSheetProps extends ViewProps {
397
440
  */
398
441
  initialDetentAnimated?: boolean;
399
442
 
443
+ /**
444
+ * Specify whether the sheet content should mount lazily, on first presentation.
445
+ * Set to `false` to mount the content before presentation without presenting the sheet.
446
+ * Use this when content is not ready on the first render, then call `present()`
447
+ * after your readiness signal so auto detents measure the settled content.
448
+ *
449
+ * Content that requires window attachment to measure, such as SwiftUI-hosted views,
450
+ * still only measures during presentation.
451
+ *
452
+ * @platform android
453
+ * @platform ios
454
+ * @default true
455
+ */
456
+ lazy?: boolean;
457
+
400
458
  /**
401
459
  * The detent index that the sheet should start to dim the background.
402
460
  * This is ignored if `dimmed` is set to `false`.
@@ -407,6 +465,7 @@ export interface TrueSheetProps extends ViewProps {
407
465
 
408
466
  /**
409
467
  * Prevents interactive dismissal of the Sheet.
468
+ * Blocked attempts fire `onDismissAttempt`, so you can confirm before dismissing programmatically.
410
469
  *
411
470
  * @default true
412
471
  */
@@ -423,9 +482,35 @@ export interface TrueSheetProps extends ViewProps {
423
482
  /**
424
483
  * Main sheet background color.
425
484
  * Uses system default when not provided.
485
+ *
486
+ * On supported iOS 26.1+ devices, uses a native color effect.
487
+ * `backgroundBlur` takes precedence on iOS.
488
+ * Use `backgroundStyle.backgroundColor` for an exact color or to tint glass or blur.
426
489
  */
427
490
  backgroundColor?: ColorValue;
428
491
 
492
+ /**
493
+ * Backgrounds matched to `detents` by index. Strings are color values.
494
+ * Null or missing entries inherit
495
+ * `backgroundColor`/`backgroundBlur`. iOS 26.1+ transitions natively.
496
+ * Other platforms cross-fade after passing the midpoint between detents.
497
+ * Blur entries use the sheet background on Android and Web.
498
+ */
499
+ detentBackgrounds?: (DetentBackground | null)[];
500
+
501
+ /**
502
+ * Custom background rendered behind the header, content, and footer.
503
+ * The wrapper fills the sheet and ignores touches.
504
+ * Size the element to fill it with `StyleSheet.absoluteFill`.
505
+ */
506
+ background?: ReactNode;
507
+
508
+ /**
509
+ * Style for the background wrapper. Only `backgroundColor` is supported.
510
+ * Use an opaque color for an exact color, or a translucent color to tint glass or blur.
511
+ */
512
+ backgroundStyle?: StyleProp<Pick<ViewStyle, 'backgroundColor'>>;
513
+
429
514
  /**
430
515
  * The sheet corner radius.
431
516
  *
@@ -471,20 +556,13 @@ export interface TrueSheetProps extends ViewProps {
471
556
 
472
557
  /**
473
558
  * The blur effect style on iOS.
474
- * Blends with `backgroundColor` when provided.
559
+ * Takes precedence over `backgroundColor`.
560
+ * Use `backgroundStyle.backgroundColor` to tint the blur.
475
561
  *
476
562
  * @platform ios
477
563
  */
478
564
  backgroundBlur?: BackgroundBlur;
479
565
 
480
- /**
481
- * Options for customizing the blur effect.
482
- * Only applies when `backgroundBlur` is set.
483
- *
484
- * @platform ios
485
- */
486
- blurOptions?: BlurOptions;
487
-
488
566
  /**
489
567
  * Overrides `large` or `100%` height.
490
568
  * Also sets the maximum height for 'auto' detents.
@@ -500,27 +578,31 @@ export interface TrueSheetProps extends ViewProps {
500
578
  maxContentWidth?: number;
501
579
 
502
580
  /**
503
- * Anchors the sheet to the specified horizontal edge.
581
+ * Horizontal placement of the sheet within the screen.
582
+ *
583
+ * - `'automatic'`: The system decides (default). Centered on Android, Web, and iOS 26 and below.
584
+ * - `'center'`: Centers the sheet horizontally.
585
+ * - `'leading'`: Places the sheet on the leading edge (left in LTR, right in RTL).
586
+ * - `'trailing'`: Places the sheet on the trailing edge (right in LTR, left in RTL).
504
587
  *
505
- * - `'center'`: Centers the sheet horizontally (default).
506
- * - `'left'`: Anchors the sheet to the left edge.
507
- * - `'right'`: Anchors the sheet to the right edge.
588
+ * `'automatic'` and `'center'` only differ on iOS 27+, where they map to
589
+ * `UISheetPresentationController.preferredPlacement`.
508
590
  *
509
591
  * Ignored on phones in portrait orientation.
510
592
  *
511
- * @default 'center'
593
+ * @default 'automatic'
512
594
  */
513
- anchor?: 'left' | 'center' | 'right';
595
+ placement?: 'automatic' | 'leading' | 'center' | 'trailing';
514
596
 
515
597
  /**
516
598
  * The offset from the screen edge.
517
- * Only applies when `anchor` is `'left'` or `'right'`.
599
+ * Only applies when `placement` is `'leading'` or `'trailing'`.
518
600
  *
519
601
  * @platform android
520
602
  * @platform web
521
603
  * @default 16
522
604
  */
523
- anchorOffset?: number;
605
+ placementOffset?: number;
524
606
 
525
607
  /**
526
608
  * Controls how the sheet adjusts its height for system insets (safe area).
@@ -568,8 +650,26 @@ export interface TrueSheetProps extends ViewProps {
568
650
  */
569
651
  footerStyle?: StyleProp<ViewStyle>;
570
652
 
653
+ /**
654
+ * A ref to the scrollable component (e.g. `ScrollView`, `FlatList`)
655
+ * rendered within the sheet content.
656
+ * Required for scrollable handling — nested scrolling, keyboard insets,
657
+ * and `auto` detent sizing are wired to this scrollable.
658
+ *
659
+ * Example:
660
+ * ```tsx
661
+ * const scrollableRef = useRef<ScrollView>(null)
662
+ *
663
+ * <TrueSheet scrollableRef={scrollableRef}>
664
+ * <ScrollView ref={scrollableRef} />
665
+ * </TrueSheet>
666
+ * ```
667
+ */
668
+ scrollableRef?: RefObject<Component<unknown> | null>;
669
+
571
670
  /**
572
671
  * Options for scrollable behavior.
672
+ * Applies to the scrollable provided via `scrollableRef`.
573
673
  */
574
674
  scrollableOptions?: ScrollableOptions;
575
675
 
@@ -621,6 +721,13 @@ export interface TrueSheetProps extends ViewProps {
621
721
  */
622
722
  onDidDismiss?: (event: DidDismissEvent) => void;
623
723
 
724
+ /**
725
+ * Called when the user tries to dismiss the sheet while `dismissible` is `false`,
726
+ * e.g. by dragging down or pressing back/escape. Tapping the dim does not count.
727
+ * The sheet stays presented. Confirm with the user, then call `dismiss()` to proceed.
728
+ */
729
+ onDismissAttempt?: (event: DismissAttemptEvent) => void;
730
+
624
731
  /**
625
732
  * Called when the detent of the sheet has changed.
626
733
  * Either by dragging or programatically.