@ledgerhq/lumen-ui-react 0.1.61 → 0.1.62

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.
Files changed (83) hide show
  1. package/dist/index.js +79 -62
  2. package/dist/lib/Components/core/AmountInput/AmountInput.js +16 -16
  3. package/dist/lib/Components/core/AmountInput/useAmountInputValue/useAmountInputValue.js +3 -3
  4. package/dist/lib/Components/core/Avatar/resolveAvatarColor.js +2 -2
  5. package/dist/lib/Components/core/AvatarButton/AvatarButton.js +6 -6
  6. package/dist/lib/Components/core/Banner/Banner.js +8 -8
  7. package/dist/lib/Components/core/Button/Button.js +10 -10
  8. package/dist/lib/Components/core/Card/Card.js +6 -6
  9. package/dist/lib/Components/core/CardButton/CardButton.d.ts +2 -0
  10. package/dist/lib/Components/core/CardButton/CardButton.d.ts.map +1 -1
  11. package/dist/lib/Components/core/CardButton/CardButton.js +4 -4
  12. package/dist/lib/Components/core/DataTable/DataTable.js +7 -7
  13. package/dist/lib/Components/core/Divider/Divider.js +8 -8
  14. package/dist/lib/Components/core/DotCount/DotCount.js +3 -3
  15. package/dist/lib/Components/core/DotIcon/DotIcon.js +9 -9
  16. package/dist/lib/Components/core/DotSymbol/DotSymbol.js +16 -16
  17. package/dist/lib/Components/core/Link/Link.d.ts +1 -1
  18. package/dist/lib/Components/core/Link/Link.d.ts.map +1 -1
  19. package/dist/lib/Components/core/Link/Link.js +21 -20
  20. package/dist/lib/Components/core/Link/types.d.ts +1 -1
  21. package/dist/lib/Components/core/Link/types.d.ts.map +1 -1
  22. package/dist/lib/Components/core/ListItem/ListItem.js +4 -4
  23. package/dist/lib/Components/core/MediaBanner/MediaBanner.js +19 -19
  24. package/dist/lib/Components/core/MediaButton/MediaButton.js +2 -2
  25. package/dist/lib/Components/core/Menu/Menu.js +30 -30
  26. package/dist/lib/Components/core/NavBar/CoinCapsule.js +8 -8
  27. package/dist/lib/Components/core/Pagination/Pagination.js +14 -14
  28. package/dist/lib/Components/core/Popover/Popover.js +6 -6
  29. package/dist/lib/Components/core/SearchInput/SearchInput.js +5 -5
  30. package/dist/lib/Components/core/SegmentedControl/SegmentedControl.js +19 -19
  31. package/dist/lib/Components/core/Select/Select.js +8 -8
  32. package/dist/lib/Components/core/SideBar/SideBar.js +14 -14
  33. package/dist/lib/Components/core/Spinner/Spinner.js +4 -4
  34. package/dist/lib/Components/core/Spot/Spot.js +9 -9
  35. package/dist/lib/Components/core/Stepper/Stepper.d.ts +4 -3
  36. package/dist/lib/Components/core/Stepper/Stepper.d.ts.map +1 -1
  37. package/dist/lib/Components/core/Stepper/Stepper.js +137 -65
  38. package/dist/lib/Components/core/Stepper/types.d.ts +12 -2
  39. package/dist/lib/Components/core/Stepper/types.d.ts.map +1 -1
  40. package/dist/lib/Components/core/Switch/Switch.js +5 -5
  41. package/dist/lib/Components/core/Table/Table.js +9 -9
  42. package/dist/lib/Components/core/TileButton/TileButton.js +8 -8
  43. package/dist/lib/Components/core/Timeline/Timeline.d.ts +54 -0
  44. package/dist/lib/Components/core/Timeline/Timeline.d.ts.map +1 -0
  45. package/dist/lib/Components/core/Timeline/Timeline.js +228 -0
  46. package/dist/lib/Components/core/Timeline/index.d.ts +3 -0
  47. package/dist/lib/Components/core/Timeline/index.d.ts.map +1 -0
  48. package/dist/lib/Components/core/Timeline/types.d.ts +148 -0
  49. package/dist/lib/Components/core/Timeline/types.d.ts.map +1 -0
  50. package/dist/lib/Components/core/Toast/Toast.d.ts +25 -0
  51. package/dist/lib/Components/core/Toast/Toast.d.ts.map +1 -0
  52. package/dist/lib/Components/core/Toast/Toast.js +68 -0
  53. package/dist/lib/Components/core/Toast/Toaster.d.ts +27 -0
  54. package/dist/lib/Components/core/Toast/Toaster.d.ts.map +1 -0
  55. package/dist/lib/Components/core/Toast/Toaster.js +92 -0
  56. package/dist/lib/Components/core/Toast/hooks/useToastCollapse.d.ts +15 -0
  57. package/dist/lib/Components/core/Toast/hooks/useToastCollapse.d.ts.map +1 -0
  58. package/dist/lib/Components/core/Toast/hooks/useToastCollapse.js +15 -0
  59. package/dist/lib/Components/core/Toast/hooks/useToastViewportPause.d.ts +24 -0
  60. package/dist/lib/Components/core/Toast/hooks/useToastViewportPause.d.ts.map +1 -0
  61. package/dist/lib/Components/core/Toast/hooks/useToastViewportPause.js +27 -0
  62. package/dist/lib/Components/core/Toast/index.d.ts +5 -0
  63. package/dist/lib/Components/core/Toast/index.d.ts.map +1 -0
  64. package/dist/lib/Components/core/Toast/styles.d.ts +20 -0
  65. package/dist/lib/Components/core/Toast/styles.d.ts.map +1 -0
  66. package/dist/lib/Components/core/Toast/styles.js +77 -0
  67. package/dist/lib/Components/core/Toast/types.d.ts +81 -0
  68. package/dist/lib/Components/core/Toast/types.d.ts.map +1 -0
  69. package/dist/lib/Components/core/Trend/Trend.js +2 -2
  70. package/dist/lib/Components/core/index.d.ts +2 -0
  71. package/dist/lib/Components/core/index.d.ts.map +1 -1
  72. package/dist/lib/Components/internal/BaseButton/BaseButton.js +2 -2
  73. package/dist/lib/Components/internal/BaseInput/BaseInput.js +9 -9
  74. package/dist/lib/Components/internal/BaseInput/BaseInputMultiline.js +12 -12
  75. package/dist/lib/Components/internal/BaseTag/BaseTag.js +8 -8
  76. package/dist/lib/Components/symbols/Icon/Icon.js +4 -4
  77. package/dist/lib/Components/symbols/Icon/createIcon.js +8 -8
  78. package/dist/lib/Components/visualization/DonutChart/DonutChartCenter.js +6 -6
  79. package/dist/lib/Components/visualization/DonutChart/donutSizeContext.js +2 -2
  80. package/dist/lib/Components/visualization/Legend/Legend.js +8 -8
  81. package/dist/libs/utils-shared/dist/index.js +306 -141
  82. package/dist/package.json +1 -1
  83. package/package.json +3 -3
@@ -1,44 +1,44 @@
1
- import { jsx as L } from "react/jsx-runtime";
2
- import { useMemo as M, createContext as W, useRef as q, useContext as I } from "react";
3
- import { clsx as N } from "clsx";
4
- import { twMerge as F } from "tailwind-merge";
5
- function K(e) {
1
+ import { jsx as K } from "react/jsx-runtime";
2
+ import { useMemo as W, createContext as G, useRef as y, useEffect as I, useContext as V } from "react";
3
+ import { clsx as X } from "clsx";
4
+ import { twMerge as Y } from "tailwind-merge";
5
+ function H(e) {
6
6
  let t = 0;
7
7
  for (let r = 0; r < e.length; r++)
8
8
  t = Math.imul(t, 31) + e.charCodeAt(r) | 0;
9
9
  return t;
10
10
  }
11
- const z = {
11
+ const J = {
12
12
  md: { max: 48, min: 17, scale: 2, startAt: 0 },
13
13
  sm: { max: 28, min: 12, scale: 2, startAt: 6 }
14
14
  };
15
- function ne(e, t = "md") {
16
- const { max: r, min: l, scale: a, startAt: o } = z[t], n = e.replace(/\D/g, "").length;
17
- return Math.max(l, r - Math.max(0, n - o) * a);
15
+ function Se(e, t = "md") {
16
+ const { max: r, min: n, scale: a, startAt: s } = J[t], o = e.replace(/\D/g, "").length;
17
+ return Math.max(n, r - Math.max(0, o - s) * a);
18
18
  }
19
- function B(e, t = !0) {
19
+ function Q(e, t = !0) {
20
20
  if (!e) return "";
21
- const r = e.includes("."), [l, a] = e.split("."), o = l.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
22
- return r && t ? a ? `${o}.${a}` : `${o}.` : o;
21
+ const r = e.includes("."), [n, a] = e.split("."), s = n.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
22
+ return r && t ? a ? `${s}.${a}` : `${s}.` : s;
23
23
  }
24
- const V = (e) => e.replaceAll(",", ".").replaceAll(/[^\d.]/g, ""), Y = (e) => e.replace(/^0+(?=\d)/, ""), D = (e, t) => t > 0 ? e.slice(0, t) : e, _ = (e, t) => D(e.replaceAll(/\D/g, ""), t), G = (e, t, r) => {
24
+ const Z = (e) => e.replaceAll(",", ".").replaceAll(/[^\d.]/g, ""), ee = (e) => e.replace(/^0+(?=\d)/, ""), S = (e, t) => t > 0 ? e.slice(0, t) : e, te = (e, t) => S(e.replaceAll(/\D/g, ""), t), re = (e, t, r) => {
25
25
  if (e === ".") return "0.";
26
- const l = e.indexOf(".");
27
- if (l === -1) return D(e, t);
28
- const a = D(e.slice(0, l), t) || "0", o = e.slice(l + 1).replaceAll(".", "").slice(0, r);
29
- return o.length > 0 ? `${a}.${o}` : e.endsWith(".") ? `${a}.` : a;
26
+ const n = e.indexOf(".");
27
+ if (n === -1) return S(e, t);
28
+ const a = S(e.slice(0, n), t) || "0", s = e.slice(n + 1).replaceAll(".", "").slice(0, r);
29
+ return s.length > 0 ? `${a}.${s}` : e.endsWith(".") ? `${a}.` : a;
30
30
  };
31
- function le(e, t = {}) {
31
+ function Oe(e, t = {}) {
32
32
  const {
33
33
  allowDecimals: r = !0,
34
- thousandsSeparator: l = !0,
34
+ thousandsSeparator: n = !0,
35
35
  maxIntegerLength: a = 9,
36
- maxDecimalLength: o = 9,
37
- decimalSeparator: n = "."
38
- } = t, i = Y(V(e)), u = r ? G(i, a, o) : _(i, a), f = l ? B(u) : u;
39
- return n === "." ? f : f.replaceAll(".", n);
36
+ maxDecimalLength: s = 9,
37
+ decimalSeparator: o = "."
38
+ } = t, i = ee(Z(e)), l = r ? re(i, a, s) : te(i, a), c = n ? Q(l) : l;
39
+ return o === "." ? c : c.replaceAll(".", o);
40
40
  }
41
- const A = [
41
+ const P = [
42
42
  "orange",
43
43
  "green",
44
44
  "blue",
@@ -48,105 +48,103 @@ const A = [
48
48
  "turquoise",
49
49
  "pink"
50
50
  ];
51
- function ae(e) {
52
- const t = (K(e) % A.length + A.length) % A.length;
53
- return A[t];
51
+ function Ie(e) {
52
+ const t = (H(e) % P.length + P.length) % P.length;
53
+ return P[t];
54
54
  }
55
- function H(e, t) {
55
+ function ne(e, t) {
56
56
  if (Object.is(e, t)) return !0;
57
- const r = e, l = t, a = Object.keys(r), o = Object.keys(l);
58
- return a.length !== o.length ? !1 : a.every(
59
- (n) => Object.prototype.hasOwnProperty.call(l, n) && Object.is(r[n], l[n])
57
+ const r = e, n = t, a = Object.keys(r), s = Object.keys(n);
58
+ return a.length !== s.length ? !1 : a.every(
59
+ (o) => Object.prototype.hasOwnProperty.call(n, o) && Object.is(r[o], n[o])
60
60
  );
61
61
  }
62
- function J(e, t) {
63
- const r = W(t), l = ({ children: o, value: n }) => {
64
- const i = q(n);
65
- return H(i.current, n) || (i.current = n), /* @__PURE__ */ L(r.Provider, { value: i.current, children: o });
62
+ function ae(e, t) {
63
+ const r = G(t), n = ({ children: s, value: o }) => {
64
+ const i = y(o);
65
+ return ne(i.current, o) || (i.current = o), /* @__PURE__ */ K(r.Provider, { value: i.current, children: s });
66
66
  };
67
- l.displayName = e + "Provider";
67
+ n.displayName = e + "Provider";
68
68
  function a({
69
- consumerName: o,
70
- contextRequired: n
69
+ consumerName: s,
70
+ contextRequired: o
71
71
  }) {
72
- const i = I(r);
72
+ const i = V(r);
73
73
  if (i)
74
74
  return i;
75
- if (n)
75
+ if (o)
76
76
  throw new Error(
77
- `${o} must be used within ${e}`
77
+ `${s} must be used within ${e}`
78
78
  );
79
79
  return t || {};
80
80
  }
81
- return [l, a];
81
+ return [n, a];
82
82
  }
83
- const [oe, Q] = J("Disabled", { disabled: !1 }), ie = ({
83
+ const [Ce, se] = ae("Disabled", { disabled: !1 }), ke = ({
84
84
  consumerName: e,
85
85
  contextRequired: t,
86
86
  mergeWith: r
87
87
  }) => {
88
- const l = Q({
88
+ const n = se({
89
89
  consumerName: e,
90
90
  contextRequired: t ?? !1
91
91
  });
92
- return !!(r?.disabled || l.disabled);
92
+ return !!(r?.disabled || n.disabled);
93
93
  };
94
- function se(...e) {
95
- return F(N(e));
94
+ function Ee(...e) {
95
+ return Y(X(e));
96
96
  }
97
- const w = (e) => typeof e == "string" || typeof e == "number", ue = (e) => Array.isArray(e) ? e.every(w) : w(e);
98
- function S(e, t) {
97
+ const k = (e) => typeof e == "string" || typeof e == "number", Re = (e) => Array.isArray(e) ? e.every(k) : k(e);
98
+ function E(e, t) {
99
99
  if (typeof e == "function")
100
100
  return e(t);
101
101
  typeof e == "object" && e !== null && "current" in e && (e.current = t);
102
102
  }
103
- function U(...e) {
103
+ function oe(...e) {
104
104
  const t = /* @__PURE__ */ new Map();
105
105
  return (r) => {
106
106
  if (r === null) {
107
- e.forEach((l) => {
108
- const a = t.get(l);
109
- typeof a == "function" && a(), S(l, null);
107
+ e.forEach((n) => {
108
+ const a = t.get(n);
109
+ typeof a == "function" && a(), E(n, null);
110
110
  }), t.clear();
111
111
  return;
112
112
  }
113
- e.forEach((l) => {
114
- const a = S(l, r);
115
- typeof a == "function" && t.set(l, a);
113
+ e.forEach((n) => {
114
+ const a = E(n, r);
115
+ typeof a == "function" && t.set(n, a);
116
116
  });
117
117
  };
118
118
  }
119
- function ce(...e) {
120
- return M(() => U(...e), e);
119
+ function Ne(...e) {
120
+ return W(() => oe(...e), e);
121
121
  }
122
- function de(e) {
122
+ function je(e) {
123
123
  return function(t, r) {
124
124
  return e[t][r];
125
125
  };
126
126
  }
127
- const fe = ({
127
+ const We = ({
128
128
  currentStep: e,
129
129
  totalSteps: t,
130
130
  size: r,
131
- label: l,
132
- strokeWidth: a = 4,
133
- arcPercentage: o = 0.75
131
+ label: n,
132
+ strokeWidth: a = 4
134
133
  }) => {
135
- const n = Math.min(Math.max(e, 0), t), i = l ?? `${n}/${t}`, u = t <= 0 ? 0 : n / t, f = (r - a) / 2, p = r / 2, h = r / 2, c = 2 * Math.PI * f, m = c * o, b = m * (1 - u), g = n <= 0, v = `${m} ${c}`, P = g ? m - 2 : b;
134
+ const s = Math.min(Math.max(e, 0), t), o = n ?? `${s}/${t}`, i = t <= 0 ? 0 : s / t, l = (r - a) / 2, c = r / 2, g = r / 2, p = 2 * Math.PI * l, m = t <= 1 ? 0 : 12 / 360 * p + a, h = t <= 1 ? p : Math.max(p / t - m, 0), A = `${h} ${m}`, x = `${p} ${p}`, M = p * (1 - i), v = h + m / 2;
136
135
  return {
137
- displayLabel: i,
138
- progress: u,
139
- r: f,
140
- cx: p,
141
- cy: h,
142
- circumference: c,
143
- trackArcLength: m,
144
- trackDashArray: `${m} ${c}`,
145
- progressDashArray: v,
146
- progressDashOffset: P,
147
- showMinimalDot: g
136
+ displayLabel: o,
137
+ progress: i,
138
+ r: l,
139
+ cx: c,
140
+ cy: g,
141
+ circumference: p,
142
+ progressDashArray: A,
143
+ progressMaskDashArray: x,
144
+ progressDashOffset: M,
145
+ dashPatternOffset: v
148
146
  };
149
- }, me = (e) => M(
147
+ }, Le = (e) => W(
150
148
  () => ({
151
149
  integerPart: Array.from(e.integerPart, (t) => ({
152
150
  value: t,
@@ -158,57 +156,215 @@ const fe = ({
158
156
  })) : []
159
157
  }),
160
158
  [e.integerPart, e.decimalPart]
161
- ), pe = (e, t, r) => {
159
+ ), Fe = (e, t, r) => {
162
160
  if (t) return r;
163
- const l = e.decimalPart ? `${e.decimalSeparator}${e.decimalPart}` : "", a = `${e.integerPart}${l}`;
161
+ const n = e.decimalPart ? `${e.decimalSeparator}${e.decimalPart}` : "", a = `${e.integerPart}${n}`;
164
162
  return e.currencyPosition === "end" ? `${a} ${e.currencyText}` : `${e.currencyText} ${a}`;
165
163
  };
166
- function Z(e, t, r = {}) {
167
- const { leading: l = !1, trailing: a = !0, maxWait: o } = r;
168
- let n = null, i = null, u = null, f = 0, p = null, h = null, c;
169
- const m = o !== void 0, b = m ? Math.max(o, t) : 0, g = (s) => {
170
- f = s;
171
- const d = p ?? [], x = h;
172
- return p = null, h = null, c = e.apply(x, d), c;
173
- }, v = (s) => {
174
- const d = u ? s - u : 0;
175
- return t - d;
176
- }, P = (s) => {
177
- const d = u ? s - u : t, x = s - f;
178
- return u === null || d >= t || d < 0 || m && x >= b;
179
- }, T = (s) => (n = null, a && p ? g(s) : (p = null, h = null, c)), y = () => {
180
- const s = Date.now();
181
- if (P(s)) {
182
- T(s);
164
+ let R = 0;
165
+ const ie = {
166
+ info: 5e3,
167
+ success: 5e3,
168
+ warning: 0,
169
+ error: 0
170
+ }, le = 3, L = [], qe = (e) => Number.isInteger(e) && e >= 1 ? e : le, Be = (e, t) => {
171
+ if (e.duration !== void 0)
172
+ return e.duration === 0 ? 1 / 0 : e.duration;
173
+ if (e.loading) return 1 / 0;
174
+ const r = t?.[e.appearance] ?? ie[e.appearance];
175
+ return r === 0 ? 1 / 0 : r;
176
+ }, ue = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : (R += 1, `toast-${Date.now()}-${R}`), ce = (e, t) => ({
177
+ id: e,
178
+ appearance: t.appearance ?? "info",
179
+ loading: t.loading ?? !1,
180
+ title: t.title,
181
+ duration: t.duration,
182
+ dismissible: t.dismissible ?? !0,
183
+ action: t.action
184
+ }), de = (e) => {
185
+ const t = {};
186
+ for (const r of Object.keys(e))
187
+ (e[r] !== void 0 || r === "action") && Object.assign(t, { [r]: e[r] });
188
+ return t;
189
+ };
190
+ let d = L;
191
+ const O = /* @__PURE__ */ new Set();
192
+ let $ = 0;
193
+ const D = () => {
194
+ for (const e of O) e();
195
+ }, pe = (e) => (O.add(e), () => O.delete(e)), fe = () => d, me = () => L, ge = (e) => {
196
+ const t = ue();
197
+ return d = [...d, ce(t, e)], D(), t;
198
+ }, he = (e, t) => {
199
+ const r = d.findIndex((o) => o.id === e);
200
+ if (r === -1) return;
201
+ const n = de(t), a = n.duration !== void 0 || n.loading !== void 0 || n.appearance !== void 0, s = {
202
+ ...d[r],
203
+ ...n,
204
+ ...a && { duration: n.duration }
205
+ };
206
+ d = d.map((o, i) => i === r ? s : o), D();
207
+ }, ye = (e) => {
208
+ const t = d.findIndex((r) => r.id === e);
209
+ t !== -1 && (d = d[t].exiting ? d.filter((r) => r.id !== e) : d.map(
210
+ (r) => r.id === e ? { ...r, exiting: !0 } : r
211
+ ), D());
212
+ }, xe = () => {
213
+ d.length !== 0 && (d = d.map((e) => ({ ...e, exiting: !0 })), D());
214
+ }, be = () => ($ += 1, $ > 1 && console.warn(
215
+ `[Toaster] ${$} <Toaster /> instances are mounted at once. Every toast will render once per instance. Mount a single <Toaster /> for the whole app.`
216
+ ), () => {
217
+ $ -= 1;
218
+ }), F = {
219
+ subscribe: pe,
220
+ getSnapshot: fe,
221
+ getServerSnapshot: me,
222
+ registerRenderer: be,
223
+ add: ge,
224
+ update: he,
225
+ dismiss: ye,
226
+ dismissAll: xe
227
+ }, Ue = (e, t) => {
228
+ const r = y(/* @__PURE__ */ new Set());
229
+ return I(() => {
230
+ r.current = new Set(
231
+ e.filter(
232
+ (n, a) => a >= t || r.current.has(n.id)
233
+ ).map((n) => n.id)
234
+ ), e.slice(t).filter((n) => n.exiting).forEach((n) => F.dismiss(n.id));
235
+ }, [e, t]), (n) => r.current.has(n);
236
+ }, Te = ({
237
+ durationMs: e,
238
+ paused: t,
239
+ exiting: r,
240
+ onExpire: n
241
+ }) => {
242
+ const a = y(n);
243
+ a.current = n;
244
+ const s = y(e), o = y(e), i = y(null);
245
+ I(() => {
246
+ if (r || (e !== o.current && (o.current = e, s.current = e), t || !Number.isFinite(s.current))) return;
247
+ i.current = Date.now();
248
+ const l = setTimeout(
249
+ () => a.current(),
250
+ s.current
251
+ );
252
+ return () => {
253
+ clearTimeout(l), i.current !== null && (s.current -= Date.now() - i.current, i.current = null);
254
+ };
255
+ }, [t, r, e]);
256
+ }, Ae = 300, _e = ({
257
+ durationMs: e,
258
+ paused: t,
259
+ exiting: r,
260
+ onDismiss: n
261
+ }) => {
262
+ Te({ durationMs: e, paused: t, exiting: r, onExpire: n });
263
+ const a = y(n);
264
+ a.current = n, I(() => {
265
+ if (!r) return;
266
+ const s = setTimeout(
267
+ () => a.current(),
268
+ Ae
269
+ );
270
+ return () => clearTimeout(s);
271
+ }, [r]);
272
+ }, N = (e, t) => typeof e == "function" ? e(t) : e, ve = ({
273
+ add: e,
274
+ update: t,
275
+ dismiss: r,
276
+ dismissAll: n
277
+ }) => {
278
+ const a = (s) => ({
279
+ id: e(s)
280
+ });
281
+ return {
282
+ notify: a,
283
+ info: (s) => a({ ...s, appearance: "info" }),
284
+ success: (s) => a({ ...s, appearance: "success" }),
285
+ warning: (s) => a({ ...s, appearance: "warning" }),
286
+ error: (s) => a({ ...s, appearance: "error" }),
287
+ loading: (s) => a({ ...s, appearance: "info", loading: !0 }),
288
+ update: t,
289
+ dismiss: r,
290
+ dismissAll: n,
291
+ promise: (s, o) => {
292
+ const { id: i } = a({
293
+ ...o.loading,
294
+ appearance: "info",
295
+ loading: !0
296
+ });
297
+ return s.then(
298
+ (l) => {
299
+ const c = N(o.success, l);
300
+ t(i, {
301
+ ...c,
302
+ appearance: "success",
303
+ loading: !1,
304
+ action: c.action,
305
+ dismissible: c.dismissible ?? !0
306
+ });
307
+ },
308
+ (l) => {
309
+ const c = N(o.error, l);
310
+ t(i, {
311
+ ...c,
312
+ appearance: "error",
313
+ loading: !1,
314
+ action: c.action,
315
+ dismissible: c.dismissible ?? !0
316
+ });
317
+ }
318
+ ), { id: i };
319
+ }
320
+ };
321
+ }, ze = ve(F);
322
+ function we(e, t, r = {}) {
323
+ const { leading: n = !1, trailing: a = !0, maxWait: s } = r;
324
+ let o = null, i = null, l = null, c = 0, g = null, p = null, m;
325
+ const h = s !== void 0, A = h ? Math.max(s, t) : 0, x = (u) => {
326
+ c = u;
327
+ const f = g ?? [], T = p;
328
+ return g = null, p = null, m = e.apply(T, f), m;
329
+ }, M = (u) => {
330
+ const f = l ? u - l : 0;
331
+ return t - f;
332
+ }, v = (u) => {
333
+ const f = l ? u - l : t, T = u - c;
334
+ return l === null || f >= t || f < 0 || h && T >= A;
335
+ }, C = (u) => (o = null, a && g ? x(u) : (g = null, p = null, m)), b = () => {
336
+ const u = Date.now();
337
+ if (v(u)) {
338
+ C(u);
183
339
  return;
184
340
  }
185
- n = setTimeout(y, v(s));
186
- }, k = () => {
187
- const s = Date.now();
188
- i = null, p && (g(s), n !== null && (clearTimeout(n), n = setTimeout(y, t)));
189
- }, O = (s) => (f = s, n = setTimeout(y, t), m && (i = setTimeout(k, b)), l ? g(s) : c), R = () => {
190
- n !== null && clearTimeout(n), i !== null && clearTimeout(i), f = 0, p = null, h = null, u = null, n = null, i = null;
191
- }, j = () => n === null && i === null ? c : T(Date.now()), E = () => n !== null || i !== null, $ = function(...s) {
192
- const d = Date.now(), x = P(d);
193
- if (p = s, h = this, u = d, x) {
194
- if (n === null)
195
- return O(d);
196
- if (m)
197
- return clearTimeout(n), n = setTimeout(y, t), g(d);
341
+ o = setTimeout(b, M(u));
342
+ }, q = () => {
343
+ const u = Date.now();
344
+ i = null, g && (x(u), o !== null && (clearTimeout(o), o = setTimeout(b, t)));
345
+ }, B = (u) => (c = u, o = setTimeout(b, t), h && (i = setTimeout(q, A)), n ? x(u) : m), U = () => {
346
+ o !== null && clearTimeout(o), i !== null && clearTimeout(i), c = 0, g = null, p = null, l = null, o = null, i = null;
347
+ }, _ = () => o === null && i === null ? m : C(Date.now()), z = () => o !== null || i !== null, w = function(...u) {
348
+ const f = Date.now(), T = v(f);
349
+ if (g = u, p = this, l = f, T) {
350
+ if (o === null)
351
+ return B(f);
352
+ if (h)
353
+ return clearTimeout(o), o = setTimeout(b, t), x(f);
198
354
  }
199
- return n === null && (n = setTimeout(y, t)), c;
355
+ return o === null && (o = setTimeout(b, t)), m;
200
356
  };
201
- return $.cancel = R, $.flush = j, $.pending = E, $;
357
+ return w.cancel = U, w.flush = _, w.pending = z, w;
202
358
  }
203
- function he(e, t, r = {}) {
204
- const { leading: l = !0, trailing: a = !0 } = r;
205
- return Z(e, t, {
206
- leading: l,
359
+ function Ke(e, t, r = {}) {
360
+ const { leading: n = !0, trailing: a = !0 } = r;
361
+ return we(e, t, {
362
+ leading: n,
207
363
  trailing: a,
208
364
  maxWait: t
209
365
  });
210
366
  }
211
- const ge = ({
367
+ const Ge = ({
212
368
  onClick: e,
213
369
  disabled: t
214
370
  }) => e ? t ? {
@@ -222,41 +378,50 @@ const ge = ({
222
378
  (r.key === "Enter" || r.key === " ") && (r.preventDefault(), e?.(r));
223
379
  },
224
380
  onClick: e
225
- } : void 0, C = " ", ye = ({
381
+ } : void 0, j = " ", Ve = ({
226
382
  label: e,
227
383
  placeholder: t
228
384
  }) => {
229
385
  const r = typeof t == "string" && t.trim().length > 0 ? t : void 0;
230
386
  return e ? {
231
- inputPlaceholder: r ?? C,
387
+ inputPlaceholder: r ?? j,
232
388
  labelStaysFloatedWithPlaceholder: r !== void 0
233
389
  } : {
234
- inputPlaceholder: t ?? C,
390
+ inputPlaceholder: t ?? j,
235
391
  labelStaysFloatedWithPlaceholder: !1
236
392
  };
237
393
  };
238
394
  export {
239
- A as AVATAR_COLOR_KEYS,
240
- oe as DisabledProvider,
241
- S as assignRef,
242
- pe as buildAriaLabel,
243
- se as cn,
244
- de as createPropsResolver,
245
- J as createSafeContext,
246
- Z as debounce,
247
- B as formatThousands,
248
- ge as getButtonA11yProps,
249
- ne as getFontSize,
250
- fe as getStepperCalculations,
251
- K as hashString,
252
- ue as isTextChildren,
253
- U as mergeRefs,
254
- ae as resolveAvatarColorKey,
255
- ye as resolveBaseInputPlaceholder,
256
- H as shallowEqual,
257
- le as textFormatter,
258
- he as throttle,
259
- ie as useDisabledContext,
260
- ce as useMergedRef,
261
- me as useSplitText
395
+ P as AVATAR_COLOR_KEYS,
396
+ Ce as DisabledProvider,
397
+ Ae as EXIT_ANIMATION_MS,
398
+ E as assignRef,
399
+ Fe as buildAriaLabel,
400
+ Ee as cn,
401
+ je as createPropsResolver,
402
+ ae as createSafeContext,
403
+ ve as createToastController,
404
+ we as debounce,
405
+ Q as formatThousands,
406
+ Ge as getButtonA11yProps,
407
+ Se as getFontSize,
408
+ We as getStepperCalculations,
409
+ H as hashString,
410
+ Re as isTextChildren,
411
+ oe as mergeRefs,
412
+ Ie as resolveAvatarColorKey,
413
+ Ve as resolveBaseInputPlaceholder,
414
+ Be as resolveDurationMs,
415
+ qe as resolveMaxItems,
416
+ ne as shallowEqual,
417
+ Oe as textFormatter,
418
+ Ke as throttle,
419
+ ze as toast,
420
+ F as toastStore,
421
+ ke as useDisabledContext,
422
+ Ne as useMergedRef,
423
+ Le as useSplitText,
424
+ Ue as useToastBacklog,
425
+ _e as useToastLifecycle,
426
+ Te as useToastTimer
262
427
  };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react",
3
- "version": "0.1.60",
3
+ "version": "0.1.61",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "keywords": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react",
3
- "version": "0.1.61",
3
+ "version": "0.1.62",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "keywords": [
@@ -47,7 +47,7 @@
47
47
  ]
48
48
  },
49
49
  "dependencies": {
50
- "@ledgerhq/lumen-utils-shared": "0.1.14",
50
+ "@ledgerhq/lumen-utils-shared": "0.1.15",
51
51
  "@types/d3-scale": "^4.0.9",
52
52
  "@types/d3-shape": "^3.1.8",
53
53
  "d3-scale": "^4.0.2",
@@ -64,7 +64,7 @@
64
64
  "@radix-ui/react-tooltip": "^1.2.8",
65
65
  "class-variance-authority": "^0.7.1",
66
66
  "@tanstack/react-table": "^8.21.3",
67
- "@ledgerhq/lumen-design-core": "0.1.30",
67
+ "@ledgerhq/lumen-design-core": "0.1.31",
68
68
  "clsx": "^2.1.1",
69
69
  "react": "^18.0.0 || ^19.0.0",
70
70
  "react-dom": "^18.0.0 || ^19.0.0",