@lodev09/react-native-true-sheet 4.0.0-beta.0 → 4.0.0-beta.2

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 (388) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +42 -31
  3. package/RNTrueSheet.podspec +10 -2
  4. package/android/build.gradle +2 -1
  5. package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerView.kt +174 -49
  6. package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerViewManager.kt +7 -0
  7. package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentView.kt +371 -18
  8. package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentViewManager.kt +14 -0
  9. package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterView.kt +156 -21
  10. package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterViewManager.kt +14 -0
  11. package/android/src/main/java/com/lodev09/truesheet/TrueSheetHeaderView.kt +38 -0
  12. package/android/src/main/java/com/lodev09/truesheet/TrueSheetHeaderViewManager.kt +28 -0
  13. package/android/src/main/java/com/lodev09/truesheet/TrueSheetModule.kt +84 -24
  14. package/android/src/main/java/com/lodev09/truesheet/TrueSheetPackage.kt +5 -4
  15. package/android/src/main/java/com/lodev09/truesheet/TrueSheetPeekView.kt +72 -0
  16. package/android/src/main/java/com/lodev09/truesheet/TrueSheetPeekViewManager.kt +33 -0
  17. package/android/src/main/java/com/lodev09/truesheet/TrueSheetStateUpdater.kt +45 -0
  18. package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +526 -231
  19. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +1224 -603
  20. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +136 -29
  21. package/android/src/main/java/com/lodev09/truesheet/core/RNScreensEventObserver.kt +63 -0
  22. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetBottomSheetBehavior.kt +36 -0
  23. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetBottomSheetView.kt +255 -0
  24. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetCoordinatorLayout.kt +303 -0
  25. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDetentCalculator.kt +277 -0
  26. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDimView.kt +162 -0
  27. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetGrabberView.kt +180 -0
  28. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetKeyboardObserver.kt +207 -0
  29. package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetStackManager.kt +220 -0
  30. package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetDragEvents.kt +71 -0
  31. package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetFocusEvents.kt +65 -0
  32. package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetLifecycleEvents.kt +112 -0
  33. package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetStateEvents.kt +56 -0
  34. package/android/src/main/java/com/lodev09/truesheet/utils/KeyboardUtils.kt +84 -0
  35. package/android/src/main/java/com/lodev09/truesheet/utils/ScreenUtils.kt +93 -67
  36. package/android/src/main/java/com/lodev09/truesheet/utils/TouchEventDeduper.kt +31 -0
  37. package/android/src/main/java/com/lodev09/truesheet/utils/ViewUtils.kt +30 -0
  38. package/android/src/main/jni/CMakeLists.txt +63 -0
  39. package/android/src/main/jni/TrueSheetSpec.h +19 -0
  40. package/android/src/main/jni/TrueSheetStateUpdater.cpp +96 -0
  41. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewComponentDescriptor.h +24 -0
  42. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.cpp +43 -0
  43. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.h +28 -0
  44. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.cpp +11 -0
  45. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.h +37 -0
  46. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewComponentDescriptor.h +24 -0
  47. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewShadowNode.cpp +56 -0
  48. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewShadowNode.h +28 -0
  49. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewState.cpp +11 -0
  50. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewState.h +41 -0
  51. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetInsets.cpp +18 -0
  52. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetInsets.h +16 -0
  53. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewComponentDescriptor.h +28 -0
  54. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.cpp +61 -0
  55. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.h +45 -0
  56. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewState.cpp +23 -0
  57. package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewState.h +52 -0
  58. package/ios/TrueSheetContainerView.h +81 -6
  59. package/ios/TrueSheetContainerView.mm +275 -21
  60. package/ios/TrueSheetContentView.h +38 -1
  61. package/ios/TrueSheetContentView.mm +413 -43
  62. package/ios/TrueSheetFooterView.h +27 -2
  63. package/ios/TrueSheetFooterView.mm +141 -35
  64. package/ios/{events/OnDidDismissEvent.h → TrueSheetHeaderView.h} +10 -7
  65. package/ios/TrueSheetHeaderView.mm +64 -0
  66. package/ios/TrueSheetModule.mm +92 -5
  67. package/ios/TrueSheetPeekView.h +32 -0
  68. package/ios/TrueSheetPeekView.mm +99 -0
  69. package/ios/TrueSheetView.h +7 -15
  70. package/ios/TrueSheetView.mm +633 -215
  71. package/ios/TrueSheetViewController.h +84 -16
  72. package/ios/TrueSheetViewController.mm +1133 -333
  73. package/ios/core/RNScreensEventObserver.h +46 -0
  74. package/ios/core/RNScreensEventObserver.mm +280 -0
  75. package/ios/core/TrueSheetBlurView.h +27 -0
  76. package/ios/core/TrueSheetBlurView.mm +82 -0
  77. package/ios/core/TrueSheetDetentCalculator.h +107 -0
  78. package/ios/core/TrueSheetDetentCalculator.mm +197 -0
  79. package/ios/core/TrueSheetGrabberView.h +72 -0
  80. package/ios/core/TrueSheetGrabberView.mm +178 -0
  81. package/ios/core/TrueSheetKeyboardObserver.h +39 -0
  82. package/ios/core/TrueSheetKeyboardObserver.mm +112 -0
  83. package/ios/events/TrueSheetDragEvents.h +39 -0
  84. package/ios/events/TrueSheetDragEvents.mm +62 -0
  85. package/ios/events/{OnPositionChangeEvent.h → TrueSheetFocusEvents.h} +8 -5
  86. package/ios/events/TrueSheetFocusEvents.mm +49 -0
  87. package/ios/events/TrueSheetLifecycleEvents.h +40 -0
  88. package/ios/events/TrueSheetLifecycleEvents.mm +71 -0
  89. package/ios/events/TrueSheetStateEvents.h +35 -0
  90. package/ios/events/TrueSheetStateEvents.mm +49 -0
  91. package/ios/tvos/TrueSheetStubs.mm +154 -0
  92. package/ios/{events/OnMountEvent.h → utils/BlurUtil.h} +5 -7
  93. package/ios/utils/BlurUtil.mm +69 -0
  94. package/ios/utils/GestureUtil.h +7 -0
  95. package/ios/utils/GestureUtil.mm +12 -0
  96. package/ios/utils/PlatformUtil.h +15 -0
  97. package/ios/utils/UIView+FirstResponder.h +15 -0
  98. package/ios/utils/UIView+FirstResponder.mm +26 -0
  99. package/ios/{events/OnWillDismissEvent.h → utils/UIView+ScrollEdgeInteraction.h} +6 -7
  100. package/ios/utils/UIView+ScrollEdgeInteraction.mm +62 -0
  101. package/ios/utils/WindowUtil.mm +17 -1
  102. package/lib/module/TrueSheet.js +230 -64
  103. package/lib/module/TrueSheet.js.map +1 -1
  104. package/lib/module/TrueSheet.web.js +1203 -0
  105. package/lib/module/TrueSheet.web.js.map +1 -0
  106. package/lib/module/TrueSheetPeek.js +15 -0
  107. package/lib/module/TrueSheetPeek.js.map +1 -0
  108. package/lib/module/TrueSheetPeek.web.js +55 -0
  109. package/lib/module/TrueSheetPeek.web.js.map +1 -0
  110. package/lib/module/TrueSheetProvider.js +28 -0
  111. package/lib/module/TrueSheetProvider.js.map +1 -0
  112. package/lib/module/TrueSheetProvider.web.js +157 -0
  113. package/lib/module/TrueSheetProvider.web.js.map +1 -0
  114. package/lib/module/fabric/TrueSheetContainerViewNativeComponent.ts +1 -1
  115. package/lib/module/fabric/TrueSheetContentViewNativeComponent.ts +5 -1
  116. package/lib/module/fabric/TrueSheetFooterViewNativeComponent.ts +10 -2
  117. package/lib/module/fabric/TrueSheetHeaderViewNativeComponent.ts +8 -0
  118. package/lib/module/fabric/TrueSheetPeekViewNativeComponent.ts +8 -0
  119. package/lib/module/fabric/TrueSheetViewNativeComponent.ts +105 -18
  120. package/lib/module/index.js +3 -3
  121. package/lib/module/index.js.map +1 -1
  122. package/lib/module/mocks/index.js +93 -0
  123. package/lib/module/mocks/index.js.map +1 -0
  124. package/lib/module/mocks/navigation.js +95 -0
  125. package/lib/module/mocks/navigation.js.map +1 -0
  126. package/lib/module/mocks/navigationExpoRouter.js +21 -0
  127. package/lib/module/mocks/navigationExpoRouter.js.map +1 -0
  128. package/lib/module/mocks/reanimated.js +91 -0
  129. package/lib/module/mocks/reanimated.js.map +1 -0
  130. package/lib/module/navigation/TrueSheetNavigatorContent.js +73 -0
  131. package/lib/module/navigation/TrueSheetNavigatorContent.js.map +1 -0
  132. package/lib/module/navigation/actions.js +50 -0
  133. package/lib/module/navigation/actions.js.map +1 -0
  134. package/lib/module/navigation/createTrueSheetRouter.js +166 -0
  135. package/lib/module/navigation/createTrueSheetRouter.js.map +1 -0
  136. package/lib/module/navigation/expo-router/index.js +48 -0
  137. package/lib/module/navigation/expo-router/index.js.map +1 -0
  138. package/lib/module/navigation/index.js +47 -0
  139. package/lib/module/navigation/index.js.map +1 -0
  140. package/lib/module/navigation/navigator.js +10 -0
  141. package/lib/module/navigation/navigator.js.map +1 -0
  142. package/lib/module/navigation/screen/ReanimatedTrueSheetScreen.js +56 -0
  143. package/lib/module/navigation/screen/ReanimatedTrueSheetScreen.js.map +1 -0
  144. package/lib/module/navigation/screen/TrueSheetScreen.js +49 -0
  145. package/lib/module/navigation/screen/TrueSheetScreen.js.map +1 -0
  146. package/lib/module/navigation/screen/index.js +5 -0
  147. package/lib/module/navigation/screen/index.js.map +1 -0
  148. package/lib/module/navigation/screen/types.js +4 -0
  149. package/lib/module/navigation/screen/types.js.map +1 -0
  150. package/lib/module/navigation/screen/useSheetScreenState.js +68 -0
  151. package/lib/module/navigation/screen/useSheetScreenState.js.map +1 -0
  152. package/lib/module/navigation/types.js +4 -0
  153. package/lib/module/navigation/types.js.map +1 -0
  154. package/lib/module/navigation/useTrueSheetNavigation.js +24 -0
  155. package/lib/module/navigation/useTrueSheetNavigation.js.map +1 -0
  156. package/lib/module/reanimated/ReanimatedTrueSheet.js +15 -9
  157. package/lib/module/reanimated/ReanimatedTrueSheet.js.map +1 -1
  158. package/lib/module/reanimated/ReanimatedTrueSheet.web.js +81 -0
  159. package/lib/module/reanimated/ReanimatedTrueSheet.web.js.map +1 -0
  160. package/lib/module/reanimated/ReanimatedTrueSheetProvider.js +4 -2
  161. package/lib/module/reanimated/ReanimatedTrueSheetProvider.js.map +1 -1
  162. package/lib/module/reanimated/index.js +2 -2
  163. package/lib/module/reanimated/index.js.map +1 -1
  164. package/lib/module/reanimated/useReanimatedPositionChangeHandler.web.js +20 -0
  165. package/lib/module/reanimated/useReanimatedPositionChangeHandler.web.js.map +1 -0
  166. package/lib/module/specs/NativeTrueSheetModule.js.map +1 -1
  167. package/lib/module/web/constants.js +16 -0
  168. package/lib/module/web/constants.js.map +1 -0
  169. package/lib/module/web/dom.js +10 -0
  170. package/lib/module/web/dom.js.map +1 -0
  171. package/lib/module/web/vaul/README.md +9 -0
  172. package/lib/module/web/vaul/browser.js +30 -0
  173. package/lib/module/web/vaul/browser.js.map +1 -0
  174. package/lib/module/web/vaul/constants.js +15 -0
  175. package/lib/module/web/vaul/constants.js.map +1 -0
  176. package/lib/module/web/vaul/context.js +59 -0
  177. package/lib/module/web/vaul/context.js.map +1 -0
  178. package/lib/module/web/vaul/helpers.js +99 -0
  179. package/lib/module/web/vaul/helpers.js.map +1 -0
  180. package/lib/module/web/vaul/index.js +1309 -0
  181. package/lib/module/web/vaul/index.js.map +1 -0
  182. package/lib/module/web/vaul/style.css +287 -0
  183. package/lib/module/web/vaul/style.css.d.js +2 -0
  184. package/lib/module/web/vaul/style.css.d.js.map +1 -0
  185. package/lib/module/web/vaul/types.js +2 -0
  186. package/lib/module/web/vaul/types.js.map +1 -0
  187. package/lib/module/web/vaul/use-composed-refs.js +34 -0
  188. package/lib/module/web/vaul/use-composed-refs.js.map +1 -0
  189. package/lib/module/web/vaul/use-controllable-state.js +54 -0
  190. package/lib/module/web/vaul/use-controllable-state.js.map +1 -0
  191. package/lib/module/web/vaul/use-position-fixed.js +123 -0
  192. package/lib/module/web/vaul/use-position-fixed.js.map +1 -0
  193. package/lib/module/web/vaul/use-prevent-scroll.js +258 -0
  194. package/lib/module/web/vaul/use-prevent-scroll.js.map +1 -0
  195. package/lib/module/web/vaul/use-scale-background.js +57 -0
  196. package/lib/module/web/vaul/use-scale-background.js.map +1 -0
  197. package/lib/module/web/vaul/use-snap-points.js +305 -0
  198. package/lib/module/web/vaul/use-snap-points.js.map +1 -0
  199. package/lib/typescript/src/TrueSheet.d.ts +51 -14
  200. package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
  201. package/lib/typescript/src/TrueSheet.types.d.ts +463 -54
  202. package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -1
  203. package/lib/typescript/src/TrueSheet.web.d.ts +5 -0
  204. package/lib/typescript/src/TrueSheet.web.d.ts.map +1 -0
  205. package/lib/typescript/src/TrueSheetPeek.d.ts +9 -0
  206. package/lib/typescript/src/TrueSheetPeek.d.ts.map +1 -0
  207. package/lib/typescript/src/TrueSheetPeek.web.d.ts +28 -0
  208. package/lib/typescript/src/TrueSheetPeek.web.d.ts.map +1 -0
  209. package/lib/typescript/src/TrueSheetProvider.d.ts +18 -0
  210. package/lib/typescript/src/TrueSheetProvider.d.ts.map +1 -0
  211. package/lib/typescript/src/TrueSheetProvider.web.d.ts +27 -0
  212. package/lib/typescript/src/TrueSheetProvider.web.d.ts.map +1 -0
  213. package/lib/typescript/src/fabric/TrueSheetContainerViewNativeComponent.d.ts.map +1 -1
  214. package/lib/typescript/src/fabric/TrueSheetContentViewNativeComponent.d.ts.map +1 -1
  215. package/lib/typescript/src/fabric/TrueSheetFooterViewNativeComponent.d.ts +2 -0
  216. package/lib/typescript/src/fabric/TrueSheetFooterViewNativeComponent.d.ts.map +1 -1
  217. package/lib/typescript/src/fabric/TrueSheetHeaderViewNativeComponent.d.ts +6 -0
  218. package/lib/typescript/src/fabric/TrueSheetHeaderViewNativeComponent.d.ts.map +1 -0
  219. package/lib/typescript/src/fabric/TrueSheetPeekViewNativeComponent.d.ts +6 -0
  220. package/lib/typescript/src/fabric/TrueSheetPeekViewNativeComponent.d.ts.map +1 -0
  221. package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts +67 -16
  222. package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
  223. package/lib/typescript/src/index.d.ts +2 -2
  224. package/lib/typescript/src/index.d.ts.map +1 -1
  225. package/lib/typescript/src/mocks/index.d.ts +43 -0
  226. package/lib/typescript/src/mocks/index.d.ts.map +1 -0
  227. package/lib/typescript/src/mocks/navigation.d.ts +70 -0
  228. package/lib/typescript/src/mocks/navigation.d.ts.map +1 -0
  229. package/lib/typescript/src/mocks/navigationExpoRouter.d.ts +22 -0
  230. package/lib/typescript/src/mocks/navigationExpoRouter.d.ts.map +1 -0
  231. package/lib/typescript/src/mocks/reanimated.d.ts +48 -0
  232. package/lib/typescript/src/mocks/reanimated.d.ts.map +1 -0
  233. package/lib/typescript/src/navigation/TrueSheetNavigatorContent.d.ts +5 -0
  234. package/lib/typescript/src/navigation/TrueSheetNavigatorContent.d.ts.map +1 -0
  235. package/lib/typescript/src/navigation/actions.d.ts +71 -0
  236. package/lib/typescript/src/navigation/actions.d.ts.map +1 -0
  237. package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts +14 -0
  238. package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts.map +1 -0
  239. package/lib/typescript/src/navigation/expo-router/index.d.ts +37 -0
  240. package/lib/typescript/src/navigation/expo-router/index.d.ts.map +1 -0
  241. package/lib/typescript/src/navigation/index.d.ts +46 -0
  242. package/lib/typescript/src/navigation/index.d.ts.map +1 -0
  243. package/lib/typescript/src/navigation/navigator.d.ts +7 -0
  244. package/lib/typescript/src/navigation/navigator.d.ts.map +1 -0
  245. package/lib/typescript/src/navigation/screen/ReanimatedTrueSheetScreen.d.ts +3 -0
  246. package/lib/typescript/src/navigation/screen/ReanimatedTrueSheetScreen.d.ts.map +1 -0
  247. package/lib/typescript/src/navigation/screen/TrueSheetScreen.d.ts +3 -0
  248. package/lib/typescript/src/navigation/screen/TrueSheetScreen.d.ts.map +1 -0
  249. package/lib/typescript/src/navigation/screen/index.d.ts +4 -0
  250. package/lib/typescript/src/navigation/screen/index.d.ts.map +1 -0
  251. package/lib/typescript/src/navigation/screen/types.d.ts +14 -0
  252. package/lib/typescript/src/navigation/screen/types.d.ts.map +1 -0
  253. package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts +33 -0
  254. package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts.map +1 -0
  255. package/lib/typescript/src/navigation/types.d.ts +177 -0
  256. package/lib/typescript/src/navigation/types.d.ts.map +1 -0
  257. package/lib/typescript/src/navigation/useTrueSheetNavigation.d.ts +23 -0
  258. package/lib/typescript/src/navigation/useTrueSheetNavigation.d.ts.map +1 -0
  259. package/lib/typescript/src/reanimated/ReanimatedTrueSheet.d.ts.map +1 -1
  260. package/lib/typescript/src/reanimated/ReanimatedTrueSheet.web.d.ts +41 -0
  261. package/lib/typescript/src/reanimated/ReanimatedTrueSheet.web.d.ts.map +1 -0
  262. package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts +8 -2
  263. package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts.map +1 -1
  264. package/lib/typescript/src/reanimated/useReanimatedPositionChangeHandler.web.d.ts +15 -0
  265. package/lib/typescript/src/reanimated/useReanimatedPositionChangeHandler.web.d.ts.map +1 -0
  266. package/lib/typescript/src/specs/NativeTrueSheetModule.d.ts +25 -3
  267. package/lib/typescript/src/specs/NativeTrueSheetModule.d.ts.map +1 -1
  268. package/lib/typescript/src/web/constants.d.ts +14 -0
  269. package/lib/typescript/src/web/constants.d.ts.map +1 -0
  270. package/lib/typescript/src/web/dom.d.ts +7 -0
  271. package/lib/typescript/src/web/dom.d.ts.map +1 -0
  272. package/lib/typescript/src/web/vaul/browser.d.ts +8 -0
  273. package/lib/typescript/src/web/vaul/browser.d.ts.map +1 -0
  274. package/lib/typescript/src/web/vaul/constants.d.ts +13 -0
  275. package/lib/typescript/src/web/vaul/constants.d.ts.map +1 -0
  276. package/lib/typescript/src/web/vaul/context.d.ts +53 -0
  277. package/lib/typescript/src/web/vaul/context.d.ts.map +1 -0
  278. package/lib/typescript/src/web/vaul/helpers.d.ts +17 -0
  279. package/lib/typescript/src/web/vaul/helpers.d.ts.map +1 -0
  280. package/lib/typescript/src/web/vaul/index.d.ts +228 -0
  281. package/lib/typescript/src/web/vaul/index.d.ts.map +1 -0
  282. package/lib/typescript/src/web/vaul/types.d.ts +7 -0
  283. package/lib/typescript/src/web/vaul/types.d.ts.map +1 -0
  284. package/lib/typescript/src/web/vaul/use-composed-refs.d.ts +14 -0
  285. package/lib/typescript/src/web/vaul/use-composed-refs.d.ts.map +1 -0
  286. package/lib/typescript/src/web/vaul/use-controllable-state.d.ts +9 -0
  287. package/lib/typescript/src/web/vaul/use-controllable-state.d.ts.map +1 -0
  288. package/lib/typescript/src/web/vaul/use-position-fixed.d.ts +19 -0
  289. package/lib/typescript/src/web/vaul/use-position-fixed.d.ts.map +1 -0
  290. package/lib/typescript/src/web/vaul/use-prevent-scroll.d.ts +18 -0
  291. package/lib/typescript/src/web/vaul/use-prevent-scroll.d.ts.map +1 -0
  292. package/lib/typescript/src/web/vaul/use-scale-background.d.ts +2 -0
  293. package/lib/typescript/src/web/vaul/use-scale-background.d.ts.map +1 -0
  294. package/lib/typescript/src/web/vaul/use-snap-points.d.ts +38 -0
  295. package/lib/typescript/src/web/vaul/use-snap-points.d.ts.map +1 -0
  296. package/package.json +95 -36
  297. package/react-native.config.js +9 -2
  298. package/src/TrueSheet.tsx +281 -62
  299. package/src/TrueSheet.types.ts +525 -71
  300. package/src/TrueSheet.web.tsx +1362 -0
  301. package/src/TrueSheetPeek.tsx +11 -0
  302. package/src/TrueSheetPeek.web.tsx +64 -0
  303. package/src/TrueSheetProvider.tsx +33 -0
  304. package/src/TrueSheetProvider.web.tsx +220 -0
  305. package/src/fabric/TrueSheetContainerViewNativeComponent.ts +1 -1
  306. package/src/fabric/TrueSheetContentViewNativeComponent.ts +5 -1
  307. package/src/fabric/TrueSheetFooterViewNativeComponent.ts +10 -2
  308. package/src/fabric/TrueSheetHeaderViewNativeComponent.ts +8 -0
  309. package/src/fabric/TrueSheetPeekViewNativeComponent.ts +8 -0
  310. package/src/fabric/TrueSheetViewNativeComponent.ts +105 -18
  311. package/src/index.ts +2 -2
  312. package/src/mocks/index.ts +89 -0
  313. package/src/mocks/navigation.ts +79 -0
  314. package/src/mocks/navigationExpoRouter.ts +40 -0
  315. package/src/mocks/reanimated.ts +100 -0
  316. package/src/navigation/TrueSheetNavigatorContent.tsx +106 -0
  317. package/src/navigation/actions.ts +78 -0
  318. package/src/navigation/createTrueSheetRouter.ts +222 -0
  319. package/src/navigation/expo-router/index.ts +89 -0
  320. package/src/navigation/index.ts +81 -0
  321. package/src/navigation/navigator.ts +18 -0
  322. package/src/navigation/screen/ReanimatedTrueSheetScreen.tsx +61 -0
  323. package/src/navigation/screen/TrueSheetScreen.tsx +54 -0
  324. package/src/navigation/screen/index.ts +3 -0
  325. package/src/navigation/screen/types.ts +19 -0
  326. package/src/navigation/screen/useSheetScreenState.ts +100 -0
  327. package/src/navigation/types.ts +251 -0
  328. package/src/navigation/useTrueSheetNavigation.ts +26 -0
  329. package/src/reanimated/ReanimatedTrueSheet.tsx +12 -7
  330. package/src/reanimated/ReanimatedTrueSheet.web.tsx +75 -0
  331. package/src/reanimated/ReanimatedTrueSheetProvider.tsx +12 -8
  332. package/src/reanimated/useReanimatedPositionChangeHandler.web.ts +31 -0
  333. package/src/specs/NativeTrueSheetModule.ts +28 -3
  334. package/src/web/constants.ts +13 -0
  335. package/src/web/dom.ts +9 -0
  336. package/src/web/vaul/README.md +9 -0
  337. package/src/web/vaul/browser.ts +38 -0
  338. package/src/web/vaul/constants.ts +20 -0
  339. package/src/web/vaul/context.ts +101 -0
  340. package/src/web/vaul/helpers.ts +131 -0
  341. package/src/web/vaul/index.tsx +1740 -0
  342. package/src/web/vaul/style.css +287 -0
  343. package/src/web/vaul/style.css.d.ts +1 -0
  344. package/src/web/vaul/types.ts +7 -0
  345. package/src/web/vaul/use-composed-refs.ts +35 -0
  346. package/src/web/vaul/use-controllable-state.ts +66 -0
  347. package/src/web/vaul/use-position-fixed.ts +147 -0
  348. package/src/web/vaul/use-prevent-scroll.ts +309 -0
  349. package/src/web/vaul/use-scale-background.ts +64 -0
  350. package/src/web/vaul/use-snap-points.ts +455 -0
  351. package/android/src/main/java/com/lodev09/truesheet/events/DetentChangeEvent.kt +0 -26
  352. package/android/src/main/java/com/lodev09/truesheet/events/DidDismissEvent.kt +0 -20
  353. package/android/src/main/java/com/lodev09/truesheet/events/DidPresentEvent.kt +0 -26
  354. package/android/src/main/java/com/lodev09/truesheet/events/DragBeginEvent.kt +0 -26
  355. package/android/src/main/java/com/lodev09/truesheet/events/DragChangeEvent.kt +0 -26
  356. package/android/src/main/java/com/lodev09/truesheet/events/DragEndEvent.kt +0 -26
  357. package/android/src/main/java/com/lodev09/truesheet/events/MountEvent.kt +0 -20
  358. package/android/src/main/java/com/lodev09/truesheet/events/PositionChangeEvent.kt +0 -32
  359. package/android/src/main/java/com/lodev09/truesheet/events/SizeChangeEvent.kt +0 -27
  360. package/android/src/main/java/com/lodev09/truesheet/events/WillDismissEvent.kt +0 -20
  361. package/android/src/main/java/com/lodev09/truesheet/events/WillPresentEvent.kt +0 -26
  362. package/android/src/main/res/values/styles.xml +0 -8
  363. package/ios/events/OnDetentChangeEvent.h +0 -28
  364. package/ios/events/OnDetentChangeEvent.mm +0 -30
  365. package/ios/events/OnDidDismissEvent.mm +0 -25
  366. package/ios/events/OnDidPresentEvent.h +0 -28
  367. package/ios/events/OnDidPresentEvent.mm +0 -30
  368. package/ios/events/OnDragBeginEvent.h +0 -28
  369. package/ios/events/OnDragBeginEvent.mm +0 -30
  370. package/ios/events/OnDragChangeEvent.h +0 -28
  371. package/ios/events/OnDragChangeEvent.mm +0 -30
  372. package/ios/events/OnDragEndEvent.h +0 -28
  373. package/ios/events/OnDragEndEvent.mm +0 -30
  374. package/ios/events/OnMountEvent.mm +0 -25
  375. package/ios/events/OnPositionChangeEvent.mm +0 -32
  376. package/ios/events/OnSizeChangeEvent.h +0 -28
  377. package/ios/events/OnSizeChangeEvent.mm +0 -30
  378. package/ios/events/OnWillDismissEvent.mm +0 -25
  379. package/ios/events/OnWillPresentEvent.h +0 -28
  380. package/ios/events/OnWillPresentEvent.mm +0 -30
  381. package/ios/utils/LayoutUtil.h +0 -44
  382. package/ios/utils/LayoutUtil.mm +0 -50
  383. package/lib/module/TrueSheetGrabber.js +0 -51
  384. package/lib/module/TrueSheetGrabber.js.map +0 -1
  385. package/lib/typescript/src/TrueSheetGrabber.d.ts +0 -39
  386. package/lib/typescript/src/TrueSheetGrabber.d.ts.map +0 -1
  387. package/src/TrueSheetGrabber.tsx +0 -82
  388. package/src/__mocks__/index.js +0 -67
@@ -1,7 +1,11 @@
1
1
  import type { ComponentType, ReactElement } from 'react';
2
- import type { ColorValue, NativeSyntheticEvent, ViewProps } from 'react-native';
3
-
4
- import type { TrueSheetGrabberProps } from './TrueSheetGrabber';
2
+ import type {
3
+ ColorValue,
4
+ NativeSyntheticEvent,
5
+ StyleProp,
6
+ ViewProps,
7
+ ViewStyle,
8
+ } from 'react-native';
5
9
 
6
10
  export interface DetentInfoEventPayload {
7
11
  /**
@@ -12,14 +16,18 @@ export interface DetentInfoEventPayload {
12
16
  * The Y position of the sheet relative to the screen.
13
17
  */
14
18
  position: number;
19
+ /**
20
+ * The detent value (0-1) for the current index.
21
+ */
22
+ detent: number;
15
23
  }
16
24
 
17
25
  export interface PositionChangeEventPayload extends DetentInfoEventPayload {
18
26
  /**
19
- * Workaround for cases where we can't get real-time position from native.
20
- * When true, manually animate the position in JS.
27
+ * Indicates whether the position value is real-time (e.g., during drag or animation tracking).
28
+ * When false, the position should be animated in JS.
21
29
  */
22
- transitioning: boolean;
30
+ realtime: boolean;
23
31
  }
24
32
 
25
33
  export type MountEvent = NativeSyntheticEvent<null>;
@@ -32,66 +40,298 @@ export type DragBeginEvent = NativeSyntheticEvent<DetentInfoEventPayload>;
32
40
  export type DragChangeEvent = NativeSyntheticEvent<DetentInfoEventPayload>;
33
41
  export type DragEndEvent = NativeSyntheticEvent<DetentInfoEventPayload>;
34
42
  export type PositionChangeEvent = NativeSyntheticEvent<PositionChangeEventPayload>;
43
+ export type DidFocusEvent = NativeSyntheticEvent<null>;
44
+ export type DidBlurEvent = NativeSyntheticEvent<null>;
45
+ export type WillFocusEvent = NativeSyntheticEvent<null>;
46
+ export type WillBlurEvent = NativeSyntheticEvent<null>;
47
+
48
+ /**
49
+ * Options for customizing the grabber (drag handle) appearance.
50
+ */
51
+ export interface GrabberOptions {
52
+ /**
53
+ * The width of the grabber pill.
54
+ *
55
+ * @default iOS: 36, Android: 32
56
+ */
57
+ width?: number;
58
+ /**
59
+ * The height of the grabber pill.
60
+ *
61
+ * @default iOS: 5, Android: 4
62
+ */
63
+ height?: number;
64
+ /**
65
+ * The top margin of the grabber from the sheet edge.
66
+ *
67
+ * @default iOS: 5, Android: 16
68
+ */
69
+ topMargin?: number;
70
+ /**
71
+ * The corner radius of the grabber pill.
72
+ *
73
+ * @default height / 2
74
+ */
75
+ cornerRadius?: number;
76
+ /**
77
+ * The color of the grabber.
78
+ * Uses native vibrancy/material styling when not provided.
79
+ */
80
+ color?: ColorValue;
81
+ /**
82
+ * Whether the grabber color adapts to light/dark mode.
83
+ * When enabled, the grabber uses vibrancy effect on iOS and
84
+ * adjusts color based on the current theme on Android.
85
+ *
86
+ * @default true
87
+ */
88
+ adaptive?: boolean;
89
+ }
90
+
91
+ /**
92
+ * Options for customizing (e.g. localizing) the accessibility strings
93
+ * announced by screen readers.
94
+ *
95
+ * On iOS, the grabber strings only apply when `grabberOptions` is provided.
96
+ * Without it, iOS uses the system grabber which is already localized.
97
+ */
98
+ export interface AccessibilityOptions {
99
+ /**
100
+ * The accessibility label of the grabber.
101
+ *
102
+ * @default iOS: 'Sheet Grabber', Android: 'Drag handle'
103
+ */
104
+ grabberLabel?: string;
105
+ /**
106
+ * The accessibility hint of the grabber.
107
+ *
108
+ * @platform ios
109
+ * @default 'Double-tap to expand. Swipe up or down to resize the sheet'
110
+ */
111
+ grabberHint?: string;
112
+ /**
113
+ * The value announced when the sheet is at the last detent.
114
+ *
115
+ * @default 'Expanded'
116
+ */
117
+ expandedValue?: string;
118
+ /**
119
+ * The value announced when the sheet is at the first detent.
120
+ *
121
+ * @default 'Collapsed'
122
+ */
123
+ collapsedValue?: string;
124
+ /**
125
+ * The value announced when the sheet is at an intermediate detent.
126
+ * Supports `{index}` and `{count}` placeholders.
127
+ *
128
+ * @default 'Detent {index} of {count}'
129
+ */
130
+ detentValue?: string;
131
+ /**
132
+ * The label of the expand accessibility action.
133
+ *
134
+ * @platform android
135
+ * @default 'Expand'
136
+ */
137
+ expandActionLabel?: string;
138
+ /**
139
+ * The label of the collapse accessibility action.
140
+ *
141
+ * @platform android
142
+ * @default 'Collapse'
143
+ */
144
+ collapseActionLabel?: string;
145
+ /**
146
+ * The title announced when the sheet appears.
147
+ * Sets the accessibility pane title on Android and the
148
+ * hidden dialog title on Web.
149
+ *
150
+ * @platform android, web
151
+ * @default Android: 'Bottom sheet', Web: 'Sheet'
152
+ */
153
+ paneTitle?: string;
154
+ }
155
+
156
+ /**
157
+ * Scroll edge effect style for iOS 26+.
158
+ * Controls the blur/gradient overlay applied to scroll view edges.
159
+ *
160
+ * @platform ios 26+
161
+ */
162
+ export type ScrollEdgeEffect = 'automatic' | 'hard' | 'soft' | 'hidden';
163
+
164
+ /**
165
+ * Options for scrollable behavior.
166
+ */
167
+ export interface ScrollableOptions {
168
+ /**
169
+ * Extra offset when scrolling to the focused input when keyboard appears.
170
+ *
171
+ * @default 0
172
+ */
173
+ keyboardScrollOffset?: number;
174
+
175
+ /**
176
+ * Whether scrolling the content expands the sheet to the next detent.
177
+ * When `false`, only the grabber can expand the sheet.
178
+ *
179
+ * @default true
180
+ */
181
+ scrollingExpandsSheet?: boolean;
182
+
183
+ /**
184
+ * The scroll edge effect applied to the top edge of the scroll view.
185
+ *
186
+ * @platform ios 26+
187
+ * @default 'hidden'
188
+ */
189
+ topScrollEdgeEffect?: ScrollEdgeEffect;
190
+
191
+ /**
192
+ * The scroll edge effect applied to the bottom edge of the scroll view.
193
+ *
194
+ * @platform ios 26+
195
+ * @default 'hidden'
196
+ */
197
+ bottomScrollEdgeEffect?: ScrollEdgeEffect;
198
+ }
35
199
 
36
200
  /**
37
- * Internal event payload for size changes (not exposed to users)
38
- * @internal
201
+ * Options for header behavior
39
202
  */
40
- export interface SizeChangeEventPayload {
41
- width: number;
42
- height: number;
203
+ export interface HeaderOptions {
204
+ /**
205
+ * How the header participates in the sheet layout.
206
+ *
207
+ * - `'relative'`: The header takes up space above the content, and its height
208
+ * is included in the `auto` detent calculation.
209
+ * - `'absolute'`: The header floats over the content, pinned to the top edge,
210
+ * and is excluded from the `auto` detent calculation.
211
+ *
212
+ * @default 'relative'
213
+ */
214
+ position?: 'relative' | 'absolute';
43
215
  }
44
216
 
45
217
  /**
46
- * Internal event type for size changes (not exposed to users)
47
- * @internal
218
+ * Options for footer behavior
48
219
  */
49
- export type SizeChangeEvent = NativeSyntheticEvent<SizeChangeEventPayload>;
220
+ export interface FooterOptions {
221
+ /**
222
+ * How the footer participates in the sheet layout.
223
+ *
224
+ * - `'relative'`: The footer takes up space below the content, pinned to the
225
+ * bottom edge. Its height is included in the `auto` detent calculation but
226
+ * excluded from the `peek` detent (it's pushed off-screen at peek).
227
+ * - `'absolute'`: The footer floats over the content, pinned to the bottom
228
+ * edge. Its height is excluded from the `auto` detent calculation but
229
+ * included in the `peek` detent.
230
+ *
231
+ * @default 'relative'
232
+ */
233
+ position?: 'relative' | 'absolute';
234
+
235
+ /**
236
+ * Adjusts how far an `absolute` footer rises when the keyboard opens.
237
+ * Positive values raise it higher; negative values reduce the rise.
238
+ * Pass `-insets.bottom` to tuck the footer's safe-area padding behind the keyboard.
239
+ * A `relative` footer stays in the layout flow behind the keyboard, so this has no effect.
240
+ *
241
+ * @default 0
242
+ */
243
+ keyboardOffset?: number;
244
+ }
245
+
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
+ /**
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.
262
+ *
263
+ * @default true
264
+ */
265
+ interaction?: boolean;
266
+ }
267
+
268
+ /**
269
+ * Inset adjustment behavior for the sheet content.
270
+ */
271
+ export type InsetAdjustment =
272
+ /**
273
+ * Automatically adjusts the sheet height to account for system insets (safe area).
274
+ * This ensures the sheet content is properly inset from system UI elements.
275
+ */
276
+ | 'automatic'
277
+ /**
278
+ * Does not adjust the sheet height for system insets.
279
+ * The sheet height is calculated purely from the detent values.
280
+ */
281
+ | 'never';
50
282
 
51
283
  /**
52
284
  * Blur style mapped to native values in IOS.
53
285
  *
54
286
  * @platform ios
55
287
  */
56
- export type BlurTint =
288
+ export type BackgroundBlur =
57
289
  | 'light'
58
290
  | 'dark'
59
291
  | 'default'
60
- | 'extraLight'
292
+ | 'extra-light'
61
293
  | 'regular'
62
294
  | 'prominent'
63
- | 'systemUltraThinMaterial'
64
- | 'systemThinMaterial'
65
- | 'systemMaterial'
66
- | 'systemThickMaterial'
67
- | 'systemChromeMaterial'
68
- | 'systemUltraThinMaterialLight'
69
- | 'systemThinMaterialLight'
70
- | 'systemMaterialLight'
71
- | 'systemThickMaterialLight'
72
- | 'systemChromeMaterialLight'
73
- | 'systemUltraThinMaterialDark'
74
- | 'systemThinMaterialDark'
75
- | 'systemMaterialDark'
76
- | 'systemThickMaterialDark'
77
- | 'systemChromeMaterialDark';
295
+ | 'system-ultra-thin-material'
296
+ | 'system-thin-material'
297
+ | 'system-material'
298
+ | 'system-thick-material'
299
+ | 'system-chrome-material'
300
+ | 'system-ultra-thin-material-light'
301
+ | 'system-thin-material-light'
302
+ | 'system-material-light'
303
+ | 'system-thick-material-light'
304
+ | 'system-chrome-material-light'
305
+ | 'system-ultra-thin-material-dark'
306
+ | 'system-thin-material-dark'
307
+ | 'system-material-dark'
308
+ | 'system-thick-material-dark'
309
+ | 'system-chrome-material-dark';
78
310
 
79
311
  /**
80
312
  * Supported Sheet detent.
81
- *
82
- * @platform android
83
- * @platform ios 15+
84
313
  */
85
314
  export type SheetDetent =
86
315
  /**
87
316
  * Auto resize based on content height, clamped to container height.
88
- * Use the `maxHeight` prop to set a custom limit.
317
+ * Use the `maxContentHeight` prop to set a custom limit.
89
318
  *
90
319
  * @platform android
91
320
  * @platform ios 16+
92
321
  */
93
322
  | 'auto'
94
323
 
324
+ /**
325
+ * Collapsed height based on the combined `header` and `footer` heights.
326
+ * Render a `TrueSheetPeek` component within the content to also include
327
+ * the content up to its bottom edge.
328
+ * Falls back to a fixed height of `150` when none is provided.
329
+ *
330
+ * @platform android
331
+ * @platform ios 16+
332
+ */
333
+ | 'peek'
334
+
95
335
  /**
96
336
  * Relative height as a fraction (0-1) of the available height.
97
337
  * For example, 0.5 represents 50% of the available height.
@@ -126,6 +366,9 @@ export interface TrueSheetProps extends ViewProps {
126
366
  * detents={['auto', 0.6, 1]}
127
367
  * ```
128
368
  *
369
+ * @note It's recommended to sort detents from smallest to largest.
370
+ * When using `auto`, place it at the first index if you plan to adjust content dynamically.
371
+ *
129
372
  * @default [0.5, 1]
130
373
  */
131
374
  detents?: SheetDetent[];
@@ -134,8 +377,6 @@ export interface TrueSheetProps extends ViewProps {
134
377
  * Specify whether the sheet background is dimmed.
135
378
  * Set to `false` to allow interaction with the background components.
136
379
  *
137
- * @platform android
138
- * @platform ios 15+
139
380
  * @default true
140
381
  */
141
382
  dimmed?: boolean;
@@ -162,7 +403,7 @@ export interface TrueSheetProps extends ViewProps {
162
403
  *
163
404
  * @default 0
164
405
  */
165
- dimmedIndex?: number;
406
+ dimmedDetentIndex?: number;
166
407
 
167
408
  /**
168
409
  * Prevents interactive dismissal of the Sheet.
@@ -172,9 +413,16 @@ export interface TrueSheetProps extends ViewProps {
172
413
  dismissible?: boolean;
173
414
 
174
415
  /**
175
- * Main sheet background color.
416
+ * Enables or disables dragging the sheet to resize it.
417
+ * When disabled, the sheet becomes static and can only be resized programmatically.
418
+ *
419
+ * @default true
420
+ */
421
+ draggable?: boolean;
176
422
 
177
- * @default white
423
+ /**
424
+ * Main sheet background color.
425
+ * Uses system default when not provided.
178
426
  */
179
427
  backgroundColor?: ColorValue;
180
428
 
@@ -184,49 +432,131 @@ export interface TrueSheetProps extends ViewProps {
184
432
  * - `undefined` (not provided): Uses system default corner radius
185
433
  * - `0`: Sharp corners (no rounding)
186
434
  * - `> 0`: Custom corner radius value
187
- *
188
- * @platform android
189
- * @platform ios 15+
190
435
  */
191
436
  cornerRadius?: number;
192
437
 
193
438
  /**
194
- * Shows native grabber (or handle) on IOS.
439
+ * Shows a native grabber (or drag handle) on the sheet.
440
+ *
441
+ * iOS uses the native `UISheetPresentationController` grabber.
442
+ * Android renders a native view following Material Design 3 specifications.
195
443
  *
196
- * @platform ios
197
444
  * @default true
198
445
  */
199
446
  grabber?: boolean;
200
447
 
201
448
  /**
202
- * Grabber props to be used for android grabber or handle.
449
+ * Options for customizing the grabber appearance.
450
+ * Only applies when `grabber` is `true`.
451
+ */
452
+ grabberOptions?: GrabberOptions;
453
+
454
+ /**
455
+ * Options for customizing (e.g. localizing) the accessibility strings
456
+ * announced by screen readers.
457
+ */
458
+ accessibilityOptions?: AccessibilityOptions;
459
+
460
+ /**
461
+ * Controls the sheet presentation style on iPad and web (landscape/tablet).
462
+ * - `'page'`: bottom-attached page sheet (full or readable width).
463
+ * - `'form'`: centered floating form sheet (default form-sheet width).
203
464
  *
204
- * @platform android
465
+ * `'form'` is absolute — `maxContentWidth` is ignored when set.
466
+ *
467
+ * @platform ios 17+, web
468
+ * @default 'page'
205
469
  */
206
- grabberProps?: TrueSheetGrabberProps;
470
+ presentation?: 'page' | 'form';
207
471
 
208
472
  /**
209
473
  * The blur effect style on iOS.
210
- * Overrides `backgroundColor` if set.
474
+ * Blends with `backgroundColor` when provided.
211
475
  *
212
476
  * @platform ios
213
477
  */
214
- blurTint?: BlurTint;
478
+ backgroundBlur?: BackgroundBlur;
479
+
480
+ /**
481
+ * Options for customizing the blur effect.
482
+ * Only applies when `backgroundBlur` is set.
483
+ *
484
+ * @platform ios
485
+ */
486
+ blurOptions?: BlurOptions;
215
487
 
216
488
  /**
217
489
  * Overrides `large` or `100%` height.
218
490
  * Also sets the maximum height for 'auto' detents.
219
491
  */
220
- maxHeight?: number;
492
+ maxContentHeight?: number;
493
+
494
+ /**
495
+ * The maximum width of the sheet content.
496
+ * On Android and Web, defaults to `640dp`. On iOS, the sheet uses system default width.
497
+ *
498
+ * Ignored on phones in portrait orientation.
499
+ */
500
+ maxContentWidth?: number;
501
+
502
+ /**
503
+ * Anchors the sheet to the specified horizontal edge.
504
+ *
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.
508
+ *
509
+ * Ignored on phones in portrait orientation.
510
+ *
511
+ * @default 'center'
512
+ */
513
+ anchor?: 'left' | 'center' | 'right';
221
514
 
222
515
  /**
223
- * Allows the sheet to extend behind the status bar when fully expanded in edge-to-edge mode.
224
- * When false (default), the sheet stops at the bottom of the status bar.
516
+ * The offset from the screen edge.
517
+ * Only applies when `anchor` is `'left'` or `'right'`.
225
518
  *
226
519
  * @platform android
227
- * @default false
520
+ * @platform web
521
+ * @default 16
228
522
  */
229
- edgeToEdgeFullScreen?: boolean;
523
+ anchorOffset?: number;
524
+
525
+ /**
526
+ * Controls how the sheet adjusts its height for system insets (safe area).
527
+ *
528
+ * - `'automatic'`: Adds the bottom safe area inset to the sheet height,
529
+ * ensuring content is properly inset from system UI elements.
530
+ * - `'never'`: Does not adjust for insets; height is calculated purely from detent values.
531
+ *
532
+ * @default 'automatic'
533
+ */
534
+ insetAdjustment?: InsetAdjustment;
535
+
536
+ /**
537
+ * The elevation (shadow depth) of the sheet.
538
+ *
539
+ * @platform android
540
+ * @platform web
541
+ * @default 4
542
+ */
543
+ elevation?: number;
544
+
545
+ /**
546
+ * A component that is fixed at the top of the Sheet content.
547
+ * Useful for search bars, titles, or other header content.
548
+ */
549
+ header?: ComponentType<unknown> | ReactElement;
550
+
551
+ /**
552
+ * Style for the header container.
553
+ */
554
+ headerStyle?: StyleProp<ViewStyle>;
555
+
556
+ /**
557
+ * Options for header behavior.
558
+ */
559
+ headerOptions?: HeaderOptions;
230
560
 
231
561
  /**
232
562
  * A component that floats at the bottom of the Sheet.
@@ -234,13 +564,35 @@ export interface TrueSheetProps extends ViewProps {
234
564
  footer?: ComponentType<unknown> | ReactElement;
235
565
 
236
566
  /**
237
- * Determines how the software keyboard will impact the layout of the sheet.
238
- * Set to `pan` if you're working with `FlatList` with a `TextInput`.
567
+ * Style for the footer container.
568
+ */
569
+ footerStyle?: StyleProp<ViewStyle>;
570
+
571
+ /**
572
+ * Options for scrollable behavior.
573
+ */
574
+ scrollableOptions?: ScrollableOptions;
575
+
576
+ /**
577
+ * Options for footer behavior.
578
+ */
579
+ footerOptions?: FooterOptions;
580
+
581
+ /**
582
+ * Renders the sheet as a detached floating card, not attached to the bottom edge.
239
583
  *
240
- * @platform android
241
- * @default resize
584
+ * @platform web
585
+ * @default false
586
+ */
587
+ detached?: boolean;
588
+
589
+ /**
590
+ * The offset from the bottom edge when [`detached`](#detached) is enabled.
591
+ *
592
+ * @platform web
593
+ * @default 16
242
594
  */
243
- keyboardMode?: 'resize' | 'pan';
595
+ detachedOffset?: number;
244
596
 
245
597
  /**
246
598
  * Called when the sheet's content is mounted and ready.
@@ -278,27 +630,18 @@ export interface TrueSheetProps extends ViewProps {
278
630
  /**
279
631
  * Called when the sheet has began dragging.
280
632
  * Comes with the detent info.
281
- *
282
- * @platform android
283
- * @platform ios 15+
284
633
  */
285
634
  onDragBegin?: (event: DragBeginEvent) => void;
286
635
 
287
636
  /**
288
637
  * Called when the sheet is being dragged.
289
638
  * Comes with the detent info.
290
- *
291
- * @platform android
292
- * @platform ios 15+
293
639
  */
294
640
  onDragChange?: (event: DragChangeEvent) => void;
295
641
 
296
642
  /**
297
643
  * Called when the sheet dragging has ended.
298
644
  * Comes with the detent info.
299
- *
300
- * @platform android
301
- * @platform ios 15+
302
645
  */
303
646
  onDragEnd?: (event: DragEndEvent) => void;
304
647
 
@@ -306,9 +649,120 @@ export interface TrueSheetProps extends ViewProps {
306
649
  * Called when the sheet's position changes.
307
650
  * This fires continuously during sheet position changes.
308
651
  * Comes with the detent info.
652
+ */
653
+ onPositionChange?: (event: PositionChangeEvent) => void;
654
+
655
+ /**
656
+ * Called when the sheet is about to regain focus because a sheet presented on top of it is being dismissed.
657
+ */
658
+ onWillFocus?: (event: WillFocusEvent) => void;
659
+
660
+ /**
661
+ * Called when the sheet regains focus after a sheet presented on top of it is dismissed.
662
+ */
663
+ onDidFocus?: (event: DidFocusEvent) => void;
664
+
665
+ /**
666
+ * Called when the sheet is about to lose focus because another sheet is being presented on top of it.
667
+ */
668
+ onWillBlur?: (event: WillBlurEvent) => void;
669
+
670
+ /**
671
+ * Called when the sheet loses focus because another sheet is presented on top of it.
672
+ */
673
+ onDidBlur?: (event: DidBlurEvent) => void;
674
+
675
+ /**
676
+ * Called when the hardware back button is pressed on Android.
677
+ * Optionally return `false` to let the back event propagate to other handlers (e.g. navigation).
309
678
  *
310
679
  * @platform android
311
- * @platform ios 15+
312
680
  */
313
- onPositionChange?: (event: PositionChangeEvent) => void;
681
+ onBackPress?: () => boolean | void;
682
+ }
683
+
684
+ /**
685
+ * Imperative methods available on a TrueSheet ref.
686
+ *
687
+ * Example:
688
+ * ```tsx
689
+ * const sheetRef = useRef<TrueSheetMethods>(null);
690
+ * sheetRef.current?.present();
691
+ * ```
692
+ */
693
+ export interface TrueSheetMethods {
694
+ /**
695
+ * Present the sheet at a given detent index.
696
+ *
697
+ * @param index - The detent index to present at (default: `0`).
698
+ * @param animated - Whether to animate the presentation (default: `true`). Ignored on web.
699
+ */
700
+ present(index?: number, animated?: boolean): Promise<void>;
701
+
702
+ /**
703
+ * Resize the sheet to a given detent index.
704
+ *
705
+ * @param index - The detent index to resize to.
706
+ */
707
+ resize(index: number): Promise<void>;
708
+
709
+ /**
710
+ * Dismiss this sheet and all sheets presented on top of it in a single animation.
711
+ *
712
+ * @param animated - Whether to animate the dismissal (default: `true`). Ignored on web.
713
+ */
714
+ dismiss(animated?: boolean): Promise<void>;
715
+
716
+ /**
717
+ * Dismiss only the sheets presented on top of this sheet, keeping this sheet presented.
718
+ * No-op if no sheets are presented on top.
719
+ *
720
+ * @param animated - Whether to animate the dismissal (default: `true`). Ignored on web.
721
+ */
722
+ dismissStack(animated?: boolean): Promise<void>;
723
+ }
724
+
725
+ /**
726
+ * Static methods exposed on the `TrueSheet` component for controlling sheets by `name`.
727
+ *
728
+ * Example:
729
+ * ```ts
730
+ * TrueSheet.present('my-sheet')
731
+ * ```
732
+ *
733
+ * @note Not supported on web — use the `useTrueSheet()` hook instead.
734
+ */
735
+ export interface TrueSheetStaticMethods {
736
+ /**
737
+ * Present the sheet with the given `name`.
738
+ *
739
+ * @throws if no sheet with the given `name` is registered.
740
+ */
741
+ present(name: string, index?: number, animated?: boolean): Promise<void>;
742
+
743
+ /**
744
+ * Resize the sheet with the given `name`.
745
+ *
746
+ * @throws if no sheet with the given `name` is registered.
747
+ */
748
+ resize(name: string, index: number): Promise<void>;
749
+
750
+ /**
751
+ * Dismiss the sheet with the given `name` and all sheets presented on top of it.
752
+ *
753
+ * @throws if no sheet with the given `name` is registered.
754
+ */
755
+ dismiss(name: string, animated?: boolean): Promise<void>;
756
+
757
+ /**
758
+ * Dismiss only the sheets presented on top of the sheet with the given `name`.
759
+ *
760
+ * @throws if no sheet with the given `name` is registered.
761
+ */
762
+ dismissStack(name: string, animated?: boolean): Promise<void>;
763
+
764
+ /**
765
+ * Dismiss every presented sheet, from the top of the stack downward.
766
+ */
767
+ dismissAll(animated?: boolean): Promise<void>;
314
768
  }