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.
- package/dist/DrawerMobile.es.js +150 -147
- package/dist/Header.es.js +1 -1
- package/dist/{ImageGallery-5nGROBTC.js → ImageGallery-WVy6uNZc.js} +1 -1
- package/dist/ImageGallery.es.js +1 -1
- package/dist/InputMultiple.es.js +33 -33
- package/dist/components/Drawer/DrawerMobile.d.ts +1 -0
- package/dist/prometeo-design-system.es.js +1 -1
- package/package.json +1 -1
package/dist/DrawerMobile.es.js
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
1
|
import { j as w } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
-
import { c as
|
|
3
|
-
import
|
|
4
|
-
import { createPortal as
|
|
5
|
-
const X = 44,
|
|
6
|
-
const { children:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}, [
|
|
10
|
-
|
|
11
|
-
}, [
|
|
12
|
-
const
|
|
13
|
-
u("0%"),
|
|
14
|
-
}, []),
|
|
15
|
-
u(
|
|
16
|
-
}, [o]),
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
20
|
+
a(x);
|
|
21
21
|
} catch {
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
}, [
|
|
25
|
-
open:
|
|
26
|
-
close:
|
|
27
|
-
isOpen:
|
|
28
|
-
subscribeOpenChange: (
|
|
29
|
-
|
|
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: () =>
|
|
32
|
-
}), [
|
|
33
|
-
const $ =
|
|
34
|
-
return
|
|
35
|
-
}),
|
|
36
|
-
const r =
|
|
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
|
|
39
|
+
return g?.map((t) => {
|
|
40
40
|
if (t === "auto") {
|
|
41
|
-
const n =
|
|
42
|
-
return parseFloat(
|
|
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
|
-
}, [
|
|
47
|
-
const e =
|
|
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
|
-
}, []),
|
|
50
|
-
const s = n + c + t +
|
|
51
|
-
return `${Math.round(
|
|
52
|
-
}, []),
|
|
53
|
-
const n =
|
|
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) :
|
|
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
|
-
}, [
|
|
66
|
-
if (
|
|
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
|
-
|
|
68
|
+
f(n);
|
|
69
69
|
}
|
|
70
|
-
}, [
|
|
71
|
-
r.current && (r.current.style.transition =
|
|
72
|
-
}, [
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
t > e ?
|
|
78
|
-
},
|
|
79
|
-
if (
|
|
80
|
-
const { scrollY: e } =
|
|
81
|
-
document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, e),
|
|
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]),
|
|
83
|
+
}, [l]), U = i((e) => {
|
|
84
84
|
if (!r.current) return;
|
|
85
85
|
const t = e.touches[0], n = r.current.offsetHeight;
|
|
86
|
-
|
|
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
|
-
}, []),
|
|
94
|
+
}, []), oe = i((e) => {
|
|
95
95
|
if (!r.current) return;
|
|
96
96
|
const t = e, n = r.current.offsetHeight;
|
|
97
|
-
|
|
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
|
-
}, []),
|
|
106
|
-
if (!
|
|
107
|
-
const t = e.touches[0], n =
|
|
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
|
-
|
|
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(),
|
|
115
|
-
if (
|
|
116
|
-
const Q = (t.clientY - n.lastY) /
|
|
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
|
|
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]),
|
|
124
|
-
if (!
|
|
125
|
-
const t = e, n =
|
|
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
|
-
|
|
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(),
|
|
133
|
-
if (
|
|
134
|
-
const Q = (t.clientY - n.lastY) /
|
|
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
|
|
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]),
|
|
142
|
-
if (!
|
|
143
|
-
const e =
|
|
141
|
+
}, [l]), S = i(() => {
|
|
142
|
+
if (!a.current || !r.current) return;
|
|
143
|
+
const e = a.current;
|
|
144
144
|
if (e.isDragging) {
|
|
145
|
-
|
|
146
|
-
const t = r.current.offsetHeight, n =
|
|
147
|
-
|
|
145
|
+
re();
|
|
146
|
+
const t = r.current.offsetHeight, n = te(t, e.velocity);
|
|
147
|
+
B(n);
|
|
148
148
|
}
|
|
149
|
-
|
|
150
|
-
}, [
|
|
151
|
-
|
|
152
|
-
const t = (
|
|
153
|
-
document.removeEventListener("mousemove", t, { capture: !0 }), document.removeEventListener("mouseup", n, { capture: !0 }),
|
|
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
|
-
}, [
|
|
157
|
-
|
|
158
|
-
const e =
|
|
156
|
+
}, [oe, se, S]);
|
|
157
|
+
D(() => {
|
|
158
|
+
const e = $.current;
|
|
159
159
|
if (e)
|
|
160
|
-
return e.addEventListener("touchstart",
|
|
161
|
-
e.removeEventListener("touchstart",
|
|
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
|
-
}, [
|
|
164
|
-
const
|
|
165
|
-
return
|
|
166
|
-
|
|
167
|
-
}, [
|
|
168
|
-
if (!
|
|
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" && !
|
|
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
|
-
}, [
|
|
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 (
|
|
182
|
-
|
|
181
|
+
if (p && !J) return;
|
|
182
|
+
ne(e), requestAnimationFrame(() => {
|
|
183
183
|
requestAnimationFrame(() => {
|
|
184
|
-
const n = !
|
|
185
|
-
if (
|
|
186
|
-
const c =
|
|
187
|
-
|
|
188
|
-
const s =
|
|
189
|
-
|
|
190
|
-
} else n &&
|
|
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 =
|
|
197
|
-
}, [o, l,
|
|
198
|
-
|
|
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
|
-
|
|
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 &&
|
|
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
|
-
|
|
213
|
+
style: { zIndex: H },
|
|
214
|
+
className: A(
|
|
213
215
|
"h-0",
|
|
214
216
|
l ? "absolute" : "fixed",
|
|
215
|
-
"
|
|
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
|
-
|
|
219
|
-
|
|
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:
|
|
228
|
-
|
|
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:
|
|
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:
|
|
237
|
-
className:
|
|
239
|
+
ref: v,
|
|
240
|
+
className: A(
|
|
238
241
|
"drawer-mobile-content prometeo-scrollbar-thin-weak ",
|
|
239
|
-
|
|
242
|
+
R ? "drawer-mobile-content--open" : "drawer-mobile-content--closed",
|
|
240
243
|
"w-full h-full",
|
|
241
|
-
|
|
244
|
+
j
|
|
242
245
|
),
|
|
243
|
-
children: (!
|
|
246
|
+
children: (!p || J) && (typeof d == "function" ? d(E) : d)
|
|
244
247
|
}
|
|
245
248
|
),
|
|
246
|
-
|
|
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
|
-
|
|
250
|
-
), children: typeof
|
|
252
|
+
F
|
|
253
|
+
), children: typeof y == "function" ? y(E) : y })
|
|
251
254
|
]
|
|
252
255
|
}
|
|
253
256
|
)
|
|
254
257
|
] });
|
|
255
|
-
},
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
-
}, []),
|
|
259
|
-
|
|
260
|
-
}, []), o = i(() =>
|
|
261
|
-
return
|
|
262
|
-
const
|
|
263
|
-
if (!
|
|
264
|
-
const
|
|
265
|
-
|
|
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
|
-
|
|
271
|
+
f && f();
|
|
269
272
|
};
|
|
270
|
-
}, [
|
|
273
|
+
}, [d.current?.subscribeOpenChange]), {
|
|
271
274
|
isOpen: l,
|
|
272
|
-
open:
|
|
273
|
-
close:
|
|
274
|
-
drawerRef:
|
|
275
|
+
open: j,
|
|
276
|
+
close: F,
|
|
277
|
+
drawerRef: d,
|
|
275
278
|
getContext: o
|
|
276
279
|
};
|
|
277
280
|
};
|
|
278
281
|
export {
|
|
279
|
-
|
|
280
|
-
|
|
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-
|
|
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,
|
package/dist/ImageGallery.es.js
CHANGED
package/dist/InputMultiple.es.js
CHANGED
|
@@ -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
|
|
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
|
|
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:
|
|
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 ||
|
|
20
|
+
if (n.length === 0 || a.includes(n)) {
|
|
21
21
|
u(""), c(!0), j(e.target);
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
m([...
|
|
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(
|
|
37
|
-
}, [C, l, m,
|
|
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 =
|
|
44
|
-
t && (m(
|
|
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 && !
|
|
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 =
|
|
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(
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
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:
|
|
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-
|
|
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
|
-
|
|
177
|
+
s && "text-neutral-medium-disabled"
|
|
178
178
|
), children: P }),
|
|
179
|
-
|
|
179
|
+
a.map((e, t) => {
|
|
180
180
|
const n = d(
|
|
181
|
-
t ===
|
|
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: !!
|
|
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
|
-
|
|
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
|
-
|
|
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(), !
|
|
215
|
+
F.stopPropagation(), !s && S(e);
|
|
216
216
|
},
|
|
217
217
|
className: d(
|
|
218
218
|
"cursor-pointer hover:text-neutral-default-hover",
|
|
219
|
-
|
|
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(), !
|
|
228
|
+
F.stopPropagation(), !s && M(e);
|
|
229
229
|
},
|
|
230
230
|
className: d(
|
|
231
231
|
"cursor-pointer hover:scale-105 transition-all duration-200",
|
|
232
|
-
|
|
232
|
+
s && "cursor-default hover:scale-100"
|
|
233
233
|
),
|
|
234
234
|
children: /* @__PURE__ */ r.jsx(
|
|
235
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
!
|
|
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-
|
|
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";
|