bmi-next 1.0.24 → 1.0.25

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,95 +1,105 @@
1
- import { jsxs as r, Fragment as D, jsx as o } from "react/jsx-runtime";
2
- import { useRef as E, Fragment as A } from "react";
1
+ import { jsxs as o, Fragment as D, jsx as r } from "react/jsx-runtime";
2
+ import { useRef as h, Fragment as A } from "react";
3
3
  import { r as I } from "../../../index-Cp_B-Y3h.js";
4
4
  import { Icon as j } from "../../../icons/icons.js";
5
5
  import { Image as H } from "../../images/index.js";
6
- import '../../../assets/index3.css';const B = "_overlay_f1ngj_1", Y = "_closing_f1ngj_11", L = "_bottomDrawer_f1ngj_35", S = "_drawerHeader_f1ngj_73", C = "_drawerIndicator_f1ngj_87", X = "_drawerContent_f1ngj_98", $ = "_optionCountry_f1ngj_106", b = "_optionNormal_f1ngj_107", R = "_options_f1ngj_125", M = "_closeButton_f1ngj_137", x = "_separator_f1ngj_150", t = {
6
+ import '../../../assets/index3.css';const B = "_overlay_f1ngj_1", Y = "_closing_f1ngj_11", L = "_bottomDrawer_f1ngj_35", S = "_drawerHeader_f1ngj_73", C = "_drawerIndicator_f1ngj_87", R = "_drawerContent_f1ngj_98", X = "_optionCountry_f1ngj_106", $ = "_optionNormal_f1ngj_107", b = "_options_f1ngj_125", x = "_closeButton_f1ngj_137", M = "_separator_f1ngj_150", t = {
7
7
  overlay: B,
8
8
  closing: Y,
9
9
  bottomDrawer: L,
10
10
  drawerHeader: S,
11
11
  drawerIndicator: C,
12
- drawerContent: X,
13
- optionCountry: $,
14
- optionNormal: b,
15
- options: R,
16
- closeButton: M,
17
- separator: x
12
+ drawerContent: R,
13
+ optionCountry: X,
14
+ optionNormal: $,
15
+ options: b,
16
+ closeButton: x,
17
+ separator: M
18
18
  }, P = ({
19
- isOpen: h,
19
+ isOpen: E,
20
20
  handleClose: s,
21
- dragPosition: f,
22
- setDragPosition: i,
23
- isClosing: _,
24
- title: p,
25
- options: u,
26
- handleOptionClick: w,
27
- countries: N,
28
- zIndex: d
21
+ dragPosition: p,
22
+ setDragPosition: m,
23
+ isClosing: u,
24
+ title: f,
25
+ options: _,
26
+ handleOptionClick: y,
27
+ countries: w,
28
+ zIndex: l
29
29
  }) => {
30
- const y = d ? 50 : 70, l = E(0), m = E(0);
31
- if (!h) return null;
32
- const v = (e) => {
30
+ const N = l ? 50 : 70, d = h(0), i = h(0);
31
+ if (!E) return null;
32
+ const g = (e) => {
33
33
  const n = "touches" in e ? e.touches[0].clientY : e.clientY;
34
- l.current = n, m.current = n, document.addEventListener("mousemove", c), document.addEventListener("touchmove", c), document.addEventListener("mouseup", a), document.addEventListener("touchend", a);
35
- }, a = () => {
36
- document.removeEventListener("mousemove", c), document.removeEventListener("touchmove", c), document.removeEventListener("mouseup", a), document.removeEventListener("touchend", a), m.current - l.current > 100 ? s() : i(0);
37
- }, c = (e) => {
38
- const n = "touches" in e ? e.touches[0].clientY : e.clientY, g = n - l.current;
39
- m.current = n, g > 0 && i(g);
34
+ d.current = n, i.current = n, document.addEventListener("mousemove", a), document.addEventListener("touchmove", a), document.addEventListener("mouseup", c), document.addEventListener("touchend", c);
35
+ }, c = () => {
36
+ document.removeEventListener("mousemove", a), document.removeEventListener("touchmove", a), document.removeEventListener("mouseup", c), document.removeEventListener("touchend", c), i.current - d.current > 100 ? s() : m(0);
37
+ }, a = (e) => {
38
+ const n = "touches" in e ? e.touches[0].clientY : e.clientY, v = n - d.current;
39
+ i.current = n, v > 0 && m(v);
40
40
  };
41
41
  return I.createPortal(
42
- /* @__PURE__ */ r(D, { children: [
43
- /* @__PURE__ */ o(
42
+ /* @__PURE__ */ o(D, { children: [
43
+ /* @__PURE__ */ r(
44
44
  "div",
45
45
  {
46
- style: { zIndex: 2e3 + (d || 0) },
47
- className: `${t.overlay} ${_ ? t.closing : ""}`,
46
+ style: { zIndex: 2e3 + (l || 0) },
47
+ className: `${t.overlay} ${u ? t.closing : ""}`,
48
48
  onClick: s
49
49
  }
50
50
  ),
51
- /* @__PURE__ */ r(
51
+ /* @__PURE__ */ o(
52
52
  "div",
53
53
  {
54
- className: `${t.bottomDrawer} ${_ ? t.closing : ""}`,
54
+ className: `${t.bottomDrawer} ${u ? t.closing : ""}`,
55
55
  style: {
56
- transform: `translateY(${f ?? 0}px)`,
57
- zIndex: 2001 + (d || 0)
56
+ transform: `translateY(${p ?? 0}px)`,
57
+ zIndex: 2001 + (l || 0)
58
58
  },
59
59
  children: [
60
- /* @__PURE__ */ r(
60
+ /* @__PURE__ */ o(
61
61
  "header",
62
62
  {
63
63
  className: t.drawerHeader,
64
- onMouseDown: v,
65
- onTouchStart: v,
64
+ onMouseDown: g,
65
+ onTouchStart: g,
66
66
  children: [
67
- /* @__PURE__ */ o("div", { className: t.drawerIndicator }),
68
- /* @__PURE__ */ o("div", { className: t.closeButton, onClick: s, children: /* @__PURE__ */ o(j, { name: "Close", fill: "rgb(0 0 0/40%)" }) }),
69
- /* @__PURE__ */ o("p", { children: p })
67
+ /* @__PURE__ */ r("div", { className: t.drawerIndicator }),
68
+ /* @__PURE__ */ r("div", { className: t.closeButton, onClick: s, children: /* @__PURE__ */ r(j, { name: "Close", fill: "rgb(0 0 0/40%)" }) }),
69
+ /* @__PURE__ */ r("p", { children: f })
70
70
  ]
71
71
  }
72
72
  ),
73
- /* @__PURE__ */ o(
73
+ /* @__PURE__ */ r(
74
74
  "div",
75
75
  {
76
76
  className: t.drawerContent,
77
- style: { maxHeight: `${y}vh` },
78
- children: /* @__PURE__ */ o("div", { className: t.options, children: u.map(
79
- (e, n) => e.hidden ? null : /* @__PURE__ */ r(A, { children: [
80
- /* @__PURE__ */ r(
77
+ style: { maxHeight: `${N}vh` },
78
+ children: /* @__PURE__ */ r("div", { className: t.options, children: _.map(
79
+ (e, n) => e.hidden ? null : /* @__PURE__ */ o(A, { children: [
80
+ /* @__PURE__ */ o(
81
81
  "div",
82
82
  {
83
- className: `${N ? t.optionCountry : t.optionNormal}`,
84
- onClick: () => w(e),
83
+ className: `${w ? t.optionCountry : t.optionNormal}`,
84
+ onClick: () => y(e),
85
85
  children: [
86
- e.image && /* @__PURE__ */ o(H, { width: 30, height: 30, src: e.image.src }),
87
- e.label
86
+ e.image && /* @__PURE__ */ r(H, { width: 30, height: 30, src: e.image.src }),
87
+ /* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column" }, children: [
88
+ /* @__PURE__ */ r("p", { style: { margin: 0 }, children: e.label }),
89
+ e.description && /* @__PURE__ */ r(
90
+ "p",
91
+ {
92
+ className: "small2Regular",
93
+ style: { margin: 0, opacity: 0.5 },
94
+ children: e.description
95
+ }
96
+ )
97
+ ] })
88
98
  ]
89
99
  },
90
100
  e.value
91
101
  ),
92
- n < u.length - 1 && /* @__PURE__ */ o("div", { className: t.separator })
102
+ n < _.length - 1 && /* @__PURE__ */ r("div", { className: t.separator })
93
103
  ] }, n)
94
104
  ) })
95
105
  }
@@ -10,6 +10,7 @@ import { ImgProps } from '../images';
10
10
  * @property {ImgProps} [image] - Imagen opcional para mostrar junto a la opción.
11
11
  * @property {IconPropsWithIconName} [icon] - Icono opcional para mostrar junto a la opción.
12
12
  * @property {boolean} [hidden] - Indica si la opción debe estar oculta en la lista.
13
+ * @property {string} [description] - Descripción opcional para mostrar junto a la opción.
13
14
  */
14
15
  export interface Option {
15
16
  /** El texto que se muestra para la opción */
@@ -22,6 +23,8 @@ export interface Option {
22
23
  icon?: IconPropsWithIconName;
23
24
  /** Indica si la opción debe estar oculta en la lista */
24
25
  hidden?: boolean;
26
+ /** Descripción opcional para mostrar junto a la opción */
27
+ description?: string;
25
28
  }
26
29
  /**
27
30
  * Props del componente Select.
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.24",
4
+ "version": "1.0.25",
5
5
  "author": "David Fernández Bolaños <david@bmiahorro.com>",
6
6
  "contributors": [
7
7
  "Jorge Martín <jorge@bmiahorro.com>",