@orioncactuscorp/ui 1.8.0 → 1.9.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/dist/components/Accordion/Accordion.css +1 -1
- package/dist/components/Button/Button.css +1 -1
- package/dist/components/Checkbox/Checkbox.css +1 -1
- package/dist/components/Modal/Modal.css +1 -1
- package/dist/components/Modal/Modal.js +696 -544
- package/dist/components/Modal/bottomSheetGeometry.js +88 -0
- package/dist/components/Modal/modalScrollArbitration.js +8 -7
- package/dist/components/Modal/snapPoints.js +9 -8
- package/dist/components/Modal/useModalContentBlockTransition.js +64 -0
- package/dist/components/Modal/useModalDrag.js +917 -788
- package/dist/components/Radio/Radio.css +1 -1
- package/dist/components/ScrollArea/ScrollArea.css +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +250 -223
- package/dist/components/ScrollArea/useScrollAreaGeometryStabilizer.js +36 -0
- package/dist/components/TextButton/TextButton.css +1 -1
- package/dist/components/TextButton/TextButton.module.scss.js +8 -6
- package/dist/styles.css +7 -7
- 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/bottomSheetGeometry.d.ts +36 -0
- package/dist/ui/src/components/Modal/bottomSheetGeometry.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/index.d.ts +1 -1
- package/dist/ui/src/components/Modal/index.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/modalScrollArbitration.d.ts +2 -1
- package/dist/ui/src/components/Modal/modalScrollArbitration.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/snapPoints.d.ts +1 -0
- package/dist/ui/src/components/Modal/snapPoints.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/types.d.ts +8 -0
- package/dist/ui/src/components/Modal/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalContentBlockTransition.d.ts +5 -0
- package/dist/ui/src/components/Modal/useModalContentBlockTransition.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/useModalDrag.d.ts +5 -1
- package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -1
- package/dist/ui/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/ui/src/components/ScrollArea/useScrollAreaGeometryStabilizer.d.ts +11 -0
- package/dist/ui/src/components/ScrollArea/useScrollAreaGeometryStabilizer.d.ts.map +1 -0
- package/package.json +2 -1
- package/src/scss/mixins/_element.scss +161 -14
- package/src/scss/mixins/_element.test.ts +94 -5
- package/src/scss/mixins/_icon.scss +27 -0
|
@@ -1,81 +1,128 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { Dialog as
|
|
5
|
-
import
|
|
6
|
-
import { MotionExpand as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { ScrollArea as
|
|
11
|
-
import { DisclosureIndicator as
|
|
12
|
-
import { normalizeSlotIcon as
|
|
13
|
-
import { useModalContext as
|
|
14
|
-
import { useControllableState as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
|
|
2
|
+
import { jsx as s, jsxs as ae } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback as k, useEffect as ne, useRef as $, useState as S, useMemo as xe, useLayoutEffect as ge, useId as at } from "react";
|
|
4
|
+
import { Dialog as O } from "@base-ui-components/react/dialog";
|
|
5
|
+
import rt from "@orioncactuscorp/icons/orioncactus/CloseThick";
|
|
6
|
+
import { MotionExpand as it } from "../../react/motion.js";
|
|
7
|
+
import ct from "../Background/Background.js";
|
|
8
|
+
import st from "../BackgroundIconButton/BackgroundIconButton.js";
|
|
9
|
+
import lt from "../Interaction/Interaction.js";
|
|
10
|
+
import { ScrollArea as Le, ScrollAreaContainer as ze } from "../ScrollArea/ScrollArea.js";
|
|
11
|
+
import { DisclosureIndicator as dt } from "../internal/DisclosureIndicator.js";
|
|
12
|
+
import { normalizeSlotIcon as ut } from "../internal/slot.js";
|
|
13
|
+
import { useModalContext as de, ModalProvider as pt } from "./contexts.js";
|
|
14
|
+
import { useControllableState as je } from "./useControllableState.js";
|
|
15
|
+
import { useModalContentBlockTransition as mt } from "./useModalContentBlockTransition.js";
|
|
16
|
+
import { useMeasuredElement as Te } from "./useElementSize.js";
|
|
17
|
+
import { useModalDrag as ft } from "./useModalDrag.js";
|
|
18
|
+
import { useModalPlacement as ht } from "./useModalPlacement.js";
|
|
19
|
+
import { useModalStackDepth as gt } from "./useModalStackDepth.js";
|
|
20
|
+
import { resolveContentSizedBottomSheetHeight as vt } from "./bottomSheetGeometry.js";
|
|
21
|
+
import { getModalScrollState as bt } from "./modalScrollArbitration.js";
|
|
22
|
+
import { resolveModalSnapMetrics as yt, resolveModalPopupSnapPositions as St } from "./snapPoints.js";
|
|
23
|
+
import i from "./Modal.module.scss.js";
|
|
24
|
+
function B(...e) {
|
|
23
25
|
return e.filter(Boolean).join(" ");
|
|
24
26
|
}
|
|
25
|
-
function
|
|
27
|
+
function $e(e) {
|
|
26
28
|
return e != null && e !== !1 && e !== "";
|
|
27
29
|
}
|
|
28
|
-
function
|
|
30
|
+
function Pe(e, t) {
|
|
29
31
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
30
32
|
}
|
|
31
|
-
function
|
|
33
|
+
function kt(e) {
|
|
32
34
|
if (!e) return;
|
|
33
35
|
const t = Object.entries(e).filter(
|
|
34
|
-
([
|
|
36
|
+
([n]) => n.startsWith("--")
|
|
35
37
|
);
|
|
36
38
|
if (t.length !== 0)
|
|
37
39
|
return Object.fromEntries(t);
|
|
38
40
|
}
|
|
39
|
-
function
|
|
41
|
+
function Ee() {
|
|
42
|
+
return typeof window > "u" ? 0 : window.visualViewport?.height ?? window.innerHeight;
|
|
43
|
+
}
|
|
44
|
+
function Nt(e) {
|
|
45
|
+
const t = e.trim();
|
|
46
|
+
if (!t.endsWith("px")) return;
|
|
47
|
+
const n = Number.parseFloat(t);
|
|
48
|
+
return Number.isFinite(n) && n > 0 ? n : void 0;
|
|
49
|
+
}
|
|
50
|
+
function Ct(e) {
|
|
51
|
+
if (!(!e || typeof window > "u"))
|
|
52
|
+
return Nt(window.getComputedStyle(e).maxHeight);
|
|
53
|
+
}
|
|
54
|
+
function wt({
|
|
55
|
+
contentTransition: e,
|
|
56
|
+
placement: t,
|
|
57
|
+
resize: n
|
|
58
|
+
}) {
|
|
59
|
+
return e !== "auto" || n !== "content" || t === "full" ? "none" : t === "bottom" ? "sheet" : "surface";
|
|
60
|
+
}
|
|
61
|
+
function Ae(e, t) {
|
|
62
|
+
return e.resolvedBackdrop === t ? e : {
|
|
63
|
+
resolvedBackdrop: t,
|
|
64
|
+
exiting: t === "hidden" && e.resolvedBackdrop !== "hidden"
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function Mt(e) {
|
|
68
|
+
const [t, n] = S(Ee);
|
|
69
|
+
return ge(() => {
|
|
70
|
+
if (!e || typeof window > "u") return;
|
|
71
|
+
const a = () => {
|
|
72
|
+
n(Ee());
|
|
73
|
+
};
|
|
74
|
+
return a(), window.addEventListener("resize", a), window.visualViewport?.addEventListener("resize", a), () => {
|
|
75
|
+
window.removeEventListener("resize", a), window.visualViewport?.removeEventListener(
|
|
76
|
+
"resize",
|
|
77
|
+
a
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
}, [e]), t;
|
|
81
|
+
}
|
|
82
|
+
function Ht(e) {
|
|
40
83
|
const t = e.trim();
|
|
41
84
|
return t.endsWith("ms") ? Number.parseFloat(t) || 0 : t.endsWith("s") ? (Number.parseFloat(t) || 0) * 1e3 : 0;
|
|
42
85
|
}
|
|
43
|
-
function
|
|
44
|
-
return e.split(",").reduce((t,
|
|
86
|
+
function ke(e) {
|
|
87
|
+
return e.split(",").reduce((t, n) => Math.max(t, Ht(n)), 0);
|
|
88
|
+
}
|
|
89
|
+
function xt(e) {
|
|
90
|
+
const t = window.getComputedStyle(e), n = ke(t.animationDuration), a = ke(t.animationDelay);
|
|
91
|
+
return n + a + 250;
|
|
45
92
|
}
|
|
46
|
-
function
|
|
47
|
-
const t = window.getComputedStyle(e),
|
|
48
|
-
return
|
|
93
|
+
function Tt(e) {
|
|
94
|
+
const t = window.getComputedStyle(e), n = ke(t.transitionDuration), a = ke(t.transitionDelay);
|
|
95
|
+
return n + a + 250;
|
|
49
96
|
}
|
|
50
|
-
function
|
|
97
|
+
function Pt({
|
|
51
98
|
defaultSnapPosition: e,
|
|
52
99
|
node: t,
|
|
53
|
-
snapPositions:
|
|
100
|
+
snapPositions: n
|
|
54
101
|
}) {
|
|
55
|
-
if (!
|
|
56
|
-
const
|
|
102
|
+
if (!n?.length) return;
|
|
103
|
+
const a = St({
|
|
57
104
|
defaultSnapPosition: e,
|
|
58
|
-
snapPositions:
|
|
105
|
+
snapPositions: n,
|
|
59
106
|
surfaceMotion: t
|
|
60
107
|
});
|
|
61
|
-
if (!
|
|
62
|
-
const
|
|
108
|
+
if (!a) return;
|
|
109
|
+
const d = a.defaultTarget;
|
|
63
110
|
t.style.setProperty(
|
|
64
111
|
"--oc-modal-translate-x",
|
|
65
|
-
|
|
112
|
+
d.settledTranslate?.x ?? `${d.x}px`
|
|
66
113
|
), t.style.setProperty(
|
|
67
114
|
"--oc-modal-translate-y",
|
|
68
|
-
|
|
115
|
+
d.settledTranslate?.y ?? `${d.y}px`
|
|
69
116
|
);
|
|
70
117
|
}
|
|
71
|
-
function
|
|
118
|
+
function Rt(e) {
|
|
72
119
|
if (e && typeof e == "object" && "reason" in e && typeof e.reason == "string")
|
|
73
120
|
return e.reason;
|
|
74
121
|
}
|
|
75
|
-
function
|
|
122
|
+
function Se(e) {
|
|
76
123
|
e && typeof e == "object" && "cancel" in e && typeof e.cancel == "function" && e.cancel();
|
|
77
124
|
}
|
|
78
|
-
function
|
|
125
|
+
function Bt(e, t) {
|
|
79
126
|
switch (t) {
|
|
80
127
|
case "drag-dismiss":
|
|
81
128
|
return e?.drag ?? "auto";
|
|
@@ -93,22 +140,22 @@ function ze(e, t) {
|
|
|
93
140
|
return e?.programmatic ?? "auto";
|
|
94
141
|
}
|
|
95
142
|
}
|
|
96
|
-
function
|
|
143
|
+
function Ft(e, t) {
|
|
97
144
|
return t > 0 && (e === "drag-dismiss" || e === "backdrop-press" || e === "outside-press");
|
|
98
145
|
}
|
|
99
|
-
function
|
|
146
|
+
function Ie(e, t) {
|
|
100
147
|
return t && (e === "backdrop-press" || e === "outside-press");
|
|
101
148
|
}
|
|
102
|
-
function
|
|
149
|
+
function Dt({
|
|
103
150
|
backdrop: e,
|
|
104
151
|
canSnapPopup: t,
|
|
105
|
-
placement:
|
|
106
|
-
presentationState:
|
|
152
|
+
placement: n,
|
|
153
|
+
presentationState: a
|
|
107
154
|
}) {
|
|
108
|
-
return e !== "auto" ? e :
|
|
155
|
+
return e !== "auto" ? e : n === "bottom" && a === "peeked" || t ? "hidden" : "visible";
|
|
109
156
|
}
|
|
110
|
-
function
|
|
111
|
-
switch (
|
|
157
|
+
function Et(e) {
|
|
158
|
+
switch (Rt(e)) {
|
|
112
159
|
case "close-press":
|
|
113
160
|
return "close-button";
|
|
114
161
|
case "outside-press":
|
|
@@ -123,380 +170,485 @@ function _e(e) {
|
|
|
123
170
|
return "programmatic";
|
|
124
171
|
}
|
|
125
172
|
}
|
|
126
|
-
function
|
|
173
|
+
function At(e) {
|
|
127
174
|
return e >= 2 && e <= 6;
|
|
128
175
|
}
|
|
129
|
-
function
|
|
176
|
+
function Ve({
|
|
130
177
|
children: e,
|
|
131
178
|
open: t,
|
|
132
|
-
defaultOpen:
|
|
133
|
-
modal:
|
|
134
|
-
onOpenChange:
|
|
135
|
-
canCloseAttempt:
|
|
136
|
-
onCloseAttempt:
|
|
137
|
-
presentationState:
|
|
138
|
-
defaultPresentationState:
|
|
139
|
-
onPresentationStateChange:
|
|
140
|
-
disablePointerDismissal:
|
|
141
|
-
navigationDepth:
|
|
142
|
-
dismissBehavior:
|
|
179
|
+
defaultOpen: n,
|
|
180
|
+
modal: a = !0,
|
|
181
|
+
onOpenChange: d,
|
|
182
|
+
canCloseAttempt: w,
|
|
183
|
+
onCloseAttempt: f,
|
|
184
|
+
presentationState: h,
|
|
185
|
+
defaultPresentationState: N = "visible",
|
|
186
|
+
onPresentationStateChange: C,
|
|
187
|
+
disablePointerDismissal: g,
|
|
188
|
+
navigationDepth: m = 0,
|
|
189
|
+
dismissBehavior: F
|
|
143
190
|
}) {
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
),
|
|
191
|
+
const l = t !== void 0, [x, q] = S(
|
|
192
|
+
n ?? !1
|
|
193
|
+
), K = l ? t : x, [Q, X] = S("bottom"), [Y, o] = S(!1), [L, W] = S(!1), [z, u] = S(!1), [v, re] = S(!1), [U, Z] = S(0), [_, ue] = S(0), [ie, pe] = S(null), [j, P] = S({
|
|
147
194
|
canScroll: !1,
|
|
148
195
|
scrolledFromTop: !1,
|
|
149
196
|
scrolledToBottom: !0
|
|
150
|
-
}), [
|
|
151
|
-
value:
|
|
152
|
-
defaultValue:
|
|
153
|
-
onChange:
|
|
154
|
-
}),
|
|
155
|
-
(
|
|
156
|
-
|
|
197
|
+
}), [b, D] = je({
|
|
198
|
+
value: h,
|
|
199
|
+
defaultValue: N,
|
|
200
|
+
onChange: C
|
|
201
|
+
}), G = Te(), E = Te(), ee = Math.max(0, m), M = k(
|
|
202
|
+
(r, y) => {
|
|
203
|
+
l || q(r), d?.(r, y);
|
|
157
204
|
},
|
|
158
|
-
[
|
|
159
|
-
),
|
|
160
|
-
(
|
|
161
|
-
[
|
|
162
|
-
),
|
|
163
|
-
(
|
|
164
|
-
|
|
205
|
+
[d, l]
|
|
206
|
+
), p = k(
|
|
207
|
+
(r = { reason: "programmatic" }) => w?.(r) !== !1,
|
|
208
|
+
[w]
|
|
209
|
+
), R = k(
|
|
210
|
+
(r = { reason: "programmatic" }) => {
|
|
211
|
+
Z((y) => y + 1);
|
|
165
212
|
},
|
|
166
213
|
[]
|
|
167
|
-
),
|
|
168
|
-
|
|
169
|
-
}, []),
|
|
170
|
-
(
|
|
171
|
-
if (
|
|
214
|
+
), te = k(() => {
|
|
215
|
+
ue((r) => r + 1);
|
|
216
|
+
}, []), A = k(
|
|
217
|
+
(r = { reason: "programmatic" }) => {
|
|
218
|
+
if (Ie(r.reason, z))
|
|
172
219
|
return !1;
|
|
173
|
-
const
|
|
174
|
-
return
|
|
220
|
+
const y = Bt(F, r.reason);
|
|
221
|
+
return y === "allow" ? !0 : y === "block" ? !1 : !Ft(r.reason, ee);
|
|
175
222
|
},
|
|
176
|
-
[
|
|
177
|
-
),
|
|
178
|
-
(
|
|
179
|
-
const { commit:
|
|
180
|
-
return !
|
|
223
|
+
[z, F, ee]
|
|
224
|
+
), I = k(
|
|
225
|
+
(r = { reason: "programmatic" }, y = {}) => {
|
|
226
|
+
const { commit: Ne = !0, skipAttempt: T = !1 } = y;
|
|
227
|
+
return !T && Ie(r.reason, z) ? (Se(r.eventDetails), !1) : !T && !A(r) || !T && !p(r) || !T && f?.(r) === !1 ? (Se(r.eventDetails), R(r), !1) : (Ne && M(!1, r.eventDetails), !0);
|
|
181
228
|
},
|
|
182
229
|
[
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
j,
|
|
186
|
-
v,
|
|
230
|
+
p,
|
|
231
|
+
z,
|
|
187
232
|
A,
|
|
188
|
-
|
|
233
|
+
M,
|
|
234
|
+
R,
|
|
235
|
+
f
|
|
189
236
|
]
|
|
190
|
-
),
|
|
191
|
-
(
|
|
192
|
-
if (
|
|
193
|
-
|
|
194
|
-
reason:
|
|
195
|
-
eventDetails:
|
|
237
|
+
), ce = k(
|
|
238
|
+
(r, y) => {
|
|
239
|
+
if (r && b === "peeked" && D("visible"), !r) {
|
|
240
|
+
I({
|
|
241
|
+
reason: Et(y),
|
|
242
|
+
eventDetails: y
|
|
196
243
|
});
|
|
197
244
|
return;
|
|
198
245
|
}
|
|
199
|
-
|
|
246
|
+
M(r, y);
|
|
200
247
|
},
|
|
201
|
-
[
|
|
202
|
-
),
|
|
248
|
+
[M, b, I, D]
|
|
249
|
+
), V = b === "visible" && !v ? a : !1, J = g || Q === "bottom" && Y, ve = xe(
|
|
203
250
|
() => ({
|
|
204
|
-
open:
|
|
205
|
-
placement:
|
|
206
|
-
setPlacement:
|
|
207
|
-
presentationState:
|
|
208
|
-
setPresentationState:
|
|
209
|
-
requestClose:
|
|
210
|
-
canDismissByBehavior:
|
|
211
|
-
canCloseAttempt:
|
|
212
|
-
closeAttemptFeedbackKey:
|
|
213
|
-
notifyCloseAttemptRejected:
|
|
214
|
-
disablePointerDismissal:
|
|
215
|
-
setBackdropDismissalDisabled:
|
|
216
|
-
setBackgroundInteractive:
|
|
217
|
-
canPeek:
|
|
218
|
-
setCanPeek:
|
|
219
|
-
canRenderHandle:
|
|
220
|
-
setCanRenderHandle:
|
|
221
|
-
popupSnapLayoutVersion:
|
|
222
|
-
notifyPopupSnapLayoutChange:
|
|
223
|
-
headerHeight:
|
|
224
|
-
footerHeight:
|
|
225
|
-
setHeaderNode:
|
|
226
|
-
setFooterNode:
|
|
227
|
-
bodyNode:
|
|
228
|
-
setBodyNode:
|
|
229
|
-
scrollState:
|
|
230
|
-
setScrollState:
|
|
251
|
+
open: K,
|
|
252
|
+
placement: Q,
|
|
253
|
+
setPlacement: X,
|
|
254
|
+
presentationState: b,
|
|
255
|
+
setPresentationState: D,
|
|
256
|
+
requestClose: I,
|
|
257
|
+
canDismissByBehavior: A,
|
|
258
|
+
canCloseAttempt: p,
|
|
259
|
+
closeAttemptFeedbackKey: U,
|
|
260
|
+
notifyCloseAttemptRejected: R,
|
|
261
|
+
disablePointerDismissal: g ?? !1,
|
|
262
|
+
setBackdropDismissalDisabled: u,
|
|
263
|
+
setBackgroundInteractive: re,
|
|
264
|
+
canPeek: Y,
|
|
265
|
+
setCanPeek: o,
|
|
266
|
+
canRenderHandle: L,
|
|
267
|
+
setCanRenderHandle: W,
|
|
268
|
+
popupSnapLayoutVersion: _,
|
|
269
|
+
notifyPopupSnapLayoutChange: te,
|
|
270
|
+
headerHeight: G.height,
|
|
271
|
+
footerHeight: E.height,
|
|
272
|
+
setHeaderNode: G.setNode,
|
|
273
|
+
setFooterNode: E.setNode,
|
|
274
|
+
bodyNode: ie,
|
|
275
|
+
setBodyNode: pe,
|
|
276
|
+
scrollState: j,
|
|
277
|
+
setScrollState: P
|
|
231
278
|
}),
|
|
232
279
|
[
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
j,
|
|
237
|
-
E,
|
|
238
|
-
z,
|
|
239
|
-
M.height,
|
|
240
|
-
M.setNode,
|
|
241
|
-
x.height,
|
|
242
|
-
x.setNode,
|
|
280
|
+
ie,
|
|
281
|
+
Y,
|
|
282
|
+
L,
|
|
243
283
|
A,
|
|
244
|
-
|
|
245
|
-
S,
|
|
246
|
-
O,
|
|
247
|
-
q,
|
|
248
|
-
_,
|
|
284
|
+
p,
|
|
249
285
|
U,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
286
|
+
E.height,
|
|
287
|
+
E.setNode,
|
|
288
|
+
G.height,
|
|
289
|
+
G.setNode,
|
|
290
|
+
R,
|
|
291
|
+
te,
|
|
292
|
+
_,
|
|
293
|
+
K,
|
|
294
|
+
Q,
|
|
295
|
+
I,
|
|
296
|
+
j,
|
|
297
|
+
g,
|
|
298
|
+
b,
|
|
299
|
+
D
|
|
253
300
|
]
|
|
254
301
|
);
|
|
255
|
-
return /* @__PURE__ */
|
|
256
|
-
|
|
302
|
+
return /* @__PURE__ */ s(pt, { value: ve, children: /* @__PURE__ */ s(
|
|
303
|
+
O.Root,
|
|
257
304
|
{
|
|
258
|
-
open:
|
|
259
|
-
modal:
|
|
260
|
-
onOpenChange:
|
|
261
|
-
disablePointerDismissal:
|
|
305
|
+
open: K,
|
|
306
|
+
modal: V,
|
|
307
|
+
onOpenChange: ce,
|
|
308
|
+
disablePointerDismissal: J,
|
|
262
309
|
children: e
|
|
263
310
|
}
|
|
264
311
|
) });
|
|
265
312
|
}
|
|
266
|
-
function
|
|
313
|
+
function It({
|
|
267
314
|
className: e = "",
|
|
268
315
|
children: t,
|
|
269
|
-
render:
|
|
270
|
-
nativeButton:
|
|
316
|
+
render: n,
|
|
317
|
+
nativeButton: a
|
|
271
318
|
}) {
|
|
272
|
-
return
|
|
273
|
-
|
|
319
|
+
return n ? /* @__PURE__ */ s(
|
|
320
|
+
O.Trigger,
|
|
274
321
|
{
|
|
275
|
-
render:
|
|
276
|
-
nativeButton:
|
|
322
|
+
render: n,
|
|
323
|
+
nativeButton: a,
|
|
277
324
|
"data-oc-component": "modal-trigger",
|
|
278
325
|
children: t
|
|
279
326
|
}
|
|
280
|
-
) : /* @__PURE__ */
|
|
281
|
-
|
|
327
|
+
) : /* @__PURE__ */ s(
|
|
328
|
+
O.Trigger,
|
|
282
329
|
{
|
|
283
|
-
className:
|
|
284
|
-
nativeButton:
|
|
330
|
+
className: B(i.trigger, e),
|
|
331
|
+
nativeButton: a,
|
|
285
332
|
"data-oc-component": "modal-trigger",
|
|
286
333
|
children: t
|
|
287
334
|
}
|
|
288
335
|
);
|
|
289
336
|
}
|
|
290
|
-
function
|
|
337
|
+
function Vt({
|
|
291
338
|
className: e = "",
|
|
292
339
|
children: t,
|
|
293
|
-
variant:
|
|
294
|
-
size:
|
|
295
|
-
resize:
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
340
|
+
variant: n = "adaptive",
|
|
341
|
+
size: a = "medium",
|
|
342
|
+
resize: d = "content",
|
|
343
|
+
contentTransition: w = "auto",
|
|
344
|
+
backdrop: f = "auto",
|
|
345
|
+
drag: h = "content",
|
|
346
|
+
peekable: N = !1,
|
|
347
|
+
snapPoints: C,
|
|
348
|
+
defaultSnapPoint: g,
|
|
349
|
+
snapPositions: m,
|
|
350
|
+
defaultSnapPosition: F,
|
|
351
|
+
initialFocus: l,
|
|
352
|
+
peekHeight: x,
|
|
353
|
+
closeThreshold: q,
|
|
354
|
+
scrollLockTimeout: K,
|
|
355
|
+
container: Q,
|
|
356
|
+
style: X,
|
|
357
|
+
...Y
|
|
310
358
|
}) {
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
359
|
+
const o = de("ModalContent"), { setCanPeek: L, setCanRenderHandle: W, setPlacement: z } = o, u = ht(n), v = $(null), re = $(null), U = $(null), Z = $(null), [_, ue] = S(null), [ie, pe] = S(
|
|
360
|
+
null
|
|
361
|
+
), j = $(0), P = $(null), b = $(null), D = $(null), [G, E] = S(), ee = h === "handle" || h === "content", M = u === "popup" && ee && !!m?.length, p = Dt({
|
|
362
|
+
backdrop: f,
|
|
363
|
+
canSnapPopup: M,
|
|
364
|
+
placement: u,
|
|
365
|
+
presentationState: o.presentationState
|
|
366
|
+
}), [R, te] = S(() => ({
|
|
367
|
+
resolvedBackdrop: p,
|
|
368
|
+
exiting: !1
|
|
369
|
+
})), A = xe(
|
|
370
|
+
() => Ae(R, p),
|
|
371
|
+
[R, p]
|
|
372
|
+
), I = A.exiting, ce = M && p === "hidden", V = (u === "bottom" || M) && ee, J = u === "bottom" && V && N, ve = J && x !== void 0 ? x : o.headerHeight > 0 ? o.headerHeight : void 0, r = u === "bottom" && d !== "fixed", y = Mt(
|
|
373
|
+
!!C?.length || r
|
|
374
|
+
), Ne = xe(() => {
|
|
375
|
+
if (!(!C?.length || y <= 0))
|
|
376
|
+
return yt({
|
|
377
|
+
snapPoints: C,
|
|
378
|
+
defaultSnapPoint: g,
|
|
379
|
+
viewportHeight: y
|
|
322
380
|
});
|
|
323
|
-
}, [
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
381
|
+
}, [g, C, y]), T = u === "bottom" ? Ne : void 0, qe = gt(o.open), [be, Ke] = S(0), ye = $(!1), We = T !== void 0 && r, Ce = r && be > 0 ? be : void 0, oe = T ? We && Ce !== void 0 ? Ce : T.sheetHeight : Ce, Ue = T && oe !== void 0 ? Math.max(0, oe - T.defaultHeight) : void 0, _e = oe !== void 0, we = wt({
|
|
382
|
+
contentTransition: w,
|
|
383
|
+
placement: u,
|
|
384
|
+
resize: d
|
|
385
|
+
}), Ge = we === "surface" ? "auto" : "none", Je = we === "sheet" ? "auto" : "none", Re = o.bodyNode;
|
|
386
|
+
mt({
|
|
387
|
+
enabled: o.open && we === "surface",
|
|
388
|
+
node: ie
|
|
389
|
+
}), ge(() => {
|
|
390
|
+
if (!r) {
|
|
391
|
+
ye.current = !1;
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
const c = Re?.firstElementChild;
|
|
395
|
+
if (!c) {
|
|
396
|
+
ye.current = !1;
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
const H = () => {
|
|
400
|
+
const le = c.getBoundingClientRect().height, he = vt({
|
|
401
|
+
contentHeight: le,
|
|
402
|
+
maxHeight: Ct(_),
|
|
403
|
+
snapHeight: T?.sheetHeight
|
|
404
|
+
}), De = Math.abs(be - he) > 0.5;
|
|
405
|
+
ye.current = De, De && Ke(he);
|
|
406
|
+
};
|
|
407
|
+
if (H(), typeof ResizeObserver > "u") return;
|
|
408
|
+
const fe = new ResizeObserver(H);
|
|
409
|
+
return fe.observe(c), () => fe.disconnect();
|
|
410
|
+
}, [
|
|
411
|
+
Re,
|
|
412
|
+
r,
|
|
413
|
+
T?.sheetHeight,
|
|
414
|
+
be,
|
|
415
|
+
y,
|
|
416
|
+
_
|
|
417
|
+
]), ne(() => {
|
|
418
|
+
z(u);
|
|
419
|
+
}, [u, z]), ne(() => {
|
|
420
|
+
o.open || (Z.current = null);
|
|
421
|
+
}, [o.open]), ne(() => (L(J), () => L(!1)), [J, L]), ne(() => (W(V), () => W(!1)), [V, W]);
|
|
422
|
+
const Qe = k(
|
|
423
|
+
() => ye.current,
|
|
424
|
+
[]
|
|
425
|
+
), Xe = ft({
|
|
426
|
+
enabled: h !== !1,
|
|
427
|
+
drag: h,
|
|
428
|
+
open: o.open,
|
|
429
|
+
placement: u,
|
|
430
|
+
surfaceMotionRef: v,
|
|
431
|
+
surfaceMotionNode: _,
|
|
432
|
+
backdropRef: U,
|
|
433
|
+
bodyNode: o.bodyNode,
|
|
434
|
+
snapHeights: T?.snapHeights,
|
|
435
|
+
sheetHeight: oe,
|
|
436
|
+
peekHeight: J ? x : void 0,
|
|
437
|
+
peekFallback: J ? "header" : void 0,
|
|
438
|
+
presentationState: o.presentationState,
|
|
439
|
+
setPresentationState: o.setPresentationState,
|
|
440
|
+
requestClose: o.requestClose,
|
|
441
|
+
canCloseAttempt: o.canCloseAttempt,
|
|
442
|
+
dismissible: !o.disablePointerDismissal && o.canDismissByBehavior({ reason: "drag-dismiss" }),
|
|
443
|
+
preserveShadowOpacity: p === "hidden",
|
|
444
|
+
visibleTranslate: Ue,
|
|
445
|
+
shouldDeferBottomSettle: Qe,
|
|
446
|
+
snapPositions: M ? m : void 0,
|
|
447
|
+
defaultSnapPosition: F,
|
|
448
|
+
closeThreshold: q,
|
|
449
|
+
scrollLockTimeout: K,
|
|
450
|
+
popupSnapLayoutVersion: o.popupSnapLayoutVersion
|
|
451
|
+
}), Ye = k(
|
|
452
|
+
(c) => {
|
|
453
|
+
v.current = c, ue(c), c && o.open && M && Z.current !== c && (Pt({
|
|
454
|
+
defaultSnapPosition: F,
|
|
455
|
+
node: c,
|
|
456
|
+
snapPositions: m
|
|
457
|
+
}), Z.current = c);
|
|
358
458
|
},
|
|
359
|
-
[
|
|
360
|
-
)
|
|
459
|
+
[M, o.open, F, m]
|
|
460
|
+
), Ze = k((c) => {
|
|
461
|
+
re.current = c, pe(c);
|
|
462
|
+
}, []);
|
|
361
463
|
ne(() => {
|
|
362
|
-
const
|
|
363
|
-
if (
|
|
364
|
-
|
|
464
|
+
const c = o.closeAttemptFeedbackKey;
|
|
465
|
+
if (c === 0 || u !== "popup" || j.current === c) {
|
|
466
|
+
j.current = c, E(void 0);
|
|
365
467
|
return;
|
|
366
468
|
}
|
|
367
|
-
const
|
|
368
|
-
if (!
|
|
369
|
-
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
},
|
|
373
|
-
|
|
469
|
+
const H = re.current;
|
|
470
|
+
if (!H) return;
|
|
471
|
+
j.current = c, P.current !== null && window.cancelAnimationFrame(P.current), b.current !== null && window.clearTimeout(b.current), E(void 0);
|
|
472
|
+
const fe = () => {
|
|
473
|
+
E(void 0), b.current = null;
|
|
474
|
+
}, le = (he) => {
|
|
475
|
+
he.target === H && he.animationName === "oc-modal-reject-shake" && (H.removeEventListener("animationend", le), b.current !== null && window.clearTimeout(b.current), fe());
|
|
374
476
|
};
|
|
375
|
-
return
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
},
|
|
477
|
+
return H.addEventListener("animationend", le), P.current = window.requestAnimationFrame(() => {
|
|
478
|
+
P.current = null, E("reject"), P.current = window.requestAnimationFrame(() => {
|
|
479
|
+
P.current = null, b.current = window.setTimeout(() => {
|
|
480
|
+
H.removeEventListener("animationend", le), fe();
|
|
481
|
+
}, xt(H));
|
|
380
482
|
});
|
|
381
483
|
}), () => {
|
|
382
|
-
|
|
484
|
+
H.removeEventListener("animationend", le), P.current !== null && (window.cancelAnimationFrame(P.current), P.current = null), b.current !== null && (window.clearTimeout(b.current), b.current = null);
|
|
383
485
|
};
|
|
384
|
-
}, [
|
|
385
|
-
const
|
|
386
|
-
...
|
|
387
|
-
...
|
|
388
|
-
...
|
|
389
|
-
...
|
|
390
|
-
...
|
|
391
|
-
|
|
392
|
-
|
|
486
|
+
}, [o.closeAttemptFeedbackKey, u]);
|
|
487
|
+
const Be = kt(X), et = {
|
|
488
|
+
...Be,
|
|
489
|
+
...o.headerHeight > 0 ? { "--oc-modal-header-height": `${o.headerHeight}px` } : {},
|
|
490
|
+
...o.footerHeight > 0 ? { "--oc-modal-footer-height": `${o.footerHeight}px` } : {},
|
|
491
|
+
...ve !== void 0 ? { "--oc-modal-peek-height": `${ve}px` } : {},
|
|
492
|
+
...oe !== void 0 ? {
|
|
493
|
+
"--oc-modal-sheet-height": `${oe}px`,
|
|
494
|
+
height: `${oe}px`
|
|
393
495
|
} : {}
|
|
394
|
-
|
|
496
|
+
// `--oc-modal-translate-y` is owned imperatively by the drag hook. With
|
|
497
|
+
// content-hug snapping the resting position depends on the measured content
|
|
498
|
+
// height, and setting it here would let a re-render clobber a settled or
|
|
499
|
+
// peeked sheet.
|
|
500
|
+
}, Fe = {
|
|
395
501
|
// Each modal reserves one backdrop slot and one viewport slot.
|
|
396
|
-
"--oc-modal-stack-offset":
|
|
397
|
-
},
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
|
|
502
|
+
"--oc-modal-stack-offset": qe * 2
|
|
503
|
+
}, tt = o.headerHeight > 0 ? {
|
|
504
|
+
...X,
|
|
505
|
+
"--oc-modal-header-height": `${o.headerHeight}px`
|
|
506
|
+
} : X, ot = l === "content" ? v : l, { setBackdropDismissalDisabled: Me, setBackgroundInteractive: He } = o, nt = p !== "hidden" || I;
|
|
507
|
+
ge(() => {
|
|
508
|
+
A !== R && te(A);
|
|
509
|
+
}, [R, A]);
|
|
510
|
+
const se = k(() => {
|
|
511
|
+
D.current !== null && (window.clearTimeout(D.current), D.current = null);
|
|
512
|
+
}, []), me = k(() => {
|
|
513
|
+
p === "hidden" && (se(), te((c) => {
|
|
514
|
+
const H = Ae(
|
|
515
|
+
c,
|
|
516
|
+
p
|
|
517
|
+
);
|
|
518
|
+
return H.resolvedBackdrop !== "hidden" || !H.exiting ? H : {
|
|
519
|
+
...H,
|
|
520
|
+
exiting: !1
|
|
521
|
+
};
|
|
522
|
+
}));
|
|
523
|
+
}, [se, p]);
|
|
524
|
+
return ne(
|
|
525
|
+
() => () => {
|
|
526
|
+
se();
|
|
527
|
+
},
|
|
528
|
+
[se]
|
|
529
|
+
), ge(() => {
|
|
530
|
+
if (!I || p !== "hidden") return;
|
|
531
|
+
const c = U.current;
|
|
532
|
+
if (!c) {
|
|
533
|
+
D.current = window.setTimeout(me, 0);
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
se(), D.current = window.setTimeout(
|
|
537
|
+
me,
|
|
538
|
+
Tt(c)
|
|
539
|
+
);
|
|
540
|
+
}, [
|
|
403
541
|
se,
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
542
|
+
me,
|
|
543
|
+
I,
|
|
544
|
+
p
|
|
545
|
+
]), ge(() => (Me(p === "hidden"), He(ce), () => {
|
|
546
|
+
Me(!1), He(!1);
|
|
547
|
+
}), [
|
|
548
|
+
ce,
|
|
549
|
+
p,
|
|
550
|
+
Me,
|
|
551
|
+
He
|
|
552
|
+
]), /* @__PURE__ */ ae(O.Portal, { container: Q, children: [
|
|
553
|
+
nt ? /* @__PURE__ */ s(
|
|
554
|
+
O.Backdrop,
|
|
408
555
|
{
|
|
409
|
-
ref:
|
|
410
|
-
className:
|
|
556
|
+
ref: U,
|
|
557
|
+
className: i.backdrop,
|
|
411
558
|
"data-oc-part": "backdrop",
|
|
412
559
|
"data-oc-component": "modal-backdrop",
|
|
413
|
-
"data-oc-modal-backdrop":
|
|
414
|
-
"data-oc-modal-placement":
|
|
415
|
-
"data-oc-modal-presentation-state":
|
|
416
|
-
style:
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
560
|
+
"data-oc-modal-backdrop": p,
|
|
561
|
+
"data-oc-modal-placement": u,
|
|
562
|
+
"data-oc-modal-presentation-state": o.presentationState,
|
|
563
|
+
style: Fe,
|
|
564
|
+
onTransitionCancel: (c) => {
|
|
565
|
+
c.currentTarget === c.target && c.propertyName === "opacity" && me();
|
|
566
|
+
},
|
|
567
|
+
onTransitionEnd: (c) => {
|
|
568
|
+
c.currentTarget === c.target && c.propertyName === "opacity" && me();
|
|
569
|
+
},
|
|
570
|
+
onClick: () => {
|
|
571
|
+
if (o.disablePointerDismissal) {
|
|
572
|
+
o.notifyCloseAttemptRejected({ reason: "backdrop-press" });
|
|
424
573
|
return;
|
|
425
574
|
}
|
|
426
|
-
if (!
|
|
427
|
-
|
|
575
|
+
if (!o.canDismissByBehavior({ reason: "backdrop-press" })) {
|
|
576
|
+
o.notifyCloseAttemptRejected({ reason: "backdrop-press" });
|
|
428
577
|
return;
|
|
429
578
|
}
|
|
430
|
-
if (
|
|
431
|
-
|
|
579
|
+
if (u === "bottom" && J) {
|
|
580
|
+
o.presentationState === "visible" && o.setPresentationState("peeked");
|
|
432
581
|
return;
|
|
433
582
|
}
|
|
434
|
-
|
|
583
|
+
o.requestClose({ reason: "backdrop-press" });
|
|
435
584
|
}
|
|
436
585
|
}
|
|
437
|
-
),
|
|
438
|
-
/* @__PURE__ */
|
|
439
|
-
|
|
586
|
+
) : null,
|
|
587
|
+
/* @__PURE__ */ s(
|
|
588
|
+
O.Viewport,
|
|
440
589
|
{
|
|
441
|
-
className:
|
|
590
|
+
className: i.viewport,
|
|
442
591
|
"data-oc-part": "viewport",
|
|
443
592
|
"data-oc-component": "modal-viewport",
|
|
444
|
-
"data-oc-modal-placement":
|
|
445
|
-
style:
|
|
446
|
-
children: /* @__PURE__ */
|
|
447
|
-
|
|
593
|
+
"data-oc-modal-placement": u,
|
|
594
|
+
style: Fe,
|
|
595
|
+
children: /* @__PURE__ */ ae(
|
|
596
|
+
O.Popup,
|
|
448
597
|
{
|
|
449
|
-
...
|
|
450
|
-
...
|
|
451
|
-
ref:
|
|
452
|
-
initialFocus:
|
|
453
|
-
className:
|
|
454
|
-
|
|
455
|
-
|
|
598
|
+
...Y,
|
|
599
|
+
...Xe,
|
|
600
|
+
ref: Ye,
|
|
601
|
+
initialFocus: ot,
|
|
602
|
+
className: B(
|
|
603
|
+
i.surfaceMotion,
|
|
604
|
+
i[a],
|
|
456
605
|
e
|
|
457
606
|
),
|
|
458
607
|
"data-oc-part": "surface-motion",
|
|
459
608
|
"data-oc-component": "modal-content",
|
|
460
|
-
"data-oc-modal-backdrop":
|
|
461
|
-
"data-oc-variant":
|
|
462
|
-
"data-oc-size":
|
|
463
|
-
"data-oc-resize":
|
|
464
|
-
"data-oc-modal-feedback":
|
|
465
|
-
"data-oc-modal-placement":
|
|
466
|
-
"data-oc-modal-snapping":
|
|
467
|
-
|
|
609
|
+
"data-oc-modal-backdrop": p,
|
|
610
|
+
"data-oc-variant": n,
|
|
611
|
+
"data-oc-size": a,
|
|
612
|
+
"data-oc-resize": d,
|
|
613
|
+
"data-oc-modal-feedback": u === "popup" ? G : void 0,
|
|
614
|
+
"data-oc-modal-placement": u,
|
|
615
|
+
"data-oc-modal-snapping": T || M ? "true" : void 0,
|
|
616
|
+
"data-oc-modal-sheet-sizing": _e ? "managed" : void 0,
|
|
617
|
+
"data-oc-modal-sheet-transition": Je === "auto" ? "auto" : void 0,
|
|
618
|
+
style: et,
|
|
468
619
|
children: [
|
|
469
|
-
|
|
620
|
+
u === "bottom" ? /* @__PURE__ */ s(
|
|
470
621
|
"div",
|
|
471
622
|
{
|
|
472
623
|
"aria-hidden": "true",
|
|
473
|
-
className:
|
|
474
|
-
|
|
475
|
-
|
|
624
|
+
className: B(
|
|
625
|
+
i.bottomFill,
|
|
626
|
+
i[a],
|
|
476
627
|
e
|
|
477
628
|
),
|
|
478
629
|
"data-oc-part": "bottom-fill",
|
|
479
630
|
"data-oc-component": "modal-bottom-fill",
|
|
480
|
-
"data-oc-size":
|
|
481
|
-
style:
|
|
631
|
+
"data-oc-size": a,
|
|
632
|
+
style: Be
|
|
482
633
|
}
|
|
483
634
|
) : null,
|
|
484
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ s(
|
|
485
636
|
"div",
|
|
486
637
|
{
|
|
487
|
-
ref:
|
|
488
|
-
className:
|
|
489
|
-
|
|
490
|
-
|
|
638
|
+
ref: Ze,
|
|
639
|
+
className: B(
|
|
640
|
+
i.surface,
|
|
641
|
+
i[d],
|
|
491
642
|
e
|
|
492
643
|
),
|
|
493
644
|
"data-oc-part": "surface",
|
|
494
|
-
"data-oc-variant":
|
|
495
|
-
"data-oc-size":
|
|
496
|
-
"data-oc-resize":
|
|
497
|
-
"data-oc-
|
|
498
|
-
"data-oc-
|
|
499
|
-
|
|
645
|
+
"data-oc-variant": n,
|
|
646
|
+
"data-oc-size": a,
|
|
647
|
+
"data-oc-resize": d,
|
|
648
|
+
"data-oc-content-transition": Ge === "auto" ? "auto" : void 0,
|
|
649
|
+
"data-oc-modal-placement": u,
|
|
650
|
+
"data-oc-scrollable": o.scrollState.canScroll ? "true" : "false",
|
|
651
|
+
style: tt,
|
|
500
652
|
children: t
|
|
501
653
|
}
|
|
502
654
|
)
|
|
@@ -507,59 +659,59 @@ function Qe({
|
|
|
507
659
|
)
|
|
508
660
|
] });
|
|
509
661
|
}
|
|
510
|
-
function
|
|
662
|
+
function Lt({
|
|
511
663
|
className: e = "",
|
|
512
664
|
title: t,
|
|
513
|
-
children:
|
|
514
|
-
leadingContent:
|
|
515
|
-
trailingContent:
|
|
516
|
-
closeLabel:
|
|
517
|
-
closeButton:
|
|
518
|
-
handle:
|
|
519
|
-
ref:
|
|
520
|
-
...
|
|
665
|
+
children: n,
|
|
666
|
+
leadingContent: a,
|
|
667
|
+
trailingContent: d,
|
|
668
|
+
closeLabel: w = "닫기",
|
|
669
|
+
closeButton: f = !0,
|
|
670
|
+
handle: h = !0,
|
|
671
|
+
ref: N,
|
|
672
|
+
...C
|
|
521
673
|
}) {
|
|
522
|
-
const
|
|
523
|
-
(
|
|
524
|
-
|
|
674
|
+
const g = de("ModalHeader"), { setHeaderNode: m, scrollState: F } = g, l = k(
|
|
675
|
+
(q) => {
|
|
676
|
+
m(q), Pe(N, q);
|
|
525
677
|
},
|
|
526
|
-
[
|
|
527
|
-
),
|
|
528
|
-
return /* @__PURE__ */
|
|
529
|
-
|
|
678
|
+
[N, m]
|
|
679
|
+
), x = $e(a);
|
|
680
|
+
return /* @__PURE__ */ ae(
|
|
681
|
+
ct,
|
|
530
682
|
{
|
|
531
|
-
...
|
|
683
|
+
...C,
|
|
532
684
|
as: "header",
|
|
533
|
-
ref:
|
|
685
|
+
ref: l,
|
|
534
686
|
backdrop: "compact",
|
|
535
|
-
className:
|
|
687
|
+
className: B(i.header, e),
|
|
536
688
|
backColor: "var(--oc-color-theme-background-elevated-normal)",
|
|
537
689
|
frontColor: "transparent",
|
|
538
690
|
"data-oc-part": "header",
|
|
539
691
|
"data-oc-component": "modal-header",
|
|
540
692
|
variant: "strong",
|
|
541
|
-
"data-oc-sticky":
|
|
693
|
+
"data-oc-sticky": F.scrolledFromTop ? "true" : "false",
|
|
542
694
|
children: [
|
|
543
|
-
|
|
695
|
+
h && g.canRenderHandle ? /* @__PURE__ */ s(
|
|
544
696
|
"div",
|
|
545
697
|
{
|
|
546
698
|
"aria-hidden": "true",
|
|
547
|
-
className:
|
|
699
|
+
className: i.handle,
|
|
548
700
|
"data-oc-part": "handle"
|
|
549
701
|
}
|
|
550
702
|
) : null,
|
|
551
|
-
/* @__PURE__ */
|
|
703
|
+
/* @__PURE__ */ ae(
|
|
552
704
|
"div",
|
|
553
705
|
{
|
|
554
|
-
className:
|
|
555
|
-
"data-oc-has-leading":
|
|
706
|
+
className: i.headerInner,
|
|
707
|
+
"data-oc-has-leading": x ? "true" : "false",
|
|
556
708
|
"data-oc-part": "header-inner",
|
|
557
709
|
children: [
|
|
558
|
-
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
-
/* @__PURE__ */
|
|
561
|
-
|
|
562
|
-
|
|
710
|
+
x ? /* @__PURE__ */ s("div", { className: i.headerLeading, "data-oc-part": "header-leading", children: a }) : null,
|
|
711
|
+
/* @__PURE__ */ s("div", { className: i.headerTitle, "data-oc-part": "header-title", children: t ? /* @__PURE__ */ s(O.Title, { children: t }) : n }),
|
|
712
|
+
/* @__PURE__ */ ae("div", { className: i.headerTrailing, "data-oc-part": "header-trailing", children: [
|
|
713
|
+
d,
|
|
714
|
+
f ? /* @__PURE__ */ s(Oe, { label: w }) : null
|
|
563
715
|
] })
|
|
564
716
|
]
|
|
565
717
|
}
|
|
@@ -568,158 +720,158 @@ function Xe({
|
|
|
568
720
|
}
|
|
569
721
|
);
|
|
570
722
|
}
|
|
571
|
-
function
|
|
723
|
+
function zt({
|
|
572
724
|
className: e = "",
|
|
573
725
|
title: t,
|
|
574
|
-
children:
|
|
575
|
-
expanded:
|
|
576
|
-
defaultExpanded:
|
|
577
|
-
onExpandedChange:
|
|
578
|
-
disabled:
|
|
579
|
-
forceMount:
|
|
580
|
-
handle:
|
|
581
|
-
headingLevel:
|
|
582
|
-
indicator:
|
|
583
|
-
titleAsDialogTitle:
|
|
584
|
-
navigationProps:
|
|
585
|
-
panelProps:
|
|
586
|
-
panelContentProps:
|
|
587
|
-
ref:
|
|
588
|
-
style:
|
|
589
|
-
...
|
|
726
|
+
children: n,
|
|
727
|
+
expanded: a,
|
|
728
|
+
defaultExpanded: d = !0,
|
|
729
|
+
onExpandedChange: w,
|
|
730
|
+
disabled: f = !1,
|
|
731
|
+
forceMount: h = !0,
|
|
732
|
+
handle: N = !0,
|
|
733
|
+
headingLevel: C = 2,
|
|
734
|
+
indicator: g,
|
|
735
|
+
titleAsDialogTitle: m = !0,
|
|
736
|
+
navigationProps: F,
|
|
737
|
+
panelProps: l,
|
|
738
|
+
panelContentProps: x,
|
|
739
|
+
ref: q,
|
|
740
|
+
style: K,
|
|
741
|
+
...Q
|
|
590
742
|
}) {
|
|
591
|
-
const
|
|
592
|
-
canRenderHandle:
|
|
593
|
-
notifyPopupSnapLayoutChange:
|
|
594
|
-
placement:
|
|
595
|
-
} =
|
|
596
|
-
value:
|
|
597
|
-
defaultValue:
|
|
598
|
-
onChange:
|
|
599
|
-
}), [
|
|
600
|
-
|
|
601
|
-
),
|
|
602
|
-
className:
|
|
603
|
-
id:
|
|
604
|
-
onClick:
|
|
605
|
-
...
|
|
606
|
-
} =
|
|
607
|
-
className:
|
|
608
|
-
id:
|
|
609
|
-
role:
|
|
610
|
-
...
|
|
611
|
-
} =
|
|
612
|
-
...
|
|
613
|
-
"--oc-modal-navigation-block-size": `${
|
|
614
|
-
} :
|
|
615
|
-
(
|
|
616
|
-
|
|
743
|
+
const X = de("ModalNavigationSection"), {
|
|
744
|
+
canRenderHandle: Y,
|
|
745
|
+
notifyPopupSnapLayoutChange: o,
|
|
746
|
+
placement: L
|
|
747
|
+
} = X, { height: W, setNode: z } = Te(), u = at(), [v, re] = je({
|
|
748
|
+
value: a,
|
|
749
|
+
defaultValue: d,
|
|
750
|
+
onChange: w
|
|
751
|
+
}), [U, Z] = S(
|
|
752
|
+
v ? "open" : "closed"
|
|
753
|
+
), _ = `h${At(C) ? C : 2}`, {
|
|
754
|
+
className: ue = "",
|
|
755
|
+
id: ie,
|
|
756
|
+
onClick: pe,
|
|
757
|
+
...j
|
|
758
|
+
} = F ?? {}, {
|
|
759
|
+
className: P = "",
|
|
760
|
+
id: b,
|
|
761
|
+
role: D,
|
|
762
|
+
...G
|
|
763
|
+
} = l ?? {}, { className: E = "", ...ee } = x ?? {}, M = ie ?? `${u}-navigation`, p = b ?? `${u}-panel`, R = `${u}-dialog-title`, te = $e(t), A = N && Y, I = W > 0 ? {
|
|
764
|
+
...K,
|
|
765
|
+
"--oc-modal-navigation-block-size": `${W}px`
|
|
766
|
+
} : K, ce = k(
|
|
767
|
+
(V) => {
|
|
768
|
+
Z(V), L === "popup" && o();
|
|
617
769
|
},
|
|
618
|
-
[
|
|
770
|
+
[o, L]
|
|
619
771
|
);
|
|
620
|
-
return /* @__PURE__ */
|
|
772
|
+
return /* @__PURE__ */ ae(
|
|
621
773
|
"section",
|
|
622
774
|
{
|
|
623
|
-
ref:
|
|
624
|
-
className:
|
|
625
|
-
style:
|
|
626
|
-
...
|
|
775
|
+
ref: q,
|
|
776
|
+
className: B(i.navigationSection, e),
|
|
777
|
+
style: I,
|
|
778
|
+
...Q,
|
|
627
779
|
"data-oc-component": "modal-navigation-section",
|
|
628
|
-
"data-oc-motion-state":
|
|
629
|
-
"data-oc-state":
|
|
780
|
+
"data-oc-motion-state": U,
|
|
781
|
+
"data-oc-state": v ? "open" : "closed",
|
|
630
782
|
children: [
|
|
631
|
-
|
|
632
|
-
|
|
783
|
+
m && te ? /* @__PURE__ */ s(
|
|
784
|
+
O.Title,
|
|
633
785
|
{
|
|
634
|
-
className:
|
|
635
|
-
id:
|
|
786
|
+
className: i.navigationDialogTitle,
|
|
787
|
+
id: R,
|
|
636
788
|
children: t
|
|
637
789
|
}
|
|
638
790
|
) : null,
|
|
639
|
-
|
|
791
|
+
A ? /* @__PURE__ */ s(
|
|
640
792
|
"div",
|
|
641
793
|
{
|
|
642
794
|
"aria-hidden": "true",
|
|
643
|
-
className:
|
|
795
|
+
className: i.handle,
|
|
644
796
|
"data-oc-part": "handle"
|
|
645
797
|
}
|
|
646
798
|
) : null,
|
|
647
|
-
/* @__PURE__ */
|
|
799
|
+
/* @__PURE__ */ s(_, { className: i.navigationHeading, "data-oc-part": "heading", children: /* @__PURE__ */ ae(
|
|
648
800
|
"button",
|
|
649
801
|
{
|
|
650
|
-
...
|
|
651
|
-
ref:
|
|
652
|
-
id:
|
|
653
|
-
className:
|
|
802
|
+
...j,
|
|
803
|
+
ref: z,
|
|
804
|
+
id: M,
|
|
805
|
+
className: B(i.navigation, ue),
|
|
654
806
|
type: "button",
|
|
655
|
-
disabled:
|
|
656
|
-
"aria-disabled":
|
|
657
|
-
"aria-expanded":
|
|
658
|
-
"aria-controls":
|
|
659
|
-
onClick: (
|
|
660
|
-
|
|
807
|
+
disabled: f,
|
|
808
|
+
"aria-disabled": f ? "true" : j["aria-disabled"],
|
|
809
|
+
"aria-expanded": v,
|
|
810
|
+
"aria-controls": p,
|
|
811
|
+
onClick: (V) => {
|
|
812
|
+
pe?.(V), !(V.defaultPrevented || f) && re(!v);
|
|
661
813
|
},
|
|
662
814
|
"data-oc-component": "modal-navigation",
|
|
663
815
|
"data-oc-part": "navigation",
|
|
664
|
-
"data-oc-state":
|
|
816
|
+
"data-oc-state": v ? "open" : "closed",
|
|
665
817
|
children: [
|
|
666
|
-
/* @__PURE__ */
|
|
667
|
-
|
|
668
|
-
|
|
818
|
+
/* @__PURE__ */ s("span", { className: i.navigationTitle, "data-oc-part": "title", children: t }),
|
|
819
|
+
g === void 0 ? /* @__PURE__ */ s(
|
|
820
|
+
dt,
|
|
669
821
|
{
|
|
670
|
-
className:
|
|
671
|
-
open:
|
|
822
|
+
className: i.navigationIndicator,
|
|
823
|
+
open: v
|
|
672
824
|
}
|
|
673
|
-
) :
|
|
825
|
+
) : g ? /* @__PURE__ */ s(
|
|
674
826
|
"span",
|
|
675
827
|
{
|
|
676
|
-
className:
|
|
828
|
+
className: i.navigationIndicator,
|
|
677
829
|
"data-oc-part": "indicator",
|
|
678
|
-
"data-oc-state":
|
|
679
|
-
children: /* @__PURE__ */
|
|
830
|
+
"data-oc-state": v ? "open" : "closed",
|
|
831
|
+
children: /* @__PURE__ */ s("span", { "data-oc-part": "indicator-frame", children: ut(g) })
|
|
680
832
|
}
|
|
681
833
|
) : null,
|
|
682
|
-
|
|
834
|
+
f ? null : /* @__PURE__ */ s(lt, { variant: "light" })
|
|
683
835
|
]
|
|
684
836
|
}
|
|
685
837
|
) }),
|
|
686
|
-
/* @__PURE__ */
|
|
687
|
-
|
|
838
|
+
/* @__PURE__ */ s(
|
|
839
|
+
it,
|
|
688
840
|
{
|
|
689
|
-
className:
|
|
690
|
-
open:
|
|
691
|
-
forceMount:
|
|
841
|
+
className: B(i.navigationPanel, P),
|
|
842
|
+
open: v,
|
|
843
|
+
forceMount: h,
|
|
692
844
|
intent: "expand",
|
|
693
845
|
measureBlockSize: "rendered",
|
|
694
|
-
onMotionStateChange:
|
|
846
|
+
onMotionStateChange: ce,
|
|
695
847
|
contentProps: {
|
|
696
|
-
className:
|
|
848
|
+
className: i.navigationPanelFrame,
|
|
697
849
|
"data-oc-part": "panel-inner"
|
|
698
850
|
},
|
|
699
|
-
...
|
|
700
|
-
"aria-hidden":
|
|
701
|
-
"aria-labelledby":
|
|
702
|
-
id:
|
|
703
|
-
inert:
|
|
704
|
-
role:
|
|
851
|
+
...G,
|
|
852
|
+
"aria-hidden": v ? void 0 : !0,
|
|
853
|
+
"aria-labelledby": M,
|
|
854
|
+
id: p,
|
|
855
|
+
inert: v ? void 0 : !0,
|
|
856
|
+
role: D ?? "region",
|
|
705
857
|
"data-oc-component": "modal-navigation-panel",
|
|
706
|
-
"data-oc-state":
|
|
707
|
-
children: /* @__PURE__ */
|
|
708
|
-
|
|
858
|
+
"data-oc-state": v ? "open" : "closed",
|
|
859
|
+
children: /* @__PURE__ */ s(
|
|
860
|
+
Le,
|
|
709
861
|
{
|
|
710
|
-
className:
|
|
862
|
+
className: i.navigationPanelScroll,
|
|
711
863
|
"data-oc-component": "modal-navigation-panel-scroll-area",
|
|
712
864
|
"data-oc-part": "panel-scroll-area",
|
|
713
|
-
children: /* @__PURE__ */
|
|
714
|
-
|
|
865
|
+
children: /* @__PURE__ */ s(
|
|
866
|
+
ze,
|
|
715
867
|
{
|
|
716
|
-
...
|
|
717
|
-
className:
|
|
718
|
-
|
|
719
|
-
|
|
868
|
+
...ee,
|
|
869
|
+
className: B(
|
|
870
|
+
i.navigationPanelInner,
|
|
871
|
+
E
|
|
720
872
|
),
|
|
721
873
|
"data-oc-component": "modal-navigation-panel-content",
|
|
722
|
-
children:
|
|
874
|
+
children: n
|
|
723
875
|
}
|
|
724
876
|
)
|
|
725
877
|
}
|
|
@@ -730,56 +882,56 @@ function Ye({
|
|
|
730
882
|
}
|
|
731
883
|
);
|
|
732
884
|
}
|
|
733
|
-
function
|
|
885
|
+
function jt({
|
|
734
886
|
className: e = "",
|
|
735
887
|
children: t,
|
|
736
|
-
layout:
|
|
737
|
-
containerClassName:
|
|
738
|
-
containerProps:
|
|
739
|
-
ref:
|
|
740
|
-
...
|
|
888
|
+
layout: n = "content",
|
|
889
|
+
containerClassName: a = "",
|
|
890
|
+
containerProps: d,
|
|
891
|
+
ref: w,
|
|
892
|
+
...f
|
|
741
893
|
}) {
|
|
742
|
-
const
|
|
743
|
-
(
|
|
744
|
-
|
|
894
|
+
const h = de("ModalBody"), { bodyNode: N, setBodyNode: C, setScrollState: g } = h, m = k(
|
|
895
|
+
(l) => {
|
|
896
|
+
g(bt(l));
|
|
745
897
|
},
|
|
746
|
-
[
|
|
747
|
-
),
|
|
748
|
-
(
|
|
749
|
-
|
|
898
|
+
[g]
|
|
899
|
+
), F = k(
|
|
900
|
+
(l) => {
|
|
901
|
+
C(l), Pe(w, l), m(l);
|
|
750
902
|
},
|
|
751
|
-
[
|
|
903
|
+
[w, C, m]
|
|
752
904
|
);
|
|
753
905
|
return ne(() => {
|
|
754
|
-
const
|
|
755
|
-
if (!
|
|
756
|
-
const
|
|
757
|
-
return
|
|
758
|
-
}, [
|
|
759
|
-
|
|
906
|
+
const l = N;
|
|
907
|
+
if (!l || (m(l), typeof ResizeObserver > "u")) return;
|
|
908
|
+
const x = new ResizeObserver(() => m(l));
|
|
909
|
+
return x.observe(l), l.firstElementChild && x.observe(l.firstElementChild), () => x.disconnect();
|
|
910
|
+
}, [N, m]), /* @__PURE__ */ s(
|
|
911
|
+
Le,
|
|
760
912
|
{
|
|
761
|
-
...
|
|
762
|
-
className:
|
|
913
|
+
...f,
|
|
914
|
+
className: B(i.body, e),
|
|
763
915
|
"data-oc-part": "body",
|
|
764
916
|
"data-oc-component": "modal-body",
|
|
765
|
-
children: /* @__PURE__ */
|
|
766
|
-
|
|
917
|
+
children: /* @__PURE__ */ s(
|
|
918
|
+
ze,
|
|
767
919
|
{
|
|
768
|
-
ref:
|
|
769
|
-
className:
|
|
920
|
+
ref: F,
|
|
921
|
+
className: i.bodyContainer,
|
|
770
922
|
"data-oc-part": "body-container",
|
|
771
923
|
"data-oc-component": "modal-body-container",
|
|
772
|
-
onScroll: (
|
|
773
|
-
|
|
924
|
+
onScroll: (l) => {
|
|
925
|
+
d?.onScroll?.(l), m(l.currentTarget);
|
|
774
926
|
},
|
|
775
|
-
children: /* @__PURE__ */
|
|
927
|
+
children: /* @__PURE__ */ s(
|
|
776
928
|
"section",
|
|
777
929
|
{
|
|
778
|
-
...
|
|
779
|
-
className:
|
|
930
|
+
...d,
|
|
931
|
+
className: B(i.bodyContent, a),
|
|
780
932
|
"data-oc-part": "body-content",
|
|
781
933
|
"data-oc-component": "modal-body-content",
|
|
782
|
-
"data-oc-layout":
|
|
934
|
+
"data-oc-layout": n,
|
|
783
935
|
children: t
|
|
784
936
|
}
|
|
785
937
|
)
|
|
@@ -788,77 +940,77 @@ function Ze({
|
|
|
788
940
|
}
|
|
789
941
|
);
|
|
790
942
|
}
|
|
791
|
-
function
|
|
943
|
+
function $t({
|
|
792
944
|
className: e = "",
|
|
793
945
|
children: t,
|
|
794
|
-
background:
|
|
795
|
-
ref:
|
|
796
|
-
...
|
|
946
|
+
background: n = "auto",
|
|
947
|
+
ref: a,
|
|
948
|
+
...d
|
|
797
949
|
}) {
|
|
798
|
-
const
|
|
799
|
-
(
|
|
800
|
-
|
|
950
|
+
const w = de("ModalFooter"), { scrollState: f, setFooterNode: h } = w, N = k(
|
|
951
|
+
(m) => {
|
|
952
|
+
h(m), Pe(a, m);
|
|
801
953
|
},
|
|
802
|
-
[
|
|
803
|
-
),
|
|
804
|
-
return /* @__PURE__ */
|
|
954
|
+
[a, h]
|
|
955
|
+
), C = n === !0 || n === "auto" && f.canScroll && !f.scrolledToBottom;
|
|
956
|
+
return /* @__PURE__ */ s(
|
|
805
957
|
"footer",
|
|
806
958
|
{
|
|
807
|
-
...
|
|
808
|
-
ref:
|
|
809
|
-
className:
|
|
959
|
+
...d,
|
|
960
|
+
ref: N,
|
|
961
|
+
className: B(i.footer, e),
|
|
810
962
|
"data-oc-part": "footer",
|
|
811
963
|
"data-oc-component": "modal-footer",
|
|
812
|
-
"data-oc-background":
|
|
964
|
+
"data-oc-background": C ? "true" : "false",
|
|
813
965
|
children: t
|
|
814
966
|
}
|
|
815
967
|
);
|
|
816
968
|
}
|
|
817
|
-
function
|
|
969
|
+
function Oe({
|
|
818
970
|
className: e = "",
|
|
819
|
-
children: t = /* @__PURE__ */
|
|
820
|
-
label:
|
|
821
|
-
size:
|
|
822
|
-
disabled:
|
|
823
|
-
onClick:
|
|
824
|
-
...
|
|
971
|
+
children: t = /* @__PURE__ */ s(rt, {}),
|
|
972
|
+
label: n = "닫기",
|
|
973
|
+
size: a = 24,
|
|
974
|
+
disabled: d,
|
|
975
|
+
onClick: w,
|
|
976
|
+
...f
|
|
825
977
|
}) {
|
|
826
|
-
const
|
|
827
|
-
return /* @__PURE__ */
|
|
828
|
-
|
|
978
|
+
const h = de("ModalClose");
|
|
979
|
+
return /* @__PURE__ */ s(
|
|
980
|
+
st,
|
|
829
981
|
{
|
|
830
|
-
...
|
|
831
|
-
className:
|
|
832
|
-
"aria-label":
|
|
982
|
+
...f,
|
|
983
|
+
className: B(i.close, e),
|
|
984
|
+
"aria-label": f["aria-label"] ?? n,
|
|
833
985
|
"data-oc-part": "close",
|
|
834
986
|
"data-oc-component": "modal-close",
|
|
835
|
-
disabled:
|
|
836
|
-
onClick: (
|
|
837
|
-
|
|
987
|
+
disabled: d,
|
|
988
|
+
onClick: (N) => {
|
|
989
|
+
w?.(N), !N.defaultPrevented && !d && h.requestClose({ reason: "close-button" });
|
|
838
990
|
},
|
|
839
|
-
size:
|
|
991
|
+
size: a,
|
|
840
992
|
children: t
|
|
841
993
|
}
|
|
842
994
|
);
|
|
843
995
|
}
|
|
844
|
-
const
|
|
845
|
-
Root:
|
|
846
|
-
Trigger:
|
|
847
|
-
Content:
|
|
848
|
-
Header:
|
|
849
|
-
NavigationSection:
|
|
850
|
-
Body:
|
|
851
|
-
Footer:
|
|
852
|
-
Close:
|
|
996
|
+
const uo = Object.assign(Ve, {
|
|
997
|
+
Root: Ve,
|
|
998
|
+
Trigger: It,
|
|
999
|
+
Content: Vt,
|
|
1000
|
+
Header: Lt,
|
|
1001
|
+
NavigationSection: zt,
|
|
1002
|
+
Body: jt,
|
|
1003
|
+
Footer: $t,
|
|
1004
|
+
Close: Oe
|
|
853
1005
|
});
|
|
854
1006
|
export {
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
1007
|
+
jt as ModalBody,
|
|
1008
|
+
Oe as ModalClose,
|
|
1009
|
+
Vt as ModalContent,
|
|
1010
|
+
$t as ModalFooter,
|
|
1011
|
+
Lt as ModalHeader,
|
|
1012
|
+
zt as ModalNavigationSection,
|
|
1013
|
+
Ve as ModalRoot,
|
|
1014
|
+
It as ModalTrigger,
|
|
1015
|
+
uo as default
|
|
864
1016
|
};
|