@orioncactuscorp/ui 1.10.0 → 1.11.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 +119 -54
- package/dist/components/Accordion/Accordion.css +1 -1
- package/dist/components/Accordion/Accordion.js +169 -177
- package/dist/components/ActionArea/ActionAreaLayout.js +20 -24
- package/dist/components/Cell/Cell.css +1 -1
- package/dist/components/Cell/Cell.js +57 -58
- package/dist/components/CheckMark/CheckMark.css +1 -1
- package/dist/components/Checkbox/Checkbox.css +1 -1
- package/dist/components/Checkbox/Checkbox.js +50 -51
- package/dist/components/Menu/Menu.css +1 -1
- package/dist/components/Menu/Menu.module.scss.js +20 -22
- package/dist/components/Modal/Modal.js +253 -261
- package/dist/components/Modal/useModalContentBlockTransition.js +49 -44
- package/dist/components/Radio/Radio.css +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +197 -200
- package/dist/components/Select/Select.js +31 -34
- package/dist/components/Switch/Switch.css +1 -1
- package/dist/components/Tabs/Tabs.css +1 -0
- package/dist/components/Tabs/Tabs.js +208 -0
- package/dist/components/Tabs/Tabs.module.scss.js +27 -0
- package/dist/components/Tabs.d.ts +6 -0
- package/dist/components/Tabs.js +8 -0
- package/dist/components/TextArea/TextArea.js +57 -58
- package/dist/components/TextInput/TextInput.js +30 -33
- package/dist/components/Tooltip/Tooltip.css +1 -1
- package/dist/foundations/color.theme.dark.css +1 -1
- package/dist/foundations/color.theme.light.css +1 -1
- package/dist/foundations/focus.css +1 -0
- package/dist/foundations/reset.css +1 -1
- package/dist/foundations.css +4 -3
- package/dist/index.js +69 -64
- package/dist/react/motion.js +31 -35
- package/dist/reset.css +1 -1
- package/dist/styles.css +13 -11
- package/dist/ui/src/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/ui/src/components/ActionArea/ActionAreaLayout.d.ts.map +1 -1
- package/dist/ui/src/components/Cell/Cell.d.ts.map +1 -1
- package/dist/ui/src/components/CheckMark/types.d.ts +10 -0
- package/dist/ui/src/components/CheckMark/types.d.ts.map +1 -1
- package/dist/ui/src/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/ui/src/components/Checkbox/types.d.ts +16 -0
- package/dist/ui/src/components/Checkbox/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalContentBlockTransition.d.ts.map +1 -1
- package/dist/ui/src/components/Radio/types.d.ts +16 -0
- package/dist/ui/src/components/Radio/types.d.ts.map +1 -1
- package/dist/ui/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/ui/src/components/Select/Select.d.ts.map +1 -1
- package/dist/ui/src/components/Switch/types.d.ts +10 -0
- package/dist/ui/src/components/Switch/types.d.ts.map +1 -1
- package/dist/ui/src/components/Tabs/Tabs.d.ts +7 -0
- package/dist/ui/src/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/ui/src/components/Tabs/index.d.ts +3 -0
- package/dist/ui/src/components/Tabs/index.d.ts.map +1 -0
- package/dist/ui/src/components/Tabs/types.d.ts +26 -0
- package/dist/ui/src/components/Tabs/types.d.ts.map +1 -0
- package/dist/ui/src/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/ui/src/components/TextInput/TextInput.d.ts.map +1 -1
- package/dist/ui/src/index.d.ts +2 -0
- package/dist/ui/src/index.d.ts.map +1 -1
- package/dist/ui/src/react/motion/index.d.ts.map +1 -1
- package/dist/ui/src/utils/mergeRefs.d.ts +13 -0
- package/dist/ui/src/utils/mergeRefs.d.ts.map +1 -0
- package/dist/utils/mergeRefs.js +24 -0
- package/dist/vscode/oc-ui-vars.css +13 -0
- package/docs/editor-setup.md +42 -0
- package/docs/motion.md +665 -0
- package/docs/responsive-foundation-profile.md +230 -0
- package/docs/scss-helpers.md +189 -0
- package/docs/selector-contract.md +260 -0
- package/docs/spring.md +382 -0
- package/docs/stability.md +62 -0
- package/docs/tokens.md +559 -0
- package/package.json +9 -4
- package/src/scss/foundations/color-theme.test.ts +14 -0
- package/src/scss/foundations/color.theme.dark.scss +1 -0
- package/src/scss/foundations/color.theme.light.scss +1 -0
- package/src/scss/foundations/focus.scss +4 -0
- package/src/scss/foundations/focus.test.ts +48 -0
- package/src/scss/foundations/reset.scss +9 -4
- package/src/scss/foundations/reset.test.ts +32 -0
- package/src/scss/index.scss +2 -0
- package/src/scss/mixins/_focus.scss +11 -0
- package/src/scss/mixins/_focus.test.ts +58 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as d, jsxs as ae } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { Dialog as
|
|
3
|
+
import { useCallback as k, useMemo as pe, useEffect as ne, useRef as j, useState as v, useLayoutEffect as ye, useId as ht } from "react";
|
|
4
|
+
import { Dialog as $ } from "@base-ui-components/react/dialog";
|
|
5
5
|
import gt from "@orioncactuscorp/icons/orioncactus/CloseThick";
|
|
6
6
|
import { MotionExpand as vt } from "../../react/motion.js";
|
|
7
7
|
import bt from "../Background/Background.js";
|
|
@@ -10,7 +10,8 @@ import yt from "../Interaction/Interaction.js";
|
|
|
10
10
|
import { ScrollArea as Ue, ScrollAreaContainer as _e } from "../ScrollArea/ScrollArea.js";
|
|
11
11
|
import { DisclosureIndicator as kt } from "../internal/DisclosureIndicator.js";
|
|
12
12
|
import { normalizeSlotIcon as Nt } from "../internal/slot.js";
|
|
13
|
-
import {
|
|
13
|
+
import { mergeRefs as Fe } from "../../utils/mergeRefs.js";
|
|
14
|
+
import { useModalContext as me, ModalProvider as Ct } from "./contexts.js";
|
|
14
15
|
import { useControllableState as Ge } from "./useControllableState.js";
|
|
15
16
|
import { useModalContentBlockTransition as wt } from "./useModalContentBlockTransition.js";
|
|
16
17
|
import { useMeasuredElement as Pe } from "./useElementSize.js";
|
|
@@ -27,9 +28,6 @@ function R(...e) {
|
|
|
27
28
|
function Qe(e) {
|
|
28
29
|
return e != null && e !== !1 && e !== "";
|
|
29
30
|
}
|
|
30
|
-
function Fe(e, t) {
|
|
31
|
-
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
32
|
-
}
|
|
33
31
|
function Pt(e) {
|
|
34
32
|
if (!e) return;
|
|
35
33
|
const t = Object.entries(e).filter(
|
|
@@ -65,8 +63,8 @@ function qe(e, t) {
|
|
|
65
63
|
};
|
|
66
64
|
}
|
|
67
65
|
function At(e) {
|
|
68
|
-
const [t, n] =
|
|
69
|
-
return
|
|
66
|
+
const [t, n] = v(Oe);
|
|
67
|
+
return ye(() => {
|
|
70
68
|
if (!e || typeof window > "u") return;
|
|
71
69
|
const a = () => {
|
|
72
70
|
n(Oe());
|
|
@@ -83,15 +81,15 @@ function It(e) {
|
|
|
83
81
|
const t = e.trim();
|
|
84
82
|
return t.endsWith("ms") ? Number.parseFloat(t) || 0 : t.endsWith("s") ? (Number.parseFloat(t) || 0) * 1e3 : 0;
|
|
85
83
|
}
|
|
86
|
-
function
|
|
84
|
+
function we(e) {
|
|
87
85
|
return e.split(",").reduce((t, n) => Math.max(t, It(n)), 0);
|
|
88
86
|
}
|
|
89
87
|
function Vt(e) {
|
|
90
|
-
const t = window.getComputedStyle(e), n =
|
|
88
|
+
const t = window.getComputedStyle(e), n = we(t.animationDuration), a = we(t.animationDelay);
|
|
91
89
|
return n + a + 250;
|
|
92
90
|
}
|
|
93
91
|
function Lt(e) {
|
|
94
|
-
const t = window.getComputedStyle(e), n =
|
|
92
|
+
const t = window.getComputedStyle(e), n = we(t.transitionDuration), a = we(t.transitionDelay);
|
|
95
93
|
return n + a + 250;
|
|
96
94
|
}
|
|
97
95
|
function zt({
|
|
@@ -106,20 +104,20 @@ function zt({
|
|
|
106
104
|
surfaceMotion: t
|
|
107
105
|
});
|
|
108
106
|
if (!a) return;
|
|
109
|
-
const
|
|
107
|
+
const l = a.defaultTarget;
|
|
110
108
|
t.style.setProperty(
|
|
111
109
|
"--oc-modal-translate-x",
|
|
112
|
-
|
|
110
|
+
l.settledTranslate?.x ?? `${l.x}px`
|
|
113
111
|
), t.style.setProperty(
|
|
114
112
|
"--oc-modal-translate-y",
|
|
115
|
-
|
|
113
|
+
l.settledTranslate?.y ?? `${l.y}px`
|
|
116
114
|
);
|
|
117
115
|
}
|
|
118
116
|
function jt(e) {
|
|
119
117
|
if (e && typeof e == "object" && "reason" in e && typeof e.reason == "string")
|
|
120
118
|
return e.reason;
|
|
121
119
|
}
|
|
122
|
-
function
|
|
120
|
+
function Ce(e) {
|
|
123
121
|
e && typeof e == "object" && "cancel" in e && typeof e.cancel == "function" && e.cancel();
|
|
124
122
|
}
|
|
125
123
|
function $t(e, t) {
|
|
@@ -178,134 +176,134 @@ function We({
|
|
|
178
176
|
open: t,
|
|
179
177
|
defaultOpen: n,
|
|
180
178
|
modal: a = !0,
|
|
181
|
-
onOpenChange:
|
|
179
|
+
onOpenChange: l,
|
|
182
180
|
canCloseAttempt: N,
|
|
183
181
|
onCloseAttempt: m,
|
|
184
182
|
presentationState: C,
|
|
185
183
|
defaultPresentationState: f = "visible",
|
|
186
184
|
onPresentationStateChange: M,
|
|
187
185
|
disablePointerDismissal: h,
|
|
188
|
-
navigationDepth:
|
|
186
|
+
navigationDepth: S = 0,
|
|
189
187
|
dismissBehavior: x
|
|
190
188
|
}) {
|
|
191
|
-
const
|
|
189
|
+
const p = t !== void 0, [T, G] = v(
|
|
192
190
|
n ?? !1
|
|
193
|
-
),
|
|
191
|
+
), O = p ? t : T, [J, fe] = v("bottom"), [A, re] = v(!1), [o, q] = v(!1), [F, K] = v(!1), [r, Q] = v(!1), [X, Y] = v(0), [W, Z] = v(0), [ie, he] = v(null), [ee, te] = v({
|
|
194
192
|
canScroll: !1,
|
|
195
193
|
scrolledFromTop: !1,
|
|
196
194
|
scrolledToBottom: !0
|
|
197
|
-
}), [
|
|
195
|
+
}), [b, y] = Ge({
|
|
198
196
|
value: C,
|
|
199
197
|
defaultValue: f,
|
|
200
198
|
onChange: M
|
|
201
|
-
}), B = Pe(),
|
|
202
|
-
(s,
|
|
203
|
-
|
|
199
|
+
}), B = Pe(), U = Pe(), I = Math.max(0, S), D = k(
|
|
200
|
+
(s, g) => {
|
|
201
|
+
p || G(s), l?.(s, g);
|
|
204
202
|
},
|
|
205
|
-
[
|
|
206
|
-
), w =
|
|
203
|
+
[l, p]
|
|
204
|
+
), w = k(
|
|
207
205
|
(s = { reason: "programmatic" }) => N?.(s) !== !1,
|
|
208
206
|
[N]
|
|
209
|
-
),
|
|
207
|
+
), u = k(
|
|
210
208
|
(s = { reason: "programmatic" }) => {
|
|
211
|
-
Y((
|
|
209
|
+
Y((g) => g + 1);
|
|
212
210
|
},
|
|
213
211
|
[]
|
|
214
|
-
),
|
|
212
|
+
), V = k(() => {
|
|
215
213
|
Z((s) => s + 1);
|
|
216
|
-
}, []),
|
|
214
|
+
}, []), L = k(
|
|
217
215
|
(s = { reason: "programmatic" }) => {
|
|
218
|
-
if (Ke(s.reason,
|
|
216
|
+
if (Ke(s.reason, F))
|
|
219
217
|
return !1;
|
|
220
|
-
const
|
|
221
|
-
return
|
|
218
|
+
const g = $t(x, s.reason);
|
|
219
|
+
return g === "allow" ? !0 : g === "block" ? !1 : !Ot(s.reason, I);
|
|
222
220
|
},
|
|
223
|
-
[
|
|
224
|
-
), P =
|
|
225
|
-
(s = { reason: "programmatic" },
|
|
226
|
-
const { commit: ce = !0, skipAttempt: se = !1 } =
|
|
227
|
-
return !se && Ke(s.reason,
|
|
221
|
+
[F, x, I]
|
|
222
|
+
), P = k(
|
|
223
|
+
(s = { reason: "programmatic" }, g = {}) => {
|
|
224
|
+
const { commit: ce = !0, skipAttempt: se = !1 } = g;
|
|
225
|
+
return !se && Ke(s.reason, F) ? (Ce(s.eventDetails), !1) : !se && !L(s) || !se && !w(s) || !se && m?.(s) === !1 ? (Ce(s.eventDetails), u(s), !1) : (ce && D(!1, s.eventDetails), !0);
|
|
228
226
|
},
|
|
229
227
|
[
|
|
230
228
|
w,
|
|
229
|
+
F,
|
|
230
|
+
L,
|
|
231
231
|
D,
|
|
232
|
-
|
|
233
|
-
E,
|
|
234
|
-
p,
|
|
232
|
+
u,
|
|
235
233
|
m
|
|
236
234
|
]
|
|
237
|
-
), oe =
|
|
238
|
-
(s,
|
|
239
|
-
if (s &&
|
|
235
|
+
), oe = k(
|
|
236
|
+
(s, g) => {
|
|
237
|
+
if (s && b === "peeked" && y("visible"), !s) {
|
|
240
238
|
P({
|
|
241
|
-
reason: Kt(
|
|
242
|
-
eventDetails:
|
|
239
|
+
reason: Kt(g),
|
|
240
|
+
eventDetails: g
|
|
243
241
|
});
|
|
244
242
|
return;
|
|
245
243
|
}
|
|
246
|
-
|
|
244
|
+
D(s, g);
|
|
247
245
|
},
|
|
248
|
-
[
|
|
249
|
-
),
|
|
246
|
+
[D, b, P, y]
|
|
247
|
+
), z = b === "visible" && !r ? a : !1, ge = h || J === "bottom" && (A || r), _ = pe(
|
|
250
248
|
() => ({
|
|
251
|
-
open:
|
|
249
|
+
open: O,
|
|
252
250
|
placement: J,
|
|
253
|
-
setPlacement:
|
|
254
|
-
presentationState:
|
|
255
|
-
setPresentationState:
|
|
251
|
+
setPlacement: fe,
|
|
252
|
+
presentationState: b,
|
|
253
|
+
setPresentationState: y,
|
|
256
254
|
requestClose: P,
|
|
257
|
-
canDismissByBehavior:
|
|
255
|
+
canDismissByBehavior: L,
|
|
258
256
|
canCloseAttempt: w,
|
|
259
257
|
closeAttemptFeedbackKey: X,
|
|
260
|
-
notifyCloseAttemptRejected:
|
|
258
|
+
notifyCloseAttemptRejected: u,
|
|
261
259
|
disablePointerDismissal: h ?? !1,
|
|
262
|
-
setBackdropDismissalDisabled:
|
|
260
|
+
setBackdropDismissalDisabled: K,
|
|
263
261
|
setBackgroundInteractive: Q,
|
|
264
|
-
canPeek:
|
|
262
|
+
canPeek: A,
|
|
265
263
|
setCanPeek: re,
|
|
266
264
|
canRenderHandle: o,
|
|
267
|
-
setCanRenderHandle:
|
|
268
|
-
popupSnapLayoutVersion:
|
|
269
|
-
notifyPopupSnapLayoutChange:
|
|
265
|
+
setCanRenderHandle: q,
|
|
266
|
+
popupSnapLayoutVersion: W,
|
|
267
|
+
notifyPopupSnapLayoutChange: V,
|
|
270
268
|
headerHeight: B.height,
|
|
271
|
-
footerHeight:
|
|
269
|
+
footerHeight: U.height,
|
|
272
270
|
setHeaderNode: B.setNode,
|
|
273
|
-
setFooterNode:
|
|
271
|
+
setFooterNode: U.setNode,
|
|
274
272
|
bodyNode: ie,
|
|
275
|
-
setBodyNode:
|
|
273
|
+
setBodyNode: he,
|
|
276
274
|
scrollState: ee,
|
|
277
275
|
setScrollState: te
|
|
278
276
|
}),
|
|
279
277
|
[
|
|
280
278
|
ie,
|
|
281
|
-
|
|
279
|
+
A,
|
|
282
280
|
o,
|
|
283
|
-
|
|
281
|
+
L,
|
|
284
282
|
w,
|
|
285
283
|
X,
|
|
286
|
-
|
|
287
|
-
|
|
284
|
+
U.height,
|
|
285
|
+
U.setNode,
|
|
288
286
|
B.height,
|
|
289
287
|
B.setNode,
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
288
|
+
u,
|
|
289
|
+
V,
|
|
290
|
+
W,
|
|
291
|
+
O,
|
|
294
292
|
J,
|
|
295
293
|
P,
|
|
296
294
|
ee,
|
|
297
295
|
h,
|
|
298
|
-
|
|
299
|
-
|
|
296
|
+
b,
|
|
297
|
+
y
|
|
300
298
|
]
|
|
301
299
|
);
|
|
302
|
-
return /* @__PURE__ */ d(Ct, { value:
|
|
303
|
-
|
|
300
|
+
return /* @__PURE__ */ d(Ct, { value: _, children: /* @__PURE__ */ d(
|
|
301
|
+
$.Root,
|
|
304
302
|
{
|
|
305
|
-
open:
|
|
306
|
-
modal:
|
|
303
|
+
open: O,
|
|
304
|
+
modal: z,
|
|
307
305
|
onOpenChange: oe,
|
|
308
|
-
disablePointerDismissal:
|
|
306
|
+
disablePointerDismissal: ge,
|
|
309
307
|
children: e
|
|
310
308
|
}
|
|
311
309
|
) });
|
|
@@ -317,7 +315,7 @@ function Ut({
|
|
|
317
315
|
nativeButton: a
|
|
318
316
|
}) {
|
|
319
317
|
return n ? /* @__PURE__ */ d(
|
|
320
|
-
|
|
318
|
+
$.Trigger,
|
|
321
319
|
{
|
|
322
320
|
render: n,
|
|
323
321
|
nativeButton: a,
|
|
@@ -325,7 +323,7 @@ function Ut({
|
|
|
325
323
|
children: t
|
|
326
324
|
}
|
|
327
325
|
) : /* @__PURE__ */ d(
|
|
328
|
-
|
|
326
|
+
$.Trigger,
|
|
329
327
|
{
|
|
330
328
|
className: R(c.trigger, e),
|
|
331
329
|
nativeButton: a,
|
|
@@ -339,98 +337,98 @@ function _t({
|
|
|
339
337
|
children: t,
|
|
340
338
|
variant: n = "adaptive",
|
|
341
339
|
size: a = "medium",
|
|
342
|
-
resize:
|
|
340
|
+
resize: l = "content",
|
|
343
341
|
contentTransition: N = "auto",
|
|
344
342
|
backdrop: m = "auto",
|
|
345
343
|
backdropFrom: C,
|
|
346
344
|
drag: f = "content",
|
|
347
345
|
peekable: M = !1,
|
|
348
346
|
snapPoints: h,
|
|
349
|
-
defaultSnapPoint:
|
|
347
|
+
defaultSnapPoint: S,
|
|
350
348
|
snapPositions: x,
|
|
351
|
-
defaultSnapPosition:
|
|
349
|
+
defaultSnapPosition: p,
|
|
352
350
|
initialFocus: T,
|
|
353
|
-
peekHeight:
|
|
354
|
-
closeThreshold:
|
|
351
|
+
peekHeight: G,
|
|
352
|
+
closeThreshold: O,
|
|
355
353
|
scrollLockTimeout: J,
|
|
356
|
-
container:
|
|
357
|
-
style:
|
|
354
|
+
container: fe,
|
|
355
|
+
style: A,
|
|
358
356
|
...re
|
|
359
357
|
}) {
|
|
360
|
-
const o =
|
|
358
|
+
const o = me("ModalContent"), { setCanPeek: q, setCanRenderHandle: F, setPlacement: K } = o, r = Mt(n), Q = j(null), X = j(null), Y = j(null), W = j(null), [Z, ie] = v(null), [he, ee] = v(
|
|
361
359
|
null
|
|
362
|
-
), te =
|
|
360
|
+
), te = j(0), b = j(null), y = j(null), B = j(null), [U, I] = v(), D = f === "handle" || f === "content", w = r === "popup" && D && !!x?.length, u = qt({
|
|
363
361
|
backdrop: m,
|
|
364
362
|
canSnapPopup: w,
|
|
365
363
|
placement: r,
|
|
366
364
|
presentationState: o.presentationState
|
|
367
|
-
}), [
|
|
368
|
-
resolvedBackdrop:
|
|
365
|
+
}), [V, L] = v(() => ({
|
|
366
|
+
resolvedBackdrop: u,
|
|
369
367
|
exiting: !1
|
|
370
|
-
})), P =
|
|
371
|
-
() => qe(
|
|
372
|
-
[
|
|
373
|
-
), oe = P.exiting,
|
|
374
|
-
!!h?.length ||
|
|
375
|
-
), se =
|
|
368
|
+
})), P = pe(
|
|
369
|
+
() => qe(V, u),
|
|
370
|
+
[V, u]
|
|
371
|
+
), oe = P.exiting, z = w && u === "hidden", ge = (r === "bottom" || w) && D, _ = r === "bottom" && ge && M, s = _ && G !== void 0 ? G : o.headerHeight > 0 ? o.headerHeight : void 0, g = r === "bottom" && l !== "fixed", ce = At(
|
|
372
|
+
!!h?.length || g
|
|
373
|
+
), se = pe(() => {
|
|
376
374
|
if (!(!h?.length || ce <= 0))
|
|
377
375
|
return Rt({
|
|
378
376
|
snapPoints: h,
|
|
379
|
-
defaultSnapPoint:
|
|
377
|
+
defaultSnapPoint: S,
|
|
380
378
|
backdropFrom: C,
|
|
381
379
|
viewportHeight: ce
|
|
382
380
|
});
|
|
383
|
-
}, [C,
|
|
381
|
+
}, [C, S, h, ce]), E = r === "bottom" ? se : void 0, Ye = xt(o.open), [ke, Ze] = v(0), Ne = j(!1), et = E !== void 0 && g, He = g && ke > 0 ? ke : void 0, de = E ? et && He !== void 0 ? He : E.sheetHeight : He, tt = E && de !== void 0 ? Math.max(0, de - E.defaultHeight) : void 0, ot = de !== void 0, Me = Et({
|
|
384
382
|
contentTransition: N,
|
|
385
383
|
placement: r,
|
|
386
|
-
resize:
|
|
387
|
-
}), nt =
|
|
384
|
+
resize: l
|
|
385
|
+
}), nt = Me === "surface" ? "auto" : "none", at = Me === "sheet" ? "auto" : "none", De = o.bodyNode;
|
|
388
386
|
wt({
|
|
389
|
-
enabled: o.open &&
|
|
390
|
-
node:
|
|
391
|
-
}),
|
|
392
|
-
if (!
|
|
393
|
-
|
|
387
|
+
enabled: o.open && Me === "surface",
|
|
388
|
+
node: he
|
|
389
|
+
}), ye(() => {
|
|
390
|
+
if (!g) {
|
|
391
|
+
Ne.current = !1;
|
|
394
392
|
return;
|
|
395
393
|
}
|
|
396
394
|
const i = De?.firstElementChild;
|
|
397
395
|
if (!i) {
|
|
398
|
-
|
|
396
|
+
Ne.current = !1;
|
|
399
397
|
return;
|
|
400
398
|
}
|
|
401
399
|
const H = () => {
|
|
402
|
-
const ue = i.getBoundingClientRect().height,
|
|
400
|
+
const ue = i.getBoundingClientRect().height, Se = Tt({
|
|
403
401
|
contentHeight: ue,
|
|
404
402
|
maxHeight: Dt(Z),
|
|
405
|
-
snapHeight:
|
|
406
|
-
}), $e = Math.abs(
|
|
407
|
-
|
|
403
|
+
snapHeight: E?.sheetHeight
|
|
404
|
+
}), $e = Math.abs(ke - Se) > 0.5;
|
|
405
|
+
Ne.current = $e, $e && Ze(Se);
|
|
408
406
|
};
|
|
409
407
|
if (H(), typeof ResizeObserver > "u") return;
|
|
410
|
-
const
|
|
411
|
-
return
|
|
408
|
+
const be = new ResizeObserver(H);
|
|
409
|
+
return be.observe(i), () => be.disconnect();
|
|
412
410
|
}, [
|
|
413
411
|
De,
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
412
|
+
g,
|
|
413
|
+
E?.sheetHeight,
|
|
414
|
+
ke,
|
|
417
415
|
ce,
|
|
418
416
|
Z
|
|
419
417
|
]), ne(() => {
|
|
420
|
-
|
|
421
|
-
}, [r,
|
|
422
|
-
o.open || (
|
|
423
|
-
}, [o.open]), ne(() => (
|
|
424
|
-
const rt =
|
|
425
|
-
() =>
|
|
418
|
+
K(r);
|
|
419
|
+
}, [r, K]), ne(() => {
|
|
420
|
+
o.open || (W.current = null);
|
|
421
|
+
}, [o.open]), ne(() => (q(_), () => q(!1)), [_, q]), ne(() => (F(ge), () => F(!1)), [ge, F]);
|
|
422
|
+
const rt = k(
|
|
423
|
+
() => Ne.current,
|
|
426
424
|
[]
|
|
427
|
-
), Ee = o.bodyNode, Ae = o.setScrollState, it =
|
|
425
|
+
), Ee = o.bodyNode, Ae = o.setScrollState, it = k(() => {
|
|
428
426
|
Ae(Je(Ee));
|
|
429
|
-
}, [Ee, Ae]), Ie =
|
|
427
|
+
}, [Ee, Ae]), Ie = E?.backdropFromHeight, [Ve, Le] = v(!1), ct = k((i) => {
|
|
430
428
|
Le(!i);
|
|
431
429
|
}, []);
|
|
432
430
|
!o.open && Ve && Le(!1);
|
|
433
|
-
const
|
|
431
|
+
const xe = Ie !== void 0 && Ve, { collapseBottomSheetToUndimmedSnap: Te, handlers: st } = Ht({
|
|
434
432
|
enabled: f !== !1,
|
|
435
433
|
drag: f,
|
|
436
434
|
open: o.open,
|
|
@@ -439,63 +437,63 @@ function _t({
|
|
|
439
437
|
surfaceMotionNode: Z,
|
|
440
438
|
backdropRef: Y,
|
|
441
439
|
bodyNode: o.bodyNode,
|
|
442
|
-
snapHeights:
|
|
440
|
+
snapHeights: E?.snapHeights,
|
|
443
441
|
sheetHeight: de,
|
|
444
442
|
backdropFromHeight: Ie,
|
|
445
443
|
onBackdropDimRestChange: ct,
|
|
446
|
-
peekHeight:
|
|
447
|
-
peekFallback:
|
|
444
|
+
peekHeight: _ ? G : void 0,
|
|
445
|
+
peekFallback: _ ? "header" : void 0,
|
|
448
446
|
presentationState: o.presentationState,
|
|
449
447
|
setPresentationState: o.setPresentationState,
|
|
450
448
|
requestClose: o.requestClose,
|
|
451
449
|
canCloseAttempt: o.canCloseAttempt,
|
|
452
450
|
dismissible: !o.disablePointerDismissal && o.canDismissByBehavior({ reason: "drag-dismiss" }),
|
|
453
|
-
backdropHidden:
|
|
451
|
+
backdropHidden: u === "hidden",
|
|
454
452
|
visibleTranslate: tt,
|
|
455
453
|
shouldDeferBottomSettle: rt,
|
|
456
454
|
refreshScrollState: it,
|
|
457
455
|
snapPositions: w ? x : void 0,
|
|
458
|
-
defaultSnapPosition:
|
|
459
|
-
closeThreshold:
|
|
456
|
+
defaultSnapPosition: p,
|
|
457
|
+
closeThreshold: O,
|
|
460
458
|
scrollLockTimeout: J,
|
|
461
459
|
popupSnapLayoutVersion: o.popupSnapLayoutVersion
|
|
462
|
-
}), dt =
|
|
460
|
+
}), dt = k(
|
|
463
461
|
(i) => {
|
|
464
|
-
Q.current = i, ie(i), i && o.open && w &&
|
|
465
|
-
defaultSnapPosition:
|
|
462
|
+
Q.current = i, ie(i), i && o.open && w && W.current !== i && (zt({
|
|
463
|
+
defaultSnapPosition: p,
|
|
466
464
|
node: i,
|
|
467
465
|
snapPositions: x
|
|
468
|
-
}),
|
|
466
|
+
}), W.current = i);
|
|
469
467
|
},
|
|
470
|
-
[w, o.open,
|
|
471
|
-
), lt =
|
|
468
|
+
[w, o.open, p, x]
|
|
469
|
+
), lt = k((i) => {
|
|
472
470
|
X.current = i, ee(i);
|
|
473
471
|
}, []);
|
|
474
472
|
ne(() => {
|
|
475
473
|
const i = o.closeAttemptFeedbackKey;
|
|
476
474
|
if (i === 0 || r !== "popup" || te.current === i) {
|
|
477
|
-
te.current = i,
|
|
475
|
+
te.current = i, I(void 0);
|
|
478
476
|
return;
|
|
479
477
|
}
|
|
480
478
|
const H = X.current;
|
|
481
479
|
if (!H) return;
|
|
482
|
-
te.current = i,
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
}, ue = (
|
|
486
|
-
|
|
480
|
+
te.current = i, b.current !== null && window.cancelAnimationFrame(b.current), y.current !== null && window.clearTimeout(y.current), I(void 0);
|
|
481
|
+
const be = () => {
|
|
482
|
+
I(void 0), y.current = null;
|
|
483
|
+
}, ue = (Se) => {
|
|
484
|
+
Se.target === H && Se.animationName === "oc-modal-reject-shake" && (H.removeEventListener("animationend", ue), y.current !== null && window.clearTimeout(y.current), be());
|
|
487
485
|
};
|
|
488
|
-
return H.addEventListener("animationend", ue),
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
H.removeEventListener("animationend", ue),
|
|
486
|
+
return H.addEventListener("animationend", ue), b.current = window.requestAnimationFrame(() => {
|
|
487
|
+
b.current = null, I("reject"), b.current = window.requestAnimationFrame(() => {
|
|
488
|
+
b.current = null, y.current = window.setTimeout(() => {
|
|
489
|
+
H.removeEventListener("animationend", ue), be();
|
|
492
490
|
}, Vt(H));
|
|
493
491
|
});
|
|
494
492
|
}), () => {
|
|
495
|
-
H.removeEventListener("animationend", ue),
|
|
493
|
+
H.removeEventListener("animationend", ue), b.current !== null && (window.cancelAnimationFrame(b.current), b.current = null), y.current !== null && (window.clearTimeout(y.current), y.current = null);
|
|
496
494
|
};
|
|
497
495
|
}, [o.closeAttemptFeedbackKey, r]);
|
|
498
|
-
const ze = Pt(
|
|
496
|
+
const ze = Pt(A), ut = {
|
|
499
497
|
...ze,
|
|
500
498
|
...o.headerHeight > 0 ? { "--oc-modal-header-height": `${o.headerHeight}px` } : {},
|
|
501
499
|
...o.footerHeight > 0 ? { "--oc-modal-footer-height": `${o.footerHeight}px` } : {},
|
|
@@ -511,88 +509,88 @@ function _t({
|
|
|
511
509
|
// Each modal reserves one backdrop slot and one viewport slot.
|
|
512
510
|
"--oc-modal-stack-offset": Ye * 2
|
|
513
511
|
}, pt = o.headerHeight > 0 ? {
|
|
514
|
-
...
|
|
512
|
+
...A,
|
|
515
513
|
"--oc-modal-header-height": `${o.headerHeight}px`
|
|
516
|
-
} :
|
|
517
|
-
|
|
518
|
-
P !==
|
|
519
|
-
}, [
|
|
520
|
-
const le =
|
|
514
|
+
} : A, mt = T === "content" ? Q : T, { setBackdropDismissalDisabled: Re, setBackgroundInteractive: Be } = o, ft = u !== "hidden" || oe;
|
|
515
|
+
ye(() => {
|
|
516
|
+
P !== V && L(P);
|
|
517
|
+
}, [V, P]);
|
|
518
|
+
const le = k(() => {
|
|
521
519
|
B.current !== null && (window.clearTimeout(B.current), B.current = null);
|
|
522
|
-
}, []),
|
|
523
|
-
|
|
520
|
+
}, []), ve = k(() => {
|
|
521
|
+
u === "hidden" && (le(), L((i) => {
|
|
524
522
|
const H = qe(
|
|
525
523
|
i,
|
|
526
|
-
|
|
524
|
+
u
|
|
527
525
|
);
|
|
528
526
|
return H.resolvedBackdrop !== "hidden" || !H.exiting ? H : {
|
|
529
527
|
...H,
|
|
530
528
|
exiting: !1
|
|
531
529
|
};
|
|
532
530
|
}));
|
|
533
|
-
}, [le,
|
|
531
|
+
}, [le, u]);
|
|
534
532
|
return ne(
|
|
535
533
|
() => () => {
|
|
536
534
|
le();
|
|
537
535
|
},
|
|
538
536
|
[le]
|
|
539
|
-
),
|
|
540
|
-
if (!oe ||
|
|
537
|
+
), ye(() => {
|
|
538
|
+
if (!oe || u !== "hidden") return;
|
|
541
539
|
const i = Y.current;
|
|
542
540
|
if (!i) {
|
|
543
|
-
B.current = window.setTimeout(
|
|
541
|
+
B.current = window.setTimeout(ve, 0);
|
|
544
542
|
return;
|
|
545
543
|
}
|
|
546
544
|
le(), B.current = window.setTimeout(
|
|
547
|
-
|
|
545
|
+
ve,
|
|
548
546
|
Lt(i)
|
|
549
547
|
);
|
|
550
548
|
}, [
|
|
551
549
|
le,
|
|
552
|
-
|
|
550
|
+
ve,
|
|
553
551
|
oe,
|
|
554
|
-
|
|
555
|
-
]),
|
|
556
|
-
|
|
552
|
+
u
|
|
553
|
+
]), ye(() => (Re(u === "hidden"), Be(z || xe), () => {
|
|
554
|
+
Re(!1), Be(!1);
|
|
557
555
|
}), [
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
]), /* @__PURE__ */ ae(
|
|
556
|
+
xe,
|
|
557
|
+
z,
|
|
558
|
+
u,
|
|
559
|
+
Re,
|
|
560
|
+
Be
|
|
561
|
+
]), /* @__PURE__ */ ae($.Portal, { container: fe, children: [
|
|
564
562
|
ft ? /* @__PURE__ */ d(
|
|
565
|
-
|
|
563
|
+
$.Backdrop,
|
|
566
564
|
{
|
|
567
565
|
ref: Y,
|
|
568
566
|
className: c.backdrop,
|
|
569
567
|
"data-oc-part": "backdrop",
|
|
570
568
|
"data-oc-component": "modal-backdrop",
|
|
571
|
-
"data-oc-modal-backdrop":
|
|
572
|
-
"data-oc-modal-backdrop-passthrough":
|
|
569
|
+
"data-oc-modal-backdrop": u,
|
|
570
|
+
"data-oc-modal-backdrop-passthrough": xe ? "true" : void 0,
|
|
573
571
|
"data-oc-modal-placement": r,
|
|
574
572
|
"data-oc-modal-presentation-state": o.presentationState,
|
|
575
573
|
style: je,
|
|
576
574
|
onTransitionCancel: (i) => {
|
|
577
|
-
i.currentTarget === i.target && i.propertyName === "opacity" &&
|
|
575
|
+
i.currentTarget === i.target && i.propertyName === "opacity" && ve();
|
|
578
576
|
},
|
|
579
577
|
onTransitionEnd: (i) => {
|
|
580
|
-
i.currentTarget === i.target && i.propertyName === "opacity" &&
|
|
578
|
+
i.currentTarget === i.target && i.propertyName === "opacity" && ve();
|
|
581
579
|
},
|
|
582
580
|
onClick: () => {
|
|
583
581
|
if (o.disablePointerDismissal) {
|
|
584
|
-
if (
|
|
582
|
+
if (Te()) return;
|
|
585
583
|
o.notifyCloseAttemptRejected({ reason: "backdrop-press" });
|
|
586
584
|
return;
|
|
587
585
|
}
|
|
588
586
|
if (!o.canDismissByBehavior({ reason: "backdrop-press" })) {
|
|
589
|
-
if (
|
|
587
|
+
if (Te()) return;
|
|
590
588
|
o.notifyCloseAttemptRejected({ reason: "backdrop-press" });
|
|
591
589
|
return;
|
|
592
590
|
}
|
|
593
|
-
if (r === "bottom" &&
|
|
591
|
+
if (r === "bottom" && _) {
|
|
594
592
|
if (o.presentationState === "visible") {
|
|
595
|
-
if (
|
|
593
|
+
if (Te()) return;
|
|
596
594
|
o.setPresentationState("peeked");
|
|
597
595
|
}
|
|
598
596
|
return;
|
|
@@ -602,7 +600,7 @@ function _t({
|
|
|
602
600
|
}
|
|
603
601
|
) : null,
|
|
604
602
|
/* @__PURE__ */ d(
|
|
605
|
-
|
|
603
|
+
$.Viewport,
|
|
606
604
|
{
|
|
607
605
|
className: c.viewport,
|
|
608
606
|
"data-oc-part": "viewport",
|
|
@@ -610,7 +608,7 @@ function _t({
|
|
|
610
608
|
"data-oc-modal-placement": r,
|
|
611
609
|
style: je,
|
|
612
610
|
children: /* @__PURE__ */ ae(
|
|
613
|
-
|
|
611
|
+
$.Popup,
|
|
614
612
|
{
|
|
615
613
|
...re,
|
|
616
614
|
...st,
|
|
@@ -623,13 +621,13 @@ function _t({
|
|
|
623
621
|
),
|
|
624
622
|
"data-oc-part": "surface-motion",
|
|
625
623
|
"data-oc-component": "modal-content",
|
|
626
|
-
"data-oc-modal-backdrop":
|
|
624
|
+
"data-oc-modal-backdrop": u,
|
|
627
625
|
"data-oc-variant": n,
|
|
628
626
|
"data-oc-size": a,
|
|
629
|
-
"data-oc-resize":
|
|
630
|
-
"data-oc-modal-feedback": r === "popup" ?
|
|
627
|
+
"data-oc-resize": l,
|
|
628
|
+
"data-oc-modal-feedback": r === "popup" ? U : void 0,
|
|
631
629
|
"data-oc-modal-placement": r,
|
|
632
|
-
"data-oc-modal-snapping":
|
|
630
|
+
"data-oc-modal-snapping": E || w ? "true" : void 0,
|
|
633
631
|
"data-oc-modal-sheet-sizing": ot ? "managed" : void 0,
|
|
634
632
|
"data-oc-modal-sheet-transition": at === "auto" ? "auto" : void 0,
|
|
635
633
|
style: ut,
|
|
@@ -655,13 +653,13 @@ function _t({
|
|
|
655
653
|
ref: lt,
|
|
656
654
|
className: R(
|
|
657
655
|
c.surface,
|
|
658
|
-
c[
|
|
656
|
+
c[l],
|
|
659
657
|
e
|
|
660
658
|
),
|
|
661
659
|
"data-oc-part": "surface",
|
|
662
660
|
"data-oc-variant": n,
|
|
663
661
|
"data-oc-size": a,
|
|
664
|
-
"data-oc-resize":
|
|
662
|
+
"data-oc-resize": l,
|
|
665
663
|
"data-oc-content-transition": nt === "auto" ? "auto" : void 0,
|
|
666
664
|
"data-oc-modal-placement": r,
|
|
667
665
|
"data-oc-scrollable": o.scrollState.canScroll ? "true" : "false",
|
|
@@ -681,25 +679,23 @@ function Gt({
|
|
|
681
679
|
title: t,
|
|
682
680
|
children: n,
|
|
683
681
|
leadingContent: a,
|
|
684
|
-
trailingContent:
|
|
682
|
+
trailingContent: l,
|
|
685
683
|
closeLabel: N = "닫기",
|
|
686
684
|
closeButton: m = !0,
|
|
687
685
|
handle: C = !0,
|
|
688
686
|
ref: f,
|
|
689
687
|
...M
|
|
690
688
|
}) {
|
|
691
|
-
const h =
|
|
692
|
-
(
|
|
693
|
-
|
|
694
|
-
},
|
|
695
|
-
[f, g]
|
|
689
|
+
const h = me("ModalHeader"), { setHeaderNode: S, scrollState: x } = h, p = pe(
|
|
690
|
+
() => Fe(S, f),
|
|
691
|
+
[f, S]
|
|
696
692
|
), T = Qe(a);
|
|
697
693
|
return /* @__PURE__ */ ae(
|
|
698
694
|
bt,
|
|
699
695
|
{
|
|
700
696
|
...M,
|
|
701
697
|
as: "header",
|
|
702
|
-
ref:
|
|
698
|
+
ref: p,
|
|
703
699
|
backdrop: "compact",
|
|
704
700
|
className: R(c.header, e),
|
|
705
701
|
backColor: "var(--oc-color-theme-background-elevated-normal)",
|
|
@@ -725,9 +721,9 @@ function Gt({
|
|
|
725
721
|
"data-oc-part": "header-inner",
|
|
726
722
|
children: [
|
|
727
723
|
T ? /* @__PURE__ */ d("div", { className: c.headerLeading, "data-oc-part": "header-leading", children: a }) : null,
|
|
728
|
-
/* @__PURE__ */ d("div", { className: c.headerTitle, "data-oc-part": "header-title", children: t ? /* @__PURE__ */ d(
|
|
724
|
+
/* @__PURE__ */ d("div", { className: c.headerTitle, "data-oc-part": "header-title", children: t ? /* @__PURE__ */ d($.Title, { children: t }) : n }),
|
|
729
725
|
/* @__PURE__ */ ae("div", { className: c.headerTrailing, "data-oc-part": "header-trailing", children: [
|
|
730
|
-
|
|
726
|
+
l,
|
|
731
727
|
m ? /* @__PURE__ */ d(Xe, { label: N }) : null
|
|
732
728
|
] })
|
|
733
729
|
]
|
|
@@ -742,54 +738,54 @@ function Jt({
|
|
|
742
738
|
title: t,
|
|
743
739
|
children: n,
|
|
744
740
|
expanded: a,
|
|
745
|
-
defaultExpanded:
|
|
741
|
+
defaultExpanded: l = !0,
|
|
746
742
|
onExpandedChange: N,
|
|
747
743
|
disabled: m = !1,
|
|
748
744
|
forceMount: C = !0,
|
|
749
745
|
handle: f = !0,
|
|
750
746
|
headingLevel: M = 2,
|
|
751
747
|
indicator: h,
|
|
752
|
-
titleAsDialogTitle:
|
|
748
|
+
titleAsDialogTitle: S = !0,
|
|
753
749
|
navigationProps: x,
|
|
754
|
-
panelProps:
|
|
750
|
+
panelProps: p,
|
|
755
751
|
panelContentProps: T,
|
|
756
|
-
ref:
|
|
757
|
-
style:
|
|
752
|
+
ref: G,
|
|
753
|
+
style: O,
|
|
758
754
|
...J
|
|
759
755
|
}) {
|
|
760
|
-
const
|
|
761
|
-
canRenderHandle:
|
|
756
|
+
const fe = me("ModalNavigationSection"), {
|
|
757
|
+
canRenderHandle: A,
|
|
762
758
|
notifyPopupSnapLayoutChange: re,
|
|
763
759
|
placement: o
|
|
764
|
-
} =
|
|
760
|
+
} = fe, { height: q, setNode: F } = Pe(), K = ht(), [r, Q] = Ge({
|
|
765
761
|
value: a,
|
|
766
|
-
defaultValue:
|
|
762
|
+
defaultValue: l,
|
|
767
763
|
onChange: N
|
|
768
|
-
}), [X, Y] =
|
|
764
|
+
}), [X, Y] = v(
|
|
769
765
|
r ? "open" : "closed"
|
|
770
|
-
),
|
|
766
|
+
), W = `h${Wt(M) ? M : 2}`, {
|
|
771
767
|
className: Z = "",
|
|
772
768
|
id: ie,
|
|
773
|
-
onClick:
|
|
769
|
+
onClick: he,
|
|
774
770
|
...ee
|
|
775
771
|
} = x ?? {}, {
|
|
776
772
|
className: te = "",
|
|
777
|
-
id:
|
|
778
|
-
role:
|
|
773
|
+
id: b,
|
|
774
|
+
role: y,
|
|
779
775
|
...B
|
|
780
|
-
} =
|
|
781
|
-
...
|
|
782
|
-
"--oc-modal-navigation-block-size": `${
|
|
783
|
-
} :
|
|
784
|
-
(
|
|
785
|
-
Y(
|
|
776
|
+
} = p ?? {}, { className: U = "", ...I } = T ?? {}, D = ie ?? `${K}-navigation`, w = b ?? `${K}-panel`, u = `${K}-dialog-title`, V = Qe(t), L = f && A, P = q > 0 ? {
|
|
777
|
+
...O,
|
|
778
|
+
"--oc-modal-navigation-block-size": `${q}px`
|
|
779
|
+
} : O, oe = k(
|
|
780
|
+
(z) => {
|
|
781
|
+
Y(z), o === "popup" && re();
|
|
786
782
|
},
|
|
787
783
|
[re, o]
|
|
788
784
|
);
|
|
789
785
|
return /* @__PURE__ */ ae(
|
|
790
786
|
"section",
|
|
791
787
|
{
|
|
792
|
-
ref:
|
|
788
|
+
ref: G,
|
|
793
789
|
className: R(c.navigationSection, e),
|
|
794
790
|
style: P,
|
|
795
791
|
...J,
|
|
@@ -797,15 +793,15 @@ function Jt({
|
|
|
797
793
|
"data-oc-motion-state": X,
|
|
798
794
|
"data-oc-state": r ? "open" : "closed",
|
|
799
795
|
children: [
|
|
800
|
-
|
|
801
|
-
|
|
796
|
+
S && V ? /* @__PURE__ */ d(
|
|
797
|
+
$.Title,
|
|
802
798
|
{
|
|
803
799
|
className: c.navigationDialogTitle,
|
|
804
|
-
id:
|
|
800
|
+
id: u,
|
|
805
801
|
children: t
|
|
806
802
|
}
|
|
807
803
|
) : null,
|
|
808
|
-
|
|
804
|
+
L ? /* @__PURE__ */ d(
|
|
809
805
|
"div",
|
|
810
806
|
{
|
|
811
807
|
"aria-hidden": "true",
|
|
@@ -813,20 +809,20 @@ function Jt({
|
|
|
813
809
|
"data-oc-part": "handle"
|
|
814
810
|
}
|
|
815
811
|
) : null,
|
|
816
|
-
/* @__PURE__ */ d(
|
|
812
|
+
/* @__PURE__ */ d(W, { className: c.navigationHeading, "data-oc-part": "heading", children: /* @__PURE__ */ ae(
|
|
817
813
|
"button",
|
|
818
814
|
{
|
|
819
815
|
...ee,
|
|
820
|
-
ref:
|
|
821
|
-
id:
|
|
816
|
+
ref: F,
|
|
817
|
+
id: D,
|
|
822
818
|
className: R(c.navigation, Z),
|
|
823
819
|
type: "button",
|
|
824
820
|
disabled: m,
|
|
825
821
|
"aria-disabled": m ? "true" : ee["aria-disabled"],
|
|
826
822
|
"aria-expanded": r,
|
|
827
823
|
"aria-controls": w,
|
|
828
|
-
onClick: (
|
|
829
|
-
|
|
824
|
+
onClick: (z) => {
|
|
825
|
+
he?.(z), !(z.defaultPrevented || m) && Q(!r);
|
|
830
826
|
},
|
|
831
827
|
"data-oc-component": "modal-navigation",
|
|
832
828
|
"data-oc-part": "navigation",
|
|
@@ -867,10 +863,10 @@ function Jt({
|
|
|
867
863
|
},
|
|
868
864
|
...B,
|
|
869
865
|
"aria-hidden": r ? void 0 : !0,
|
|
870
|
-
"aria-labelledby":
|
|
866
|
+
"aria-labelledby": D,
|
|
871
867
|
id: w,
|
|
872
868
|
inert: r ? void 0 : !0,
|
|
873
|
-
role:
|
|
869
|
+
role: y ?? "region",
|
|
874
870
|
"data-oc-component": "modal-navigation-panel",
|
|
875
871
|
"data-oc-state": r ? "open" : "closed",
|
|
876
872
|
children: /* @__PURE__ */ d(
|
|
@@ -882,10 +878,10 @@ function Jt({
|
|
|
882
878
|
children: /* @__PURE__ */ d(
|
|
883
879
|
_e,
|
|
884
880
|
{
|
|
885
|
-
...
|
|
881
|
+
...I,
|
|
886
882
|
className: R(
|
|
887
883
|
c.navigationPanelInner,
|
|
888
|
-
|
|
884
|
+
U
|
|
889
885
|
),
|
|
890
886
|
"data-oc-component": "modal-navigation-panel-content",
|
|
891
887
|
children: n
|
|
@@ -904,27 +900,25 @@ function Qt({
|
|
|
904
900
|
children: t,
|
|
905
901
|
layout: n = "content",
|
|
906
902
|
containerClassName: a = "",
|
|
907
|
-
containerProps:
|
|
903
|
+
containerProps: l,
|
|
908
904
|
ref: N,
|
|
909
905
|
...m
|
|
910
906
|
}) {
|
|
911
|
-
const C =
|
|
912
|
-
(
|
|
913
|
-
h(Je(
|
|
907
|
+
const C = me("ModalBody"), { bodyNode: f, setBodyNode: M, setScrollState: h } = C, S = k(
|
|
908
|
+
(p) => {
|
|
909
|
+
h(Je(p));
|
|
914
910
|
},
|
|
915
911
|
[h]
|
|
916
|
-
), x =
|
|
917
|
-
(
|
|
918
|
-
|
|
919
|
-
},
|
|
920
|
-
[N, M, g]
|
|
912
|
+
), x = pe(
|
|
913
|
+
() => Fe(M, N, S),
|
|
914
|
+
[N, M, S]
|
|
921
915
|
);
|
|
922
916
|
return ne(() => {
|
|
923
|
-
const
|
|
924
|
-
if (!
|
|
925
|
-
const T = new ResizeObserver(() =>
|
|
926
|
-
return T.observe(
|
|
927
|
-
}, [f,
|
|
917
|
+
const p = f;
|
|
918
|
+
if (!p || (S(p), typeof ResizeObserver > "u")) return;
|
|
919
|
+
const T = new ResizeObserver(() => S(p));
|
|
920
|
+
return T.observe(p), p.firstElementChild && T.observe(p.firstElementChild), () => T.disconnect();
|
|
921
|
+
}, [f, S]), /* @__PURE__ */ d(
|
|
928
922
|
Ue,
|
|
929
923
|
{
|
|
930
924
|
...m,
|
|
@@ -938,13 +932,13 @@ function Qt({
|
|
|
938
932
|
className: c.bodyContainer,
|
|
939
933
|
"data-oc-part": "body-container",
|
|
940
934
|
"data-oc-component": "modal-body-container",
|
|
941
|
-
onScroll: (
|
|
942
|
-
|
|
935
|
+
onScroll: (p) => {
|
|
936
|
+
l?.onScroll?.(p), S(p.currentTarget);
|
|
943
937
|
},
|
|
944
938
|
children: /* @__PURE__ */ d(
|
|
945
939
|
"section",
|
|
946
940
|
{
|
|
947
|
-
...
|
|
941
|
+
...l,
|
|
948
942
|
className: R(c.bodyContent, a),
|
|
949
943
|
"data-oc-part": "body-content",
|
|
950
944
|
"data-oc-component": "modal-body-content",
|
|
@@ -962,18 +956,16 @@ function Xt({
|
|
|
962
956
|
children: t,
|
|
963
957
|
background: n = "auto",
|
|
964
958
|
ref: a,
|
|
965
|
-
...
|
|
959
|
+
...l
|
|
966
960
|
}) {
|
|
967
|
-
const N =
|
|
968
|
-
(
|
|
969
|
-
C(g), Fe(a, g);
|
|
970
|
-
},
|
|
961
|
+
const N = me("ModalFooter"), { scrollState: m, setFooterNode: C } = N, f = pe(
|
|
962
|
+
() => Fe(C, a),
|
|
971
963
|
[a, C]
|
|
972
964
|
), M = n === !0 || n === "auto" && m.canScroll && !m.scrolledToBottom;
|
|
973
965
|
return /* @__PURE__ */ d(
|
|
974
966
|
"footer",
|
|
975
967
|
{
|
|
976
|
-
...
|
|
968
|
+
...l,
|
|
977
969
|
ref: f,
|
|
978
970
|
className: R(c.footer, e),
|
|
979
971
|
"data-oc-part": "footer",
|
|
@@ -988,11 +980,11 @@ function Xe({
|
|
|
988
980
|
children: t = /* @__PURE__ */ d(gt, {}),
|
|
989
981
|
label: n = "닫기",
|
|
990
982
|
size: a = 24,
|
|
991
|
-
disabled:
|
|
983
|
+
disabled: l,
|
|
992
984
|
onClick: N,
|
|
993
985
|
...m
|
|
994
986
|
}) {
|
|
995
|
-
const C =
|
|
987
|
+
const C = me("ModalClose");
|
|
996
988
|
return /* @__PURE__ */ d(
|
|
997
989
|
St,
|
|
998
990
|
{
|
|
@@ -1001,16 +993,16 @@ function Xe({
|
|
|
1001
993
|
"aria-label": m["aria-label"] ?? n,
|
|
1002
994
|
"data-oc-part": "close",
|
|
1003
995
|
"data-oc-component": "modal-close",
|
|
1004
|
-
disabled:
|
|
996
|
+
disabled: l,
|
|
1005
997
|
onClick: (f) => {
|
|
1006
|
-
N?.(f), !f.defaultPrevented && !
|
|
998
|
+
N?.(f), !f.defaultPrevented && !l && C.requestClose({ reason: "close-button" });
|
|
1007
999
|
},
|
|
1008
1000
|
size: a,
|
|
1009
1001
|
children: t
|
|
1010
1002
|
}
|
|
1011
1003
|
);
|
|
1012
1004
|
}
|
|
1013
|
-
const
|
|
1005
|
+
const No = Object.assign(We, {
|
|
1014
1006
|
Root: We,
|
|
1015
1007
|
Trigger: Ut,
|
|
1016
1008
|
Content: _t,
|
|
@@ -1029,5 +1021,5 @@ export {
|
|
|
1029
1021
|
Jt as ModalNavigationSection,
|
|
1030
1022
|
We as ModalRoot,
|
|
1031
1023
|
Ut as ModalTrigger,
|
|
1032
|
-
|
|
1024
|
+
No as default
|
|
1033
1025
|
};
|