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