bmi-next 1.0.33 → 1.0.35
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/assets/index6.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._overlay_1anip_1{position:fixed;top:0;left:0;right:0;bottom:0;background-color:var(--negro-60);animation:_fadeIn_1anip_1 .25s ease-in-out;z-index:2000}._overlay_1anip_1._closing_1anip_12{animation:_fadeOut_1anip_1 .25s ease-in-out forwards}@keyframes _fadeIn_1anip_1{0%{opacity:0}to{opacity:1}}@keyframes _fadeOut_1anip_1{0%{opacity:1}to{opacity:0}}._bottomDrawer_1anip_36{position:fixed;bottom:0;left:0;right:0;background-color:#fff;border-radius:16px 16px 0 0;z-index:2001;animation:_slideUp_1anip_1 .35s cubic-bezier(.4,0,.2,1);padding-top:7px;padding-bottom:calc(env(safe-area-inset-bottom) + 10px);padding-inline:15px;transition:transform .2s cubic-bezier(.4,0,.2,1);touch-action:none}._closing_1anip_12{animation:_slideDown_1anip_1 .35s cubic-bezier(.4,0,.2,1) forwards}@keyframes _slideUp_1anip_1{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes _slideDown_1anip_1{0%{transform:translateY(0)}to{transform:translateY(100%)}}._drawerHeader_1anip_76{display:flex;flex-direction:column;cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;position:relative}._drawerHeader_1anip_76:active{cursor:grabbing}._drawerIndicator_1anip_89{width:40px;height:7px;background-color:var(--negro-10);border-radius:14px;position:absolute;left:50%;transform:translate(-50%);top:7px}._drawerContent_1anip_100{max-height:70vh;overflow-y:auto;padding-top:15px;display:flex;flex-direction:column;gap:19px}._drawerHeader_1anip_76 p{font-family:Poppins Bold;font-size:19px;line-height:22.8px;margin:0}._closeButton_1anip_116{cursor:pointer;display:flex;align-items:center;justify-content:end}._closeButton_1anip_116>svg{background-color:var(--negro-10);border-radius:50%;padding:2px}._modalDrawer_1anip_129{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background-color:#fff;border-radius:16px;z-index:2001;animation:_fadeIn_1anip_1 .35s cubic-bezier(.4,0,.2,1);padding:20px;max-width:90%;max-height:90vh;min-width:350px;width:350px}._modalDrawer_1anip_129._closing_1anip_12{animation:_fadeOut_1anip_1 .35s cubic-bezier(.4,0,.2,1) forwards}
|
|
@@ -11,6 +11,7 @@ interface DrawerPortalBaseProps {
|
|
|
11
11
|
isClosing: boolean;
|
|
12
12
|
title?: string;
|
|
13
13
|
children: ReactNode;
|
|
14
|
+
modal?: boolean;
|
|
14
15
|
}
|
|
15
|
-
export declare const DrawerPortalBase: ({ isOpen, handleClose, dragPosition, setDragPosition, isClosing, title, children, }: DrawerPortalBaseProps) => import('react').ReactPortal | null;
|
|
16
|
+
export declare const DrawerPortalBase: ({ isOpen, handleClose, dragPosition, setDragPosition, isClosing, title, children, modal, }: DrawerPortalBaseProps) => import('react').ReactPortal | null;
|
|
16
17
|
export {};
|
|
@@ -1,64 +1,67 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsxs as m, Fragment as E, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as p } from "react";
|
|
3
3
|
import { r as g } from "../../../index-Cp_B-Y3h.js";
|
|
4
|
-
import { Icon as
|
|
5
|
-
import '../../../assets/index6.css';const
|
|
6
|
-
overlay:
|
|
7
|
-
closing:
|
|
8
|
-
bottomDrawer:
|
|
9
|
-
drawerHeader:
|
|
10
|
-
drawerIndicator:
|
|
11
|
-
drawerContent:
|
|
12
|
-
closeButton:
|
|
13
|
-
|
|
4
|
+
import { Icon as y } from "../../../icons/icons.js";
|
|
5
|
+
import '../../../assets/index6.css';const Y = "_overlay_1anip_1", L = "_closing_1anip_12", B = "_bottomDrawer_1anip_36", I = "_drawerHeader_1anip_76", N = "_drawerIndicator_1anip_89", b = "_drawerContent_1anip_100", x = "_closeButton_1anip_116", $ = "_modalDrawer_1anip_129", e = {
|
|
6
|
+
overlay: Y,
|
|
7
|
+
closing: L,
|
|
8
|
+
bottomDrawer: B,
|
|
9
|
+
drawerHeader: I,
|
|
10
|
+
drawerIndicator: N,
|
|
11
|
+
drawerContent: b,
|
|
12
|
+
closeButton: x,
|
|
13
|
+
modalDrawer: $
|
|
14
|
+
}, k = ({
|
|
14
15
|
isOpen: h,
|
|
15
|
-
handleClose:
|
|
16
|
-
dragPosition:
|
|
17
|
-
setDragPosition:
|
|
18
|
-
isClosing:
|
|
19
|
-
title:
|
|
20
|
-
children:
|
|
16
|
+
handleClose: s,
|
|
17
|
+
dragPosition: D,
|
|
18
|
+
setDragPosition: l,
|
|
19
|
+
isClosing: u,
|
|
20
|
+
title: v,
|
|
21
|
+
children: f,
|
|
22
|
+
modal: o
|
|
21
23
|
}) => {
|
|
22
|
-
const
|
|
24
|
+
const d = p(0), i = p(0);
|
|
23
25
|
if (!h) return null;
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
const _ = (r) => {
|
|
27
|
+
if (o) return;
|
|
28
|
+
const n = "touches" in r ? r.touches[0].clientY : r.clientY;
|
|
29
|
+
d.current = n, i.current = n, document.addEventListener("mousemove", c), document.addEventListener("touchmove", c), document.addEventListener("mouseup", a), document.addEventListener("touchend", a);
|
|
30
|
+
}, a = () => {
|
|
31
|
+
document.removeEventListener("mousemove", c), document.removeEventListener("touchmove", c), document.removeEventListener("mouseup", a), document.removeEventListener("touchend", a), i.current - d.current > 100 ? s() : l(0);
|
|
32
|
+
}, c = (r) => {
|
|
33
|
+
const n = "touches" in r ? r.touches[0].clientY : r.clientY, w = n - d.current;
|
|
34
|
+
i.current = n, w > 0 && l(w);
|
|
32
35
|
};
|
|
33
36
|
return g.createPortal(
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ m(E, { children: [
|
|
38
|
+
/* @__PURE__ */ t(
|
|
36
39
|
"div",
|
|
37
40
|
{
|
|
38
|
-
className: `${
|
|
39
|
-
onClick:
|
|
41
|
+
className: `${e.overlay} ${u ? e.closing : ""}`,
|
|
42
|
+
onClick: s
|
|
40
43
|
}
|
|
41
44
|
),
|
|
42
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ m(
|
|
43
46
|
"div",
|
|
44
47
|
{
|
|
45
|
-
className: `${
|
|
46
|
-
style: { transform: `translateY(${
|
|
48
|
+
className: `${o ? e.modalDrawer : e.bottomDrawer} ${u ? e.closing : ""}`,
|
|
49
|
+
style: { transform: o ? void 0 : `translateY(${D}px)` },
|
|
47
50
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ m(
|
|
49
52
|
"header",
|
|
50
53
|
{
|
|
51
|
-
className:
|
|
52
|
-
onMouseDown:
|
|
53
|
-
onTouchStart:
|
|
54
|
+
className: e.drawerHeader,
|
|
55
|
+
onMouseDown: _,
|
|
56
|
+
onTouchStart: _,
|
|
54
57
|
children: [
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
|
|
58
|
+
!o && /* @__PURE__ */ t("div", { className: e.drawerIndicator }),
|
|
59
|
+
/* @__PURE__ */ t("div", { className: e.closeButton, onClick: s, children: /* @__PURE__ */ t(y, { name: "Close", fill: "#030c2466" }) }),
|
|
60
|
+
v && /* @__PURE__ */ t("p", { children: v })
|
|
58
61
|
]
|
|
59
62
|
}
|
|
60
63
|
),
|
|
61
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ t("div", { className: e.drawerContent, children: f })
|
|
62
65
|
]
|
|
63
66
|
}
|
|
64
67
|
)
|
|
@@ -67,5 +70,5 @@ import '../../../assets/index6.css';const y = "_overlay_1b37u_1", D = "_closing_
|
|
|
67
70
|
);
|
|
68
71
|
};
|
|
69
72
|
export {
|
|
70
|
-
|
|
73
|
+
k as DrawerPortalBase
|
|
71
74
|
};
|
|
@@ -12,6 +12,8 @@ export interface DrawerProps {
|
|
|
12
12
|
title?: string;
|
|
13
13
|
/** Contenido del drawer */
|
|
14
14
|
children: ReactNode;
|
|
15
|
+
/** Si es true, el drawer se muestra como un modal centrado */
|
|
16
|
+
modal?: boolean;
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
19
|
* Un componente de drawer que se abre desde la parte inferior de la pantalla
|
|
@@ -36,4 +38,4 @@ export interface DrawerProps {
|
|
|
36
38
|
* - Previene el desplazamiento del fondo cuando está abierto
|
|
37
39
|
* - Animaciones suaves de entrada y salida
|
|
38
40
|
*/
|
|
39
|
-
export declare function Drawer({ isOpen, onClose, title, children }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare function Drawer({ isOpen, onClose, title, children, modal }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as r, useEffect as
|
|
3
|
-
import { DrawerPortalBase as
|
|
4
|
-
function
|
|
5
|
-
const [
|
|
6
|
-
return
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as r, useEffect as m } from "react";
|
|
3
|
+
import { DrawerPortalBase as u } from "./DrawerPortalBase/index.js";
|
|
4
|
+
function v({ isOpen: o, onClose: s, title: l, children: n, modal: i }) {
|
|
5
|
+
const [d, e] = r(!1), [f, t] = r(0);
|
|
6
|
+
return m(() => (o ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
7
7
|
document.body.style.overflow = "";
|
|
8
|
-
}), [o]), /* @__PURE__ */
|
|
9
|
-
|
|
8
|
+
}), [o]), /* @__PURE__ */ a(
|
|
9
|
+
u,
|
|
10
10
|
{
|
|
11
11
|
isOpen: o,
|
|
12
12
|
handleClose: () => {
|
|
@@ -14,14 +14,15 @@ function g({ isOpen: o, onClose: s, title: l, children: n }) {
|
|
|
14
14
|
s(), e(!1), t(0);
|
|
15
15
|
}, 350);
|
|
16
16
|
},
|
|
17
|
-
dragPosition:
|
|
17
|
+
dragPosition: f,
|
|
18
18
|
setDragPosition: t,
|
|
19
|
-
isClosing:
|
|
19
|
+
isClosing: d,
|
|
20
20
|
title: l || void 0,
|
|
21
|
+
modal: i,
|
|
21
22
|
children: n
|
|
22
23
|
}
|
|
23
24
|
);
|
|
24
25
|
}
|
|
25
26
|
export {
|
|
26
|
-
|
|
27
|
+
v as Drawer
|
|
27
28
|
};
|
package/package.json
CHANGED