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