@ledgerhq/lumen-ui-react 0.1.61 → 0.1.63
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.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +80 -63
- package/dist/lib/Components/core/AddressInput/AddressInput.js +1 -1
- package/dist/lib/Components/core/AmountDisplay/AmountDisplay.js +1 -1
- package/dist/lib/Components/core/AmountInput/AmountInput.js +17 -17
- package/dist/lib/Components/core/AmountInput/useAmountInputValue/useAmountInputValue.js +3 -3
- package/dist/lib/Components/core/Avatar/Avatar.js +7 -7
- package/dist/lib/Components/core/Avatar/resolveAvatarColor.js +2 -2
- package/dist/lib/Components/core/AvatarButton/AvatarButton.js +2 -2
- package/dist/lib/Components/core/Banner/Banner.js +9 -9
- package/dist/lib/Components/core/Button/Button.js +4 -4
- package/dist/lib/Components/core/Card/Card.js +15 -15
- package/dist/lib/Components/core/CardButton/CardButton.d.ts +2 -0
- package/dist/lib/Components/core/CardButton/CardButton.d.ts.map +1 -1
- package/dist/lib/Components/core/CardButton/CardButton.js +4 -4
- package/dist/lib/Components/core/ContentBanner/ContentBanner.js +1 -1
- package/dist/lib/Components/core/DataTable/DataTable.js +42 -42
- package/dist/lib/Components/core/Dialog/DialogHeader/DialogHeader.js +1 -1
- package/dist/lib/Components/core/Divider/Divider.js +4 -4
- package/dist/lib/Components/core/DotCount/DotCount.js +3 -3
- package/dist/lib/Components/core/DotIcon/DotIcon.js +11 -11
- package/dist/lib/Components/core/DotSymbol/DotSymbol.js +7 -7
- package/dist/lib/Components/core/Link/Link.d.ts +1 -1
- package/dist/lib/Components/core/Link/Link.d.ts.map +1 -1
- package/dist/lib/Components/core/Link/Link.js +25 -23
- package/dist/lib/Components/core/Link/types.d.ts +1 -1
- package/dist/lib/Components/core/Link/types.d.ts.map +1 -1
- package/dist/lib/Components/core/ListItem/ListItem.js +8 -8
- package/dist/lib/Components/core/MediaBanner/MediaBanner.js +4 -4
- package/dist/lib/Components/core/MediaCard/MediaCard.js +1 -1
- package/dist/lib/Components/core/MediaImage/MediaImage.js +5 -5
- package/dist/lib/Components/core/Menu/Menu.js +25 -25
- package/dist/lib/Components/core/NavBar/CoinCapsule.js +4 -4
- package/dist/lib/Components/core/NavBar/NavBar.js +3 -3
- package/dist/lib/Components/core/PageIndicator/PageIndicator.js +5 -5
- package/dist/lib/Components/core/Pagination/Pagination.js +1 -1
- package/dist/lib/Components/core/Popover/Popover.js +13 -13
- package/dist/lib/Components/core/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/lib/Components/core/SegmentedControl/SegmentedControl.js +80 -84
- package/dist/lib/Components/core/Select/Select.d.ts.map +1 -1
- package/dist/lib/Components/core/Select/Select.js +108 -107
- package/dist/lib/Components/core/SideBar/SideBar.js +33 -33
- package/dist/lib/Components/core/Spinner/Spinner.js +1 -1
- package/dist/lib/Components/core/Spot/Spot.js +13 -13
- package/dist/lib/Components/core/Stepper/Stepper.d.ts +4 -3
- package/dist/lib/Components/core/Stepper/Stepper.d.ts.map +1 -1
- package/dist/lib/Components/core/Stepper/Stepper.js +137 -62
- package/dist/lib/Components/core/Stepper/types.d.ts +12 -2
- package/dist/lib/Components/core/Stepper/types.d.ts.map +1 -1
- package/dist/lib/Components/core/Subheader/Subheader.d.ts.map +1 -1
- package/dist/lib/Components/core/Subheader/Subheader.js +33 -29
- package/dist/lib/Components/core/Table/Table.js +10 -10
- package/dist/lib/Components/core/ThemeProvider/ThemeProvider.js +6 -6
- package/dist/lib/Components/core/ThemeProvider/ThemeProvider.types.d.ts +1 -1
- package/dist/lib/Components/core/ThemeProvider/ThemeProvider.types.d.ts.map +1 -1
- package/dist/lib/Components/core/Timeline/Timeline.d.ts +54 -0
- package/dist/lib/Components/core/Timeline/Timeline.d.ts.map +1 -0
- package/dist/lib/Components/core/Timeline/Timeline.js +228 -0
- package/dist/lib/Components/core/Timeline/index.d.ts +3 -0
- package/dist/lib/Components/core/Timeline/index.d.ts.map +1 -0
- package/dist/lib/Components/core/Timeline/types.d.ts +148 -0
- package/dist/lib/Components/core/Timeline/types.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/Toast.d.ts +25 -0
- package/dist/lib/Components/core/Toast/Toast.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/Toast.js +68 -0
- package/dist/lib/Components/core/Toast/Toaster.d.ts +27 -0
- package/dist/lib/Components/core/Toast/Toaster.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/Toaster.js +92 -0
- package/dist/lib/Components/core/Toast/hooks/useToastCollapse.d.ts +15 -0
- package/dist/lib/Components/core/Toast/hooks/useToastCollapse.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/hooks/useToastCollapse.js +15 -0
- package/dist/lib/Components/core/Toast/hooks/useToastViewportPause.d.ts +24 -0
- package/dist/lib/Components/core/Toast/hooks/useToastViewportPause.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/hooks/useToastViewportPause.js +27 -0
- package/dist/lib/Components/core/Toast/index.d.ts +5 -0
- package/dist/lib/Components/core/Toast/index.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/styles.d.ts +20 -0
- package/dist/lib/Components/core/Toast/styles.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/styles.js +77 -0
- package/dist/lib/Components/core/Toast/types.d.ts +81 -0
- package/dist/lib/Components/core/Toast/types.d.ts.map +1 -0
- package/dist/lib/Components/core/Trend/Trend.js +3 -3
- package/dist/lib/Components/core/index.d.ts +2 -0
- package/dist/lib/Components/core/index.d.ts.map +1 -1
- package/dist/lib/Components/internal/BaseButton/BaseButton.js +7 -7
- package/dist/lib/Components/internal/BaseInput/BaseInput.js +22 -22
- package/dist/lib/Components/internal/BaseInput/BaseInputMultiline.js +12 -12
- package/dist/lib/Components/internal/BaseInput/useAutosizeTextarea/useAutosizeTextarea.js +4 -4
- package/dist/lib/Components/internal/BaseTag/BaseTag.js +4 -4
- package/dist/lib/Components/symbols/Icon/createIcon.js +3 -3
- package/dist/lib/Components/visualization/CartesianChart/CartesianChart.d.ts.map +1 -1
- package/dist/lib/Components/visualization/CartesianChart/CartesianChart.js +36 -35
- package/dist/lib/Components/visualization/CartesianChart/types.d.ts +1 -1
- package/dist/lib/Components/visualization/DonutChart/DonutChart.d.ts.map +1 -1
- package/dist/lib/Components/visualization/DonutChart/DonutChart.js +31 -31
- package/dist/lib/Components/visualization/DonutChart/DonutChartCenter.js +2 -2
- package/dist/lib/Components/visualization/DonutChart/DonutRing.d.ts.map +1 -1
- package/dist/lib/Components/visualization/DonutChart/DonutRing.js +13 -12
- package/dist/lib/Components/visualization/DonutChart/types.d.ts +1 -1
- package/dist/lib/Components/visualization/Legend/Legend.d.ts +1 -1
- package/dist/lib/Components/visualization/Legend/Legend.d.ts.map +1 -1
- package/dist/lib/Components/visualization/Legend/Legend.js +6 -10
- package/dist/lib/Components/visualization/Legend/types.d.ts +2 -2
- package/dist/lib/Components/visualization/LineChart/LineChart.d.ts +1 -1
- package/dist/lib/Components/visualization/LineChart/LineChart.d.ts.map +1 -1
- package/dist/lib/Components/visualization/LineChart/LineChart.js +90 -84
- package/dist/lib/Components/visualization/LineChart/types.d.ts +1 -1
- package/dist/lib/Components/visualization/LineChart/utils.d.ts +2 -1
- package/dist/lib/Components/visualization/LineChart/utils.d.ts.map +1 -1
- package/dist/lib/Components/visualization/LineChart/utils.js +23 -22
- package/dist/lib/Components/visualization/config.d.ts +0 -3
- package/dist/lib/Components/visualization/config.d.ts.map +1 -1
- package/dist/lib/Components/visualization/config.js +3 -6
- package/dist/libs/utils-shared/dist/index.js +353 -140
- package/dist/package.json +4 -6
- package/dist/translations/index.d.ts +3 -0
- package/dist/translations/index.d.ts.map +1 -0
- package/dist/{i18n → translations}/languages.d.ts +0 -5
- package/dist/translations/languages.d.ts.map +1 -0
- package/dist/{i18n → translations}/languages.js +1 -2
- package/dist/{i18n → translations}/locales/en.json.d.ts +11 -0
- package/dist/{i18n → translations}/locales/en.json.js +2 -2
- package/dist/translations/translations.d.ts +727 -0
- package/dist/translations/translations.d.ts.map +1 -0
- package/dist/translations/translations.js +22 -0
- package/package.json +4 -6
- package/dist/_virtual/dynamic-import-helper.js +0 -9
- package/dist/i18n/I18nProvider.d.ts +0 -8
- package/dist/i18n/I18nProvider.d.ts.map +0 -1
- package/dist/i18n/I18nProvider.js +0 -14
- package/dist/i18n/i18n.d.ts +0 -12
- package/dist/i18n/i18n.d.ts.map +0 -1
- package/dist/i18n/i18n.js +0 -42
- package/dist/i18n/index.d.ts +0 -4
- package/dist/i18n/index.d.ts.map +0 -1
- package/dist/i18n/languages.d.ts.map +0 -1
- package/dist/i18n/useCommonTranslation.d.ts +0 -2
- package/dist/i18n/useCommonTranslation.d.ts.map +0 -1
- package/dist/i18n/useCommonTranslation.js +0 -6
- package/dist/node_modules/i18next/dist/esm/i18next.js +0 -1479
- package/dist/node_modules/react-i18next/dist/es/I18nextProvider.js +0 -19
- package/dist/node_modules/react-i18next/dist/es/context.js +0 -17
- package/dist/node_modules/react-i18next/dist/es/defaults.js +0 -22
- package/dist/node_modules/react-i18next/dist/es/i18nInstance.js +0 -8
- package/dist/node_modules/react-i18next/dist/es/initReactI18next.js +0 -11
- package/dist/node_modules/react-i18next/dist/es/unescape.js +0 -25
- package/dist/node_modules/react-i18next/dist/es/useTranslation.js +0 -65
- package/dist/node_modules/react-i18next/dist/es/utils.js +0 -57
- /package/dist/{i18n → translations}/locales/de.json.d.ts +0 -0
- /package/dist/{i18n → translations}/locales/de.json.js +0 -0
- /package/dist/{i18n → translations}/locales/es.json.d.ts +0 -0
- /package/dist/{i18n → translations}/locales/es.json.js +0 -0
- /package/dist/{i18n → translations}/locales/fr.json.d.ts +0 -0
- /package/dist/{i18n → translations}/locales/fr.json.js +0 -0
- /package/dist/{i18n → translations}/locales/ja.json.d.ts +0 -0
- /package/dist/{i18n → translations}/locales/ja.json.js +0 -0
- /package/dist/{i18n → translations}/locales/ko.json.d.ts +0 -0
- /package/dist/{i18n → translations}/locales/ko.json.js +0 -0
- /package/dist/{i18n → translations}/locales/pt.json.d.ts +0 -0
- /package/dist/{i18n → translations}/locales/pt.json.js +0 -0
- /package/dist/{i18n → translations}/locales/ru.json.d.ts +0 -0
- /package/dist/{i18n → translations}/locales/ru.json.js +0 -0
- /package/dist/{i18n → translations}/locales/th.json.d.ts +0 -0
- /package/dist/{i18n → translations}/locales/th.json.js +0 -0
- /package/dist/{i18n → translations}/locales/tr.json.d.ts +0 -0
- /package/dist/{i18n → translations}/locales/tr.json.js +0 -0
- /package/dist/{i18n → translations}/locales/zh.json.d.ts +0 -0
- /package/dist/{i18n → translations}/locales/zh.json.js +0 -0
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { clsx as
|
|
4
|
-
import { twMerge as
|
|
5
|
-
function
|
|
1
|
+
import { jsx as q } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as I, createContext as F, useContext as _, useRef as y, useEffect as k } from "react";
|
|
3
|
+
import { clsx as J } from "clsx";
|
|
4
|
+
import { twMerge as Q } from "tailwind-merge";
|
|
5
|
+
function V(e) {
|
|
6
6
|
let t = 0;
|
|
7
7
|
for (let r = 0; r < e.length; r++)
|
|
8
8
|
t = Math.imul(t, 31) + e.charCodeAt(r) | 0;
|
|
9
9
|
return t;
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const Z = {
|
|
12
12
|
md: { max: 48, min: 17, scale: 2, startAt: 0 },
|
|
13
13
|
sm: { max: 28, min: 12, scale: 2, startAt: 6 }
|
|
14
14
|
};
|
|
15
|
-
function
|
|
16
|
-
const { max: r, min:
|
|
17
|
-
return Math.max(
|
|
15
|
+
function Ce(e, t = "md") {
|
|
16
|
+
const { max: r, min: n, scale: a, startAt: s } = Z[t], o = e.replace(/\D/g, "").length;
|
|
17
|
+
return Math.max(n, r - Math.max(0, o - s) * a);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function H(e, t = !0) {
|
|
20
20
|
if (!e) return "";
|
|
21
|
-
const r = e.includes("."), [
|
|
22
|
-
return r && t ? a ? `${
|
|
21
|
+
const r = e.includes("."), [n, a] = e.split("."), s = n.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
22
|
+
return r && t ? a ? `${s}.${a}` : `${s}.` : s;
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const ee = (e) => e.replaceAll(",", ".").replaceAll(/[^\d.]/g, ""), te = (e) => e.replace(/^0+(?=\d)/, ""), M = (e, t) => t > 0 ? e.slice(0, t) : e, re = (e, t) => M(e.replaceAll(/\D/g, ""), t), ne = (e, t, r) => {
|
|
25
25
|
if (e === ".") return "0.";
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
28
|
-
const a =
|
|
29
|
-
return
|
|
26
|
+
const n = e.indexOf(".");
|
|
27
|
+
if (n === -1) return M(e, t);
|
|
28
|
+
const a = M(e.slice(0, n), t) || "0", s = e.slice(n + 1).replaceAll(".", "").slice(0, r);
|
|
29
|
+
return s.length > 0 ? `${a}.${s}` : e.endsWith(".") ? `${a}.` : a;
|
|
30
30
|
};
|
|
31
|
-
function
|
|
31
|
+
function Ee(e, t = {}) {
|
|
32
32
|
const {
|
|
33
33
|
allowDecimals: r = !0,
|
|
34
|
-
thousandsSeparator:
|
|
34
|
+
thousandsSeparator: n = !0,
|
|
35
35
|
maxIntegerLength: a = 9,
|
|
36
|
-
maxDecimalLength:
|
|
37
|
-
decimalSeparator:
|
|
38
|
-
} = t, i =
|
|
39
|
-
return
|
|
36
|
+
maxDecimalLength: s = 9,
|
|
37
|
+
decimalSeparator: o = "."
|
|
38
|
+
} = t, i = te(ee(e)), l = r ? ne(i, a, s) : re(i, a), c = n ? H(l) : l;
|
|
39
|
+
return o === "." ? c : c.replaceAll(".", o);
|
|
40
40
|
}
|
|
41
|
-
const
|
|
41
|
+
const P = [
|
|
42
42
|
"orange",
|
|
43
43
|
"green",
|
|
44
44
|
"blue",
|
|
@@ -48,105 +48,112 @@ const A = [
|
|
|
48
48
|
"turquoise",
|
|
49
49
|
"pink"
|
|
50
50
|
];
|
|
51
|
-
function
|
|
52
|
-
const t = (
|
|
53
|
-
return
|
|
51
|
+
function Le(e) {
|
|
52
|
+
const t = (V(e) % P.length + P.length) % P.length;
|
|
53
|
+
return P[t];
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function ae(e, t) {
|
|
56
56
|
if (Object.is(e, t)) return !0;
|
|
57
|
-
const r = e,
|
|
58
|
-
return a.length !==
|
|
59
|
-
(
|
|
57
|
+
const r = e, n = t, a = Object.keys(r), s = Object.keys(n);
|
|
58
|
+
return a.length !== s.length ? !1 : a.every(
|
|
59
|
+
(o) => Object.prototype.hasOwnProperty.call(n, o) && Object.is(r[o], n[o])
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
const r =
|
|
64
|
-
const i =
|
|
65
|
-
return
|
|
62
|
+
function se(e, t) {
|
|
63
|
+
const r = F(t), n = ({ children: s, value: o }) => {
|
|
64
|
+
const i = y(o);
|
|
65
|
+
return ae(i.current, o) || (i.current = o), /* @__PURE__ */ q(r.Provider, { value: i.current, children: s });
|
|
66
66
|
};
|
|
67
|
-
|
|
67
|
+
n.displayName = e + "Provider";
|
|
68
68
|
function a({
|
|
69
|
-
consumerName:
|
|
70
|
-
contextRequired:
|
|
69
|
+
consumerName: s,
|
|
70
|
+
contextRequired: o
|
|
71
71
|
}) {
|
|
72
|
-
const i =
|
|
72
|
+
const i = _(r);
|
|
73
73
|
if (i)
|
|
74
74
|
return i;
|
|
75
|
-
if (
|
|
75
|
+
if (o)
|
|
76
76
|
throw new Error(
|
|
77
|
-
`${
|
|
77
|
+
`${s} must be used within ${e}`
|
|
78
78
|
);
|
|
79
79
|
return t || {};
|
|
80
80
|
}
|
|
81
|
-
return [
|
|
81
|
+
return [n, a];
|
|
82
82
|
}
|
|
83
|
-
const [
|
|
83
|
+
const [Re, oe] = se("Disabled", { disabled: !1 }), Ne = ({
|
|
84
84
|
consumerName: e,
|
|
85
85
|
contextRequired: t,
|
|
86
86
|
mergeWith: r
|
|
87
87
|
}) => {
|
|
88
|
-
const
|
|
88
|
+
const n = oe({
|
|
89
89
|
consumerName: e,
|
|
90
90
|
contextRequired: t ?? !1
|
|
91
91
|
});
|
|
92
|
-
return !!(r?.disabled ||
|
|
92
|
+
return !!(r?.disabled || n.disabled);
|
|
93
93
|
};
|
|
94
|
-
function
|
|
95
|
-
return
|
|
94
|
+
function We(...e) {
|
|
95
|
+
return Q(J(e));
|
|
96
96
|
}
|
|
97
|
-
const
|
|
98
|
-
function
|
|
97
|
+
const C = (e) => typeof e == "string" || typeof e == "number", qe = (e) => Array.isArray(e) ? e.every(C) : C(e);
|
|
98
|
+
function E(e, t) {
|
|
99
99
|
if (typeof e == "function")
|
|
100
100
|
return e(t);
|
|
101
101
|
typeof e == "object" && e !== null && "current" in e && (e.current = t);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function ie(...e) {
|
|
104
104
|
const t = /* @__PURE__ */ new Map();
|
|
105
105
|
return (r) => {
|
|
106
106
|
if (r === null) {
|
|
107
|
-
e.forEach((
|
|
108
|
-
const a = t.get(
|
|
109
|
-
typeof a == "function" && a(),
|
|
107
|
+
e.forEach((n) => {
|
|
108
|
+
const a = t.get(n);
|
|
109
|
+
typeof a == "function" && a(), E(n, null);
|
|
110
110
|
}), t.clear();
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
|
-
e.forEach((
|
|
114
|
-
const a =
|
|
115
|
-
typeof a == "function" && t.set(
|
|
113
|
+
e.forEach((n) => {
|
|
114
|
+
const a = E(n, r);
|
|
115
|
+
typeof a == "function" && t.set(n, a);
|
|
116
116
|
});
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
return
|
|
119
|
+
function Fe(...e) {
|
|
120
|
+
return I(() => ie(...e), e);
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
const le = (e, t) => {
|
|
123
|
+
let r = e;
|
|
124
|
+
for (const n of t) {
|
|
125
|
+
if (r == null)
|
|
126
|
+
return;
|
|
127
|
+
r = r[n];
|
|
128
|
+
}
|
|
129
|
+
return r;
|
|
130
|
+
};
|
|
131
|
+
function _e(e) {
|
|
123
132
|
return function(t, r) {
|
|
124
133
|
return e[t][r];
|
|
125
134
|
};
|
|
126
135
|
}
|
|
127
|
-
const
|
|
136
|
+
const Be = ({
|
|
128
137
|
currentStep: e,
|
|
129
138
|
totalSteps: t,
|
|
130
139
|
size: r,
|
|
131
|
-
label:
|
|
132
|
-
strokeWidth: a = 4
|
|
133
|
-
arcPercentage: o = 0.75
|
|
140
|
+
label: n,
|
|
141
|
+
strokeWidth: a = 4
|
|
134
142
|
}) => {
|
|
135
|
-
const
|
|
143
|
+
const s = Math.min(Math.max(e, 0), t), o = n ?? `${s}/${t}`, i = t <= 0 ? 0 : s / t, l = (r - a) / 2, c = r / 2, p = r / 2, d = 2 * Math.PI * l, g = t <= 1 ? 0 : 12 / 360 * d + a, h = t <= 1 ? d : Math.max(d / t - g, 0), v = `${h} ${g}`, b = `${d} ${d}`, S = d * (1 - i), w = h + g / 2;
|
|
136
144
|
return {
|
|
137
|
-
displayLabel:
|
|
138
|
-
progress:
|
|
139
|
-
r:
|
|
140
|
-
cx:
|
|
141
|
-
cy:
|
|
142
|
-
circumference:
|
|
143
|
-
trackArcLength: m,
|
|
144
|
-
trackDashArray: `${m} ${c}`,
|
|
145
|
+
displayLabel: o,
|
|
146
|
+
progress: i,
|
|
147
|
+
r: l,
|
|
148
|
+
cx: c,
|
|
149
|
+
cy: p,
|
|
150
|
+
circumference: d,
|
|
145
151
|
progressDashArray: v,
|
|
146
|
-
|
|
147
|
-
|
|
152
|
+
progressMaskDashArray: b,
|
|
153
|
+
progressDashOffset: S,
|
|
154
|
+
dashPatternOffset: w
|
|
148
155
|
};
|
|
149
|
-
},
|
|
156
|
+
}, Ke = (e) => I(
|
|
150
157
|
() => ({
|
|
151
158
|
integerPart: Array.from(e.integerPart, (t) => ({
|
|
152
159
|
value: t,
|
|
@@ -158,57 +165,215 @@ const fe = ({
|
|
|
158
165
|
})) : []
|
|
159
166
|
}),
|
|
160
167
|
[e.integerPart, e.decimalPart]
|
|
161
|
-
),
|
|
168
|
+
), Ue = (e, t, r) => {
|
|
162
169
|
if (t) return r;
|
|
163
|
-
const
|
|
170
|
+
const n = e.decimalPart ? `${e.decimalSeparator}${e.decimalPart}` : "", a = `${e.integerPart}${n}`;
|
|
164
171
|
return e.currencyPosition === "end" ? `${a} ${e.currencyText}` : `${e.currencyText} ${a}`;
|
|
165
172
|
};
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
173
|
+
let L = 0;
|
|
174
|
+
const ce = {
|
|
175
|
+
info: 5e3,
|
|
176
|
+
success: 5e3,
|
|
177
|
+
warning: 0,
|
|
178
|
+
error: 0
|
|
179
|
+
}, ue = 3, B = [], ze = (e) => Number.isInteger(e) && e >= 1 ? e : ue, Xe = (e, t) => {
|
|
180
|
+
if (e.duration !== void 0)
|
|
181
|
+
return e.duration === 0 ? 1 / 0 : e.duration;
|
|
182
|
+
if (e.loading) return 1 / 0;
|
|
183
|
+
const r = t?.[e.appearance] ?? ce[e.appearance];
|
|
184
|
+
return r === 0 ? 1 / 0 : r;
|
|
185
|
+
}, de = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : (L += 1, `toast-${Date.now()}-${L}`), pe = (e, t) => ({
|
|
186
|
+
id: e,
|
|
187
|
+
appearance: t.appearance ?? "info",
|
|
188
|
+
loading: t.loading ?? !1,
|
|
189
|
+
title: t.title,
|
|
190
|
+
duration: t.duration,
|
|
191
|
+
dismissible: t.dismissible ?? !0,
|
|
192
|
+
action: t.action
|
|
193
|
+
}), fe = (e) => {
|
|
194
|
+
const t = {};
|
|
195
|
+
for (const r of Object.keys(e))
|
|
196
|
+
(e[r] !== void 0 || r === "action") && Object.assign(t, { [r]: e[r] });
|
|
197
|
+
return t;
|
|
198
|
+
};
|
|
199
|
+
let f = B;
|
|
200
|
+
const O = /* @__PURE__ */ new Set();
|
|
201
|
+
let $ = 0;
|
|
202
|
+
const D = () => {
|
|
203
|
+
for (const e of O) e();
|
|
204
|
+
}, me = (e) => (O.add(e), () => O.delete(e)), ge = () => f, he = () => B, ye = (e) => {
|
|
205
|
+
const t = de();
|
|
206
|
+
return f = [...f, pe(t, e)], D(), t;
|
|
207
|
+
}, be = (e, t) => {
|
|
208
|
+
const r = f.findIndex((o) => o.id === e);
|
|
209
|
+
if (r === -1) return;
|
|
210
|
+
const n = fe(t), a = n.duration !== void 0 || n.loading !== void 0 || n.appearance !== void 0, s = {
|
|
211
|
+
...f[r],
|
|
212
|
+
...n,
|
|
213
|
+
...a && { duration: n.duration }
|
|
214
|
+
};
|
|
215
|
+
f = f.map((o, i) => i === r ? s : o), D();
|
|
216
|
+
}, xe = (e) => {
|
|
217
|
+
const t = f.findIndex((r) => r.id === e);
|
|
218
|
+
t !== -1 && (f = f[t].exiting ? f.filter((r) => r.id !== e) : f.map(
|
|
219
|
+
(r) => r.id === e ? { ...r, exiting: !0 } : r
|
|
220
|
+
), D());
|
|
221
|
+
}, Te = () => {
|
|
222
|
+
f.length !== 0 && (f = f.map((e) => ({ ...e, exiting: !0 })), D());
|
|
223
|
+
}, ve = () => ($ += 1, $ > 1 && console.warn(
|
|
224
|
+
`[Toaster] ${$} <Toaster /> instances are mounted at once. Every toast will render once per instance. Mount a single <Toaster /> for the whole app.`
|
|
225
|
+
), () => {
|
|
226
|
+
$ -= 1;
|
|
227
|
+
}), K = {
|
|
228
|
+
subscribe: me,
|
|
229
|
+
getSnapshot: ge,
|
|
230
|
+
getServerSnapshot: he,
|
|
231
|
+
registerRenderer: ve,
|
|
232
|
+
add: ye,
|
|
233
|
+
update: be,
|
|
234
|
+
dismiss: xe,
|
|
235
|
+
dismissAll: Te
|
|
236
|
+
}, Ye = (e, t) => {
|
|
237
|
+
const r = y(/* @__PURE__ */ new Set());
|
|
238
|
+
return k(() => {
|
|
239
|
+
r.current = new Set(
|
|
240
|
+
e.filter(
|
|
241
|
+
(n, a) => a >= t || r.current.has(n.id)
|
|
242
|
+
).map((n) => n.id)
|
|
243
|
+
), e.slice(t).filter((n) => n.exiting).forEach((n) => K.dismiss(n.id));
|
|
244
|
+
}, [e, t]), (n) => r.current.has(n);
|
|
245
|
+
}, we = ({
|
|
246
|
+
durationMs: e,
|
|
247
|
+
paused: t,
|
|
248
|
+
exiting: r,
|
|
249
|
+
onExpire: n
|
|
250
|
+
}) => {
|
|
251
|
+
const a = y(n);
|
|
252
|
+
a.current = n;
|
|
253
|
+
const s = y(e), o = y(e), i = y(null);
|
|
254
|
+
k(() => {
|
|
255
|
+
if (r || (e !== o.current && (o.current = e, s.current = e), t || !Number.isFinite(s.current))) return;
|
|
256
|
+
i.current = Date.now();
|
|
257
|
+
const l = setTimeout(
|
|
258
|
+
() => a.current(),
|
|
259
|
+
s.current
|
|
260
|
+
);
|
|
261
|
+
return () => {
|
|
262
|
+
clearTimeout(l), i.current !== null && (s.current -= Date.now() - i.current, i.current = null);
|
|
263
|
+
};
|
|
264
|
+
}, [t, r, e]);
|
|
265
|
+
}, Ae = 300, Ge = ({
|
|
266
|
+
durationMs: e,
|
|
267
|
+
paused: t,
|
|
268
|
+
exiting: r,
|
|
269
|
+
onDismiss: n
|
|
270
|
+
}) => {
|
|
271
|
+
we({ durationMs: e, paused: t, exiting: r, onExpire: n });
|
|
272
|
+
const a = y(n);
|
|
273
|
+
a.current = n, k(() => {
|
|
274
|
+
if (!r) return;
|
|
275
|
+
const s = setTimeout(
|
|
276
|
+
() => a.current(),
|
|
277
|
+
Ae
|
|
278
|
+
);
|
|
279
|
+
return () => clearTimeout(s);
|
|
280
|
+
}, [r]);
|
|
281
|
+
}, R = (e, t) => typeof e == "function" ? e(t) : e, Pe = ({
|
|
282
|
+
add: e,
|
|
283
|
+
update: t,
|
|
284
|
+
dismiss: r,
|
|
285
|
+
dismissAll: n
|
|
286
|
+
}) => {
|
|
287
|
+
const a = (s) => ({
|
|
288
|
+
id: e(s)
|
|
289
|
+
});
|
|
290
|
+
return {
|
|
291
|
+
notify: a,
|
|
292
|
+
info: (s) => a({ ...s, appearance: "info" }),
|
|
293
|
+
success: (s) => a({ ...s, appearance: "success" }),
|
|
294
|
+
warning: (s) => a({ ...s, appearance: "warning" }),
|
|
295
|
+
error: (s) => a({ ...s, appearance: "error" }),
|
|
296
|
+
loading: (s) => a({ ...s, appearance: "info", loading: !0 }),
|
|
297
|
+
update: t,
|
|
298
|
+
dismiss: r,
|
|
299
|
+
dismissAll: n,
|
|
300
|
+
promise: (s, o) => {
|
|
301
|
+
const { id: i } = a({
|
|
302
|
+
...o.loading,
|
|
303
|
+
appearance: "info",
|
|
304
|
+
loading: !0
|
|
305
|
+
});
|
|
306
|
+
return s.then(
|
|
307
|
+
(l) => {
|
|
308
|
+
const c = R(o.success, l);
|
|
309
|
+
t(i, {
|
|
310
|
+
...c,
|
|
311
|
+
appearance: "success",
|
|
312
|
+
loading: !1,
|
|
313
|
+
action: c.action,
|
|
314
|
+
dismissible: c.dismissible ?? !0
|
|
315
|
+
});
|
|
316
|
+
},
|
|
317
|
+
(l) => {
|
|
318
|
+
const c = R(o.error, l);
|
|
319
|
+
t(i, {
|
|
320
|
+
...c,
|
|
321
|
+
appearance: "error",
|
|
322
|
+
loading: !1,
|
|
323
|
+
action: c.action,
|
|
324
|
+
dismissible: c.dismissible ?? !0
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
), { id: i };
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
}, Je = Pe(K);
|
|
331
|
+
function $e(e, t, r = {}) {
|
|
332
|
+
const { leading: n = !1, trailing: a = !0, maxWait: s } = r;
|
|
333
|
+
let o = null, i = null, l = null, c = 0, p = null, d = null, g;
|
|
334
|
+
const h = s !== void 0, v = h ? Math.max(s, t) : 0, b = (u) => {
|
|
335
|
+
c = u;
|
|
336
|
+
const m = p ?? [], T = d;
|
|
337
|
+
return p = null, d = null, g = e.apply(T, m), g;
|
|
338
|
+
}, S = (u) => {
|
|
339
|
+
const m = l ? u - l : 0;
|
|
340
|
+
return t - m;
|
|
341
|
+
}, w = (u) => {
|
|
342
|
+
const m = l ? u - l : t, T = u - c;
|
|
343
|
+
return l === null || m >= t || m < 0 || h && T >= v;
|
|
344
|
+
}, j = (u) => (o = null, a && p ? b(u) : (p = null, d = null, g)), x = () => {
|
|
345
|
+
const u = Date.now();
|
|
346
|
+
if (w(u)) {
|
|
347
|
+
j(u);
|
|
183
348
|
return;
|
|
184
349
|
}
|
|
185
|
-
|
|
186
|
-
},
|
|
187
|
-
const
|
|
188
|
-
i = null, p && (
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
},
|
|
192
|
-
const
|
|
193
|
-
if (p =
|
|
194
|
-
if (
|
|
195
|
-
return
|
|
196
|
-
if (
|
|
197
|
-
return clearTimeout(
|
|
350
|
+
o = setTimeout(x, S(u));
|
|
351
|
+
}, U = () => {
|
|
352
|
+
const u = Date.now();
|
|
353
|
+
i = null, p && (b(u), o !== null && (clearTimeout(o), o = setTimeout(x, t)));
|
|
354
|
+
}, z = (u) => (c = u, o = setTimeout(x, t), h && (i = setTimeout(U, v)), n ? b(u) : g), X = () => {
|
|
355
|
+
o !== null && clearTimeout(o), i !== null && clearTimeout(i), c = 0, p = null, d = null, l = null, o = null, i = null;
|
|
356
|
+
}, Y = () => o === null && i === null ? g : j(Date.now()), G = () => o !== null || i !== null, A = function(...u) {
|
|
357
|
+
const m = Date.now(), T = w(m);
|
|
358
|
+
if (p = u, d = this, l = m, T) {
|
|
359
|
+
if (o === null)
|
|
360
|
+
return z(m);
|
|
361
|
+
if (h)
|
|
362
|
+
return clearTimeout(o), o = setTimeout(x, t), b(m);
|
|
198
363
|
}
|
|
199
|
-
return
|
|
364
|
+
return o === null && (o = setTimeout(x, t)), g;
|
|
200
365
|
};
|
|
201
|
-
return
|
|
366
|
+
return A.cancel = X, A.flush = Y, A.pending = G, A;
|
|
202
367
|
}
|
|
203
|
-
function
|
|
204
|
-
const { leading:
|
|
205
|
-
return
|
|
206
|
-
leading:
|
|
368
|
+
function Qe(e, t, r = {}) {
|
|
369
|
+
const { leading: n = !0, trailing: a = !0 } = r;
|
|
370
|
+
return $e(e, t, {
|
|
371
|
+
leading: n,
|
|
207
372
|
trailing: a,
|
|
208
373
|
maxWait: t
|
|
209
374
|
});
|
|
210
375
|
}
|
|
211
|
-
const
|
|
376
|
+
const Ve = ({
|
|
212
377
|
onClick: e,
|
|
213
378
|
disabled: t
|
|
214
379
|
}) => e ? t ? {
|
|
@@ -222,41 +387,89 @@ const ge = ({
|
|
|
222
387
|
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), e?.(r));
|
|
223
388
|
},
|
|
224
389
|
onClick: e
|
|
225
|
-
} : void 0,
|
|
390
|
+
} : void 0, N = " ", Ze = ({
|
|
226
391
|
label: e,
|
|
227
392
|
placeholder: t
|
|
228
393
|
}) => {
|
|
229
394
|
const r = typeof t == "string" && t.trim().length > 0 ? t : void 0;
|
|
230
395
|
return e ? {
|
|
231
|
-
inputPlaceholder: r ??
|
|
396
|
+
inputPlaceholder: r ?? N,
|
|
232
397
|
labelStaysFloatedWithPlaceholder: r !== void 0
|
|
233
398
|
} : {
|
|
234
|
-
inputPlaceholder: t ??
|
|
399
|
+
inputPlaceholder: t ?? N,
|
|
235
400
|
labelStaysFloatedWithPlaceholder: !1
|
|
236
401
|
};
|
|
402
|
+
}, De = /\{\{\s*(\w+)\s*\}\}/g, Se = (e, t) => t ? e.replace(
|
|
403
|
+
De,
|
|
404
|
+
(r, n) => Object.hasOwn(t, n) ? String(t[n]) : r
|
|
405
|
+
) : e, Me = (e, t, r) => {
|
|
406
|
+
if (!e)
|
|
407
|
+
return r;
|
|
408
|
+
const n = e.toLowerCase().replaceAll("_", "-"), a = (s) => t.find((o) => o.toLowerCase() === s);
|
|
409
|
+
return a(n) ?? a(n.split("-")[0]) ?? r;
|
|
410
|
+
}, W = (e, t) => {
|
|
411
|
+
const r = le(e ?? {}, t.split("."));
|
|
412
|
+
return typeof r == "string" ? r : void 0;
|
|
413
|
+
}, He = ({
|
|
414
|
+
dictionaries: e,
|
|
415
|
+
defaultLocale: t,
|
|
416
|
+
fallbackLocale: r = t
|
|
417
|
+
}) => {
|
|
418
|
+
const n = Object.keys(e), a = (l, c, p) => {
|
|
419
|
+
const d = W(e[l], c) ?? W(e[r], c) ?? c;
|
|
420
|
+
return Se(d, p);
|
|
421
|
+
}, s = (l) => ({
|
|
422
|
+
locale: l,
|
|
423
|
+
t: (c, p) => a(l, c, p)
|
|
424
|
+
}), o = F({ locale: t, t: (l) => l }), i = ({
|
|
425
|
+
locale: l,
|
|
426
|
+
children: c
|
|
427
|
+
}) => {
|
|
428
|
+
const p = Me(
|
|
429
|
+
l,
|
|
430
|
+
n,
|
|
431
|
+
t
|
|
432
|
+
), d = I(
|
|
433
|
+
() => s(p),
|
|
434
|
+
[p]
|
|
435
|
+
);
|
|
436
|
+
return /* @__PURE__ */ q(o.Provider, { value: d, children: c });
|
|
437
|
+
};
|
|
438
|
+
return i.displayName = "TranslationsProvider", { TranslationsProvider: i, useTranslations: () => _(o), translate: a };
|
|
237
439
|
};
|
|
238
440
|
export {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
441
|
+
P as AVATAR_COLOR_KEYS,
|
|
442
|
+
Re as DisabledProvider,
|
|
443
|
+
Ae as EXIT_ANIMATION_MS,
|
|
444
|
+
E as assignRef,
|
|
445
|
+
Ue as buildAriaLabel,
|
|
446
|
+
We as cn,
|
|
447
|
+
_e as createPropsResolver,
|
|
448
|
+
se as createSafeContext,
|
|
449
|
+
Pe as createToastController,
|
|
450
|
+
He as createTranslations,
|
|
451
|
+
$e as debounce,
|
|
452
|
+
H as formatThousands,
|
|
453
|
+
Ve as getButtonA11yProps,
|
|
454
|
+
Ce as getFontSize,
|
|
455
|
+
le as getObjectPath,
|
|
456
|
+
Be as getStepperCalculations,
|
|
457
|
+
V as hashString,
|
|
458
|
+
qe as isTextChildren,
|
|
459
|
+
ie as mergeRefs,
|
|
460
|
+
Le as resolveAvatarColorKey,
|
|
461
|
+
Ze as resolveBaseInputPlaceholder,
|
|
462
|
+
Xe as resolveDurationMs,
|
|
463
|
+
ze as resolveMaxItems,
|
|
464
|
+
ae as shallowEqual,
|
|
465
|
+
Ee as textFormatter,
|
|
466
|
+
Qe as throttle,
|
|
467
|
+
Je as toast,
|
|
468
|
+
K as toastStore,
|
|
469
|
+
Ne as useDisabledContext,
|
|
470
|
+
Fe as useMergedRef,
|
|
471
|
+
Ke as useSplitText,
|
|
472
|
+
Ye as useToastBacklog,
|
|
473
|
+
Ge as useToastLifecycle,
|
|
474
|
+
we as useToastTimer
|
|
262
475
|
};
|
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.62",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"keywords": [
|
|
@@ -47,13 +47,11 @@
|
|
|
47
47
|
]
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@ledgerhq/lumen-utils-shared": "0.1.
|
|
50
|
+
"@ledgerhq/lumen-utils-shared": "0.1.15",
|
|
51
51
|
"@types/d3-scale": "^4.0.9",
|
|
52
52
|
"@types/d3-shape": "^3.1.8",
|
|
53
53
|
"d3-scale": "^4.0.2",
|
|
54
|
-
"d3-shape": "^3.2.0"
|
|
55
|
-
"i18next": "^23.7.0",
|
|
56
|
-
"react-i18next": "^14.0.0"
|
|
54
|
+
"d3-shape": "^3.2.0"
|
|
57
55
|
},
|
|
58
56
|
"peerDependencies": {
|
|
59
57
|
"@base-ui/react": "^1.3.0",
|
|
@@ -64,7 +62,7 @@
|
|
|
64
62
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
65
63
|
"class-variance-authority": "^0.7.1",
|
|
66
64
|
"@tanstack/react-table": "^8.21.3",
|
|
67
|
-
"@ledgerhq/lumen-design-core": "0.1.
|
|
65
|
+
"@ledgerhq/lumen-design-core": "0.1.31",
|
|
68
66
|
"clsx": "^2.1.1",
|
|
69
67
|
"react": "^18.0.0 || ^19.0.0",
|
|
70
68
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/translations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -44,9 +44,4 @@ export declare const DEFAULT_LANGUAGE: "en";
|
|
|
44
44
|
* Supported locales type
|
|
45
45
|
*/
|
|
46
46
|
export type SupportedLocale = keyof typeof Languages;
|
|
47
|
-
/**
|
|
48
|
-
* Default namespace for i18n
|
|
49
|
-
* Currently there is only one namespace
|
|
50
|
-
*/
|
|
51
|
-
export declare const I18N_DEFAULT_NAMESPACE = "common";
|
|
52
47
|
//# sourceMappingURL=languages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../src/translations/languages.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC6B,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,gBAAgB,MAAkB,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,SAAS,CAAC"}
|