bmi-next-brokers 2.8.6 → 2.8.7

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.
@@ -0,0 +1 @@
1
+ ._toast_2sram_2{position:relative;width:100%;min-width:0;max-width:420px;border-radius:12px;align-items:center;border-left:4px solid;overflow:hidden;cursor:default;display:flex;flex-direction:column;gap:.75em;box-sizing:border-box}._topRow_2sram_19{display:flex;align-items:center;gap:.75rem;width:100%}._bottomRow_2sram_26{display:flex;justify-content:center;width:100%}._iconContainer_2sram_33{flex-shrink:0;width:24px;margin-left:5px;height:24px;display:flex;align-items:center;justify-content:center;margin-top:.125rem}._content_2sram_45{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;flex:1;min-width:0;gap:2px;overflow:visible;word-break:break-word}._small2Bold_2sram_58{font-size:12px;font-weight:600;line-height:1.3}._small5Regular_2sram_64{font-size:11px;font-weight:400;line-height:1.4}._bodyBold_2sram_70{font-size:14px;font-weight:600;line-height:1.3}._small2Medium_2sram_76{font-size:12px;font-weight:500;line-height:1.4}._title6Bold_2sram_82{font-size:16px;font-weight:600;line-height:1.3}._bodyMedium_2sram_88{font-size:14px;font-weight:500;line-height:1.4}._actionButton_2sram_95{flex-shrink:0;background:transparent!important}._toast_2sram_2 ._actionButton_2sram_95{border:1px solid var(--Badge-Toasts-Stroke, #2054a5)!important;color:var(--Badge-Toasts-Stroke, #2054a5)!important;background-color:transparent!important}._type_brand_2sram_106 ._actionButton_2sram_95,._type_info_2sram_111 ._actionButton_2sram_95{border:1px solid #2054a5!important;color:#2054a5!important}._type_new_2sram_116 ._actionButton_2sram_95{border:1px solid #0f93a8!important;color:#0f93a8!important}._type_pending_2sram_121 ._actionButton_2sram_95{border:1px solid #ca8a04!important;color:#ca8a04!important}._type_positive_2sram_126 ._actionButton_2sram_95{border:1px solid #65a30d!important;color:#65a30d!important}._type_warning_2sram_131 ._actionButton_2sram_95{border:1px solid #ea580c!important;color:#ea580c!important}._type_negative_2sram_136 ._actionButton_2sram_95{border:1px solid #dc2626!important;color:#dc2626!important}._toast_2sram_2 ._actionButton_2sram_95:hover:not(:disabled){border-width:1px!important;background-color:transparent!important}._closeButton_2sram_147{flex-shrink:0;background:none;border:none;cursor:pointer;padding:0 0 0 7px;display:flex;align-items:center;justify-content:center;transition:all .2s ease;margin-right:.5rem}._closeButton_2sram_147:active{transform:scale(.95)}._progressBar_2sram_166{position:absolute;bottom:0;left:0;height:3px;background:currentColor;opacity:.6;animation:_progressBarShrink_2sram_1 linear;transform-origin:left}._entering_2sram_178{animation:_staticToastIn_2sram_1 .3s cubic-bezier(.16,1,.3,1) forwards}._exiting_2sram_182{animation:_staticToastOut_2sram_1 .3s cubic-bezier(.4,0,1,1) forwards}@keyframes _staticToastIn_2sram_1{0%{opacity:0;transform:translateY(-6px) scale(.98);filter:blur(3px)}to{opacity:1;transform:translateY(0) scale(1);filter:blur(0)}}@keyframes _staticToastOut_2sram_1{0%{opacity:1;transform:translateY(0) scale(1);filter:blur(0)}to{opacity:0;transform:translateY(-6px) scale(.98);filter:blur(3px)}}@keyframes _progressBarShrink_2sram_1{0%{transform:scaleX(1)}to{transform:scaleX(0)}}._toast_2sram_2:hover ._progressBar_2sram_166{animation-play-state:paused}@media (prefers-reduced-motion: reduce){._toast_2sram_2,._entering_2sram_178,._exiting_2sram_182,._progressBar_2sram_166{animation:none!important}}._content_2sram_45:only-child,._content_2sram_45:not(:has(._body_2sram_70)){justify-content:center}
@@ -0,0 +1,27 @@
1
+ import { IconName } from '../../icons/Icon';
2
+ export type StaticToastType = "brand" | "info" | "new" | "pending" | "positive" | "warning" | "negative";
3
+ export type StaticToastSize = "small" | "medium" | "large";
4
+ export interface StaticToastProps {
5
+ type?: StaticToastType;
6
+ title?: string;
7
+ body?: string;
8
+ size?: StaticToastSize;
9
+ icon?: IconName;
10
+ /** Controla la visibilidad del toast. Por defecto visible. */
11
+ isVisible?: boolean;
12
+ /** Muestra el botón de cierre (X). Por defecto true. */
13
+ closable?: boolean;
14
+ onClose?: () => void;
15
+ /** Cierra automáticamente tras `duration` ms. Por defecto false en el StaticToast. */
16
+ autoClose?: boolean;
17
+ /** Duración del autoClose en ms y de la barra de progreso. */
18
+ duration?: number;
19
+ className?: string;
20
+ /** Estilos inline para integrarlo como un div normal (ancho, márgenes, etc.). */
21
+ style?: React.CSSProperties;
22
+ action?: {
23
+ label: string;
24
+ function: () => void;
25
+ };
26
+ }
27
+ export declare const StaticToast: ({ type, title, body, size, icon, isVisible, closable, onClose, autoClose, duration, className, style, action, }: StaticToastProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,228 @@
1
+ import { jsxs as B, jsx as t } from "react/jsx-runtime";
2
+ import { useState as R, useEffect as x } from "react";
3
+ import { Icon as w } from "../../icons/Icon.js";
4
+ import { Button as D } from "../Button/Button.js";
5
+ import '../../assets/StaticToast.css';const j = "_toast_2sram_2", O = "_topRow_2sram_19", P = "_bottomRow_2sram_26", $ = "_iconContainer_2sram_33", H = "_content_2sram_45", L = "_small2Bold_2sram_58", W = "_small5Regular_2sram_64", q = "_bodyBold_2sram_70", G = "_small2Medium_2sram_76", J = "_title6Bold_2sram_82", K = "_bodyMedium_2sram_88", Q = "_actionButton_2sram_95", U = "_type_brand_2sram_106", X = "_type_info_2sram_111", Y = "_type_new_2sram_116", Z = "_type_pending_2sram_121", S = "_type_positive_2sram_126", V = "_type_warning_2sram_131", z = "_type_negative_2sram_136", oo = "_closeButton_2sram_147", ro = "_progressBar_2sram_166", to = "_progressBarShrink_2sram_1", eo = "_entering_2sram_178", ao = "_staticToastIn_2sram_1", so = "_exiting_2sram_182", no = "_staticToastOut_2sram_1", lo = "_body_2sram_70", r = {
6
+ toast: j,
7
+ topRow: O,
8
+ bottomRow: P,
9
+ iconContainer: $,
10
+ content: H,
11
+ small2Bold: L,
12
+ small5Regular: W,
13
+ bodyBold: q,
14
+ small2Medium: G,
15
+ title6Bold: J,
16
+ bodyMedium: K,
17
+ actionButton: Q,
18
+ type_brand: U,
19
+ type_info: X,
20
+ type_new: Y,
21
+ type_pending: Z,
22
+ type_positive: S,
23
+ type_warning: V,
24
+ type_negative: z,
25
+ closeButton: oo,
26
+ progressBar: ro,
27
+ progressBarShrink: to,
28
+ entering: eo,
29
+ staticToastIn: ao,
30
+ exiting: so,
31
+ staticToastOut: no,
32
+ body: lo
33
+ }, po = ({
34
+ type: i = "info",
35
+ title: y,
36
+ body: v,
37
+ size: s = "small",
38
+ icon: E,
39
+ isVisible: m = !0,
40
+ closable: A = !0,
41
+ onClose: g,
42
+ autoClose: u = !1,
43
+ duration: d = 5e3,
44
+ className: N,
45
+ style: M,
46
+ action: p
47
+ }) => {
48
+ const [c, f] = R(m), [_, C] = R(!1);
49
+ x(() => {
50
+ m ? (C(!1), f(!0)) : c && b();
51
+ }, [m]), x(() => {
52
+ if (u && c && !_ && d > 0) {
53
+ const l = setTimeout(() => {
54
+ b();
55
+ }, d);
56
+ return () => clearTimeout(l);
57
+ }
58
+ }, [c, d, u, _]);
59
+ const b = () => {
60
+ C(!0), setTimeout(() => {
61
+ f(!1), g == null || g();
62
+ }, 300);
63
+ }, e = {
64
+ small: "10px 8px",
65
+ medium: "14px 10px",
66
+ large: "14px 12px"
67
+ }, a = {
68
+ small: "18px",
69
+ medium: "20px",
70
+ large: "24px"
71
+ }, T = {
72
+ small: { title: "small2Bold", body: "small5Regular" },
73
+ medium: { title: "bodyBold", body: "small2Medium" },
74
+ large: { title: "title6Bold", body: "bodyMedium" }
75
+ }, h = (l, o) => {
76
+ switch (l) {
77
+ case "brand":
78
+ return {
79
+ borderColor: "var(--Badge-Toasts-Stroke, #2054A5)",
80
+ background: "var(--Badge-Toasts-Fill, #FFF)",
81
+ padding: e[o],
82
+ borderRadius: a[o]
83
+ };
84
+ case "info":
85
+ return {
86
+ borderColor: "var(--Badge-Toasts-Stroke, #2054A5)",
87
+ background: "var(--Badge-Toasts-Fill, #E0E9F8)",
88
+ padding: e[o],
89
+ borderRadius: a[o]
90
+ };
91
+ case "new":
92
+ return {
93
+ borderColor: "var(--Badge-Toasts-Stroke, #0F93A8)",
94
+ background: "var(--Badge-Toasts-Fill, #D6F4F8)",
95
+ padding: e[o],
96
+ borderRadius: a[o]
97
+ };
98
+ case "pending":
99
+ return {
100
+ borderColor: "var(--Badge-Toasts-Stroke, #CA8A04)",
101
+ background: "var(--Badge-Toasts-Fill, #FEF9C3)",
102
+ padding: e[o],
103
+ borderRadius: a[o]
104
+ };
105
+ case "positive":
106
+ return {
107
+ borderColor: "var(--Badge-Toasts-Stroke, #65A30D)",
108
+ background: "var(--Badge-Toasts-Fill, #ECFCCB)",
109
+ padding: e[o],
110
+ borderRadius: a[o]
111
+ };
112
+ case "warning":
113
+ return {
114
+ borderColor: "var(--Badge-Toasts-Stroke, #EA580C)",
115
+ background: "var(--Badge-Toasts-Fill, #FFEDD5)",
116
+ padding: e[o],
117
+ borderRadius: a[o]
118
+ };
119
+ case "negative":
120
+ return {
121
+ borderColor: "var(--Badge-Toasts-Stroke, #DC2626)",
122
+ background: "var(--Badge-Toasts-Fill, #FEE2E2)",
123
+ padding: e[o],
124
+ borderRadius: a[o]
125
+ };
126
+ default:
127
+ return {
128
+ borderColor: "var(--Badge-Toasts-Stroke, #2054A5)",
129
+ background: "var(--Badge-Toasts-Fill, #E0E9F8)",
130
+ padding: e[o],
131
+ borderRadius: a[o]
132
+ };
133
+ }
134
+ }, k = (l, o) => {
135
+ const F = h(l, o).borderColor.match(/#([0-9A-Fa-f]{6})/);
136
+ return F ? F[0] : null;
137
+ };
138
+ if (!c) return null;
139
+ const I = [
140
+ r.toast,
141
+ r[`type_${i}`],
142
+ _ ? r.exiting : r.entering,
143
+ N
144
+ ].filter(Boolean).join(" "), n = h(i, s);
145
+ return /* @__PURE__ */ B(
146
+ "div",
147
+ {
148
+ className: I,
149
+ style: {
150
+ border: "1px solid " + n.borderColor,
151
+ background: n.background,
152
+ padding: n.padding,
153
+ borderRadius: n.borderRadius,
154
+ ...M
155
+ },
156
+ role: "alert",
157
+ "aria-live": "polite",
158
+ children: [
159
+ /* @__PURE__ */ B("div", { className: r.topRow, children: [
160
+ /* @__PURE__ */ t("div", { className: r.iconContainer, children: /* @__PURE__ */ t(
161
+ w,
162
+ {
163
+ name: E || "Info",
164
+ fill: k(i, s) || "#2054A5",
165
+ width: 25,
166
+ height: 25
167
+ }
168
+ ) }),
169
+ /* @__PURE__ */ B("div", { className: r.content, children: [
170
+ y && /* @__PURE__ */ t("div", { className: r[T[s].title], children: y }),
171
+ v && /* @__PURE__ */ t(
172
+ "div",
173
+ {
174
+ className: r[T[s].body],
175
+ style: { color: n.borderColor },
176
+ children: v
177
+ }
178
+ )
179
+ ] }),
180
+ A && /* @__PURE__ */ t(
181
+ "button",
182
+ {
183
+ className: r.closeButton,
184
+ style: {
185
+ borderLeft: "1px solid " + n.borderColor
186
+ },
187
+ onClick: b,
188
+ "aria-label": "Cerrar notificación",
189
+ children: /* @__PURE__ */ t(
190
+ w,
191
+ {
192
+ name: "CancelIcon",
193
+ fill: k(i, s) || "#2054A5",
194
+ width: 20,
195
+ height: 20
196
+ }
197
+ )
198
+ }
199
+ )
200
+ ] }),
201
+ p && /* @__PURE__ */ t("div", { className: r.bottomRow, children: /* @__PURE__ */ t(
202
+ D,
203
+ {
204
+ onClick: p.function,
205
+ variant: "outline",
206
+ size: s,
207
+ className: r.actionButton,
208
+ fullWidth: !0,
209
+ children: p.label
210
+ }
211
+ ) }),
212
+ u && d > 0 && /* @__PURE__ */ t(
213
+ "div",
214
+ {
215
+ className: r.progressBar,
216
+ style: {
217
+ animationDuration: `${d}ms`,
218
+ animationPlayState: _ ? "paused" : "running"
219
+ }
220
+ }
221
+ )
222
+ ]
223
+ }
224
+ );
225
+ };
226
+ export {
227
+ po as StaticToast
228
+ };
@@ -0,0 +1,2 @@
1
+ export { StaticToast } from './StaticToast';
2
+ export type { StaticToastProps, StaticToastType, StaticToastSize, } from './StaticToast';
@@ -0,0 +1,4 @@
1
+ import { StaticToast as a } from "./StaticToast.js";
2
+ export {
3
+ a as StaticToast
4
+ };
package/dist/main.d.ts CHANGED
@@ -17,6 +17,7 @@ export { Stepper } from './components/stepper';
17
17
  export { Tab } from './components/tab';
18
18
  export { TabGroup } from './components/tab/tabGroup';
19
19
  export { Toast } from './components/Toast';
20
+ export { StaticToast } from './components/StaticToast';
20
21
  export { Modal } from './components/modal';
21
22
  export { Tooltip } from './components/tooltip';
22
23
  export { useScrollLock } from './hooks/useScrollLock';
@@ -42,5 +43,6 @@ export type { SelectProps, SelectSize, SelectOption, } from './components/Select
42
43
  export type { SpinnerProps, SpinnerColor } from './components/Spinner';
43
44
  export type { Step } from './components/stepper';
44
45
  export type { ToastProps, ToastType, ToastPosition } from './components/Toast';
46
+ export type { StaticToastProps, StaticToastType, StaticToastSize, } from './components/StaticToast';
45
47
  export type { ModalProps } from './components/modal';
46
48
  export type { SearchableInputGroupProps, SearchableInputGroupField, } from './components/SearchableInputGroup';
package/dist/main.js CHANGED
@@ -5,8 +5,8 @@ import { ButtonGroup as a } from "./components/ButtonGroup/ButtonGroup.js";
5
5
  import { Dialog as u } from "./components/Dialog/Dialog.js";
6
6
  import { FileUpload as c } from "./components/FileUpload/FileUpload.js";
7
7
  import { CompactFileUpload as s } from "./components/FileUpload/CompactFileUpload.js";
8
- import { Input as d } from "./components/Input/Input.js";
9
- import { Checkbox as S } from "./components/Input/Checkbox/Checkbox.js";
8
+ import { Input as S } from "./components/Input/Input.js";
9
+ import { Checkbox as d } from "./components/Input/Checkbox/Checkbox.js";
10
10
  import { RadioButton as b } from "./components/Input/RadioButton/RadioButton.js";
11
11
  import { Navbar as h } from "./components/navbar/index.js";
12
12
  import { ProgressBar as F } from "./components/progressBar/index.js";
@@ -17,48 +17,50 @@ import { Stepper as E } from "./components/stepper/index.js";
17
17
  import { Tab as L } from "./components/tab/index.js";
18
18
  import { TabGroup as N } from "./components/tab/tabGroup/index.js";
19
19
  import { Toast as R } from "./components/Toast/Toast.js";
20
- import { Modal as q } from "./components/modal/index.js";
21
- import { Tooltip as z } from "./components/tooltip/index.js";
22
- import { useScrollLock as J } from "./hooks/useScrollLock.js";
23
- import { ScrollContainer as Q } from "./components/scrollContainer/index.js";
24
- import { FieldError as W } from "./components/fieldError/index.js";
25
- import { HelperText as Y } from "./components/helperText/index.js";
26
- import { Drawer as _ } from "./components/drawer/index.js";
27
- import { Sheet as oo } from "./components/sheet/index.js";
28
- import { useClose as eo } from "./hooks/useClose.js";
29
- import { useCloseOnBack as po } from "./hooks/useCloseOnBack.js";
30
- import { useBTC as mo } from "./hooks/btcContext/useBtcContext.js";
31
- import { BTCProvider as ao } from "./hooks/btcContext/btcProvider.js";
20
+ import { StaticToast as q } from "./components/StaticToast/StaticToast.js";
21
+ import { Modal as z } from "./components/modal/index.js";
22
+ import { Tooltip as J } from "./components/tooltip/index.js";
23
+ import { useScrollLock as Q } from "./hooks/useScrollLock.js";
24
+ import { ScrollContainer as W } from "./components/scrollContainer/index.js";
25
+ import { FieldError as Y } from "./components/fieldError/index.js";
26
+ import { HelperText as _ } from "./components/helperText/index.js";
27
+ import { Drawer as oo } from "./components/drawer/index.js";
28
+ import { Sheet as eo } from "./components/sheet/index.js";
29
+ import { useClose as po } from "./hooks/useClose.js";
30
+ import { useCloseOnBack as mo } from "./hooks/useCloseOnBack.js";
31
+ import { useBTC as ao } from "./hooks/btcContext/useBtcContext.js";
32
+ import { BTCProvider as uo } from "./hooks/btcContext/btcProvider.js";
32
33
  import './assets/main.css';export {
33
- ao as BTCProvider,
34
+ uo as BTCProvider,
34
35
  p as Badge,
35
36
  m as Button,
36
37
  a as ButtonGroup,
37
- S as Checkbox,
38
+ d as Checkbox,
38
39
  s as CompactFileUpload,
39
40
  u as Dialog,
40
- _ as Drawer,
41
- W as FieldError,
41
+ oo as Drawer,
42
+ Y as FieldError,
42
43
  c as FileUpload,
43
- Y as HelperText,
44
+ _ as HelperText,
44
45
  e as Icon,
45
- d as Input,
46
- q as Modal,
46
+ S as Input,
47
+ z as Modal,
47
48
  h as Navbar,
48
49
  F as ProgressBar,
49
50
  b as RadioButton,
50
- Q as ScrollContainer,
51
+ W as ScrollContainer,
51
52
  D as SearchableInputGroup,
52
53
  I as Select,
53
- oo as Sheet,
54
+ eo as Sheet,
54
55
  U as Spinner,
56
+ q as StaticToast,
55
57
  E as Stepper,
56
58
  L as Tab,
57
59
  N as TabGroup,
58
60
  R as Toast,
59
- z as Tooltip,
60
- mo as useBTC,
61
- eo as useClose,
62
- po as useCloseOnBack,
63
- J as useScrollLock
61
+ J as Tooltip,
62
+ ao as useBTC,
63
+ po as useClose,
64
+ mo as useCloseOnBack,
65
+ Q as useScrollLock
64
66
  };
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.8.6",
4
+ "version": "2.8.7",
5
5
  "author": "BMI Ahorro España",
6
6
  "contributors": [
7
7
  "José Ramón Jiménez <jrjimenez@bmicos.com>",