@orioncactuscorp/ui 1.8.0 → 1.9.1

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