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.
@@ -1 +1 @@
1
- ._overlay_1b37u_1{position:fixed;top:0;left:0;right:0;bottom:0;background-color:var(--negro-60);animation:_fadeIn_1b37u_1 .25s ease-in-out;z-index:2000}._overlay_1b37u_1._closing_1b37u_12{animation:_fadeOut_1b37u_1 .25s ease-in-out forwards}@keyframes _fadeIn_1b37u_1{0%{opacity:0}to{opacity:1}}@keyframes _fadeOut_1b37u_1{0%{opacity:1}to{opacity:0}}._bottomDrawer_1b37u_36{position:fixed;bottom:0;left:0;right:0;background-color:#fff;border-radius:16px 16px 0 0;z-index:2001;animation:_slideUp_1b37u_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_1b37u_12{animation:_slideDown_1b37u_1 .35s cubic-bezier(.4,0,.2,1) forwards}@keyframes _slideUp_1b37u_1{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes _slideDown_1b37u_1{0%{transform:translateY(0)}to{transform:translateY(100%)}}._drawerHeader_1b37u_76{display:flex;flex-direction:column;cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;position:relative}._drawerHeader_1b37u_76:active{cursor:grabbing}._drawerIndicator_1b37u_89{width:40px;height:7px;background-color:var(--negro-10);border-radius:14px;position:absolute;left:50%;transform:translate(-50%);top:7px}._drawerContent_1b37u_100{max-height:70vh;overflow-y:auto;padding-top:15px;display:flex;flex-direction:column;gap:19px}._drawerHeader_1b37u_76 p{font-family:Poppins Bold;font-size:19px;line-height:22.8px;margin:0}._closeButton_1b37u_116{cursor:pointer;display:flex;align-items:center;justify-content:end}._closeButton_1b37u_116>svg{background-color:var(--negro-10);border-radius:50%;padding:2px}
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 u, Fragment as f, jsx as r } from "react/jsx-runtime";
2
- import { useRef as w } from "react";
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 p } from "../../../icons/icons.js";
5
- import '../../../assets/index6.css';const y = "_overlay_1b37u_1", D = "_closing_1b37u_12", Y = "_bottomDrawer_1b37u_36", L = "_drawerHeader_1b37u_76", B = "_drawerIndicator_1b37u_89", I = "_drawerContent_1b37u_100", N = "_closeButton_1b37u_116", t = {
6
- overlay: y,
7
- closing: D,
8
- bottomDrawer: Y,
9
- drawerHeader: L,
10
- drawerIndicator: B,
11
- drawerContent: I,
12
- closeButton: N
13
- }, S = ({
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: a,
16
- dragPosition: b,
17
- setDragPosition: m,
18
- isClosing: l,
19
- title: i,
20
- children: E
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 s = w(0), d = w(0);
24
+ const d = p(0), i = p(0);
23
25
  if (!h) return null;
24
- const v = (e) => {
25
- const o = "touches" in e ? e.touches[0].clientY : e.clientY;
26
- s.current = o, d.current = o, document.addEventListener("mousemove", c), document.addEventListener("touchmove", c), document.addEventListener("mouseup", n), document.addEventListener("touchend", n);
27
- }, n = () => {
28
- document.removeEventListener("mousemove", c), document.removeEventListener("touchmove", c), document.removeEventListener("mouseup", n), document.removeEventListener("touchend", n), d.current - s.current > 100 ? a() : m(0);
29
- }, c = (e) => {
30
- const o = "touches" in e ? e.touches[0].clientY : e.clientY, _ = o - s.current;
31
- d.current = o, _ > 0 && m(_);
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__ */ u(f, { children: [
35
- /* @__PURE__ */ r(
37
+ /* @__PURE__ */ m(E, { children: [
38
+ /* @__PURE__ */ t(
36
39
  "div",
37
40
  {
38
- className: `${t.overlay} ${l ? t.closing : ""}`,
39
- onClick: a
41
+ className: `${e.overlay} ${u ? e.closing : ""}`,
42
+ onClick: s
40
43
  }
41
44
  ),
42
- /* @__PURE__ */ u(
45
+ /* @__PURE__ */ m(
43
46
  "div",
44
47
  {
45
- className: `${t.bottomDrawer} ${l ? t.closing : ""}`,
46
- style: { transform: `translateY(${b}px)` },
48
+ className: `${o ? e.modalDrawer : e.bottomDrawer} ${u ? e.closing : ""}`,
49
+ style: { transform: o ? void 0 : `translateY(${D}px)` },
47
50
  children: [
48
- /* @__PURE__ */ u(
51
+ /* @__PURE__ */ m(
49
52
  "header",
50
53
  {
51
- className: t.drawerHeader,
52
- onMouseDown: v,
53
- onTouchStart: v,
54
+ className: e.drawerHeader,
55
+ onMouseDown: _,
56
+ onTouchStart: _,
54
57
  children: [
55
- /* @__PURE__ */ r("div", { className: t.drawerIndicator }),
56
- /* @__PURE__ */ r("div", { className: t.closeButton, onClick: a, children: /* @__PURE__ */ r(p, { name: "Close", fill: "#030c2466" }) }),
57
- i && /* @__PURE__ */ r("p", { children: i })
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__ */ r("div", { className: t.drawerContent, children: E })
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
- S as DrawerPortalBase
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 f } from "react/jsx-runtime";
2
- import { useState as r, useEffect as a } from "react";
3
- import { DrawerPortalBase as m } from "./DrawerPortalBase/index.js";
4
- function g({ isOpen: o, onClose: s, title: l, children: n }) {
5
- const [i, e] = r(!1), [d, t] = r(0);
6
- return a(() => (o ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
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__ */ f(
9
- m,
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: d,
17
+ dragPosition: f,
18
18
  setDragPosition: t,
19
- isClosing: i,
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
- g as Drawer
27
+ v as Drawer
27
28
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bmi-next",
3
3
  "description": "Componentes de UI para proyecto BMI Next",
4
- "version": "1.0.33",
4
+ "version": "1.0.35",
5
5
  "author": "David Fernández Bolaños <david@bmiahorro.com>",
6
6
  "contributors": [
7
7
  "Jorge Martín <jorge@bmiahorro.com>",