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