bmi-next-brokers 2.2.9 → 2.3.0

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.
@@ -424,6 +424,7 @@ import '../../assets/Select.css';const Ue = "_selectContainer_1sakp_23", Ze = "_
424
424
  isOpen: l,
425
425
  setIsOpen: C,
426
426
  title: ve,
427
+ zIndex: 1,
427
428
  children: [
428
429
  s && /* @__PURE__ */ o("div", { className: e.drawerSearchInput, children: /* @__PURE__ */ o(
429
430
  Je,
@@ -1,25 +1,24 @@
1
- import { jsxs as n, Fragment as V, jsx as l } from "react/jsx-runtime";
2
- import { useState as U, useRef as D } from "react";
1
+ import { jsxs as h, Fragment as V, jsx as i } from "react/jsx-runtime";
2
+ import { useState as U, useRef as E } from "react";
3
3
  import { createPortal as q } from "react-dom";
4
4
  import { Icon as J } from "../../icons/Icon.js";
5
5
  import { useScrollLock as K } from "../../hooks/useScrollLock.js";
6
6
  import { CloseContext as Q } from "../../hooks/useClose.js";
7
7
  import { Button as S } from "../Button/Button.js";
8
- import { useCloseOnBack as u } from "../../hooks/useCloseOnBack.js";
9
- import '../../assets/index12.css';const B = "_overlay_1fhs2_1", ee = "_closing_1fhs2_12", se = "_bottomDrawer_1fhs2_36", re = "_header_1fhs2_60", ae = "_indicator_1fhs2_73", de = "_drawer_1fhs2_83", le = "_closeDiv_1fhs2_90", ie = "_closeIcon_1fhs2_98", te = "_drawerHeader_1fhs2_105", oe = "_drawerContent_1fhs2_109", ne = "_drawerFooter_1fhs2_122", a = {
10
- overlay: B,
11
- closing: ee,
12
- bottomDrawer: se,
13
- header: re,
14
- indicator: ae,
15
- drawer: de,
16
- closeDiv: le,
8
+ import '../../assets/index12.css';const u = "_overlay_1fhs2_1", B = "_closing_1fhs2_12", ee = "_bottomDrawer_1fhs2_36", se = "_header_1fhs2_60", re = "_indicator_1fhs2_73", ae = "_drawer_1fhs2_83", de = "_closeDiv_1fhs2_90", ie = "_closeIcon_1fhs2_98", le = "_drawerHeader_1fhs2_105", te = "_drawerContent_1fhs2_109", oe = "_drawerFooter_1fhs2_122", a = {
9
+ overlay: u,
10
+ closing: B,
11
+ bottomDrawer: ee,
12
+ header: se,
13
+ indicator: re,
14
+ drawer: ae,
15
+ closeDiv: de,
17
16
  closeIcon: ie,
18
- drawerHeader: te,
19
- drawerContent: oe,
20
- drawerFooter: ne
21
- }, ge = ({
22
- isOpen: m,
17
+ drawerHeader: le,
18
+ drawerContent: te,
19
+ drawerFooter: oe
20
+ }, De = ({
21
+ isOpen: f,
23
22
  setIsOpen: A,
24
23
  title: I,
25
24
  zIndex: v,
@@ -28,25 +27,25 @@ import '../../assets/index12.css';const B = "_overlay_1fhs2_1", ee = "_closing_1
28
27
  contentClassName: L,
29
28
  footerClassName: R,
30
29
  onClickOverlay: w,
31
- onClose: h,
30
+ onClose: n,
32
31
  confirmButton: e,
33
32
  cancelButton: s,
34
- children: k,
35
- ...x
33
+ children: x,
34
+ ...$
36
35
  }) => {
37
- const $ = v ? 50 : 70, [C, g] = U(!1), y = D(0), E = D(0), r = D(null);
36
+ const j = v ? 50 : 70, [D, g] = U(!1), m = E(0), y = E(0), r = E(null);
38
37
  let t = 0;
39
- const j = () => {
38
+ const k = () => {
40
39
  if (r.current) {
41
- const d = "slideDown", i = document.styleSheets[0];
42
- i.insertRule(
40
+ const d = "slideDown", l = document.styleSheets[0];
41
+ l.insertRule(
43
42
  `
44
43
  @keyframes ${d} {
45
44
  from { transform: translateY(${t}px); }
46
45
  to { transform: translateY(100%); }
47
46
  }
48
47
  `,
49
- i.cssRules.length
48
+ l.cssRules.length
50
49
  ), r.current.style.animation = `${d} 0.35s cubic-bezier(0.4,0,0.2,1) forwards`;
51
50
  }
52
51
  }, X = () => {
@@ -54,82 +53,78 @@ import '../../assets/index12.css';const B = "_overlay_1fhs2_1", ee = "_closing_1
54
53
  r.current && (r.current.style.transition = "", r.current.style.transform = "");
55
54
  }, 350));
56
55
  };
57
- K(m);
56
+ K(f);
58
57
  const z = async () => {
59
58
  w !== !1 && (typeof w == "function" && await w(), o());
60
- }, f = async () => {
61
- h !== !1 && (typeof h == "function" && await h(), o());
59
+ }, C = async () => {
60
+ n !== !1 && (typeof n == "function" && await n(), o());
62
61
  }, o = () => {
63
- j(), g(!0), setTimeout(() => {
62
+ k(), g(!0), setTimeout(() => {
64
63
  A(!1), g(!1);
65
64
  }, 350);
66
- };
67
- u({ isOpen: m, onClose: f });
68
- const N = (d) => {
69
- const i = "touches" in d ? d.touches[0].clientY : d.clientY;
70
- y.current = i, E.current = i, document.addEventListener("mousemove", c), document.addEventListener("touchmove", c), document.addEventListener("mouseup", _), document.addEventListener("touchend", _);
71
- }, c = (d) => {
72
- const i = "touches" in d ? d.touches[0].clientY : d.clientY;
73
- t = i - y.current, E.current = i, t < 0 && (t = 0), r.current && (r.current.style.transform = `translateY(${t}px)`);
74
- }, _ = () => {
75
- r.current && (r.current.style.transition = ""), document.removeEventListener("mousemove", c), document.removeEventListener("touchmove", c), document.removeEventListener("mouseup", _), document.removeEventListener("touchend", _), t = E.current - y.current, t > 100 && r.current ? f() : X();
65
+ }, N = (d) => {
66
+ const l = "touches" in d ? d.touches[0].clientY : d.clientY;
67
+ m.current = l, y.current = l, document.addEventListener("mousemove", _), document.addEventListener("touchmove", _), document.addEventListener("mouseup", c), document.addEventListener("touchend", c);
68
+ }, _ = (d) => {
69
+ const l = "touches" in d ? d.touches[0].clientY : d.clientY;
70
+ t = l - m.current, y.current = l, t < 0 && (t = 0), r.current && (r.current.style.transform = `translateY(${t}px)`);
71
+ }, c = () => {
72
+ r.current && (r.current.style.transition = ""), document.removeEventListener("mousemove", _), document.removeEventListener("touchmove", _), document.removeEventListener("mouseup", c), document.removeEventListener("touchend", c), t = y.current - m.current, t > 100 && r.current ? C() : X();
76
73
  }, T = [a.drawer, H].filter(Boolean).join(" "), M = [a.drawerHeader, "title5Bold", Y].filter(Boolean).join(" "), F = [a.drawerContent, L].filter(Boolean).join(" "), G = [a.drawerFooter, R].filter(Boolean).join(" "), W = async () => {
77
- if (e != null && e.action)
78
- try {
79
- await e.action(), o();
80
- } catch {
81
- return;
82
- }
74
+ try {
75
+ e != null && e.action && await e.action(), o();
76
+ } catch {
77
+ return;
78
+ }
83
79
  }, Z = async () => {
84
- if (s != null && s.action)
85
- try {
86
- await s.action(), o();
87
- } catch {
88
- return;
89
- }
80
+ try {
81
+ s != null && s.action && await (s == null ? void 0 : s.action()), o();
82
+ } catch {
83
+ return;
84
+ }
90
85
  }, O = s && Object.keys(s).length > 0, P = e && Object.keys(e).length > 0, b = O && (s.show ?? !0), p = P && (e.show ?? !0);
91
- return m ? q(
92
- /* @__PURE__ */ n(V, { children: [
93
- /* @__PURE__ */ l(
86
+ return f ? q(
87
+ /* @__PURE__ */ h(V, { children: [
88
+ /* @__PURE__ */ i(
94
89
  "div",
95
90
  {
96
91
  style: { zIndex: 3e3 + (v || 0) },
97
- className: `${a.overlay} ${C ? a.closing : ""}`,
92
+ className: `${a.overlay} ${D ? a.closing : ""}`,
98
93
  onClick: z
99
94
  }
100
95
  ),
101
- /* @__PURE__ */ n(
96
+ /* @__PURE__ */ h(
102
97
  "div",
103
98
  {
104
99
  ref: r,
105
- ...x,
106
- className: `${a.bottomDrawer} ${C ? a.closing : ""}`,
100
+ ...$,
101
+ className: `${a.bottomDrawer} ${D ? a.closing : ""}`,
107
102
  style: {
108
103
  zIndex: 3001 + (v || 0)
109
104
  },
110
105
  children: [
111
- h !== !1 && /* @__PURE__ */ n(
106
+ n !== !1 && /* @__PURE__ */ h(
112
107
  "header",
113
108
  {
114
109
  className: a.header,
115
110
  onMouseDown: N,
116
111
  onTouchStart: N,
117
112
  children: [
118
- /* @__PURE__ */ l("div", { className: a.indicator }),
119
- /* @__PURE__ */ l("div", { className: a.closeDiv, children: /* @__PURE__ */ l("div", { className: a.closeIcon, onClick: f, children: /* @__PURE__ */ l(J, { name: "CloseDrawer", size: 31 }) }) })
113
+ /* @__PURE__ */ i("div", { className: a.indicator }),
114
+ /* @__PURE__ */ i("div", { className: a.closeDiv, children: /* @__PURE__ */ i("div", { className: a.closeIcon, onClick: C, children: /* @__PURE__ */ i(J, { name: "CloseDrawer", size: 31 }) }) })
120
115
  ]
121
116
  }
122
117
  ),
123
- /* @__PURE__ */ l(Q.Provider, { value: o, children: /* @__PURE__ */ n(
118
+ /* @__PURE__ */ i(Q.Provider, { value: o, children: /* @__PURE__ */ h(
124
119
  "div",
125
120
  {
126
121
  className: T,
127
- style: { maxHeight: `${$}dvh` },
122
+ style: { maxHeight: `${j}dvh` },
128
123
  children: [
129
- /* @__PURE__ */ l("span", { className: M, children: I }),
130
- /* @__PURE__ */ l("div", { className: F, children: k }),
131
- (b || p) && /* @__PURE__ */ n("div", { className: G, children: [
132
- b && /* @__PURE__ */ l(
124
+ /* @__PURE__ */ i("span", { className: M, children: I }),
125
+ /* @__PURE__ */ i("div", { className: F, children: x }),
126
+ (b || p) && /* @__PURE__ */ h("div", { className: G, children: [
127
+ b && /* @__PURE__ */ i(
133
128
  S,
134
129
  {
135
130
  variant: (s == null ? void 0 : s.variant) || "outline",
@@ -142,7 +137,7 @@ import '../../assets/index12.css';const B = "_overlay_1fhs2_1", ee = "_closing_1
142
137
  children: (s == null ? void 0 : s.text) || "Cancelar"
143
138
  }
144
139
  ),
145
- p && /* @__PURE__ */ l(
140
+ p && /* @__PURE__ */ i(
146
141
  S,
147
142
  {
148
143
  type: "submit",
@@ -169,5 +164,5 @@ import '../../assets/index12.css';const B = "_overlay_1fhs2_1", ee = "_closing_1
169
164
  ) : null;
170
165
  };
171
166
  export {
172
- ge as Drawer
167
+ De as Drawer
173
168
  };
@@ -48,19 +48,17 @@ import '../../assets/index7.css';const Q = "_modalOverlay_1hyzx_1", U = "_closin
48
48
  }, A = async () => {
49
49
  o !== !1 && (typeof o == "function" && await o(), i());
50
50
  }, Y = async () => {
51
- if (s != null && s.action)
52
- try {
53
- await s.action(), i();
54
- } catch {
55
- return;
56
- }
51
+ try {
52
+ s != null && s.action && await s.action(), i();
53
+ } catch {
54
+ return;
55
+ }
57
56
  }, P = async () => {
58
- if (e != null && e.action)
59
- try {
60
- await e.action(), i();
61
- } catch {
62
- return;
63
- }
57
+ try {
58
+ e != null && e.action && await e.action(), i();
59
+ } catch {
60
+ return;
61
+ }
64
62
  }, V = e && Object.keys(e).length > 0, X = s && Object.keys(s).length > 0, z = V && (e.show ?? !0), C = X && (s.show ?? !0), Z = `${l.modal} ${$ || ""}`;
65
63
  return M(() => {
66
64
  if (!_.current) return;
@@ -1,64 +1,63 @@
1
- import { jsx as n, jsxs as l } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as a } from "react/jsx-runtime";
2
2
  import { useState as h } from "react";
3
3
  import { CloseContext as y } from "../../hooks/useClose.js";
4
4
  import { useScrollLock as g } from "../../hooks/useScrollLock.js";
5
- import { useCloseOnBack as p } from "../../hooks/useCloseOnBack.js";
6
- import { Icon as I } from "../../icons/Icon.js";
7
- import { createPortal as N } from "react-dom";
8
- import '../../assets/index13.css';const $ = "_overlay_15ved_1", k = "_closing_15ved_16", w = "_nav_15ved_20", B = "_arrowBack_15ved_32", x = "_title_15ved_36", S = "_content_15ved_43", j = "_mainContent_15ved_51", P = "_contentInner_15ved_63", e = {
9
- overlay: $,
10
- closing: k,
5
+ import { Icon as p } from "../../icons/Icon.js";
6
+ import { createPortal as I } from "react-dom";
7
+ import '../../assets/index13.css';const N = "_overlay_15ved_1", $ = "_closing_15ved_16", w = "_nav_15ved_20", k = "_arrowBack_15ved_32", x = "_title_15ved_36", B = "_content_15ved_43", S = "_mainContent_15ved_51", j = "_contentInner_15ved_63", e = {
8
+ overlay: N,
9
+ closing: $,
11
10
  nav: w,
12
- arrowBack: B,
11
+ arrowBack: k,
13
12
  title: x,
14
- content: S,
15
- mainContent: j,
16
- contentInner: P
17
- }, D = ({
13
+ content: B,
14
+ mainContent: S,
15
+ contentInner: j
16
+ }, T = ({
18
17
  isOpen: o,
19
- setIsOpen: i,
20
- title: m,
21
- children: d,
22
- navClassName: _,
23
- className: v,
24
- withAutoClose: f = !0,
18
+ setIsOpen: l,
19
+ title: i,
20
+ children: m,
21
+ navClassName: d,
22
+ className: _,
23
+ withAutoClose: v = !0,
25
24
  onBack: t,
26
- navIcon: u = "ArrowBackIosNew",
27
- ...C
25
+ navIcon: f = "ArrowBackIosNew",
26
+ ...u
28
27
  }) => {
29
28
  const [s, r] = h(!1);
30
29
  g(o);
31
30
  const c = () => {
32
- f && (r(!0), setTimeout(() => {
33
- i(!1), r(!1);
31
+ v && (r(!0), setTimeout(() => {
32
+ l(!1), r(!1);
34
33
  }, 450));
35
- }, a = async () => {
34
+ }, C = async () => {
36
35
  t !== !1 && (typeof t == "function" && await t(), c());
37
36
  };
38
- return p({ isOpen: o, onClose: a }), o ? N(
37
+ return o ? I(
39
38
  /* @__PURE__ */ n("div", { className: `${e.overlay} ${s ? e.closing : ""}`, children: /* @__PURE__ */ n(
40
39
  "div",
41
40
  {
42
41
  className: `${e.mainContent} ${s ? e.closing : ""}`,
43
- children: /* @__PURE__ */ l("div", { className: e.content, children: [
44
- /* @__PURE__ */ l("div", { className: `${e.nav} ${_ || ""}`, children: [
42
+ children: /* @__PURE__ */ a("div", { className: e.content, children: [
43
+ /* @__PURE__ */ a("div", { className: `${e.nav} ${d || ""}`, children: [
45
44
  t !== !1 && /* @__PURE__ */ n(
46
- I,
45
+ p,
47
46
  {
48
- name: u,
47
+ name: f,
49
48
  size: 24,
50
49
  className: e.arrowBack,
51
- onClick: a
50
+ onClick: C
52
51
  }
53
52
  ),
54
- /* @__PURE__ */ n("span", { className: e.title, children: m })
53
+ /* @__PURE__ */ n("span", { className: e.title, children: i })
55
54
  ] }),
56
55
  /* @__PURE__ */ n(
57
56
  "div",
58
57
  {
59
- className: `${e.contentInner} ${v || ""}`,
60
- ...C,
61
- children: /* @__PURE__ */ n(y.Provider, { value: c, children: d })
58
+ className: `${e.contentInner} ${_ || ""}`,
59
+ ...u,
60
+ children: /* @__PURE__ */ n(y.Provider, { value: c, children: m })
62
61
  }
63
62
  )
64
63
  ] })
@@ -68,5 +67,5 @@ import '../../assets/index13.css';const $ = "_overlay_15ved_1", k = "_closing_15
68
67
  ) : null;
69
68
  };
70
69
  export {
71
- D as Sheet
70
+ T as Sheet
72
71
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bmi-next-brokers",
3
3
  "description": "Componentes de UI para proyecto BMI Next Brokers",
4
- "version": "2.2.9",
4
+ "version": "2.3.0",
5
5
  "author": "BMI Ahorro España",
6
6
  "contributors": [
7
7
  "José Ramón Jiménez <jrjimenez@bmicos.com>",