@ledgerhq/lumen-ui-react 0.0.84 → 0.0.86
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/CardButton/CardButton.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAkB1C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,UAAU;sFASpB,eAAe;;
|
|
1
|
+
{"version":3,"file":"CardButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/CardButton/CardButton.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAkB1C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,UAAU;sFASpB,eAAe;;CAgCjB,CAAC"}
|
|
@@ -3,11 +3,11 @@ import { cn as u } from "../../../libs/utils-shared/dist/index.js";
|
|
|
3
3
|
import { cva as c } from "class-variance-authority";
|
|
4
4
|
import { ChevronRight as m } from "../../Symbols/Icons/ChevronRight.js";
|
|
5
5
|
const f = c(
|
|
6
|
-
"inline-flex h-fit w-full cursor-pointer items-center gap-12 rounded-sm p-12 transition-colors focus-visible:outline-2 focus-visible:outline-focus disabled:cursor-default disabled:text-disabled",
|
|
6
|
+
"group inline-flex h-fit w-full cursor-pointer items-center gap-12 rounded-sm p-12 transition-colors focus-visible:outline-2 focus-visible:outline-focus disabled:cursor-default disabled:text-disabled",
|
|
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
|
},
|
|
@@ -16,35 +16,41 @@ const f = c(
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
), p = ({
|
|
19
|
-
ref:
|
|
20
|
-
className:
|
|
21
|
-
appearance:
|
|
22
|
-
icon:
|
|
23
|
-
title:
|
|
24
|
-
description:
|
|
19
|
+
ref: l,
|
|
20
|
+
className: d,
|
|
21
|
+
appearance: r,
|
|
22
|
+
icon: n,
|
|
23
|
+
title: o,
|
|
24
|
+
description: s,
|
|
25
25
|
hideChevron: b,
|
|
26
|
-
...
|
|
26
|
+
...t
|
|
27
27
|
}) => {
|
|
28
|
-
const a =
|
|
28
|
+
const a = n;
|
|
29
29
|
return /* @__PURE__ */ i(
|
|
30
30
|
"button",
|
|
31
31
|
{
|
|
32
|
-
ref:
|
|
32
|
+
ref: l,
|
|
33
33
|
className: u(
|
|
34
|
-
|
|
34
|
+
d,
|
|
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: o }),
|
|
45
|
+
s && /* @__PURE__ */ e("div", { className: "line-clamp-2 min-w-0 body-3 text-muted group-disabled:text-disabled", children: s })
|
|
46
46
|
] }),
|
|
47
|
-
!b && /* @__PURE__ */ e(
|
|
47
|
+
!b && /* @__PURE__ */ e(
|
|
48
|
+
m,
|
|
49
|
+
{
|
|
50
|
+
size: 24,
|
|
51
|
+
className: "shrink-0 text-muted group-disabled:text-disabled"
|
|
52
|
+
}
|
|
53
|
+
)
|
|
48
54
|
]
|
|
49
55
|
}
|
|
50
56
|
);
|
|
@@ -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.85",
|
|
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
|
},
|