@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.
- package/dist/index.js +79 -62
- package/dist/lib/Components/core/AmountInput/AmountInput.js +16 -16
- package/dist/lib/Components/core/AmountInput/useAmountInputValue/useAmountInputValue.js +3 -3
- package/dist/lib/Components/core/Avatar/resolveAvatarColor.js +2 -2
- package/dist/lib/Components/core/AvatarButton/AvatarButton.js +6 -6
- package/dist/lib/Components/core/Banner/Banner.js +8 -8
- package/dist/lib/Components/core/Button/Button.js +10 -10
- package/dist/lib/Components/core/Card/Card.js +6 -6
- package/dist/lib/Components/core/CardButton/CardButton.d.ts +2 -0
- package/dist/lib/Components/core/CardButton/CardButton.d.ts.map +1 -1
- package/dist/lib/Components/core/CardButton/CardButton.js +4 -4
- package/dist/lib/Components/core/DataTable/DataTable.js +7 -7
- package/dist/lib/Components/core/Divider/Divider.js +8 -8
- package/dist/lib/Components/core/DotCount/DotCount.js +3 -3
- package/dist/lib/Components/core/DotIcon/DotIcon.js +9 -9
- package/dist/lib/Components/core/DotSymbol/DotSymbol.js +16 -16
- package/dist/lib/Components/core/Link/Link.d.ts +1 -1
- package/dist/lib/Components/core/Link/Link.d.ts.map +1 -1
- package/dist/lib/Components/core/Link/Link.js +21 -20
- package/dist/lib/Components/core/Link/types.d.ts +1 -1
- package/dist/lib/Components/core/Link/types.d.ts.map +1 -1
- package/dist/lib/Components/core/ListItem/ListItem.js +4 -4
- package/dist/lib/Components/core/MediaBanner/MediaBanner.js +19 -19
- package/dist/lib/Components/core/MediaButton/MediaButton.js +2 -2
- package/dist/lib/Components/core/Menu/Menu.js +30 -30
- package/dist/lib/Components/core/NavBar/CoinCapsule.js +8 -8
- package/dist/lib/Components/core/Pagination/Pagination.js +14 -14
- package/dist/lib/Components/core/Popover/Popover.js +6 -6
- package/dist/lib/Components/core/SearchInput/SearchInput.js +5 -5
- package/dist/lib/Components/core/SegmentedControl/SegmentedControl.js +19 -19
- package/dist/lib/Components/core/Select/Select.js +8 -8
- package/dist/lib/Components/core/SideBar/SideBar.js +14 -14
- package/dist/lib/Components/core/Spinner/Spinner.js +4 -4
- package/dist/lib/Components/core/Spot/Spot.js +9 -9
- package/dist/lib/Components/core/Stepper/Stepper.d.ts +4 -3
- package/dist/lib/Components/core/Stepper/Stepper.d.ts.map +1 -1
- package/dist/lib/Components/core/Stepper/Stepper.js +137 -65
- package/dist/lib/Components/core/Stepper/types.d.ts +12 -2
- package/dist/lib/Components/core/Stepper/types.d.ts.map +1 -1
- package/dist/lib/Components/core/Switch/Switch.js +5 -5
- package/dist/lib/Components/core/Table/Table.js +9 -9
- package/dist/lib/Components/core/TileButton/TileButton.js +8 -8
- package/dist/lib/Components/core/Timeline/Timeline.d.ts +54 -0
- package/dist/lib/Components/core/Timeline/Timeline.d.ts.map +1 -0
- package/dist/lib/Components/core/Timeline/Timeline.js +228 -0
- package/dist/lib/Components/core/Timeline/index.d.ts +3 -0
- package/dist/lib/Components/core/Timeline/index.d.ts.map +1 -0
- package/dist/lib/Components/core/Timeline/types.d.ts +148 -0
- package/dist/lib/Components/core/Timeline/types.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/Toast.d.ts +25 -0
- package/dist/lib/Components/core/Toast/Toast.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/Toast.js +68 -0
- package/dist/lib/Components/core/Toast/Toaster.d.ts +27 -0
- package/dist/lib/Components/core/Toast/Toaster.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/Toaster.js +92 -0
- package/dist/lib/Components/core/Toast/hooks/useToastCollapse.d.ts +15 -0
- package/dist/lib/Components/core/Toast/hooks/useToastCollapse.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/hooks/useToastCollapse.js +15 -0
- package/dist/lib/Components/core/Toast/hooks/useToastViewportPause.d.ts +24 -0
- package/dist/lib/Components/core/Toast/hooks/useToastViewportPause.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/hooks/useToastViewportPause.js +27 -0
- package/dist/lib/Components/core/Toast/index.d.ts +5 -0
- package/dist/lib/Components/core/Toast/index.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/styles.d.ts +20 -0
- package/dist/lib/Components/core/Toast/styles.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/styles.js +77 -0
- package/dist/lib/Components/core/Toast/types.d.ts +81 -0
- package/dist/lib/Components/core/Toast/types.d.ts.map +1 -0
- package/dist/lib/Components/core/Trend/Trend.js +2 -2
- package/dist/lib/Components/core/index.d.ts +2 -0
- package/dist/lib/Components/core/index.d.ts.map +1 -1
- package/dist/lib/Components/internal/BaseButton/BaseButton.js +2 -2
- package/dist/lib/Components/internal/BaseInput/BaseInput.js +9 -9
- package/dist/lib/Components/internal/BaseInput/BaseInputMultiline.js +12 -12
- package/dist/lib/Components/internal/BaseTag/BaseTag.js +8 -8
- package/dist/lib/Components/symbols/Icon/Icon.js +4 -4
- package/dist/lib/Components/symbols/Icon/createIcon.js +8 -8
- package/dist/lib/Components/visualization/DonutChart/DonutChartCenter.js +6 -6
- package/dist/lib/Components/visualization/DonutChart/donutSizeContext.js +2 -2
- package/dist/lib/Components/visualization/Legend/Legend.js +8 -8
- package/dist/libs/utils-shared/dist/index.js +306 -141
- package/dist/package.json +1 -1
- package/package.json +3 -3
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { clsx as
|
|
4
|
-
import { twMerge as
|
|
5
|
-
function
|
|
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
|
|
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
|
|
16
|
-
const { max: r, min:
|
|
17
|
-
return Math.max(
|
|
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
|
|
19
|
+
function Q(e, t = !0) {
|
|
20
20
|
if (!e) return "";
|
|
21
|
-
const r = e.includes("."), [
|
|
22
|
-
return r && t ? a ? `${
|
|
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
|
|
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
|
|
27
|
-
if (
|
|
28
|
-
const a =
|
|
29
|
-
return
|
|
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
|
|
31
|
+
function Oe(e, t = {}) {
|
|
32
32
|
const {
|
|
33
33
|
allowDecimals: r = !0,
|
|
34
|
-
thousandsSeparator:
|
|
34
|
+
thousandsSeparator: n = !0,
|
|
35
35
|
maxIntegerLength: a = 9,
|
|
36
|
-
maxDecimalLength:
|
|
37
|
-
decimalSeparator:
|
|
38
|
-
} = t, i =
|
|
39
|
-
return
|
|
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
|
|
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
|
|
52
|
-
const t = (
|
|
53
|
-
return
|
|
51
|
+
function Ie(e) {
|
|
52
|
+
const t = (H(e) % P.length + P.length) % P.length;
|
|
53
|
+
return P[t];
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function ne(e, t) {
|
|
56
56
|
if (Object.is(e, t)) return !0;
|
|
57
|
-
const r = e,
|
|
58
|
-
return a.length !==
|
|
59
|
-
(
|
|
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
|
|
63
|
-
const r =
|
|
64
|
-
const i =
|
|
65
|
-
return
|
|
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
|
-
|
|
67
|
+
n.displayName = e + "Provider";
|
|
68
68
|
function a({
|
|
69
|
-
consumerName:
|
|
70
|
-
contextRequired:
|
|
69
|
+
consumerName: s,
|
|
70
|
+
contextRequired: o
|
|
71
71
|
}) {
|
|
72
|
-
const i =
|
|
72
|
+
const i = V(r);
|
|
73
73
|
if (i)
|
|
74
74
|
return i;
|
|
75
|
-
if (
|
|
75
|
+
if (o)
|
|
76
76
|
throw new Error(
|
|
77
|
-
`${
|
|
77
|
+
`${s} must be used within ${e}`
|
|
78
78
|
);
|
|
79
79
|
return t || {};
|
|
80
80
|
}
|
|
81
|
-
return [
|
|
81
|
+
return [n, a];
|
|
82
82
|
}
|
|
83
|
-
const [
|
|
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
|
|
88
|
+
const n = se({
|
|
89
89
|
consumerName: e,
|
|
90
90
|
contextRequired: t ?? !1
|
|
91
91
|
});
|
|
92
|
-
return !!(r?.disabled ||
|
|
92
|
+
return !!(r?.disabled || n.disabled);
|
|
93
93
|
};
|
|
94
|
-
function
|
|
95
|
-
return
|
|
94
|
+
function Ee(...e) {
|
|
95
|
+
return Y(X(e));
|
|
96
96
|
}
|
|
97
|
-
const
|
|
98
|
-
function
|
|
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
|
|
103
|
+
function oe(...e) {
|
|
104
104
|
const t = /* @__PURE__ */ new Map();
|
|
105
105
|
return (r) => {
|
|
106
106
|
if (r === null) {
|
|
107
|
-
e.forEach((
|
|
108
|
-
const a = t.get(
|
|
109
|
-
typeof a == "function" && a(),
|
|
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((
|
|
114
|
-
const a =
|
|
115
|
-
typeof a == "function" && t.set(
|
|
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
|
|
120
|
-
return
|
|
119
|
+
function Ne(...e) {
|
|
120
|
+
return W(() => oe(...e), e);
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function je(e) {
|
|
123
123
|
return function(t, r) {
|
|
124
124
|
return e[t][r];
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
const
|
|
127
|
+
const We = ({
|
|
128
128
|
currentStep: e,
|
|
129
129
|
totalSteps: t,
|
|
130
130
|
size: r,
|
|
131
|
-
label:
|
|
132
|
-
strokeWidth: a = 4
|
|
133
|
-
arcPercentage: o = 0.75
|
|
131
|
+
label: n,
|
|
132
|
+
strokeWidth: a = 4
|
|
134
133
|
}) => {
|
|
135
|
-
const
|
|
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:
|
|
138
|
-
progress:
|
|
139
|
-
r:
|
|
140
|
-
cx:
|
|
141
|
-
cy:
|
|
142
|
-
circumference:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
},
|
|
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
|
-
),
|
|
159
|
+
), Fe = (e, t, r) => {
|
|
162
160
|
if (t) return r;
|
|
163
|
-
const
|
|
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
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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
|
-
|
|
186
|
-
},
|
|
187
|
-
const
|
|
188
|
-
i = null,
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
},
|
|
192
|
-
const
|
|
193
|
-
if (
|
|
194
|
-
if (
|
|
195
|
-
return
|
|
196
|
-
if (
|
|
197
|
-
return clearTimeout(
|
|
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
|
|
355
|
+
return o === null && (o = setTimeout(b, t)), m;
|
|
200
356
|
};
|
|
201
|
-
return
|
|
357
|
+
return w.cancel = U, w.flush = _, w.pending = z, w;
|
|
202
358
|
}
|
|
203
|
-
function
|
|
204
|
-
const { leading:
|
|
205
|
-
return
|
|
206
|
-
leading:
|
|
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
|
|
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,
|
|
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 ??
|
|
387
|
+
inputPlaceholder: r ?? j,
|
|
232
388
|
labelStaysFloatedWithPlaceholder: r !== void 0
|
|
233
389
|
} : {
|
|
234
|
-
inputPlaceholder: t ??
|
|
390
|
+
inputPlaceholder: t ?? j,
|
|
235
391
|
labelStaysFloatedWithPlaceholder: !1
|
|
236
392
|
};
|
|
237
393
|
};
|
|
238
394
|
export {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-react",
|
|
3
|
-
"version": "0.1.
|
|
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.
|
|
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.
|
|
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",
|