@tamagui/sheet 1.112.5 → 1.112.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.
@@ -4,7 +4,6 @@ import { useComposedRefs } from "@tamagui/compose-refs";
4
4
  import { currentPlatform, isClient, isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
5
5
  import { getConfig, Stack, Theme, useConfiguration, useEvent, useThemeName } from "@tamagui/core";
6
6
  import { Portal } from "@tamagui/portal";
7
- import { useKeyboardVisible } from "@tamagui/use-keyboard-visible";
8
7
  import React from "react";
9
8
  import { Dimensions, Keyboard, PanResponder, View } from "react-native-web";
10
9
  import { ParentSheetContext, SheetInsideSheetContext } from "./contexts.mjs";
@@ -15,302 +14,302 @@ import { useSheetProviderProps } from "./useSheetProviderProps.mjs";
15
14
  import { jsx, jsxs } from "react/jsx-runtime";
16
15
  let hiddenSize = 10000.1,
17
16
  sheetHiddenStyleSheet = null;
18
- const SheetImplementationCustom = React.forwardRef(function (props, forwardedRef) {
19
- const parentSheet = React.useContext(ParentSheetContext),
20
- {
21
- animation,
22
- animationConfig: animationConfigProp,
23
- modal = !1,
24
- zIndex = parentSheet.zIndex + 1,
25
- moveOnKeyboardChange = !1,
26
- unmountChildrenWhenHidden = !1,
27
- portalProps,
28
- containerComponent: ContainerComponent = React.Fragment
29
- } = props,
30
- keyboardIsVisible = useKeyboardVisible(),
31
- state = useSheetOpenState(props),
32
- [overlayComponent, setOverlayComponent] = React.useState(null),
33
- providerProps = useSheetProviderProps(props, state, {
34
- onOverlayComponent: setOverlayComponent
35
- }),
36
- {
37
- frameSize,
38
- setFrameSize,
39
- snapPoints,
40
- snapPointsMode,
41
- hasFit,
42
- position,
43
- setPosition,
44
- scrollBridge,
45
- screenSize,
46
- setMaxContentSize,
47
- maxSnapPoint
48
- } = providerProps,
49
- {
50
- open,
51
- controller,
52
- isHidden
53
- } = state,
54
- sheetRef = React.useRef(null),
55
- ref = useComposedRefs(forwardedRef, sheetRef),
56
- animationConfig = (() => {
57
- const [animationProp, animationPropConfig] = animation ? Array.isArray(animation) ? animation : [animation] : [];
58
- return animationConfigProp ?? (animationProp ? {
59
- ...getConfig().animations.animations[animationProp],
60
- ...animationPropConfig
61
- } : null);
62
- })(),
63
- [isShowingInnerSheet, setIsShowingInnerSheet] = React.useState(!1),
64
- shouldHideParentSheet = !isWeb && modal && isShowingInnerSheet,
65
- parentSheetContext = React.useContext(SheetInsideSheetContext),
66
- onInnerSheet = React.useCallback(hasChild => {
67
- setIsShowingInnerSheet(hasChild);
68
- }, []),
69
- positions = React.useMemo(() => snapPoints.map(point => getYPositions(snapPointsMode, point, screenSize, frameSize)), [screenSize, frameSize, snapPoints, snapPointsMode]),
70
- {
71
- animationDriver
72
- } = useConfiguration(),
73
- {
74
- useAnimatedNumber,
75
- useAnimatedNumberStyle,
76
- useAnimatedNumberReaction
77
- } = animationDriver,
78
- AnimatedView = animationDriver.View ?? Stack;
79
- useIsomorphicLayoutEffect(() => {
80
- if (parentSheetContext && open) return parentSheetContext(!0), () => {
81
- parentSheetContext(!1);
82
- };
83
- }, [parentSheetContext, open]);
84
- const nextParentContext = React.useMemo(() => ({
85
- zIndex
86
- }), [zIndex]),
87
- animatedNumber = useAnimatedNumber(hiddenSize),
88
- at = React.useRef(hiddenSize);
89
- useAnimatedNumberReaction({
90
- value: animatedNumber,
91
- hostRef: sheetRef
92
- }, React.useCallback(value => {
93
- at.current = value, scrollBridge.paneY = value;
94
- }, [animationDriver]));
95
- function stopSpring() {
96
- animatedNumber.stop(), scrollBridge.onFinishAnimate && (scrollBridge.onFinishAnimate(), scrollBridge.onFinishAnimate = void 0);
97
- }
98
- const hasntMeasured = at.current === hiddenSize,
99
- animateTo = useEvent(position2 => {
100
- if (frameSize === 0) return;
101
- let toValue = isHidden || position2 === -1 ? screenSize : positions[position2];
102
- if (at.current !== toValue) {
103
- if (at.current = toValue, stopSpring(), hasntMeasured || isHidden) {
104
- animatedNumber.setValue(screenSize, {
105
- type: "timing",
106
- duration: 0
107
- }, () => {
108
- isHidden || (toValue = positions[position2], at.current = toValue, animatedNumber.setValue(toValue, {
109
- type: "spring",
110
- ...animationConfig
111
- }));
112
- });
113
- return;
114
- }
115
- animatedNumber.setValue(toValue, {
116
- type: "spring",
117
- ...animationConfig
118
- });
119
- }
120
- });
121
- useIsomorphicLayoutEffect(() => {
122
- screenSize && hasntMeasured && animatedNumber.setValue(screenSize, {
123
- type: "timing",
124
- duration: 0
125
- });
126
- }, [hasntMeasured, screenSize]), useIsomorphicLayoutEffect(() => {
127
- !frameSize || !screenSize || isHidden || hasntMeasured && !open || animateTo(position);
128
- }, [isHidden, frameSize, screenSize, open, position]);
129
- const disableDrag = props.disableDrag ?? controller?.disableDrag,
130
- themeName = useThemeName(),
131
- [isDragging, setIsDragging] = React.useState(!1),
132
- panResponder = React.useMemo(() => {
133
- if (disableDrag || !frameSize || isShowingInnerSheet) return;
134
- const minY = positions[0];
135
- scrollBridge.paneMinY = minY;
136
- let startY = at.current;
137
- function setPanning(val) {
138
- setIsDragging(val), isClient && (sheetHiddenStyleSheet || (sheetHiddenStyleSheet = document.createElement("style"), typeof document.head < "u" && document.head.appendChild(sheetHiddenStyleSheet)), val ? sheetHiddenStyleSheet.innerText = ":root * { user-select: none !important; -webkit-user-select: none !important; }" : sheetHiddenStyleSheet.innerText = "");
139
- }
140
- const release = ({
141
- vy,
142
- dragAt
143
- }) => {
144
- isExternalDrag = !1, previouslyScrolling = !1, setPanning(!1);
145
- const end = dragAt + startY + frameSize * vy * 0.2;
146
- let closestPoint = 0,
147
- dist = Number.POSITIVE_INFINITY;
148
- for (let i = 0; i < positions.length; i++) {
149
- const position2 = positions[i],
150
- curDist = end > position2 ? end - position2 : position2 - end;
151
- curDist < dist && (dist = curDist, closestPoint = i);
17
+ const relativeDimensionTo = isWeb ? "window" : "screen",
18
+ SheetImplementationCustom = React.forwardRef(function (props, forwardedRef) {
19
+ const parentSheet = React.useContext(ParentSheetContext),
20
+ {
21
+ animation,
22
+ animationConfig: animationConfigProp,
23
+ modal = !1,
24
+ zIndex = parentSheet.zIndex + 1,
25
+ moveOnKeyboardChange = !1,
26
+ unmountChildrenWhenHidden = !1,
27
+ portalProps,
28
+ containerComponent: ContainerComponent = React.Fragment
29
+ } = props,
30
+ state = useSheetOpenState(props),
31
+ [overlayComponent, setOverlayComponent] = React.useState(null),
32
+ providerProps = useSheetProviderProps(props, state, {
33
+ onOverlayComponent: setOverlayComponent
34
+ }),
35
+ {
36
+ frameSize,
37
+ setFrameSize,
38
+ snapPoints,
39
+ snapPointsMode,
40
+ hasFit,
41
+ position,
42
+ setPosition,
43
+ scrollBridge,
44
+ screenSize,
45
+ setMaxContentSize,
46
+ maxSnapPoint
47
+ } = providerProps,
48
+ {
49
+ open,
50
+ controller,
51
+ isHidden
52
+ } = state,
53
+ sheetRef = React.useRef(null),
54
+ ref = useComposedRefs(forwardedRef, sheetRef),
55
+ animationConfig = (() => {
56
+ const [animationProp, animationPropConfig] = animation ? Array.isArray(animation) ? animation : [animation] : [];
57
+ return animationConfigProp ?? (animationProp ? {
58
+ ...getConfig().animations.animations[animationProp],
59
+ ...animationPropConfig
60
+ } : null);
61
+ })(),
62
+ [isShowingInnerSheet, setIsShowingInnerSheet] = React.useState(!1),
63
+ shouldHideParentSheet = !isWeb && modal && isShowingInnerSheet,
64
+ parentSheetContext = React.useContext(SheetInsideSheetContext),
65
+ onInnerSheet = React.useCallback(hasChild => {
66
+ setIsShowingInnerSheet(hasChild);
67
+ }, []),
68
+ positions = React.useMemo(() => snapPoints.map(point => getYPositions(snapPointsMode, point, screenSize, frameSize)), [screenSize, frameSize, snapPoints, snapPointsMode]),
69
+ {
70
+ animationDriver
71
+ } = useConfiguration(),
72
+ {
73
+ useAnimatedNumber,
74
+ useAnimatedNumberStyle,
75
+ useAnimatedNumberReaction
76
+ } = animationDriver,
77
+ AnimatedView = animationDriver.View ?? Stack;
78
+ useIsomorphicLayoutEffect(() => {
79
+ if (parentSheetContext && open) return parentSheetContext(!0), () => {
80
+ parentSheetContext(!1);
81
+ };
82
+ }, [parentSheetContext, open]);
83
+ const nextParentContext = React.useMemo(() => ({
84
+ zIndex
85
+ }), [zIndex]),
86
+ animatedNumber = useAnimatedNumber(hiddenSize),
87
+ at = React.useRef(hiddenSize);
88
+ useAnimatedNumberReaction({
89
+ value: animatedNumber,
90
+ hostRef: sheetRef
91
+ }, React.useCallback(value => {
92
+ at.current = value, scrollBridge.paneY = value;
93
+ }, [animationDriver]));
94
+ function stopSpring() {
95
+ animatedNumber.stop(), scrollBridge.onFinishAnimate && (scrollBridge.onFinishAnimate(), scrollBridge.onFinishAnimate = void 0);
96
+ }
97
+ const hasntMeasured = at.current === hiddenSize,
98
+ animateTo = useEvent(position2 => {
99
+ if (frameSize === 0) return;
100
+ let toValue = isHidden || position2 === -1 ? screenSize : positions[position2];
101
+ if (at.current !== toValue) {
102
+ if (at.current = toValue, stopSpring(), hasntMeasured || isHidden) {
103
+ animatedNumber.setValue(screenSize, {
104
+ type: "timing",
105
+ duration: 0
106
+ }, () => {
107
+ isHidden || (toValue = positions[position2], at.current = toValue, animatedNumber.setValue(toValue, {
108
+ type: "spring",
109
+ ...animationConfig
110
+ }));
111
+ });
112
+ return;
152
113
  }
153
- setPosition(closestPoint), animateTo(closestPoint);
154
- },
155
- finish = (_e, state2) => {
156
- release({
157
- vy: state2.vy,
158
- dragAt: state2.dy
114
+ animatedNumber.setValue(toValue, {
115
+ type: "spring",
116
+ ...animationConfig
159
117
  });
160
- };
161
- let previouslyScrolling = !1;
162
- const onMoveShouldSet = (e, {
163
- dy
164
- }) => {
165
- if (e.target === providerProps.handleRef.current) return !0;
166
- const isScrolled = scrollBridge.y !== 0,
167
- isDraggingUp = dy < 0,
168
- isNearTop = scrollBridge.paneY - 5 <= scrollBridge.paneMinY;
169
- return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && !isScrolled && isDraggingUp && !isWeb ? !1 : Math.abs(dy) > 5;
170
- },
171
- grant = () => {
172
- setPanning(!0), stopSpring(), startY = at.current;
173
- };
174
- let isExternalDrag = !1;
175
- return scrollBridge.drag = dy => {
176
- isExternalDrag || (isExternalDrag = !0, grant());
177
- const to = dy + startY;
178
- animatedNumber.setValue(resisted(to, minY), {
179
- type: "direct"
180
- });
181
- }, scrollBridge.release = release, PanResponder.create({
182
- onMoveShouldSetPanResponder: onMoveShouldSet,
183
- onPanResponderGrant: grant,
184
- onPanResponderMove: (_e, {
185
- dy
186
- }) => {
187
- const toFull = dy + startY,
188
- to = resisted(toFull, minY);
189
- animatedNumber.setValue(to, {
118
+ }
119
+ });
120
+ useIsomorphicLayoutEffect(() => {
121
+ screenSize && hasntMeasured && animatedNumber.setValue(screenSize, {
122
+ type: "timing",
123
+ duration: 0
124
+ });
125
+ }, [hasntMeasured, screenSize]), useIsomorphicLayoutEffect(() => {
126
+ !frameSize || !screenSize || isHidden || hasntMeasured && !open || animateTo(position);
127
+ }, [isHidden, frameSize, screenSize, open, position]);
128
+ const disableDrag = props.disableDrag ?? controller?.disableDrag,
129
+ themeName = useThemeName(),
130
+ [isDragging, setIsDragging] = React.useState(!1),
131
+ panResponder = React.useMemo(() => {
132
+ if (disableDrag || !frameSize || isShowingInnerSheet) return;
133
+ const minY = positions[0];
134
+ scrollBridge.paneMinY = minY;
135
+ let startY = at.current;
136
+ function setPanning(val) {
137
+ setIsDragging(val), isClient && (sheetHiddenStyleSheet || (sheetHiddenStyleSheet = document.createElement("style"), typeof document.head < "u" && document.head.appendChild(sheetHiddenStyleSheet)), val ? sheetHiddenStyleSheet.innerText = ":root * { user-select: none !important; -webkit-user-select: none !important; }" : sheetHiddenStyleSheet.innerText = "");
138
+ }
139
+ const release = ({
140
+ vy,
141
+ dragAt
142
+ }) => {
143
+ isExternalDrag = !1, previouslyScrolling = !1, setPanning(!1);
144
+ const end = dragAt + startY + frameSize * vy * 0.2;
145
+ let closestPoint = 0,
146
+ dist = Number.POSITIVE_INFINITY;
147
+ for (let i = 0; i < positions.length; i++) {
148
+ const position2 = positions[i],
149
+ curDist = end > position2 ? end - position2 : position2 - end;
150
+ curDist < dist && (dist = curDist, closestPoint = i);
151
+ }
152
+ setPosition(closestPoint), animateTo(closestPoint);
153
+ },
154
+ finish = (_e, state2) => {
155
+ release({
156
+ vy: state2.vy,
157
+ dragAt: state2.dy
158
+ });
159
+ };
160
+ let previouslyScrolling = !1;
161
+ const onMoveShouldSet = (e, {
162
+ dy
163
+ }) => {
164
+ if (e.target === providerProps.handleRef.current) return !0;
165
+ const isScrolled = scrollBridge.y !== 0,
166
+ isDraggingUp = dy < 0,
167
+ isNearTop = scrollBridge.paneY - 5 <= scrollBridge.paneMinY;
168
+ return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && !isScrolled && isDraggingUp && !isWeb ? !1 : Math.abs(dy) > 5;
169
+ },
170
+ grant = () => {
171
+ setPanning(!0), stopSpring(), startY = at.current;
172
+ };
173
+ let isExternalDrag = !1;
174
+ return scrollBridge.drag = dy => {
175
+ isExternalDrag || (isExternalDrag = !0, grant());
176
+ const to = dy + startY;
177
+ animatedNumber.setValue(resisted(to, minY), {
190
178
  type: "direct"
191
179
  });
192
- },
193
- onPanResponderEnd: finish,
194
- onPanResponderTerminate: finish,
195
- onPanResponderRelease: finish
196
- });
197
- }, [disableDrag, isShowingInnerSheet, animateTo, frameSize, positions, setPosition]),
198
- handleAnimationViewLayout = React.useCallback(e => {
199
- const next = Math.min(e.nativeEvent?.layout.height, Dimensions.get("screen").height);
200
- next && setFrameSize(next);
201
- }, [keyboardIsVisible]),
202
- handleMaxContentViewLayout = React.useCallback(e => {
203
- const next = Math.min(e.nativeEvent?.layout.height, Dimensions.get("screen").height);
204
- next && setMaxContentSize(next);
205
- }, [keyboardIsVisible]),
206
- animatedStyle = useAnimatedNumberStyle(animatedNumber, val => {
207
- "worklet";
180
+ }, scrollBridge.release = release, PanResponder.create({
181
+ onMoveShouldSetPanResponder: onMoveShouldSet,
182
+ onPanResponderGrant: grant,
183
+ onPanResponderMove: (_e, {
184
+ dy
185
+ }) => {
186
+ const toFull = dy + startY,
187
+ to = resisted(toFull, minY);
188
+ animatedNumber.setValue(to, {
189
+ type: "direct"
190
+ });
191
+ },
192
+ onPanResponderEnd: finish,
193
+ onPanResponderTerminate: finish,
194
+ onPanResponderRelease: finish
195
+ });
196
+ }, [disableDrag, isShowingInnerSheet, animateTo, frameSize, positions, setPosition]),
197
+ handleAnimationViewLayout = React.useCallback(e => {
198
+ const next = Math.min(e.nativeEvent?.layout.height, Dimensions.get(relativeDimensionTo).height);
199
+ next && setFrameSize(next);
200
+ }, []),
201
+ handleMaxContentViewLayout = React.useCallback(e => {
202
+ const next = Math.min(e.nativeEvent?.layout.height, Dimensions.get(relativeDimensionTo).height);
203
+ next && setMaxContentSize(next);
204
+ }, []),
205
+ animatedStyle = useAnimatedNumberStyle(animatedNumber, val => {
206
+ "worklet";
208
207
 
209
- return {
210
- transform: [{
211
- translateY: frameSize === 0 ? hiddenSize : val
212
- }]
213
- };
214
- }),
215
- sizeBeforeKeyboard = React.useRef(null);
216
- React.useEffect(() => {
217
- if (isWeb || !moveOnKeyboardChange) return;
218
- const keyboardShowListener = Keyboard.addListener(currentPlatform === "ios" ? "keyboardWillShow" : "keyboardDidShow", e => {
219
- sizeBeforeKeyboard.current === null && (sizeBeforeKeyboard.current = isHidden || position === -1 ? screenSize : positions[position], animatedNumber.setValue(Math.max(sizeBeforeKeyboard.current - e.endCoordinates.height, 0), {
220
- type: "timing",
221
- duration: 250
222
- }));
208
+ return {
209
+ transform: [{
210
+ translateY: frameSize === 0 ? hiddenSize : val
211
+ }]
212
+ };
223
213
  }),
224
- keyboardDidHideListener = Keyboard.addListener("keyboardDidHide", () => {
225
- sizeBeforeKeyboard.current !== null && (animatedNumber.setValue(sizeBeforeKeyboard.current, {
226
- type: "timing",
227
- duration: 250
228
- }), sizeBeforeKeyboard.current = null);
229
- });
230
- return () => {
231
- keyboardDidHideListener.remove(), keyboardShowListener.remove();
232
- };
233
- }, [moveOnKeyboardChange, positions, position, isHidden]);
234
- const [opacity, setOpacity] = React.useState(open ? 1 : 0);
235
- open && opacity === 0 && setOpacity(1), React.useEffect(() => {
236
- if (!open) {
237
- const tm = setTimeout(() => {
238
- setOpacity(0);
239
- }, 400);
214
+ sizeBeforeKeyboard = React.useRef(null);
215
+ React.useEffect(() => {
216
+ if (isWeb || !moveOnKeyboardChange) return;
217
+ const keyboardShowListener = Keyboard.addListener(currentPlatform === "ios" ? "keyboardWillShow" : "keyboardDidShow", e => {
218
+ sizeBeforeKeyboard.current === null && (sizeBeforeKeyboard.current = isHidden || position === -1 ? screenSize : positions[position], animatedNumber.setValue(Math.max(sizeBeforeKeyboard.current - e.endCoordinates.height, 0), {
219
+ type: "timing",
220
+ duration: 250
221
+ }));
222
+ }),
223
+ keyboardDidHideListener = Keyboard.addListener("keyboardDidHide", () => {
224
+ sizeBeforeKeyboard.current !== null && (animatedNumber.setValue(sizeBeforeKeyboard.current, {
225
+ type: "timing",
226
+ duration: 250
227
+ }), sizeBeforeKeyboard.current = null);
228
+ });
240
229
  return () => {
241
- clearTimeout(tm);
230
+ keyboardDidHideListener.remove(), keyboardShowListener.remove();
242
231
  };
243
- }
244
- }, [open]);
245
- const forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? `${maxSnapPoint}${isWeb ? "dvh" : "%"}` : maxSnapPoint,
246
- contents = /* @__PURE__ */jsx(ParentSheetContext.Provider, {
247
- value: nextParentContext,
248
- children: /* @__PURE__ */jsxs(SheetProvider, {
249
- ...providerProps,
250
- children: [/* @__PURE__ */jsx(AnimatePresence, {
251
- custom: {
252
- open
253
- },
254
- children: shouldHideParentSheet || !open ? null : overlayComponent
255
- }), snapPointsMode !== "percent" && /* @__PURE__ */jsx(View, {
256
- style: {
257
- opacity: 0,
258
- position: "absolute",
259
- top: 0,
260
- left: 0,
261
- right: 0,
262
- bottom: 0,
263
- pointerEvents: "none"
264
- },
265
- onLayout: handleMaxContentViewLayout
266
- }), /* @__PURE__ */jsx(AnimatedView, {
267
- ref,
268
- ...panResponder?.panHandlers,
269
- onLayout: handleAnimationViewLayout,
270
- ...(!isDragging && {
271
- // @ts-ignore for CSS driver this is necessary to attach the transition
272
- animation
273
- }),
274
- disableClassName: !0,
275
- style: [{
276
- position: "absolute",
277
- zIndex,
278
- width: "100%",
279
- height: forcedContentHeight,
280
- minHeight: forcedContentHeight,
281
- opacity,
282
- ...((shouldHideParentSheet || !open) && {
232
+ }, [moveOnKeyboardChange, positions, position, isHidden]);
233
+ const [opacity, setOpacity] = React.useState(open ? 1 : 0);
234
+ open && opacity === 0 && setOpacity(1), React.useEffect(() => {
235
+ if (!open) {
236
+ const tm = setTimeout(() => {
237
+ setOpacity(0);
238
+ }, 400);
239
+ return () => {
240
+ clearTimeout(tm);
241
+ };
242
+ }
243
+ }, [open]);
244
+ const forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? `${maxSnapPoint}${isWeb ? "dvh" : "%"}` : maxSnapPoint,
245
+ contents = /* @__PURE__ */jsx(ParentSheetContext.Provider, {
246
+ value: nextParentContext,
247
+ children: /* @__PURE__ */jsxs(SheetProvider, {
248
+ ...providerProps,
249
+ children: [/* @__PURE__ */jsx(AnimatePresence, {
250
+ custom: {
251
+ open
252
+ },
253
+ children: shouldHideParentSheet || !open ? null : overlayComponent
254
+ }), snapPointsMode !== "percent" && /* @__PURE__ */jsx(View, {
255
+ style: {
256
+ opacity: 0,
257
+ position: "absolute",
258
+ top: 0,
259
+ left: 0,
260
+ right: 0,
261
+ bottom: 0,
283
262
  pointerEvents: "none"
263
+ },
264
+ onLayout: handleMaxContentViewLayout
265
+ }), /* @__PURE__ */jsx(AnimatedView, {
266
+ ref,
267
+ ...panResponder?.panHandlers,
268
+ onLayout: handleAnimationViewLayout,
269
+ ...(!isDragging && {
270
+ // @ts-ignore for CSS driver this is necessary to attach the transition
271
+ animation
272
+ }),
273
+ disableClassName: !0,
274
+ style: [{
275
+ position: "absolute",
276
+ zIndex,
277
+ width: "100%",
278
+ height: forcedContentHeight,
279
+ minHeight: forcedContentHeight,
280
+ opacity,
281
+ ...((shouldHideParentSheet || !open) && {
282
+ pointerEvents: "none"
283
+ })
284
+ }, animatedStyle],
285
+ children: props.children
286
+ })]
287
+ })
288
+ }),
289
+ adaptContext = React.useContext(AdaptParentContext),
290
+ shouldMountChildren = !!(opacity || !unmountChildrenWhenHidden);
291
+ if (modal) {
292
+ const modalContents = /* @__PURE__ */jsx(Portal, {
293
+ zIndex,
294
+ ...portalProps,
295
+ children: shouldMountChildren && /* @__PURE__ */jsx(ContainerComponent, {
296
+ children: /* @__PURE__ */jsx(Theme, {
297
+ forceClassName: !0,
298
+ name: themeName,
299
+ children: /* @__PURE__ */jsx(AdaptParentContext.Provider, {
300
+ value: adaptContext,
301
+ children: contents
284
302
  })
285
- }, animatedStyle],
286
- children: props.children
287
- })]
288
- })
289
- }),
290
- adaptContext = React.useContext(AdaptParentContext),
291
- shouldMountChildren = !!(opacity || !unmountChildrenWhenHidden);
292
- if (modal) {
293
- const modalContents = /* @__PURE__ */jsx(Portal, {
294
- zIndex,
295
- ...portalProps,
296
- children: shouldMountChildren && /* @__PURE__ */jsx(ContainerComponent, {
297
- children: /* @__PURE__ */jsx(Theme, {
298
- forceClassName: !0,
299
- name: themeName,
300
- children: /* @__PURE__ */jsx(AdaptParentContext.Provider, {
301
- value: adaptContext,
302
- children: contents
303
303
  })
304
304
  })
305
- })
306
- });
307
- return isWeb ? modalContents : /* @__PURE__ */jsx(SheetInsideSheetContext.Provider, {
308
- value: onInnerSheet,
309
- children: modalContents
310
- });
311
- }
312
- return contents;
313
- });
305
+ });
306
+ return isWeb ? modalContents : /* @__PURE__ */jsx(SheetInsideSheetContext.Provider, {
307
+ value: onInnerSheet,
308
+ children: modalContents
309
+ });
310
+ }
311
+ return contents;
312
+ });
314
313
  function getYPositions(mode, point, screenSize, frameSize) {
315
314
  if (!screenSize || !frameSize) return 0;
316
315
  if (mode === "mixed") {