prometeo-design-system 5.8.2 → 5.8.3

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,86 +1,96 @@
1
- import { j as w } from "./jsx-runtime-GkKLlHH4.js";
2
- import { c as A } from "./cn-B6yFEsav.js";
3
- import ie, { forwardRef as ge, useState as G, useRef as m, useEffect as D, useCallback as i, useMemo as ue, useImperativeHandle as he } from "react";
4
- import { createPortal as me } from "react-dom";
5
- const X = 44, pe = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", He = ge((d, l) => {
6
- const { children: L, defaultOpen: j = !1, onClose: F, snapPoints: o = ["auto"], setSnap: g, snap: f, attachToParent: N = !1 } = d, [p, u] = G(f || "0%"), [T, C] = G(null), E = m(F), y = m(g), H = m(T), r = m(/* @__PURE__ */ new Set());
7
- E.current = F, H.current = T, D(() => {
8
- j && M();
9
- }, [j]), D(() => {
10
- y.current = g;
11
- }, [g]);
12
- const v = i(() => {
13
- u("0%"), E.current?.(H.current), setTimeout(() => C(null), 300);
14
- }, []), M = i((a, Y) => {
15
- u(a || o[0] || "60%"), C(Y ?? null);
16
- }, [o]), x = ue(() => p !== "0%", [p]);
1
+ import { j as b } from "./jsx-runtime-GkKLlHH4.js";
2
+ import { c as _ } from "./cn-B6yFEsav.js";
3
+ import ue, { forwardRef as me, useState as G, useRef as m, useEffect as D, useCallback as c, useMemo as fe, useImperativeHandle as pe, useLayoutEffect as we } from "react";
4
+ import { createPortal as be } from "react-dom";
5
+ const $ = 44, ve = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", Ee = me((g, l) => {
6
+ const { children: j, defaultOpen: F = !1, onClose: N, snapPoints: o = ["auto"], setSnap: h, snap: d, attachToParent: C = !1 } = g, [p, u] = G(d || "0%"), [T, A] = G(null), E = m(N), y = m(h), H = m(T), M = m(/* @__PURE__ */ new Set()), r = m(() => $);
7
+ E.current = N, H.current = T, D(() => {
8
+ F && Y();
9
+ }, [F]), D(() => {
10
+ y.current = h;
11
+ }, [h]);
12
+ const w = c(() => {
13
+ u("0%"), E.current?.(H.current), setTimeout(() => A(null), 300);
14
+ }, []), Y = c((a, R) => {
15
+ u(a || o[0] || "60%"), A(R ?? null);
16
+ }, [o]), x = fe(() => p !== "0%", [p]);
17
17
  D(() => {
18
- r.current.forEach((a) => {
18
+ M.current.forEach((a) => {
19
19
  try {
20
20
  a(x);
21
21
  } catch {
22
22
  }
23
23
  });
24
- }, [x]), he(l, () => ({
25
- open: M,
26
- close: v,
24
+ }, [x]), pe(l, () => ({
25
+ open: Y,
26
+ close: w,
27
27
  isOpen: x,
28
- subscribeOpenChange: (a) => (r.current.add(a), () => {
29
- r.current.delete(a);
28
+ subscribeOpenChange: (a) => (M.current.add(a), () => {
29
+ M.current.delete(a);
30
30
  }),
31
- getContext: () => H.current
32
- }), [M, v, x]);
33
- const $ = f || p;
34
- return N ? /* @__PURE__ */ w.jsx(le, { ...d, snap: $, setSnap: u, context: T, children: L }) : me(/* @__PURE__ */ w.jsx(le, { ...d, snap: $, setSnap: u, context: T, children: L }), document.body);
35
- }), le = ({ children: d, attachToParent: l = !1, className: L, classNameContent: j, classNameFooter: F, snap: o, snapPoints: g = [0, "auto", 1], setSnap: f, hideOnClose: N = !1, unmountChildrenOnClose: p = !1, header: u, modal: T = !1, closeOnOverlayClick: C = !1, context: E, footer: y, zIndex: H = 60 }) => {
36
- const r = m(null), v = m(null), M = m(null), x = m(null), $ = m(null), O = m(0), a = m(null), Y = m(null), Z = i(() => {
31
+ getContext: () => H.current,
32
+ getChromeHeight: () => r.current()
33
+ }), [Y, w, x, r]);
34
+ const k = d || p;
35
+ return C ? /* @__PURE__ */ b.jsx(ae, { ...g, snap: k, setSnap: u, context: T, chromeHeightGetterRef: r, children: j }) : be(/* @__PURE__ */ b.jsx(ae, { ...g, snap: k, setSnap: u, context: T, chromeHeightGetterRef: r, children: j }), document.body);
36
+ }), ae = ({ children: g, attachToParent: l = !1, className: j, classNameContent: F, classNameFooter: N, snap: o, snapPoints: h = [0, "auto", 1], setSnap: d, hideOnClose: C = !1, unmountChildrenOnClose: p = !1, header: u, modal: T = !1, closeOnOverlayClick: A = !1, context: E, footer: y, zIndex: H = 60, chromeHeightGetterRef: M }) => {
37
+ const r = m(null), w = m(null), Y = m(null), x = m(null), k = m(null), B = m(0), a = m(null), R = m(null), ee = c(() => {
37
38
  if (!r.current) return [];
38
39
  const e = l && r.current.parentElement?.offsetHeight || window.innerHeight;
39
- return g?.map((t) => {
40
+ return h?.map((t) => {
40
41
  if (t === "auto") {
41
- const n = O.current, h = W(), c = P(), s = ee(), b = q(e, n, h, c, s);
42
- return parseFloat(b) / 100 * e;
42
+ const n = B.current, f = q(), i = W(), s = te(), v = V(e, n, f, i, s);
43
+ return parseFloat(v) / 100 * e;
43
44
  }
44
45
  return 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 : typeof t == "number" ? t : 0;
45
46
  }) || [];
46
- }, [g, l]), W = i(() => 46, []), _ = i(() => v.current?.scrollHeight ?? 0, []), P = i(() => {
47
- const e = M.current?.scrollHeight ?? 0;
47
+ }, [h, l]), q = c(() => 46, []), U = c(() => w.current?.scrollHeight ?? 0, []), W = c(() => {
48
+ const e = Y.current?.scrollHeight ?? 0;
48
49
  return e > 0 ? e + 2 : 0;
49
- }, []), ee = i(() => x.current?.scrollHeight ?? 0, []), q = i((e, t, n, h, c) => {
50
- const s = n + c + t + h, b = Math.min(100, s / e * 100);
51
- return `${Math.round(b)}%`;
52
- }, []), te = i((e, t) => {
53
- const n = Z();
50
+ }, []), te = c(() => x.current?.scrollHeight ?? 0, []), V = c((e, t, n, f, i) => {
51
+ const s = n + i + t + f, v = Math.min(100, s / e * 100);
52
+ return `${Math.round(v)}%`;
53
+ }, []), ne = c(() => {
54
+ if (!r.current || !w.current)
55
+ return $;
56
+ const e = r.current.getBoundingClientRect(), t = w.current.getBoundingClientRect(), n = Math.max(0, t.top - e.top), f = W();
57
+ return $ + n + f;
58
+ }, [W]);
59
+ we(() => {
60
+ M && (M.current = ne);
61
+ }, [M, ne]);
62
+ const re = c((e, t) => {
63
+ const n = ee();
54
64
  if (n.length === 0) return e;
55
65
  if (Math.abs(t) > 0.05)
56
66
  if (t > 0) {
57
- const c = n.filter((s) => s < e);
58
- return c.length > 0 ? Math.max(...c) : N ? 0 : X;
67
+ const i = n.filter((s) => s < e);
68
+ return i.length > 0 ? Math.max(...i) : C ? 0 : $;
59
69
  } else {
60
- const c = n.filter((s) => s > e);
61
- if (c.length > 0)
62
- return Math.min(...c);
70
+ const i = n.filter((s) => s > e);
71
+ if (i.length > 0)
72
+ return Math.min(...i);
63
73
  }
64
- return n.reduce((c, s) => Math.abs(s - e) < Math.abs(c - e) ? s : c);
65
- }, [Z]), B = i((e) => {
66
- if (f && g) {
67
- const t = l && r.current?.parentElement?.offsetHeight || window.innerHeight, n = e <= X ? "0%" : `${Math.round(e / t * 100)}%`;
68
- f(n);
74
+ return n.reduce((i, s) => Math.abs(s - e) < Math.abs(i - e) ? s : i);
75
+ }, [ee]), z = c((e) => {
76
+ if (d && h) {
77
+ const t = l && r.current?.parentElement?.offsetHeight || window.innerHeight, n = e <= $ ? "0%" : `${Math.round(e / t * 100)}%`;
78
+ d(n);
69
79
  }
70
- }, [f, g, l]), ne = i((e) => {
71
- r.current && (r.current.style.transition = pe, r.current.style.height = `${e}px`, de(e, O.current || _()));
72
- }, [f, g, l]), ae = () => {
73
- v.current?.classList.remove("prometeo-scrollbar-none");
74
- }, fe = () => {
75
- v.current?.classList.add("prometeo-scrollbar-none");
76
- }, de = (e, t) => {
77
- t > e ? ae() : fe();
78
- }, re = i(() => {
79
- if (Y.current && l) {
80
- const { scrollY: e } = Y.current;
81
- document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, e), Y.current = null;
80
+ }, [d, h, l]), oe = c((e) => {
81
+ r.current && (r.current.style.transition = ve, r.current.style.height = `${e}px`, he(e, B.current || U()));
82
+ }, [d, h, l]), de = () => {
83
+ w.current?.classList.remove("prometeo-scrollbar-none");
84
+ }, ge = () => {
85
+ w.current?.classList.add("prometeo-scrollbar-none");
86
+ }, he = (e, t) => {
87
+ t > e ? de() : ge();
88
+ }, se = c(() => {
89
+ if (R.current && l) {
90
+ const { scrollY: e } = R.current;
91
+ document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, e), R.current = null;
82
92
  }
83
- }, [l]), U = i((e) => {
93
+ }, [l]), J = c((e) => {
84
94
  if (!r.current) return;
85
95
  const t = e.touches[0], n = r.current.offsetHeight;
86
96
  a.current = {
@@ -91,7 +101,7 @@ const X = 44, pe = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", He = ge((d, l)
91
101
  lastTime: Date.now(),
92
102
  velocity: 0
93
103
  };
94
- }, []), oe = i((e) => {
104
+ }, []), ce = c((e) => {
95
105
  if (!r.current) return;
96
106
  const t = e, n = r.current.offsetHeight;
97
107
  a.current = {
@@ -102,183 +112,183 @@ const X = 44, pe = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", He = ge((d, l)
102
112
  lastTime: Date.now(),
103
113
  velocity: 0
104
114
  };
105
- }, []), V = i((e) => {
115
+ }, []), K = c((e) => {
106
116
  if (!a.current || !r.current) return;
107
- const t = e.touches[0], n = a.current, h = n.startY - t.clientY, c = n.isDragging || Math.abs(h) > 5;
108
- if (!n.isDragging && c && (n.isDragging = !0, l)) {
117
+ const t = e.touches[0], n = a.current, f = n.startY - t.clientY, i = n.isDragging || Math.abs(f) > 5;
118
+ if (!n.isDragging && i && (n.isDragging = !0, l)) {
109
119
  const s = window.scrollY;
110
- Y.current = { scrollY: s }, document.body.style.position = "fixed", document.body.style.top = `-${s}px`, document.body.style.width = "100%";
120
+ R.current = { scrollY: s }, document.body.style.position = "fixed", document.body.style.top = `-${s}px`, document.body.style.width = "100%";
111
121
  }
112
- if (c) {
122
+ if (i) {
113
123
  e.preventDefault();
114
- const s = Date.now(), b = s - n.lastTime;
115
- if (b > 0) {
116
- const Q = (t.clientY - n.lastY) / b;
117
- n.velocity = n.velocity * 0.8 + Q * 0.2;
124
+ const s = Date.now(), v = s - n.lastTime;
125
+ if (v > 0) {
126
+ const P = (t.clientY - n.lastY) / v;
127
+ n.velocity = n.velocity * 0.8 + P * 0.2;
118
128
  }
119
129
  n.lastY = t.clientY, n.lastTime = s;
120
- const k = n.startHeight + h, I = l && r.current.parentElement?.offsetHeight || window.innerHeight, K = Math.max(0, Math.min(k, I));
121
- r.current.style.transition = "none", r.current.style.height = `${K}px`;
130
+ const I = n.startHeight + f, O = l && r.current.parentElement?.offsetHeight || window.innerHeight, Z = Math.max(0, Math.min(I, O));
131
+ r.current.style.transition = "none", r.current.style.height = `${Z}px`;
122
132
  }
123
- }, [l]), se = i((e) => {
133
+ }, [l]), ie = c((e) => {
124
134
  if (!a.current || !r.current) return;
125
- const t = e, n = a.current, h = n.startY - t.clientY, c = n.isDragging || Math.abs(h) > 5;
126
- if (!n.isDragging && c && (n.isDragging = !0, l)) {
135
+ const t = e, n = a.current, f = n.startY - t.clientY, i = n.isDragging || Math.abs(f) > 5;
136
+ if (!n.isDragging && i && (n.isDragging = !0, l)) {
127
137
  const s = window.scrollY;
128
- Y.current = { scrollY: s }, document.body.style.position = "fixed", document.body.style.top = `-${s}px`, document.body.style.width = "100%";
138
+ R.current = { scrollY: s }, document.body.style.position = "fixed", document.body.style.top = `-${s}px`, document.body.style.width = "100%";
129
139
  }
130
- if (c) {
140
+ if (i) {
131
141
  e.preventDefault();
132
- const s = Date.now(), b = s - n.lastTime;
133
- if (b > 0) {
134
- const Q = (t.clientY - n.lastY) / b;
135
- n.velocity = n.velocity * 0.8 + Q * 0.2;
142
+ const s = Date.now(), v = s - n.lastTime;
143
+ if (v > 0) {
144
+ const P = (t.clientY - n.lastY) / v;
145
+ n.velocity = n.velocity * 0.8 + P * 0.2;
136
146
  }
137
147
  n.lastY = t.clientY, n.lastTime = s;
138
- const k = n.startHeight + h, I = l && r.current.parentElement?.offsetHeight || window.innerHeight, K = Math.max(0, Math.min(k, I));
139
- r.current.style.transition = "none", r.current.style.height = `${K}px`;
148
+ const I = n.startHeight + f, O = l && r.current.parentElement?.offsetHeight || window.innerHeight, Z = Math.max(0, Math.min(I, O));
149
+ r.current.style.transition = "none", r.current.style.height = `${Z}px`;
140
150
  }
141
- }, [l]), S = i(() => {
151
+ }, [l]), S = c(() => {
142
152
  if (!a.current || !r.current) return;
143
153
  const e = a.current;
144
154
  if (e.isDragging) {
145
- re();
146
- const t = r.current.offsetHeight, n = te(t, e.velocity);
147
- B(n);
155
+ se();
156
+ const t = r.current.offsetHeight, n = re(t, e.velocity);
157
+ z(n);
148
158
  }
149
159
  a.current = null;
150
- }, [te, B, re]), z = i((e) => {
151
- oe(e);
152
- const t = (h) => se(h), n = () => {
160
+ }, [re, z, se]), Q = c((e) => {
161
+ ce(e);
162
+ const t = (f) => ie(f), n = () => {
153
163
  document.removeEventListener("mousemove", t, { capture: !0 }), document.removeEventListener("mouseup", n, { capture: !0 }), S();
154
164
  };
155
165
  document.addEventListener("mousemove", t, { passive: !1, capture: !0 }), document.addEventListener("mouseup", n, { capture: !0 });
156
- }, [oe, se, S]);
166
+ }, [ce, ie, S]);
157
167
  D(() => {
158
- const e = $.current;
168
+ const e = k.current;
159
169
  if (e)
160
- return e.addEventListener("touchstart", U, { passive: !1 }), e.addEventListener("touchmove", V, { passive: !1 }), e.addEventListener("touchend", S), e.addEventListener("touchcancel", S), e.addEventListener("mousedown", z, { passive: !1 }), () => {
161
- e.removeEventListener("touchstart", U), e.removeEventListener("touchmove", V), e.removeEventListener("touchend", S), e.removeEventListener("touchcancel", S), e.removeEventListener("mousedown", z);
170
+ return e.addEventListener("touchstart", J, { passive: !1 }), e.addEventListener("touchmove", K, { passive: !1 }), e.addEventListener("touchend", S), e.addEventListener("touchcancel", S), e.addEventListener("mousedown", Q, { passive: !1 }), () => {
171
+ e.removeEventListener("touchstart", J), e.removeEventListener("touchmove", K), e.removeEventListener("touchend", S), e.removeEventListener("touchcancel", S), e.removeEventListener("mousedown", Q);
162
172
  };
163
- }, [U, V, S, z]);
164
- const R = ue(() => o !== "0%", [o]), [J, ce] = G(() => p ? o !== "0%" : !0);
173
+ }, [J, K, S, Q]);
174
+ const L = fe(() => o !== "0%", [o]), [X, le] = G(() => p ? o !== "0%" : !0);
165
175
  return D(() => {
166
- p && R && ce(!0);
167
- }, [R, p]), D(() => {
176
+ p && L && le(!0);
177
+ }, [L, p]), D(() => {
168
178
  if (!p) return;
169
179
  const e = r.current;
170
180
  if (!e) return;
171
181
  const t = (n) => {
172
- n.propertyName === "height" && !R && o === "0%" && ce(!1);
182
+ n.propertyName === "height" && !L && o === "0%" && le(!1);
173
183
  };
174
184
  return e.addEventListener("transitionend", t), () => {
175
185
  e.removeEventListener("transitionend", t);
176
186
  };
177
- }, [R, o, p]), D(() => {
187
+ }, [L, o, p]), D(() => {
178
188
  if (!r.current || !o) return;
179
189
  const e = l && r.current.parentElement?.offsetHeight || window.innerHeight;
180
190
  if (o === "auto") {
181
- if (p && !J) return;
182
- ne(e), requestAnimationFrame(() => {
191
+ if (p && !X) return;
192
+ oe(e), requestAnimationFrame(() => {
183
193
  requestAnimationFrame(() => {
184
- const n = !y || M.current, h = v.current && v.current.children.length > 0;
185
- if (v.current && h && n) {
186
- const c = _();
187
- O.current = c;
188
- const s = W(), b = P(), k = ee(), I = q(e, c, s, b, k);
189
- f(I);
190
- } else n && f("100%");
194
+ const n = !y || Y.current, f = w.current && w.current.children.length > 0;
195
+ if (w.current && f && n) {
196
+ const i = U();
197
+ B.current = i;
198
+ const s = q(), v = W(), I = te(), O = V(e, i, s, v, I);
199
+ d(O);
200
+ } else n && d("100%");
191
201
  });
192
202
  });
193
203
  return;
194
204
  }
195
205
  let t = 0;
196
- typeof o == "string" && o.endsWith("%") ? parseFloat(o) <= 0 ? t = N ? 0 : X : t = parseFloat(o) / 100 * e : typeof o == "string" && o.endsWith("px") ? t = parseFloat(o) : typeof o == "number" && (o >= 0 && o <= 1 ? t = o * e : t = o), ne(t);
197
- }, [o, l, _, W, q, f, J, y, p]), /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
198
- T && /* @__PURE__ */ w.jsx(
206
+ typeof o == "string" && o.endsWith("%") ? parseFloat(o) <= 0 ? t = C ? 0 : $ : t = parseFloat(o) / 100 * e : typeof o == "string" && o.endsWith("px") ? t = parseFloat(o) : typeof o == "number" && (o >= 0 && o <= 1 ? t = o * e : t = o), oe(t);
207
+ }, [o, l, U, q, V, d, X, y, p]), /* @__PURE__ */ b.jsxs(b.Fragment, { children: [
208
+ T && /* @__PURE__ */ b.jsx(
199
209
  "div",
200
210
  {
201
211
  style: { zIndex: H },
202
- className: A(R ? "fixed inset-0 bg-black/40 cursor-default" : "hidden"),
212
+ className: _(L ? "fixed inset-0 bg-black/40 cursor-default" : "hidden"),
203
213
  onClick: (e) => {
204
- e.preventDefault(), e.stopPropagation(), C && B(0);
214
+ e.preventDefault(), e.stopPropagation(), A && z(0);
205
215
  },
206
216
  "aria-hidden": "true"
207
217
  }
208
218
  ),
209
- /* @__PURE__ */ w.jsxs(
219
+ /* @__PURE__ */ b.jsxs(
210
220
  "div",
211
221
  {
212
222
  ref: r,
213
223
  style: { zIndex: H },
214
- className: A(
224
+ className: _(
215
225
  "h-0",
216
226
  l ? "absolute" : "fixed",
217
227
  "bottom-0 w-full overflow-hidden",
218
228
  "bg-neutral-default-default",
219
229
  "border-t border-neutral-strong-default rounded-t-[12px]",
220
- R ? "" : "border-neutral-weak",
221
- L,
230
+ L ? "" : "border-neutral-weak",
231
+ j,
222
232
  "flex flex-col items-center",
223
233
  "touch-none select-none"
224
234
  ),
225
235
  children: [
226
- /* @__PURE__ */ w.jsx(
236
+ /* @__PURE__ */ b.jsx(
227
237
  "div",
228
238
  {
229
- ref: $,
239
+ ref: k,
230
240
  style: { zIndex: H + 1 },
231
241
  className: "w-full absolute top-0 h-11 flex items-center justify-center cursor-grab active:cursor-grabbing bg-inherit! ",
232
- children: /* @__PURE__ */ w.jsx("span", { className: "w-12 h-1 rounded-full bg-neutral-weak-default" })
242
+ children: /* @__PURE__ */ b.jsx("span", { className: "w-12 h-1 rounded-full bg-neutral-weak-default" })
233
243
  }
234
244
  ),
235
- typeof u == "string" ? /* @__PURE__ */ w.jsx("p", { ref: x, style: { zIndex: H + 2 }, className: " prometeo-fonts-headline-small text-neutral-default-default w-full min-h-11 bg-inherit mt-11 px-4 text-balance", children: u }) : /* @__PURE__ */ w.jsx("div", { ref: x, className: "w-full mt-11", children: typeof u == "function" ? u(E) : ie.isValidElement(u) ? u : u && typeof u == "object" && "$$typeof" in u ? ie.createElement(u, { context: E }) : u }),
236
- /* @__PURE__ */ w.jsx(
245
+ typeof u == "string" ? /* @__PURE__ */ b.jsx("p", { ref: x, style: { zIndex: H + 2 }, className: " prometeo-fonts-headline-small text-neutral-default-default w-full min-h-11 bg-inherit mt-11 px-4 text-balance", children: u }) : /* @__PURE__ */ b.jsx("div", { ref: x, className: "w-full mt-11", children: typeof u == "function" ? u(E) : ue.isValidElement(u) ? u : u && typeof u == "object" && "$$typeof" in u ? ue.createElement(u, { context: E }) : u }),
246
+ /* @__PURE__ */ b.jsx(
237
247
  "div",
238
248
  {
239
- ref: v,
240
- className: A(
249
+ ref: w,
250
+ className: _(
241
251
  "drawer-mobile-content prometeo-scrollbar-thin-weak ",
242
- R ? "drawer-mobile-content--open" : "drawer-mobile-content--closed",
252
+ L ? "drawer-mobile-content--open" : "drawer-mobile-content--closed",
243
253
  "w-full h-full",
244
- j
254
+ F
245
255
  ),
246
- children: (!p || J) && (typeof d == "function" ? d(E) : d)
256
+ children: (!p || X) && (typeof g == "function" ? g(E) : g)
247
257
  }
248
258
  ),
249
- y && /* @__PURE__ */ w.jsx("div", { ref: M, className: A(
259
+ y && /* @__PURE__ */ b.jsx("div", { ref: Y, className: _(
250
260
  "w-full mt-0 flex items-center justify-center p-0",
251
261
  "border-t border-neutral-strong-default",
252
- F
262
+ N
253
263
  ), children: typeof y == "function" ? y(E) : y })
254
264
  ]
255
265
  }
256
266
  )
257
267
  ] });
258
- }, xe = () => {
259
- const d = m(null), [l, L] = G(!1), j = i((g, f) => {
260
- d.current?.open(g, f);
261
- }, []), F = i(() => {
262
- d.current?.close();
263
- }, []), o = i(() => d.current?.getContext() ?? null, []);
268
+ }, Me = () => {
269
+ const g = m(null), [l, j] = G(!1), F = c((h, d) => {
270
+ g.current?.open(h, d);
271
+ }, []), N = c(() => {
272
+ g.current?.close();
273
+ }, []), o = c(() => g.current?.getContext() ?? null, []);
264
274
  return D(() => {
265
- const g = d.current?.subscribeOpenChange;
266
- if (!g) return;
267
- const f = g((N) => {
268
- L(N);
275
+ const h = g.current?.subscribeOpenChange;
276
+ if (!h) return;
277
+ const d = h((C) => {
278
+ j(C);
269
279
  });
270
280
  return () => {
271
- f && f();
281
+ d && d();
272
282
  };
273
- }, [d.current?.subscribeOpenChange]), {
283
+ }, [g.current?.subscribeOpenChange]), {
274
284
  isOpen: l,
275
- open: j,
276
- close: F,
277
- drawerRef: d,
285
+ open: F,
286
+ close: N,
287
+ drawerRef: g,
278
288
  getContext: o
279
289
  };
280
290
  };
281
291
  export {
282
- He as default,
283
- xe as useDrawerMobile
292
+ Ee as default,
293
+ Me as useDrawerMobile
284
294
  };
@@ -23,6 +23,12 @@ export interface DrawerMobileHandle<TContext = unknown> {
23
23
  close: () => void;
24
24
  isOpen: boolean;
25
25
  getContext: () => TContext | null;
26
+ /**
27
+ * Altura fija (dragger, header y footer) que queda fuera del área scrollable del contenido.
28
+ * Sirve para calcular `calc(100vh - getChromeHeight())` u otros `calc(<altura padre> - ...)`,
29
+ * especialmente cuando se usa `attachToParent` y el drawer no llena todo el viewport.
30
+ */
31
+ getChromeHeight: () => number;
26
32
  subscribeOpenChange: (cb: (open: boolean) => void) => () => void;
27
33
  }
28
34
  declare const DrawerMobile: <TContext = unknown>(props: DrawerMobileProps<TContext> & {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prometeo-design-system",
3
3
  "private": false,
4
- "version": "5.8.2",
4
+ "version": "5.8.3",
5
5
  "type": "module",
6
6
  "description": "design kit system",
7
7
  "main": "dist/prometeo-design-system.umd.js",