prometeo-design-system 5.8.0 → 5.8.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,89 +1,89 @@
1
1
  import { j as w } from "./jsx-runtime-GkKLlHH4.js";
2
- import { c as z } from "./cn-B6yFEsav.js";
3
- import ce, { forwardRef as de, useState as A, useRef as h, useEffect as x, useCallback as i, useMemo as le, useImperativeHandle as ge } from "react";
4
- import { createPortal as he } from "react-dom";
5
- const X = 44, me = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", ye = de((f, l) => {
6
- const { children: R, defaultOpen: L = !1, onClose: j, snapPoints: o = ["auto"], setSnap: d, snap: a, attachToParent: F = !1 } = f, [m, u] = A(a || "0%"), [N, C] = A(null), D = h(j), H = h(d), r = h(N), b = h(/* @__PURE__ */ new Set());
7
- D.current = j, r.current = N, x(() => {
8
- L && E();
9
- }, [L]), x(() => {
10
- H.current = d;
11
- }, [d]);
12
- const T = i(() => {
13
- u("0%"), D.current?.(r.current), setTimeout(() => C(null), 300);
14
- }, []), E = i((p, O) => {
15
- u(p || o[0] || "60%"), C(O ?? null);
16
- }, [o]), M = le(() => m !== "0%", [m]);
17
- x(() => {
18
- b.current.forEach((p) => {
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]);
17
+ D(() => {
18
+ r.current.forEach((a) => {
19
19
  try {
20
- p(M);
20
+ a(x);
21
21
  } catch {
22
22
  }
23
23
  });
24
- }, [M]), ge(l, () => ({
25
- open: E,
26
- close: T,
27
- isOpen: M,
28
- subscribeOpenChange: (p) => (b.current.add(p), () => {
29
- b.current.delete(p);
24
+ }, [x]), he(l, () => ({
25
+ open: M,
26
+ close: v,
27
+ isOpen: x,
28
+ subscribeOpenChange: (a) => (r.current.add(a), () => {
29
+ r.current.delete(a);
30
30
  }),
31
- getContext: () => r.current
32
- }), [E, T, M]);
33
- const $ = a || m;
34
- return F ? /* @__PURE__ */ w.jsx(ie, { ...f, snap: $, setSnap: u, context: N, children: R }) : he(/* @__PURE__ */ w.jsx(ie, { ...f, snap: $, setSnap: u, context: N, children: R }), document.body);
35
- }), ie = ({ children: f, attachToParent: l = !1, className: R, classNameContent: L, classNameFooter: j, snap: o, snapPoints: d = [0, "auto", 1], setSnap: a, hideOnClose: F = !1, unmountChildrenOnClose: m = !1, header: u, modal: N = !1, closeOnOverlayClick: C = !1, context: D, footer: H }) => {
36
- const r = h(null), b = h(null), T = h(null), E = h(null), M = h(null), $ = h(0), y = h(null), p = h(null), O = i(() => {
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(() => {
37
37
  if (!r.current) return [];
38
38
  const e = l && r.current.parentElement?.offsetHeight || window.innerHeight;
39
- return d?.map((t) => {
39
+ return g?.map((t) => {
40
40
  if (t === "auto") {
41
- const n = $.current, g = G(), c = Z(), s = P(), v = _(e, n, g, c, s);
42
- return parseFloat(v) / 100 * e;
41
+ const n = O.current, h = W(), c = P(), s = ee(), b = q(e, n, h, c, s);
42
+ return parseFloat(b) / 100 * e;
43
43
  }
44
44
  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
45
  }) || [];
46
- }, [d, l]), G = i(() => 46, []), W = i(() => b.current?.scrollHeight ?? 0, []), Z = i(() => {
47
- const e = T.current?.scrollHeight ?? 0;
46
+ }, [g, l]), W = i(() => 46, []), _ = i(() => v.current?.scrollHeight ?? 0, []), P = i(() => {
47
+ const e = M.current?.scrollHeight ?? 0;
48
48
  return e > 0 ? e + 2 : 0;
49
- }, []), P = i(() => E.current?.scrollHeight ?? 0, []), _ = i((e, t, n, g, c) => {
50
- const s = n + c + t + g, v = Math.min(100, s / e * 100);
51
- return `${Math.round(v)}%`;
52
- }, []), ee = i((e, t) => {
53
- const n = O();
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();
54
54
  if (n.length === 0) return e;
55
55
  if (Math.abs(t) > 0.05)
56
56
  if (t > 0) {
57
57
  const c = n.filter((s) => s < e);
58
- return c.length > 0 ? Math.max(...c) : F ? 0 : X;
58
+ return c.length > 0 ? Math.max(...c) : N ? 0 : X;
59
59
  } else {
60
60
  const c = n.filter((s) => s > e);
61
61
  if (c.length > 0)
62
62
  return Math.min(...c);
63
63
  }
64
64
  return n.reduce((c, s) => Math.abs(s - e) < Math.abs(c - e) ? s : c);
65
- }, [O]), q = i((e) => {
66
- if (a && d) {
65
+ }, [Z]), B = i((e) => {
66
+ if (f && g) {
67
67
  const t = l && r.current?.parentElement?.offsetHeight || window.innerHeight, n = e <= X ? "0%" : `${Math.round(e / t * 100)}%`;
68
- a(n);
68
+ f(n);
69
69
  }
70
- }, [a, d, l]), te = i((e) => {
71
- r.current && (r.current.style.transition = me, r.current.style.height = `${e}px`, fe(e, $.current || W()));
72
- }, [a, d, l]), ue = () => {
73
- b.current?.classList.remove("prometeo-scrollbar-none");
74
- }, ae = () => {
75
- b.current?.classList.add("prometeo-scrollbar-none");
76
- }, fe = (e, t) => {
77
- t > e ? ue() : ae();
78
- }, ne = i(() => {
79
- if (p.current && l) {
80
- const { scrollY: e } = p.current;
81
- document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, e), p.current = null;
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;
82
82
  }
83
- }, [l]), B = i((e) => {
83
+ }, [l]), U = i((e) => {
84
84
  if (!r.current) return;
85
85
  const t = e.touches[0], n = r.current.offsetHeight;
86
- y.current = {
86
+ a.current = {
87
87
  isDragging: !1,
88
88
  startY: t.clientY,
89
89
  startHeight: n,
@@ -91,10 +91,10 @@ const X = 44, me = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", ye = de((f, l)
91
91
  lastTime: Date.now(),
92
92
  velocity: 0
93
93
  };
94
- }, []), re = i((e) => {
94
+ }, []), oe = i((e) => {
95
95
  if (!r.current) return;
96
96
  const t = e, n = r.current.offsetHeight;
97
- y.current = {
97
+ a.current = {
98
98
  isDragging: !1,
99
99
  startY: t.clientY,
100
100
  startHeight: n,
@@ -102,105 +102,106 @@ const X = 44, me = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", ye = de((f, l)
102
102
  lastTime: Date.now(),
103
103
  velocity: 0
104
104
  };
105
- }, []), U = i((e) => {
106
- if (!y.current || !r.current) return;
107
- const t = e.touches[0], n = y.current, g = n.startY - t.clientY, c = n.isDragging || Math.abs(g) > 5;
105
+ }, []), V = i((e) => {
106
+ 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
108
  if (!n.isDragging && c && (n.isDragging = !0, l)) {
109
109
  const s = window.scrollY;
110
- p.current = { scrollY: s }, document.body.style.position = "fixed", document.body.style.top = `-${s}px`, document.body.style.width = "100%";
110
+ Y.current = { scrollY: s }, document.body.style.position = "fixed", document.body.style.top = `-${s}px`, document.body.style.width = "100%";
111
111
  }
112
112
  if (c) {
113
113
  e.preventDefault();
114
- const s = Date.now(), v = s - n.lastTime;
115
- if (v > 0) {
116
- const Q = (t.clientY - n.lastY) / v;
114
+ const s = Date.now(), b = s - n.lastTime;
115
+ if (b > 0) {
116
+ const Q = (t.clientY - n.lastY) / b;
117
117
  n.velocity = n.velocity * 0.8 + Q * 0.2;
118
118
  }
119
119
  n.lastY = t.clientY, n.lastTime = s;
120
- const I = n.startHeight + g, k = l && r.current.parentElement?.offsetHeight || window.innerHeight, K = Math.max(0, Math.min(I, k));
120
+ const k = n.startHeight + h, I = l && r.current.parentElement?.offsetHeight || window.innerHeight, K = Math.max(0, Math.min(k, I));
121
121
  r.current.style.transition = "none", r.current.style.height = `${K}px`;
122
122
  }
123
- }, [l]), oe = i((e) => {
124
- if (!y.current || !r.current) return;
125
- const t = e, n = y.current, g = n.startY - t.clientY, c = n.isDragging || Math.abs(g) > 5;
123
+ }, [l]), se = i((e) => {
124
+ 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
126
  if (!n.isDragging && c && (n.isDragging = !0, l)) {
127
127
  const s = window.scrollY;
128
- p.current = { scrollY: s }, document.body.style.position = "fixed", document.body.style.top = `-${s}px`, document.body.style.width = "100%";
128
+ Y.current = { scrollY: s }, document.body.style.position = "fixed", document.body.style.top = `-${s}px`, document.body.style.width = "100%";
129
129
  }
130
130
  if (c) {
131
131
  e.preventDefault();
132
- const s = Date.now(), v = s - n.lastTime;
133
- if (v > 0) {
134
- const Q = (t.clientY - n.lastY) / v;
132
+ const s = Date.now(), b = s - n.lastTime;
133
+ if (b > 0) {
134
+ const Q = (t.clientY - n.lastY) / b;
135
135
  n.velocity = n.velocity * 0.8 + Q * 0.2;
136
136
  }
137
137
  n.lastY = t.clientY, n.lastTime = s;
138
- const I = n.startHeight + g, k = l && r.current.parentElement?.offsetHeight || window.innerHeight, K = Math.max(0, Math.min(I, k));
138
+ const k = n.startHeight + h, I = l && r.current.parentElement?.offsetHeight || window.innerHeight, K = Math.max(0, Math.min(k, I));
139
139
  r.current.style.transition = "none", r.current.style.height = `${K}px`;
140
140
  }
141
- }, [l]), Y = i(() => {
142
- if (!y.current || !r.current) return;
143
- const e = y.current;
141
+ }, [l]), S = i(() => {
142
+ if (!a.current || !r.current) return;
143
+ const e = a.current;
144
144
  if (e.isDragging) {
145
- ne();
146
- const t = r.current.offsetHeight, n = ee(t, e.velocity);
147
- q(n);
145
+ re();
146
+ const t = r.current.offsetHeight, n = te(t, e.velocity);
147
+ B(n);
148
148
  }
149
- y.current = null;
150
- }, [ee, q, ne]), V = i((e) => {
151
- re(e);
152
- const t = (g) => oe(g), n = () => {
153
- document.removeEventListener("mousemove", t, { capture: !0 }), document.removeEventListener("mouseup", n, { capture: !0 }), Y();
149
+ a.current = null;
150
+ }, [te, B, re]), z = i((e) => {
151
+ oe(e);
152
+ const t = (h) => se(h), n = () => {
153
+ document.removeEventListener("mousemove", t, { capture: !0 }), document.removeEventListener("mouseup", n, { capture: !0 }), S();
154
154
  };
155
155
  document.addEventListener("mousemove", t, { passive: !1, capture: !0 }), document.addEventListener("mouseup", n, { capture: !0 });
156
- }, [re, oe, Y]);
157
- x(() => {
158
- const e = M.current;
156
+ }, [oe, se, S]);
157
+ D(() => {
158
+ const e = $.current;
159
159
  if (e)
160
- return e.addEventListener("touchstart", B, { passive: !1 }), e.addEventListener("touchmove", U, { passive: !1 }), e.addEventListener("touchend", Y), e.addEventListener("touchcancel", Y), e.addEventListener("mousedown", V, { passive: !1 }), () => {
161
- e.removeEventListener("touchstart", B), e.removeEventListener("touchmove", U), e.removeEventListener("touchend", Y), e.removeEventListener("touchcancel", Y), e.removeEventListener("mousedown", V);
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);
162
162
  };
163
- }, [B, U, Y, V]);
164
- const S = le(() => o !== "0%", [o]), [J, se] = A(() => m ? o !== "0%" : !0);
165
- return x(() => {
166
- m && S && se(!0);
167
- }, [S, m]), x(() => {
168
- if (!m) return;
163
+ }, [U, V, S, z]);
164
+ const R = ue(() => o !== "0%", [o]), [J, ce] = G(() => p ? o !== "0%" : !0);
165
+ return D(() => {
166
+ p && R && ce(!0);
167
+ }, [R, p]), D(() => {
168
+ if (!p) return;
169
169
  const e = r.current;
170
170
  if (!e) return;
171
171
  const t = (n) => {
172
- n.propertyName === "height" && !S && o === "0%" && se(!1);
172
+ n.propertyName === "height" && !R && o === "0%" && ce(!1);
173
173
  };
174
174
  return e.addEventListener("transitionend", t), () => {
175
175
  e.removeEventListener("transitionend", t);
176
176
  };
177
- }, [S, o, m]), x(() => {
177
+ }, [R, o, p]), D(() => {
178
178
  if (!r.current || !o) return;
179
179
  const e = l && r.current.parentElement?.offsetHeight || window.innerHeight;
180
180
  if (o === "auto") {
181
- if (m && !J) return;
182
- te(e), requestAnimationFrame(() => {
181
+ if (p && !J) return;
182
+ ne(e), requestAnimationFrame(() => {
183
183
  requestAnimationFrame(() => {
184
- const n = !H || T.current, g = b.current && b.current.children.length > 0;
185
- if (b.current && g && n) {
186
- const c = W();
187
- $.current = c;
188
- const s = G(), v = Z(), I = P(), k = _(e, c, s, v, I);
189
- a(k);
190
- } else n && a("100%");
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%");
191
191
  });
192
192
  });
193
193
  return;
194
194
  }
195
195
  let t = 0;
196
- typeof o == "string" && o.endsWith("%") ? parseFloat(o) <= 0 ? t = F ? 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), te(t);
197
- }, [o, l, W, G, _, a, J, H, m]), /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
198
- N && /* @__PURE__ */ w.jsx(
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(
199
199
  "div",
200
200
  {
201
- className: z(S ? "fixed inset-0 bg-black/40 z-55 cursor-default" : "hidden"),
201
+ style: { zIndex: H },
202
+ className: A(R ? "fixed inset-0 bg-black/40 cursor-default" : "hidden"),
202
203
  onClick: (e) => {
203
- e.preventDefault(), e.stopPropagation(), C && q(0);
204
+ e.preventDefault(), e.stopPropagation(), C && B(0);
204
205
  },
205
206
  "aria-hidden": "true"
206
207
  }
@@ -209,14 +210,15 @@ const X = 44, me = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", ye = de((f, l)
209
210
  "div",
210
211
  {
211
212
  ref: r,
212
- className: z(
213
+ style: { zIndex: H },
214
+ className: A(
213
215
  "h-0",
214
216
  l ? "absolute" : "fixed",
215
- "z-60 bottom-0 w-full overflow-hidden",
217
+ "bottom-0 w-full overflow-hidden",
216
218
  "bg-neutral-default-default",
217
219
  "border-t border-neutral-strong-default rounded-t-[12px]",
218
- S ? "" : "border-neutral-weak",
219
- R,
220
+ R ? "" : "border-neutral-weak",
221
+ L,
220
222
  "flex flex-col items-center",
221
223
  "touch-none select-none"
222
224
  ),
@@ -224,58 +226,59 @@ const X = 44, me = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", ye = de((f, l)
224
226
  /* @__PURE__ */ w.jsx(
225
227
  "div",
226
228
  {
227
- ref: M,
228
- className: "w-full absolute top-0 h-11 flex items-center justify-center cursor-grab active:cursor-grabbing z-50 bg-inherit! ",
229
+ ref: $,
230
+ style: { zIndex: H + 1 },
231
+ className: "w-full absolute top-0 h-11 flex items-center justify-center cursor-grab active:cursor-grabbing bg-inherit! ",
229
232
  children: /* @__PURE__ */ w.jsx("span", { className: "w-12 h-1 rounded-full bg-neutral-weak-default" })
230
233
  }
231
234
  ),
232
- typeof u == "string" ? /* @__PURE__ */ w.jsx("p", { ref: E, className: " prometeo-fonts-headline-small text-neutral-default-default w-full min-h-11 bg-inherit mt-11 z-50 px-4 text-balance", children: u }) : /* @__PURE__ */ w.jsx("div", { ref: E, className: "w-full mt-11", children: typeof u == "function" ? u(D) : ce.isValidElement(u) ? u : u && typeof u == "object" && "$$typeof" in u ? ce.createElement(u, { context: D }) : u }),
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 }),
233
236
  /* @__PURE__ */ w.jsx(
234
237
  "div",
235
238
  {
236
- ref: b,
237
- className: z(
239
+ ref: v,
240
+ className: A(
238
241
  "drawer-mobile-content prometeo-scrollbar-thin-weak ",
239
- S ? "drawer-mobile-content--open" : "drawer-mobile-content--closed",
242
+ R ? "drawer-mobile-content--open" : "drawer-mobile-content--closed",
240
243
  "w-full h-full",
241
- L
244
+ j
242
245
  ),
243
- children: (!m || J) && (typeof f == "function" ? f(D) : f)
246
+ children: (!p || J) && (typeof d == "function" ? d(E) : d)
244
247
  }
245
248
  ),
246
- H && /* @__PURE__ */ w.jsx("div", { ref: T, className: z(
249
+ y && /* @__PURE__ */ w.jsx("div", { ref: M, className: A(
247
250
  "w-full mt-0 flex items-center justify-center p-0",
248
251
  "border-t border-neutral-strong-default",
249
- j
250
- ), children: typeof H == "function" ? H(D) : H })
252
+ F
253
+ ), children: typeof y == "function" ? y(E) : y })
251
254
  ]
252
255
  }
253
256
  )
254
257
  ] });
255
- }, He = () => {
256
- const f = h(null), [l, R] = A(!1), L = i((d, a) => {
257
- f.current?.open(d, a);
258
- }, []), j = i(() => {
259
- f.current?.close();
260
- }, []), o = i(() => f.current?.getContext() ?? null, []);
261
- return x(() => {
262
- const d = f.current?.subscribeOpenChange;
263
- if (!d) return;
264
- const a = d((F) => {
265
- R(F);
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, []);
264
+ return D(() => {
265
+ const g = d.current?.subscribeOpenChange;
266
+ if (!g) return;
267
+ const f = g((N) => {
268
+ L(N);
266
269
  });
267
270
  return () => {
268
- a && a();
271
+ f && f();
269
272
  };
270
- }, [f.current?.subscribeOpenChange]), {
273
+ }, [d.current?.subscribeOpenChange]), {
271
274
  isOpen: l,
272
- open: L,
273
- close: j,
274
- drawerRef: f,
275
+ open: j,
276
+ close: F,
277
+ drawerRef: d,
275
278
  getContext: o
276
279
  };
277
280
  };
278
281
  export {
279
- ye as default,
280
- He as useDrawerMobile
282
+ He as default,
283
+ xe as useDrawerMobile
281
284
  };
package/dist/Header.es.js CHANGED
@@ -17,7 +17,7 @@ const c = ({ title: e, subtitle: l, children: m, className: d, subtitleClassName
17
17
  a && /* @__PURE__ */ s.jsx("div", { className: "", children: typeof a == "function" ? a() : a }),
18
18
  t && /* @__PURE__ */ s.jsx("div", { className: "hidden md:flex", children: typeof t == "function" ? t() : t })
19
19
  ] }),
20
- /* @__PURE__ */ s.jsxs("div", { className: "w-full flex justify-between md:px-6", children: [
20
+ /* @__PURE__ */ s.jsxs("div", { className: "w-full flex justify-between md:px-6 overflow-hidden", children: [
21
21
  /* @__PURE__ */ s.jsxs("div", { className: i("flex flex-col leading-6 justify-center relative overflow-hidden"), children: [
22
22
  l && /* @__PURE__ */ s.jsx("h3", { className: i(" prometeo-fonts-body-small md:prometeo-fonts-body-medium text-neutral-medium-default line-clamp-1 text-nowrap overflow-hidden text-ellipsis w-full", r), children: l }),
23
23
  e && /* @__PURE__ */ s.jsx("h1", { className: i("prometeo-fonts-headline-xsmall md:prometeo-fonts-headline-small text-neutral-strong-default line-clamp-1 text-nowrap overflow-hidden text-ellipsis w-full wrap-break-word", o), children: e })
@@ -95,7 +95,7 @@ const _ = T(({ images: r, lightboxClassName: u, closeLightbox: n, showThumbnails
95
95
  "div",
96
96
  {
97
97
  ref: b,
98
- className: k("fixed inset-0 z-50 bg-black/90 flex items-center justify-center lg:px-16", u),
98
+ className: k("fixed inset-0 z-65 bg-black/90 flex items-center justify-center lg:px-16", u),
99
99
  onClick: n,
100
100
  onKeyDown: P,
101
101
  onTouchStart: I,
@@ -1,4 +1,4 @@
1
- import { I as p } from "./ImageGallery-5nGROBTC.js";
1
+ import { I as p } from "./ImageGallery-WVy6uNZc.js";
2
2
  import { useRef as u, useCallback as r } from "react";
3
3
  const g = () => {
4
4
  const e = u(null), t = r((a) => {
@@ -1,10 +1,10 @@
1
1
  import { j as r } from "./jsx-runtime-GkKLlHH4.js";
2
2
  import { c as d } from "./cn-B6yFEsav.js";
3
- import B, { useRef as U, useState as b, useCallback as ne, useEffect as se } from "react";
3
+ import B, { useRef as U, useState as b, useCallback as ne, useEffect as ae } from "react";
4
4
  import { H as $ } from "./HelperComponent-ljsn0xD6.js";
5
- import { Close as ae } from "./Icons/Close.es.js";
5
+ import { Close as se } from "./Icons/Close.es.js";
6
6
  import { Info as le } from "./Icons/Info.es.js";
7
- const ue = ({ label: O, name: q, onChange: m, value: s, icon: P, valueSeparator: v = ",", variant: w = "default", placeholder: A, itemClassName: z, itemIcon: k, helperText: g, errorText: x, disabled: a, onClick: D, className: G, readonly: p, onValueDelete: J, tabIndex: L, renderItem: R, ...Q }) => {
7
+ const ue = ({ label: O, name: q, onChange: m, value: a, icon: P, valueSeparator: v = ",", variant: w = "default", placeholder: A, itemClassName: z, itemIcon: k, helperText: g, errorText: x, disabled: s, onClick: D, className: G, readonly: p, onValueDelete: J, tabIndex: L, renderItem: R, ...Q }) => {
8
8
  const o = U(null), I = U(null), [l, u] = b(""), [_, i] = b(0), [W, c] = b(!0), [E, K] = b(!1), [f, h] = b(!1), [C, y] = b(null), j = (e) => {
9
9
  if (p || !e) return;
10
10
  const t = e.selectionStart ?? l.length;
@@ -17,11 +17,11 @@ const ue = ({ label: O, name: q, onChange: m, value: s, icon: P, valueSeparator:
17
17
  n.length > 0 ? (u(n), N()) : (h(!1), u(""), c(!0), i(0));
18
18
  return;
19
19
  }
20
- if (n.length === 0 || s.includes(n)) {
20
+ if (n.length === 0 || a.includes(n)) {
21
21
  u(""), c(!0), j(e.target);
22
22
  return;
23
23
  }
24
- m([...s, n]), u(""), c(!0);
24
+ m([...a, n]), u(""), c(!0);
25
25
  } else {
26
26
  if (e.target.value === v) return;
27
27
  u(e.target.value), c(!1);
@@ -33,15 +33,15 @@ const ue = ({ label: O, name: q, onChange: m, value: s, icon: P, valueSeparator:
33
33
  h(!1), u(""), c(!0), i(0), y(null);
34
34
  return;
35
35
  }
36
- h(!1), C !== null && m(ee(s.map((t, n) => n === C ? e : t))), u(""), c(!0), i(0), y(null);
37
- }, [C, l, m, s]), Y = (e) => {
36
+ h(!1), C !== null && m(ee(a.map((t, n) => n === C ? e : t))), u(""), c(!0), i(0), y(null);
37
+ }, [C, l, m, a]), Y = (e) => {
38
38
  p || e.key === "Tab" && (f || l.length > 0) && (e.preventDefault(), e.stopPropagation());
39
39
  }, Z = (e) => {
40
40
  if (!p) {
41
41
  if (e.key === "Backspace" && l.length === 0) {
42
42
  if (W) {
43
- const t = s[s.length - 1];
44
- t && (m(s.filter((n) => n !== t)), u(t), i(t.length));
43
+ const t = a[a.length - 1];
44
+ t && (m(a.filter((n) => n !== t)), u(t), i(t.length));
45
45
  } else
46
46
  c(!0);
47
47
  return;
@@ -52,20 +52,20 @@ const ue = ({ label: O, name: q, onChange: m, value: s, icon: P, valueSeparator:
52
52
  t.length > 0 ? (u(t), N()) : (h(!1), u(""), c(!0), i(0));
53
53
  return;
54
54
  }
55
- t.length > 0 && !s.includes(t) && t !== v && (m([...s, t]), u(""), c(!0), i(0));
55
+ t.length > 0 && !a.includes(t) && t !== v && (m([...a, t]), u(""), c(!0), i(0));
56
56
  }
57
57
  e.key === "Escape" && f && (h(!1), u(""), c(!0), i(0), y(null)), j(e.currentTarget);
58
58
  }
59
59
  }, M = (e) => {
60
- const t = s.filter((n) => n !== e);
60
+ const t = a.filter((n) => n !== e);
61
61
  m(t), J?.(e);
62
62
  }, S = (e) => {
63
- p || (T(e), h(!0), u(e), i(e.length), y(s.length - 1), o.current?.focus());
63
+ p || (T(e), h(!0), u(e), i(e.length), y(a.length - 1), o.current?.focus());
64
64
  }, T = (e) => {
65
- const t = s.filter((n) => n !== e);
65
+ const t = a.filter((n) => n !== e);
66
66
  m([...t, e]);
67
67
  }, ee = (e) => e.filter((t, n, V) => V.indexOf(t) === n);
68
- se(() => {
68
+ ae(() => {
69
69
  o.current && (o.current.onfocus = () => {
70
70
  K(!0);
71
71
  }, o.current.onblur = () => {
@@ -114,7 +114,7 @@ const ue = ({ label: O, name: q, onChange: m, value: s, icon: P, valueSeparator:
114
114
  isFocused: "text-warning-default-focused",
115
115
  disabled: "text-warning-default-disabled"
116
116
  }
117
- }, H = a ? "disabled" : E ? "isFocused" : "default";
117
+ }, H = s ? "disabled" : E ? "isFocused" : "default";
118
118
  return /* @__PURE__ */ r.jsxs("div", { className: d(
119
119
  "relative w-full",
120
120
  G
@@ -136,7 +136,7 @@ const ue = ({ label: O, name: q, onChange: m, value: s, icon: P, valueSeparator:
136
136
  onClick: (e) => j(e.currentTarget),
137
137
  onSelect: (e) => j(e.currentTarget),
138
138
  name: q,
139
- disabled: a,
139
+ disabled: s,
140
140
  className: d(
141
141
  "absolute inset-0 w-full h-full",
142
142
  "opacity-0 cursor-text z-10",
@@ -158,7 +158,7 @@ const ue = ({ label: O, name: q, onChange: m, value: s, icon: P, valueSeparator:
158
158
  ref: I,
159
159
  className: d(
160
160
  "border border-neutral-default-default rounded-lg p-3",
161
- "flex flex-wrap gap-1 min-h-12",
161
+ "flex flex-wrap gap-1 min-h-14",
162
162
  "transition-all duration-300 ease-in-out",
163
163
  "cursor-text",
164
164
  te[H][w]
@@ -174,16 +174,16 @@ const ue = ({ label: O, name: q, onChange: m, value: s, icon: P, valueSeparator:
174
174
  children: [
175
175
  P && /* @__PURE__ */ r.jsx("div", { className: d(
176
176
  "flex items-center text-neutral-medium-default",
177
- a && "text-neutral-medium-disabled"
177
+ s && "text-neutral-medium-disabled"
178
178
  ), children: P }),
179
- s.map((e, t) => {
179
+ a.map((e, t) => {
180
180
  const n = d(
181
- t === s.length - 1 && f && "opacity-0 hidden overflow-hidden max-w-0 px-0! "
181
+ t === a.length - 1 && f && "opacity-0 hidden overflow-hidden max-w-0 px-0! "
182
182
  ), V = {
183
183
  item: e,
184
184
  index: t,
185
185
  isEditing: f,
186
- disabled: !!a,
186
+ disabled: !!s,
187
187
  onEdit: () => S(e),
188
188
  onDelete: () => M(e),
189
189
  itemIcon: k,
@@ -197,7 +197,7 @@ const ue = ({ label: O, name: q, onChange: m, value: s, icon: P, valueSeparator:
197
197
  "h-8 max-h-8 rounded-lg bg-primary-light-default border border-neutral-default-default",
198
198
  "flex items-center gap-2 px-2",
199
199
  "prometeo-fonts-body-large z-20",
200
- a && "border-neutral-strong-default text-neutral-medium-disabled",
200
+ s && "border-neutral-strong-default text-neutral-medium-disabled",
201
201
  z
202
202
  ),
203
203
  children: [
@@ -205,18 +205,18 @@ const ue = ({ label: O, name: q, onChange: m, value: s, icon: P, valueSeparator:
205
205
  size: 16,
206
206
  className: d(
207
207
  "text-neutral-medium-default",
208
- a && "text-neutral-medium-disabled"
208
+ s && "text-neutral-medium-disabled"
209
209
  )
210
210
  }) }),
211
211
  /* @__PURE__ */ r.jsx(
212
212
  "span",
213
213
  {
214
214
  onClick: (F) => {
215
- F.stopPropagation(), !a && S(e);
215
+ F.stopPropagation(), !s && S(e);
216
216
  },
217
217
  className: d(
218
218
  "cursor-pointer hover:text-neutral-default-hover",
219
- a && "cursor-default hover:text-neutral-medium-disabled"
219
+ s && "cursor-default hover:text-neutral-medium-disabled"
220
220
  ),
221
221
  children: e
222
222
  }
@@ -225,19 +225,19 @@ const ue = ({ label: O, name: q, onChange: m, value: s, icon: P, valueSeparator:
225
225
  "div",
226
226
  {
227
227
  onClick: (F) => {
228
- F.stopPropagation(), !a && M(e);
228
+ F.stopPropagation(), !s && M(e);
229
229
  },
230
230
  className: d(
231
231
  "cursor-pointer hover:scale-105 transition-all duration-200",
232
- a && "cursor-default hover:scale-100"
232
+ s && "cursor-default hover:scale-100"
233
233
  ),
234
234
  children: /* @__PURE__ */ r.jsx(
235
- ae,
235
+ se,
236
236
  {
237
237
  size: 16,
238
238
  className: d(
239
239
  "text-neutral-default-default hover:text-neutral-default-hover transition-all duration-200",
240
- a && "text-neutral-medium-disabled hover:text-neutral-medium-disabled"
240
+ s && "text-neutral-medium-disabled hover:text-neutral-medium-disabled"
241
241
  )
242
242
  }
243
243
  )
@@ -253,12 +253,12 @@ const ue = ({ label: O, name: q, onChange: m, value: s, icon: P, valueSeparator:
253
253
  E && /* @__PURE__ */ r.jsx("span", { className: "animate-[cursor-intermitent_1s_ease-in-out_infinite] bg-neutral-default-pressed w-0 border-r border-neutral-default-default h-5 inline-block align-middle z-20 " }),
254
254
  /* @__PURE__ */ r.jsx("span", { className: "text-neutral-default-default whitespace-pre-wrap wrap-break-word -ml-px", children: l.slice(_) })
255
255
  ] }),
256
- s.length === 0 && !E && l.length === 0 && !p && /* @__PURE__ */ r.jsx(
256
+ a.length === 0 && !E && l.length === 0 && !p && /* @__PURE__ */ r.jsx(
257
257
  "span",
258
258
  {
259
259
  className: d(
260
- "text-neutral-medium-default self-center prometeo-fonts-body-large pointer-events-none",
261
- a && "text-neutral-medium-disabled"
260
+ "text-neutral-medium-default self-center prometeo-fonts-body-large pointer-events-none truncate",
261
+ s && "text-neutral-medium-disabled"
262
262
  ),
263
263
  children: A || `Escribe los valores separados por ${v}`
264
264
  }
@@ -267,7 +267,7 @@ const ue = ({ label: O, name: q, onChange: m, value: s, icon: P, valueSeparator:
267
267
  }
268
268
  )
269
269
  ] }),
270
- !a && (g || x) && /* @__PURE__ */ r.jsx("div", { className: "min-h-6", children: w === "warning" ? typeof (g || x) == "string" ? /* @__PURE__ */ r.jsx("div", { className: "pl-3 mt-1", children: /* @__PURE__ */ r.jsxs("div", { className: "flex gap-0.5 items-start", children: [
270
+ !s && (g || x) && /* @__PURE__ */ r.jsx("div", { className: "min-h-6", children: w === "warning" ? typeof (g || x) == "string" ? /* @__PURE__ */ r.jsx("div", { className: "pl-3 mt-1", children: /* @__PURE__ */ r.jsxs("div", { className: "flex gap-0.5 items-start", children: [
271
271
  /* @__PURE__ */ r.jsx(le, { size: 16, className: "text-warning-medium-default" }),
272
272
  /* @__PURE__ */ r.jsx("p", { className: "prometeo-fonts-body-small text-warning-medium-default pt-px", children: g || x })
273
273
  ] }) }) : /* @__PURE__ */ r.jsx("div", { className: "ml-3", children: g || x }) : w === "error" && x ? /* @__PURE__ */ r.jsx($, { variant: "error", children: x }) : g ? /* @__PURE__ */ r.jsx($, { variant: w === "success" ? "success" : "default", children: g }) : null })
@@ -16,6 +16,7 @@ export interface DrawerMobileProps<TContext = unknown> {
16
16
  className?: string;
17
17
  classNameContent?: string;
18
18
  classNameFooter?: string;
19
+ zIndex?: number;
19
20
  }
20
21
  export interface DrawerMobileHandle<TContext = unknown> {
21
22
  open: (snap?: string | number | 'auto', context?: TContext) => void;
@@ -27,7 +27,7 @@ import { default as sr } from "./TextArea.es.js";
27
27
  import { default as ir } from "./Tooltip.es.js";
28
28
  import { default as mr } from "./Skeleton.es.js";
29
29
  import { default as dr } from "./SegmentedButton.es.js";
30
- import { I as hr } from "./ImageGallery-5nGROBTC.js";
30
+ import { I as hr } from "./ImageGallery-WVy6uNZc.js";
31
31
  import { default as gr } from "./Image.es.js";
32
32
  import { default as Dr, toastpyrion as vr } from "./Toast.es.js";
33
33
  import { default as kr } from "./ToastProvider.es.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prometeo-design-system",
3
3
  "private": false,
4
- "version": "5.8.0",
4
+ "version": "5.8.2",
5
5
  "type": "module",
6
6
  "description": "design kit system",
7
7
  "main": "dist/prometeo-design-system.umd.js",