@swmansion/react-native-bottom-sheet 0.15.0-next.4 → 0.15.0-next.6
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.
- package/README.md +25 -2
- package/android/src/main/java/com/swmansion/reactnativebottomsheet/BottomSheetHostView.kt +979 -0
- package/android/src/main/java/com/swmansion/reactnativebottomsheet/BottomSheetView.kt +342 -874
- package/android/src/main/java/com/swmansion/reactnativebottomsheet/BottomSheetViewManager.kt +7 -1
- package/ios/BottomSheetComponentView.mm +149 -0
- package/ios/BottomSheetContentView.h +1 -0
- package/ios/BottomSheetContentView.mm +5 -0
- package/ios/BottomSheetHostingView.swift +4 -0
- package/lib/module/BottomSheet.js +26 -16
- package/lib/module/BottomSheet.js.map +1 -1
- package/lib/module/BottomSheetNativeComponent.ts +1 -0
- package/lib/module/ModalBottomSheet.js +12 -5
- package/lib/module/ModalBottomSheet.js.map +1 -1
- package/lib/typescript/src/BottomSheet.d.ts +17 -8
- package/lib/typescript/src/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/src/BottomSheetNativeComponent.d.ts +1 -0
- package/lib/typescript/src/BottomSheetNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/ModalBottomSheet.d.ts +36 -2
- package/lib/typescript/src/ModalBottomSheet.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/BottomSheet.tsx +45 -23
- package/src/BottomSheetNativeComponent.ts +1 -0
- package/src/ModalBottomSheet.tsx +50 -8
package/README.md
CHANGED
|
@@ -175,6 +175,29 @@ To keep the scrim deepening across every detent, pass one value per detent:
|
|
|
175
175
|
</ModalBottomSheet>
|
|
176
176
|
```
|
|
177
177
|
|
|
178
|
+
#### Native overlay
|
|
179
|
+
|
|
180
|
+
By default `ModalBottomSheet` renders through `BottomSheetProvider`’s portal.
|
|
181
|
+
That portal lives in your React tree, so a sheet opened from a screen presented
|
|
182
|
+
as a native modal (for example, a React Navigation native-stack screen with
|
|
183
|
+
`presentation: 'modal'`) is confined to that screen and cannot cover it.
|
|
184
|
+
|
|
185
|
+
Set `nativeOverlay` to present the sheet in a native overlay above
|
|
186
|
+
everything—including native modal screens—so it always covers the full window.
|
|
187
|
+
On iOS, a `UIWindow`-attached container is used; on Android, a full-screen,
|
|
188
|
+
edge-to-edge, transparent dialog.
|
|
189
|
+
|
|
190
|
+
```tsx
|
|
191
|
+
<ModalBottomSheet
|
|
192
|
+
nativeOverlay
|
|
193
|
+
index={index}
|
|
194
|
+
onIndexChange={setIndex}
|
|
195
|
+
surface={/* ... */}
|
|
196
|
+
>
|
|
197
|
+
{/* ... */}
|
|
198
|
+
</ModalBottomSheet>
|
|
199
|
+
```
|
|
200
|
+
|
|
178
201
|
### Surface
|
|
179
202
|
|
|
180
203
|
Provide the sheet’s background through the `surface` prop. The library renders
|
|
@@ -307,8 +330,8 @@ top of the sheet from `event.nativeEvent.position`. The same event also
|
|
|
307
330
|
carries `event.nativeEvent.index`—the fractional detent index in
|
|
308
331
|
`0..(detents.length - 1)` (`0` at the shortest detent, `1` at the next, and so
|
|
309
332
|
on, interpolated in between)—the continuous counterpart of `onIndexChange`,
|
|
310
|
-
handy for driving a backdrop or per-detent animation without knowing the
|
|
311
|
-
|
|
333
|
+
handy for driving a backdrop or per-detent animation without knowing the sheet’s
|
|
334
|
+
height.
|
|
312
335
|
|
|
313
336
|
```tsx
|
|
314
337
|
<BottomSheet // Or `ModalBottomSheet`.
|