@hanzogui/sheet 2.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 (347) hide show
  1. package/LICENSE +21 -0
  2. package/controller/index.cjs +2 -0
  3. package/controller/index.d.ts +5 -0
  4. package/controller/index.js +2 -0
  5. package/controller/index.native.cjs +2 -0
  6. package/controller/index.native.js +2 -0
  7. package/dist/cjs/GestureDetectorWrapper.cjs +48 -0
  8. package/dist/cjs/GestureDetectorWrapper.native.js +53 -0
  9. package/dist/cjs/GestureDetectorWrapper.native.js.map +1 -0
  10. package/dist/cjs/GestureSheetContext.cjs +52 -0
  11. package/dist/cjs/GestureSheetContext.native.js +56 -0
  12. package/dist/cjs/GestureSheetContext.native.js.map +1 -0
  13. package/dist/cjs/Sheet.cjs +117 -0
  14. package/dist/cjs/Sheet.native.js +120 -0
  15. package/dist/cjs/Sheet.native.js.map +1 -0
  16. package/dist/cjs/SheetContext.cjs +32 -0
  17. package/dist/cjs/SheetContext.native.js +35 -0
  18. package/dist/cjs/SheetContext.native.js.map +1 -0
  19. package/dist/cjs/SheetController.cjs +65 -0
  20. package/dist/cjs/SheetController.native.js +71 -0
  21. package/dist/cjs/SheetController.native.js.map +1 -0
  22. package/dist/cjs/SheetImplementationCustom.cjs +472 -0
  23. package/dist/cjs/SheetImplementationCustom.native.js +524 -0
  24. package/dist/cjs/SheetImplementationCustom.native.js.map +1 -0
  25. package/dist/cjs/SheetScrollView.cjs +180 -0
  26. package/dist/cjs/SheetScrollView.native.js +197 -0
  27. package/dist/cjs/SheetScrollView.native.js.map +1 -0
  28. package/dist/cjs/constants.cjs +32 -0
  29. package/dist/cjs/constants.native.js +35 -0
  30. package/dist/cjs/constants.native.js.map +1 -0
  31. package/dist/cjs/contexts.cjs +42 -0
  32. package/dist/cjs/contexts.native.js +45 -0
  33. package/dist/cjs/contexts.native.js.map +1 -0
  34. package/dist/cjs/controller.cjs +29 -0
  35. package/dist/cjs/controller.native.js +32 -0
  36. package/dist/cjs/controller.native.js.map +1 -0
  37. package/dist/cjs/createSheet.cjs +191 -0
  38. package/dist/cjs/createSheet.native.js +208 -0
  39. package/dist/cjs/createSheet.native.js.map +1 -0
  40. package/dist/cjs/gestureState.cjs +39 -0
  41. package/dist/cjs/gestureState.native.js +42 -0
  42. package/dist/cjs/gestureState.native.js.map +1 -0
  43. package/dist/cjs/helpers.cjs +31 -0
  44. package/dist/cjs/helpers.native.js +35 -0
  45. package/dist/cjs/helpers.native.js.map +1 -0
  46. package/dist/cjs/index.cjs +28 -0
  47. package/dist/cjs/index.native.js +31 -0
  48. package/dist/cjs/index.native.js.map +1 -0
  49. package/dist/cjs/nativeSheet.cjs +87 -0
  50. package/dist/cjs/nativeSheet.native.js +101 -0
  51. package/dist/cjs/nativeSheet.native.js.map +1 -0
  52. package/dist/cjs/setupGestureHandler.cjs +46 -0
  53. package/dist/cjs/setupGestureHandler.native.js +50 -0
  54. package/dist/cjs/setupGestureHandler.native.js.map +1 -0
  55. package/dist/cjs/types.cjs +16 -0
  56. package/dist/cjs/types.native.js +19 -0
  57. package/dist/cjs/types.native.js.map +1 -0
  58. package/dist/cjs/useGestureHandlerPan.cjs +136 -0
  59. package/dist/cjs/useGestureHandlerPan.native.js +145 -0
  60. package/dist/cjs/useGestureHandlerPan.native.js.map +1 -0
  61. package/dist/cjs/useKeyboardControllerSheet.cjs +38 -0
  62. package/dist/cjs/useKeyboardControllerSheet.native.js +114 -0
  63. package/dist/cjs/useKeyboardControllerSheet.native.js.map +1 -0
  64. package/dist/cjs/useSheet.cjs +27 -0
  65. package/dist/cjs/useSheet.native.js +32 -0
  66. package/dist/cjs/useSheet.native.js.map +1 -0
  67. package/dist/cjs/useSheetController.cjs +50 -0
  68. package/dist/cjs/useSheetController.native.js +53 -0
  69. package/dist/cjs/useSheetController.native.js.map +1 -0
  70. package/dist/cjs/useSheetOffscreenSize.cjs +51 -0
  71. package/dist/cjs/useSheetOffscreenSize.native.js +61 -0
  72. package/dist/cjs/useSheetOffscreenSize.native.js.map +1 -0
  73. package/dist/cjs/useSheetOpenState.cjs +49 -0
  74. package/dist/cjs/useSheetOpenState.native.js +56 -0
  75. package/dist/cjs/useSheetOpenState.native.js.map +1 -0
  76. package/dist/cjs/useSheetProviderProps.cjs +133 -0
  77. package/dist/cjs/useSheetProviderProps.native.js +153 -0
  78. package/dist/cjs/useSheetProviderProps.native.js.map +1 -0
  79. package/dist/cjs/useSheetScrollViewGestures.cjs +123 -0
  80. package/dist/cjs/useSheetScrollViewGestures.native.js +110 -0
  81. package/dist/cjs/useSheetScrollViewGestures.native.js.map +1 -0
  82. package/dist/esm/GestureDetectorWrapper.mjs +25 -0
  83. package/dist/esm/GestureDetectorWrapper.mjs.map +1 -0
  84. package/dist/esm/GestureDetectorWrapper.native.js +27 -0
  85. package/dist/esm/GestureDetectorWrapper.native.js.map +1 -0
  86. package/dist/esm/GestureSheetContext.mjs +28 -0
  87. package/dist/esm/GestureSheetContext.mjs.map +1 -0
  88. package/dist/esm/GestureSheetContext.native.js +29 -0
  89. package/dist/esm/GestureSheetContext.native.js.map +1 -0
  90. package/dist/esm/Sheet.mjs +89 -0
  91. package/dist/esm/Sheet.mjs.map +1 -0
  92. package/dist/esm/Sheet.native.js +89 -0
  93. package/dist/esm/Sheet.native.js.map +1 -0
  94. package/dist/esm/SheetContext.mjs +6 -0
  95. package/dist/esm/SheetContext.mjs.map +1 -0
  96. package/dist/esm/SheetContext.native.js +6 -0
  97. package/dist/esm/SheetContext.native.js.map +1 -0
  98. package/dist/esm/SheetController.mjs +31 -0
  99. package/dist/esm/SheetController.mjs.map +1 -0
  100. package/dist/esm/SheetController.native.js +34 -0
  101. package/dist/esm/SheetController.native.js.map +1 -0
  102. package/dist/esm/SheetImplementationCustom.mjs +437 -0
  103. package/dist/esm/SheetImplementationCustom.mjs.map +1 -0
  104. package/dist/esm/SheetImplementationCustom.native.js +487 -0
  105. package/dist/esm/SheetImplementationCustom.native.js.map +1 -0
  106. package/dist/esm/SheetScrollView.mjs +146 -0
  107. package/dist/esm/SheetScrollView.mjs.map +1 -0
  108. package/dist/esm/SheetScrollView.native.js +160 -0
  109. package/dist/esm/SheetScrollView.native.js.map +1 -0
  110. package/dist/esm/constants.mjs +6 -0
  111. package/dist/esm/constants.mjs.map +1 -0
  112. package/dist/esm/constants.native.js +6 -0
  113. package/dist/esm/constants.native.js.map +1 -0
  114. package/dist/esm/contexts.mjs +7 -0
  115. package/dist/esm/contexts.mjs.map +1 -0
  116. package/dist/esm/contexts.native.js +7 -0
  117. package/dist/esm/contexts.native.js.map +1 -0
  118. package/dist/esm/controller.mjs +4 -0
  119. package/dist/esm/controller.mjs.map +1 -0
  120. package/dist/esm/controller.native.js +4 -0
  121. package/dist/esm/controller.native.js.map +1 -0
  122. package/dist/esm/createSheet.mjs +168 -0
  123. package/dist/esm/createSheet.mjs.map +1 -0
  124. package/dist/esm/createSheet.native.js +182 -0
  125. package/dist/esm/createSheet.native.js.map +1 -0
  126. package/dist/esm/gestureState.mjs +13 -0
  127. package/dist/esm/gestureState.mjs.map +1 -0
  128. package/dist/esm/gestureState.native.js +13 -0
  129. package/dist/esm/gestureState.native.js.map +1 -0
  130. package/dist/esm/helpers.mjs +8 -0
  131. package/dist/esm/helpers.mjs.map +1 -0
  132. package/dist/esm/helpers.native.js +9 -0
  133. package/dist/esm/helpers.native.js.map +1 -0
  134. package/dist/esm/index.js +12 -0
  135. package/dist/esm/index.js.map +1 -0
  136. package/dist/esm/index.mjs +12 -0
  137. package/dist/esm/index.mjs.map +1 -0
  138. package/dist/esm/index.native.js +12 -0
  139. package/dist/esm/index.native.js.map +1 -0
  140. package/dist/esm/nativeSheet.mjs +63 -0
  141. package/dist/esm/nativeSheet.mjs.map +1 -0
  142. package/dist/esm/nativeSheet.native.js +74 -0
  143. package/dist/esm/nativeSheet.native.js.map +1 -0
  144. package/dist/esm/setupGestureHandler.mjs +22 -0
  145. package/dist/esm/setupGestureHandler.mjs.map +1 -0
  146. package/dist/esm/setupGestureHandler.native.js +23 -0
  147. package/dist/esm/setupGestureHandler.native.js.map +1 -0
  148. package/dist/esm/types.mjs +2 -0
  149. package/dist/esm/types.mjs.map +1 -0
  150. package/dist/esm/types.native.js +2 -0
  151. package/dist/esm/types.native.js.map +1 -0
  152. package/dist/esm/useGestureHandlerPan.mjs +113 -0
  153. package/dist/esm/useGestureHandlerPan.mjs.map +1 -0
  154. package/dist/esm/useGestureHandlerPan.native.js +119 -0
  155. package/dist/esm/useGestureHandlerPan.native.js.map +1 -0
  156. package/dist/esm/useKeyboardControllerSheet.mjs +15 -0
  157. package/dist/esm/useKeyboardControllerSheet.mjs.map +1 -0
  158. package/dist/esm/useKeyboardControllerSheet.native.js +88 -0
  159. package/dist/esm/useKeyboardControllerSheet.native.js.map +1 -0
  160. package/dist/esm/useSheet.mjs +4 -0
  161. package/dist/esm/useSheet.mjs.map +1 -0
  162. package/dist/esm/useSheet.native.js +6 -0
  163. package/dist/esm/useSheet.native.js.map +1 -0
  164. package/dist/esm/useSheetController.mjs +15 -0
  165. package/dist/esm/useSheetController.mjs.map +1 -0
  166. package/dist/esm/useSheetController.native.js +15 -0
  167. package/dist/esm/useSheetController.native.js.map +1 -0
  168. package/dist/esm/useSheetOffscreenSize.mjs +28 -0
  169. package/dist/esm/useSheetOffscreenSize.mjs.map +1 -0
  170. package/dist/esm/useSheetOffscreenSize.native.js +35 -0
  171. package/dist/esm/useSheetOffscreenSize.native.js.map +1 -0
  172. package/dist/esm/useSheetOpenState.mjs +26 -0
  173. package/dist/esm/useSheetOpenState.mjs.map +1 -0
  174. package/dist/esm/useSheetOpenState.native.js +30 -0
  175. package/dist/esm/useSheetOpenState.native.js.map +1 -0
  176. package/dist/esm/useSheetProviderProps.mjs +99 -0
  177. package/dist/esm/useSheetProviderProps.mjs.map +1 -0
  178. package/dist/esm/useSheetProviderProps.native.js +116 -0
  179. package/dist/esm/useSheetProviderProps.native.js.map +1 -0
  180. package/dist/esm/useSheetScrollViewGestures.mjs +100 -0
  181. package/dist/esm/useSheetScrollViewGestures.mjs.map +1 -0
  182. package/dist/esm/useSheetScrollViewGestures.native.js +84 -0
  183. package/dist/esm/useSheetScrollViewGestures.native.js.map +1 -0
  184. package/dist/jsx/GestureDetectorWrapper.mjs +25 -0
  185. package/dist/jsx/GestureDetectorWrapper.mjs.map +1 -0
  186. package/dist/jsx/GestureDetectorWrapper.native.js +53 -0
  187. package/dist/jsx/GestureDetectorWrapper.native.js.map +1 -0
  188. package/dist/jsx/GestureSheetContext.mjs +28 -0
  189. package/dist/jsx/GestureSheetContext.mjs.map +1 -0
  190. package/dist/jsx/GestureSheetContext.native.js +56 -0
  191. package/dist/jsx/GestureSheetContext.native.js.map +1 -0
  192. package/dist/jsx/Sheet.mjs +89 -0
  193. package/dist/jsx/Sheet.mjs.map +1 -0
  194. package/dist/jsx/Sheet.native.js +120 -0
  195. package/dist/jsx/Sheet.native.js.map +1 -0
  196. package/dist/jsx/SheetContext.mjs +6 -0
  197. package/dist/jsx/SheetContext.mjs.map +1 -0
  198. package/dist/jsx/SheetContext.native.js +35 -0
  199. package/dist/jsx/SheetContext.native.js.map +1 -0
  200. package/dist/jsx/SheetController.mjs +31 -0
  201. package/dist/jsx/SheetController.mjs.map +1 -0
  202. package/dist/jsx/SheetController.native.js +71 -0
  203. package/dist/jsx/SheetController.native.js.map +1 -0
  204. package/dist/jsx/SheetImplementationCustom.mjs +437 -0
  205. package/dist/jsx/SheetImplementationCustom.mjs.map +1 -0
  206. package/dist/jsx/SheetImplementationCustom.native.js +524 -0
  207. package/dist/jsx/SheetImplementationCustom.native.js.map +1 -0
  208. package/dist/jsx/SheetScrollView.mjs +146 -0
  209. package/dist/jsx/SheetScrollView.mjs.map +1 -0
  210. package/dist/jsx/SheetScrollView.native.js +197 -0
  211. package/dist/jsx/SheetScrollView.native.js.map +1 -0
  212. package/dist/jsx/constants.mjs +6 -0
  213. package/dist/jsx/constants.mjs.map +1 -0
  214. package/dist/jsx/constants.native.js +35 -0
  215. package/dist/jsx/constants.native.js.map +1 -0
  216. package/dist/jsx/contexts.mjs +7 -0
  217. package/dist/jsx/contexts.mjs.map +1 -0
  218. package/dist/jsx/contexts.native.js +45 -0
  219. package/dist/jsx/contexts.native.js.map +1 -0
  220. package/dist/jsx/controller.mjs +4 -0
  221. package/dist/jsx/controller.mjs.map +1 -0
  222. package/dist/jsx/controller.native.js +32 -0
  223. package/dist/jsx/controller.native.js.map +1 -0
  224. package/dist/jsx/createSheet.mjs +168 -0
  225. package/dist/jsx/createSheet.mjs.map +1 -0
  226. package/dist/jsx/createSheet.native.js +208 -0
  227. package/dist/jsx/createSheet.native.js.map +1 -0
  228. package/dist/jsx/gestureState.mjs +13 -0
  229. package/dist/jsx/gestureState.mjs.map +1 -0
  230. package/dist/jsx/gestureState.native.js +42 -0
  231. package/dist/jsx/gestureState.native.js.map +1 -0
  232. package/dist/jsx/helpers.mjs +8 -0
  233. package/dist/jsx/helpers.mjs.map +1 -0
  234. package/dist/jsx/helpers.native.js +35 -0
  235. package/dist/jsx/helpers.native.js.map +1 -0
  236. package/dist/jsx/index.js +12 -0
  237. package/dist/jsx/index.js.map +1 -0
  238. package/dist/jsx/index.mjs +12 -0
  239. package/dist/jsx/index.mjs.map +1 -0
  240. package/dist/jsx/index.native.js +31 -0
  241. package/dist/jsx/index.native.js.map +1 -0
  242. package/dist/jsx/nativeSheet.mjs +63 -0
  243. package/dist/jsx/nativeSheet.mjs.map +1 -0
  244. package/dist/jsx/nativeSheet.native.js +101 -0
  245. package/dist/jsx/nativeSheet.native.js.map +1 -0
  246. package/dist/jsx/setupGestureHandler.mjs +22 -0
  247. package/dist/jsx/setupGestureHandler.mjs.map +1 -0
  248. package/dist/jsx/setupGestureHandler.native.js +50 -0
  249. package/dist/jsx/setupGestureHandler.native.js.map +1 -0
  250. package/dist/jsx/types.mjs +2 -0
  251. package/dist/jsx/types.mjs.map +1 -0
  252. package/dist/jsx/types.native.js +19 -0
  253. package/dist/jsx/types.native.js.map +1 -0
  254. package/dist/jsx/useGestureHandlerPan.mjs +113 -0
  255. package/dist/jsx/useGestureHandlerPan.mjs.map +1 -0
  256. package/dist/jsx/useGestureHandlerPan.native.js +145 -0
  257. package/dist/jsx/useGestureHandlerPan.native.js.map +1 -0
  258. package/dist/jsx/useKeyboardControllerSheet.mjs +15 -0
  259. package/dist/jsx/useKeyboardControllerSheet.mjs.map +1 -0
  260. package/dist/jsx/useKeyboardControllerSheet.native.js +114 -0
  261. package/dist/jsx/useKeyboardControllerSheet.native.js.map +1 -0
  262. package/dist/jsx/useSheet.mjs +4 -0
  263. package/dist/jsx/useSheet.mjs.map +1 -0
  264. package/dist/jsx/useSheet.native.js +32 -0
  265. package/dist/jsx/useSheet.native.js.map +1 -0
  266. package/dist/jsx/useSheetController.mjs +15 -0
  267. package/dist/jsx/useSheetController.mjs.map +1 -0
  268. package/dist/jsx/useSheetController.native.js +53 -0
  269. package/dist/jsx/useSheetController.native.js.map +1 -0
  270. package/dist/jsx/useSheetOffscreenSize.mjs +28 -0
  271. package/dist/jsx/useSheetOffscreenSize.mjs.map +1 -0
  272. package/dist/jsx/useSheetOffscreenSize.native.js +61 -0
  273. package/dist/jsx/useSheetOffscreenSize.native.js.map +1 -0
  274. package/dist/jsx/useSheetOpenState.mjs +26 -0
  275. package/dist/jsx/useSheetOpenState.mjs.map +1 -0
  276. package/dist/jsx/useSheetOpenState.native.js +56 -0
  277. package/dist/jsx/useSheetOpenState.native.js.map +1 -0
  278. package/dist/jsx/useSheetProviderProps.mjs +99 -0
  279. package/dist/jsx/useSheetProviderProps.mjs.map +1 -0
  280. package/dist/jsx/useSheetProviderProps.native.js +153 -0
  281. package/dist/jsx/useSheetProviderProps.native.js.map +1 -0
  282. package/dist/jsx/useSheetScrollViewGestures.mjs +100 -0
  283. package/dist/jsx/useSheetScrollViewGestures.mjs.map +1 -0
  284. package/dist/jsx/useSheetScrollViewGestures.native.js +110 -0
  285. package/dist/jsx/useSheetScrollViewGestures.native.js.map +1 -0
  286. package/next.md +78 -0
  287. package/package.json +96 -0
  288. package/setup-gesture-handler/index.cjs +2 -0
  289. package/setup-gesture-handler/index.js +2 -0
  290. package/setup-gesture-handler/index.native.cjs +2 -0
  291. package/setup-gesture-handler/index.native.js +2 -0
  292. package/setup-gesture-handler.cjs +1 -0
  293. package/src/GestureDetectorWrapper.tsx +41 -0
  294. package/src/GestureSheetContext.tsx +62 -0
  295. package/src/Sheet.tsx +114 -0
  296. package/src/SheetContext.tsx +11 -0
  297. package/src/SheetController.tsx +44 -0
  298. package/src/SheetImplementationCustom.tsx +868 -0
  299. package/src/SheetScrollView.tsx +195 -0
  300. package/src/constants.tsx +5 -0
  301. package/src/contexts.ts +9 -0
  302. package/src/controller.ts +9 -0
  303. package/src/createSheet.tsx +296 -0
  304. package/src/gestureState.ts +24 -0
  305. package/src/helpers.tsx +31 -0
  306. package/src/index.ts +11 -0
  307. package/src/nativeSheet.tsx +89 -0
  308. package/src/setupGestureHandler.ts +34 -0
  309. package/src/types.tsx +181 -0
  310. package/src/useGestureHandlerPan.tsx +364 -0
  311. package/src/useKeyboardControllerSheet.native.ts +136 -0
  312. package/src/useKeyboardControllerSheet.ts +26 -0
  313. package/src/useSheet.tsx +3 -0
  314. package/src/useSheetController.tsx +27 -0
  315. package/src/useSheetOffscreenSize.tsx +49 -0
  316. package/src/useSheetOpenState.tsx +33 -0
  317. package/src/useSheetProviderProps.tsx +223 -0
  318. package/src/useSheetScrollViewGestures.native.ts +163 -0
  319. package/src/useSheetScrollViewGestures.ts +194 -0
  320. package/tsconfig.json +56 -0
  321. package/types/GestureDetectorWrapper.d.ts +14 -0
  322. package/types/GestureSheetContext.d.ts +36 -0
  323. package/types/Sheet.d.ts +183 -0
  324. package/types/SheetContext.d.ts +43 -0
  325. package/types/SheetController.d.ts +6 -0
  326. package/types/SheetImplementationCustom.d.ts +36 -0
  327. package/types/SheetScrollView.d.ts +40 -0
  328. package/types/constants.d.ts +5 -0
  329. package/types/contexts.d.ts +6 -0
  330. package/types/controller.d.ts +3 -0
  331. package/types/createSheet.d.ts +194 -0
  332. package/types/gestureState.d.ts +11 -0
  333. package/types/helpers.d.ts +2 -0
  334. package/types/index.d.ts +12 -0
  335. package/types/nativeSheet.d.ts +10 -0
  336. package/types/setupGestureHandler.d.ts +11 -0
  337. package/types/types.d.ts +147 -0
  338. package/types/useGestureHandlerPan.d.ts +44 -0
  339. package/types/useKeyboardControllerSheet.d.ts +7 -0
  340. package/types/useKeyboardControllerSheet.native.d.ts +13 -0
  341. package/types/useSheet.d.ts +2 -0
  342. package/types/useSheetController.d.ts +17 -0
  343. package/types/useSheetOffscreenSize.d.ts +3 -0
  344. package/types/useSheetOpenState.d.ts +9 -0
  345. package/types/useSheetProviderProps.d.ts +36 -0
  346. package/types/useSheetScrollViewGestures.d.ts +12 -0
  347. package/types/useSheetScrollViewGestures.native.d.ts +21 -0
@@ -0,0 +1,194 @@
1
+ import { useEffect, useRef } from 'react'
2
+ import type { ScrollView as RNScrollView } from 'react-native'
3
+ import type { ScrollBridge } from './types'
4
+
5
+ type GestureOwner = 'none' | 'pan' | 'scroll'
6
+
7
+ interface GestureState {
8
+ startY: number
9
+ lastY: number
10
+ owner: GestureOwner
11
+ panDragOffset: number
12
+ dys: number[]
13
+ scrollYAtGestureStart: number
14
+ }
15
+
16
+ interface UseSheetScrollViewGesturesProps {
17
+ scrollRef: React.RefObject<RNScrollView | null>
18
+ scrollBridge: ScrollBridge
19
+ hasScrollableContent: boolean
20
+ scrollEnabled: boolean
21
+ setScrollEnabled: (enabled: boolean, lockTo?: number) => void
22
+ }
23
+
24
+ export function useSheetScrollViewGestures({
25
+ scrollRef,
26
+ scrollBridge,
27
+ hasScrollableContent,
28
+ }: UseSheetScrollViewGesturesProps) {
29
+ const state = useRef<GestureState>({
30
+ startY: 0,
31
+ lastY: 0,
32
+ owner: 'none',
33
+ panDragOffset: 0,
34
+ dys: [],
35
+ scrollYAtGestureStart: 0,
36
+ })
37
+
38
+ useEffect(() => {
39
+ if (!scrollRef.current) return
40
+
41
+ const controller = new AbortController()
42
+ const node = scrollRef.current?.getScrollableNode() as HTMLElement | undefined
43
+
44
+ if (!node) return
45
+
46
+ node.style.overscrollBehavior = 'contain'
47
+
48
+ // track original overflow to restore later
49
+ let originalOverflow = ''
50
+
51
+ const disableScroll = () => {
52
+ if (node.style.overflowY !== 'hidden') {
53
+ originalOverflow = node.style.overflowY
54
+ node.style.overflowY = 'hidden'
55
+ }
56
+ }
57
+
58
+ const enableScroll = () => {
59
+ node.style.overflowY = originalOverflow
60
+ }
61
+
62
+ const handleTouchStart = (e: TouchEvent) => {
63
+ const touch = e.touches[0]
64
+ if (!touch) return
65
+
66
+ const currentScrollY = node.scrollTop
67
+
68
+ state.current = {
69
+ startY: touch.pageY,
70
+ lastY: touch.pageY,
71
+ owner: 'none',
72
+ panDragOffset: 0,
73
+ dys: [],
74
+ scrollYAtGestureStart: currentScrollY,
75
+ }
76
+
77
+ scrollBridge.scrollStartY = touch.pageY
78
+ }
79
+
80
+ const handleTouchMove = (e: TouchEvent) => {
81
+ const touch = e.touches[0]
82
+ if (!touch) return
83
+
84
+ const { current: s } = state
85
+ const pageY = touch.pageY
86
+ const dy = pageY - s.lastY
87
+ s.lastY = pageY
88
+
89
+ if (dy === 0) return
90
+
91
+ const isDraggingDown = dy > 0
92
+ const currentScrollY = node.scrollTop
93
+ const isPaneAtTop = scrollBridge.paneY <= scrollBridge.paneMinY + 5
94
+
95
+ scrollBridge.y = currentScrollY
96
+
97
+ // simple ownership rules:
98
+ // - pan owns when: sheet not at top, OR (sheet at top AND scrollY=0 AND dragging down)
99
+ // - scroll owns otherwise
100
+
101
+ let shouldPanOwn = false
102
+
103
+ if (!isPaneAtTop) {
104
+ // sheet not at top - pan always owns
105
+ shouldPanOwn = true
106
+ } else if (currentScrollY <= 0 && isDraggingDown) {
107
+ // at top, scroll at 0, dragging down - pan owns (pull sheet down)
108
+ shouldPanOwn = true
109
+ }
110
+
111
+ const newOwner: GestureOwner = shouldPanOwn ? 'pan' : 'scroll'
112
+
113
+ // handle transitions
114
+ if (newOwner !== s.owner) {
115
+ if (newOwner === 'pan') {
116
+ s.panDragOffset = 0
117
+ s.dys = []
118
+ scrollBridge.setParentDragging(true)
119
+ disableScroll()
120
+ } else {
121
+ scrollBridge.setParentDragging(false)
122
+ scrollBridge.scrollLock = false
123
+ enableScroll()
124
+ }
125
+ s.owner = newOwner
126
+ }
127
+
128
+ if (s.owner === 'pan') {
129
+ if (e.cancelable) e.preventDefault()
130
+
131
+ s.panDragOffset += dy
132
+ scrollBridge.drag(s.panDragOffset)
133
+
134
+ s.dys.push(dy)
135
+ if (s.dys.length > 100) s.dys = s.dys.slice(-10)
136
+ } else if (s.owner === 'scroll') {
137
+ // programmatic scroll for synthetic events
138
+ const scrollDelta = -dy
139
+ const maxScrollY = node.scrollHeight - node.clientHeight
140
+ const newScrollY = Math.max(0, Math.min(maxScrollY, currentScrollY + scrollDelta))
141
+ if (newScrollY !== currentScrollY) {
142
+ node.scrollTop = newScrollY
143
+ scrollBridge.y = newScrollY
144
+ }
145
+ }
146
+ }
147
+
148
+ const handleTouchEnd = () => {
149
+ const { current: s } = state
150
+
151
+ if (s.owner === 'pan') {
152
+ scrollBridge.setParentDragging(false)
153
+
154
+ let vy = 0
155
+ if (s.dys.length) {
156
+ const recentDys = s.dys.slice(-10)
157
+ const dist = recentDys.reduce((a, b) => a + b, 0)
158
+ vy = (dist / recentDys.length) * 0.04
159
+ }
160
+
161
+ scrollBridge.release({ dragAt: s.panDragOffset, vy })
162
+ }
163
+
164
+ enableScroll()
165
+ s.owner = 'none'
166
+ s.panDragOffset = 0
167
+ s.dys = []
168
+ }
169
+
170
+ node.addEventListener('touchstart', handleTouchStart, {
171
+ signal: controller.signal,
172
+ passive: true,
173
+ })
174
+ node.addEventListener('touchmove', handleTouchMove, {
175
+ signal: controller.signal,
176
+ passive: false,
177
+ })
178
+ node.addEventListener('touchend', handleTouchEnd, {
179
+ signal: controller.signal,
180
+ passive: true,
181
+ })
182
+ node.addEventListener('touchcancel', handleTouchEnd, {
183
+ signal: controller.signal,
184
+ passive: true,
185
+ })
186
+
187
+ return () => {
188
+ enableScroll()
189
+ controller.abort()
190
+ }
191
+ }, [scrollRef, scrollBridge, hasScrollableContent])
192
+
193
+ return {}
194
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "composite": true,
5
+ "strict": true
6
+ },
7
+ "references": [
8
+ {
9
+ "path": "../../core/animations-react-native"
10
+ },
11
+ {
12
+ "path": "../../core/compose-refs"
13
+ },
14
+ {
15
+ "path": "../../core/constants"
16
+ },
17
+ {
18
+ "path": "../../core/core"
19
+ },
20
+ {
21
+ "path": "../../core/create-context"
22
+ },
23
+ {
24
+ "path": "../../core/helpers"
25
+ },
26
+ {
27
+ "path": "../../core/use-constant"
28
+ },
29
+ {
30
+ "path": "../../core/use-controllable-state"
31
+ },
32
+ {
33
+ "path": "../../core/use-keyboard-visible"
34
+ },
35
+ {
36
+ "path": "../animate-presence"
37
+ },
38
+ {
39
+ "path": "../portal"
40
+ },
41
+ {
42
+ "path": "../remove-scroll"
43
+ },
44
+ {
45
+ "path": "../scroll-view"
46
+ },
47
+ {
48
+ "path": "../stacks"
49
+ }
50
+ ],
51
+ "exclude": [
52
+ "types",
53
+ "dist",
54
+ "**/__tests__"
55
+ ]
56
+ }
@@ -0,0 +1,14 @@
1
+ import type React from 'react';
2
+ import { type ViewStyle } from 'react-native';
3
+ interface GestureDetectorWrapperProps {
4
+ gesture: any;
5
+ children: React.ReactNode;
6
+ style?: ViewStyle;
7
+ }
8
+ /**
9
+ * Conditionally wraps children with GestureDetector when RNGH is available.
10
+ * Uses a plain View wrapper that GestureDetector can attach gesture handlers to.
11
+ */
12
+ export declare function GestureDetectorWrapper({ gesture, children, style, }: GestureDetectorWrapperProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
14
+ //# sourceMappingURL=GestureDetectorWrapper.d.ts.map
@@ -0,0 +1,36 @@
1
+ import type React from 'react';
2
+ import { type RefObject } from 'react';
3
+ export interface GestureSheetContextValue {
4
+ /**
5
+ * The sheet's pan gesture object, used for simultaneousHandlers
6
+ * in ScrollView to coordinate gestures
7
+ */
8
+ panGesture: any | null;
9
+ /**
10
+ * Ref to the pan gesture for simultaneousHandlers prop
11
+ */
12
+ panGestureRef: RefObject<any> | null;
13
+ /**
14
+ * Whether the sheet is currently being dragged by the user
15
+ */
16
+ isDragging: boolean;
17
+ /**
18
+ * Set whether panning should be blocked (e.g., when scrolling)
19
+ */
20
+ setBlockPan: (blocked: boolean) => void;
21
+ /**
22
+ * Whether pan gesture is currently blocked
23
+ */
24
+ blockPan: boolean;
25
+ }
26
+ export declare function useGestureSheetContext(): GestureSheetContextValue | null;
27
+ export interface GestureSheetProviderProps {
28
+ children: React.ReactNode;
29
+ isDragging: boolean;
30
+ blockPan: boolean;
31
+ setBlockPan: (blocked: boolean) => void;
32
+ panGesture: any | null;
33
+ panGestureRef: RefObject<any> | null;
34
+ }
35
+ export declare function GestureSheetProvider({ children, isDragging, blockPan, setBlockPan, panGesture, panGestureRef, }: GestureSheetProviderProps): import("react/jsx-runtime").JSX.Element;
36
+ //# sourceMappingURL=GestureSheetContext.d.ts.map
@@ -0,0 +1,183 @@
1
+ export { createSheetScope } from './SheetContext';
2
+ export * from './types';
3
+ export declare const Handle: import("@gui/core").GuiComponent<import("@gui/core").TamaDefer, import("@gui/core").GuiElement, import("@gui/core").RNGuiViewNonStyleProps, import("@gui/core").StackStyleBase, {
4
+ open?: boolean | undefined;
5
+ unstyled?: boolean | undefined;
6
+ elevation?: number | import("@gui/core").SizeTokens | undefined;
7
+ fullscreen?: boolean | undefined;
8
+ }, import("@gui/core").StaticConfigPublic>;
9
+ export declare const Overlay: import("@gui/core").GuiComponent<import("@gui/core").TamaDefer, import("@gui/core").GuiElement, import("@gui/core").RNGuiViewNonStyleProps, import("@gui/core").StackStyleBase, {
10
+ open?: boolean | undefined;
11
+ unstyled?: boolean | undefined;
12
+ elevation?: number | import("@gui/core").SizeTokens | undefined;
13
+ fullscreen?: boolean | undefined;
14
+ }, import("@gui/core").StaticConfigPublic>;
15
+ export declare const Frame: import("@gui/core").GuiComponent<import("@gui/core").TamaDefer, import("@gui/core").GuiElement, import("@gui/core").RNGuiViewNonStyleProps, import("@gui/core").StackStyleBase, {
16
+ unstyled?: boolean | undefined;
17
+ elevation?: number | import("@gui/core").SizeTokens | undefined;
18
+ fullscreen?: boolean | undefined;
19
+ }, import("@gui/core").StaticConfigPublic>;
20
+ export declare const Sheet: import("react").ForwardRefExoticComponent<{
21
+ open?: boolean;
22
+ defaultOpen?: boolean;
23
+ onOpenChange?: import("react").Dispatch<import("react").SetStateAction<boolean>> | ((open: boolean) => void);
24
+ position?: number;
25
+ defaultPosition?: number;
26
+ snapPoints?: (string | number)[];
27
+ snapPointsMode?: import("./types").SnapPointsMode;
28
+ onPositionChange?: import("./types").PositionChangeHandler;
29
+ children?: import("react").ReactNode;
30
+ dismissOnOverlayPress?: boolean;
31
+ dismissOnSnapToBottom?: boolean;
32
+ disableRemoveScroll?: boolean;
33
+ forceRemoveScrollEnabled?: boolean;
34
+ transitionConfig?: import("@gui/core").AnimatedNumberStrategy;
35
+ preferAdaptParentOpenState?: boolean;
36
+ unmountChildrenWhenHidden?: boolean;
37
+ native?: "ios"[] | boolean;
38
+ transition?: import("@gui/core").TransitionProp;
39
+ handleDisableScroll?: boolean;
40
+ disableDrag?: boolean;
41
+ modal?: boolean;
42
+ zIndex?: number;
43
+ portalProps?: import("@gui/portal").PortalProps;
44
+ moveOnKeyboardChange?: boolean;
45
+ containerComponent?: React.ComponentType<any>;
46
+ onAnimationComplete?: (info: {
47
+ open: boolean;
48
+ }) => void;
49
+ } & {
50
+ __scopeSheet?: import("@gui/create-context").Scope<any>;
51
+ } & import("react").RefAttributes<import("react-native").View>> & {
52
+ Controlled: import("react").FunctionComponent<Omit<import("./types").SheetProps, "open" | "onOpenChange"> & import("react").RefAttributes<import("react-native").View>> & {
53
+ Frame: import("react").ForwardRefExoticComponent<import("./types").SheetScopedProps<Omit<import("@gui/core").GetFinalProps<import("@gui/core").RNGuiViewNonStyleProps, import("@gui/core").StackStyleBase, {
54
+ unstyled?: boolean | undefined;
55
+ elevation?: number | import("@gui/core").SizeTokens | undefined;
56
+ fullscreen?: boolean | undefined;
57
+ }>, keyof {
58
+ disableHideBottomOverflow?: boolean;
59
+ adjustPaddingForOffscreenContent?: boolean;
60
+ }> & {
61
+ disableHideBottomOverflow?: boolean;
62
+ adjustPaddingForOffscreenContent?: boolean;
63
+ }>>;
64
+ Overlay: import("@gui/core").GuiComponent<Omit<import("@gui/core").StackNonStyleProps & import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase> & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase>> & import("@gui/core").WithPseudoProps<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase> & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase>>> & import("@gui/core").WithMediaProps<import("@gui/core").WithThemeShorthandsAndPseudos<import("@gui/core").StackStyleBase, {}>> & {
65
+ open?: boolean;
66
+ }, "__scopeSheet"> & {
67
+ __scopeSheet?: import("@gui/create-context").Scope<any>;
68
+ }, any, any, any, {
69
+ open?: boolean;
70
+ }, {}> | import("@gui/core").GuiComponent<Omit<import("@gui/core").StackNonStyleProps & import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase> & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase>> & import("@gui/core").WithPseudoProps<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase> & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase>>> & import("@gui/core").WithMediaProps<import("@gui/core").WithThemeShorthandsAndPseudos<import("@gui/core").StackStyleBase, {}>> & {
71
+ open?: boolean;
72
+ }, "__scopeSheet"> & {
73
+ __scopeSheet?: import("@gui/create-context").Scope<any>;
74
+ }, any, {
75
+ __scopeSheet?: import("@gui/create-context").Scope<any>;
76
+ }, {}, {}, {}>;
77
+ Handle: import("@gui/core").GuiComponent<any, any, any, any, {
78
+ open?: boolean;
79
+ }, {}> | import("@gui/core").GuiComponent<any, any, any, {}, {}, {}>;
80
+ ScrollView: import("react").ForwardRefExoticComponent<Omit<import("@gui/core").GuiComponentPropsBaseBase & import("react-native").ScrollViewProps, keyof import("@gui/core").StackStyleBase | "fullscreen" | "contentContainerStyle"> & import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
81
+ readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
82
+ accept: {
83
+ readonly contentContainerStyle: "style";
84
+ };
85
+ }>> | undefined;
86
+ }> & {
87
+ fullscreen?: boolean | undefined;
88
+ } & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
89
+ readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
90
+ accept: {
91
+ readonly contentContainerStyle: "style";
92
+ };
93
+ }>> | undefined;
94
+ }>> & import("@gui/core").WithPseudoProps<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
95
+ readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
96
+ accept: {
97
+ readonly contentContainerStyle: "style";
98
+ };
99
+ }>> | undefined;
100
+ }> & {
101
+ fullscreen?: boolean | undefined;
102
+ } & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
103
+ readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
104
+ accept: {
105
+ readonly contentContainerStyle: "style";
106
+ };
107
+ }>> | undefined;
108
+ }>>> & import("@gui/core").WithMediaProps<import("@gui/core").WithThemeShorthandsAndPseudos<import("@gui/core").StackStyleBase & {
109
+ readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
110
+ accept: {
111
+ readonly contentContainerStyle: "style";
112
+ };
113
+ }>> | undefined;
114
+ }, {
115
+ fullscreen?: boolean | undefined;
116
+ }>> & import("react").RefAttributes<import("react-native").ScrollView>>;
117
+ };
118
+ Frame: import("react").ForwardRefExoticComponent<import("./types").SheetScopedProps<Omit<import("@gui/core").GetFinalProps<import("@gui/core").RNGuiViewNonStyleProps, import("@gui/core").StackStyleBase, {
119
+ unstyled?: boolean | undefined;
120
+ elevation?: number | import("@gui/core").SizeTokens | undefined;
121
+ fullscreen?: boolean | undefined;
122
+ }>, keyof {
123
+ disableHideBottomOverflow?: boolean;
124
+ adjustPaddingForOffscreenContent?: boolean;
125
+ }> & {
126
+ disableHideBottomOverflow?: boolean;
127
+ adjustPaddingForOffscreenContent?: boolean;
128
+ }>>;
129
+ Overlay: import("@gui/core").GuiComponent<Omit<import("@gui/core").StackNonStyleProps & import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase> & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase>> & import("@gui/core").WithPseudoProps<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase> & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase>>> & import("@gui/core").WithMediaProps<import("@gui/core").WithThemeShorthandsAndPseudos<import("@gui/core").StackStyleBase, {}>> & {
130
+ open?: boolean;
131
+ }, "__scopeSheet"> & {
132
+ __scopeSheet?: import("@gui/create-context").Scope<any>;
133
+ }, any, any, any, {
134
+ open?: boolean;
135
+ }, {}> | import("@gui/core").GuiComponent<Omit<import("@gui/core").StackNonStyleProps & import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase> & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase>> & import("@gui/core").WithPseudoProps<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase> & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase>>> & import("@gui/core").WithMediaProps<import("@gui/core").WithThemeShorthandsAndPseudos<import("@gui/core").StackStyleBase, {}>> & {
136
+ open?: boolean;
137
+ }, "__scopeSheet"> & {
138
+ __scopeSheet?: import("@gui/create-context").Scope<any>;
139
+ }, any, {
140
+ __scopeSheet?: import("@gui/create-context").Scope<any>;
141
+ }, {}, {}, {}>;
142
+ Handle: import("@gui/core").GuiComponent<any, any, any, any, {
143
+ open?: boolean;
144
+ }, {}> | import("@gui/core").GuiComponent<any, any, any, {}, {}, {}>;
145
+ ScrollView: import("react").ForwardRefExoticComponent<Omit<import("@gui/core").GuiComponentPropsBaseBase & import("react-native").ScrollViewProps, keyof import("@gui/core").StackStyleBase | "fullscreen" | "contentContainerStyle"> & import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
146
+ readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
147
+ accept: {
148
+ readonly contentContainerStyle: "style";
149
+ };
150
+ }>> | undefined;
151
+ }> & {
152
+ fullscreen?: boolean | undefined;
153
+ } & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
154
+ readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
155
+ accept: {
156
+ readonly contentContainerStyle: "style";
157
+ };
158
+ }>> | undefined;
159
+ }>> & import("@gui/core").WithPseudoProps<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
160
+ readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
161
+ accept: {
162
+ readonly contentContainerStyle: "style";
163
+ };
164
+ }>> | undefined;
165
+ }> & {
166
+ fullscreen?: boolean | undefined;
167
+ } & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
168
+ readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
169
+ accept: {
170
+ readonly contentContainerStyle: "style";
171
+ };
172
+ }>> | undefined;
173
+ }>>> & import("@gui/core").WithMediaProps<import("@gui/core").WithThemeShorthandsAndPseudos<import("@gui/core").StackStyleBase & {
174
+ readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
175
+ accept: {
176
+ readonly contentContainerStyle: "style";
177
+ };
178
+ }>> | undefined;
179
+ }, {
180
+ fullscreen?: boolean | undefined;
181
+ }>> & import("react").RefAttributes<import("react-native").ScrollView>>;
182
+ };
183
+ //# sourceMappingURL=Sheet.d.ts.map
@@ -0,0 +1,43 @@
1
+ import type { SheetContextValue } from './useSheetProviderProps';
2
+ export declare const createSheetContext: <ContextValueType extends object | null>(rootComponentName: string, defaultContext?: ContextValueType) => readonly [(props: ContextValueType & {
3
+ scope: import("@gui/create-context").Scope<ContextValueType>;
4
+ children: React.ReactNode;
5
+ }) => import("react/jsx-runtime").JSX.Element, (consumerName: string, scope: import("@gui/create-context").Scope<ContextValueType | undefined>, options?: {
6
+ warn?: boolean;
7
+ fallback?: Partial<ContextValueType>;
8
+ }) => ContextValueType], createSheetScope: import("@gui/create-context").CreateScope;
9
+ export declare const SheetProvider: (props: {
10
+ screenSize: number;
11
+ maxSnapPoint: string | number;
12
+ disableRemoveScroll: boolean;
13
+ scrollBridge: import("./types").ScrollBridge;
14
+ modal: boolean;
15
+ open: boolean;
16
+ setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
17
+ hidden: boolean;
18
+ contentRef: import("react").RefObject<import("@gui/web").GuiElement | null>;
19
+ handleRef: import("react").RefObject<import("@gui/web").GuiElement | null>;
20
+ frameSize: number;
21
+ setFrameSize: import("react").Dispatch<import("react").SetStateAction<number>>;
22
+ dismissOnOverlayPress: boolean;
23
+ dismissOnSnapToBottom: boolean;
24
+ onOverlayComponent: ((comp: any) => void) | undefined;
25
+ scope: import("@gui/create-context").Scope<any>;
26
+ hasFit: boolean;
27
+ position: number;
28
+ snapPoints: (string | number)[];
29
+ snapPointsMode: import("./types").SnapPointsMode;
30
+ setMaxContentSize: import("react").Dispatch<import("react").SetStateAction<number>>;
31
+ setPosition: (next: number) => void;
32
+ setPositionImmediate: import("react").Dispatch<import("react").SetStateAction<number>>;
33
+ onlyShowFrame: boolean;
34
+ } & {
35
+ setHasScrollView: (val: boolean) => void;
36
+ } & {
37
+ scope: import("@gui/create-context").Scope<SheetContextValue>;
38
+ children: React.ReactNode;
39
+ }) => import("react/jsx-runtime").JSX.Element, useSheetContext: (consumerName: string, scope: import("@gui/create-context").Scope<SheetContextValue | undefined>, options?: {
40
+ warn?: boolean;
41
+ fallback?: Partial<SheetContextValue> | undefined;
42
+ } | undefined) => SheetContextValue;
43
+ //# sourceMappingURL=SheetContext.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { SheetControllerContextValue } from './useSheetController';
3
+ export declare const SheetController: ({ children, onOpenChange: onOpenChangeProp, open, hidden, disableDrag, }: Partial<SheetControllerContextValue> & {
4
+ children?: ReactNode;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=SheetController.d.ts.map
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { View } from 'react-native';
3
+ import type { SnapPointsMode } from './types';
4
+ export declare const SheetImplementationCustom: React.ForwardRefExoticComponent<{
5
+ open?: boolean;
6
+ defaultOpen?: boolean;
7
+ onOpenChange?: React.Dispatch<React.SetStateAction<boolean>> | ((open: boolean) => void);
8
+ position?: number;
9
+ defaultPosition?: number;
10
+ snapPoints?: (string | number)[];
11
+ snapPointsMode?: SnapPointsMode;
12
+ onPositionChange?: import("./types").PositionChangeHandler;
13
+ children?: React.ReactNode;
14
+ dismissOnOverlayPress?: boolean;
15
+ dismissOnSnapToBottom?: boolean;
16
+ disableRemoveScroll?: boolean;
17
+ forceRemoveScrollEnabled?: boolean;
18
+ transitionConfig?: import("@gui/core").AnimatedNumberStrategy;
19
+ preferAdaptParentOpenState?: boolean;
20
+ unmountChildrenWhenHidden?: boolean;
21
+ native?: "ios"[] | boolean;
22
+ transition?: import("@gui/core").TransitionProp;
23
+ handleDisableScroll?: boolean;
24
+ disableDrag?: boolean;
25
+ modal?: boolean;
26
+ zIndex?: number;
27
+ portalProps?: import("@gui/portal").PortalProps;
28
+ moveOnKeyboardChange?: boolean;
29
+ containerComponent?: React.ComponentType<any>;
30
+ onAnimationComplete?: (info: {
31
+ open: boolean;
32
+ }) => void;
33
+ } & {
34
+ __scopeSheet?: import("@gui/create-context").Scope<any>;
35
+ } & React.RefAttributes<View>>;
36
+ //# sourceMappingURL=SheetImplementationCustom.d.ts.map
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import type { ScrollView as RNScrollView } from 'react-native';
3
+ export declare const SheetScrollView: React.ForwardRefExoticComponent<Omit<import("@gui/core").GuiComponentPropsBaseBase & import("react-native").ScrollViewProps, keyof import("@gui/core").StackStyleBase | "fullscreen" | "contentContainerStyle"> & import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
4
+ readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof RNScrollView, {
5
+ accept: {
6
+ readonly contentContainerStyle: "style";
7
+ };
8
+ }>> | undefined;
9
+ }> & {
10
+ fullscreen?: boolean | undefined;
11
+ } & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
12
+ readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof RNScrollView, {
13
+ accept: {
14
+ readonly contentContainerStyle: "style";
15
+ };
16
+ }>> | undefined;
17
+ }>> & import("@gui/core").WithPseudoProps<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
18
+ readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof RNScrollView, {
19
+ accept: {
20
+ readonly contentContainerStyle: "style";
21
+ };
22
+ }>> | undefined;
23
+ }> & {
24
+ fullscreen?: boolean | undefined;
25
+ } & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
26
+ readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof RNScrollView, {
27
+ accept: {
28
+ readonly contentContainerStyle: "style";
29
+ };
30
+ }>> | undefined;
31
+ }>>> & import("@gui/core").WithMediaProps<import("@gui/core").WithThemeShorthandsAndPseudos<import("@gui/core").StackStyleBase & {
32
+ readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof RNScrollView, {
33
+ accept: {
34
+ readonly contentContainerStyle: "style";
35
+ };
36
+ }>> | undefined;
37
+ }, {
38
+ fullscreen?: boolean | undefined;
39
+ }>> & React.RefAttributes<RNScrollView>>;
40
+ //# sourceMappingURL=SheetScrollView.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const constants: {};
2
+ export declare const SHEET_NAME = "Sheet";
3
+ export declare const SHEET_HANDLE_NAME = "SheetHandle";
4
+ export declare const SHEET_OVERLAY_NAME = "SheetOverlay";
5
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export declare const ParentSheetContext: React.Context<{
3
+ zIndex: number;
4
+ }>;
5
+ export declare const SheetInsideSheetContext: React.Context<((hasChild: boolean) => void) | null>;
6
+ //# sourceMappingURL=contexts.d.ts.map
@@ -0,0 +1,3 @@
1
+ export { SheetController } from './SheetController';
2
+ export { SheetControllerContext, useSheetController, type SheetControllerContextValue, } from './useSheetController';
3
+ //# sourceMappingURL=controller.d.ts.map