@ledgerhq/lumen-ui-react 0.0.84 → 0.0.85
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.
|
@@ -7,7 +7,7 @@ const f = c(
|
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
9
9
|
appearance: {
|
|
10
|
-
base: "bg-
|
|
10
|
+
base: "bg-surface text-base hover:bg-surface-hover active:bg-surface-pressed disabled:bg-disabled",
|
|
11
11
|
outline: "bg-base-transparent text-base outline-dashed outline-1 outline-muted-subtle hover:bg-base-transparent-hover hover:outline-muted-subtle-hover focus-visible:outline-hidden focus-visible:outline-offset-0 active:bg-base-transparent-pressed active:outline-muted-subtle-pressed disabled:bg-base-transparent disabled:outline-disabled"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
@@ -18,14 +18,14 @@ const f = c(
|
|
|
18
18
|
), p = ({
|
|
19
19
|
ref: n,
|
|
20
20
|
className: l,
|
|
21
|
-
appearance:
|
|
22
|
-
icon:
|
|
23
|
-
title:
|
|
24
|
-
description:
|
|
21
|
+
appearance: r,
|
|
22
|
+
icon: o,
|
|
23
|
+
title: d,
|
|
24
|
+
description: s,
|
|
25
25
|
hideChevron: b,
|
|
26
|
-
...
|
|
26
|
+
...t
|
|
27
27
|
}) => {
|
|
28
|
-
const a =
|
|
28
|
+
const a = o;
|
|
29
29
|
return /* @__PURE__ */ i(
|
|
30
30
|
"button",
|
|
31
31
|
{
|
|
@@ -33,16 +33,16 @@ const f = c(
|
|
|
33
33
|
className: u(
|
|
34
34
|
l,
|
|
35
35
|
f({
|
|
36
|
-
appearance:
|
|
36
|
+
appearance: r
|
|
37
37
|
})
|
|
38
38
|
),
|
|
39
|
-
disabled:
|
|
40
|
-
...
|
|
39
|
+
disabled: t.disabled,
|
|
40
|
+
...t,
|
|
41
41
|
children: [
|
|
42
42
|
a && /* @__PURE__ */ e(a, { size: 24, className: "shrink-0" }),
|
|
43
43
|
/* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 flex-col gap-4 text-left", children: [
|
|
44
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 truncate body-2-semi-bold", children:
|
|
45
|
-
|
|
44
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 truncate body-2-semi-bold", children: d }),
|
|
45
|
+
s && /* @__PURE__ */ e("div", { className: "line-clamp-2 min-w-0 body-3 text-muted", children: s })
|
|
46
46
|
] }),
|
|
47
47
|
!b && /* @__PURE__ */ e(m, { size: 24, className: "shrink-0" })
|
|
48
48
|
]
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as W, useMemo as O,
|
|
1
|
+
import { jsx as A } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as W, useMemo 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(r) {
|
|
6
|
+
return r ? r.split(/[-_ ]+/).map((t) => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase()).join("") : "";
|
|
7
7
|
}
|
|
8
8
|
const q = 48, z = 17, E = 2;
|
|
9
|
-
function J(
|
|
10
|
-
const t =
|
|
9
|
+
function J(r) {
|
|
10
|
+
const t = r.replace(/\D/g, "").length;
|
|
11
11
|
return Math.max(
|
|
12
12
|
z,
|
|
13
13
|
q - t * E
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
if (!
|
|
18
|
-
const o =
|
|
19
|
-
return o && t ?
|
|
16
|
+
function y(r, t = !0) {
|
|
17
|
+
if (!r) return "";
|
|
18
|
+
const o = r.includes("."), [m, l] = r.split("."), s = m.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
19
|
+
return o && t ? l ? `${s}.${l}` : `${s}.` : s;
|
|
20
20
|
}
|
|
21
|
-
function K(
|
|
21
|
+
function K(r, t = {}) {
|
|
22
22
|
const {
|
|
23
23
|
allowDecimals: o = !0,
|
|
24
24
|
thousandsSeparator: m = !0,
|
|
25
|
-
maxIntegerLength:
|
|
25
|
+
maxIntegerLength: l = 9,
|
|
26
26
|
maxDecimalLength: s = 9
|
|
27
|
-
} = t, n =
|
|
27
|
+
} = t, n = r.replace(",", ".").replace(/[^\d.]/g, "");
|
|
28
28
|
let e = n;
|
|
29
29
|
if (e = e.replace(/^0+(?=\d)/, ""), !o)
|
|
30
|
-
return e = e.replace(/\D/g, ""),
|
|
30
|
+
return e = e.replace(/\D/g, ""), l > 0 && e.length > l && (e = e.slice(0, l)), m ? y(e) : e;
|
|
31
31
|
e === "." && (e = "0.");
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
34
|
-
let a = e.slice(0,
|
|
35
|
-
|
|
32
|
+
const i = e.indexOf(".");
|
|
33
|
+
if (i !== -1) {
|
|
34
|
+
let a = e.slice(0, i), c = e.slice(i + 1).replace(/\./g, "");
|
|
35
|
+
l > 0 && a.length > l && (a = a.slice(0, l)), c = c.slice(0, s), a === "" && (a = "0");
|
|
36
36
|
const h = n.endsWith(".") || e.endsWith(".");
|
|
37
|
-
e =
|
|
37
|
+
e = c.length > 0 ? `${a}.${c}` : h ? `${a}.` : a;
|
|
38
38
|
} else
|
|
39
|
-
|
|
40
|
-
return m ?
|
|
39
|
+
l > 0 && e.length > l && (e = e.slice(0, l));
|
|
40
|
+
return m ? y(e) : e;
|
|
41
41
|
}
|
|
42
|
-
function U(
|
|
42
|
+
function U(r, t) {
|
|
43
43
|
const o = W(t), m = ({ children: s, value: n }) => {
|
|
44
44
|
const e = O(
|
|
45
45
|
() => n,
|
|
46
46
|
Object.values(n ?? {})
|
|
47
47
|
);
|
|
48
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ A(o.Provider, { value: e, children: s });
|
|
49
49
|
};
|
|
50
|
-
m.displayName =
|
|
51
|
-
function
|
|
50
|
+
m.displayName = r + "Provider";
|
|
51
|
+
function l({
|
|
52
52
|
consumerName: s,
|
|
53
53
|
contextRequired: n
|
|
54
54
|
}) {
|
|
@@ -57,80 +57,80 @@ function U(l, t) {
|
|
|
57
57
|
return e;
|
|
58
58
|
if (n)
|
|
59
59
|
throw new Error(
|
|
60
|
-
`${s} must be used within ${
|
|
60
|
+
`${s} must be used within ${r}`
|
|
61
61
|
);
|
|
62
62
|
return t || {};
|
|
63
63
|
}
|
|
64
|
-
return [m,
|
|
64
|
+
return [m, l];
|
|
65
65
|
}
|
|
66
|
-
function V(...
|
|
67
|
-
return N(k(
|
|
66
|
+
function V(...r) {
|
|
67
|
+
return N(k(r));
|
|
68
68
|
}
|
|
69
69
|
const _ = ({
|
|
70
|
-
currentStep:
|
|
70
|
+
currentStep: r,
|
|
71
71
|
totalSteps: t,
|
|
72
72
|
size: o,
|
|
73
73
|
label: m,
|
|
74
|
-
strokeWidth:
|
|
74
|
+
strokeWidth: l = 4,
|
|
75
75
|
arcPercentage: s = 0.75
|
|
76
76
|
}) => {
|
|
77
|
-
const n = Math.min(Math.max(
|
|
77
|
+
const n = Math.min(Math.max(r, 0), t), e = m ?? `${n}/${t}`, i = t <= 0 ? 0 : n / t, a = (o - l) / 2, c = o / 2, h = o / 2, f = 2 * Math.PI * a, g = f * s, D = g * (1 - i), d = n <= 0, C = `${g} ${f}`, T = d ? g - 2 : D;
|
|
78
78
|
return {
|
|
79
79
|
displayLabel: e,
|
|
80
|
-
progress:
|
|
80
|
+
progress: i,
|
|
81
81
|
r: a,
|
|
82
|
-
cx:
|
|
82
|
+
cx: c,
|
|
83
83
|
cy: h,
|
|
84
84
|
circumference: f,
|
|
85
85
|
trackArcLength: g,
|
|
86
86
|
trackDashArray: `${g} ${f}`,
|
|
87
|
-
progressDashArray:
|
|
87
|
+
progressDashArray: C,
|
|
88
88
|
progressDashOffset: T,
|
|
89
89
|
showMinimalDot: d
|
|
90
90
|
};
|
|
91
91
|
};
|
|
92
|
-
function F(
|
|
93
|
-
const { leading: m = !1, trailing:
|
|
94
|
-
let n = null, e = null,
|
|
92
|
+
function F(r, t, o = {}) {
|
|
93
|
+
const { leading: m = !1, trailing: l = !0, maxWait: s } = o;
|
|
94
|
+
let n = null, e = null, i = null, a = 0, c = null, h = null, f;
|
|
95
95
|
const g = s !== void 0, D = g ? Math.max(s, t) : 0, d = (u) => {
|
|
96
96
|
a = u;
|
|
97
|
-
const p =
|
|
98
|
-
return
|
|
99
|
-
},
|
|
100
|
-
const p =
|
|
97
|
+
const p = c, $ = h;
|
|
98
|
+
return c = null, h = null, f = r.apply($, p), f;
|
|
99
|
+
}, C = (u) => {
|
|
100
|
+
const p = i ? u - i : 0;
|
|
101
101
|
return t - p;
|
|
102
102
|
}, T = (u) => {
|
|
103
|
-
const p =
|
|
104
|
-
return
|
|
105
|
-
},
|
|
103
|
+
const p = i ? u - i : t, $ = u - a;
|
|
104
|
+
return i === null || p >= t || p < 0 || g && $ >= D;
|
|
105
|
+
}, M = (u) => (n = null, l && c ? d(u) : (c = null, h = null, f)), x = () => {
|
|
106
106
|
const u = Date.now();
|
|
107
107
|
if (T(u)) {
|
|
108
|
-
|
|
108
|
+
M(u);
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
n = setTimeout(x,
|
|
111
|
+
n = setTimeout(x, C(u));
|
|
112
112
|
}, b = () => {
|
|
113
113
|
const u = Date.now();
|
|
114
|
-
e = null,
|
|
115
|
-
},
|
|
116
|
-
n !== null && clearTimeout(n), e !== null && clearTimeout(e), a = 0,
|
|
117
|
-
},
|
|
114
|
+
e = null, c && (d(u), n !== null && (clearTimeout(n), n = setTimeout(x, t)));
|
|
115
|
+
}, v = (u) => (a = u, n = setTimeout(x, t), g && (e = setTimeout(b, D)), m ? d(u) : f), L = () => {
|
|
116
|
+
n !== null && clearTimeout(n), e !== null && clearTimeout(e), a = 0, c = null, h = null, i = null, n = null, e = null;
|
|
117
|
+
}, P = () => n === null && e === null ? f : M(Date.now()), S = () => n !== null || e !== null, w = function(...u) {
|
|
118
118
|
const p = Date.now(), $ = T(p);
|
|
119
|
-
if (
|
|
119
|
+
if (c = u, h = this, i = p, $) {
|
|
120
120
|
if (n === null)
|
|
121
|
-
return
|
|
121
|
+
return v(p);
|
|
122
122
|
if (g)
|
|
123
123
|
return clearTimeout(n), n = setTimeout(x, t), d(p);
|
|
124
124
|
}
|
|
125
125
|
return n === null && (n = setTimeout(x, t)), f;
|
|
126
126
|
};
|
|
127
|
-
return w.cancel =
|
|
127
|
+
return w.cancel = L, w.flush = P, w.pending = S, w;
|
|
128
128
|
}
|
|
129
|
-
function Q(
|
|
130
|
-
const { leading: m = !0, trailing:
|
|
131
|
-
return F(
|
|
129
|
+
function Q(r, t, o = {}) {
|
|
130
|
+
const { leading: m = !0, trailing: l = !0 } = o;
|
|
131
|
+
return F(r, t, {
|
|
132
132
|
leading: m,
|
|
133
|
-
trailing:
|
|
133
|
+
trailing: l,
|
|
134
134
|
maxWait: t
|
|
135
135
|
});
|
|
136
136
|
}
|
|
@@ -138,7 +138,7 @@ export {
|
|
|
138
138
|
V as cn,
|
|
139
139
|
U as createSafeContext,
|
|
140
140
|
F as debounce,
|
|
141
|
-
|
|
141
|
+
y as formatThousands,
|
|
142
142
|
J as getFontSize,
|
|
143
143
|
_ as getStepperCalculations,
|
|
144
144
|
K as textFormatter,
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.84",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"keywords": [
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
]
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@ledgerhq/lumen-utils-shared": "0.0.
|
|
44
|
+
"@ledgerhq/lumen-utils-shared": "0.0.20",
|
|
45
45
|
"i18next": "^23.7.0",
|
|
46
46
|
"react-i18next": "^14.0.0"
|
|
47
47
|
},
|