@ledgerhq/lumen-ui-react 0.1.48 → 0.1.49
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 +227 -223
- package/dist/lib/Components/AmountDisplay/AmountDisplay.js +10 -10
- package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.js +3 -3
- package/dist/lib/Components/Avatar/Avatar.d.ts +1 -1
- package/dist/lib/Components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/lib/Components/Avatar/Avatar.js +97 -57
- package/dist/lib/Components/Avatar/index.d.ts +1 -0
- package/dist/lib/Components/Avatar/index.d.ts.map +1 -1
- package/dist/lib/Components/Avatar/resolveAvatarColor.d.ts +9 -0
- package/dist/lib/Components/Avatar/resolveAvatarColor.d.ts.map +1 -0
- package/dist/lib/Components/Avatar/resolveAvatarColor.js +18 -0
- package/dist/lib/Components/Avatar/types.d.ts +23 -8
- package/dist/lib/Components/Avatar/types.d.ts.map +1 -1
- package/dist/lib/Components/AvatarButton/AvatarButton.d.ts +6 -0
- package/dist/lib/Components/AvatarButton/AvatarButton.d.ts.map +1 -0
- package/dist/lib/Components/AvatarButton/AvatarButton.js +52 -0
- package/dist/lib/Components/AvatarButton/index.d.ts +3 -0
- package/dist/lib/Components/AvatarButton/index.d.ts.map +1 -0
- package/dist/lib/Components/AvatarButton/types.d.ts +4 -0
- package/dist/lib/Components/AvatarButton/types.d.ts.map +1 -0
- package/dist/lib/Components/BaseInput/BaseInput.js +6 -6
- package/dist/lib/Components/BaseTag/BaseTag.js +4 -4
- package/dist/lib/Components/Button/BaseButton.d.ts +2 -2
- package/dist/lib/Components/Button/Button.js +8 -8
- package/dist/lib/Components/Card/Card.js +14 -14
- package/dist/lib/Components/CardButton/CardButton.js +6 -6
- package/dist/lib/Components/DataTable/DataTable.js +10 -10
- package/dist/lib/Components/Divider/Divider.js +4 -4
- package/dist/lib/Components/DotIcon/DotIcon.js +5 -5
- package/dist/lib/Components/DotIndicator/getDotIndicatorProps.d.ts +32 -0
- package/dist/lib/Components/DotIndicator/getDotIndicatorProps.d.ts.map +1 -1
- package/dist/lib/Components/DotIndicator/getDotIndicatorProps.js +7 -4
- package/dist/lib/Components/Icon/createIcon.js +6 -6
- package/dist/lib/Components/Link/Link.js +6 -6
- package/dist/lib/Components/ListItem/ListItem.js +4 -4
- package/dist/lib/Components/MediaBanner/MediaBanner.d.ts +1 -1
- package/dist/lib/Components/MediaBanner/MediaBanner.d.ts.map +1 -1
- package/dist/lib/Components/MediaBanner/MediaBanner.js +94 -75
- package/dist/lib/Components/MediaCard/MediaCard.js +4 -4
- package/dist/lib/Components/MediaImage/MediaImage.js +6 -6
- package/dist/lib/Components/Menu/Menu.js +33 -33
- package/dist/lib/Components/NavBar/CoinCapsule.js +4 -4
- package/dist/lib/Components/NavBar/NavBar.js +9 -9
- package/dist/lib/Components/Popover/Popover.js +14 -14
- package/dist/lib/Components/SegmentedControl/SegmentedControl.js +11 -11
- package/dist/lib/Components/SideBar/SideBar.js +34 -34
- package/dist/lib/Components/Spot/Spot.js +4 -4
- package/dist/lib/Components/Stepper/Stepper.js +6 -6
- package/dist/lib/Components/Table/Table.js +9 -9
- package/dist/lib/Components/Tooltip/Tooltip.js +4 -4
- package/dist/lib/Components/index.d.ts +1 -0
- package/dist/lib/Components/index.d.ts.map +1 -1
- package/dist/libs/design-core/dist/lib/cssVar/cssVar.js +4 -0
- package/dist/libs/utils-shared/dist/index.js +135 -112
- package/dist/package.json +2 -2
- package/package.json +3 -3
|
@@ -9,7 +9,7 @@ import { ChevronUpDown as B } from "../../Symbols/Icons/ChevronUpDown.js";
|
|
|
9
9
|
import { ChevronDescending as j } from "../../Symbols/Icons/ChevronDescending.js";
|
|
10
10
|
import { ChevronAscending as I } from "../../Symbols/Icons/ChevronAscending.js";
|
|
11
11
|
import { InteractiveIcon as A } from "../InteractiveIcon/InteractiveIcon.js";
|
|
12
|
-
const [
|
|
12
|
+
const [V, u] = h("Table"), k = c(
|
|
13
13
|
"relative scrollbar-none w-full max-w-full border-collapse overflow-x-auto rounded-lg",
|
|
14
14
|
{
|
|
15
15
|
variants: {
|
|
@@ -32,12 +32,12 @@ const [k, u] = h("Table"), q = c(
|
|
|
32
32
|
onScrollBottom: a,
|
|
33
33
|
loading: r
|
|
34
34
|
});
|
|
35
|
-
return /* @__PURE__ */ l(
|
|
35
|
+
return /* @__PURE__ */ l(V, { value: { appearance: e, loading: r }, children: /* @__PURE__ */ l(
|
|
36
36
|
"div",
|
|
37
37
|
{
|
|
38
38
|
...i,
|
|
39
39
|
ref: o,
|
|
40
|
-
className:
|
|
40
|
+
className: k({ appearance: e, className: t }),
|
|
41
41
|
onScroll: d,
|
|
42
42
|
children: n
|
|
43
43
|
}
|
|
@@ -55,7 +55,7 @@ const [k, u] = h("Table"), q = c(
|
|
|
55
55
|
className: e,
|
|
56
56
|
ref: t,
|
|
57
57
|
...a
|
|
58
|
-
}) => /* @__PURE__ */ l("colgroup", { ref: t, className: e, ...a, children: n }),
|
|
58
|
+
}) => /* @__PURE__ */ l("colgroup", { ref: t, className: e, ...a, children: n }), q = c("", {
|
|
59
59
|
variants: {
|
|
60
60
|
hideBelow: {
|
|
61
61
|
xs: "hidden xs:table-column",
|
|
@@ -74,7 +74,7 @@ const [k, u] = h("Table"), q = c(
|
|
|
74
74
|
"col",
|
|
75
75
|
{
|
|
76
76
|
ref: t,
|
|
77
|
-
className:
|
|
77
|
+
className: q({ hideBelow: e, className: n }),
|
|
78
78
|
...a
|
|
79
79
|
}
|
|
80
80
|
), _ = ({
|
|
@@ -107,7 +107,7 @@ const [k, u] = h("Table"), q = c(
|
|
|
107
107
|
...o,
|
|
108
108
|
children: n
|
|
109
109
|
}
|
|
110
|
-
),
|
|
110
|
+
), H = c("", {
|
|
111
111
|
variants: {
|
|
112
112
|
appearance: {
|
|
113
113
|
"no-background": "bg-canvas",
|
|
@@ -133,7 +133,7 @@ const [k, u] = h("Table"), q = c(
|
|
|
133
133
|
"tr",
|
|
134
134
|
{
|
|
135
135
|
ref: a,
|
|
136
|
-
className:
|
|
136
|
+
className: H({ appearance: o, stickyHeader: t, className: e }),
|
|
137
137
|
...r,
|
|
138
138
|
children: n
|
|
139
139
|
}
|
|
@@ -197,7 +197,7 @@ const [k, u] = h("Table"), q = c(
|
|
|
197
197
|
...o,
|
|
198
198
|
children: /* @__PURE__ */ l("div", { className: p.inner({ align: a }), children: n })
|
|
199
199
|
}
|
|
200
|
-
), [
|
|
200
|
+
), [S, m] = h("TableCellItem", { align: "start" }), L = c("flex min-w-0 items-center gap-12", {
|
|
201
201
|
variants: {
|
|
202
202
|
align: {
|
|
203
203
|
start: "text-start",
|
|
@@ -210,7 +210,7 @@ const [k, u] = h("Table"), q = c(
|
|
|
210
210
|
children: t,
|
|
211
211
|
ref: a,
|
|
212
212
|
...r
|
|
213
|
-
}) => /* @__PURE__ */ l(
|
|
213
|
+
}) => /* @__PURE__ */ l(S, { value: { align: e }, children: /* @__PURE__ */ l(
|
|
214
214
|
"div",
|
|
215
215
|
{
|
|
216
216
|
ref: a,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { cn as
|
|
1
|
+
import { jsx as o, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { cn as s } from "../../../libs/utils-shared/dist/index.js";
|
|
3
3
|
import * as e from "@radix-ui/react-tooltip";
|
|
4
4
|
import { cva as d } from "class-variance-authority";
|
|
5
5
|
const m = d(
|
|
@@ -37,13 +37,13 @@ const m = d(
|
|
|
37
37
|
side: a,
|
|
38
38
|
children: r,
|
|
39
39
|
...n
|
|
40
|
-
}) => /* @__PURE__ */ o(e.Portal, { children: /* @__PURE__ */
|
|
40
|
+
}) => /* @__PURE__ */ o(e.Portal, { children: /* @__PURE__ */ l(
|
|
41
41
|
e.Content,
|
|
42
42
|
{
|
|
43
43
|
"data-slot": "tooltip-content",
|
|
44
44
|
side: a,
|
|
45
45
|
sideOffset: i,
|
|
46
|
-
className:
|
|
46
|
+
className: s(m({ side: a }), t),
|
|
47
47
|
...n,
|
|
48
48
|
children: [
|
|
49
49
|
/* @__PURE__ */ o(e.Arrow, { className: "size-10 translate-y-[calc(-50%-1px)] rotate-45 rounded-[1px] bg-interactive fill-interactive" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,83 +1,103 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsx as L } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as S, createContext as E, useRef as W, useContext as q } from "react";
|
|
3
3
|
import { clsx as I } from "clsx";
|
|
4
|
-
import { twMerge as
|
|
5
|
-
function
|
|
4
|
+
import { twMerge as N } from "tailwind-merge";
|
|
5
|
+
function re(e) {
|
|
6
6
|
return e ? e.split(/[-_ ]+/).map((t) => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase()).join("") : "";
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
function F(e) {
|
|
9
|
+
let t = 0;
|
|
10
|
+
for (let r = 0; r < e.length; r++)
|
|
11
|
+
t = Math.imul(t, 31) + e.charCodeAt(r) | 0;
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
const K = {
|
|
9
15
|
md: { max: 48, min: 17, scale: 2, startAt: 0 },
|
|
10
16
|
sm: { max: 28, min: 12, scale: 2, startAt: 6 }
|
|
11
17
|
};
|
|
12
|
-
function
|
|
13
|
-
const { max: r, min:
|
|
14
|
-
return Math.max(
|
|
18
|
+
function ne(e, t = "md") {
|
|
19
|
+
const { max: r, min: l, scale: a, startAt: o } = K[t], n = e.replace(/\D/g, "").length;
|
|
20
|
+
return Math.max(l, r - Math.max(0, n - o) * a);
|
|
15
21
|
}
|
|
16
|
-
function
|
|
22
|
+
function z(e, t = !0) {
|
|
17
23
|
if (!e) return "";
|
|
18
|
-
const r = e.includes("."), [
|
|
19
|
-
return r && t ?
|
|
24
|
+
const r = e.includes("."), [l, a] = e.split("."), o = l.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
25
|
+
return r && t ? a ? `${o}.${a}` : `${o}.` : o;
|
|
20
26
|
}
|
|
21
|
-
const
|
|
27
|
+
const B = (e) => e.replaceAll(",", ".").replaceAll(/[^\d.]/g, ""), _ = (e) => e.replace(/^0+(?=\d)/, ""), v = (e, t) => t > 0 ? e.slice(0, t) : e, U = (e, t) => v(e.replaceAll(/\D/g, ""), t), V = (e, t, r) => {
|
|
22
28
|
if (e === ".") return "0.";
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
const
|
|
26
|
-
return o.length > 0 ? `${
|
|
29
|
+
const l = e.indexOf(".");
|
|
30
|
+
if (l === -1) return v(e, t);
|
|
31
|
+
const a = v(e.slice(0, l), t) || "0", o = e.slice(l + 1).replaceAll(".", "").slice(0, r);
|
|
32
|
+
return o.length > 0 ? `${a}.${o}` : e.endsWith(".") ? `${a}.` : a;
|
|
27
33
|
};
|
|
28
|
-
function
|
|
34
|
+
function le(e, t = {}) {
|
|
29
35
|
const {
|
|
30
36
|
allowDecimals: r = !0,
|
|
31
|
-
thousandsSeparator:
|
|
32
|
-
maxIntegerLength:
|
|
37
|
+
thousandsSeparator: l = !0,
|
|
38
|
+
maxIntegerLength: a = 9,
|
|
33
39
|
maxDecimalLength: o = 9,
|
|
34
40
|
decimalSeparator: n = "."
|
|
35
|
-
} = t,
|
|
36
|
-
return n === "." ?
|
|
41
|
+
} = t, s = _(B(e)), u = r ? V(s, a, o) : U(s, a), f = l ? z(u) : u;
|
|
42
|
+
return n === "." ? f : f.replaceAll(".", n);
|
|
43
|
+
}
|
|
44
|
+
const A = [
|
|
45
|
+
"orange",
|
|
46
|
+
"green",
|
|
47
|
+
"blue",
|
|
48
|
+
"purple",
|
|
49
|
+
"red",
|
|
50
|
+
"yellow",
|
|
51
|
+
"turquoise",
|
|
52
|
+
"pink"
|
|
53
|
+
];
|
|
54
|
+
function ae(e) {
|
|
55
|
+
const t = (F(e) % A.length + A.length) % A.length;
|
|
56
|
+
return A[t];
|
|
37
57
|
}
|
|
38
|
-
function
|
|
58
|
+
function Y(e, t) {
|
|
39
59
|
if (Object.is(e, t)) return !0;
|
|
40
|
-
const r = e,
|
|
41
|
-
return
|
|
42
|
-
(n) => Object.prototype.hasOwnProperty.call(
|
|
60
|
+
const r = e, l = t, a = Object.keys(r), o = Object.keys(l);
|
|
61
|
+
return a.length !== o.length ? !1 : a.every(
|
|
62
|
+
(n) => Object.prototype.hasOwnProperty.call(l, n) && Object.is(r[n], l[n])
|
|
43
63
|
);
|
|
44
64
|
}
|
|
45
65
|
function G(e, t) {
|
|
46
|
-
const r =
|
|
47
|
-
const
|
|
48
|
-
return
|
|
66
|
+
const r = E(t), l = ({ children: o, value: n }) => {
|
|
67
|
+
const s = W(n);
|
|
68
|
+
return Y(s.current, n) || (s.current = n), /* @__PURE__ */ L(r.Provider, { value: s.current, children: o });
|
|
49
69
|
};
|
|
50
|
-
|
|
51
|
-
function
|
|
70
|
+
l.displayName = e + "Provider";
|
|
71
|
+
function a({
|
|
52
72
|
consumerName: o,
|
|
53
73
|
contextRequired: n
|
|
54
74
|
}) {
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
57
|
-
return
|
|
75
|
+
const s = q(r);
|
|
76
|
+
if (s)
|
|
77
|
+
return s;
|
|
58
78
|
if (n)
|
|
59
79
|
throw new Error(
|
|
60
80
|
`${o} must be used within ${e}`
|
|
61
81
|
);
|
|
62
82
|
return t || {};
|
|
63
83
|
}
|
|
64
|
-
return [
|
|
84
|
+
return [l, a];
|
|
65
85
|
}
|
|
66
|
-
const [
|
|
86
|
+
const [oe, H] = G("Disabled", { disabled: !1 }), se = ({
|
|
67
87
|
consumerName: e,
|
|
68
88
|
contextRequired: t,
|
|
69
89
|
mergeWith: r
|
|
70
90
|
}) => {
|
|
71
|
-
const
|
|
91
|
+
const l = H({
|
|
72
92
|
consumerName: e,
|
|
73
93
|
contextRequired: t ?? !1
|
|
74
94
|
});
|
|
75
|
-
return !!(r?.disabled ||
|
|
95
|
+
return !!(r?.disabled || l.disabled);
|
|
76
96
|
};
|
|
77
|
-
function
|
|
78
|
-
return
|
|
97
|
+
function ie(...e) {
|
|
98
|
+
return N(I(e));
|
|
79
99
|
}
|
|
80
|
-
function
|
|
100
|
+
function T(e, t) {
|
|
81
101
|
if (typeof e == "function")
|
|
82
102
|
return e(t);
|
|
83
103
|
typeof e == "object" && e !== null && "current" in e && (e.current = t);
|
|
@@ -86,49 +106,49 @@ function J(...e) {
|
|
|
86
106
|
const t = /* @__PURE__ */ new Map();
|
|
87
107
|
return (r) => {
|
|
88
108
|
if (r === null) {
|
|
89
|
-
e.forEach((
|
|
90
|
-
const
|
|
91
|
-
typeof
|
|
109
|
+
e.forEach((l) => {
|
|
110
|
+
const a = t.get(l);
|
|
111
|
+
typeof a == "function" && a(), T(l, null);
|
|
92
112
|
}), t.clear();
|
|
93
113
|
return;
|
|
94
114
|
}
|
|
95
|
-
e.forEach((
|
|
96
|
-
const
|
|
97
|
-
typeof
|
|
115
|
+
e.forEach((l) => {
|
|
116
|
+
const a = T(l, r);
|
|
117
|
+
typeof a == "function" && t.set(l, a);
|
|
98
118
|
});
|
|
99
119
|
};
|
|
100
120
|
}
|
|
101
|
-
function
|
|
102
|
-
return
|
|
121
|
+
function ue(...e) {
|
|
122
|
+
return S(() => J(...e), e);
|
|
103
123
|
}
|
|
104
|
-
function
|
|
124
|
+
function ce(e) {
|
|
105
125
|
return function(t, r) {
|
|
106
126
|
return e[t][r];
|
|
107
127
|
};
|
|
108
128
|
}
|
|
109
|
-
const
|
|
129
|
+
const de = ({
|
|
110
130
|
currentStep: e,
|
|
111
131
|
totalSteps: t,
|
|
112
132
|
size: r,
|
|
113
|
-
label:
|
|
114
|
-
strokeWidth:
|
|
133
|
+
label: l,
|
|
134
|
+
strokeWidth: a = 4,
|
|
115
135
|
arcPercentage: o = 0.75
|
|
116
136
|
}) => {
|
|
117
|
-
const n = Math.min(Math.max(e, 0), t),
|
|
137
|
+
const n = Math.min(Math.max(e, 0), t), s = l ?? `${n}/${t}`, u = t <= 0 ? 0 : n / t, f = (r - a) / 2, p = r / 2, h = r / 2, c = 2 * Math.PI * f, m = c * o, b = m * (1 - u), g = n <= 0, D = `${m} ${c}`, P = g ? m - 2 : b;
|
|
118
138
|
return {
|
|
119
|
-
displayLabel:
|
|
139
|
+
displayLabel: s,
|
|
120
140
|
progress: u,
|
|
121
|
-
r:
|
|
141
|
+
r: f,
|
|
122
142
|
cx: p,
|
|
123
143
|
cy: h,
|
|
124
144
|
circumference: c,
|
|
125
|
-
trackArcLength:
|
|
126
|
-
trackDashArray: `${
|
|
145
|
+
trackArcLength: m,
|
|
146
|
+
trackDashArray: `${m} ${c}`,
|
|
127
147
|
progressDashArray: D,
|
|
128
148
|
progressDashOffset: P,
|
|
129
149
|
showMinimalDot: g
|
|
130
150
|
};
|
|
131
|
-
},
|
|
151
|
+
}, fe = (e) => S(
|
|
132
152
|
() => ({
|
|
133
153
|
integerPart: Array.from(e.integerPart, (t) => ({
|
|
134
154
|
value: t,
|
|
@@ -140,57 +160,57 @@ const se = ({
|
|
|
140
160
|
})) : []
|
|
141
161
|
}),
|
|
142
162
|
[e.integerPart, e.decimalPart]
|
|
143
|
-
),
|
|
163
|
+
), me = (e, t, r) => {
|
|
144
164
|
if (t) return r;
|
|
145
|
-
const
|
|
146
|
-
return e.currencyPosition === "end" ? `${
|
|
165
|
+
const l = e.decimalPart ? `${e.decimalSeparator}${e.decimalPart}` : "", a = `${e.integerPart}${l}`;
|
|
166
|
+
return e.currencyPosition === "end" ? `${a} ${e.currencyText}` : `${e.currencyText} ${a}`;
|
|
147
167
|
};
|
|
148
|
-
function
|
|
149
|
-
const { leading:
|
|
150
|
-
let n = null,
|
|
151
|
-
const
|
|
152
|
-
|
|
168
|
+
function Q(e, t, r = {}) {
|
|
169
|
+
const { leading: l = !1, trailing: a = !0, maxWait: o } = r;
|
|
170
|
+
let n = null, s = null, u = null, f = 0, p = null, h = null, c;
|
|
171
|
+
const m = o !== void 0, b = m ? Math.max(o, t) : 0, g = (i) => {
|
|
172
|
+
f = i;
|
|
153
173
|
const d = p, y = h;
|
|
154
174
|
return p = null, h = null, c = e.apply(y, d), c;
|
|
155
|
-
}, D = (
|
|
156
|
-
const d = u ?
|
|
175
|
+
}, D = (i) => {
|
|
176
|
+
const d = u ? i - u : 0;
|
|
157
177
|
return t - d;
|
|
158
|
-
}, P = (
|
|
159
|
-
const d = u ?
|
|
160
|
-
return u === null || d >= t || d < 0 ||
|
|
161
|
-
},
|
|
162
|
-
const
|
|
163
|
-
if (P(
|
|
164
|
-
|
|
178
|
+
}, P = (i) => {
|
|
179
|
+
const d = u ? i - u : t, y = i - f;
|
|
180
|
+
return u === null || d >= t || d < 0 || m && y >= b;
|
|
181
|
+
}, w = (i) => (n = null, a && p ? g(i) : (p = null, h = null, c)), x = () => {
|
|
182
|
+
const i = Date.now();
|
|
183
|
+
if (P(i)) {
|
|
184
|
+
w(i);
|
|
165
185
|
return;
|
|
166
186
|
}
|
|
167
|
-
n = setTimeout(x, D(
|
|
168
|
-
},
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
}, k = (
|
|
172
|
-
n !== null && clearTimeout(n),
|
|
173
|
-
},
|
|
187
|
+
n = setTimeout(x, D(i));
|
|
188
|
+
}, M = () => {
|
|
189
|
+
const i = Date.now();
|
|
190
|
+
s = null, p && (g(i), n !== null && (clearTimeout(n), n = setTimeout(x, t)));
|
|
191
|
+
}, k = (i) => (f = i, n = setTimeout(x, t), m && (s = setTimeout(M, b)), l ? g(i) : c), O = () => {
|
|
192
|
+
n !== null && clearTimeout(n), s !== null && clearTimeout(s), f = 0, p = null, h = null, u = null, n = null, s = null;
|
|
193
|
+
}, R = () => n === null && s === null ? c : w(Date.now()), j = () => n !== null || s !== null, $ = function(...i) {
|
|
174
194
|
const d = Date.now(), y = P(d);
|
|
175
|
-
if (p =
|
|
195
|
+
if (p = i, h = this, u = d, y) {
|
|
176
196
|
if (n === null)
|
|
177
197
|
return k(d);
|
|
178
|
-
if (
|
|
198
|
+
if (m)
|
|
179
199
|
return clearTimeout(n), n = setTimeout(x, t), g(d);
|
|
180
200
|
}
|
|
181
201
|
return n === null && (n = setTimeout(x, t)), c;
|
|
182
202
|
};
|
|
183
|
-
return $.cancel =
|
|
203
|
+
return $.cancel = O, $.flush = R, $.pending = j, $;
|
|
184
204
|
}
|
|
185
|
-
function
|
|
186
|
-
const { leading:
|
|
187
|
-
return
|
|
188
|
-
leading:
|
|
189
|
-
trailing:
|
|
205
|
+
function pe(e, t, r = {}) {
|
|
206
|
+
const { leading: l = !0, trailing: a = !0 } = r;
|
|
207
|
+
return Q(e, t, {
|
|
208
|
+
leading: l,
|
|
209
|
+
trailing: a,
|
|
190
210
|
maxWait: t
|
|
191
211
|
});
|
|
192
212
|
}
|
|
193
|
-
const
|
|
213
|
+
const he = ({
|
|
194
214
|
onClick: e,
|
|
195
215
|
disabled: t
|
|
196
216
|
}) => e ? t ? {
|
|
@@ -204,38 +224,41 @@ const me = ({
|
|
|
204
224
|
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), e?.(r));
|
|
205
225
|
},
|
|
206
226
|
onClick: e
|
|
207
|
-
} : void 0,
|
|
227
|
+
} : void 0, C = " ", ge = ({
|
|
208
228
|
label: e,
|
|
209
229
|
placeholder: t
|
|
210
230
|
}) => {
|
|
211
231
|
const r = typeof t == "string" && t.trim().length > 0 ? t : void 0;
|
|
212
232
|
return e ? {
|
|
213
|
-
inputPlaceholder: r ??
|
|
233
|
+
inputPlaceholder: r ?? C,
|
|
214
234
|
labelStaysFloatedWithPlaceholder: r !== void 0
|
|
215
235
|
} : {
|
|
216
|
-
inputPlaceholder: t ??
|
|
236
|
+
inputPlaceholder: t ?? C,
|
|
217
237
|
labelStaysFloatedWithPlaceholder: !1
|
|
218
238
|
};
|
|
219
239
|
};
|
|
220
240
|
export {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
ie as
|
|
241
|
+
A as AVATAR_COLOR_KEYS,
|
|
242
|
+
oe as DisabledProvider,
|
|
243
|
+
T as assignRef,
|
|
244
|
+
me as buildAriaLabel,
|
|
245
|
+
ie as cn,
|
|
246
|
+
ce as createPropsResolver,
|
|
226
247
|
G as createSafeContext,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
248
|
+
Q as debounce,
|
|
249
|
+
z as formatThousands,
|
|
250
|
+
he as getButtonA11yProps,
|
|
251
|
+
ne as getFontSize,
|
|
252
|
+
de as getStepperCalculations,
|
|
253
|
+
F as hashString,
|
|
232
254
|
J as mergeRefs,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
ue as
|
|
255
|
+
ae as resolveAvatarColorKey,
|
|
256
|
+
ge as resolveBaseInputPlaceholder,
|
|
257
|
+
Y as shallowEqual,
|
|
258
|
+
le as textFormatter,
|
|
259
|
+
pe as throttle,
|
|
260
|
+
re as toPascalCase,
|
|
261
|
+
se as useDisabledContext,
|
|
262
|
+
ue as useMergedRef,
|
|
263
|
+
fe as useSplitText
|
|
241
264
|
};
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.48",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"keywords": [
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
55
55
|
"class-variance-authority": "^0.7.1",
|
|
56
56
|
"@tanstack/react-table": "^8.21.3",
|
|
57
|
-
"@ledgerhq/lumen-design-core": "0.1.
|
|
57
|
+
"@ledgerhq/lumen-design-core": "0.1.22",
|
|
58
58
|
"clsx": "^2.1.1",
|
|
59
59
|
"react": "^18.0.0 || ^19.0.0",
|
|
60
60
|
"react-dom": "^18.0.0 || ^19.0.0",
|
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.49",
|
|
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.1.
|
|
44
|
+
"@ledgerhq/lumen-utils-shared": "0.1.10",
|
|
45
45
|
"i18next": "^23.7.0",
|
|
46
46
|
"react-i18next": "^14.0.0"
|
|
47
47
|
},
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
55
55
|
"class-variance-authority": "^0.7.1",
|
|
56
56
|
"@tanstack/react-table": "^8.21.3",
|
|
57
|
-
"@ledgerhq/lumen-design-core": "0.1.
|
|
57
|
+
"@ledgerhq/lumen-design-core": "0.1.23",
|
|
58
58
|
"clsx": "^2.1.1",
|
|
59
59
|
"react": "^18.0.0 || ^19.0.0",
|
|
60
60
|
"react-dom": "^18.0.0 || ^19.0.0",
|