@ledgerhq/lumen-ui-react 0.0.59 → 0.0.61
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 +83 -76
- package/dist/lib/Components/AmountInput/AmountInput.js +10 -10
- package/dist/lib/Components/BaseInput/BaseInput.js +4 -4
- 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/Dialog.js +32 -31
- package/dist/lib/Components/Dialog/types.d.ts +6 -0
- package/dist/lib/Components/Dialog/types.d.ts.map +1 -1
- package/dist/lib/Components/Divider/Divider.d.ts +24 -0
- package/dist/lib/Components/Divider/Divider.d.ts.map +1 -0
- package/dist/lib/Components/Divider/Divider.js +23 -0
- package/dist/lib/Components/Divider/index.d.ts +3 -0
- package/dist/lib/Components/Divider/index.d.ts.map +1 -0
- package/dist/lib/Components/Divider/types.d.ts +9 -0
- package/dist/lib/Components/Divider/types.d.ts.map +1 -0
- package/dist/lib/Components/Link/Link.js +5 -5
- package/dist/lib/Components/ListItem/ListItem.js +5 -5
- package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
- package/dist/lib/Components/Menu/Menu.js +80 -78
- package/dist/lib/Components/Select/Select.d.ts.map +1 -1
- package/dist/lib/Components/Select/Select.js +76 -74
- package/dist/lib/Components/Spot/Spot.js +4 -4
- package/dist/lib/Components/ThemeProvider/ThemeProvider.js +2 -2
- package/dist/lib/Components/Tile/Tile.d.ts +75 -45
- package/dist/lib/Components/Tile/Tile.d.ts.map +1 -1
- package/dist/lib/Components/Tile/Tile.js +168 -99
- package/dist/lib/Components/Tile/index.d.ts +1 -1
- package/dist/lib/Components/Tile/index.d.ts.map +1 -1
- package/dist/lib/Components/Tile/types.d.ts +68 -26
- package/dist/lib/Components/Tile/types.d.ts.map +1 -1
- package/dist/lib/Components/index.d.ts +1 -0
- package/dist/lib/Components/index.d.ts.map +1 -1
- package/dist/libs/utils-shared/dist/index.js +52 -44
- package/dist/package.json +2 -2
- package/package.json +2 -2
|
@@ -1,76 +1,84 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { clsx as
|
|
4
|
-
import { twMerge as
|
|
5
|
-
function
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as h, Children as g, isValidElement as m, useMemo as x, useContext as $ } from "react";
|
|
3
|
+
import { clsx as C } from "clsx";
|
|
4
|
+
import { twMerge as w } from "tailwind-merge";
|
|
5
|
+
function S(t) {
|
|
6
6
|
return t ? t.split(/[-_ ]+/).map((n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase()).join("") : "";
|
|
7
7
|
}
|
|
8
|
-
const
|
|
9
|
-
function
|
|
8
|
+
const v = 48, j = 17, y = 2;
|
|
9
|
+
function b(t) {
|
|
10
10
|
const n = t.replace(/\D/g, "").length;
|
|
11
11
|
return Math.max(
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
j,
|
|
13
|
+
v - n * y
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function p(t, n = !0) {
|
|
17
17
|
if (!t) return "";
|
|
18
|
-
const a = t.includes("."), [
|
|
19
|
-
return a && n ? r ? `${
|
|
18
|
+
const a = t.includes("."), [i, r] = t.split("."), s = i.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
19
|
+
return a && n ? r ? `${s}.${r}` : `${s}.` : s;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function F(t, n = {}) {
|
|
22
22
|
const {
|
|
23
23
|
allowDecimals: a = !0,
|
|
24
|
-
thousandsSeparator:
|
|
24
|
+
thousandsSeparator: i = !0,
|
|
25
25
|
maxIntegerLength: r = 9,
|
|
26
|
-
maxDecimalLength:
|
|
27
|
-
} = n,
|
|
28
|
-
let e =
|
|
26
|
+
maxDecimalLength: s = 9
|
|
27
|
+
} = n, o = t.replace(",", ".").replace(/[^\d.]/g, "");
|
|
28
|
+
let e = o;
|
|
29
29
|
if (e = e.replace(/^0+(?=\d)/, ""), !a)
|
|
30
|
-
return e = e.replace(/\D/g, ""), r > 0 && e.length > r && (e = e.slice(0, r)),
|
|
30
|
+
return e = e.replace(/\D/g, ""), r > 0 && e.length > r && (e = e.slice(0, r)), i ? p(e) : e;
|
|
31
31
|
e === "." && (e = "0.");
|
|
32
32
|
const u = e.indexOf(".");
|
|
33
33
|
if (u !== -1) {
|
|
34
|
-
let
|
|
35
|
-
r > 0 &&
|
|
36
|
-
const f =
|
|
37
|
-
e =
|
|
34
|
+
let l = e.slice(0, u), c = e.slice(u + 1).replace(/\./g, "");
|
|
35
|
+
r > 0 && l.length > r && (l = l.slice(0, r)), c = c.slice(0, s), l === "" && (l = "0");
|
|
36
|
+
const f = o.endsWith(".") || e.endsWith(".");
|
|
37
|
+
e = c.length > 0 ? `${l}.${c}` : f ? `${l}.` : l;
|
|
38
38
|
} else
|
|
39
39
|
r > 0 && e.length > r && (e = e.slice(0, r));
|
|
40
|
-
return
|
|
40
|
+
return i ? p(e) : e;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
const a =
|
|
44
|
-
const e =
|
|
45
|
-
() =>
|
|
46
|
-
Object.values(
|
|
42
|
+
function O(t, n) {
|
|
43
|
+
const a = h(n), i = ({ children: s, value: o }) => {
|
|
44
|
+
const e = x(
|
|
45
|
+
() => o,
|
|
46
|
+
Object.values(o ?? {})
|
|
47
47
|
);
|
|
48
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ d(a.Provider, { value: e, children: s });
|
|
49
49
|
};
|
|
50
|
-
|
|
50
|
+
i.displayName = t + "Provider";
|
|
51
51
|
function r({
|
|
52
|
-
consumerName:
|
|
53
|
-
contextRequired:
|
|
52
|
+
consumerName: s,
|
|
53
|
+
contextRequired: o
|
|
54
54
|
}) {
|
|
55
|
-
const e =
|
|
55
|
+
const e = $(a);
|
|
56
56
|
if (e)
|
|
57
57
|
return e;
|
|
58
|
-
if (
|
|
58
|
+
if (o)
|
|
59
59
|
throw new Error(
|
|
60
|
-
`${
|
|
60
|
+
`${s} must be used within ${t}`
|
|
61
61
|
);
|
|
62
62
|
return n || {};
|
|
63
63
|
}
|
|
64
|
-
return [
|
|
64
|
+
return [i, r];
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
66
|
+
function P(...t) {
|
|
67
|
+
return w(C(t));
|
|
68
|
+
}
|
|
69
|
+
function z(t, n) {
|
|
70
|
+
const a = g.toArray(t), i = typeof n == "string" ? (o) => m(o) && o.props["data-slot"] === n : (o) => m(o) && o.type === n, r = a.find(i), s = a.filter((o) => !i(o));
|
|
71
|
+
return {
|
|
72
|
+
slotElement: r ?? null,
|
|
73
|
+
remainingChildren: s
|
|
74
|
+
};
|
|
68
75
|
}
|
|
69
76
|
export {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
b as
|
|
75
|
-
|
|
77
|
+
P as cn,
|
|
78
|
+
O as createSafeContext,
|
|
79
|
+
z as extractSlottable,
|
|
80
|
+
p as formatThousands,
|
|
81
|
+
b as getFontSize,
|
|
82
|
+
F as textFormatter,
|
|
83
|
+
S as toPascalCase
|
|
76
84
|
};
|
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.60",
|
|
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.14",
|
|
45
45
|
"i18next": "^23.7.0",
|
|
46
46
|
"react-i18next": "^14.0.0"
|
|
47
47
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.61",
|
|
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.15",
|
|
45
45
|
"i18next": "^23.7.0",
|
|
46
46
|
"react-i18next": "^14.0.0"
|
|
47
47
|
},
|