@orioncactuscorp/ui 1.17.0 → 1.18.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.
- package/CHANGELOG.md +91 -0
- package/README.md +16 -14
- package/dist/components/BackgroundIconButton/BackgroundIconButton.css +1 -1
- package/dist/components/Modal/Modal.css +1 -1
- package/dist/components/Modal/Modal.js +514 -471
- package/dist/components/Modal/Modal.module.scss.js +59 -57
- package/dist/components/Modal/fieldReveal.js +57 -0
- package/dist/components/Modal/headerTapScroll.js +10 -0
- package/dist/components/Modal/keyboardEditable.js +31 -0
- package/dist/components/Modal/keyboardInsetMemory.js +24 -0
- package/dist/components/Modal/keyboardSession.js +46 -73
- package/dist/components/Modal/scrollportScroller.js +43 -0
- package/dist/components/Modal/tapCaret.js +32 -0
- package/dist/components/Modal/useBottomSheetIntrinsicHeight.js +26 -23
- package/dist/components/Modal/useFieldReveal.js +81 -0
- package/dist/components/Modal/useModalDrag.js +1025 -977
- package/dist/components/Modal/useModalKeyboardAvoidance.js +200 -117
- package/dist/components/Modal/useModalViewportGeometry.js +35 -19
- package/dist/components/PositionSnap/policy.js +40 -43
- package/dist/styles.css +2 -2
- package/dist/ui/src/components/Modal/Modal.d.ts +1 -1
- package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/Modal.test.utils.d.ts +12 -0
- package/dist/ui/src/components/Modal/Modal.test.utils.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/contexts.d.ts +5 -0
- package/dist/ui/src/components/Modal/contexts.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/fieldReveal.d.ts +18 -0
- package/dist/ui/src/components/Modal/fieldReveal.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/headerTapScroll.d.ts +5 -0
- package/dist/ui/src/components/Modal/headerTapScroll.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/keyboardEditable.d.ts +6 -0
- package/dist/ui/src/components/Modal/keyboardEditable.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/keyboardInsetMemory.d.ts +5 -0
- package/dist/ui/src/components/Modal/keyboardInsetMemory.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/keyboardSession.d.ts +4 -11
- package/dist/ui/src/components/Modal/keyboardSession.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/scrollportScroller.d.ts +20 -0
- package/dist/ui/src/components/Modal/scrollportScroller.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/tapCaret.d.ts +10 -0
- package/dist/ui/src/components/Modal/tapCaret.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/useBottomSheetIntrinsicHeight.d.ts +8 -1
- package/dist/ui/src/components/Modal/useBottomSheetIntrinsicHeight.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useFieldReveal.d.ts +28 -0
- package/dist/ui/src/components/Modal/useFieldReveal.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalKeyboardAvoidance.d.ts +6 -1
- package/dist/ui/src/components/Modal/useModalKeyboardAvoidance.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalViewportGeometry.d.ts +1 -0
- package/dist/ui/src/components/Modal/useModalViewportGeometry.d.ts.map +1 -1
- package/dist/ui/src/components/PositionSnap/policy.d.ts.map +1 -1
- package/dist/ui/src/utils/gesture.d.ts +58 -0
- package/dist/ui/src/utils/gesture.d.ts.map +1 -0
- package/dist/utils/gesture.d.ts +2 -0
- package/dist/utils/gesture.js +103 -0
- package/docs/gesture.md +64 -0
- package/docs/selector-contract.md +5 -1
- package/docs/spring.md +4 -0
- package/package.json +5 -1
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useRef as
|
|
2
|
+
import { jsx as d, jsxs as Ge } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as j, useState as m, useMemo as Q, useEffect as L, useCallback as S, useLayoutEffect as De } from "react";
|
|
4
4
|
import { Dialog as V } from "@base-ui-components/react/dialog";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
25
|
-
|
|
5
|
+
import ft from "@orioncactuscorp/icons/orioncactus/CloseThick";
|
|
6
|
+
import ht from "../BackgroundIconButton/BackgroundIconButton.js";
|
|
7
|
+
import gt from "../Interaction/Interaction.js";
|
|
8
|
+
import { mergeRefs as Ae } from "../../utils/mergeRefs.js";
|
|
9
|
+
import { useModalContext as le, ModalProvider as bt } from "./contexts.js";
|
|
10
|
+
import { shouldScrollToTopOnHeaderClick as yt } from "./headerTapScroll.js";
|
|
11
|
+
import { createScrollportScroller as St } from "./scrollportScroller.js";
|
|
12
|
+
import { useControllableState as kt } from "./useControllableState.js";
|
|
13
|
+
import { useModalContentBlockTransition as vt } from "./useModalContentBlockTransition.js";
|
|
14
|
+
import { useBottomSheetIntrinsicHeight as Mt } from "./useBottomSheetIntrinsicHeight.js";
|
|
15
|
+
import { getMaxCssTimeMs as Ne } from "./cssTime.js";
|
|
16
|
+
import { useMeasuredElement as Ue } from "./useMeasuredElement.js";
|
|
17
|
+
import { useModalDrag as Nt } from "./useModalDrag.js";
|
|
18
|
+
import { KEYBOARD_INSET_SETTLED_PROPERTY as Ct } from "./useFieldReveal.js";
|
|
19
|
+
import { useModalKeyboardAvoidance as Tt } from "./useModalKeyboardAvoidance.js";
|
|
20
|
+
import { useModalPlacement as Ht } from "./useModalPlacement.js";
|
|
21
|
+
import { useModalStackDepth as wt } from "./useModalStackDepth.js";
|
|
22
|
+
import { useModalViewportGeometry as xt } from "./useModalViewportGeometry.js";
|
|
23
|
+
import { getModalScrollState as Rt } from "./modalScrollArbitration.js";
|
|
24
|
+
import { resolveModalInitialFocus as Bt } from "./initialFocus.js";
|
|
25
|
+
import { useModalBodyScrollState as Ft, ModalBodyFrame as Pt, ModalSurfaceFrame as Dt, resolveModalFooterBackground as At, ModalFooterFrame as Et, ModalHeaderFrame as It, ModalNavigationSectionFrame as jt, mergeModalClassName as Lt } from "../internal/ModalPresentation.js";
|
|
26
|
+
import { OverlayPortalProvider as Vt } from "../internal/OverlayPortalContext.js";
|
|
27
|
+
import { resolveModalSnapMetrics as $t, resolveModalPopupSnapPositions as Kt } from "./snapPoints.js";
|
|
28
|
+
import y from "./Modal.module.scss.js";
|
|
29
|
+
const Ot = /* @__PURE__ */ new Set([
|
|
26
30
|
"oc-modal-reject-shake",
|
|
27
31
|
"oc-modal-reject-shake-replay"
|
|
28
|
-
]),
|
|
29
|
-
function
|
|
32
|
+
]), Ce = Lt;
|
|
33
|
+
function _t(e) {
|
|
30
34
|
if (!e) return;
|
|
31
35
|
const o = Object.entries(e).filter(
|
|
32
36
|
([r]) => r.startsWith("--")
|
|
@@ -34,56 +38,56 @@ function It(e) {
|
|
|
34
38
|
if (o.length !== 0)
|
|
35
39
|
return Object.fromEntries(o);
|
|
36
40
|
}
|
|
37
|
-
function
|
|
41
|
+
function qt({
|
|
38
42
|
contentTransition: e,
|
|
39
43
|
placement: o,
|
|
40
44
|
resize: r
|
|
41
45
|
}) {
|
|
42
46
|
return e !== "auto" || r !== "content" || o === "full" ? "none" : o === "bottom" ? "sheet" : "surface";
|
|
43
47
|
}
|
|
44
|
-
function
|
|
48
|
+
function ze(e, o) {
|
|
45
49
|
return e.resolvedBackdrop === o ? e : {
|
|
46
50
|
resolvedBackdrop: o,
|
|
47
51
|
exiting: o === "hidden" && e.resolvedBackdrop !== "hidden"
|
|
48
52
|
};
|
|
49
53
|
}
|
|
50
|
-
function
|
|
51
|
-
const o = window.getComputedStyle(e), r =
|
|
54
|
+
function Gt(e) {
|
|
55
|
+
const o = window.getComputedStyle(e), r = Ne(o.animationDuration), a = Ne(o.animationDelay);
|
|
52
56
|
return r + a + 250;
|
|
53
57
|
}
|
|
54
|
-
function
|
|
55
|
-
const o = window.getComputedStyle(e), r =
|
|
58
|
+
function Ut(e) {
|
|
59
|
+
const o = window.getComputedStyle(e), r = Ne(o.transitionDuration), a = Ne(o.transitionDelay);
|
|
56
60
|
return r + a + 250;
|
|
57
61
|
}
|
|
58
|
-
function
|
|
62
|
+
function zt({
|
|
59
63
|
defaultSnapPosition: e,
|
|
60
64
|
node: o,
|
|
61
65
|
snapPositions: r
|
|
62
66
|
}) {
|
|
63
67
|
if (!r?.length) return;
|
|
64
|
-
const a =
|
|
68
|
+
const a = Kt({
|
|
65
69
|
defaultSnapPosition: e,
|
|
66
70
|
snapPositions: r,
|
|
67
71
|
surfaceMotion: o
|
|
68
72
|
});
|
|
69
73
|
if (!a) return;
|
|
70
|
-
const
|
|
74
|
+
const i = a.defaultTarget;
|
|
71
75
|
o.style.setProperty(
|
|
72
76
|
"--oc-modal-translate-x",
|
|
73
|
-
|
|
77
|
+
i.settledTranslate?.x ?? `${i.x}px`
|
|
74
78
|
), o.style.setProperty(
|
|
75
79
|
"--oc-modal-translate-y",
|
|
76
|
-
|
|
80
|
+
i.settledTranslate?.y ?? `${i.y}px`
|
|
77
81
|
);
|
|
78
82
|
}
|
|
79
|
-
function
|
|
83
|
+
function Wt(e) {
|
|
80
84
|
if (e && typeof e == "object" && "reason" in e && typeof e.reason == "string")
|
|
81
85
|
return e.reason;
|
|
82
86
|
}
|
|
83
|
-
function
|
|
87
|
+
function Me(e) {
|
|
84
88
|
e && typeof e == "object" && "cancel" in e && typeof e.cancel == "function" && e.cancel();
|
|
85
89
|
}
|
|
86
|
-
function
|
|
90
|
+
function Yt(e, o) {
|
|
87
91
|
switch (o) {
|
|
88
92
|
case "drag-dismiss":
|
|
89
93
|
return e?.drag ?? "auto";
|
|
@@ -101,13 +105,13 @@ function qt(e, o) {
|
|
|
101
105
|
return e?.programmatic ?? "auto";
|
|
102
106
|
}
|
|
103
107
|
}
|
|
104
|
-
function
|
|
108
|
+
function Jt(e, o) {
|
|
105
109
|
return o > 0 && (e === "drag-dismiss" || e === "backdrop-press" || e === "outside-press");
|
|
106
110
|
}
|
|
107
|
-
function
|
|
111
|
+
function We(e, o) {
|
|
108
112
|
return o && (e === "backdrop-press" || e === "outside-press");
|
|
109
113
|
}
|
|
110
|
-
function
|
|
114
|
+
function Qt({
|
|
111
115
|
backdrop: e,
|
|
112
116
|
canSnapPopup: o,
|
|
113
117
|
placement: r,
|
|
@@ -115,8 +119,8 @@ function Gt({
|
|
|
115
119
|
}) {
|
|
116
120
|
return e !== "auto" ? e : r === "bottom" && a === "peeked" || o ? "hidden" : "visible";
|
|
117
121
|
}
|
|
118
|
-
function
|
|
119
|
-
switch (
|
|
122
|
+
function Xt(e) {
|
|
123
|
+
switch (Wt(e)) {
|
|
120
124
|
case "close-press":
|
|
121
125
|
return "close-button";
|
|
122
126
|
case "outside-press":
|
|
@@ -131,160 +135,167 @@ function Ut(e) {
|
|
|
131
135
|
return "programmatic";
|
|
132
136
|
}
|
|
133
137
|
}
|
|
134
|
-
function
|
|
138
|
+
function Ye({
|
|
135
139
|
children: e,
|
|
136
140
|
open: o,
|
|
137
141
|
defaultOpen: r,
|
|
138
142
|
modal: a = !0,
|
|
139
|
-
onOpenChange:
|
|
140
|
-
onOpenChangeComplete:
|
|
141
|
-
canCloseAttempt:
|
|
142
|
-
onCloseAttempt:
|
|
143
|
-
presentationState:
|
|
144
|
-
defaultPresentationState:
|
|
145
|
-
onPresentationStateChange:
|
|
146
|
-
disablePointerDismissal:
|
|
143
|
+
onOpenChange: i,
|
|
144
|
+
onOpenChangeComplete: h,
|
|
145
|
+
canCloseAttempt: g,
|
|
146
|
+
onCloseAttempt: f,
|
|
147
|
+
presentationState: p,
|
|
148
|
+
defaultPresentationState: R = "visible",
|
|
149
|
+
onPresentationStateChange: H,
|
|
150
|
+
disablePointerDismissal: w,
|
|
147
151
|
navigationDepth: N = 0,
|
|
148
|
-
dismissBehavior:
|
|
152
|
+
dismissBehavior: b
|
|
149
153
|
}) {
|
|
150
|
-
const $ = o !== void 0, [
|
|
154
|
+
const $ = o !== void 0, [A, X] = m(
|
|
151
155
|
r ?? !1
|
|
152
|
-
),
|
|
156
|
+
), K = $ ? o : A, [O, _] = m("bottom"), [q, t] = m(!1), [x, de] = m(!1), [Z, he] = m(!1), [s, ge] = m(!1), [be, ue] = m(!1), [ee, E] = m(0), [ye, me] = m(0), [Se, Te] = m(null), te = Q(() => St(), []);
|
|
157
|
+
L(() => () => te.destroy(), [te]);
|
|
158
|
+
const [oe, k] = m(null), [v, G] = m({
|
|
153
159
|
canScroll: !1,
|
|
154
160
|
scrolledFromTop: !1,
|
|
155
161
|
scrolledToBottom: !0
|
|
156
|
-
}), [
|
|
157
|
-
value:
|
|
158
|
-
defaultValue:
|
|
159
|
-
onChange:
|
|
160
|
-
}),
|
|
161
|
-
(n,
|
|
162
|
-
$ ||
|
|
162
|
+
}), [B, U] = kt({
|
|
163
|
+
value: p,
|
|
164
|
+
defaultValue: R,
|
|
165
|
+
onChange: H
|
|
166
|
+
}), z = Ue(), M = Ue(), l = Math.max(0, N), F = S(
|
|
167
|
+
(n, u) => {
|
|
168
|
+
$ || X(n), i?.(n, u);
|
|
163
169
|
},
|
|
164
|
-
[
|
|
165
|
-
),
|
|
166
|
-
(n = { reason: "programmatic" }) =>
|
|
167
|
-
[
|
|
168
|
-
),
|
|
170
|
+
[i, $]
|
|
171
|
+
), W = S(
|
|
172
|
+
(n = { reason: "programmatic" }) => g?.(n) !== !1,
|
|
173
|
+
[g]
|
|
174
|
+
), C = S(
|
|
169
175
|
(n = { reason: "programmatic" }) => {
|
|
170
|
-
|
|
176
|
+
E((u) => u + 1);
|
|
171
177
|
},
|
|
172
178
|
[]
|
|
173
|
-
),
|
|
174
|
-
|
|
175
|
-
}, []),
|
|
179
|
+
), ne = S(() => {
|
|
180
|
+
me((n) => n + 1);
|
|
181
|
+
}, []), Y = S(
|
|
176
182
|
(n = { reason: "programmatic" }) => {
|
|
177
|
-
if (
|
|
183
|
+
if (We(n.reason, s))
|
|
178
184
|
return !1;
|
|
179
|
-
const
|
|
180
|
-
return
|
|
185
|
+
const u = Yt(b, n.reason);
|
|
186
|
+
return u === "allow" ? !0 : u === "block" ? !1 : !Jt(n.reason, l);
|
|
181
187
|
},
|
|
182
|
-
[
|
|
183
|
-
),
|
|
184
|
-
(n = { reason: "programmatic" },
|
|
185
|
-
const { commit:
|
|
186
|
-
return !
|
|
188
|
+
[s, b, l]
|
|
189
|
+
), P = S(
|
|
190
|
+
(n = { reason: "programmatic" }, u = {}) => {
|
|
191
|
+
const { commit: ae = !0, skipAttempt: ce = !1 } = u;
|
|
192
|
+
return !ce && We(n.reason, s) ? (Me(n.eventDetails), !1) : !ce && !Y(n) || !ce && !W(n) || !ce && f?.(n) === !1 ? (Me(n.eventDetails), C(n), !1) : (ae && F(!1, n.eventDetails), !0);
|
|
187
193
|
},
|
|
188
194
|
[
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
+
W,
|
|
196
|
+
s,
|
|
197
|
+
Y,
|
|
198
|
+
F,
|
|
199
|
+
C,
|
|
200
|
+
f
|
|
195
201
|
]
|
|
196
|
-
),
|
|
197
|
-
(n,
|
|
198
|
-
if (n &&
|
|
199
|
-
|
|
200
|
-
reason:
|
|
201
|
-
eventDetails:
|
|
202
|
+
), I = S(
|
|
203
|
+
(n, u) => {
|
|
204
|
+
if (n && B === "peeked" && U("visible"), !n) {
|
|
205
|
+
P({
|
|
206
|
+
reason: Xt(u),
|
|
207
|
+
eventDetails: u
|
|
202
208
|
});
|
|
203
209
|
return;
|
|
204
210
|
}
|
|
205
|
-
|
|
211
|
+
F(n, u);
|
|
206
212
|
},
|
|
207
|
-
[
|
|
208
|
-
),
|
|
213
|
+
[F, B, P, U]
|
|
214
|
+
), re = B === "visible" && !be ? a : !1, pe = w || O === "bottom" && (q || be), ke = Q(
|
|
209
215
|
() => ({
|
|
210
|
-
open:
|
|
211
|
-
modal:
|
|
212
|
-
placement:
|
|
213
|
-
setPlacement:
|
|
214
|
-
presentationState:
|
|
215
|
-
setPresentationState:
|
|
216
|
-
requestClose:
|
|
217
|
-
canDismissByBehavior:
|
|
218
|
-
canCloseAttempt:
|
|
219
|
-
closeAttemptFeedbackKey:
|
|
220
|
-
notifyCloseAttemptRejected:
|
|
221
|
-
disablePointerDismissal:
|
|
222
|
-
setBackdropDismissalDisabled:
|
|
223
|
-
setBackgroundInteractive:
|
|
224
|
-
canPeek:
|
|
216
|
+
open: K,
|
|
217
|
+
modal: re,
|
|
218
|
+
placement: O,
|
|
219
|
+
setPlacement: _,
|
|
220
|
+
presentationState: B,
|
|
221
|
+
setPresentationState: U,
|
|
222
|
+
requestClose: P,
|
|
223
|
+
canDismissByBehavior: Y,
|
|
224
|
+
canCloseAttempt: W,
|
|
225
|
+
closeAttemptFeedbackKey: ee,
|
|
226
|
+
notifyCloseAttemptRejected: C,
|
|
227
|
+
disablePointerDismissal: w ?? !1,
|
|
228
|
+
setBackdropDismissalDisabled: ge,
|
|
229
|
+
setBackgroundInteractive: ue,
|
|
230
|
+
canPeek: q,
|
|
225
231
|
setCanPeek: t,
|
|
226
|
-
canRenderHandle:
|
|
227
|
-
setCanRenderHandle:
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
232
|
+
canRenderHandle: x,
|
|
233
|
+
setCanRenderHandle: de,
|
|
234
|
+
handleDraggable: Z,
|
|
235
|
+
setHandleDraggable: he,
|
|
236
|
+
popupSnapLayoutVersion: ye,
|
|
237
|
+
notifyPopupSnapLayoutChange: ne,
|
|
238
|
+
navigationDepth: l,
|
|
239
|
+
headerHeight: z.height,
|
|
240
|
+
footerHeight: M.height,
|
|
241
|
+
setHeaderNode: z.setNode,
|
|
242
|
+
titleNode: oe,
|
|
243
|
+
setTitleNode: k,
|
|
244
|
+
setFooterNode: M.setNode,
|
|
245
|
+
bodyNode: Se,
|
|
246
|
+
setBodyNode: Te,
|
|
247
|
+
bodyScroller: te,
|
|
248
|
+
scrollState: v,
|
|
249
|
+
setScrollState: G
|
|
241
250
|
}),
|
|
242
251
|
[
|
|
243
|
-
|
|
244
|
-
|
|
252
|
+
Se,
|
|
253
|
+
te,
|
|
254
|
+
q,
|
|
255
|
+
x,
|
|
256
|
+
Z,
|
|
257
|
+
Y,
|
|
245
258
|
W,
|
|
259
|
+
ee,
|
|
260
|
+
M.height,
|
|
261
|
+
M.setNode,
|
|
262
|
+
z.height,
|
|
263
|
+
z.setNode,
|
|
264
|
+
re,
|
|
265
|
+
l,
|
|
266
|
+
C,
|
|
267
|
+
ne,
|
|
268
|
+
ye,
|
|
269
|
+
K,
|
|
270
|
+
O,
|
|
246
271
|
P,
|
|
247
|
-
|
|
248
|
-
z,
|
|
249
|
-
O.height,
|
|
250
|
-
O.setNode,
|
|
251
|
-
A.height,
|
|
252
|
-
A.setNode,
|
|
253
|
-
_,
|
|
254
|
-
q,
|
|
272
|
+
v,
|
|
255
273
|
w,
|
|
256
|
-
le,
|
|
257
274
|
B,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
Q,
|
|
262
|
-
M,
|
|
263
|
-
p,
|
|
264
|
-
R,
|
|
265
|
-
pe,
|
|
266
|
-
me
|
|
275
|
+
U,
|
|
276
|
+
k,
|
|
277
|
+
oe
|
|
267
278
|
]
|
|
268
279
|
);
|
|
269
|
-
return /* @__PURE__ */
|
|
280
|
+
return /* @__PURE__ */ d(bt, { value: ke, children: /* @__PURE__ */ d(
|
|
270
281
|
V.Root,
|
|
271
282
|
{
|
|
272
|
-
open:
|
|
273
|
-
modal:
|
|
274
|
-
onOpenChange:
|
|
275
|
-
onOpenChangeComplete:
|
|
276
|
-
disablePointerDismissal:
|
|
283
|
+
open: K,
|
|
284
|
+
modal: re,
|
|
285
|
+
onOpenChange: I,
|
|
286
|
+
onOpenChangeComplete: h,
|
|
287
|
+
disablePointerDismissal: pe,
|
|
277
288
|
children: e
|
|
278
289
|
}
|
|
279
290
|
) });
|
|
280
291
|
}
|
|
281
|
-
function
|
|
292
|
+
function Zt({
|
|
282
293
|
className: e = "",
|
|
283
294
|
children: o,
|
|
284
295
|
render: r,
|
|
285
296
|
nativeButton: a
|
|
286
297
|
}) {
|
|
287
|
-
return r ? /* @__PURE__ */
|
|
298
|
+
return r ? /* @__PURE__ */ d(
|
|
288
299
|
V.Trigger,
|
|
289
300
|
{
|
|
290
301
|
render: r,
|
|
@@ -292,291 +303,298 @@ function Wt({
|
|
|
292
303
|
"data-oc-component": "modal-trigger",
|
|
293
304
|
children: o
|
|
294
305
|
}
|
|
295
|
-
) : /* @__PURE__ */
|
|
306
|
+
) : /* @__PURE__ */ d(
|
|
296
307
|
V.Trigger,
|
|
297
308
|
{
|
|
298
|
-
className:
|
|
309
|
+
className: Ce(y.trigger, e),
|
|
299
310
|
nativeButton: a,
|
|
300
311
|
"data-oc-component": "modal-trigger",
|
|
301
312
|
children: o
|
|
302
313
|
}
|
|
303
314
|
);
|
|
304
315
|
}
|
|
305
|
-
function
|
|
316
|
+
function eo({
|
|
306
317
|
className: e = "",
|
|
307
318
|
children: o,
|
|
308
319
|
variant: r = "adaptive",
|
|
309
320
|
size: a = "medium",
|
|
310
|
-
resize:
|
|
311
|
-
contentTransition:
|
|
312
|
-
backdrop:
|
|
313
|
-
backdropFrom:
|
|
314
|
-
drag:
|
|
315
|
-
peekable:
|
|
316
|
-
snapPoints:
|
|
317
|
-
defaultSnapPoint:
|
|
321
|
+
resize: i = "content",
|
|
322
|
+
contentTransition: h = "auto",
|
|
323
|
+
backdrop: g = "auto",
|
|
324
|
+
backdropFrom: f,
|
|
325
|
+
drag: p = "content",
|
|
326
|
+
peekable: R = !1,
|
|
327
|
+
snapPoints: H,
|
|
328
|
+
defaultSnapPoint: w,
|
|
318
329
|
snapPositions: N,
|
|
319
|
-
defaultSnapPosition:
|
|
330
|
+
defaultSnapPosition: b,
|
|
320
331
|
initialFocus: $,
|
|
321
|
-
peekHeight:
|
|
322
|
-
closeThreshold:
|
|
323
|
-
scrollLockTimeout:
|
|
324
|
-
container:
|
|
325
|
-
style:
|
|
326
|
-
...
|
|
332
|
+
peekHeight: A,
|
|
333
|
+
closeThreshold: X,
|
|
334
|
+
scrollLockTimeout: K,
|
|
335
|
+
container: O,
|
|
336
|
+
style: _,
|
|
337
|
+
...q
|
|
327
338
|
}) {
|
|
328
|
-
const t =
|
|
339
|
+
const t = le("ModalContent"), { setCanPeek: x, setCanRenderHandle: de, setHandleDraggable: Z, setPlacement: he } = t, s = Ht(r), ge = j(null), be = j(null), ue = j(null), ee = j(null), [E, ye] = m(null), [me, Se] = m(
|
|
329
340
|
null
|
|
330
|
-
), [
|
|
331
|
-
backdrop:
|
|
332
|
-
canSnapPopup:
|
|
333
|
-
placement:
|
|
341
|
+
), [Te, te] = m(null), oe = j(0), k = j(null), v = j(null), G = j(null), [B, U] = m(), z = p === "handle" || p === "content", M = s === "popup" && z && !!N?.length, l = Qt({
|
|
342
|
+
backdrop: g,
|
|
343
|
+
canSnapPopup: M,
|
|
344
|
+
placement: s,
|
|
334
345
|
presentationState: t.presentationState
|
|
335
|
-
}), [
|
|
336
|
-
resolvedBackdrop:
|
|
346
|
+
}), [F, W] = m(() => ({
|
|
347
|
+
resolvedBackdrop: l,
|
|
337
348
|
exiting: !1
|
|
338
|
-
})),
|
|
339
|
-
() =>
|
|
340
|
-
[
|
|
341
|
-
),
|
|
349
|
+
})), C = Q(
|
|
350
|
+
() => ze(F, l),
|
|
351
|
+
[F, l]
|
|
352
|
+
), ne = C.exiting, Y = M && l === "hidden", P = (s === "bottom" || M) && z, I = s === "bottom" && P && R, re = I && A !== void 0 ? A : t.headerHeight > 0 ? t.headerHeight : void 0, pe = s === "bottom" && i !== "fixed", ke = xt(t.open), n = Tt({
|
|
342
353
|
bodyNode: t.bodyNode,
|
|
343
|
-
enabled: t.open &&
|
|
354
|
+
enabled: t.open && s === "bottom",
|
|
344
355
|
footerHeight: t.footerHeight,
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
356
|
+
scroller: t.bodyScroller,
|
|
357
|
+
surfaceNode: E,
|
|
358
|
+
viewportGeometry: ke,
|
|
359
|
+
viewportNode: Te
|
|
360
|
+
}), u = s === "bottom" ? n.viewportGeometry : ke, ae = u?.height ?? 0, ce = Q(() => {
|
|
361
|
+
if (!(!H?.length || ae <= 0))
|
|
362
|
+
return $t({
|
|
363
|
+
snapPoints: H,
|
|
364
|
+
defaultSnapPoint: w,
|
|
365
|
+
backdropFrom: f,
|
|
366
|
+
viewportHeight: ae
|
|
355
367
|
});
|
|
356
|
-
}, [
|
|
357
|
-
enabled:
|
|
358
|
-
bodyNode:
|
|
359
|
-
surfaceMotionNode:
|
|
368
|
+
}, [f, w, H, ae]), D = s === "bottom" ? ce : void 0, Qe = wt(t.open), Xe = t.bodyNode, { intrinsicSheetHeight: Ee, shouldDeferSettle: Ze } = Mt({
|
|
369
|
+
enabled: pe,
|
|
370
|
+
bodyNode: Xe,
|
|
371
|
+
surfaceMotionNode: E,
|
|
360
372
|
snapSheetHeight: D?.sheetHeight,
|
|
361
|
-
viewportHeight:
|
|
362
|
-
discreteKey: t.navigationDepth
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
},
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}, [
|
|
376
|
-
|
|
373
|
+
viewportHeight: ae,
|
|
374
|
+
discreteKey: t.navigationDepth,
|
|
375
|
+
// The sheet shell is frozen for the whole keyboard session, like the
|
|
376
|
+
// viewport height: the keyboard moves the internal scroll inset only.
|
|
377
|
+
frozen: n.shellHeld
|
|
378
|
+
}), et = D !== void 0 && pe, He = pe && Ee > 0 ? Ee : void 0, se = D ? et && He !== void 0 ? He : D.sheetHeight : He, tt = D && se !== void 0 ? Math.max(0, se - D.defaultHeight) : void 0, ot = se !== void 0, we = qt({
|
|
379
|
+
contentTransition: h,
|
|
380
|
+
placement: s,
|
|
381
|
+
resize: i
|
|
382
|
+
}), nt = we === "surface" ? "auto" : "none", rt = we === "sheet" ? "auto" : "none";
|
|
383
|
+
L(() => {
|
|
384
|
+
he(s);
|
|
385
|
+
}, [s, he]), L(() => {
|
|
386
|
+
t.open || (ee.current = null);
|
|
387
|
+
}, [t.open]), L(() => (x(I), () => x(!1)), [I, x]), L(() => (de(P), () => de(!1)), [P, de]);
|
|
388
|
+
const Ie = P;
|
|
389
|
+
L(() => (Z(Ie), () => Z(!1)), [Ie, Z]);
|
|
390
|
+
const xe = t.bodyNode, je = t.setScrollState, Le = S(() => {
|
|
391
|
+
je(Rt(xe));
|
|
392
|
+
}, [xe, je]);
|
|
393
|
+
vt({
|
|
377
394
|
enabled: t.open && we === "surface",
|
|
378
|
-
node:
|
|
379
|
-
resizeHost:
|
|
380
|
-
bodyNode:
|
|
395
|
+
node: me,
|
|
396
|
+
resizeHost: E,
|
|
397
|
+
bodyNode: xe,
|
|
381
398
|
// Depth navigation is the explicit discrete-swap signal: the view swap
|
|
382
399
|
// and the depth change land in one commit, so the surface pins its
|
|
383
400
|
// previous height before that frame paints.
|
|
384
401
|
discreteKey: t.navigationDepth,
|
|
385
|
-
refreshScrollState:
|
|
402
|
+
refreshScrollState: Le
|
|
386
403
|
});
|
|
387
|
-
const
|
|
388
|
-
|
|
404
|
+
const Ve = D?.backdropFromHeight, [$e, Ke] = m(!1), at = S((c) => {
|
|
405
|
+
Ke(!c);
|
|
389
406
|
}, []);
|
|
390
|
-
!t.open &&
|
|
391
|
-
const
|
|
392
|
-
enabled:
|
|
393
|
-
drag:
|
|
407
|
+
!t.open && $e && Ke(!1);
|
|
408
|
+
const Re = Ve !== void 0 && $e, { collapseBottomSheetToUndimmedSnap: Be, handlers: ct } = Nt({
|
|
409
|
+
enabled: p !== !1 && !n.active,
|
|
410
|
+
drag: p,
|
|
394
411
|
open: t.open,
|
|
395
|
-
placement:
|
|
396
|
-
surfaceMotionRef:
|
|
397
|
-
surfaceMotionNode:
|
|
398
|
-
backdropRef:
|
|
412
|
+
placement: s,
|
|
413
|
+
surfaceMotionRef: ge,
|
|
414
|
+
surfaceMotionNode: E,
|
|
415
|
+
backdropRef: ue,
|
|
399
416
|
bodyNode: t.bodyNode,
|
|
400
417
|
snapHeights: D?.snapHeights,
|
|
401
|
-
sheetHeight:
|
|
402
|
-
backdropFromHeight:
|
|
403
|
-
onBackdropDimRestChange:
|
|
404
|
-
peekHeight:
|
|
405
|
-
peekFallback:
|
|
418
|
+
sheetHeight: se,
|
|
419
|
+
backdropFromHeight: Ve,
|
|
420
|
+
onBackdropDimRestChange: at,
|
|
421
|
+
peekHeight: I ? A : void 0,
|
|
422
|
+
peekFallback: I ? "header" : void 0,
|
|
406
423
|
presentationState: t.presentationState,
|
|
407
424
|
setPresentationState: t.setPresentationState,
|
|
408
425
|
requestClose: t.requestClose,
|
|
409
426
|
canCloseAttempt: t.canCloseAttempt,
|
|
410
427
|
dismissible: !t.disablePointerDismissal && t.canDismissByBehavior({ reason: "drag-dismiss" }),
|
|
411
|
-
backdropHidden:
|
|
412
|
-
visibleTranslate:
|
|
413
|
-
shouldDeferBottomSettle:
|
|
414
|
-
refreshScrollState:
|
|
415
|
-
snapPositions:
|
|
416
|
-
defaultSnapPosition:
|
|
417
|
-
closeThreshold:
|
|
418
|
-
scrollLockTimeout:
|
|
428
|
+
backdropHidden: l === "hidden",
|
|
429
|
+
visibleTranslate: tt,
|
|
430
|
+
shouldDeferBottomSettle: Ze,
|
|
431
|
+
refreshScrollState: Le,
|
|
432
|
+
snapPositions: M ? N : void 0,
|
|
433
|
+
defaultSnapPosition: b,
|
|
434
|
+
closeThreshold: X,
|
|
435
|
+
scrollLockTimeout: K,
|
|
419
436
|
popupSnapLayoutVersion: t.popupSnapLayoutVersion
|
|
420
|
-
}),
|
|
421
|
-
(
|
|
422
|
-
|
|
423
|
-
defaultSnapPosition:
|
|
424
|
-
node:
|
|
437
|
+
}), st = S(
|
|
438
|
+
(c) => {
|
|
439
|
+
ge.current = c, ye(c), c && t.open && M && ee.current !== c && (zt({
|
|
440
|
+
defaultSnapPosition: b,
|
|
441
|
+
node: c,
|
|
425
442
|
snapPositions: N
|
|
426
|
-
}),
|
|
443
|
+
}), ee.current = c);
|
|
427
444
|
},
|
|
428
|
-
[
|
|
429
|
-
),
|
|
430
|
-
|
|
445
|
+
[M, t.open, b, N]
|
|
446
|
+
), it = S((c) => {
|
|
447
|
+
be.current = c, Se(c);
|
|
431
448
|
}, []);
|
|
432
|
-
|
|
433
|
-
const
|
|
434
|
-
|
|
449
|
+
L(() => {
|
|
450
|
+
const c = t.closeAttemptFeedbackKey, T = () => {
|
|
451
|
+
U(void 0), v.current = null;
|
|
435
452
|
};
|
|
436
|
-
if (
|
|
437
|
-
|
|
453
|
+
if (c === 0) {
|
|
454
|
+
oe.current = c, T();
|
|
438
455
|
return;
|
|
439
456
|
}
|
|
440
|
-
if (
|
|
457
|
+
if (s !== "popup") {
|
|
441
458
|
T();
|
|
442
459
|
return;
|
|
443
460
|
}
|
|
444
|
-
if (
|
|
461
|
+
if (oe.current === c) {
|
|
445
462
|
T();
|
|
446
463
|
return;
|
|
447
464
|
}
|
|
448
|
-
const
|
|
449
|
-
if (!
|
|
450
|
-
|
|
451
|
-
const
|
|
452
|
-
|
|
465
|
+
const J = me;
|
|
466
|
+
if (!J) return;
|
|
467
|
+
oe.current = c, k.current !== null && window.cancelAnimationFrame(k.current), v.current !== null && window.clearTimeout(v.current), T();
|
|
468
|
+
const ve = (qe) => {
|
|
469
|
+
qe.target === J && Ot.has(qe.animationName) && (J.removeEventListener("animationend", ve), v.current !== null && window.clearTimeout(v.current), T());
|
|
453
470
|
};
|
|
454
|
-
return
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
},
|
|
471
|
+
return J.addEventListener("animationend", ve), k.current = window.requestAnimationFrame(() => {
|
|
472
|
+
k.current = null, U(c), k.current = window.requestAnimationFrame(() => {
|
|
473
|
+
k.current = null, v.current = window.setTimeout(() => {
|
|
474
|
+
J.removeEventListener("animationend", ve), T();
|
|
475
|
+
}, Gt(J));
|
|
459
476
|
});
|
|
460
477
|
}), () => {
|
|
461
|
-
|
|
478
|
+
J.removeEventListener("animationend", ve), k.current !== null && (window.cancelAnimationFrame(k.current), k.current = null), v.current !== null && (window.clearTimeout(v.current), v.current = null);
|
|
462
479
|
};
|
|
463
|
-
}, [t.closeAttemptFeedbackKey,
|
|
464
|
-
const
|
|
465
|
-
|
|
480
|
+
}, [t.closeAttemptFeedbackKey, s, me]);
|
|
481
|
+
const Oe = _t(_), lt = {
|
|
482
|
+
...Oe,
|
|
466
483
|
...t.headerHeight > 0 ? { "--oc-modal-header-height": `${t.headerHeight}px` } : {},
|
|
467
|
-
// The measured footer height feeds keyboard avoidance
|
|
468
|
-
//
|
|
469
|
-
//
|
|
470
|
-
|
|
471
|
-
...
|
|
472
|
-
...
|
|
484
|
+
// The measured footer height feeds keyboard avoidance, which hands it
|
|
485
|
+
// back held through a keyboard session; as a CSS reserve it only reaches
|
|
486
|
+
// the body when no footer is mounted (the `.surface:has(> .footer)` calc
|
|
487
|
+
// wins otherwise), so it must drop back to 0 on unmount.
|
|
488
|
+
...n.footerHeight > 0 ? { "--oc-modal-footer-height": `${n.footerHeight}px` } : {},
|
|
489
|
+
...re !== void 0 ? { "--oc-modal-peek-height": `${re}px` } : {},
|
|
490
|
+
...se !== void 0 ? { "--oc-modal-sheet-height": `${se}px` } : {}
|
|
473
491
|
// `--oc-modal-translate-y` and the inline `height` are owned imperatively
|
|
474
492
|
// by the drag hook: content-size transitions pin the surface to a canvas
|
|
475
493
|
// height and compensate the translate in the same frame. Rendering the
|
|
476
494
|
// height here would commit the new size before that compensation runs and
|
|
477
495
|
// make the sheet jump a frame early. The managed sizing CSS rule renders
|
|
478
496
|
// the resting height from `--oc-modal-sheet-height`.
|
|
479
|
-
},
|
|
497
|
+
}, _e = {
|
|
480
498
|
// Each modal reserves one backdrop slot and one viewport slot.
|
|
481
|
-
"--oc-modal-stack-offset":
|
|
482
|
-
},
|
|
483
|
-
...
|
|
484
|
-
"--_-modal-keyboard-inset": `${
|
|
485
|
-
|
|
486
|
-
...
|
|
487
|
-
"--_-modal-viewport-height": `${
|
|
488
|
-
"--_-modal-viewport-offset-left": `${
|
|
489
|
-
"--_-modal-viewport-offset-top": `${
|
|
490
|
-
"--_-modal-viewport-width": `${
|
|
499
|
+
"--oc-modal-stack-offset": Qe * 2
|
|
500
|
+
}, dt = {
|
|
501
|
+
..._e,
|
|
502
|
+
"--_-modal-keyboard-inset": `${n.keyboardInset}px`,
|
|
503
|
+
[Ct]: `${n.settledKeyboardInset}px`,
|
|
504
|
+
...u ? {
|
|
505
|
+
"--_-modal-viewport-height": `${u.height}px`,
|
|
506
|
+
"--_-modal-viewport-offset-left": `${u.offsetLeft}px`,
|
|
507
|
+
"--_-modal-viewport-offset-top": `${u.offsetTop}px`,
|
|
508
|
+
"--_-modal-viewport-width": `${u.width}px`
|
|
491
509
|
} : {}
|
|
492
|
-
},
|
|
493
|
-
...
|
|
510
|
+
}, ut = t.headerHeight > 0 ? {
|
|
511
|
+
..._,
|
|
494
512
|
"--oc-modal-header-height": `${t.headerHeight}px`
|
|
495
|
-
} :
|
|
496
|
-
contentNode:
|
|
513
|
+
} : _, mt = Bt({
|
|
514
|
+
contentNode: E,
|
|
497
515
|
initialFocus: $,
|
|
498
516
|
modal: t.modal,
|
|
499
517
|
titleNode: t.titleNode
|
|
500
|
-
}), { setBackdropDismissalDisabled:
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
}, [
|
|
504
|
-
const
|
|
505
|
-
|
|
506
|
-
}, []),
|
|
507
|
-
|
|
508
|
-
const T =
|
|
509
|
-
|
|
510
|
-
|
|
518
|
+
}), { setBackdropDismissalDisabled: Fe, setBackgroundInteractive: Pe } = t, pt = l !== "hidden" || ne;
|
|
519
|
+
De(() => {
|
|
520
|
+
C !== F && W(C);
|
|
521
|
+
}, [F, C]);
|
|
522
|
+
const ie = S(() => {
|
|
523
|
+
G.current !== null && (window.clearTimeout(G.current), G.current = null);
|
|
524
|
+
}, []), fe = S(() => {
|
|
525
|
+
l === "hidden" && (ie(), W((c) => {
|
|
526
|
+
const T = ze(
|
|
527
|
+
c,
|
|
528
|
+
l
|
|
511
529
|
);
|
|
512
530
|
return T.resolvedBackdrop !== "hidden" || !T.exiting ? T : {
|
|
513
531
|
...T,
|
|
514
532
|
exiting: !1
|
|
515
533
|
};
|
|
516
534
|
}));
|
|
517
|
-
}, [
|
|
518
|
-
return
|
|
535
|
+
}, [ie, l]);
|
|
536
|
+
return L(
|
|
519
537
|
() => () => {
|
|
520
|
-
|
|
538
|
+
ie();
|
|
521
539
|
},
|
|
522
|
-
[
|
|
523
|
-
),
|
|
524
|
-
if (!
|
|
525
|
-
const
|
|
526
|
-
if (!
|
|
527
|
-
|
|
540
|
+
[ie]
|
|
541
|
+
), De(() => {
|
|
542
|
+
if (!ne || l !== "hidden") return;
|
|
543
|
+
const c = ue.current;
|
|
544
|
+
if (!c) {
|
|
545
|
+
G.current = window.setTimeout(fe, 0);
|
|
528
546
|
return;
|
|
529
547
|
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
548
|
+
ie(), G.current = window.setTimeout(
|
|
549
|
+
fe,
|
|
550
|
+
Ut(c)
|
|
533
551
|
);
|
|
534
552
|
}, [
|
|
535
|
-
|
|
536
|
-
ue,
|
|
537
|
-
E,
|
|
538
|
-
d
|
|
539
|
-
]), Be(() => (Re(d === "hidden"), Fe(fe || Te), () => {
|
|
540
|
-
Re(!1), Fe(!1);
|
|
541
|
-
}), [
|
|
542
|
-
Te,
|
|
553
|
+
ie,
|
|
543
554
|
fe,
|
|
544
|
-
|
|
555
|
+
ne,
|
|
556
|
+
l
|
|
557
|
+
]), De(() => (Fe(l === "hidden"), Pe(Y || Re), () => {
|
|
558
|
+
Fe(!1), Pe(!1);
|
|
559
|
+
}), [
|
|
545
560
|
Re,
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
561
|
+
Y,
|
|
562
|
+
l,
|
|
563
|
+
Fe,
|
|
564
|
+
Pe
|
|
565
|
+
]), /* @__PURE__ */ Ge(V.Portal, { container: O, children: [
|
|
566
|
+
pt ? /* @__PURE__ */ d(
|
|
549
567
|
V.Backdrop,
|
|
550
568
|
{
|
|
551
|
-
ref:
|
|
552
|
-
className:
|
|
569
|
+
ref: ue,
|
|
570
|
+
className: y.backdrop,
|
|
553
571
|
"data-oc-part": "backdrop",
|
|
554
572
|
"data-oc-component": "modal-backdrop",
|
|
555
|
-
"data-oc-modal-backdrop":
|
|
556
|
-
"data-oc-modal-backdrop-passthrough":
|
|
557
|
-
"data-oc-modal-placement":
|
|
573
|
+
"data-oc-modal-backdrop": l,
|
|
574
|
+
"data-oc-modal-backdrop-passthrough": Re ? "true" : void 0,
|
|
575
|
+
"data-oc-modal-placement": s,
|
|
558
576
|
"data-oc-modal-presentation-state": t.presentationState,
|
|
559
|
-
style:
|
|
560
|
-
onTransitionCancel: (
|
|
561
|
-
|
|
577
|
+
style: _e,
|
|
578
|
+
onTransitionCancel: (c) => {
|
|
579
|
+
c.currentTarget === c.target && c.propertyName === "opacity" && fe();
|
|
562
580
|
},
|
|
563
|
-
onTransitionEnd: (
|
|
564
|
-
|
|
581
|
+
onTransitionEnd: (c) => {
|
|
582
|
+
c.currentTarget === c.target && c.propertyName === "opacity" && fe();
|
|
565
583
|
},
|
|
566
584
|
onClick: () => {
|
|
567
585
|
if (t.disablePointerDismissal) {
|
|
568
|
-
if (
|
|
586
|
+
if (Be()) return;
|
|
569
587
|
t.notifyCloseAttemptRejected({ reason: "backdrop-press" });
|
|
570
588
|
return;
|
|
571
589
|
}
|
|
572
590
|
if (!t.canDismissByBehavior({ reason: "backdrop-press" })) {
|
|
573
|
-
if (
|
|
591
|
+
if (Be()) return;
|
|
574
592
|
t.notifyCloseAttemptRejected({ reason: "backdrop-press" });
|
|
575
593
|
return;
|
|
576
594
|
}
|
|
577
|
-
if (
|
|
595
|
+
if (s === "bottom" && I) {
|
|
578
596
|
if (t.presentationState === "visible") {
|
|
579
|
-
if (
|
|
597
|
+
if (Be()) return;
|
|
580
598
|
t.setPresentationState("peeked");
|
|
581
599
|
}
|
|
582
600
|
return;
|
|
@@ -585,68 +603,69 @@ function zt({
|
|
|
585
603
|
}
|
|
586
604
|
}
|
|
587
605
|
) : null,
|
|
588
|
-
/* @__PURE__ */
|
|
606
|
+
/* @__PURE__ */ d(
|
|
589
607
|
V.Viewport,
|
|
590
608
|
{
|
|
591
|
-
ref:
|
|
592
|
-
className:
|
|
609
|
+
ref: te,
|
|
610
|
+
className: y.viewport,
|
|
593
611
|
"data-oc-part": "viewport",
|
|
594
612
|
"data-oc-component": "modal-viewport",
|
|
595
|
-
"data-oc-modal-placement":
|
|
596
|
-
"data-oc-modal-keyboard-avoiding":
|
|
597
|
-
|
|
598
|
-
|
|
613
|
+
"data-oc-modal-placement": s,
|
|
614
|
+
"data-oc-modal-keyboard-avoiding": n.active ? "true" : void 0,
|
|
615
|
+
"data-oc-modal-keyboard-closing": n.closing ? "true" : void 0,
|
|
616
|
+
style: dt,
|
|
617
|
+
children: /* @__PURE__ */ d(
|
|
599
618
|
V.Popup,
|
|
600
619
|
{
|
|
601
|
-
...
|
|
602
|
-
...
|
|
603
|
-
ref:
|
|
604
|
-
initialFocus:
|
|
605
|
-
className:
|
|
606
|
-
|
|
607
|
-
|
|
620
|
+
...q,
|
|
621
|
+
...ct,
|
|
622
|
+
ref: st,
|
|
623
|
+
initialFocus: mt,
|
|
624
|
+
className: Ce(
|
|
625
|
+
y.surfaceMotion,
|
|
626
|
+
y[a],
|
|
608
627
|
e,
|
|
609
|
-
|
|
628
|
+
B === void 0 ? void 0 : B % 2 === 0 ? y.feedbackEven : y.feedbackOdd
|
|
610
629
|
),
|
|
611
630
|
"data-oc-part": "surface-motion",
|
|
612
631
|
"data-oc-component": "modal-content",
|
|
613
|
-
"data-oc-modal-backdrop":
|
|
632
|
+
"data-oc-modal-backdrop": l,
|
|
614
633
|
"data-oc-variant": r,
|
|
615
634
|
"data-oc-size": a,
|
|
616
|
-
"data-oc-resize":
|
|
617
|
-
"data-oc-modal-feedback":
|
|
618
|
-
"data-oc-modal-placement":
|
|
619
|
-
"data-oc-modal-snapping": D ||
|
|
620
|
-
"data-oc-modal-sheet-sizing":
|
|
621
|
-
"data-oc-modal-sheet-transition":
|
|
622
|
-
style:
|
|
623
|
-
children: /* @__PURE__ */
|
|
624
|
-
|
|
635
|
+
"data-oc-resize": i,
|
|
636
|
+
"data-oc-modal-feedback": s === "popup" && B !== void 0 ? "reject" : void 0,
|
|
637
|
+
"data-oc-modal-placement": s,
|
|
638
|
+
"data-oc-modal-snapping": D || M ? "true" : void 0,
|
|
639
|
+
"data-oc-modal-sheet-sizing": ot ? "managed" : void 0,
|
|
640
|
+
"data-oc-modal-sheet-transition": rt === "auto" ? "auto" : void 0,
|
|
641
|
+
style: lt,
|
|
642
|
+
children: /* @__PURE__ */ Ge(Vt, { container: E, children: [
|
|
643
|
+
s === "bottom" ? /* @__PURE__ */ d(
|
|
625
644
|
"div",
|
|
626
645
|
{
|
|
627
646
|
"aria-hidden": "true",
|
|
628
|
-
className:
|
|
629
|
-
|
|
630
|
-
|
|
647
|
+
className: Ce(
|
|
648
|
+
y.bottomFill,
|
|
649
|
+
y[a],
|
|
631
650
|
e
|
|
632
651
|
),
|
|
633
652
|
"data-oc-part": "bottom-fill",
|
|
634
653
|
"data-oc-component": "modal-bottom-fill",
|
|
635
654
|
"data-oc-size": a,
|
|
636
|
-
style:
|
|
655
|
+
style: Oe
|
|
637
656
|
}
|
|
638
657
|
) : null,
|
|
639
|
-
/* @__PURE__ */
|
|
640
|
-
|
|
658
|
+
/* @__PURE__ */ d(
|
|
659
|
+
Dt,
|
|
641
660
|
{
|
|
642
|
-
ref:
|
|
661
|
+
ref: it,
|
|
643
662
|
className: e,
|
|
644
|
-
contentTransition:
|
|
645
|
-
placement:
|
|
646
|
-
resize:
|
|
663
|
+
contentTransition: nt === "auto" ? "auto" : void 0,
|
|
664
|
+
placement: s,
|
|
665
|
+
resize: i,
|
|
647
666
|
scrollable: t.scrollState.canScroll,
|
|
648
667
|
size: a,
|
|
649
|
-
style:
|
|
668
|
+
style: ut,
|
|
650
669
|
variant: r,
|
|
651
670
|
children: o
|
|
652
671
|
}
|
|
@@ -658,179 +677,203 @@ function zt({
|
|
|
658
677
|
)
|
|
659
678
|
] });
|
|
660
679
|
}
|
|
661
|
-
function
|
|
680
|
+
function to({
|
|
662
681
|
className: e = "",
|
|
663
682
|
title: o,
|
|
664
683
|
children: r,
|
|
665
684
|
leadingContent: a,
|
|
666
|
-
trailingContent:
|
|
667
|
-
bottomContent:
|
|
668
|
-
closeLabel:
|
|
669
|
-
closeButton:
|
|
670
|
-
handle:
|
|
671
|
-
|
|
672
|
-
|
|
685
|
+
trailingContent: i,
|
|
686
|
+
bottomContent: h,
|
|
687
|
+
closeLabel: g = "닫기",
|
|
688
|
+
closeButton: f = !0,
|
|
689
|
+
handle: p = !0,
|
|
690
|
+
onClick: R,
|
|
691
|
+
ref: H,
|
|
692
|
+
...w
|
|
673
693
|
}) {
|
|
674
|
-
const
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
694
|
+
const N = le("ModalHeader"), {
|
|
695
|
+
bodyNode: b,
|
|
696
|
+
bodyScroller: $,
|
|
697
|
+
setHeaderNode: A,
|
|
698
|
+
setTitleNode: X,
|
|
699
|
+
scrollState: K,
|
|
700
|
+
handleDraggable: O
|
|
701
|
+
} = N, _ = (x) => {
|
|
702
|
+
R?.(x), !(x.defaultPrevented || !b || !yt({
|
|
703
|
+
scrollTop: b.scrollTop,
|
|
704
|
+
target: x.target
|
|
705
|
+
})) && $.scrollTo(b, 0);
|
|
706
|
+
}, q = Q(
|
|
707
|
+
() => Ae(A, H),
|
|
708
|
+
[H, A]
|
|
709
|
+
), t = Q(
|
|
710
|
+
() => Ae(X),
|
|
711
|
+
[X]
|
|
680
712
|
);
|
|
681
|
-
return /* @__PURE__ */
|
|
682
|
-
|
|
713
|
+
return /* @__PURE__ */ d(
|
|
714
|
+
It,
|
|
683
715
|
{
|
|
684
|
-
...
|
|
685
|
-
ref:
|
|
686
|
-
|
|
716
|
+
...w,
|
|
717
|
+
ref: q,
|
|
718
|
+
onClick: _,
|
|
719
|
+
bottomSlot: h,
|
|
687
720
|
className: e,
|
|
688
|
-
closeContent:
|
|
689
|
-
handleContent:
|
|
721
|
+
closeContent: f ? /* @__PURE__ */ d(Je, { label: g }) : null,
|
|
722
|
+
handleContent: p && N.canRenderHandle ? /* @__PURE__ */ d(
|
|
690
723
|
"div",
|
|
691
724
|
{
|
|
692
725
|
"aria-hidden": "true",
|
|
693
|
-
className:
|
|
694
|
-
"data-oc-part": "handle"
|
|
726
|
+
className: y.handleArea,
|
|
727
|
+
"data-oc-part": "handle-area",
|
|
728
|
+
"data-oc-draggable": O ? "true" : "false",
|
|
729
|
+
children: /* @__PURE__ */ d(
|
|
730
|
+
"div",
|
|
731
|
+
{
|
|
732
|
+
"aria-hidden": "true",
|
|
733
|
+
className: y.handle,
|
|
734
|
+
"data-oc-part": "handle",
|
|
735
|
+
children: /* @__PURE__ */ d(gt, { variant: "light" })
|
|
736
|
+
}
|
|
737
|
+
)
|
|
695
738
|
}
|
|
696
739
|
) : null,
|
|
697
740
|
leadingContent: a,
|
|
698
|
-
sticky:
|
|
699
|
-
titleContent: o ? /* @__PURE__ */
|
|
741
|
+
sticky: K.scrolledFromTop,
|
|
742
|
+
titleContent: o ? /* @__PURE__ */ d(
|
|
700
743
|
V.Title,
|
|
701
744
|
{
|
|
702
|
-
ref:
|
|
703
|
-
className:
|
|
745
|
+
ref: t,
|
|
746
|
+
className: y.initialFocusTitle,
|
|
704
747
|
tabIndex: -1,
|
|
705
748
|
children: o
|
|
706
749
|
}
|
|
707
750
|
) : void 0,
|
|
708
|
-
trailingContent:
|
|
751
|
+
trailingContent: i,
|
|
709
752
|
children: r
|
|
710
753
|
}
|
|
711
754
|
);
|
|
712
755
|
}
|
|
713
|
-
function
|
|
756
|
+
function oo({
|
|
714
757
|
handle: e = !0,
|
|
715
758
|
...o
|
|
716
759
|
}) {
|
|
717
|
-
const r =
|
|
760
|
+
const r = le("ModalNavigationSection"), {
|
|
718
761
|
canRenderHandle: a,
|
|
719
|
-
notifyPopupSnapLayoutChange:
|
|
720
|
-
placement:
|
|
762
|
+
notifyPopupSnapLayoutChange: i,
|
|
763
|
+
placement: h
|
|
721
764
|
} = r;
|
|
722
|
-
return /* @__PURE__ */
|
|
723
|
-
|
|
765
|
+
return /* @__PURE__ */ d(
|
|
766
|
+
jt,
|
|
724
767
|
{
|
|
725
768
|
...o,
|
|
726
769
|
canRenderHandle: e && a,
|
|
727
770
|
onPanelMotionStateChange: () => {
|
|
728
|
-
|
|
771
|
+
h === "popup" && i();
|
|
729
772
|
}
|
|
730
773
|
}
|
|
731
774
|
);
|
|
732
775
|
}
|
|
733
|
-
function
|
|
776
|
+
function no({
|
|
734
777
|
className: e = "",
|
|
735
778
|
children: o,
|
|
736
779
|
layout: r = "content",
|
|
737
780
|
containerClassName: a = "",
|
|
738
|
-
containerProps:
|
|
739
|
-
ref:
|
|
740
|
-
...
|
|
781
|
+
containerProps: i,
|
|
782
|
+
ref: h,
|
|
783
|
+
...g
|
|
741
784
|
}) {
|
|
742
|
-
const
|
|
743
|
-
bodyNode:
|
|
744
|
-
bodyRef:
|
|
745
|
-
setBodyNode:
|
|
746
|
-
setScrollState:
|
|
785
|
+
const f = le("ModalBody"), { bodyNode: p, setBodyNode: R, setScrollState: H } = f, { setBodyRef: w, updateScrollState: N } = Ft({
|
|
786
|
+
bodyNode: p,
|
|
787
|
+
bodyRef: h,
|
|
788
|
+
setBodyNode: R,
|
|
789
|
+
setScrollState: H
|
|
747
790
|
});
|
|
748
|
-
return /* @__PURE__ */
|
|
749
|
-
|
|
791
|
+
return /* @__PURE__ */ d(
|
|
792
|
+
Pt,
|
|
750
793
|
{
|
|
751
794
|
bodyContainerProps: {
|
|
752
|
-
ref:
|
|
753
|
-
onScroll: (
|
|
754
|
-
|
|
795
|
+
ref: w,
|
|
796
|
+
onScroll: (b) => {
|
|
797
|
+
i?.onScroll?.(b), N(b.currentTarget);
|
|
755
798
|
}
|
|
756
799
|
},
|
|
757
|
-
bodyContentProps: { ...
|
|
800
|
+
bodyContentProps: { ...i, className: a },
|
|
758
801
|
layout: r,
|
|
759
|
-
scrollAreaProps: { ...
|
|
802
|
+
scrollAreaProps: { ...g, className: e },
|
|
760
803
|
children: o
|
|
761
804
|
}
|
|
762
805
|
);
|
|
763
806
|
}
|
|
764
|
-
function
|
|
807
|
+
function ro({
|
|
765
808
|
className: e = "",
|
|
766
809
|
children: o,
|
|
767
810
|
background: r = "auto",
|
|
768
811
|
ref: a,
|
|
769
|
-
...
|
|
812
|
+
...i
|
|
770
813
|
}) {
|
|
771
|
-
const
|
|
772
|
-
() =>
|
|
773
|
-
[a,
|
|
774
|
-
),
|
|
814
|
+
const h = le("ModalFooter"), { scrollState: g, setFooterNode: f } = h, p = Q(
|
|
815
|
+
() => Ae(f, a),
|
|
816
|
+
[a, f]
|
|
817
|
+
), R = At(
|
|
775
818
|
r,
|
|
776
|
-
|
|
819
|
+
g
|
|
777
820
|
);
|
|
778
|
-
return /* @__PURE__ */
|
|
779
|
-
|
|
821
|
+
return /* @__PURE__ */ d(
|
|
822
|
+
Et,
|
|
780
823
|
{
|
|
781
|
-
...
|
|
782
|
-
ref:
|
|
783
|
-
backgroundActive:
|
|
824
|
+
...i,
|
|
825
|
+
ref: p,
|
|
826
|
+
backgroundActive: R,
|
|
784
827
|
className: e,
|
|
785
828
|
children: o
|
|
786
829
|
}
|
|
787
830
|
);
|
|
788
831
|
}
|
|
789
|
-
function
|
|
832
|
+
function Je({
|
|
790
833
|
className: e = "",
|
|
791
|
-
children: o = /* @__PURE__ */
|
|
834
|
+
children: o = /* @__PURE__ */ d(ft, {}),
|
|
792
835
|
label: r = "닫기",
|
|
793
836
|
size: a = 24,
|
|
794
|
-
disabled:
|
|
795
|
-
onClick:
|
|
796
|
-
...
|
|
837
|
+
disabled: i,
|
|
838
|
+
onClick: h,
|
|
839
|
+
...g
|
|
797
840
|
}) {
|
|
798
|
-
const
|
|
799
|
-
return /* @__PURE__ */
|
|
800
|
-
|
|
841
|
+
const f = le("ModalClose");
|
|
842
|
+
return /* @__PURE__ */ d(
|
|
843
|
+
ht,
|
|
801
844
|
{
|
|
802
|
-
...
|
|
803
|
-
className:
|
|
804
|
-
"aria-label":
|
|
845
|
+
...g,
|
|
846
|
+
className: Ce(y.close, e),
|
|
847
|
+
"aria-label": g["aria-label"] ?? r,
|
|
805
848
|
"data-oc-part": "close",
|
|
806
849
|
"data-oc-component": "modal-close",
|
|
807
|
-
disabled:
|
|
808
|
-
onClick: (
|
|
809
|
-
|
|
850
|
+
disabled: i,
|
|
851
|
+
onClick: (p) => {
|
|
852
|
+
h?.(p), !p.defaultPrevented && !i && f.requestClose({ reason: "close-button" });
|
|
810
853
|
},
|
|
811
854
|
size: a,
|
|
812
855
|
children: o
|
|
813
856
|
}
|
|
814
857
|
);
|
|
815
858
|
}
|
|
816
|
-
const
|
|
817
|
-
Root:
|
|
818
|
-
Trigger:
|
|
819
|
-
Content:
|
|
820
|
-
Header:
|
|
821
|
-
NavigationSection:
|
|
822
|
-
Body:
|
|
823
|
-
Footer:
|
|
824
|
-
Close:
|
|
859
|
+
const Do = Object.assign(Ye, {
|
|
860
|
+
Root: Ye,
|
|
861
|
+
Trigger: Zt,
|
|
862
|
+
Content: eo,
|
|
863
|
+
Header: to,
|
|
864
|
+
NavigationSection: oo,
|
|
865
|
+
Body: no,
|
|
866
|
+
Footer: ro,
|
|
867
|
+
Close: Je
|
|
825
868
|
});
|
|
826
869
|
export {
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
870
|
+
no as ModalBody,
|
|
871
|
+
Je as ModalClose,
|
|
872
|
+
eo as ModalContent,
|
|
873
|
+
ro as ModalFooter,
|
|
874
|
+
to as ModalHeader,
|
|
875
|
+
oo as ModalNavigationSection,
|
|
876
|
+
Ye as ModalRoot,
|
|
877
|
+
Zt as ModalTrigger,
|
|
878
|
+
Do as default
|
|
836
879
|
};
|