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