@lodev09/react-native-true-sheet 3.11.0-beta.1 → 3.11.0-beta.10
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/LICENSE +1 -1
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +3 -3
- package/ios/TrueSheetFooterView.mm +10 -1
- package/ios/TrueSheetView.mm +1 -1
- package/ios/TrueSheetViewController.h +1 -1
- package/ios/TrueSheetViewController.mm +10 -4
- package/lib/module/TrueSheet.js +2 -2
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/module/TrueSheet.web.js +222 -50
- package/lib/module/TrueSheet.web.js.map +1 -1
- package/lib/module/TrueSheetProvider.web.js +5 -2
- package/lib/module/TrueSheetProvider.web.js.map +1 -1
- package/lib/module/fabric/TrueSheetViewNativeComponent.ts +1 -1
- package/lib/module/web/constants.js +1 -1
- package/lib/module/web/constants.js.map +1 -1
- package/lib/module/web/vaul/index.js +88 -133
- package/lib/module/web/vaul/index.js.map +1 -1
- package/lib/module/web/vaul/style.css +1 -1
- package/lib/typescript/src/TrueSheet.types.d.ts +6 -4
- package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheet.web.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheetProvider.web.d.ts +2 -1
- package/lib/typescript/src/TrueSheetProvider.web.d.ts.map +1 -1
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts +1 -1
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/navigation/types.d.ts +1 -1
- package/lib/typescript/src/navigation/types.d.ts.map +1 -1
- package/lib/typescript/src/web/constants.d.ts +1 -1
- package/lib/typescript/src/web/constants.d.ts.map +1 -1
- package/lib/typescript/src/web/vaul/index.d.ts +7 -1
- package/lib/typescript/src/web/vaul/index.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/TrueSheet.tsx +2 -2
- package/src/TrueSheet.types.ts +6 -4
- package/src/TrueSheet.web.tsx +220 -52
- package/src/TrueSheetProvider.web.tsx +11 -2
- package/src/fabric/TrueSheetViewNativeComponent.ts +1 -1
- package/src/navigation/types.ts +1 -1
- package/src/web/constants.ts +1 -1
- package/src/web/vaul/index.tsx +118 -146
- package/src/web/vaul/style.css +1 -1
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2026 lodev09
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
5
|
of this software and associated documentation files (the "Software"), to deal
|
|
6
6
|
in the Software without restriction, including without limitation the rights
|
|
@@ -206,9 +206,9 @@ class TrueSheetViewManager :
|
|
|
206
206
|
view.setScrollable(value)
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
@ReactProp(name = "
|
|
210
|
-
override fun
|
|
211
|
-
// iOS-specific prop - no-op on Android
|
|
209
|
+
@ReactProp(name = "presentation")
|
|
210
|
+
override fun setPresentation(view: TrueSheetView, value: String?) {
|
|
211
|
+
// iOS/web-specific prop - no-op on Android
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
@ReactProp(name = "elevation", defaultDouble = -1.0)
|
|
@@ -21,6 +21,7 @@ using namespace facebook::react;
|
|
|
21
21
|
|
|
22
22
|
@implementation TrueSheetFooterView {
|
|
23
23
|
CGFloat _lastHeight;
|
|
24
|
+
CGFloat _pendingHeight;
|
|
24
25
|
BOOL _didInitialLayout;
|
|
25
26
|
NSLayoutConstraint *_bottomConstraint;
|
|
26
27
|
CGFloat _currentKeyboardOffset;
|
|
@@ -38,6 +39,7 @@ using namespace facebook::react;
|
|
|
38
39
|
self.backgroundColor = [UIColor clearColor];
|
|
39
40
|
|
|
40
41
|
_lastHeight = 0;
|
|
42
|
+
_pendingHeight = 0;
|
|
41
43
|
_didInitialLayout = NO;
|
|
42
44
|
_bottomConstraint = nil;
|
|
43
45
|
_currentKeyboardOffset = 0;
|
|
@@ -50,6 +52,11 @@ using namespace facebook::react;
|
|
|
50
52
|
- (void)setupConstraintsWithHeight:(CGFloat)height {
|
|
51
53
|
UIView *parentView = self.superview;
|
|
52
54
|
if (!parentView) {
|
|
55
|
+
// On recycled views, updateLayoutMetrics can fire before the view is
|
|
56
|
+
// reparented. Remember the desired height so didMoveToSuperview applies
|
|
57
|
+
// it instead of falling back to the stale self.frame from the previous
|
|
58
|
+
// present cycle.
|
|
59
|
+
_pendingHeight = height;
|
|
53
60
|
return;
|
|
54
61
|
}
|
|
55
62
|
|
|
@@ -70,13 +77,14 @@ using namespace facebook::react;
|
|
|
70
77
|
}
|
|
71
78
|
|
|
72
79
|
_lastHeight = height;
|
|
80
|
+
_pendingHeight = 0;
|
|
73
81
|
}
|
|
74
82
|
|
|
75
83
|
- (void)didMoveToSuperview {
|
|
76
84
|
[super didMoveToSuperview];
|
|
77
85
|
|
|
78
86
|
if (self.superview) {
|
|
79
|
-
CGFloat initialHeight = self.frame.size.height;
|
|
87
|
+
CGFloat initialHeight = _pendingHeight > 0 ? _pendingHeight : self.frame.size.height;
|
|
80
88
|
[self setupConstraintsWithHeight:initialHeight];
|
|
81
89
|
}
|
|
82
90
|
}
|
|
@@ -105,6 +113,7 @@ using namespace facebook::react;
|
|
|
105
113
|
}
|
|
106
114
|
|
|
107
115
|
_lastHeight = 0;
|
|
116
|
+
_pendingHeight = 0;
|
|
108
117
|
_didInitialLayout = NO;
|
|
109
118
|
_bottomConstraint = nil;
|
|
110
119
|
_currentKeyboardOffset = 0;
|
package/ios/TrueSheetView.mm
CHANGED
|
@@ -230,7 +230,7 @@ using namespace facebook::react;
|
|
|
230
230
|
_controller.grabberOptions = nil;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
_controller.
|
|
233
|
+
_controller.presentation = newProps.presentation;
|
|
234
234
|
_controller.dismissible = newProps.dismissible;
|
|
235
235
|
_controller.draggable = newProps.draggable;
|
|
236
236
|
_controller.dimmed = newProps.dimmed;
|
|
@@ -67,7 +67,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
67
67
|
@property (nonatomic, assign) facebook::react::TrueSheetViewBackgroundBlur backgroundBlur;
|
|
68
68
|
@property (nonatomic, strong, nullable) NSNumber *blurIntensity;
|
|
69
69
|
@property (nonatomic, assign) BOOL blurInteraction;
|
|
70
|
-
@property (nonatomic, assign)
|
|
70
|
+
@property (nonatomic, assign) facebook::react::TrueSheetViewPresentation presentation;
|
|
71
71
|
@property (nonatomic, assign) facebook::react::TrueSheetViewAnchor anchor;
|
|
72
72
|
@property (nonatomic, assign) facebook::react::TrueSheetViewInsetAdjustment insetAdjustment;
|
|
73
73
|
@property (nonatomic, assign) BOOL scrollingExpandsSheet;
|
|
@@ -73,7 +73,7 @@ static BOOL TrueSheetPositionStateEquals(TrueSheetPositionState a, TrueSheetPosi
|
|
|
73
73
|
_dismissible = YES;
|
|
74
74
|
_dimmed = YES;
|
|
75
75
|
_dimmedDetentIndex = @(0);
|
|
76
|
-
|
|
76
|
+
_presentation = facebook::react::TrueSheetViewPresentation::Page;
|
|
77
77
|
_lastEmittedPositionState = (TrueSheetPositionState){0, 0, 0};
|
|
78
78
|
_isDragging = NO;
|
|
79
79
|
_isPresented = NO;
|
|
@@ -739,7 +739,7 @@ static BOOL TrueSheetPositionStateEquals(TrueSheetPositionState a, TrueSheetPosi
|
|
|
739
739
|
_blurView.blurInteraction = self.blurInteraction;
|
|
740
740
|
[_blurView applyBlurEffect];
|
|
741
741
|
|
|
742
|
-
#if RNTS_IPHONE_OS_VERSION_AVAILABLE(26_1)
|
|
742
|
+
#if RNTS_IPHONE_OS_VERSION_AVAILABLE(26_1) && !TARGET_OS_MACCATALYST
|
|
743
743
|
if (@available(iOS 26.1, *)) {
|
|
744
744
|
if (!self.isDesignCompatibilityMode) {
|
|
745
745
|
if (self.backgroundColor) {
|
|
@@ -869,10 +869,16 @@ static BOOL TrueSheetPositionStateEquals(TrueSheetPositionState a, TrueSheetPosi
|
|
|
869
869
|
if (!sheet)
|
|
870
870
|
return;
|
|
871
871
|
|
|
872
|
-
|
|
872
|
+
// `presentation` is absolute on the form side: 'form' always renders a
|
|
873
|
+
// centered form sheet and ignores `maxContentWidth`. For 'page' with a
|
|
874
|
+
// custom `maxContentWidth`, prefersPageSizing has to flip to NO since
|
|
875
|
+
// `widthFollowsPreferredContentSizeWhenEdgeAttached` only takes effect
|
|
876
|
+
// when the sheet is edge-attached (Apple API constraint).
|
|
877
|
+
BOOL formSheet = self.presentation == facebook::react::TrueSheetViewPresentation::Form;
|
|
878
|
+
BOOL hasMaxWidth = self.maxContentWidth != nil && !formSheet;
|
|
873
879
|
|
|
874
880
|
if (@available(iOS 17.0, *)) {
|
|
875
|
-
sheet.prefersPageSizing =
|
|
881
|
+
sheet.prefersPageSizing = !formSheet && !hasMaxWidth;
|
|
876
882
|
}
|
|
877
883
|
|
|
878
884
|
sheet.widthFollowsPreferredContentSizeWhenEdgeAttached = hasMaxWidth;
|
package/lib/module/TrueSheet.js
CHANGED
|
@@ -349,7 +349,7 @@ export class TrueSheet extends PureComponent {
|
|
|
349
349
|
anchorOffset,
|
|
350
350
|
scrollable = false,
|
|
351
351
|
scrollableOptions,
|
|
352
|
-
|
|
352
|
+
presentation = 'page',
|
|
353
353
|
children,
|
|
354
354
|
style,
|
|
355
355
|
header,
|
|
@@ -402,7 +402,7 @@ export class TrueSheet extends PureComponent {
|
|
|
402
402
|
anchorOffset: anchorOffset,
|
|
403
403
|
scrollable: scrollable,
|
|
404
404
|
scrollableOptions: scrollableOptions,
|
|
405
|
-
|
|
405
|
+
presentation: presentation,
|
|
406
406
|
insetAdjustment: insetAdjustment,
|
|
407
407
|
onMount: this.onMount,
|
|
408
408
|
onWillPresent: this.onWillPresent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PureComponent","createRef","isValidElement","createElement","TrueSheetViewNativeComponent","TrueSheetContainerViewNativeComponent","TrueSheetContentViewNativeComponent","TrueSheetHeaderViewNativeComponent","TrueSheetFooterViewNativeComponent","TrueSheetModule","Platform","StyleSheet","BackHandler","findNodeHandle","processColor","jsx","_jsx","jsxs","_jsxs","LINKING_ERROR","select","ios","default","Error","TrueSheet","displayName","backHandlerSubscription","isPresented","isSheetVisible","instances","presentationResolver","isPresenting","constructor","props","nativeRef","validateDetents","shouldRenderImmediately","initialDetentIndex","undefined","state","shouldRenderNativeView","onMount","bind","onWillDismiss","onDidDismiss","onWillPresent","onDidPresent","onDetentChange","onDragBegin","onDragChange","onDragEnd","onPositionChange","onWillFocus","onDidFocus","onWillBlur","onDidBlur","handleBackPress","onVisibilityChange","detents","length","console","warn","forEach","detent","index","detentsLength","Math","min","getInstance","name","instance","handle","nodeHandle","current","present","animated","dismiss","dismissStack","resize","dismissAll","registerInstance","unregisterInstance","event","OS","remove","addEventListener","setState","nativeEvent","visible","onBackPress","Promise","resolve","presentByRef","resizeByRef","dismissByRef","dismissStackByRef","componentDidMount","componentDidUpdate","prevProps","componentWillUnmount","render","backgroundColor","dismissible","draggable","grabber","grabberOptions","dimmed","initialDetentAnimated","dimmedDetentIndex","backgroundBlur","blurOptions","cornerRadius","maxContentHeight","maxContentWidth","anchor","anchorOffset","scrollable","scrollableOptions","pageSizing","children","style","header","headerStyle","footer","footerStyle","insetAdjustment","rest","resolvedDetents","slice","map","cachedGrabberOptions","resolvedGrabberOptions","color","ref","styles","sheetView","scrollableContainer","scrollableContent","create","absoluteFill","zIndex","pointerEvents","flex","position","left","right"],"sourceRoot":"../../src","sources":["TrueSheet.tsx"],"mappings":";;AAAA,SACEA,aAAa,EAEbC,SAAS,EAGTC,cAAc,EACdC,aAAa,QACR,OAAO;AAqBd,OAAOC,4BAA4B,MAAM,uCAAuC;AAChF,OAAOC,qCAAqC,MAAM,gDAAgD;AAClG,OAAOC,mCAAmC,MAAM,8CAA8C;AAC9F,OAAOC,kCAAkC,MAAM,6CAA6C;AAC5F,OAAOC,kCAAkC,MAAM,6CAA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AE;IACNkB,aAAa,EAAE,UAAU;IACzBE,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["PureComponent","createRef","isValidElement","createElement","TrueSheetViewNativeComponent","TrueSheetContainerViewNativeComponent","TrueSheetContentViewNativeComponent","TrueSheetHeaderViewNativeComponent","TrueSheetFooterViewNativeComponent","TrueSheetModule","Platform","StyleSheet","BackHandler","findNodeHandle","processColor","jsx","_jsx","jsxs","_jsxs","LINKING_ERROR","select","ios","default","Error","TrueSheet","displayName","backHandlerSubscription","isPresented","isSheetVisible","instances","presentationResolver","isPresenting","constructor","props","nativeRef","validateDetents","shouldRenderImmediately","initialDetentIndex","undefined","state","shouldRenderNativeView","onMount","bind","onWillDismiss","onDidDismiss","onWillPresent","onDidPresent","onDetentChange","onDragBegin","onDragChange","onDragEnd","onPositionChange","onWillFocus","onDidFocus","onWillBlur","onDidBlur","handleBackPress","onVisibilityChange","detents","length","console","warn","forEach","detent","index","detentsLength","Math","min","getInstance","name","instance","handle","nodeHandle","current","present","animated","dismiss","dismissStack","resize","dismissAll","registerInstance","unregisterInstance","event","OS","remove","addEventListener","setState","nativeEvent","visible","onBackPress","Promise","resolve","presentByRef","resizeByRef","dismissByRef","dismissStackByRef","componentDidMount","componentDidUpdate","prevProps","componentWillUnmount","render","backgroundColor","dismissible","draggable","grabber","grabberOptions","dimmed","initialDetentAnimated","dimmedDetentIndex","backgroundBlur","blurOptions","cornerRadius","maxContentHeight","maxContentWidth","anchor","anchorOffset","scrollable","scrollableOptions","presentation","children","style","header","headerStyle","footer","footerStyle","insetAdjustment","rest","resolvedDetents","slice","map","cachedGrabberOptions","resolvedGrabberOptions","color","ref","styles","sheetView","scrollableContainer","scrollableContent","create","absoluteFill","zIndex","pointerEvents","flex","position","left","right"],"sourceRoot":"../../src","sources":["TrueSheet.tsx"],"mappings":";;AAAA,SACEA,aAAa,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MAAM,EAAE,CAAC,IAAI;IACbC,aAAa,EAAE;EACjB,CAAC;EACDL,mBAAmB,EAAE;IACnB,GAAG7H,UAAU,CAACgI;EAChB,CAAC;EACDF,iBAAiB,EAAE;IACjBK,IAAI,EAAE;EACR,CAAC;EACDrB,MAAM,EAAE;IACNoB,aAAa,EAAE;EACjB,CAAC;EACDlB,MAAM,EAAE;IACNkB,aAAa,EAAE,UAAU;IACzBE,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -7,7 +7,7 @@ import { Drawer } from "./web/vaul/index.js";
|
|
|
7
7
|
import { TRANSITIONS } from "./web/vaul/constants.js";
|
|
8
8
|
import { usePortalContainer, useRegisterSheet, useSheetStack } from "./TrueSheetProvider.web.js";
|
|
9
9
|
import { COLOR_SURFACE_CONTAINER_LOW_DARK, COLOR_SURFACE_CONTAINER_LOW_LIGHT, DEFAULT_ANCHOR_OFFSET, DEFAULT_CORNER_RADIUS, DEFAULT_DETACHED_OFFSET, DEFAULT_GRABBER_COLOR_DARK, DEFAULT_GRABBER_COLOR_LIGHT, DEFAULT_GRABBER_HEIGHT, DEFAULT_GRABBER_TOP_MARGIN, DEFAULT_GRABBER_WIDTH, DEFAULT_FORM_SHEET_HEIGHT_RATIO, DEFAULT_FORM_SHEET_WIDTH, DEFAULT_MAX_WIDTH } from "./web/constants.js";
|
|
10
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
11
|
const TrueSheetComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
12
12
|
const {
|
|
13
13
|
children,
|
|
@@ -32,8 +32,7 @@ const TrueSheetComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
32
32
|
footer,
|
|
33
33
|
footerStyle,
|
|
34
34
|
scrollable = false,
|
|
35
|
-
|
|
36
|
-
pageSizing = true,
|
|
35
|
+
presentation = 'page',
|
|
37
36
|
detached = false,
|
|
38
37
|
detachedOffset = DEFAULT_DETACHED_OFFSET,
|
|
39
38
|
elevation = 4,
|
|
@@ -67,10 +66,11 @@ const TrueSheetComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
67
66
|
height: windowHeight
|
|
68
67
|
} = useWindowDimensions();
|
|
69
68
|
const isLandscapeOrTablet = windowWidth >= 600 || windowWidth > windowHeight;
|
|
69
|
+
const isFormSheet = isLandscapeOrTablet && presentation === 'form';
|
|
70
70
|
|
|
71
|
-
//
|
|
71
|
+
// presentation='form' implies a floating/detached sheet on web — mirrors iOS
|
|
72
72
|
// form-sheet semantics where the sheet is never edge-attached.
|
|
73
|
-
const effectiveDetached =
|
|
73
|
+
const effectiveDetached = presentation === 'form' || detached;
|
|
74
74
|
const colorScheme = useColorScheme();
|
|
75
75
|
const backgroundColor = backgroundColorProp ?? (colorScheme === 'dark' ? COLOR_SURFACE_CONTAINER_LOW_DARK : COLOR_SURFACE_CONTAINER_LOW_LIGHT);
|
|
76
76
|
const shouldAutoPresent = initialDetentIndex >= 0 && initialDetentIndex < validDetents.length;
|
|
@@ -100,6 +100,17 @@ const TrueSheetComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
100
100
|
// in another screen's tree when navigating) should not close the drawer.
|
|
101
101
|
if (portalContainer && !portalContainer.contains(target)) {
|
|
102
102
|
e.preventDefault();
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
// The footer is rendered via vaul's `detachedSiblings` as a sibling of
|
|
106
|
+
// Drawer.Content inside [data-vaul-detached-wrapper], so Radix treats
|
|
107
|
+
// clicks on it as "outside" the content. Don't dismiss for clicks that
|
|
108
|
+
// landed inside the wrapper.
|
|
109
|
+
if (target instanceof Element) {
|
|
110
|
+
const wrapper = drawerContentRef.current?.closest('[data-vaul-detached-wrapper]');
|
|
111
|
+
if (wrapper && wrapper.contains(target)) {
|
|
112
|
+
e.preventDefault();
|
|
113
|
+
}
|
|
103
114
|
}
|
|
104
115
|
};
|
|
105
116
|
const dismissAboveRef = useRef(async () => {});
|
|
@@ -290,10 +301,21 @@ const TrueSheetComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
290
301
|
if (!isOpen && !wasOpen) return undefined;
|
|
291
302
|
const present = !wasOpen && isOpen;
|
|
292
303
|
if (present) {
|
|
304
|
+
// Pair willFocus with willPresent on initial present — mirrors native
|
|
305
|
+
// iOS where viewWillAppear dispatches both. The descendant-stack focus
|
|
306
|
+
// effect handles subsequent gained/lost transitions.
|
|
293
307
|
onWillPresentRef.current?.({
|
|
294
308
|
nativeEvent: computeDetentInfo()
|
|
295
309
|
});
|
|
310
|
+
onWillFocusRef.current?.({
|
|
311
|
+
nativeEvent: null
|
|
312
|
+
});
|
|
296
313
|
} else if (wasOpen && !isOpen) {
|
|
314
|
+
// Pair willBlur with willDismiss on dismiss — mirrors native iOS
|
|
315
|
+
// emitWillDismissEvents (blur fires before dismiss).
|
|
316
|
+
onWillBlurRef.current?.({
|
|
317
|
+
nativeEvent: null
|
|
318
|
+
});
|
|
297
319
|
onWillDismissRef.current?.({
|
|
298
320
|
nativeEvent: null
|
|
299
321
|
});
|
|
@@ -305,7 +327,13 @@ const TrueSheetComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
305
327
|
onDidPresentRef.current?.({
|
|
306
328
|
nativeEvent: computeDetentInfo()
|
|
307
329
|
});
|
|
330
|
+
onDidFocusRef.current?.({
|
|
331
|
+
nativeEvent: null
|
|
332
|
+
});
|
|
308
333
|
} else {
|
|
334
|
+
onDidBlurRef.current?.({
|
|
335
|
+
nativeEvent: null
|
|
336
|
+
});
|
|
309
337
|
onDidDismissRef.current?.({
|
|
310
338
|
nativeEvent: null
|
|
311
339
|
});
|
|
@@ -396,7 +424,7 @@ const TrueSheetComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
396
424
|
isNested,
|
|
397
425
|
dismissAbove,
|
|
398
426
|
descendants
|
|
399
|
-
} = useSheetStack(methodsRef, drawerContentRef, isOpen);
|
|
427
|
+
} = useSheetStack(methodsRef, drawerContentRef, isOpen, isFormSheet);
|
|
400
428
|
dismissAboveRef.current = dismissAbove;
|
|
401
429
|
|
|
402
430
|
// Mirror Android: translate this sheet down to match the deepest descendant's
|
|
@@ -405,24 +433,94 @@ const TrueSheetComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
405
433
|
useEffect(() => {
|
|
406
434
|
const parent = drawerContentRef.current;
|
|
407
435
|
if (!parent) return;
|
|
436
|
+
// Skip while dismissing: this sheet's stack pop changes `descendants`,
|
|
437
|
+
// which would re-fire the effect and write `wrapper.style.transition =
|
|
438
|
+
// 'clip-path …'`, clobbering vaul's just-written `'transform …'` for the
|
|
439
|
+
// dismiss animation. Vaul fully owns this sheet's transitions on the way
|
|
440
|
+
// out — nothing to align with anymore.
|
|
441
|
+
if (!isOpen) return;
|
|
442
|
+
const parentWrapper = parent.closest('[data-vaul-detached-wrapper]');
|
|
408
443
|
const transition = `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`;
|
|
444
|
+
const wrapperTransition = `clip-path ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`;
|
|
445
|
+
const CLIP_NONE = 'inset(0px round 0px)';
|
|
446
|
+
|
|
447
|
+
// Animate clip-path on the wrapper. Dedupes via DOM read so repeat ticks
|
|
448
|
+
// (mutation observer) skip identical writes. Seeds CLIP_NONE before the
|
|
449
|
+
// first inset() so the browser interpolates between two inset() shapes —
|
|
450
|
+
// `none → inset()` interpolates inconsistently.
|
|
451
|
+
const setClip = next => {
|
|
452
|
+
if (!parentWrapper) return;
|
|
453
|
+
const current = parentWrapper.style.clipPath;
|
|
454
|
+
if (current === next) return;
|
|
455
|
+
if (next === CLIP_NONE && !current) return;
|
|
456
|
+
if (!current) {
|
|
457
|
+
parentWrapper.style.transition = '';
|
|
458
|
+
parentWrapper.style.clipPath = CLIP_NONE;
|
|
459
|
+
// eslint-disable-next-line no-void
|
|
460
|
+
void parentWrapper.offsetHeight;
|
|
461
|
+
}
|
|
462
|
+
parentWrapper.style.transition = wrapperTransition;
|
|
463
|
+
parentWrapper.style.clipPath = next;
|
|
464
|
+
};
|
|
409
465
|
if (descendants.length === 0) {
|
|
410
466
|
parent.style.transition = transition;
|
|
411
467
|
parent.style.transform = '';
|
|
468
|
+
setClip(CLIP_NONE);
|
|
412
469
|
return;
|
|
413
470
|
}
|
|
471
|
+
|
|
472
|
+
// Track only the immediate child's snap point. Walking deeper descendants
|
|
473
|
+
// would push this sheet further when a grandchild opens, even when our
|
|
474
|
+
// own child didn't move (e.g., child skipped its cascade for a page
|
|
475
|
+
// grandchild) — leaving a visible gap between this sheet and its child.
|
|
414
476
|
const computeTargetY = () => {
|
|
415
477
|
const parentSnap = parseFloat(parent.style.getPropertyValue('--snap-point-height')) || 0;
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
478
|
+
const node = descendants[0]?.nodeRef.current;
|
|
479
|
+
if (!node) return parentSnap;
|
|
480
|
+
const childSnap = parseFloat(node.style.getPropertyValue('--snap-point-height')) || 0;
|
|
481
|
+
return Math.max(parentSnap, childSnap);
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
// When a form-sheet parent has a form-sheet descendant, clip the parent to
|
|
485
|
+
// the child card's viewport box so it doesn't peek above/around. Only
|
|
486
|
+
// applies when this sheet is itself form — a page parent should remain
|
|
487
|
+
// visible behind/around a floating form child. Geometry comes from the
|
|
488
|
+
// child's inline styles (not getBoundingClientRect) to read the at-rest
|
|
489
|
+
// box, unskewed by vaul's slide-in.
|
|
490
|
+
const applyFormClip = () => {
|
|
491
|
+
const form = isFormSheet ? descendants.find(d => d.isFormSheetRef.current) : undefined;
|
|
492
|
+
if (!form) {
|
|
493
|
+
setClip(CLIP_NONE);
|
|
494
|
+
return;
|
|
422
495
|
}
|
|
423
|
-
|
|
496
|
+
const childDrawer = form.nodeRef.current;
|
|
497
|
+
const childWrapper = childDrawer?.closest('[data-vaul-detached-wrapper]');
|
|
498
|
+
if (!parentWrapper || !childDrawer || !childWrapper) return;
|
|
499
|
+
const snapY = parseFloat(childDrawer.style.getPropertyValue('--snap-point-height')) || 0;
|
|
500
|
+
const childBottomGap = parseFloat(childWrapper.style.bottom) || 0;
|
|
501
|
+
const childMaxW = parseFloat(childWrapper.style.maxWidth) || window.innerWidth;
|
|
502
|
+
const formLeft = (window.innerWidth - childMaxW) / 2;
|
|
503
|
+
const formRight = (window.innerWidth + childMaxW) / 2;
|
|
504
|
+
const formBottom = window.innerHeight - childBottomGap;
|
|
505
|
+
const rect = parentWrapper.getBoundingClientRect();
|
|
506
|
+
const top = Math.max(0, snapY - rect.top);
|
|
507
|
+
const left = Math.max(0, formLeft - rect.left);
|
|
508
|
+
const right = Math.max(0, rect.right - formRight);
|
|
509
|
+
const bottom = Math.max(0, rect.bottom - formBottom);
|
|
510
|
+
const radius = cornerRadius ?? DEFAULT_CORNER_RADIUS;
|
|
511
|
+
setClip(`inset(${top}px ${right}px ${bottom}px ${left}px round ${radius}px)`);
|
|
424
512
|
};
|
|
425
513
|
const apply = () => {
|
|
514
|
+
applyFormClip();
|
|
515
|
+
// Mirror iOS: a page-sheet child fully covers a form-sheet parent, so the
|
|
516
|
+
// cascade push-down has no visible effect — and would briefly peek above
|
|
517
|
+
// the page during the present animation. Leave the parent put.
|
|
518
|
+
const child = descendants[0];
|
|
519
|
+
if (isFormSheet && child && !child.isFormSheetRef.current) {
|
|
520
|
+
parent.style.transition = transition;
|
|
521
|
+
parent.style.transform = '';
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
426
524
|
const targetY = computeTargetY();
|
|
427
525
|
const match = parent.style.transform.match(/translate3d\([^,]*,\s*(-?\d*\.?\d+)px/);
|
|
428
526
|
const currentY = match ? parseFloat(match[1]) : 0;
|
|
@@ -443,7 +541,7 @@ const TrueSheetComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
443
541
|
cancelAnimationFrame(raf);
|
|
444
542
|
observer.disconnect();
|
|
445
543
|
};
|
|
446
|
-
}, [descendants, activeSnapPoint]);
|
|
544
|
+
}, [descendants, activeSnapPoint, cornerRadius, isFormSheet, isOpen]);
|
|
447
545
|
|
|
448
546
|
// Focus/blur events fire when a descendant sheet appears on top of this one
|
|
449
547
|
// (blur) or when all descendants are dismissed (focus). will-events fire
|
|
@@ -513,7 +611,14 @@ const TrueSheetComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
513
611
|
// Shadow cast upward from the sheet's top edge toward the background. Matches
|
|
514
612
|
// Android's `elevation` semantics roughly — the sheet "lifts" off whatever is
|
|
515
613
|
// behind it. Scales linearly so higher elevation reads as more separation.
|
|
516
|
-
|
|
614
|
+
// Applied to the vaul wrapper (not the drawer) as `filter: drop-shadow`: the
|
|
615
|
+
// wrapper clips the drawer (overflow: hidden + contain: paint), which would
|
|
616
|
+
// cut off `box-shadow` on the drawer at the wrapper edges — visible in
|
|
617
|
+
// detached mode (bottom blur clipped in the floating gap) and when the
|
|
618
|
+
// wrapper is narrowed by maxWidth/anchor margins (lateral blur clipped at
|
|
619
|
+
// wrapper edges). drop-shadow on the wrapper follows the post-clip silhouette
|
|
620
|
+
// and isn't clipped by the wrapper itself.
|
|
621
|
+
const dropShadow = elevation > 0 ? `drop-shadow(0 ${-elevation}px ${elevation * 3}px rgba(0, 0, 0, 0.15))` : undefined;
|
|
517
622
|
const mergedContentStyle = useMemo(() => ({
|
|
518
623
|
position: 'fixed',
|
|
519
624
|
top: 0,
|
|
@@ -525,10 +630,12 @@ const TrueSheetComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
525
630
|
borderTopLeftRadius: effectiveCornerRadius,
|
|
526
631
|
borderTopRightRadius: effectiveCornerRadius,
|
|
527
632
|
backgroundColor: backgroundColor,
|
|
528
|
-
|
|
633
|
+
// Clip children to the rounded top so headers/content with their own
|
|
634
|
+
// background don't bleed past the corners.
|
|
635
|
+
overflow: 'hidden',
|
|
529
636
|
// Lift content above iOS home indicator / bottom safe area when enabled.
|
|
530
637
|
paddingBottom: insetAdjustment === 'automatic' ? 'env(safe-area-inset-bottom, 0px)' : 0
|
|
531
|
-
}), [backgroundColor, effectiveCornerRadius,
|
|
638
|
+
}), [backgroundColor, effectiveCornerRadius, insetAdjustment]);
|
|
532
639
|
const defaultGrabberColor = colorScheme === 'dark' ? DEFAULT_GRABBER_COLOR_DARK : DEFAULT_GRABBER_COLOR_LIGHT;
|
|
533
640
|
const grabberHeight = grabberOptions?.height ?? DEFAULT_GRABBER_HEIGHT;
|
|
534
641
|
|
|
@@ -545,26 +652,58 @@ const TrueSheetComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
545
652
|
pointerEvents: 'auto'
|
|
546
653
|
}), []);
|
|
547
654
|
|
|
548
|
-
// Form-sheet style (
|
|
549
|
-
// default width and a height
|
|
550
|
-
//
|
|
551
|
-
//
|
|
552
|
-
//
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
655
|
+
// Form-sheet style (presentation='form'): centered floating card with a
|
|
656
|
+
// default width and a height fit to content. We reuse the existing detached
|
|
657
|
+
// mechanic so drag/snap math stays correct — the wrapper is bottom-attached
|
|
658
|
+
// with a computed offset that centers it vertically. `presentation` is
|
|
659
|
+
// absolute: when 'form', `maxContentWidth` is ignored and the card uses
|
|
660
|
+
// DEFAULT_FORM_SHEET_WIDTH.
|
|
661
|
+
|
|
662
|
+
// Vaul measures the auto-size wrapper's offsetHeight (always, post fork).
|
|
663
|
+
// Track it here so the form sheet can size its card to fit content,
|
|
664
|
+
// clamped between a minimum ratio of the viewport and a maximum derived
|
|
665
|
+
// from `detachedOffset` (the breathing room left at top + bottom of the
|
|
666
|
+
// floating card).
|
|
667
|
+
const [measuredContentHeight, setMeasuredContentHeight] = useState(0);
|
|
668
|
+
const effectiveMaxContentHeight = useMemo(() => {
|
|
669
|
+
if (maxContentHeight !== undefined) return maxContentHeight;
|
|
670
|
+
if (!isFormSheet) return undefined;
|
|
671
|
+
const min = windowHeight * DEFAULT_FORM_SHEET_HEIGHT_RATIO;
|
|
672
|
+
const max = Math.max(min, windowHeight - 2 * detachedOffset);
|
|
673
|
+
if (measuredContentHeight <= 0) return min;
|
|
674
|
+
return Math.max(min, Math.min(measuredContentHeight, max));
|
|
675
|
+
}, [maxContentHeight, isFormSheet, windowHeight, detachedOffset, measuredContentHeight]);
|
|
676
|
+
|
|
677
|
+
// Center the form sheet using the actual visible drawer height. Vaul
|
|
678
|
+
// auto-sizes to content (capped by `maxContentHeight`), so when content is
|
|
679
|
+
// shorter than `effectiveMaxContentHeight`'s min-clamped floor, using that
|
|
680
|
+
// for the offset would push a small sheet below the viewport center.
|
|
681
|
+
const effectiveDetachedOffset = useMemo(() => {
|
|
682
|
+
if (!isFormSheet) return detachedOffset;
|
|
683
|
+
const max = Math.max(0, windowHeight - 2 * detachedOffset);
|
|
684
|
+
const visibleHeight = measuredContentHeight > 0 ? Math.min(measuredContentHeight, max) : effectiveMaxContentHeight ?? 0;
|
|
685
|
+
return Math.max(0, (windowHeight - visibleHeight) / 2);
|
|
686
|
+
}, [isFormSheet, windowHeight, detachedOffset, measuredContentHeight, effectiveMaxContentHeight]);
|
|
556
687
|
|
|
557
688
|
// The wrapper holds all horizontal sizing/anchoring so its rounded-bottom
|
|
558
689
|
// clip (when detached) aligns with the drawer's horizontal bounds on
|
|
559
690
|
// desktop — otherwise its corners sit at the far viewport edges.
|
|
560
|
-
//
|
|
561
|
-
//
|
|
562
|
-
//
|
|
691
|
+
// - presentation='form' → DEFAULT_FORM_SHEET_WIDTH on tablet/landscape;
|
|
692
|
+
// `maxContentWidth` is ignored ('form' is absolute).
|
|
693
|
+
// - presentation='page' → `maxContentWidth` (any viewport) or
|
|
694
|
+
// DEFAULT_MAX_WIDTH (tablet/landscape readability cap).
|
|
563
695
|
// Detached without a width constraint applies anchorOffset on both edges so
|
|
564
696
|
// the floating card breathes from the viewport sides.
|
|
565
697
|
const wrapperStyle = useMemo(() => {
|
|
566
|
-
|
|
567
|
-
|
|
698
|
+
// Mobile portrait ignores width sizing entirely (matches iOS/Android:
|
|
699
|
+
// both apply `maxContentWidth` only when not on a portrait phone).
|
|
700
|
+
// `detached` + `detachedOffset` are still respected via the wrapper.
|
|
701
|
+
const maxWidth = isLandscapeOrTablet ? presentation === 'form' ? DEFAULT_FORM_SHEET_WIDTH : maxContentWidth ?? DEFAULT_MAX_WIDTH : undefined;
|
|
702
|
+
const needsMargins = maxWidth != null || effectiveDetached;
|
|
703
|
+
if (!needsMargins && !dropShadow) return undefined;
|
|
704
|
+
const next = {};
|
|
705
|
+
if (dropShadow) next.filter = dropShadow;
|
|
706
|
+
if (!needsMargins) return next;
|
|
568
707
|
let marginLeft;
|
|
569
708
|
let marginRight;
|
|
570
709
|
if (isFormSheet) {
|
|
@@ -577,21 +716,30 @@ const TrueSheetComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
577
716
|
marginLeft = anchor === 'left' ? anchorOffset : 'auto';
|
|
578
717
|
marginRight = anchor === 'right' ? anchorOffset : 'auto';
|
|
579
718
|
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
719
|
+
if (maxWidth != null) next.maxWidth = maxWidth;
|
|
720
|
+
next.marginLeft = marginLeft;
|
|
721
|
+
next.marginRight = marginRight;
|
|
722
|
+
return next;
|
|
723
|
+
}, [isLandscapeOrTablet, isFormSheet, maxContentWidth, presentation, anchor, anchorOffset, effectiveDetached, dropShadow]);
|
|
724
|
+
|
|
725
|
+
// Absolute-position the grabber so it overlays the content top-edge
|
|
726
|
+
// instead of consuming flow height — mirrors native iOS/Android, where
|
|
727
|
+
// the grabber sits in the rounded corner zone above the content and
|
|
728
|
+
// doesn't push the header down or inflate the 'auto' detent measurement.
|
|
588
729
|
const handleStyle = useMemo(() => ({
|
|
730
|
+
position: 'absolute',
|
|
731
|
+
top: grabberOptions?.topMargin ?? DEFAULT_GRABBER_TOP_MARGIN,
|
|
732
|
+
left: '50%',
|
|
733
|
+
transform: 'translateX(-50%)',
|
|
589
734
|
height: grabberHeight,
|
|
590
735
|
width: grabberOptions?.width ?? DEFAULT_GRABBER_WIDTH,
|
|
591
736
|
borderRadius: grabberOptions?.cornerRadius ?? grabberHeight / 2,
|
|
592
737
|
backgroundColor: grabberOptions?.color ?? defaultGrabberColor,
|
|
593
738
|
opacity: 1,
|
|
594
|
-
|
|
739
|
+
// Above absolute-positioned headers (which often use zIndex:1 to overlay
|
|
740
|
+
// scroll content) so the grabber stays draggable — critical when
|
|
741
|
+
// `handleOnly` mode means only the grabber can drag the sheet.
|
|
742
|
+
zIndex: 2
|
|
595
743
|
}), [grabberOptions, grabberHeight, defaultGrabberColor]);
|
|
596
744
|
return /*#__PURE__*/_jsx(Drawer.Root, {
|
|
597
745
|
open: isOpen,
|
|
@@ -601,7 +749,6 @@ const TrueSheetComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
601
749
|
onRelease: handleRelease,
|
|
602
750
|
dismissible: dismissible,
|
|
603
751
|
draggable: draggable,
|
|
604
|
-
handleOnly: scrollable && scrollableOptions?.scrollingExpandsSheet === false,
|
|
605
752
|
repositionInputs: false,
|
|
606
753
|
modal: dimmed,
|
|
607
754
|
nested: isNested,
|
|
@@ -611,6 +758,7 @@ const TrueSheetComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
611
758
|
maxContentHeight: effectiveMaxContentHeight,
|
|
612
759
|
initialAnimated: initialDetentAnimated,
|
|
613
760
|
detachedWrapperStyle: wrapperStyle,
|
|
761
|
+
onContentHeightChange: setMeasuredContentHeight,
|
|
614
762
|
activeSnapPoint: activeSnapPoint,
|
|
615
763
|
setActiveSnapPoint: handleSetActiveSnapPoint,
|
|
616
764
|
...snapPointsProps,
|
|
@@ -634,18 +782,33 @@ const TrueSheetComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
634
782
|
children: "Sheet"
|
|
635
783
|
}), grabber && /*#__PURE__*/_jsx(Drawer.Handle, {
|
|
636
784
|
style: handleStyle
|
|
637
|
-
}),
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
785
|
+
}), scrollable ?
|
|
786
|
+
/*#__PURE__*/
|
|
787
|
+
// vaul wraps children in `[data-vaul-auto-size-wrapper]` (display:
|
|
788
|
+
// flow-root) which doesn't honor descendant flex layout. Use an
|
|
789
|
+
// absolute fill sized to the visible portion (via vaul's
|
|
790
|
+
// `--snap-point-height` var) so the inner flex column has a
|
|
791
|
+
// definite height for the scroll container's flex:1 to fill.
|
|
792
|
+
_jsxs("div", {
|
|
793
|
+
style: scrollableLayoutStyle,
|
|
794
|
+
children: [header && /*#__PURE__*/_jsx(View, {
|
|
795
|
+
style: headerStyle,
|
|
796
|
+
children: /*#__PURE__*/isValidElement(header) ? header : /*#__PURE__*/createElement(header)
|
|
797
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
798
|
+
style: scrollableContainerStyle,
|
|
799
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
800
|
+
style: style,
|
|
801
|
+
children: children
|
|
802
|
+
})
|
|
803
|
+
})]
|
|
804
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
805
|
+
children: [header && /*#__PURE__*/_jsx(View, {
|
|
806
|
+
style: headerStyle,
|
|
807
|
+
children: /*#__PURE__*/isValidElement(header) ? header : /*#__PURE__*/createElement(header)
|
|
808
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
643
809
|
style: style,
|
|
644
810
|
children: children
|
|
645
|
-
})
|
|
646
|
-
}) : /*#__PURE__*/_jsx(View, {
|
|
647
|
-
style: style,
|
|
648
|
-
children: children
|
|
811
|
+
})]
|
|
649
812
|
})]
|
|
650
813
|
})]
|
|
651
814
|
})
|
|
@@ -656,6 +819,15 @@ const overlayStyle = {
|
|
|
656
819
|
inset: 0,
|
|
657
820
|
backgroundColor: 'rgba(0, 0, 0, 0.5)'
|
|
658
821
|
};
|
|
822
|
+
const scrollableLayoutStyle = {
|
|
823
|
+
position: 'absolute',
|
|
824
|
+
top: 0,
|
|
825
|
+
left: 0,
|
|
826
|
+
right: 0,
|
|
827
|
+
height: 'calc(100% - var(--snap-point-height, 0px))',
|
|
828
|
+
display: 'flex',
|
|
829
|
+
flexDirection: 'column'
|
|
830
|
+
};
|
|
659
831
|
const scrollableContainerStyle = {
|
|
660
832
|
flex: 1,
|
|
661
833
|
minHeight: 0,
|