@ledgerhq/lumen-ui-react 0.1.62 → 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 +1 -1
- 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 +22 -22
- package/dist/lib/Components/core/Avatar/Avatar.js +7 -7
- package/dist/lib/Components/core/AvatarButton/AvatarButton.js +8 -8
- package/dist/lib/Components/core/Banner/Banner.js +1 -1
- package/dist/lib/Components/core/Button/Button.js +6 -6
- package/dist/lib/Components/core/Card/Card.js +17 -17
- package/dist/lib/Components/core/ContentBanner/ContentBanner.js +1 -1
- package/dist/lib/Components/core/DataTable/DataTable.js +45 -45
- 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 +4 -4
- package/dist/lib/Components/core/DotSymbol/DotSymbol.js +18 -18
- package/dist/lib/Components/core/Link/Link.d.ts.map +1 -1
- package/dist/lib/Components/core/Link/Link.js +25 -24
- package/dist/lib/Components/core/ListItem/ListItem.js +4 -4
- package/dist/lib/Components/core/MediaBanner/MediaBanner.js +16 -16
- package/dist/lib/Components/core/MediaButton/MediaButton.js +2 -2
- 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 +15 -15
- package/dist/lib/Components/core/Popover/Popover.js +13 -13
- package/dist/lib/Components/core/SearchInput/SearchInput.js +5 -5
- package/dist/lib/Components/core/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/lib/Components/core/SegmentedControl/SegmentedControl.js +78 -82
- package/dist/lib/Components/core/Select/Select.d.ts.map +1 -1
- package/dist/lib/Components/core/Select/Select.js +105 -104
- package/dist/lib/Components/core/SideBar/SideBar.js +28 -28
- package/dist/lib/Components/core/Spinner/Spinner.js +5 -5
- package/dist/lib/Components/core/Spot/Spot.js +10 -10
- package/dist/lib/Components/core/Stepper/Stepper.d.ts.map +1 -1
- package/dist/lib/Components/core/Stepper/Stepper.js +51 -48
- 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/Switch/Switch.js +5 -5
- package/dist/lib/Components/core/Table/Table.js +6 -6
- 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/TileButton/TileButton.js +8 -8
- package/dist/lib/Components/core/Timeline/Timeline.js +16 -16
- package/dist/lib/Components/core/Toast/Toast.js +4 -4
- package/dist/lib/Components/core/Toast/Toaster.js +9 -9
- package/dist/lib/Components/core/Trend/Trend.js +3 -3
- package/dist/lib/Components/internal/BaseButton/BaseButton.js +9 -9
- package/dist/lib/Components/internal/BaseInput/BaseInput.js +21 -21
- 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/Icon.js +4 -4
- package/dist/lib/Components/symbols/Icon/createIcon.js +5 -5
- 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 +4 -4
- 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/donutSizeContext.js +2 -2
- 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 +7 -11
- 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 +191 -143
- 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 +3 -5
- 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,41 +1,41 @@
|
|
|
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: n, scale: a, startAt: s } =
|
|
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
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
21
|
const r = e.includes("."), [n, a] = e.split("."), s = n.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
22
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
26
|
const n = e.indexOf(".");
|
|
27
|
-
if (n === -1) return
|
|
28
|
-
const a =
|
|
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
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
34
|
thousandsSeparator: n = !0,
|
|
35
35
|
maxIntegerLength: a = 9,
|
|
36
36
|
maxDecimalLength: s = 9,
|
|
37
37
|
decimalSeparator: o = "."
|
|
38
|
-
} = t, i = ee(
|
|
38
|
+
} = t, i = te(ee(e)), l = r ? ne(i, a, s) : re(i, a), c = n ? H(l) : l;
|
|
39
39
|
return o === "." ? c : c.replaceAll(".", o);
|
|
40
40
|
}
|
|
41
41
|
const P = [
|
|
@@ -48,28 +48,28 @@ const P = [
|
|
|
48
48
|
"turquoise",
|
|
49
49
|
"pink"
|
|
50
50
|
];
|
|
51
|
-
function
|
|
52
|
-
const t = (
|
|
51
|
+
function Le(e) {
|
|
52
|
+
const t = (V(e) % P.length + P.length) % P.length;
|
|
53
53
|
return P[t];
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function ae(e, t) {
|
|
56
56
|
if (Object.is(e, t)) return !0;
|
|
57
57
|
const r = e, n = t, a = Object.keys(r), s = Object.keys(n);
|
|
58
58
|
return a.length !== s.length ? !1 : a.every(
|
|
59
59
|
(o) => Object.prototype.hasOwnProperty.call(n, o) && Object.is(r[o], n[o])
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
const r =
|
|
62
|
+
function se(e, t) {
|
|
63
|
+
const r = F(t), n = ({ children: s, value: o }) => {
|
|
64
64
|
const i = y(o);
|
|
65
|
-
return
|
|
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
69
|
consumerName: s,
|
|
70
70
|
contextRequired: o
|
|
71
71
|
}) {
|
|
72
|
-
const i =
|
|
72
|
+
const i = _(r);
|
|
73
73
|
if (i)
|
|
74
74
|
return i;
|
|
75
75
|
if (o)
|
|
@@ -80,27 +80,27 @@ function ae(e, t) {
|
|
|
80
80
|
}
|
|
81
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 n =
|
|
88
|
+
const n = oe({
|
|
89
89
|
consumerName: e,
|
|
90
90
|
contextRequired: t ?? !1
|
|
91
91
|
});
|
|
92
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
|
|
97
|
+
const C = (e) => typeof e == "string" || typeof e == "number", qe = (e) => Array.isArray(e) ? e.every(C) : C(e);
|
|
98
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) {
|
|
@@ -116,35 +116,44 @@ function oe(...e) {
|
|
|
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
140
|
label: n,
|
|
132
141
|
strokeWidth: a = 4
|
|
133
142
|
}) => {
|
|
134
|
-
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,
|
|
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;
|
|
135
144
|
return {
|
|
136
145
|
displayLabel: o,
|
|
137
146
|
progress: i,
|
|
138
147
|
r: l,
|
|
139
148
|
cx: c,
|
|
140
|
-
cy:
|
|
141
|
-
circumference:
|
|
142
|
-
progressDashArray:
|
|
143
|
-
progressMaskDashArray:
|
|
144
|
-
progressDashOffset:
|
|
145
|
-
dashPatternOffset:
|
|
149
|
+
cy: p,
|
|
150
|
+
circumference: d,
|
|
151
|
+
progressDashArray: v,
|
|
152
|
+
progressMaskDashArray: b,
|
|
153
|
+
progressDashOffset: S,
|
|
154
|
+
dashPatternOffset: w
|
|
146
155
|
};
|
|
147
|
-
},
|
|
156
|
+
}, Ke = (e) => I(
|
|
148
157
|
() => ({
|
|
149
158
|
integerPart: Array.from(e.integerPart, (t) => ({
|
|
150
159
|
value: t,
|
|
@@ -156,24 +165,24 @@ const We = ({
|
|
|
156
165
|
})) : []
|
|
157
166
|
}),
|
|
158
167
|
[e.integerPart, e.decimalPart]
|
|
159
|
-
),
|
|
168
|
+
), Ue = (e, t, r) => {
|
|
160
169
|
if (t) return r;
|
|
161
170
|
const n = e.decimalPart ? `${e.decimalSeparator}${e.decimalPart}` : "", a = `${e.integerPart}${n}`;
|
|
162
171
|
return e.currencyPosition === "end" ? `${a} ${e.currencyText}` : `${e.currencyText} ${a}`;
|
|
163
172
|
};
|
|
164
|
-
let
|
|
165
|
-
const
|
|
173
|
+
let L = 0;
|
|
174
|
+
const ce = {
|
|
166
175
|
info: 5e3,
|
|
167
176
|
success: 5e3,
|
|
168
177
|
warning: 0,
|
|
169
178
|
error: 0
|
|
170
|
-
},
|
|
179
|
+
}, ue = 3, B = [], ze = (e) => Number.isInteger(e) && e >= 1 ? e : ue, Xe = (e, t) => {
|
|
171
180
|
if (e.duration !== void 0)
|
|
172
181
|
return e.duration === 0 ? 1 / 0 : e.duration;
|
|
173
182
|
if (e.loading) return 1 / 0;
|
|
174
|
-
const r = t?.[e.appearance] ??
|
|
183
|
+
const r = t?.[e.appearance] ?? ce[e.appearance];
|
|
175
184
|
return r === 0 ? 1 / 0 : r;
|
|
176
|
-
},
|
|
185
|
+
}, de = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : (L += 1, `toast-${Date.now()}-${L}`), pe = (e, t) => ({
|
|
177
186
|
id: e,
|
|
178
187
|
appearance: t.appearance ?? "info",
|
|
179
188
|
loading: t.loading ?? !1,
|
|
@@ -181,59 +190,59 @@ const ie = {
|
|
|
181
190
|
duration: t.duration,
|
|
182
191
|
dismissible: t.dismissible ?? !0,
|
|
183
192
|
action: t.action
|
|
184
|
-
}),
|
|
193
|
+
}), fe = (e) => {
|
|
185
194
|
const t = {};
|
|
186
195
|
for (const r of Object.keys(e))
|
|
187
196
|
(e[r] !== void 0 || r === "action") && Object.assign(t, { [r]: e[r] });
|
|
188
197
|
return t;
|
|
189
198
|
};
|
|
190
|
-
let
|
|
199
|
+
let f = B;
|
|
191
200
|
const O = /* @__PURE__ */ new Set();
|
|
192
201
|
let $ = 0;
|
|
193
202
|
const D = () => {
|
|
194
203
|
for (const e of O) e();
|
|
195
|
-
},
|
|
196
|
-
const t =
|
|
197
|
-
return
|
|
198
|
-
},
|
|
199
|
-
const r =
|
|
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);
|
|
200
209
|
if (r === -1) return;
|
|
201
|
-
const n =
|
|
202
|
-
...
|
|
210
|
+
const n = fe(t), a = n.duration !== void 0 || n.loading !== void 0 || n.appearance !== void 0, s = {
|
|
211
|
+
...f[r],
|
|
203
212
|
...n,
|
|
204
213
|
...a && { duration: n.duration }
|
|
205
214
|
};
|
|
206
|
-
|
|
207
|
-
},
|
|
208
|
-
const t =
|
|
209
|
-
t !== -1 && (
|
|
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(
|
|
210
219
|
(r) => r.id === e ? { ...r, exiting: !0 } : r
|
|
211
220
|
), D());
|
|
212
|
-
},
|
|
213
|
-
|
|
214
|
-
},
|
|
221
|
+
}, Te = () => {
|
|
222
|
+
f.length !== 0 && (f = f.map((e) => ({ ...e, exiting: !0 })), D());
|
|
223
|
+
}, ve = () => ($ += 1, $ > 1 && console.warn(
|
|
215
224
|
`[Toaster] ${$} <Toaster /> instances are mounted at once. Every toast will render once per instance. Mount a single <Toaster /> for the whole app.`
|
|
216
225
|
), () => {
|
|
217
226
|
$ -= 1;
|
|
218
|
-
}),
|
|
219
|
-
subscribe:
|
|
220
|
-
getSnapshot:
|
|
221
|
-
getServerSnapshot:
|
|
222
|
-
registerRenderer:
|
|
223
|
-
add:
|
|
224
|
-
update:
|
|
225
|
-
dismiss:
|
|
226
|
-
dismissAll:
|
|
227
|
-
},
|
|
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) => {
|
|
228
237
|
const r = y(/* @__PURE__ */ new Set());
|
|
229
|
-
return
|
|
238
|
+
return k(() => {
|
|
230
239
|
r.current = new Set(
|
|
231
240
|
e.filter(
|
|
232
241
|
(n, a) => a >= t || r.current.has(n.id)
|
|
233
242
|
).map((n) => n.id)
|
|
234
|
-
), e.slice(t).filter((n) => n.exiting).forEach((n) =>
|
|
243
|
+
), e.slice(t).filter((n) => n.exiting).forEach((n) => K.dismiss(n.id));
|
|
235
244
|
}, [e, t]), (n) => r.current.has(n);
|
|
236
|
-
},
|
|
245
|
+
}, we = ({
|
|
237
246
|
durationMs: e,
|
|
238
247
|
paused: t,
|
|
239
248
|
exiting: r,
|
|
@@ -242,7 +251,7 @@ const D = () => {
|
|
|
242
251
|
const a = y(n);
|
|
243
252
|
a.current = n;
|
|
244
253
|
const s = y(e), o = y(e), i = y(null);
|
|
245
|
-
|
|
254
|
+
k(() => {
|
|
246
255
|
if (r || (e !== o.current && (o.current = e, s.current = e), t || !Number.isFinite(s.current))) return;
|
|
247
256
|
i.current = Date.now();
|
|
248
257
|
const l = setTimeout(
|
|
@@ -253,15 +262,15 @@ const D = () => {
|
|
|
253
262
|
clearTimeout(l), i.current !== null && (s.current -= Date.now() - i.current, i.current = null);
|
|
254
263
|
};
|
|
255
264
|
}, [t, r, e]);
|
|
256
|
-
}, Ae = 300,
|
|
265
|
+
}, Ae = 300, Ge = ({
|
|
257
266
|
durationMs: e,
|
|
258
267
|
paused: t,
|
|
259
268
|
exiting: r,
|
|
260
269
|
onDismiss: n
|
|
261
270
|
}) => {
|
|
262
|
-
|
|
271
|
+
we({ durationMs: e, paused: t, exiting: r, onExpire: n });
|
|
263
272
|
const a = y(n);
|
|
264
|
-
a.current = n,
|
|
273
|
+
a.current = n, k(() => {
|
|
265
274
|
if (!r) return;
|
|
266
275
|
const s = setTimeout(
|
|
267
276
|
() => a.current(),
|
|
@@ -269,7 +278,7 @@ const D = () => {
|
|
|
269
278
|
);
|
|
270
279
|
return () => clearTimeout(s);
|
|
271
280
|
}, [r]);
|
|
272
|
-
},
|
|
281
|
+
}, R = (e, t) => typeof e == "function" ? e(t) : e, Pe = ({
|
|
273
282
|
add: e,
|
|
274
283
|
update: t,
|
|
275
284
|
dismiss: r,
|
|
@@ -296,7 +305,7 @@ const D = () => {
|
|
|
296
305
|
});
|
|
297
306
|
return s.then(
|
|
298
307
|
(l) => {
|
|
299
|
-
const c =
|
|
308
|
+
const c = R(o.success, l);
|
|
300
309
|
t(i, {
|
|
301
310
|
...c,
|
|
302
311
|
appearance: "success",
|
|
@@ -306,7 +315,7 @@ const D = () => {
|
|
|
306
315
|
});
|
|
307
316
|
},
|
|
308
317
|
(l) => {
|
|
309
|
-
const c =
|
|
318
|
+
const c = R(o.error, l);
|
|
310
319
|
t(i, {
|
|
311
320
|
...c,
|
|
312
321
|
appearance: "error",
|
|
@@ -318,53 +327,53 @@ const D = () => {
|
|
|
318
327
|
), { id: i };
|
|
319
328
|
}
|
|
320
329
|
};
|
|
321
|
-
},
|
|
322
|
-
function
|
|
330
|
+
}, Je = Pe(K);
|
|
331
|
+
function $e(e, t, r = {}) {
|
|
323
332
|
const { leading: n = !1, trailing: a = !0, maxWait: s } = r;
|
|
324
|
-
let o = null, i = null, l = null, c = 0,
|
|
325
|
-
const h = s !== void 0,
|
|
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) => {
|
|
326
335
|
c = u;
|
|
327
|
-
const
|
|
328
|
-
return
|
|
329
|
-
},
|
|
330
|
-
const
|
|
331
|
-
return t -
|
|
332
|
-
},
|
|
333
|
-
const
|
|
334
|
-
return l === null ||
|
|
335
|
-
},
|
|
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 = () => {
|
|
336
345
|
const u = Date.now();
|
|
337
|
-
if (
|
|
338
|
-
|
|
346
|
+
if (w(u)) {
|
|
347
|
+
j(u);
|
|
339
348
|
return;
|
|
340
349
|
}
|
|
341
|
-
o = setTimeout(
|
|
342
|
-
},
|
|
350
|
+
o = setTimeout(x, S(u));
|
|
351
|
+
}, U = () => {
|
|
343
352
|
const u = Date.now();
|
|
344
|
-
i = null,
|
|
345
|
-
},
|
|
346
|
-
o !== null && clearTimeout(o), i !== null && clearTimeout(i), c = 0,
|
|
347
|
-
},
|
|
348
|
-
const
|
|
349
|
-
if (
|
|
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) {
|
|
350
359
|
if (o === null)
|
|
351
|
-
return
|
|
360
|
+
return z(m);
|
|
352
361
|
if (h)
|
|
353
|
-
return clearTimeout(o), o = setTimeout(
|
|
362
|
+
return clearTimeout(o), o = setTimeout(x, t), b(m);
|
|
354
363
|
}
|
|
355
|
-
return o === null && (o = setTimeout(
|
|
364
|
+
return o === null && (o = setTimeout(x, t)), g;
|
|
356
365
|
};
|
|
357
|
-
return
|
|
366
|
+
return A.cancel = X, A.flush = Y, A.pending = G, A;
|
|
358
367
|
}
|
|
359
|
-
function
|
|
368
|
+
function Qe(e, t, r = {}) {
|
|
360
369
|
const { leading: n = !0, trailing: a = !0 } = r;
|
|
361
|
-
return
|
|
370
|
+
return $e(e, t, {
|
|
362
371
|
leading: n,
|
|
363
372
|
trailing: a,
|
|
364
373
|
maxWait: t
|
|
365
374
|
});
|
|
366
375
|
}
|
|
367
|
-
const
|
|
376
|
+
const Ve = ({
|
|
368
377
|
onClick: e,
|
|
369
378
|
disabled: t
|
|
370
379
|
}) => e ? t ? {
|
|
@@ -378,50 +387,89 @@ const Ge = ({
|
|
|
378
387
|
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), e?.(r));
|
|
379
388
|
},
|
|
380
389
|
onClick: e
|
|
381
|
-
} : void 0,
|
|
390
|
+
} : void 0, N = " ", Ze = ({
|
|
382
391
|
label: e,
|
|
383
392
|
placeholder: t
|
|
384
393
|
}) => {
|
|
385
394
|
const r = typeof t == "string" && t.trim().length > 0 ? t : void 0;
|
|
386
395
|
return e ? {
|
|
387
|
-
inputPlaceholder: r ??
|
|
396
|
+
inputPlaceholder: r ?? N,
|
|
388
397
|
labelStaysFloatedWithPlaceholder: r !== void 0
|
|
389
398
|
} : {
|
|
390
|
-
inputPlaceholder: t ??
|
|
399
|
+
inputPlaceholder: t ?? N,
|
|
391
400
|
labelStaysFloatedWithPlaceholder: !1
|
|
392
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 };
|
|
393
439
|
};
|
|
394
440
|
export {
|
|
395
441
|
P as AVATAR_COLOR_KEYS,
|
|
396
|
-
|
|
442
|
+
Re as DisabledProvider,
|
|
397
443
|
Ae as EXIT_ANIMATION_MS,
|
|
398
444
|
E as assignRef,
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
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
|
|
427
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"}
|
|
@@ -53,6 +53,17 @@ declare const _default: {
|
|
|
53
53
|
"positiveAriaLabel": "Trend up {{value}}",
|
|
54
54
|
"negativeAriaLabel": "Trend down {{value}}",
|
|
55
55
|
"neutralAriaLabel": "Neutral trend {{value}}"
|
|
56
|
+
},
|
|
57
|
+
"chart": {
|
|
58
|
+
"emptyLabel": "No data",
|
|
59
|
+
"loadingAriaLabel": "Loading chart",
|
|
60
|
+
"defaultAriaLabel": "Chart"
|
|
61
|
+
},
|
|
62
|
+
"select": {
|
|
63
|
+
"searchPlaceholder": "Search"
|
|
64
|
+
},
|
|
65
|
+
"subheader": {
|
|
66
|
+
"moreInfoAriaLabel": "More information"
|
|
56
67
|
}
|
|
57
68
|
}
|
|
58
69
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const a = { closeAriaLabel: "Close" }, e = { addressInput: { qrCodeAriaLabel: "Scan QR code" }, amountDisplay: { amountHiddenAriaLabel: "Amount hidden" }, avatar: { defaultAriaLabel: "User avatar" }, baseInput: { clearInputAriaLabel: "Clear input" }, spinner: { loadingAriaLabel: "Loading" }, dialogHeader: { goBackAriaLabel: "Go back", closeAriaLabel: "Close" }, banner: { closeAriaLabel: "Close" }, link: { opensInNewTabAriaLabel: "(opens in a new tab)" }, navBar: { goBackAriaLabel: "Go back" }, sideBar: { navigationAriaLabel: "Sidebar navigation", collapseAriaLabel: "Collapse sidebar", expandAriaLabel: "Expand sidebar" }, stepper: { progressAriaLabel: "Step {{currentStep}} of {{totalSteps}}" }, table: { ascAriaLabel: "Sort ascending", descAriaLabel: "Sort descending" }, pagination: { navigationAriaLabel: "Pagination", previousPageAriaLabel: "Previous page", nextPageAriaLabel: "Next page", pageAriaLabel: "Page {{page}}" }, trend: { positiveAriaLabel: "Trend up {{value}}", negativeAriaLabel: "Trend down {{value}}", neutralAriaLabel: "Neutral trend {{value}}" } },
|
|
1
|
+
const a = { closeAriaLabel: "Close" }, e = { addressInput: { qrCodeAriaLabel: "Scan QR code" }, amountDisplay: { amountHiddenAriaLabel: "Amount hidden" }, avatar: { defaultAriaLabel: "User avatar" }, baseInput: { clearInputAriaLabel: "Clear input" }, spinner: { loadingAriaLabel: "Loading" }, dialogHeader: { goBackAriaLabel: "Go back", closeAriaLabel: "Close" }, banner: { closeAriaLabel: "Close" }, link: { opensInNewTabAriaLabel: "(opens in a new tab)" }, navBar: { goBackAriaLabel: "Go back" }, sideBar: { navigationAriaLabel: "Sidebar navigation", collapseAriaLabel: "Collapse sidebar", expandAriaLabel: "Expand sidebar" }, stepper: { progressAriaLabel: "Step {{currentStep}} of {{totalSteps}}" }, table: { ascAriaLabel: "Sort ascending", descAriaLabel: "Sort descending" }, pagination: { navigationAriaLabel: "Pagination", previousPageAriaLabel: "Previous page", nextPageAriaLabel: "Next page", pageAriaLabel: "Page {{page}}" }, trend: { positiveAriaLabel: "Trend up {{value}}", negativeAriaLabel: "Trend down {{value}}", neutralAriaLabel: "Neutral trend {{value}}" }, chart: { emptyLabel: "No data", loadingAriaLabel: "Loading chart", defaultAriaLabel: "Chart" }, select: { searchPlaceholder: "Search" }, subheader: { moreInfoAriaLabel: "More information" } }, r = {
|
|
2
2
|
common: a,
|
|
3
3
|
components: e
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
6
|
a as common,
|
|
7
7
|
e as components,
|
|
8
|
-
|
|
8
|
+
r as default
|
|
9
9
|
};
|