prometeo-design-system 7.1.1 → 7.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { u as o, a as t } from "./useModalControl-sfny_3xt.js";
2
- import { D as u } from "./useModalControl-sfny_3xt.js";
1
+ import { u as o, a as t } from "./useModalControl-D5oehVFf.js";
2
+ import { D as u } from "./useModalControl-D5oehVFf.js";
3
3
  const s = o, e = t;
4
4
  export {
5
5
  u as default,
@@ -0,0 +1,566 @@
1
+ import { j as l } from "./jsx-runtime-GkKLlHH4.js";
2
+ import qe, { useContext as pt, createContext as yt, useRef as f, useState as se, useMemo as ye, useCallback as n, useLayoutEffect as X, useEffect as A, forwardRef as xt, useImperativeHandle as bt } from "react";
3
+ import { createPortal as vt } from "react-dom";
4
+ import { c as E } from "./cn-B6yFEsav.js";
5
+ import { D as wt } from "./Divider-BxsuAgUn.js";
6
+ import Ht from "./IconButton.es.js";
7
+ import { Close as St } from "./Icons/Close.es.js";
8
+ const Oe = yt(
9
+ null
10
+ );
11
+ function Gt() {
12
+ const u = pt(Oe);
13
+ if (!u)
14
+ throw new Error(
15
+ "Drawer slot components must be used inside <DrawerMobile> or <DrawerPanel>"
16
+ );
17
+ return u;
18
+ }
19
+ function Et(u, a) {
20
+ return {
21
+ title: a.title,
22
+ headerChildren: a.header,
23
+ headerActions: a.headerActions,
24
+ headerClassName: a.classNameHeader,
25
+ content: u,
26
+ contentClassName: a.classNameContent,
27
+ footer: a.footer,
28
+ footerClassName: a.classNameFooter
29
+ };
30
+ }
31
+ const Ue = "0.5s cubic-bezier(0.32, 0.72, 0, 1)", Rt = `transform ${Ue}`, Dt = `height ${Ue}`, Nt = 24, Ct = 0.05, Tt = 5;
32
+ function ze(u, a, J) {
33
+ if (typeof u == "string" && u.endsWith("%")) {
34
+ const R = parseFloat(u);
35
+ return R <= 0 ? J : R > 100 ? a : Math.min(R, 100) / 100 * a;
36
+ }
37
+ return typeof u == "string" && u.endsWith("px") ? parseFloat(u) : typeof u == "number" ? u >= 0 && u <= 1 ? u * a : u : 0;
38
+ }
39
+ function Mt({
40
+ children: u,
41
+ attachToParent: a = !1,
42
+ className: J,
43
+ classNameContent: R,
44
+ classNameFooter: K,
45
+ classNameHeader: Q,
46
+ isOpen: m,
47
+ applySnapRef: B,
48
+ onSnapChange: v,
49
+ snapPoints: ce = [0, "auto", 1],
50
+ hideOnClose: Z = !1,
51
+ unmountChildrenOnClose: p = !1,
52
+ header: L,
53
+ headerActions: V,
54
+ modal: $ = !1,
55
+ closeOnOverlayClick: ee = !1,
56
+ context: D,
57
+ footer: G,
58
+ zIndex: N = 60,
59
+ chromeHeightGetterRef: F,
60
+ hideCloseButton: le = !1,
61
+ title: w,
62
+ onRequestClose: k
63
+ }) {
64
+ const C = typeof u == "function" ? u(D) : u, H = !!(w || L || G), x = H ? Et(C, {
65
+ title: w,
66
+ header: L,
67
+ headerActions: V,
68
+ footer: G,
69
+ classNameHeader: Q,
70
+ classNameContent: R,
71
+ classNameFooter: K
72
+ }) : null, te = x?.title ?? w, s = x?.headerChildren ?? L, T = x?.headerActions ?? V, b = x?.footer ?? G, Xe = E(Q, x?.headerClassName), Je = E(R, x?.contentClassName), Ke = E(K, x?.footerClassName), Qe = x?.content ?? null, Ze = () => s ? typeof s == "string" ? /* @__PURE__ */ l.jsx(
73
+ "p",
74
+ {
75
+ style: { zIndex: N + 2 },
76
+ className: "pyrion-fonts-body-small text-neutral-secondary-default w-full text-balance",
77
+ children: s
78
+ }
79
+ ) : typeof s == "function" ? s(D) : qe.isValidElement(s) ? s : typeof s == "object" && "$$typeof" in s ? qe.createElement(
80
+ s,
81
+ { context: D }
82
+ ) : s : null, Ve = () => T ? typeof T == "function" ? T(D) : T : null, et = () => b ? typeof b == "function" ? b(D) : b : null, c = f(null), ie = f(null), xe = f(null), Y = f(0), ae = f("0%"), Ce = {
83
+ header: null,
84
+ headerTitle: null,
85
+ headerActions: null,
86
+ headerBody: null,
87
+ content: null,
88
+ footer: null
89
+ }, W = f({ ...Ce }), [be, tt] = se(Ce), [re, rt] = se(
90
+ null
91
+ ), q = ye(() => {
92
+ const e = (r) => (t) => {
93
+ W.current[r] !== t && (W.current[r] = t, tt(
94
+ (o) => o[r] === t ? o : { ...o, [r]: t }
95
+ ));
96
+ };
97
+ return {
98
+ header: e("header"),
99
+ headerTitle: e("headerTitle"),
100
+ headerActions: e("headerActions"),
101
+ headerBody: e("headerBody"),
102
+ content: e("content"),
103
+ footer: e("footer")
104
+ };
105
+ }, []), Te = n(
106
+ (e) => {
107
+ rt(e ?? null);
108
+ },
109
+ []
110
+ ), nt = ye(
111
+ () => ({ regions: be, registerForm: Te }),
112
+ [be, Te]
113
+ ), ue = n(() => W.current.header, []), h = n(() => W.current.content, []), z = n(() => W.current.footer, []), I = f(null), fe = f(null), ve = f(0), we = f(!0), He = f(null), Se = f(null), d = n(() => Z ? 0 : xe.current?.offsetHeight ?? 0, [Z]), M = n(() => {
114
+ if (!c.current) return 0;
115
+ const e = getComputedStyle(c.current);
116
+ return parseFloat(e.paddingTop) + parseFloat(e.paddingBottom);
117
+ }, []), y = n(() => c.current && a && c.current.parentElement?.offsetHeight || window.innerHeight, [a]), O = n(() => {
118
+ if (!c.current) return 0;
119
+ const e = y(), t = c.current.style.transform.match(/translateY\(([^)]+)px\)/);
120
+ return t ? e - parseFloat(t[1]) : 0;
121
+ }, [y]), de = n((e, r) => {
122
+ const t = [e > 0, !0, r > 0].filter(Boolean).length;
123
+ return Nt * Math.max(0, t - 1);
124
+ }, []), Ee = n(() => {
125
+ const e = M(), r = ue()?.offsetHeight ?? 0, t = z()?.offsetHeight ?? 0, o = de(r, t);
126
+ return e + r + t + o;
127
+ }, [de, M, z, ue]), j = n(() => {
128
+ const e = M(), r = ue()?.offsetHeight ?? 0, t = h()?.scrollHeight ?? 0, o = z()?.offsetHeight ?? 0, i = de(r, o);
129
+ return e + r + t + o + i;
130
+ }, [de, M, h, z, ue]);
131
+ X(() => {
132
+ F && (F.current = Ee);
133
+ }, [F, Ee]);
134
+ const Me = n(() => {
135
+ if (!c.current) return [];
136
+ const e = y(), r = d();
137
+ return ce?.map((t) => t === "auto" ? j() : typeof t == "string" && t.endsWith("%") ? parseFloat(t) > 100 ? e : parseFloat(t) / 100 * e : typeof t == "string" && t.endsWith("px") ? parseFloat(t) : typeof t == "number" && t >= 0 && t <= 1 ? t * e : t === 0 ? r : typeof t == "number" ? t : 0) || [];
138
+ }, [ce, y, d, j]), he = n((e, r) => {
139
+ if (!ie.current) return;
140
+ const t = He.current ?? M(), o = Se.current ?? d(), i = Math.max(0, e - t), g = e <= o, _ = g ? ve.current : i;
141
+ ie.current.style.transition = r ? Dt : "none", ie.current.style.height = `${_}px`, g || (ve.current = _);
142
+ }, [M, d]), je = n((e) => {
143
+ const r = h();
144
+ r && (r.classList.toggle("drawer-mobile-content--open", e), r.classList.toggle("drawer-mobile-content--closed", !e));
145
+ }, [h]), ot = () => {
146
+ h()?.classList.remove("prometeo-scrollbar-none");
147
+ }, st = () => {
148
+ h()?.classList.add("prometeo-scrollbar-none");
149
+ }, Ae = n((e, r) => {
150
+ const t = Me();
151
+ if (t.length === 0) return e;
152
+ const o = d();
153
+ if (Math.abs(r) > Ct) {
154
+ if (r > 0) {
155
+ const g = t.filter((_) => _ < e);
156
+ return g.length > 0 ? Math.max(...g) : o;
157
+ }
158
+ const i = t.filter((g) => g > e);
159
+ if (i.length > 0)
160
+ return Math.min(...i);
161
+ }
162
+ return t.reduce(
163
+ (i, g) => Math.abs(g - e) < Math.abs(i - e) ? g : i
164
+ );
165
+ }, [Me, d]), Le = n((e) => {
166
+ const r = d(), t = e <= r ? "0%" : e;
167
+ v(t);
168
+ }, [v, d]), ct = (e, r) => {
169
+ const t = Ee(), o = e - t;
170
+ r > o ? ot() : st();
171
+ }, S = n((e, r = !0) => {
172
+ if (!c.current) return;
173
+ const t = y(), o = Math.max(0, t - e);
174
+ he(e, r), c.current.style.transition = Rt, c.current.style.transform = `translateY(${o}px)`;
175
+ const i = Y.current || h()?.scrollHeight || 0;
176
+ ct(e, i);
177
+ }, [y, he, h]), ne = n((e) => {
178
+ if (!c.current) return;
179
+ const r = y(), t = Math.max(0, r - e);
180
+ c.current.style.transition = "none", c.current.style.transform = `translateY(${t}px)`, he(e, !1);
181
+ }, [y, he]), Fe = n(() => {
182
+ if (fe.current && a) {
183
+ const { scrollY: e } = fe.current;
184
+ document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, e), fe.current = null;
185
+ }
186
+ }, [a]), Ye = n(() => {
187
+ if (!a) return;
188
+ const e = window.scrollY;
189
+ fe.current = { scrollY: e }, document.body.style.position = "fixed", document.body.style.top = `-${e}px`, document.body.style.width = "100%";
190
+ }, [a]), me = n(() => {
191
+ He.current = M(), Se.current = d();
192
+ }, [M, d]), Ie = n(() => {
193
+ He.current = null, Se.current = null;
194
+ }, []), Re = n((e) => {
195
+ if (!c.current) return;
196
+ me();
197
+ const r = e.touches[0], t = O();
198
+ I.current = {
199
+ isDragging: !1,
200
+ startY: r.clientY,
201
+ startHeight: t,
202
+ lastY: r.clientY,
203
+ lastTime: Date.now(),
204
+ velocity: 0
205
+ };
206
+ }, [O, me]), Pe = n((e) => {
207
+ if (!c.current) return;
208
+ me();
209
+ const r = O();
210
+ I.current = {
211
+ isDragging: !1,
212
+ startY: e.clientY,
213
+ startHeight: r,
214
+ lastY: e.clientY,
215
+ lastTime: Date.now(),
216
+ velocity: 0
217
+ };
218
+ }, [O, me]), ge = n((e, r) => {
219
+ if (!I.current || !c.current) return;
220
+ const t = I.current, o = t.startY - e, i = t.isDragging || Math.abs(o) > Tt;
221
+ if (!t.isDragging && i && (t.isDragging = !0, Ye()), !i) return;
222
+ r.preventDefault();
223
+ const g = Date.now(), _ = g - t.lastTime;
224
+ if (_ > 0) {
225
+ const gt = (e - t.lastY) / _;
226
+ t.velocity = t.velocity * 0.8 + gt * 0.2;
227
+ }
228
+ t.lastY = e, t.lastTime = g;
229
+ const dt = t.startHeight + o, ht = y(), mt = Math.max(0, Math.min(dt, ht));
230
+ ne(mt);
231
+ }, [Ye, y, ne]), De = n((e) => {
232
+ ge(e.touches[0].clientY, e);
233
+ }, [ge]), _e = n((e) => {
234
+ ge(e.clientY, e);
235
+ }, [ge]), P = n(() => {
236
+ if (I.current?.isDragging && c.current) {
237
+ Fe();
238
+ const e = O(), r = Ae(e, I.current.velocity);
239
+ Le(r);
240
+ }
241
+ I.current = null, Ie();
242
+ }, [Ae, Le, Fe, O, Ie]), Ne = n((e) => {
243
+ Pe(e);
244
+ const r = (o) => _e(o), t = () => {
245
+ document.removeEventListener("mousemove", r, { capture: !0 }), document.removeEventListener("mouseup", t, { capture: !0 }), P();
246
+ };
247
+ document.addEventListener("mousemove", r, { passive: !1, capture: !0 }), document.addEventListener("mouseup", t, { capture: !0 });
248
+ }, [Pe, _e, P]);
249
+ A(() => {
250
+ const e = xe.current;
251
+ if (e)
252
+ return e.addEventListener("touchstart", Re, { passive: !1 }), e.addEventListener("touchmove", De, { passive: !1 }), e.addEventListener("touchend", P), e.addEventListener("touchcancel", P), e.addEventListener("mousedown", Ne, { passive: !1 }), () => {
253
+ e.removeEventListener("touchstart", Re), e.removeEventListener("touchmove", De), e.removeEventListener("touchend", P), e.removeEventListener("touchcancel", P), e.removeEventListener("mousedown", Ne);
254
+ };
255
+ }, [Re, De, P, Ne]);
256
+ const [U, Be] = se(() => p ? m : !0), oe = f(null);
257
+ A(() => {
258
+ p && m && Be(!0);
259
+ }, [m, p]), A(() => {
260
+ if (!p) return;
261
+ const e = c.current;
262
+ if (!e) return;
263
+ const r = (t) => {
264
+ t.propertyName === "transform" && (m || Be(!1));
265
+ };
266
+ return e.addEventListener("transitionend", r), () => e.removeEventListener("transitionend", r);
267
+ }, [m, p]);
268
+ const $e = n((e) => {
269
+ const r = e === "0%";
270
+ !r && we.current && (ve.current = d()), we.current = r;
271
+ }, [d]), Ge = n(() => {
272
+ c.current && (c.current.style.visibility = "hidden", ne(d()), requestAnimationFrame(() => {
273
+ requestAnimationFrame(() => {
274
+ if (!c.current) return;
275
+ const e = z(), r = !b || e != null && e.children.length >= 0, t = h(), o = t && t.children.length > 0;
276
+ t && o && r ? (Y.current = t.scrollHeight, S(j(), !1), c.current.style.visibility = "") : (r && ne(d()), c.current.style.visibility = "");
277
+ });
278
+ }));
279
+ }, [
280
+ b,
281
+ ne,
282
+ d,
283
+ S,
284
+ j,
285
+ h,
286
+ z
287
+ ]), pe = n((e) => {
288
+ if (!e) return;
289
+ if (ae.current = e, p && !U && e !== "0%") {
290
+ oe.current = e;
291
+ return;
292
+ }
293
+ oe.current = null, je(e !== "0%"), U && h() && Y.current === 0 && (Y.current = h()?.scrollHeight ?? 0);
294
+ const r = e !== "0%" && we.current;
295
+ if ($e(e), e === "auto") {
296
+ Ge();
297
+ return;
298
+ }
299
+ const t = y(), o = d(), i = ze(e, t, o);
300
+ S(i, !r);
301
+ }, [
302
+ p,
303
+ U,
304
+ $e,
305
+ Ge,
306
+ S,
307
+ y,
308
+ d,
309
+ je,
310
+ h
311
+ ]);
312
+ X(() => {
313
+ if (!m) return;
314
+ const e = ae.current;
315
+ if (!e || e === "0%") return;
316
+ const r = h();
317
+ if (r) {
318
+ const g = r.scrollHeight;
319
+ g > 0 && (Y.current = g);
320
+ }
321
+ const t = y(), o = d(), i = ze(e, t, o);
322
+ S(i, !1);
323
+ }, [m, y, d, S, h]), X(() => {
324
+ if (!m) return;
325
+ const e = W.current.content;
326
+ if (!e) return;
327
+ let r = 0;
328
+ const t = () => {
329
+ if (ae.current !== "auto") return;
330
+ const i = e.scrollHeight;
331
+ i <= 0 || i === r || (r = i, Y.current = i, S(j(), !0));
332
+ };
333
+ t();
334
+ const o = new ResizeObserver(t);
335
+ return o.observe(e), () => o.disconnect();
336
+ }, [m, be.content, S, j]), X(() => {
337
+ if (!m || !re) return;
338
+ const e = h();
339
+ e && (Y.current = e.scrollHeight, ae.current === "auto" && S(j(), !1));
340
+ }, [re, m, h, S, j]), X(() => (B.current = pe, () => {
341
+ B.current = null;
342
+ }), [pe]), X(() => {
343
+ if (U && oe.current) {
344
+ const e = oe.current;
345
+ oe.current = null, pe(e);
346
+ }
347
+ }, [U, pe]);
348
+ const lt = ye(
349
+ () => navigator.userAgent.includes("iPhone") || navigator.userAgent.includes("iPad") || navigator.userAgent.includes("iPod"),
350
+ []
351
+ ), it = ye(() => window.matchMedia("(display-mode: standalone)").matches, []), at = Z ? 0 : d(), ut = /* @__PURE__ */ l.jsxs(
352
+ "div",
353
+ {
354
+ ref: q.header,
355
+ className: E(
356
+ "pb-4 flex flex-col gap-3 items-start justify-start border-b border-neutral-default-default",
357
+ Xe
358
+ ),
359
+ children: [
360
+ /* @__PURE__ */ l.jsxs("div", { className: "pl-4 pr-2 gap-1 flex items-end w-full", children: [
361
+ /* @__PURE__ */ l.jsx(
362
+ "div",
363
+ {
364
+ ref: q.headerTitle,
365
+ className: "flex-1 min-w-0 flex items-end",
366
+ children: H && te ? /* @__PURE__ */ l.jsx("h4", { className: "pyrion-fonts-headline-small text-neutral-primary-default flex-1 truncate", children: te }) : null
367
+ }
368
+ ),
369
+ /* @__PURE__ */ l.jsx(
370
+ "div",
371
+ {
372
+ ref: q.headerActions,
373
+ className: "flex shrink-0 pl-4 pr-2 gap-1 items-end",
374
+ children: H ? Ve() : null
375
+ }
376
+ ),
377
+ !le && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
378
+ /* @__PURE__ */ l.jsx(wt, { orientation: "vertical" }),
379
+ /* @__PURE__ */ l.jsx(
380
+ Ht,
381
+ {
382
+ icon: St,
383
+ variant: "text",
384
+ color: "neutral",
385
+ size: "small",
386
+ onClick: k
387
+ }
388
+ )
389
+ ] })
390
+ ] }),
391
+ /* @__PURE__ */ l.jsx("div", { ref: q.headerBody, className: "w-full", children: H ? Ze() : null })
392
+ ]
393
+ }
394
+ ), ke = /* @__PURE__ */ l.jsx(
395
+ "div",
396
+ {
397
+ ref: q.content,
398
+ className: E(
399
+ "drawer-mobile-content pyrion-scrollbar-thin-weak",
400
+ m ? "drawer-mobile-content--open" : "drawer-mobile-content--closed",
401
+ "w-full flex-1 min-h-0 overflow-y-auto",
402
+ "flex flex-col gap-6 px-4 items-start justify-start",
403
+ Je
404
+ ),
405
+ children: (!p || U) && (H ? Qe : C)
406
+ }
407
+ ), We = /* @__PURE__ */ l.jsx(
408
+ "div",
409
+ {
410
+ ref: q.footer,
411
+ className: E(
412
+ "w-full flex px-4 pt-4 gap-4 pb-0 items-center justify-center",
413
+ "border-t border-neutral-default-default",
414
+ "shrink-0",
415
+ it && lt && "pb-8",
416
+ Ke
417
+ ),
418
+ children: H && b ? et() : null
419
+ }
420
+ ), ft = re ? /* @__PURE__ */ l.jsxs("form", { ...re, className: E("contents", re.className), children: [
421
+ ke,
422
+ We
423
+ ] }) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
424
+ ke,
425
+ We
426
+ ] });
427
+ return /* @__PURE__ */ l.jsx(Oe.Provider, { value: nt, children: /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
428
+ ($ || ee) && /* @__PURE__ */ l.jsx(
429
+ "div",
430
+ {
431
+ style: { zIndex: N },
432
+ className: E(
433
+ m ? "fixed inset-0 cursor-default" : "hidden",
434
+ $ && "bg-black/40"
435
+ ),
436
+ onClick: (e) => {
437
+ e.preventDefault(), e.stopPropagation(), ee && k();
438
+ },
439
+ "aria-hidden": "true"
440
+ }
441
+ ),
442
+ /* @__PURE__ */ l.jsxs(
443
+ "div",
444
+ {
445
+ ref: c,
446
+ style: { zIndex: N, transform: "translateY(100%)" },
447
+ className: E(
448
+ "h-full",
449
+ a ? "absolute" : "fixed",
450
+ "bottom-0 w-full overflow-hidden",
451
+ "bg-neutral-default-default",
452
+ "border-t border-neutral-default-default rounded-t-300",
453
+ "flex flex-col items-center pt-7 pb-6 gap-2",
454
+ "touch-none select-none will-change-transform",
455
+ J
456
+ ),
457
+ children: [
458
+ /* @__PURE__ */ l.jsx(
459
+ "div",
460
+ {
461
+ ref: xe,
462
+ style: { zIndex: N + 1 },
463
+ className: "w-full absolute top-0 pt-4 pb-2 flex items-end justify-center cursor-grab active:cursor-grabbing bg-inherit!",
464
+ children: /* @__PURE__ */ l.jsx("span", { className: "w-12 h-1 rounded-full bg-neutral-tertiary-default" })
465
+ }
466
+ ),
467
+ /* @__PURE__ */ l.jsxs(
468
+ "div",
469
+ {
470
+ ref: ie,
471
+ style: { height: `${at}px` },
472
+ className: "w-full flex flex-col min-h-0 overflow-hidden gap-6",
473
+ children: [
474
+ ut,
475
+ ft
476
+ ]
477
+ }
478
+ )
479
+ ]
480
+ }
481
+ )
482
+ ] }) });
483
+ }
484
+ const jt = Mt, At = 300, Lt = xt(function(a, J) {
485
+ const {
486
+ children: R,
487
+ defaultOpen: K = !1,
488
+ onClose: Q,
489
+ snapPoints: m = ["auto"],
490
+ setSnap: B,
491
+ snap: v,
492
+ attachToParent: ce = !1,
493
+ classNameHeader: Z
494
+ } = a, p = f(v || "0%"), [L, V] = se(!1), [$, ee] = se(null), D = f(Q), G = f(B), N = f($), F = f(/* @__PURE__ */ new Set()), le = f(() => 0), w = f(null), k = f(null);
495
+ D.current = Q, N.current = $, A(() => {
496
+ G.current = B;
497
+ }, [B]);
498
+ const C = n((s) => {
499
+ const T = p.current !== "0%";
500
+ p.current = s;
501
+ const b = s !== "0%";
502
+ T !== b && V(b), G.current?.(s), k.current?.(s);
503
+ }, []);
504
+ A(() => {
505
+ if (v == null || v === p.current) return;
506
+ p.current = v, V(v !== "0%"), k.current?.(v);
507
+ }, [v]), A(() => {
508
+ K && x();
509
+ }, [K]);
510
+ const H = n(() => {
511
+ C("0%"), D.current?.(N.current), w.current && clearTimeout(w.current), w.current = setTimeout(() => {
512
+ ee(null), w.current = null;
513
+ }, At);
514
+ }, [C]);
515
+ A(() => () => {
516
+ w.current && clearTimeout(w.current);
517
+ }, []);
518
+ const x = n(
519
+ (s, T) => {
520
+ const b = T || m[0] || "60%";
521
+ ee(s ?? null), C(b);
522
+ },
523
+ [m, C]
524
+ );
525
+ A(() => {
526
+ F.current.forEach((s) => {
527
+ try {
528
+ s(L);
529
+ } catch {
530
+ }
531
+ });
532
+ }, [L]), bt(
533
+ J,
534
+ () => ({
535
+ open: x,
536
+ close: H,
537
+ get isOpen() {
538
+ return p.current !== "0%";
539
+ },
540
+ subscribeOpenChange: (s) => (F.current.add(s), s(p.current !== "0%"), () => F.current.delete(s)),
541
+ getContext: () => N.current,
542
+ getChromeHeight: () => le.current()
543
+ }),
544
+ [x, H]
545
+ );
546
+ const te = /* @__PURE__ */ l.jsx(
547
+ jt,
548
+ {
549
+ ...a,
550
+ classNameHeader: Z,
551
+ isOpen: L,
552
+ applySnapRef: k,
553
+ onSnapChange: C,
554
+ context: $,
555
+ chromeHeightGetterRef: le,
556
+ onRequestClose: H,
557
+ children: R
558
+ }
559
+ );
560
+ return ce ? te : vt(te, document.body);
561
+ });
562
+ Lt.displayName = "DrawerMobile";
563
+ export {
564
+ Lt as D,
565
+ Gt as u
566
+ };
@@ -1,4 +1,4 @@
1
- import { D as a } from "./DrawerMobile-VjhsKiXN.js";
1
+ import { D as a } from "./DrawerMobile-CZ7EoU0P.js";
2
2
  import { u as o, c as t, b as u, a as D } from "./useDrawerControl-H3_CBNvK.js";
3
3
  export {
4
4
  a as default,
package/dist/Menu.es.js CHANGED
@@ -4,7 +4,7 @@ import { C as ot } from "./CardBackground-D5SgTU1i.js";
4
4
  import { c as H } from "./cn-B6yFEsav.js";
5
5
  import { u as rt } from "./useDevice-S7cYqLVh.js";
6
6
  import { createPortal as st } from "react-dom";
7
- import { D as it } from "./DrawerMobile-VjhsKiXN.js";
7
+ import { D as it } from "./DrawerMobile-CZ7EoU0P.js";
8
8
  const ct = {
9
9
  color: "neutral",
10
10
  variant: "primary",