prometeo-design-system 2.5.1 → 2.5.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.
- package/dist/{CardProfile-Fn44kEnM.js → CardProfile-DV3gwvqE.js} +20 -20
- package/dist/CardProfile.es.js +1 -1
- package/dist/DatePicker.es.js +1 -1
- package/dist/DrawerMobile.es.js +102 -100
- package/dist/Icons/Icons.d.ts +3 -0
- package/dist/Icons.es.js +43 -26
- package/dist/{Input-Bhd0bmVq.js → Input-PNwH7rb6.js} +1 -1
- package/dist/Input.es.js +1 -1
- package/dist/OtpInput.es.js +144 -139
- package/dist/SegmentedButton.es.js +16 -16
- package/dist/{Select-B32JqJIS.js → Select-C-aLaiJu.js} +1 -1
- package/dist/Select.es.js +1 -1
- package/dist/SelectFormik.es.js +1 -1
- package/dist/SelectSearch.es.js +48 -47
- package/dist/components/Drawer/DrawerMobile.d.ts +6 -5
- package/dist/components/Drawer/useDrawerMobile.d.ts +4 -3
- package/dist/components/FAB/FAButton.d.ts +21 -0
- package/dist/components/OtpInput/OtpInput.d.ts +5 -2
- package/dist/components/SelectSearch/SelectSearch.d.ts +1 -0
- package/dist/exports/FAButton.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/pages/ButtonsPage.d.ts +2 -0
- package/dist/pages/OtpPage.d.ts +2 -0
- package/dist/preview/FABPreview.d.ts +2 -0
- package/dist/preview/OTPPreview.d.ts +2 -0
- package/dist/preview/SegmentedButtonPreview.d.ts +2 -0
- package/dist/prometeo-design-system.css +1 -1
- package/dist/prometeo-design-system.es.js +329 -269
- package/package.json +1 -1
- package/src/styles/intellisense.css +10 -1
- package/dist/pages/Buttons.d.ts +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
-
import { c as
|
|
3
|
-
import { motion as
|
|
2
|
+
import { c as l } from "./cn-B6yFEsav.js";
|
|
3
|
+
import { motion as i, AnimatePresence as u } from "framer-motion";
|
|
4
4
|
import m from "./Avatar.es.js";
|
|
5
5
|
import { Icons as s } from "./Icons.es.js";
|
|
6
6
|
function f({
|
|
@@ -29,13 +29,13 @@ function f({
|
|
|
29
29
|
r._id
|
|
30
30
|
)) });
|
|
31
31
|
}
|
|
32
|
-
const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profile-container flex rounded-md text-white-prometeo overflow-hidden
|
|
32
|
+
const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profile-container flex rounded-md text-white-prometeo overflow-hidden shrink-0 w-full min-w-0 ", children: t }), h = ({
|
|
33
33
|
isExpanded: t,
|
|
34
34
|
sessions: a,
|
|
35
35
|
onClickLogout: r,
|
|
36
36
|
handleTokenLogin: n
|
|
37
37
|
}) => /* @__PURE__ */ e.jsx(u, { mode: "wait", children: t && /* @__PURE__ */ e.jsxs(
|
|
38
|
-
|
|
38
|
+
i.div,
|
|
39
39
|
{
|
|
40
40
|
initial: { height: 0, opacity: 0 },
|
|
41
41
|
animate: {
|
|
@@ -61,7 +61,7 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
|
|
|
61
61
|
className: "overflow-hidden",
|
|
62
62
|
children: [
|
|
63
63
|
/* @__PURE__ */ e.jsx(
|
|
64
|
-
|
|
64
|
+
i.div,
|
|
65
65
|
{
|
|
66
66
|
className: "flex justify-center items-center w-full mt-4",
|
|
67
67
|
exit: {
|
|
@@ -74,12 +74,12 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
|
|
|
74
74
|
ease: "easeInOut"
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "border-b border-neutral-strong-default border
|
|
77
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "border-b border-neutral-strong-default border w-full" })
|
|
78
78
|
}
|
|
79
79
|
),
|
|
80
80
|
a && a.length > 0 && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
81
81
|
/* @__PURE__ */ e.jsx(
|
|
82
|
-
|
|
82
|
+
i.div,
|
|
83
83
|
{
|
|
84
84
|
className: "mt-4",
|
|
85
85
|
exit: {
|
|
@@ -96,7 +96,7 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
|
|
|
96
96
|
}
|
|
97
97
|
),
|
|
98
98
|
/* @__PURE__ */ e.jsx(
|
|
99
|
-
|
|
99
|
+
i.div,
|
|
100
100
|
{
|
|
101
101
|
className: "mt-4 overflow-hidden w-full ",
|
|
102
102
|
exit: {
|
|
@@ -122,7 +122,7 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
|
|
|
122
122
|
}
|
|
123
123
|
),
|
|
124
124
|
/* @__PURE__ */ e.jsx(
|
|
125
|
-
|
|
125
|
+
i.div,
|
|
126
126
|
{
|
|
127
127
|
className: "flex justify-center items-center w-full mt-4",
|
|
128
128
|
exit: {
|
|
@@ -135,12 +135,12 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
|
|
|
135
135
|
ease: "easeInOut"
|
|
136
136
|
}
|
|
137
137
|
},
|
|
138
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "border-b border-neutral-strong-default border
|
|
138
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "border-b border-neutral-strong-default border w-full" })
|
|
139
139
|
}
|
|
140
140
|
)
|
|
141
141
|
] }),
|
|
142
142
|
/* @__PURE__ */ e.jsxs(
|
|
143
|
-
|
|
143
|
+
i.button,
|
|
144
144
|
{
|
|
145
145
|
onClick: r,
|
|
146
146
|
className: "flex flex-1 h-12 w-full gap-1 rounded-md cursor-pointer mt-4 mb-4 px-2 items-center overflow-hidden focus:outline-none hover:bg-neutral-medium-selected button-profile",
|
|
@@ -184,10 +184,10 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
|
|
|
184
184
|
cardProfile: d,
|
|
185
185
|
onClick: c
|
|
186
186
|
}) => /* @__PURE__ */ e.jsxs(
|
|
187
|
-
|
|
187
|
+
i.button,
|
|
188
188
|
{
|
|
189
189
|
onClick: c,
|
|
190
|
-
className:
|
|
190
|
+
className: l(
|
|
191
191
|
"flex flex-1 gap-1 rounded-l-md cursor-pointer relative overflow-hidden focus:outline-none hover:bg-neutral-medium-selected button-profile h-12",
|
|
192
192
|
t && "bg-neutral-medium-selected"
|
|
193
193
|
),
|
|
@@ -203,7 +203,7 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
|
|
|
203
203
|
/* @__PURE__ */ e.jsx(
|
|
204
204
|
"p",
|
|
205
205
|
{
|
|
206
|
-
className:
|
|
206
|
+
className: l(
|
|
207
207
|
"profile-name font-semibold leading-tight mb-0 text-left",
|
|
208
208
|
t ? "text-primary-default-default" : "text-neutral-default-default"
|
|
209
209
|
),
|
|
@@ -214,7 +214,7 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
|
|
|
214
214
|
/* @__PURE__ */ e.jsx(
|
|
215
215
|
"p",
|
|
216
216
|
{
|
|
217
|
-
className:
|
|
217
|
+
className: l(
|
|
218
218
|
"profile-options truncate text-xs mt-0",
|
|
219
219
|
t ? "text-primary-default-default" : "text-neutral-default-default"
|
|
220
220
|
),
|
|
@@ -224,7 +224,7 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
|
|
|
224
224
|
/* @__PURE__ */ e.jsx(
|
|
225
225
|
"p",
|
|
226
226
|
{
|
|
227
|
-
className:
|
|
227
|
+
className: l(
|
|
228
228
|
"profile-options truncate font-bold mt-0",
|
|
229
229
|
t ? "text-primary-default-default" : "text-neutral-default-default"
|
|
230
230
|
),
|
|
@@ -234,7 +234,7 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
|
|
|
234
234
|
/* @__PURE__ */ e.jsx(
|
|
235
235
|
"p",
|
|
236
236
|
{
|
|
237
|
-
className:
|
|
237
|
+
className: l(
|
|
238
238
|
"profile-options truncate text-xs mt-0",
|
|
239
239
|
t ? "text-primary-default-default" : "text-neutral-default-default"
|
|
240
240
|
),
|
|
@@ -246,7 +246,7 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
|
|
|
246
246
|
]
|
|
247
247
|
}
|
|
248
248
|
), g = () => /* @__PURE__ */ e.jsx("div", { className: "w-px bg-gray-500/30 my-1 border-separator-profile" }), v = ({ isExpanded: t, onClick: a }) => /* @__PURE__ */ e.jsx(
|
|
249
|
-
|
|
249
|
+
i.button,
|
|
250
250
|
{
|
|
251
251
|
onClick: a,
|
|
252
252
|
className: "flex items-center justify-center p-3 rounded-r-md cursor-pointer relative overflow-hidden focus:outline-none min-w-[50px] hover:bg-neutral-medium-selected button-content-chevron",
|
|
@@ -256,12 +256,12 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
|
|
|
256
256
|
title: t ? "Ocultar opciones" : "Mostrar opciones",
|
|
257
257
|
"aria-label": t ? "Ocultar opciones" : "Mostrar opciones",
|
|
258
258
|
children: /* @__PURE__ */ e.jsx(
|
|
259
|
-
|
|
259
|
+
i.div,
|
|
260
260
|
{
|
|
261
261
|
animate: { rotate: t ? 180 : 0 },
|
|
262
262
|
transition: { duration: 0.3, ease: "easeOut" },
|
|
263
263
|
className: "relative button-select-crevron",
|
|
264
|
-
children: /* @__PURE__ */ e.jsx(
|
|
264
|
+
children: /* @__PURE__ */ e.jsx(i.div, { transition: { duration: 0.2 }, children: /* @__PURE__ */ e.jsx(s.ChevronDown, { size: 20, className: "text-prometeo-neutral " }) })
|
|
265
265
|
}
|
|
266
266
|
)
|
|
267
267
|
}
|
package/dist/CardProfile.es.js
CHANGED
package/dist/DatePicker.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as $ } from "./jsx-runtime-DKDX3adD.js";
|
|
2
2
|
import m, { createContext as mn, useContext as hn, useCallback as q, useRef as Se, useLayoutEffect as yn, useState as he, useEffect as _e, useMemo as fe, memo as pn } from "react";
|
|
3
3
|
import { InputMultiple as gn } from "./InputMultiple.es.js";
|
|
4
|
-
import { I as wn } from "./Input-
|
|
4
|
+
import { I as wn } from "./Input-PNwH7rb6.js";
|
|
5
5
|
import { createPortal as bn } from "react-dom";
|
|
6
6
|
import { Icons as Mt } from "./Icons.es.js";
|
|
7
7
|
import { c as Be } from "./cn-B6yFEsav.js";
|
package/dist/DrawerMobile.es.js
CHANGED
|
@@ -1,68 +1,69 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { c as
|
|
3
|
-
import { forwardRef as
|
|
1
|
+
import { j as g } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
+
import { c as G } from "./cn-B6yFEsav.js";
|
|
3
|
+
import { forwardRef as J, useState as _, useRef as h, useEffect as F, useCallback as c, useMemo as q, useImperativeHandle as K } from "react";
|
|
4
4
|
import { createPortal as Q } from "react-dom";
|
|
5
|
-
const
|
|
6
|
-
const { children:
|
|
7
|
-
|
|
8
|
-
s &&
|
|
9
|
-
}, [s]),
|
|
10
|
-
|
|
11
|
-
}, [
|
|
12
|
-
const
|
|
13
|
-
r("0%"),
|
|
14
|
-
}, []),
|
|
15
|
-
console.log(
|
|
16
|
-
}, [
|
|
5
|
+
const W = 44, U = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", ee = J((a, o) => {
|
|
6
|
+
const { children: x, defaultOpen: s = !1, onClose: f, snapPoints: d = ["60%"], setSnap: v, snap: w, attachToParent: O = !1 } = a, [E, r] = _(w || "0%"), [C, Y] = _(null), u = h(f), p = h(v), b = h(C);
|
|
7
|
+
u.current = f, b.current = C, F(() => {
|
|
8
|
+
s && H();
|
|
9
|
+
}, [s]), F(() => {
|
|
10
|
+
p.current = v;
|
|
11
|
+
}, [v]);
|
|
12
|
+
const M = c(() => {
|
|
13
|
+
r("0%"), u.current?.(b.current), setTimeout(() => Y(null), 300);
|
|
14
|
+
}, []), H = c((L, R) => {
|
|
15
|
+
console.log(L || d[0] || "60%"), r(L || d[0] || "60%"), Y(R ?? null);
|
|
16
|
+
}, [d]), S = q(() => E !== "0%", [E]);
|
|
17
17
|
K(o, () => ({
|
|
18
|
-
open:
|
|
19
|
-
close:
|
|
20
|
-
isOpen:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
open: H,
|
|
19
|
+
close: M,
|
|
20
|
+
isOpen: S,
|
|
21
|
+
getContext: () => b.current
|
|
22
|
+
}), [H, M, S]);
|
|
23
|
+
const y = w || E;
|
|
24
|
+
return O ? /* @__PURE__ */ g.jsx(B, { ...a, snap: y, setSnap: r, children: x }) : Q(/* @__PURE__ */ g.jsx(B, { ...a, snap: y, setSnap: r, children: x }), document.body);
|
|
25
|
+
}), B = ({ children: a, attachToParent: o = !1, className: x, snap: s, snapPoints: f = ["60%"], setSnap: d, hideOnClose: v = !1, header: w, modal: O = !1, closeOnOverlayClick: E = !1 }) => {
|
|
26
|
+
const r = h(null), C = h(null), Y = h(null), u = h(null), p = h(null), b = c(() => {
|
|
26
27
|
if (!r.current) return [];
|
|
27
28
|
console.log(f, "snapPoints");
|
|
28
29
|
const e = o && r.current.parentElement?.offsetHeight || window.innerHeight;
|
|
29
30
|
return f?.map((t) => 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) || [];
|
|
30
|
-
}, [f, o]),
|
|
31
|
-
const n =
|
|
31
|
+
}, [f, o]), M = c((e, t) => {
|
|
32
|
+
const n = b();
|
|
32
33
|
if (n.length === 0) return e;
|
|
33
34
|
if (Math.abs(t) > 0.05)
|
|
34
35
|
if (t > 0) {
|
|
35
|
-
const
|
|
36
|
-
return
|
|
36
|
+
const l = n.filter((i) => i < e);
|
|
37
|
+
return l.length > 0 ? Math.max(...l) : v ? 0 : W;
|
|
37
38
|
} else {
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
return Math.min(...
|
|
39
|
+
const l = n.filter((i) => i > e);
|
|
40
|
+
if (l.length > 0)
|
|
41
|
+
return Math.min(...l);
|
|
41
42
|
}
|
|
42
|
-
return n.reduce((
|
|
43
|
-
}, [
|
|
44
|
-
if (
|
|
45
|
-
const t = o && r.current?.parentElement?.offsetHeight || window.innerHeight, n = e <=
|
|
46
|
-
|
|
43
|
+
return n.reduce((l, i) => Math.abs(i - e) < Math.abs(l - e) ? i : l);
|
|
44
|
+
}, [b]), H = c((e) => {
|
|
45
|
+
if (d && f) {
|
|
46
|
+
const t = o && r.current?.parentElement?.offsetHeight || window.innerHeight, n = e <= W ? "0%" : `${Math.round(e / t * 100)}%`;
|
|
47
|
+
d(n);
|
|
47
48
|
}
|
|
48
|
-
}, [
|
|
49
|
+
}, [d, f, o]), S = c((e) => {
|
|
49
50
|
r.current && (r.current.style.transition = U, r.current.style.height = `${e}px`);
|
|
50
|
-
}, [
|
|
51
|
-
if (
|
|
52
|
-
const { scrollY: e } =
|
|
53
|
-
document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, e),
|
|
51
|
+
}, [d, f, o]), y = c(() => {
|
|
52
|
+
if (p.current && o) {
|
|
53
|
+
const { scrollY: e } = p.current;
|
|
54
|
+
document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, e), p.current = null;
|
|
54
55
|
}
|
|
55
56
|
}, [o]);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, [
|
|
57
|
+
F(() => () => {
|
|
58
|
+
y();
|
|
59
|
+
}, [y]), F(() => {
|
|
59
60
|
if (!r.current || !s) return;
|
|
60
61
|
console.log(s, "new snap");
|
|
61
62
|
const e = o && r.current.parentElement?.offsetHeight || window.innerHeight;
|
|
62
63
|
let t = 0;
|
|
63
|
-
typeof s == "string" && s.endsWith("%") ? parseFloat(s) <= 0 ? t =
|
|
64
|
+
typeof s == "string" && s.endsWith("%") ? parseFloat(s) <= 0 ? t = v ? 0 : W : t = parseFloat(s) / 100 * e : typeof s == "string" && s.endsWith("px") ? t = parseFloat(s) : typeof s == "number" && (s >= 0 && s <= 1 ? t = s * e : t = s), S(t);
|
|
64
65
|
}, [s, o]);
|
|
65
|
-
const N =
|
|
66
|
+
const N = c((e) => {
|
|
66
67
|
if (!r.current) return;
|
|
67
68
|
const t = e.touches[0], n = r.current.offsetHeight;
|
|
68
69
|
u.current = {
|
|
@@ -73,7 +74,7 @@ const G = 44, U = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", ee = q((a, o) =>
|
|
|
73
74
|
lastTime: Date.now(),
|
|
74
75
|
velocity: 0
|
|
75
76
|
};
|
|
76
|
-
}, []),
|
|
77
|
+
}, []), L = c((e) => {
|
|
77
78
|
if (!r.current) return;
|
|
78
79
|
const t = e, n = r.current.offsetHeight;
|
|
79
80
|
u.current = {
|
|
@@ -84,100 +85,100 @@ const G = 44, U = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", ee = q((a, o) =>
|
|
|
84
85
|
lastTime: Date.now(),
|
|
85
86
|
velocity: 0
|
|
86
87
|
};
|
|
87
|
-
}, []),
|
|
88
|
+
}, []), R = c((e) => {
|
|
88
89
|
if (!u.current || !r.current) return;
|
|
89
|
-
const t = e.touches[0], n = u.current,
|
|
90
|
-
if (!n.isDragging &&
|
|
90
|
+
const t = e.touches[0], n = u.current, D = n.startY - t.clientY, l = n.isDragging || Math.abs(D) > 5;
|
|
91
|
+
if (!n.isDragging && l && (n.isDragging = !0, o)) {
|
|
91
92
|
const i = window.scrollY;
|
|
92
|
-
|
|
93
|
+
p.current = { scrollY: i }, document.body.style.position = "fixed", document.body.style.top = `-${i}px`, document.body.style.width = "100%";
|
|
93
94
|
}
|
|
94
|
-
if (
|
|
95
|
+
if (l) {
|
|
95
96
|
e.preventDefault();
|
|
96
|
-
const i = Date.now(),
|
|
97
|
-
if (
|
|
98
|
-
const
|
|
99
|
-
n.velocity = n.velocity * 0.8 +
|
|
97
|
+
const i = Date.now(), j = i - n.lastTime;
|
|
98
|
+
if (j > 0) {
|
|
99
|
+
const z = (t.clientY - n.lastY) / j;
|
|
100
|
+
n.velocity = n.velocity * 0.8 + z * 0.2;
|
|
100
101
|
}
|
|
101
102
|
n.lastY = t.clientY, n.lastTime = i;
|
|
102
|
-
const k = n.startHeight +
|
|
103
|
-
r.current.style.transition = "none", r.current.style.height = `${
|
|
103
|
+
const k = n.startHeight + D, T = o && r.current.parentElement?.offsetHeight || window.innerHeight, $ = Math.max(0, Math.min(k, T));
|
|
104
|
+
r.current.style.transition = "none", r.current.style.height = `${$}px`;
|
|
104
105
|
}
|
|
105
|
-
}, [o]), A =
|
|
106
|
+
}, [o]), A = c((e) => {
|
|
106
107
|
if (!u.current || !r.current) return;
|
|
107
|
-
const t = e, n = u.current,
|
|
108
|
-
if (!n.isDragging &&
|
|
108
|
+
const t = e, n = u.current, D = n.startY - t.clientY, l = n.isDragging || Math.abs(D) > 5;
|
|
109
|
+
if (!n.isDragging && l && (n.isDragging = !0, o)) {
|
|
109
110
|
const i = window.scrollY;
|
|
110
|
-
|
|
111
|
+
p.current = { scrollY: i }, document.body.style.position = "fixed", document.body.style.top = `-${i}px`, document.body.style.width = "100%";
|
|
111
112
|
}
|
|
112
|
-
if (
|
|
113
|
+
if (l) {
|
|
113
114
|
e.preventDefault();
|
|
114
|
-
const i = Date.now(),
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
117
|
-
n.velocity = n.velocity * 0.8 +
|
|
115
|
+
const i = Date.now(), j = i - n.lastTime;
|
|
116
|
+
if (j > 0) {
|
|
117
|
+
const z = (t.clientY - n.lastY) / j;
|
|
118
|
+
n.velocity = n.velocity * 0.8 + z * 0.2;
|
|
118
119
|
}
|
|
119
120
|
n.lastY = t.clientY, n.lastTime = i;
|
|
120
|
-
const k = n.startHeight +
|
|
121
|
-
r.current.style.transition = "none", r.current.style.height = `${
|
|
121
|
+
const k = n.startHeight + D, T = o && r.current.parentElement?.offsetHeight || window.innerHeight, $ = Math.max(0, Math.min(k, T));
|
|
122
|
+
r.current.style.transition = "none", r.current.style.height = `${$}px`;
|
|
122
123
|
}
|
|
123
|
-
}, [o]),
|
|
124
|
+
}, [o]), m = c(() => {
|
|
124
125
|
if (!u.current || !r.current) return;
|
|
125
126
|
const e = u.current;
|
|
126
127
|
if (e.isDragging) {
|
|
127
|
-
|
|
128
|
-
const t = r.current.offsetHeight, n =
|
|
129
|
-
|
|
128
|
+
y();
|
|
129
|
+
const t = r.current.offsetHeight, n = M(t, e.velocity);
|
|
130
|
+
H(n);
|
|
130
131
|
}
|
|
131
132
|
u.current = null;
|
|
132
|
-
}, [
|
|
133
|
-
|
|
134
|
-
const e =
|
|
133
|
+
}, [M, S, y]);
|
|
134
|
+
F(() => {
|
|
135
|
+
const e = Y.current;
|
|
135
136
|
if (e)
|
|
136
|
-
return e.addEventListener("touchstart", N, { passive: !1 }), e.addEventListener("touchmove",
|
|
137
|
-
e.removeEventListener("touchstart", N), e.removeEventListener("touchmove",
|
|
137
|
+
return e.addEventListener("touchstart", N, { passive: !1 }), e.addEventListener("touchmove", R, { passive: !1 }), e.addEventListener("touchend", m), e.addEventListener("touchcancel", m), e.addEventListener("mousedown", L, { passive: !1 }), e.addEventListener("mousemove", A, { passive: !1 }), e.addEventListener("mouseup", m), e.addEventListener("mouseleave", m), () => {
|
|
138
|
+
e.removeEventListener("touchstart", N), e.removeEventListener("touchmove", R), e.removeEventListener("touchend", m), e.removeEventListener("touchcancel", m), e.removeEventListener("mousedown", L), e.removeEventListener("mousemove", A), e.removeEventListener("mouseup", m), e.removeEventListener("mouseleave", m);
|
|
138
139
|
};
|
|
139
|
-
}, [N,
|
|
140
|
-
const I =
|
|
141
|
-
return /* @__PURE__ */
|
|
142
|
-
|
|
140
|
+
}, [N, R, m]);
|
|
141
|
+
const I = q(() => s !== "0%", [s]);
|
|
142
|
+
return /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
|
|
143
|
+
O && /* @__PURE__ */ g.jsx(
|
|
143
144
|
"div",
|
|
144
145
|
{
|
|
145
|
-
className:
|
|
146
|
+
className: G(I ? "fixed inset-0 bg-black/40 z-55 cursor-default" : "hidden"),
|
|
146
147
|
onClick: (e) => {
|
|
147
|
-
e.preventDefault(), e.stopPropagation(),
|
|
148
|
+
e.preventDefault(), e.stopPropagation(), E && H(0);
|
|
148
149
|
},
|
|
149
150
|
"aria-hidden": "true"
|
|
150
151
|
}
|
|
151
152
|
),
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ g.jsxs(
|
|
153
154
|
"div",
|
|
154
155
|
{
|
|
155
156
|
ref: r,
|
|
156
|
-
className:
|
|
157
|
+
className: G(
|
|
157
158
|
o ? "absolute" : "fixed",
|
|
158
159
|
"z-60 bottom-0 w-full overflow-hidden",
|
|
159
160
|
"bg-neutral-default-default",
|
|
160
161
|
"border-t border-neutral-strong-default rounded-t-[12px]",
|
|
161
162
|
I ? "" : "border-neutral-weak",
|
|
162
|
-
|
|
163
|
+
x,
|
|
163
164
|
"flex flex-col items-center",
|
|
164
165
|
"touch-none select-none"
|
|
165
166
|
),
|
|
166
167
|
children: [
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ g.jsx(
|
|
168
169
|
"div",
|
|
169
170
|
{
|
|
170
|
-
ref:
|
|
171
|
+
ref: Y,
|
|
171
172
|
className: "w-full absolute top-0 h-11 flex items-center justify-center cursor-grab active:cursor-grabbing z-50 bg-inherit!",
|
|
172
|
-
children: /* @__PURE__ */
|
|
173
|
+
children: /* @__PURE__ */ g.jsx("span", { className: "w-12 h-1 rounded-full bg-neutral-weak-default" })
|
|
173
174
|
}
|
|
174
175
|
),
|
|
175
|
-
typeof w == "string" ? /* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */
|
|
176
|
+
typeof w == "string" ? /* @__PURE__ */ g.jsx("p", { className: " prometeo-fonts-headline-small text-neutral-default-default w-full h-11 bg-inherit absolute top-11 z-50 px-4", children: w }) : w,
|
|
177
|
+
/* @__PURE__ */ g.jsx(
|
|
177
178
|
"div",
|
|
178
179
|
{
|
|
179
|
-
ref:
|
|
180
|
-
className:
|
|
180
|
+
ref: C,
|
|
181
|
+
className: G(
|
|
181
182
|
"w-full h-full overflow-y-auto px-4 pb-4 ",
|
|
182
183
|
w ? "mt-22" : "mt-11"
|
|
183
184
|
),
|
|
@@ -193,16 +194,17 @@ const G = 44, U = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", ee = q((a, o) =>
|
|
|
193
194
|
)
|
|
194
195
|
] });
|
|
195
196
|
}, te = () => {
|
|
196
|
-
const a =
|
|
197
|
-
a.current?.open(
|
|
198
|
-
}, []),
|
|
197
|
+
const a = h(null), o = c((d, v) => {
|
|
198
|
+
a.current?.open(d, v);
|
|
199
|
+
}, []), x = c(() => {
|
|
199
200
|
a.current?.close();
|
|
200
|
-
}, []);
|
|
201
|
+
}, []), s = c(() => a.current?.isOpen ?? !1, []), f = c(() => a.current?.getContext() ?? null, []);
|
|
201
202
|
return {
|
|
202
|
-
isOpen:
|
|
203
|
+
isOpen: s,
|
|
203
204
|
open: o,
|
|
204
|
-
close:
|
|
205
|
-
drawerRef: a
|
|
205
|
+
close: x,
|
|
206
|
+
drawerRef: a,
|
|
207
|
+
getContext: f
|
|
206
208
|
};
|
|
207
209
|
};
|
|
208
210
|
export {
|
package/dist/Icons/Icons.d.ts
CHANGED
|
@@ -53,5 +53,8 @@ declare const Icons: {
|
|
|
53
53
|
readonly Cancel: import('react').MemoExoticComponent<(props: IconProps) => ReactElement>;
|
|
54
54
|
readonly CheckCircle: import('react').MemoExoticComponent<(props: IconProps) => ReactElement>;
|
|
55
55
|
readonly FormatColorText: import('react').MemoExoticComponent<(props: IconProps) => ReactElement>;
|
|
56
|
+
readonly CheckList: import('react').MemoExoticComponent<(props: IconProps) => ReactElement>;
|
|
56
57
|
};
|
|
57
58
|
export { Icons };
|
|
59
|
+
export type IconName = keyof typeof Icons;
|
|
60
|
+
export type IconComponent = (typeof Icons)[IconName];
|