bmi-next-brokers 3.1.4 → 3.1.5

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
- ._button_1i1mc_1{position:relative;border:none;border-radius:1000px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;font-family:var(--font-regular);font-weight:100;transition:all .2s ease-in-out;width:fit-content}._content_1i1mc_15{display:inline-flex;align-items:center;justify-content:center;gap:8px}._button_1i1mc_1:disabled{opacity:.3;cursor:not-allowed}._small_1i1mc_28{padding:4px 12px;font-size:14px;height:30px}._medium_1i1mc_34{padding:4px 10px;font-size:16px;height:36px}._large_1i1mc_40{padding:4px 14px;font-size:18px;height:42px}._extraLarge_1i1mc_46{padding:4px 16px;font-size:20px;height:48px}._brand_1i1mc_53{background:var(--Fill-Brand-Inverted-Active, #2054a5);color:#fff}._brand_1i1mc_53:hover:not(:disabled){background:var(--Fill-Brand-Inverted-Hover, #4f88d9)}._brand_1i1mc_53:active:not(:disabled){box-shadow:0 0 0 var(--Focused_Stroke, 4px) var(--ui-blue-800, #16396f)}._outline_1i1mc_66{background-color:transparent;color:var(--Stroke-Brand-Active, #2054a5);border:1px solid var(--Stroke-Brand-Active, #2054a5)}._outline_1i1mc_66:hover:not(:disabled){border:2px solid var(--Stroke-Brand-Hover, #4f88d9);color:var(--Stroke-Brand-Hover, #4f88d9)}._outline_1i1mc_66:active{background:var(--Content-Brand-Inverted-Active, #eef3fc);border:none!important;box-shadow:0 0 0 var(--Focused_Stroke, 4px) var(--brand-Azul-digital-BMI-500, #2054a5)}._outlineRed_1i1mc_84{background-color:transparent;color:var(--Stroke-Danger-Active, #c53030);border:1px solid var(--Stroke-Danger-Active, #c53030)}._outlineRed_1i1mc_84:hover:not(:disabled){border:2px solid var(--Stroke-Danger-Hover, #e53e3e);color:var(--Stroke-Danger-Hover, #e53e3e)}._outlineRed_1i1mc_84:active:not(:disabled){background:var(--Content-Danger-Inverted-Active, #fff5f5);border:none!important;box-shadow:0 0 0 var(--Focused_Stroke, 4px) var(--Stroke-Danger-Active, #c53030)}._ghost_1i1mc_102{background-color:transparent;color:var(--Content-Brand-Default-Active, #2054a5);border:none}._ghost_1i1mc_102:hover:not(:disabled){font-family:var(--font-medium)}._ghost_1i1mc_102:active:not(:disabled){background:var(--Fill-Disabled-Default, #f8fafc);box-shadow:0 0 0 var(--Focused_Stroke, 4px) var(--brand-Azul-digital-BMI-500, #2054a5)}._textLink_1i1mc_119{background-color:transparent;color:var(--Content-Brand-Default-Active, #2054a5);border:none;text-decoration:underline}._textLink_1i1mc_119:hover:not(:disabled){font-family:var(--font-medium)}._textLink_1i1mc_119:active:not(:disabled){background:var(--Fill-Disabled-Default, #f8fafc);box-shadow:0 0 0 var(--Focused_Stroke, 4px) var(--brand-Azul-digital-BMI-500, #2054a5)}._secondary_1i1mc_136{background-color:var(--ui-blue-100);color:var(--Content-Brand-Default-Active, #2054a5);border:none}._button_1i1mc_1._inverted_1i1mc_143 svg path{fill:currentColor!important}._button_1i1mc_1._inverted_1i1mc_143._brand_1i1mc_53{background:#fff!important;color:#2054a5!important}._button_1i1mc_1._inverted_1i1mc_143._brand_1i1mc_53:hover:not(:disabled){background:#eef3fc!important;color:#1b468a!important}._button_1i1mc_1._inverted_1i1mc_143._brand_1i1mc_53:active:not(:disabled){box-shadow:0 0 0 3px var(--ui-blue-400, #7eaae6)}._button_1i1mc_1._inverted_1i1mc_143._outline_1i1mc_66{background-color:transparent!important;border:1px solid var(--Stroke-Brand-Active, #fff)}._button_1i1mc_1._inverted_1i1mc_143._outline_1i1mc_66:not(:disabled){border:1px solid var(--Stroke-Brand-Active, #fff);color:var(--Stroke-Brand-Active, #fff);background-color:transparent!important}._button_1i1mc_1._inverted_1i1mc_143._outline_1i1mc_66:hover:not(:disabled){border:2px solid var(--Stroke-Brand-Active, #fff);color:#f8f9fa!important;background-color:transparent!important}._button_1i1mc_1._inverted_1i1mc_143._outline_1i1mc_66:active:not(:disabled){border:2px solid var(--Stroke-Brand-Active, #fff);box-shadow:0 0 0 3px var(--ui-blue-400, #7eaae6)}._button_1i1mc_1._inverted_1i1mc_143._ghost_1i1mc_102{background-color:transparent!important;color:#fff!important;border:none!important}._button_1i1mc_1._inverted_1i1mc_143._ghost_1i1mc_102:hover:not(:disabled){background-color:#ffffff1a!important;color:var(--Stroke-Brand-Innactive, #2054a5)}._button_1i1mc_1._inverted_1i1mc_143._textLink_1i1mc_119{background-color:transparent!important;color:#fff!important;border:none!important;text-decoration:underline!important}._button_1i1mc_1._inverted_1i1mc_143._textLink_1i1mc_119:hover:not(:disabled){color:#f8f9fa!important;background-color:transparent!important}._fullWidth_1i1mc_209{width:100%}._squaredBorder_1i1mc_213{border-radius:12px!important}._spinner_1i1mc_217{position:absolute;display:flex;justify-content:center;align-items:center}
1
+ ._button_efl15_1{position:relative;border:none;border-radius:1000px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;font-family:var(--font-regular);font-weight:100;transition:all .2s ease-in-out;width:fit-content}._content_efl15_15{display:inline-flex;align-items:center;justify-content:center;gap:8px}._button_efl15_1:disabled{opacity:.3;cursor:not-allowed}._small_efl15_28{padding:4px 12px;font-size:14px;height:30px}._medium_efl15_34{padding:4px 10px;font-size:16px;height:36px}._large_efl15_40{padding:4px 14px;font-size:18px;height:42px}._extraLarge_efl15_46{padding:4px 16px;font-size:20px;height:48px}._brand_efl15_53{background:var(--Fill-Brand-Inverted-Active, #2054a5);color:#fff}._brand_efl15_53:hover:not(:disabled){background:var(--Fill-Brand-Inverted-Hover, #4f88d9)}._brand_efl15_53:active:not(:disabled){box-shadow:0 0 0 var(--Focused_Stroke, 4px) var(--ui-blue-800, #16396f)}._outline_efl15_66{background-color:transparent;color:var(--Stroke-Brand-Active, #2054a5);border:1px solid var(--Stroke-Brand-Active, #2054a5)}._outline_efl15_66:hover:not(:disabled){border:2px solid var(--Stroke-Brand-Hover, #4f88d9);color:var(--Stroke-Brand-Hover, #4f88d9)}._outline_efl15_66:active{background:var(--Content-Brand-Inverted-Active, #eef3fc);border:none!important;box-shadow:0 0 0 var(--Focused_Stroke, 4px) var(--brand-Azul-digital-BMI-500, #2054a5)}._outlineRed_efl15_84{background-color:transparent;color:var(--Stroke-Danger-Active, #c53030);border:1px solid var(--Stroke-Danger-Active, #c53030)}._outlineRed_efl15_84:hover:not(:disabled){border:2px solid var(--Stroke-Danger-Hover, #e53e3e);color:var(--Stroke-Danger-Hover, #e53e3e)}._outlineRed_efl15_84:active:not(:disabled){background:var(--Content-Danger-Inverted-Active, #fff5f5);border:none!important;box-shadow:0 0 0 var(--Focused_Stroke, 4px) var(--Stroke-Danger-Active, #c53030)}._ghost_efl15_102{background-color:transparent;color:var(--Content-Brand-Default-Active, #2054a5);border:none}._ghost_efl15_102:hover:not(:disabled){font-family:var(--font-medium)}._ghost_efl15_102:active:not(:disabled){background:var(--Fill-Disabled-Default, #f8fafc);box-shadow:0 0 0 var(--Focused_Stroke, 4px) var(--brand-Azul-digital-BMI-500, #2054a5)}._textLink_efl15_119{background-color:transparent;color:var(--Content-Brand-Default-Active, #2054a5);border:none;text-decoration:underline}._textLink_efl15_119:hover:not(:disabled){font-family:var(--font-medium)}._textLink_efl15_119:active:not(:disabled){background:var(--Fill-Disabled-Default, #f8fafc);box-shadow:0 0 0 var(--Focused_Stroke, 4px) var(--brand-Azul-digital-BMI-500, #2054a5)}._secondary_efl15_136{background-color:var(--ui-blue-100);color:var(--Content-Brand-Default-Active, #2054a5);border:none}._button_efl15_1._inverted_efl15_143 svg path{fill:currentColor!important}._button_efl15_1._inverted_efl15_143._brand_efl15_53{background:#fff!important;color:#2054a5!important}._button_efl15_1._inverted_efl15_143._brand_efl15_53:hover:not(:disabled){background:#eef3fc!important;color:#1b468a!important}._button_efl15_1._inverted_efl15_143._brand_efl15_53:active:not(:disabled){box-shadow:0 0 0 3px var(--ui-blue-400, #7eaae6)}._button_efl15_1._inverted_efl15_143._outline_efl15_66{background-color:transparent!important;border:1px solid var(--Stroke-Brand-Active, #fff)}._button_efl15_1._inverted_efl15_143._outline_efl15_66:not(:disabled){border:1px solid var(--Stroke-Brand-Active, #fff);color:var(--Stroke-Brand-Active, #fff);background-color:transparent!important}._button_efl15_1._inverted_efl15_143._outline_efl15_66:hover:not(:disabled){border:2px solid var(--Stroke-Brand-Active, #fff);color:#f8f9fa!important;background-color:transparent!important}._button_efl15_1._inverted_efl15_143._outline_efl15_66:active:not(:disabled){border:2px solid var(--Stroke-Brand-Active, #fff);box-shadow:0 0 0 3px var(--ui-blue-400, #7eaae6)}._button_efl15_1._inverted_efl15_143._ghost_efl15_102{background-color:transparent!important;color:#fff!important;border:none!important}._button_efl15_1._inverted_efl15_143._ghost_efl15_102:hover:not(:disabled){background-color:#ffffff1a!important;color:var(--Stroke-Brand-Innactive, #2054a5)}._button_efl15_1._inverted_efl15_143._textLink_efl15_119{background-color:transparent!important;color:#fff!important;border:none!important;text-decoration:underline!important}._button_efl15_1._inverted_efl15_143._textLink_efl15_119:hover:not(:disabled){color:#f8f9fa!important;background-color:transparent!important}._fullWidth_efl15_209{width:100%}._squaredBorder_efl15_213{border-radius:12px!important}._stack_efl15_220{display:grid;place-items:center}._stack_efl15_220>*{grid-area:1 / 1}._spinner_efl15_225{display:flex;justify-content:center;align-items:center;white-space:nowrap}
@@ -7,12 +7,17 @@ export interface IconConfig {
7
7
  name: IconName;
8
8
  position: "before" | "after";
9
9
  }
10
+ export interface LoadingMessageConfig {
11
+ text: string;
12
+ position?: "before" | "after";
13
+ }
10
14
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
11
15
  children: React.ReactNode;
12
16
  variant?: ButtonVariant;
13
17
  size?: ButtonSize;
14
18
  disabled?: boolean;
15
19
  loading?: boolean;
20
+ loadingMessage?: LoadingMessageConfig;
16
21
  onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
17
22
  className?: string;
18
23
  type?: "button" | "submit" | "reset";
@@ -21,4 +26,4 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
21
26
  fullWidth?: boolean;
22
27
  squared?: boolean;
23
28
  }
24
- export declare const Button: ({ children, variant, size, disabled, loading, onClick, className, type, icon, inverted, fullWidth, squared, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
29
+ export declare const Button: ({ children, variant, size, disabled, loading, loadingMessage, onClick, className, type, icon, inverted, fullWidth, squared, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,80 +1,94 @@
1
- import { jsxs as c, jsx as n, Fragment as a } from "react/jsx-runtime";
2
- import { Icon as v } from "../../icons/Icon.js";
3
- import { Spinner as y } from "../Spinner/Spinner.js";
4
- import '../../assets/Button.css';const B = "_button_1i1mc_1", k = "_content_1i1mc_15", q = "_small_1i1mc_28", R = "_medium_1i1mc_34", W = "_large_1i1mc_40", j = "_extraLarge_1i1mc_46", C = "_brand_1i1mc_53", N = "_outline_1i1mc_66", S = "_outlineRed_1i1mc_84", $ = "_ghost_1i1mc_102", w = "_textLink_1i1mc_119", E = "_secondary_1i1mc_136", F = "_inverted_1i1mc_143", I = "_fullWidth_1i1mc_209", A = "_squaredBorder_1i1mc_213", D = "_spinner_1i1mc_217", e = {
5
- button: B,
6
- content: k,
7
- small: q,
8
- medium: R,
9
- large: W,
1
+ import { jsx as n, jsxs as o, Fragment as a } from "react/jsx-runtime";
2
+ import { Icon as B } from "../../icons/Icon.js";
3
+ import { Spinner as v } from "../Spinner/Spinner.js";
4
+ import '../../assets/Button.css';const q = "_button_efl15_1", N = "_content_efl15_15", R = "_small_efl15_28", W = "_medium_efl15_34", $ = "_large_efl15_40", j = "_extraLarge_efl15_46", C = "_brand_efl15_53", E = "_outline_efl15_66", S = "_outlineRed_efl15_84", F = "_ghost_efl15_102", w = "_textLink_efl15_119", I = "_secondary_efl15_136", A = "_inverted_efl15_143", D = "_fullWidth_efl15_209", G = "_squaredBorder_efl15_213", H = "_stack_efl15_220", J = "_spinner_efl15_225", e = {
5
+ button: q,
6
+ content: N,
7
+ small: R,
8
+ medium: W,
9
+ large: $,
10
10
  extraLarge: j,
11
11
  brand: C,
12
- outline: N,
12
+ outline: E,
13
13
  outlineRed: S,
14
- ghost: $,
14
+ ghost: F,
15
15
  textLink: w,
16
- secondary: E,
17
- inverted: F,
18
- fullWidth: I,
19
- squaredBorder: A,
20
- spinner: D
21
- }, K = ({
22
- children: o,
23
- variant: _ = "brand",
24
- size: t = "medium",
25
- disabled: d = !1,
26
- loading: s = !1,
27
- onClick: m,
28
- className: u,
16
+ secondary: I,
17
+ inverted: A,
18
+ fullWidth: D,
19
+ squaredBorder: G,
20
+ stack: H,
21
+ spinner: J
22
+ }, Q = ({
23
+ children: s,
24
+ variant: i = "brand",
25
+ size: r = "medium",
26
+ disabled: f = !1,
27
+ loading: l = !1,
28
+ loadingMessage: t,
29
+ onClick: u,
30
+ className: m,
29
31
  type: b = "button",
30
- icon: i,
31
- inverted: f = !1,
32
- fullWidth: h = !1,
33
- squared: g = !1,
34
- ...p
32
+ icon: _,
33
+ inverted: h = !1,
34
+ fullWidth: p = !1,
35
+ squared: x = !1,
36
+ ...k
35
37
  }) => {
36
- const x = [
38
+ const L = [
37
39
  e.button,
38
- _ === "outline-red" ? e.outlineRed : e[_],
39
- e[t],
40
- f ? e.inverted : "",
41
- h ? e.fullWidth : "",
42
- u
43
- ].filter(Boolean).join(" "), r = t === "small" ? 16 : t === "large" ? 20 : t === "extraLarge" ? 24 : 18, L = () => {
44
- if (!i) return o;
45
- const l = /* @__PURE__ */ n(v, { name: i.name, width: r, height: r });
46
- return i.position === "before" ? /* @__PURE__ */ c(a, { children: [
47
- l,
48
- o
49
- ] }) : /* @__PURE__ */ c(a, { children: [
50
- o,
51
- l
40
+ i === "outline-red" ? e.outlineRed : e[i],
41
+ e[r],
42
+ h ? e.inverted : "",
43
+ p ? e.fullWidth : "",
44
+ m
45
+ ].filter(Boolean).join(" "), c = r === "small" ? 16 : r === "large" ? 20 : r === "extraLarge" ? 24 : 18, y = () => {
46
+ if (!_) return s;
47
+ const d = /* @__PURE__ */ n(B, { name: _.name, width: c, height: c });
48
+ return _.position === "before" ? /* @__PURE__ */ o(a, { children: [
49
+ d,
50
+ s
51
+ ] }) : /* @__PURE__ */ o(a, { children: [
52
+ s,
53
+ d
52
54
  ] });
53
55
  };
54
- return /* @__PURE__ */ c(
56
+ return /* @__PURE__ */ n(
55
57
  "button",
56
58
  {
57
59
  type: b,
58
- disabled: d || s,
59
- onClick: m,
60
- className: `${x} ${g ? e.squaredBorder : ""}`,
61
- ...p,
62
- children: [
63
- s && /* @__PURE__ */ n("div", { className: e.spinner, children: /* @__PURE__ */ n(y, { thickness: 4, size: r, backgroundColor: "#9bd" }) }),
60
+ disabled: f || l,
61
+ onClick: u,
62
+ className: `${L} ${x ? e.squaredBorder : ""}`,
63
+ ...k,
64
+ children: /* @__PURE__ */ o("span", { className: e.stack, children: [
65
+ l && /* @__PURE__ */ o("span", { className: `${e.spinner} ${e.content}`, children: [
66
+ (t == null ? void 0 : t.position) === "before" && /* @__PURE__ */ n("span", { children: t.text }),
67
+ /* @__PURE__ */ n(
68
+ v,
69
+ {
70
+ thickness: 1.5,
71
+ size: c,
72
+ backgroundColor: "#E2E8F0",
73
+ roundedStroke: !0
74
+ }
75
+ ),
76
+ t && t.position !== "before" && /* @__PURE__ */ n("span", { children: t.text })
77
+ ] }),
64
78
  /* @__PURE__ */ n(
65
79
  "span",
66
80
  {
67
81
  style: {
68
- visibility: s ? "hidden" : "visible"
82
+ visibility: l ? "hidden" : "visible"
69
83
  },
70
84
  className: e.content,
71
- children: L()
85
+ children: y()
72
86
  }
73
87
  )
74
- ]
88
+ ] })
75
89
  }
76
90
  );
77
91
  };
78
92
  export {
79
- K as Button
93
+ Q as Button
80
94
  };
@@ -1,2 +1,2 @@
1
1
  export { Button } from './Button';
2
- export type { ButtonProps, ButtonVariant, ButtonSize } from './Button';
2
+ export type { ButtonProps, ButtonVariant, ButtonSize, LoadingMessageConfig, } from './Button';
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": "3.1.4",
4
+ "version": "3.1.5",
5
5
  "author": "BMI Ahorro España",
6
6
  "contributors": [
7
7
  "José Ramón Jiménez <jrjimenez@bmicos.com>",