bmi-next-brokers 2.3.0 → 2.3.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.
@@ -1,5 +1,5 @@
1
- import { jsxs as b, jsx as o, Fragment as te } from "react/jsx-runtime";
2
- import { useState as P, useRef as N, useEffect as ne, useMemo as he, useLayoutEffect as Qe } from "react";
1
+ import { jsxs as b, jsx as o, Fragment as ee } from "react/jsx-runtime";
2
+ import { useState as P, useRef as N, useEffect as te, useMemo as ue, useLayoutEffect as Qe } from "react";
3
3
  import { createPortal as Me } from "react-dom";
4
4
  import { Icon as F } from "../../icons/Icon.js";
5
5
  import { HelperText as je } from "../helperText/index.js";
@@ -9,7 +9,7 @@ import { Drawer as Xe } from "../drawer/index.js";
9
9
  import { useClose as Ge } from "../../hooks/useClose.js";
10
10
  import { Input as Je } from "../Input/Input.js";
11
11
  import { useBTC as Ke } from "../../hooks/btcContext/useBtcContext.js";
12
- import '../../assets/Select.css';const Ue = "_selectContainer_1sakp_23", Ze = "_selectContainer_medium_1sakp_47", ze = "_selectContainer_large_1sakp_55", et = "_selectContainer_extraLarge_1sakp_57", tt = "_label_1sakp_75", nt = "_label_large_1sakp_89", rt = "_label_extraLarge_1sakp_91", ot = "_label_disabled_1sakp_99", st = "_label_inverted_1sakp_107", at = "_label_inverted_disabled_1sakp_115", lt = "_selectWrapper_1sakp_133", it = "_select_1sakp_23", ct = "_open_1sakp_213", dt = "_disabled_1sakp_221", _t = "_placeholder_1sakp_235", pt = "_small_1sakp_257", ut = "_medium_1sakp_279", ht = "_large_1sakp_301", mt = "_extraLarge_1sakp_323", ft = "_selectValue_1sakp_351", bt = "_selectInput_1sakp_371", gt = "_error_1sakp_467", wt = "_btc_1sakp_495", kt = "_errorShake_1sakp_1", vt = "_inverted_1sakp_625", St = "_chevron_1sakp_685", $t = "_icon_inverted_1sakp_693", Ct = "_icon_inverted_disabled_1sakp_825", Lt = "_chevronOpen_1sakp_893", Dt = "_icon_1sakp_693", yt = "_icon_disabled_1sakp_927", xt = "_iconLabel_1sakp_945", Nt = "_optionIcon_1sakp_967", Wt = "_required_1sakp_989", Ot = "_required_inverted_1sakp_999", It = "_required_disabled_1sakp_1007", Et = "_required_inverted_disabled_1sakp_1015", Tt = "_dropdown_1sakp_1033", qt = "_highlight_1sakp_1067", Vt = "_isDrawer_1sakp_1083", Ht = "_dropdownPortal_1sakp_1129", Rt = "_drawerSelect_1sakp_1155", Bt = "_drawerSelectHeader_1sakp_1163", Pt = "_drawerSearchInput_1sakp_1171", Ft = "_option_1sakp_967", Qt = "_optionSelected_1sakp_1203", Mt = "_optionWithCheckbox_1sakp_1295", jt = "_optionCheckbox_1sakp_1307", At = "_optionWithDescriptionWrapper_1sakp_1395", Yt = "_optionWithDescription_1sakp_1395", Xt = "_optionWithDescriptionLabel_1sakp_1427", Gt = "_optionWithDescriptionValue_1sakp_1439", Jt = "_dropdownTable_1sakp_1459", Kt = "_optionTable_1sakp_1469", Ut = "_tableColumn_1sakp_1485", Zt = "_columnHeader_1sakp_1501", zt = "_columnValue_1sakp_1517", en = "_noResults_1sakp_1551", tn = "_dropdown_inverted_1sakp_1579", nn = "_option_inverted_1sakp_1625", e = {
12
+ import '../../assets/Select.css';const Ue = "_selectContainer_1sakp_23", Ze = "_selectContainer_medium_1sakp_47", ze = "_selectContainer_large_1sakp_55", et = "_selectContainer_extraLarge_1sakp_57", tt = "_label_1sakp_75", nt = "_label_large_1sakp_89", rt = "_label_extraLarge_1sakp_91", ot = "_label_disabled_1sakp_99", st = "_label_inverted_1sakp_107", at = "_label_inverted_disabled_1sakp_115", lt = "_selectWrapper_1sakp_133", it = "_select_1sakp_23", ct = "_open_1sakp_213", dt = "_disabled_1sakp_221", _t = "_placeholder_1sakp_235", pt = "_small_1sakp_257", ut = "_medium_1sakp_279", ht = "_large_1sakp_301", mt = "_extraLarge_1sakp_323", ft = "_selectValue_1sakp_351", bt = "_selectInput_1sakp_371", gt = "_error_1sakp_467", wt = "_btc_1sakp_495", kt = "_errorShake_1sakp_1", vt = "_inverted_1sakp_625", St = "_chevron_1sakp_685", $t = "_icon_inverted_1sakp_693", Ct = "_icon_inverted_disabled_1sakp_825", Lt = "_chevronOpen_1sakp_893", Dt = "_icon_1sakp_693", yt = "_icon_disabled_1sakp_927", xt = "_iconLabel_1sakp_945", Nt = "_optionIcon_1sakp_967", Wt = "_required_1sakp_989", It = "_required_inverted_1sakp_999", Ot = "_required_disabled_1sakp_1007", Et = "_required_inverted_disabled_1sakp_1015", Tt = "_dropdown_1sakp_1033", qt = "_highlight_1sakp_1067", Vt = "_isDrawer_1sakp_1083", Ht = "_dropdownPortal_1sakp_1129", Rt = "_drawerSelect_1sakp_1155", Bt = "_drawerSelectHeader_1sakp_1163", Pt = "_drawerSearchInput_1sakp_1171", Ft = "_option_1sakp_967", Qt = "_optionSelected_1sakp_1203", Mt = "_optionWithCheckbox_1sakp_1295", jt = "_optionCheckbox_1sakp_1307", At = "_optionWithDescriptionWrapper_1sakp_1395", Yt = "_optionWithDescription_1sakp_1395", Xt = "_optionWithDescriptionLabel_1sakp_1427", Gt = "_optionWithDescriptionValue_1sakp_1439", Jt = "_dropdownTable_1sakp_1459", Kt = "_optionTable_1sakp_1469", Ut = "_tableColumn_1sakp_1485", Zt = "_columnHeader_1sakp_1501", zt = "_columnValue_1sakp_1517", en = "_noResults_1sakp_1551", tn = "_dropdown_inverted_1sakp_1579", nn = "_option_inverted_1sakp_1625", e = {
13
13
  selectContainer: Ue,
14
14
  selectContainer_medium: Ze,
15
15
  selectContainer_large: ze,
@@ -44,8 +44,8 @@ import '../../assets/Select.css';const Ue = "_selectContainer_1sakp_23", Ze = "_
44
44
  iconLabel: xt,
45
45
  optionIcon: Nt,
46
46
  required: Wt,
47
- required_inverted: Ot,
48
- required_disabled: It,
47
+ required_inverted: It,
48
+ required_disabled: Ot,
49
49
  required_inverted_disabled: Et,
50
50
  dropdown: Tt,
51
51
  highlight: qt,
@@ -71,160 +71,159 @@ import '../../assets/Select.css';const Ue = "_selectContainer_1sakp_23", Ze = "_
71
71
  dropdown_inverted: tn,
72
72
  option_inverted: nn
73
73
  }, gn = ({
74
- size: a = "medium",
74
+ size: l = "medium",
75
75
  label: T,
76
- error: re,
76
+ error: ne,
77
77
  helperText: q,
78
78
  icon: W,
79
- className: me,
80
- required: fe,
79
+ className: he,
80
+ required: me,
81
81
  placeholder: Q = "Seleccionar...",
82
82
  options: $ = [],
83
83
  value: f,
84
- onChange: u,
84
+ onChange: d,
85
85
  onSearchInput: M,
86
- disabled: d = !1,
87
- inverted: _ = !1,
88
- dynamicIcon: be = !1,
89
- showPlaceholderIcon: ge = !1,
90
- btc: oe,
86
+ disabled: _ = !1,
87
+ inverted: p = !1,
88
+ dynamicIcon: fe = !1,
89
+ showPlaceholderIcon: be = !1,
90
+ btc: re,
91
91
  columnHeaders: V,
92
- searchable: we = !1,
93
- noSearchResult: se = "No se encontraron resultados",
92
+ searchable: ge = !1,
93
+ noSearchResult: oe = "No se encontraron resultados",
94
94
  searchAndCheckbox: H = !1,
95
- customBorderColor: ae,
96
- responsive: ke = !1,
97
- title: ve,
98
- responsiveQuery: Se = 1024,
99
- highlightMatch: $e = !1,
100
- ...Ce
95
+ customBorderColor: se,
96
+ responsive: we = !1,
97
+ title: ke,
98
+ responsiveQuery: ve = 1024,
99
+ highlightMatch: Se = !1,
100
+ ...$e
101
101
  }) => {
102
- const j = !!M, { btc: Le } = Ke(), De = oe ?? Le, [l, C] = P(!1), [h, A] = P(""), s = we || H, g = H, Y = N(null), ye = N(null), O = N(null), X = N(null), G = N(null), [L, v] = P([]), xe = l && !d, Ne = Ye(`(max-width: ${Se}px)`), J = ke && Ne && !d;
103
- ne(() => {
102
+ const j = !!M, { btc: Ce } = Ke(), Le = re ?? Ce, [i, S] = P(!1), [m, De] = P(""), s = ge || H, g = H, A = N(null), ye = N(null), I = N(null), Y = N(null), X = N(null), [C, w] = P([]), xe = i && !_, Ne = Ye(`(max-width: ${ve}px)`), G = we && Ne && !_;
103
+ te(() => {
104
104
  if (g)
105
105
  if (Array.isArray(f) && f.length > 0) {
106
106
  const t = $.filter((n) => f.includes(n.value)), r = t.map((n) => n.value);
107
- v(t), (r.length !== f.length || !r.every((n) => f.includes(n))) && u && u(r);
107
+ w(t), (r.length !== f.length || !r.every((n) => f.includes(n))) && d && d(r);
108
108
  } else
109
- v([]);
109
+ w([]);
110
110
  else if (f) {
111
111
  const t = $.find((r) => r.value === f);
112
- t ? (v([t]), A(t.label)) : (v([]), u && u(""));
112
+ t ? w([t]) : (w([]), d && d(""));
113
113
  } else
114
- v([]);
114
+ w([]);
115
115
  }, [f, $, g]);
116
- const I = L.map((t) => t.value), p = L[0] ?? null, w = (t) => typeof t == "string" ? t.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/\s+/g, "").toLowerCase() : "", le = N("");
117
- ne(() => {
116
+ const O = C.map((t) => t.value), u = C[0] ?? null, k = (t) => typeof t == "string" ? t.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/\s+/g, "").toLowerCase() : "", ae = N("");
117
+ te(() => {
118
118
  if (!s) return;
119
- const t = h.trim(), r = le.current.trim();
119
+ const t = m.trim(), r = ae.current.trim();
120
120
  if (g) {
121
121
  if (t.length > 0) {
122
- const c = L.filter(
123
- (i) => w(i.label).includes(w(t))
124
- ), n = c.map((i) => i.value);
125
- c.length !== L.length && (v(c), u && u(n));
122
+ const c = C.filter(
123
+ (a) => k(a.label).includes(k(t))
124
+ ), n = c.map((a) => a.value);
125
+ c.length !== C.length && (w(c), d && d(n));
126
126
  }
127
- t === "" && r.length > 0 && (v([]), u && u([]));
127
+ t === "" && r.length > 0 && (w([]), d && d([]));
128
128
  } else
129
- p && t.length > 0 && w(t) !== w(p.label) && (v([]), u && u(""));
130
- le.current = h;
129
+ u && t.length > 0 && !k(u.label).includes(k(t)) && (w([]), d && d("")), t === "" && r.length > 0 && (w([]), d && d(""));
130
+ ae.current = m;
131
131
  }, [
132
- h,
133
- p,
134
- L,
132
+ m,
133
+ u,
134
+ C,
135
135
  g,
136
136
  s,
137
- u
137
+ d
138
138
  ]);
139
- const ie = he(() => s ? l ? h : !g && p ? p.label : g && I.length > 0 ? `${I.length} ${I.length === 1 ? "seleccionado" : "seleccionados"}` : h : "", [
139
+ const le = ue(() => s ? i ? m : !g && u ? u.label : g && O.length > 0 ? `${O.length} ${O.length === 1 ? "seleccionado" : "seleccionados"}` : "" : "", [
140
140
  s,
141
- l,
142
- h,
143
- p,
144
- I,
141
+ i,
142
+ m,
143
+ u,
144
+ O,
145
145
  g
146
- ]), ce = (t) => L.some((r) => r.value === t), R = he(() => !s || !h || j ? $ : $.filter(
147
- (t) => w(t.label).includes(w(h))
148
- ), [$, h, s, j]), D = (() => {
149
- if (re) return re;
150
- if (s && h && h.trim().length > 0 && R.length === 0 && !l && !f)
151
- return se;
146
+ ]), ie = (t) => C.some((r) => r.value === t), R = ue(() => !s || !m || j ? $ : $.filter(
147
+ (t) => k(t.label).includes(k(m))
148
+ ), [$, m, s, j]), L = (() => {
149
+ if (ne) return ne;
150
+ if (s && m && m.trim().length > 0 && R.length === 0 && !i && !f)
151
+ return oe;
152
152
  })();
153
- ne(() => {
153
+ te(() => {
154
154
  const t = (r) => {
155
- Y.current && !Y.current.contains(r.target) && O.current && !O.current.contains(r.target) && C(!1);
155
+ A.current && !A.current.contains(r.target) && I.current && !I.current.contains(r.target) && S(!1);
156
156
  };
157
157
  return document.addEventListener("mousedown", t), () => {
158
158
  document.removeEventListener("mousedown", t);
159
159
  };
160
- }, [s, j, p]);
160
+ }, [s, j, u]);
161
161
  const We = [
162
162
  e.select,
163
- De && e.btc,
164
- e[a],
165
- D ? e.error : "",
166
- d ? e.disabled : "",
167
- l ? e.open : "",
168
- _ ? e.inverted : "",
169
- me
170
- ].filter(Boolean).join(" "), y = a === "small" ? 16 : a === "large" ? 20 : a === "extraLarge" ? 24 : 18, de = be && (p != null && p.icon) && !(s && l) ? p.icon : W, Oe = () => {
163
+ Le && e.btc,
164
+ e[l],
165
+ L ? e.error : "",
166
+ _ ? e.disabled : "",
167
+ i ? e.open : "",
168
+ p ? e.inverted : "",
169
+ he
170
+ ].filter(Boolean).join(" "), D = l === "small" ? 16 : l === "large" ? 20 : l === "extraLarge" ? 24 : 18, ce = fe && (u != null && u.icon) && !(s && i) ? u.icon : W, Ie = () => {
171
171
  var t;
172
- d || (C(!l), s && !l && (pe(), (t = G.current) == null || t.focus()));
173
- }, K = (t, r = !0) => {
174
- if (!u) return;
175
- const c = $.find((n) => n.value === t);
176
- if (g) {
177
- const n = Array.isArray(f) ? f : [], m = n.includes(t) ? n.filter((S) => S !== t) : [...n, t];
178
- u(m);
179
- } else
180
- u(t), r && C(!1), c && A(c.label);
181
- }, _e = (t) => {
172
+ _ || (S(!i), s && !i && (_e(), (t = X.current) == null || t.focus()));
173
+ }, J = (t, r = !0) => {
174
+ if (d)
175
+ if (g) {
176
+ const c = Array.isArray(f) ? f : [], a = c.includes(t) ? c.filter((h) => h !== t) : [...c, t];
177
+ d(a);
178
+ } else
179
+ d(t), r && S(!1);
180
+ }, de = (t) => {
182
181
  const r = t.target.value;
183
- A(r), l || C(!0), M && M(r);
184
- }, pe = () => {
185
- l || C(!0);
186
- }, Ie = (t) => {
187
- J && (t.preventDefault(), t.stopPropagation()), s && (t.stopPropagation(), l || (C(!0), setTimeout(() => {
182
+ De(r), i || S(!0), M && M(r);
183
+ }, _e = () => {
184
+ i || S(!0);
185
+ }, Oe = (t) => {
186
+ G && (t.preventDefault(), t.stopPropagation()), s && (t.stopPropagation(), i || (S(!0), setTimeout(() => {
188
187
  var r;
189
- (r = G.current) == null || r.focus();
188
+ (r = X.current) == null || r.focus();
190
189
  }, 0)));
191
- }, U = (t, r) => {
192
- if (!$e || !r.trim()) return t;
193
- const c = w(t), n = w(r.trim());
190
+ }, K = (t, r) => {
191
+ if (!Se || !r.trim()) return t;
192
+ const c = k(t), n = k(r.trim());
194
193
  if (!c.includes(n)) return t;
195
- const i = [], m = [];
196
- for (let k = 0; k < t.length; k++) {
197
- const z = w(t[k]);
198
- for (let x = 0; x < z.length; x++)
199
- m.push(k);
194
+ const a = [], h = [];
195
+ for (let v = 0; v < t.length; v++) {
196
+ const Z = k(t[v]);
197
+ for (let x = 0; x < Z.length; x++)
198
+ h.push(v);
200
199
  }
201
- const S = c.indexOf(n), B = S + n.length - 1, E = m[S], Z = m[B] + 1;
202
- return i.push(t.slice(0, E)), i.push(
203
- /* @__PURE__ */ o("mark", { className: e.highlight, children: t.slice(E, Z) }, "highlight")
204
- ), i.push(t.slice(Z)), /* @__PURE__ */ o(te, { children: i });
200
+ const y = c.indexOf(n), B = y + n.length - 1, E = h[y], U = h[B] + 1;
201
+ return a.push(t.slice(0, E)), a.push(
202
+ /* @__PURE__ */ o("mark", { className: e.highlight, children: t.slice(E, U) }, "highlight")
203
+ ), a.push(t.slice(U)), /* @__PURE__ */ o(ee, { children: a });
205
204
  }, [Ee, Te] = P();
206
205
  Qe(() => {
207
206
  const t = document.body.style.overflow === "hidden", r = () => {
208
- if (l && X.current && O.current) {
209
- const n = X.current.getBoundingClientRect(), i = O.current.offsetHeight, m = window.innerHeight, S = (Re) => {
207
+ if (i && Y.current && I.current) {
208
+ const n = Y.current.getBoundingClientRect(), a = I.current.offsetHeight, h = window.innerHeight, y = (Re) => {
210
209
  const { label: Be, helperText: Pe, displayError: Fe } = Re;
211
210
  return { top: s && !Be ? 3 : 0, bottom: s && !Pe && !Fe ? 3 : 0 };
212
- }, { top: B, bottom: E } = S({
211
+ }, { top: B, bottom: E } = y({
213
212
  label: T,
214
213
  helperText: q,
215
- displayError: D
216
- }), k = {
214
+ displayError: L
215
+ }), v = {
217
216
  small: 1,
218
217
  //Meter gap en small
219
218
  medium: 2,
220
219
  large: 4,
221
220
  extraLarge: 4
222
- }[a], z = n.bottom + k + E, x = m - z, ee = n.top - k - B, Ve = (
221
+ }[l], Z = n.bottom + v + E, x = h - Z, z = n.top - v - B, Ve = (
223
222
  //si no hay espacio abajo pero sí arriba, se muestra arriba con separación dependiendo del size y tamaño del label
224
- x < i && ee >= i ? n.top + window.scrollY - i - k - B : n.bottom + window.scrollY + k + E
225
- ), He = x < i && ee >= i ? (
223
+ x < a && z >= a ? n.top + window.scrollY - a - v - B : n.bottom + window.scrollY + v + E
224
+ ), He = x < a && z >= a ? (
226
225
  //si no cabe abajo, pero si arriba, se coloca con el tamaño mas pequeño entre 300 px y el espacio que hay arriba -15 px de margen (para que cuadre con el margen de los overlays de los modales etc)
227
- Math.min(ee - 15, 300)
226
+ Math.min(z - 15, 300)
228
227
  ) : (
229
228
  //si tiene espacio abajo, se calcula la altura igual que arriba pero teniendo en cuenta el espacio que tiene abajo
230
229
  Math.min(x - 15, 300)
@@ -248,86 +247,86 @@ import '../../assets/Select.css';const Ue = "_selectContainer_1sakp_23", Ze = "_
248
247
  cancelAnimationFrame(c), window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0);
249
248
  };
250
249
  }, [
250
+ i,
251
251
  l,
252
- a,
253
252
  R.length,
254
253
  s,
255
254
  T,
256
- D,
255
+ L,
257
256
  q
258
257
  ]);
259
- const ue = ({
258
+ const pe = ({
260
259
  insideDrawer: t = !1,
261
260
  handleOptionClickProp: r
262
261
  }) => {
263
262
  const c = (n) => {
264
- r ? r(n) : K(n);
263
+ r ? r(n) : J(n);
265
264
  };
266
- return R.length > 0 ? R.map((n, i) => /* @__PURE__ */ b(
265
+ return R.length > 0 ? R.map((n, a) => /* @__PURE__ */ b(
267
266
  "div",
268
267
  {
269
- className: `${e.option} ${t ? e.isDrawer : ""} ${ce(n.value) ? e.optionSelected : ""} ${_ ? e.option_inverted : ""} ${n.columns ? e.optionTable : ""} ${H ? e.optionWithCheckbox : ""}`,
270
- onClick: (m) => {
271
- m.stopPropagation(), c(n.value);
268
+ className: `${e.option} ${t ? e.isDrawer : ""} ${ie(n.value) ? e.optionSelected : ""} ${p ? e.option_inverted : ""} ${n.columns ? e.optionTable : ""} ${H ? e.optionWithCheckbox : ""}`,
269
+ onClick: (h) => {
270
+ h.stopPropagation(), c(n.value);
272
271
  },
273
272
  children: [
274
273
  H && /* @__PURE__ */ o(
275
274
  "input",
276
275
  {
277
276
  type: "checkbox",
278
- checked: ce(n.value),
279
- onChange: () => K(n.value),
280
- onClick: (m) => m.stopPropagation(),
277
+ checked: ie(n.value),
278
+ onChange: () => J(n.value),
279
+ onClick: (h) => h.stopPropagation(),
281
280
  className: e.optionCheckbox
282
281
  }
283
282
  ),
284
- n.columns ? /* @__PURE__ */ o(te, { children: V && Object.entries(V).map(([m, S]) => /* @__PURE__ */ b("div", { className: e.tableColumn, children: [
285
- /* @__PURE__ */ o("div", { className: `${e.columnHeader} ${e[a]}`, children: S }),
286
- /* @__PURE__ */ o("div", { className: `${e.columnValue} ${e[a]}`, children: U(
287
- String(n.columns[m] ?? ""),
288
- h
283
+ n.columns ? /* @__PURE__ */ o(ee, { children: V && Object.entries(V).map(([h, y]) => /* @__PURE__ */ b("div", { className: e.tableColumn, children: [
284
+ /* @__PURE__ */ o("div", { className: `${e.columnHeader} ${e[l]}`, children: y }),
285
+ /* @__PURE__ */ o("div", { className: `${e.columnValue} ${e[l]}`, children: K(
286
+ String(n.columns[h] ?? ""),
287
+ m
289
288
  ) })
290
- ] }, m)) }) : (
289
+ ] }, h)) }) : (
291
290
  //opción tiene descripción
292
291
  n.description ? /* @__PURE__ */ b("div", { className: e.optionWithDescriptionWrapper, children: [
293
292
  (n.icon || W) && /* @__PURE__ */ o(
294
293
  F,
295
294
  {
296
295
  name: n.icon || W,
297
- width: y,
298
- height: y
296
+ width: D,
297
+ height: D
299
298
  }
300
299
  ),
301
300
  /* @__PURE__ */ b("div", { className: e.optionWithDescription, children: [
302
- /* @__PURE__ */ o("span", { className: e.optionWithDescriptionLabel, children: U(n.label, h) }),
301
+ /* @__PURE__ */ o("span", { className: e.optionWithDescriptionLabel, children: K(n.label, m) }),
303
302
  /* @__PURE__ */ o("span", { className: e.optionWithDescriptionValue, children: n.description })
304
303
  ] })
305
- ] }) : /* @__PURE__ */ b(te, { children: [
304
+ ] }) : /* @__PURE__ */ b(ee, { children: [
306
305
  (n.icon || W) && /* @__PURE__ */ o("div", { className: e.optionIcon, children: /* @__PURE__ */ o(
307
306
  F,
308
307
  {
309
308
  name: n.icon || W,
310
- width: y,
311
- height: y
309
+ width: D,
310
+ height: D
312
311
  }
313
312
  ) }),
314
- /* @__PURE__ */ o("div", { style: { whiteSpace: "pre-line", lineHeight: 1.25 }, children: U(n.label, h) })
313
+ /* @__PURE__ */ o("div", { style: { whiteSpace: "pre-line", lineHeight: 1.25 }, children: K(n.label, m) })
315
314
  ] })
316
315
  )
317
316
  ]
318
317
  },
319
- i
320
- )) : /* @__PURE__ */ o("span", { className: e.noResults, children: se });
318
+ a
319
+ )) : /* @__PURE__ */ o("span", { className: e.noResults, children: oe });
321
320
  }, qe = () => {
322
321
  const t = Ge(), r = (c) => {
323
- K(c, !1), g || t();
322
+ J(c, !1), g || t();
324
323
  };
325
324
  return /* @__PURE__ */ o(
326
325
  "div",
327
326
  {
328
- className: `${e.dropdown} ${e.isDrawer} ${e[a]} ${_ ? e.dropdown_inverted : ""} ${V ? e.dropdownTable : ""} ${s ? e.dropdownSearchable : ""}`,
327
+ className: `${e.dropdown} ${e.isDrawer} ${e[l]} ${p ? e.dropdown_inverted : ""} ${V ? e.dropdownTable : ""} ${s ? e.dropdownSearchable : ""}`,
329
328
  children: /* @__PURE__ */ o(
330
- ue,
329
+ pe,
331
330
  {
332
331
  insideDrawer: !0,
333
332
  handleOptionClickProp: r
@@ -339,21 +338,21 @@ import '../../assets/Select.css';const Ue = "_selectContainer_1sakp_23", Ze = "_
339
338
  return /* @__PURE__ */ b(
340
339
  "div",
341
340
  {
342
- ref: X,
343
- className: `${e.selectContainer} ${a === "medium" ? e.selectContainer_medium : a === "large" ? e.selectContainer_large : a === "extraLarge" ? e.selectContainer_extraLarge : ""}`,
344
- ...Ce,
341
+ ref: Y,
342
+ className: `${e.selectContainer} ${l === "medium" ? e.selectContainer_medium : l === "large" ? e.selectContainer_large : l === "extraLarge" ? e.selectContainer_extraLarge : ""}`,
343
+ ...$e,
345
344
  children: [
346
345
  T && /* @__PURE__ */ b(
347
346
  "label",
348
347
  {
349
- className: `${e.label} ${a === "large" ? e.label_large : ""} ${a === "extraLarge" ? e.label_extraLarge : ""} ${d && !_ ? e.label_disabled : ""} ${_ && !d ? e.label_inverted : ""} ${_ && d ? e.label_inverted_disabled : ""}`,
348
+ className: `${e.label} ${l === "large" ? e.label_large : ""} ${l === "extraLarge" ? e.label_extraLarge : ""} ${_ && !p ? e.label_disabled : ""} ${p && !_ ? e.label_inverted : ""} ${p && _ ? e.label_inverted_disabled : ""}`,
350
349
  children: [
351
350
  T,
352
351
  /* @__PURE__ */ o(
353
352
  "span",
354
353
  {
355
- className: `${e.required} ${d && !_ ? e.required_disabled : ""} ${_ && !d ? e.required_inverted : ""} ${_ && d ? e.required_inverted_disabled : ""}`,
356
- children: fe && "*"
354
+ className: `${e.required} ${_ && !p ? e.required_disabled : ""} ${p && !_ ? e.required_inverted : ""} ${p && _ ? e.required_inverted_disabled : ""}`,
355
+ children: me && "*"
357
356
  }
358
357
  )
359
358
  ]
@@ -364,21 +363,21 @@ import '../../assets/Select.css';const Ue = "_selectContainer_1sakp_23", Ze = "_
364
363
  "div",
365
364
  {
366
365
  className: We,
367
- onClick: Oe,
368
- ref: Y,
369
- style: ae ? { borderColor: ae } : void 0,
366
+ onClick: Ie,
367
+ ref: A,
368
+ style: se ? { borderColor: se } : void 0,
370
369
  children: [
371
370
  /* @__PURE__ */ b("div", { className: e.iconLabel, children: [
372
- (s || de && ge) && /* @__PURE__ */ o(
371
+ (s || ce && be) && /* @__PURE__ */ o(
373
372
  "div",
374
373
  {
375
- className: `${e.icon} ${d && !_ ? e.icon_disabled : ""} ${_ && !d ? e.icon_inverted : ""} ${_ && d ? e.icon_inverted_disabled : ""}`,
374
+ className: `${e.icon} ${_ && !p ? e.icon_disabled : ""} ${p && !_ ? e.icon_inverted : ""} ${p && _ ? e.icon_inverted_disabled : ""}`,
376
375
  children: /* @__PURE__ */ o(
377
376
  F,
378
377
  {
379
- name: s ? "SearchIcon" : de,
380
- width: y,
381
- height: y
378
+ name: s ? "SearchIcon" : ce,
379
+ width: D,
380
+ height: D
382
381
  }
383
382
  )
384
383
  }
@@ -386,21 +385,21 @@ import '../../assets/Select.css';const Ue = "_selectContainer_1sakp_23", Ze = "_
386
385
  s ? /* @__PURE__ */ o(
387
386
  "input",
388
387
  {
389
- ref: G,
390
- value: ie,
391
- className: `${e.selectInput} ${!p && !l && I.length === 0 ? e.placeholder : ""}`,
388
+ ref: X,
389
+ value: le,
390
+ className: `${e.selectInput} ${!u && !i && O.length === 0 ? e.placeholder : ""}`,
392
391
  placeholder: Q,
393
- onChange: _e,
394
- onFocus: pe,
395
- onClick: Ie,
396
- disabled: d,
397
- readOnly: J || !l
392
+ onChange: de,
393
+ onFocus: _e,
394
+ onClick: Oe,
395
+ disabled: _,
396
+ readOnly: G || !i
398
397
  }
399
398
  ) : /* @__PURE__ */ o(
400
399
  "span",
401
400
  {
402
- className: `${e.selectValue} ${p ? "" : e.placeholder}`,
403
- children: p ? p.label : Q
401
+ className: `${e.selectValue} ${u ? "" : e.placeholder}`,
402
+ children: u ? u.label : Q
404
403
  }
405
404
  )
406
405
  ] }),
@@ -410,20 +409,20 @@ import '../../assets/Select.css';const Ue = "_selectContainer_1sakp_23", Ze = "_
410
409
  name: "ArrowDown",
411
410
  width: 16,
412
411
  height: 16,
413
- className: `${e.chevron} ${l ? e.chevronOpen : ""}`
412
+ className: `${e.chevron} ${i ? e.chevronOpen : ""}`
414
413
  }
415
414
  )
416
415
  ]
417
416
  }
418
417
  ),
419
- J ? /* @__PURE__ */ b(
418
+ G ? /* @__PURE__ */ b(
420
419
  Xe,
421
420
  {
422
421
  className: e.drawerSelect,
423
422
  headerClassName: e.drawerSelectHeader,
424
- isOpen: l,
425
- setIsOpen: C,
426
- title: ve,
423
+ isOpen: i,
424
+ setIsOpen: S,
425
+ title: ke,
427
426
  zIndex: 1,
428
427
  children: [
429
428
  s && /* @__PURE__ */ o("div", { className: e.drawerSearchInput, children: /* @__PURE__ */ o(
@@ -431,9 +430,9 @@ import '../../assets/Select.css';const Ue = "_selectContainer_1sakp_23", Ze = "_
431
430
  {
432
431
  placeholder: Q,
433
432
  icon: "SearchIcon",
434
- value: ie,
435
- onChange: _e,
436
- btc: oe
433
+ value: le,
434
+ onChange: de,
435
+ btc: re
437
436
  }
438
437
  ) }),
439
438
  /* @__PURE__ */ o(qe, {})
@@ -443,23 +442,23 @@ import '../../assets/Select.css';const Ue = "_selectContainer_1sakp_23", Ze = "_
443
442
  /* @__PURE__ */ o(
444
443
  "div",
445
444
  {
446
- ref: O,
447
- className: `${e.dropdown} ${e[a]} ${e.dropdownPortal} ${_ ? e.dropdown_inverted : ""} ${V ? e.dropdownTable : ""} ${s ? e.dropdownSearchable : ""}`,
445
+ ref: I,
446
+ className: `${e.dropdown} ${e[l]} ${e.dropdownPortal} ${p ? e.dropdown_inverted : ""} ${V ? e.dropdownTable : ""} ${s ? e.dropdownSearchable : ""}`,
448
447
  style: Ee,
449
- children: /* @__PURE__ */ o(ue, {})
448
+ children: /* @__PURE__ */ o(pe, {})
450
449
  }
451
450
  ),
452
451
  document.getElementById("root") || document.body
453
452
  )
454
453
  ] }),
455
- D && /* @__PURE__ */ o(Ae, { message: D, size: a, inverted: _ }),
456
- q && !D && /* @__PURE__ */ o(
454
+ L && /* @__PURE__ */ o(Ae, { message: L, size: l, inverted: p }),
455
+ q && !L && /* @__PURE__ */ o(
457
456
  je,
458
457
  {
459
458
  message: q,
460
- size: a,
461
- disabled: d,
462
- inverted: _
459
+ size: l,
460
+ disabled: _,
461
+ inverted: p
463
462
  }
464
463
  )
465
464
  ]
@@ -19,7 +19,6 @@ interface NavbarProps extends React.HTMLAttributes<HTMLDivElement> {
19
19
  activeItem: string;
20
20
  withConfig?: boolean;
21
21
  configAction?: () => void;
22
- ref?: React.Ref<HTMLDivElement>;
23
22
  }
24
23
  /**
25
24
  * Sidebar navegacional adaptable a plataformas web y app.
@@ -47,5 +46,5 @@ interface NavbarProps extends React.HTMLAttributes<HTMLDivElement> {
47
46
  * />
48
47
  * ```
49
48
  */
50
- export declare const Navbar: ({ options, className, activeItem, withConfig, configAction, ref, ...props }: NavbarProps) => import("react/jsx-runtime").JSX.Element;
49
+ export declare const Navbar: React.ForwardRefExoticComponent<NavbarProps & React.RefAttributes<HTMLDivElement>>;
51
50
  export {};
@@ -1,84 +1,77 @@
1
1
  import { jsx as n, jsxs as o } from "react/jsx-runtime";
2
- import { useState as b } from "react";
2
+ import { forwardRef as b, useState as v } from "react";
3
3
  import { Icon as i } from "../../icons/Icon.js";
4
- import { MenuItem as m } from "./menuItem/index.js";
5
- import '../../assets/index2.css';const v = "_sidebar_1c3mn_1", B = "_open_1c3mn_17", N = "_content_1c3mn_21", $ = "_header_1c3mn_28", f = "_toggleButton_1c3mn_43", C = "_menuList_1c3mn_59", L = "_bottomDiv_1c3mn_75", e = {
6
- sidebar: v,
7
- open: B,
8
- content: N,
4
+ import { MenuItem as r } from "./menuItem/index.js";
5
+ import '../../assets/index2.css';const B = "_sidebar_1c3mn_1", N = "_open_1c3mn_17", f = "_content_1c3mn_21", $ = "_header_1c3mn_28", w = "_toggleButton_1c3mn_43", C = "_menuList_1c3mn_59", L = "_bottomDiv_1c3mn_75", e = {
6
+ sidebar: B,
7
+ open: N,
8
+ content: f,
9
9
  header: $,
10
- toggleButton: f,
10
+ toggleButton: w,
11
11
  menuList: C,
12
12
  bottomDiv: L
13
- }, j = ({
14
- options: r,
15
- className: d,
16
- activeItem: l,
17
- withConfig: h = !1,
18
- configAction: s,
19
- ref: _,
20
- ...p
21
- }) => {
22
- const [t, g] = b(!0), c = () => {
23
- g((a) => !a);
24
- };
25
- return /* @__PURE__ */ n(
26
- "aside",
27
- {
28
- ref: _,
29
- className: `${e.sidebar} ${t ? e.open : ""} ${d || ""}`,
30
- ...p,
31
- children: /* @__PURE__ */ o("div", { className: e.content, children: [
32
- /* @__PURE__ */ o("header", { className: `${e.header} ${t && e.open}`, children: [
33
- /* @__PURE__ */ n(
34
- i,
35
- {
36
- name: t ? "BmiLogo" : "BmiCollapsed",
37
- width: t ? 80.86 : 26.62,
38
- height: 32
39
- }
40
- ),
41
- t && /* @__PURE__ */ n("div", { className: e.toggleButton, onClick: c, children: /* @__PURE__ */ n(
42
- i,
43
- {
44
- name: "ClosePanel",
45
- width: 20,
46
- height: 20,
47
- fill: "var(--black-60)"
48
- }
49
- ) })
50
- ] }),
51
- /* @__PURE__ */ o("ul", { className: e.menuList, children: [
52
- r.map((a, u) => /* @__PURE__ */ n(
53
- m,
54
- {
55
- option: a,
56
- activeItem: l,
57
- open: t
58
- },
59
- u
60
- )),
61
- /* @__PURE__ */ o("div", { className: `${e.bottomDiv} ${t && e.open}`, children: [
62
- !t && /* @__PURE__ */ n("div", { className: e.toggleButton, onClick: c, children: /* @__PURE__ */ n(i, { name: "OpenPanel", width: 20, height: 20, fill: "black" }) }),
63
- h && /* @__PURE__ */ n(
64
- m,
13
+ }, O = b(
14
+ ({
15
+ options: c,
16
+ className: d,
17
+ activeItem: l,
18
+ withConfig: h = !1,
19
+ configAction: s,
20
+ ..._
21
+ }, p) => {
22
+ const [t, g] = v(!0), m = () => {
23
+ g((a) => !a);
24
+ };
25
+ return /* @__PURE__ */ n(
26
+ "aside",
27
+ {
28
+ ref: p,
29
+ className: `${e.sidebar} ${t ? e.open : ""} ${d || ""}`,
30
+ ..._,
31
+ children: /* @__PURE__ */ o("div", { className: e.content, children: [
32
+ /* @__PURE__ */ o("header", { className: `${e.header} ${t && e.open}`, children: [
33
+ /* @__PURE__ */ n(
34
+ i,
65
35
  {
66
- option: {
67
- label: "Configuración",
68
- action: () => s == null ? void 0 : s(),
69
- iconAfter: "Settings",
70
- iconBefore: "ArrowRight"
71
- },
72
- open: t,
73
- activeItem: l
36
+ name: t ? "BmiLogo" : "BmiCollapsed",
37
+ width: t ? 80.86 : 26.62,
38
+ height: 32
74
39
  }
75
- )
40
+ ),
41
+ t && /* @__PURE__ */ n("div", { className: e.toggleButton, onClick: m, children: /* @__PURE__ */ n(i, { name: "ClosePanel", width: 20, height: 20 }) })
42
+ ] }),
43
+ /* @__PURE__ */ o("ul", { className: e.menuList, children: [
44
+ c.map((a, u) => /* @__PURE__ */ n(
45
+ r,
46
+ {
47
+ option: a,
48
+ activeItem: l,
49
+ open: t
50
+ },
51
+ u
52
+ )),
53
+ /* @__PURE__ */ o("div", { className: `${e.bottomDiv} ${t && e.open}`, children: [
54
+ !t && /* @__PURE__ */ n("div", { className: e.toggleButton, onClick: m, children: /* @__PURE__ */ n(i, { name: "OpenPanel", width: 20, height: 20, fill: "black" }) }),
55
+ h && /* @__PURE__ */ n(
56
+ r,
57
+ {
58
+ option: {
59
+ label: "Configuración",
60
+ action: () => s == null ? void 0 : s(),
61
+ iconAfter: "Settings",
62
+ iconBefore: "ArrowRight"
63
+ },
64
+ open: t,
65
+ activeItem: l
66
+ }
67
+ )
68
+ ] })
76
69
  ] })
77
70
  ] })
78
- ] })
79
- }
80
- );
81
- };
71
+ }
72
+ );
73
+ }
74
+ );
82
75
  export {
83
- j as Navbar
76
+ O as Navbar
84
77
  };
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.3.0",
4
+ "version": "2.3.2",
5
5
  "author": "BMI Ahorro España",
6
6
  "contributors": [
7
7
  "José Ramón Jiménez <jrjimenez@bmicos.com>",