@ledgerhq/lumen-ui-react 0.0.87 → 0.0.89
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/ai-rules/RULES.md +5 -1
- package/dist/i18n/locales/de.json.d.ts +3 -0
- package/dist/i18n/locales/de.json.js +1 -1
- package/dist/i18n/locales/en.json.d.ts +3 -0
- package/dist/i18n/locales/en.json.js +1 -1
- package/dist/i18n/locales/es.json.d.ts +3 -0
- package/dist/i18n/locales/es.json.js +1 -1
- package/dist/i18n/locales/fr.json.d.ts +3 -0
- package/dist/i18n/locales/fr.json.js +1 -1
- package/dist/i18n/locales/ja.json.d.ts +3 -0
- package/dist/i18n/locales/ja.json.js +1 -1
- package/dist/i18n/locales/ko.json.d.ts +3 -0
- package/dist/i18n/locales/ko.json.js +1 -1
- package/dist/i18n/locales/pt.json.d.ts +3 -0
- package/dist/i18n/locales/pt.json.js +1 -1
- package/dist/i18n/locales/ru.json.d.ts +3 -0
- package/dist/i18n/locales/ru.json.js +1 -1
- package/dist/i18n/locales/th.json.d.ts +3 -0
- package/dist/i18n/locales/th.json.js +1 -1
- package/dist/i18n/locales/tr.json.d.ts +3 -0
- package/dist/i18n/locales/tr.json.js +1 -1
- package/dist/i18n/locales/zh.json.d.ts +3 -0
- package/dist/i18n/locales/zh.json.js +1 -1
- package/dist/index.js +130 -128
- package/dist/lib/Components/AmountDisplay/AmountDisplay.d.ts +1 -1
- package/dist/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
- package/dist/lib/Components/AmountDisplay/AmountDisplay.js +82 -22
- package/dist/lib/Components/AmountDisplay/index.d.ts +1 -1
- package/dist/lib/Components/AmountDisplay/index.d.ts.map +1 -1
- package/dist/lib/Components/AmountDisplay/types.d.ts +10 -24
- package/dist/lib/Components/AmountDisplay/types.d.ts.map +1 -1
- package/dist/lib/Components/Dialog/Dialog.d.ts +1 -0
- package/dist/lib/Components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/lib/Components/Dialog/DialogClose/DialogClose.d.ts +19 -0
- package/dist/lib/Components/Dialog/DialogClose/DialogClose.d.ts.map +1 -0
- package/dist/lib/Components/Dialog/DialogClose/DialogClose.js +8 -0
- package/dist/lib/Components/Dialog/DialogHeader/DialogHeader.d.ts.map +1 -1
- package/dist/lib/Components/Dialog/DialogHeader/DialogHeader.js +16 -15
- package/dist/lib/Components/Dialog/types.d.ts +22 -3
- package/dist/lib/Components/Dialog/types.d.ts.map +1 -1
- package/dist/lib/Components/Table/utils/useThrottledScrollBottom.js +4 -4
- package/dist/libs/utils-shared/dist/index.js +110 -92
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,147 +1,165 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as W } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as A, createContext as O, useContext as j } from "react";
|
|
3
3
|
import { clsx as k } from "clsx";
|
|
4
4
|
import { twMerge as N } from "tailwind-merge";
|
|
5
|
-
function H(
|
|
6
|
-
return
|
|
5
|
+
function H(t) {
|
|
6
|
+
return t ? t.split(/[-_ ]+/).map((r) => r.charAt(0).toUpperCase() + r.slice(1).toLowerCase()).join("") : "";
|
|
7
7
|
}
|
|
8
8
|
const q = 48, z = 17, E = 2;
|
|
9
|
-
function J(
|
|
10
|
-
const
|
|
9
|
+
function J(t) {
|
|
10
|
+
const r = t.replace(/\D/g, "").length;
|
|
11
11
|
return Math.max(
|
|
12
12
|
z,
|
|
13
|
-
q -
|
|
13
|
+
q - r * E
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
if (!
|
|
18
|
-
const
|
|
19
|
-
return
|
|
16
|
+
function v(t, r = !0) {
|
|
17
|
+
if (!t) return "";
|
|
18
|
+
const i = t.includes("."), [c, l] = t.split("."), o = c.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
19
|
+
return i && r ? l ? `${o}.${l}` : `${o}.` : o;
|
|
20
20
|
}
|
|
21
|
-
function K(
|
|
21
|
+
function K(t, r = {}) {
|
|
22
22
|
const {
|
|
23
|
-
allowDecimals:
|
|
24
|
-
thousandsSeparator:
|
|
23
|
+
allowDecimals: i = !0,
|
|
24
|
+
thousandsSeparator: c = !0,
|
|
25
25
|
maxIntegerLength: l = 9,
|
|
26
|
-
maxDecimalLength:
|
|
27
|
-
} =
|
|
26
|
+
maxDecimalLength: o = 9
|
|
27
|
+
} = r, n = t.replace(",", ".").replace(/[^\d.]/g, "");
|
|
28
28
|
let e = n;
|
|
29
|
-
if (e = e.replace(/^0+(?=\d)/, ""), !
|
|
30
|
-
return e = e.replace(/\D/g, ""), l > 0 && e.length > l && (e = e.slice(0, l)),
|
|
29
|
+
if (e = e.replace(/^0+(?=\d)/, ""), !i)
|
|
30
|
+
return e = e.replace(/\D/g, ""), l > 0 && e.length > l && (e = e.slice(0, l)), c ? v(e) : e;
|
|
31
31
|
e === "." && (e = "0.");
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
34
|
-
let
|
|
35
|
-
l > 0 &&
|
|
36
|
-
const
|
|
37
|
-
e =
|
|
32
|
+
const s = e.indexOf(".");
|
|
33
|
+
if (s !== -1) {
|
|
34
|
+
let u = e.slice(0, s), m = e.slice(s + 1).replace(/\./g, "");
|
|
35
|
+
l > 0 && u.length > l && (u = u.slice(0, l)), m = m.slice(0, o), u === "" && (u = "0");
|
|
36
|
+
const g = n.endsWith(".") || e.endsWith(".");
|
|
37
|
+
e = m.length > 0 ? `${u}.${m}` : g ? `${u}.` : u;
|
|
38
38
|
} else
|
|
39
39
|
l > 0 && e.length > l && (e = e.slice(0, l));
|
|
40
|
-
return
|
|
40
|
+
return c ? v(e) : e;
|
|
41
41
|
}
|
|
42
|
-
function U(
|
|
43
|
-
const
|
|
44
|
-
const e =
|
|
42
|
+
function U(t, r) {
|
|
43
|
+
const i = O(r), c = ({ children: o, value: n }) => {
|
|
44
|
+
const e = A(
|
|
45
45
|
() => n,
|
|
46
46
|
Object.values(n ?? {})
|
|
47
47
|
);
|
|
48
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ W(i.Provider, { value: e, children: o });
|
|
49
49
|
};
|
|
50
|
-
|
|
50
|
+
c.displayName = t + "Provider";
|
|
51
51
|
function l({
|
|
52
|
-
consumerName:
|
|
52
|
+
consumerName: o,
|
|
53
53
|
contextRequired: n
|
|
54
54
|
}) {
|
|
55
|
-
const e = j(
|
|
55
|
+
const e = j(i);
|
|
56
56
|
if (e)
|
|
57
57
|
return e;
|
|
58
58
|
if (n)
|
|
59
59
|
throw new Error(
|
|
60
|
-
`${
|
|
60
|
+
`${o} must be used within ${t}`
|
|
61
61
|
);
|
|
62
|
-
return
|
|
62
|
+
return r || {};
|
|
63
63
|
}
|
|
64
|
-
return [
|
|
64
|
+
return [c, l];
|
|
65
65
|
}
|
|
66
|
-
function V(...
|
|
67
|
-
return N(k(
|
|
66
|
+
function V(...t) {
|
|
67
|
+
return N(k(t));
|
|
68
68
|
}
|
|
69
69
|
const _ = ({
|
|
70
|
-
currentStep:
|
|
71
|
-
totalSteps:
|
|
72
|
-
size:
|
|
73
|
-
label:
|
|
70
|
+
currentStep: t,
|
|
71
|
+
totalSteps: r,
|
|
72
|
+
size: i,
|
|
73
|
+
label: c,
|
|
74
74
|
strokeWidth: l = 4,
|
|
75
|
-
arcPercentage:
|
|
75
|
+
arcPercentage: o = 0.75
|
|
76
76
|
}) => {
|
|
77
|
-
const n = Math.min(Math.max(
|
|
77
|
+
const n = Math.min(Math.max(t, 0), r), e = c ?? `${n}/${r}`, s = r <= 0 ? 0 : n / r, u = (i - l) / 2, m = i / 2, g = i / 2, d = 2 * Math.PI * u, p = d * o, P = p * (1 - s), h = n <= 0, w = `${p} ${d}`, y = h ? p - 2 : P;
|
|
78
78
|
return {
|
|
79
79
|
displayLabel: e,
|
|
80
|
-
progress:
|
|
81
|
-
r:
|
|
82
|
-
cx:
|
|
83
|
-
cy:
|
|
84
|
-
circumference:
|
|
85
|
-
trackArcLength:
|
|
86
|
-
trackDashArray: `${
|
|
87
|
-
progressDashArray:
|
|
88
|
-
progressDashOffset:
|
|
89
|
-
showMinimalDot:
|
|
80
|
+
progress: s,
|
|
81
|
+
r: u,
|
|
82
|
+
cx: m,
|
|
83
|
+
cy: g,
|
|
84
|
+
circumference: d,
|
|
85
|
+
trackArcLength: p,
|
|
86
|
+
trackDashArray: `${p} ${d}`,
|
|
87
|
+
progressDashArray: w,
|
|
88
|
+
progressDashOffset: y,
|
|
89
|
+
showMinimalDot: h
|
|
90
90
|
};
|
|
91
|
+
}, Q = (t) => A(
|
|
92
|
+
() => ({
|
|
93
|
+
integerPart: Array.from(t.integerPart, (r) => ({
|
|
94
|
+
value: r,
|
|
95
|
+
type: r.match(/^\d$/) ? "digit" : "separator"
|
|
96
|
+
})),
|
|
97
|
+
decimalPart: t.decimalPart ? Array.from(t.decimalPart, (r) => ({
|
|
98
|
+
value: r,
|
|
99
|
+
type: "digit"
|
|
100
|
+
})) : []
|
|
101
|
+
}),
|
|
102
|
+
[t.integerPart, t.decimalPart]
|
|
103
|
+
), X = (t, r, i) => {
|
|
104
|
+
if (r) return i;
|
|
105
|
+
const c = t.decimalPart ? `${t.decimalSeparator}${t.decimalPart}` : "", l = `${t.integerPart}${c}`;
|
|
106
|
+
return t.currencyPosition === "end" ? `${l} ${t.currencyText}` : `${t.currencyText} ${l}`;
|
|
91
107
|
};
|
|
92
|
-
function F(
|
|
93
|
-
const { leading:
|
|
94
|
-
let n = null, e = null,
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
return
|
|
99
|
-
},
|
|
100
|
-
const
|
|
101
|
-
return
|
|
102
|
-
},
|
|
103
|
-
const
|
|
104
|
-
return
|
|
105
|
-
},
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
108
|
-
|
|
108
|
+
function F(t, r, i = {}) {
|
|
109
|
+
const { leading: c = !1, trailing: l = !0, maxWait: o } = i;
|
|
110
|
+
let n = null, e = null, s = null, u = 0, m = null, g = null, d;
|
|
111
|
+
const p = o !== void 0, P = p ? Math.max(o, r) : 0, h = (a) => {
|
|
112
|
+
u = a;
|
|
113
|
+
const f = m, x = g;
|
|
114
|
+
return m = null, g = null, d = t.apply(x, f), d;
|
|
115
|
+
}, w = (a) => {
|
|
116
|
+
const f = s ? a - s : 0;
|
|
117
|
+
return r - f;
|
|
118
|
+
}, y = (a) => {
|
|
119
|
+
const f = s ? a - s : r, x = a - u;
|
|
120
|
+
return s === null || f >= r || f < 0 || p && x >= P;
|
|
121
|
+
}, D = (a) => (n = null, l && m ? h(a) : (m = null, g = null, d)), $ = () => {
|
|
122
|
+
const a = Date.now();
|
|
123
|
+
if (y(a)) {
|
|
124
|
+
D(a);
|
|
109
125
|
return;
|
|
110
126
|
}
|
|
111
|
-
n = setTimeout(
|
|
112
|
-
},
|
|
113
|
-
const
|
|
114
|
-
e = null,
|
|
115
|
-
},
|
|
116
|
-
n !== null && clearTimeout(n), e !== null && clearTimeout(e),
|
|
117
|
-
},
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
127
|
+
n = setTimeout($, w(a));
|
|
128
|
+
}, M = () => {
|
|
129
|
+
const a = Date.now();
|
|
130
|
+
e = null, m && (h(a), n !== null && (clearTimeout(n), n = setTimeout($, r)));
|
|
131
|
+
}, b = (a) => (u = a, n = setTimeout($, r), p && (e = setTimeout(M, P)), c ? h(a) : d), C = () => {
|
|
132
|
+
n !== null && clearTimeout(n), e !== null && clearTimeout(e), u = 0, m = null, g = null, s = null, n = null, e = null;
|
|
133
|
+
}, S = () => n === null && e === null ? d : D(Date.now()), L = () => n !== null || e !== null, T = function(...a) {
|
|
134
|
+
const f = Date.now(), x = y(f);
|
|
135
|
+
if (m = a, g = this, s = f, x) {
|
|
120
136
|
if (n === null)
|
|
121
|
-
return
|
|
122
|
-
if (
|
|
123
|
-
return clearTimeout(n), n = setTimeout(
|
|
137
|
+
return b(f);
|
|
138
|
+
if (p)
|
|
139
|
+
return clearTimeout(n), n = setTimeout($, r), h(f);
|
|
124
140
|
}
|
|
125
|
-
return n === null && (n = setTimeout(
|
|
141
|
+
return n === null && (n = setTimeout($, r)), d;
|
|
126
142
|
};
|
|
127
|
-
return
|
|
143
|
+
return T.cancel = C, T.flush = S, T.pending = L, T;
|
|
128
144
|
}
|
|
129
|
-
function
|
|
130
|
-
const { leading:
|
|
131
|
-
return F(
|
|
132
|
-
leading:
|
|
145
|
+
function Y(t, r, i = {}) {
|
|
146
|
+
const { leading: c = !0, trailing: l = !0 } = i;
|
|
147
|
+
return F(t, r, {
|
|
148
|
+
leading: c,
|
|
133
149
|
trailing: l,
|
|
134
|
-
maxWait:
|
|
150
|
+
maxWait: r
|
|
135
151
|
});
|
|
136
152
|
}
|
|
137
153
|
export {
|
|
154
|
+
X as buildAriaLabel,
|
|
138
155
|
V as cn,
|
|
139
156
|
U as createSafeContext,
|
|
140
157
|
F as debounce,
|
|
141
|
-
|
|
158
|
+
v as formatThousands,
|
|
142
159
|
J as getFontSize,
|
|
143
160
|
_ as getStepperCalculations,
|
|
144
161
|
K as textFormatter,
|
|
145
|
-
|
|
146
|
-
H as toPascalCase
|
|
162
|
+
Y as throttle,
|
|
163
|
+
H as toPascalCase,
|
|
164
|
+
Q as useSplitText
|
|
147
165
|
};
|
package/dist/package.json
CHANGED