@ledgerhq/lumen-ui-react 0.1.30 → 0.1.32
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/lib/Components/AddressInput/AddressInput.d.ts +4 -4
- package/dist/lib/Components/AmountDisplay/AmountDisplay.js +13 -13
- package/dist/lib/Components/AmountInput/AmountInput.js +14 -14
- package/dist/lib/Components/Banner/Banner.js +5 -5
- package/dist/lib/Components/BaseInput/BaseInput.d.ts +1 -1
- package/dist/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
- package/dist/lib/Components/BaseInput/BaseInput.js +134 -85
- package/dist/lib/Components/BaseInput/types.d.ts +12 -4
- package/dist/lib/Components/BaseInput/types.d.ts.map +1 -1
- package/dist/lib/Components/Button/Button.js +8 -8
- package/dist/lib/Components/Card/Card.js +12 -12
- package/dist/lib/Components/CardButton/CardButton.js +4 -4
- package/dist/lib/Components/DataTable/DataTable.d.ts +1 -1
- package/dist/lib/Components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/lib/Components/DataTable/DataTable.js +101 -99
- package/dist/lib/Components/DataTable/types.d.ts +8 -0
- package/dist/lib/Components/DataTable/types.d.ts.map +1 -1
- package/dist/lib/Components/Dialog/Dialog.js +13 -13
- package/dist/lib/Components/Dialog/DialogHeader/DialogHeader.js +12 -12
- package/dist/lib/Components/DotCount/DotCount.js +4 -4
- package/dist/lib/Components/InteractiveIcon/InteractiveIcon.js +4 -4
- package/dist/lib/Components/Link/Link.js +6 -6
- package/dist/lib/Components/ListItem/ListItem.js +3 -3
- package/dist/lib/Components/MediaButton/MediaButton.js +4 -4
- package/dist/lib/Components/MediaImage/MediaImage.js +9 -9
- package/dist/lib/Components/NavBar/CoinCapsule.js +4 -4
- package/dist/lib/Components/NavBar/NavBar.js +26 -26
- package/dist/lib/Components/Popover/Popover.js +6 -6
- package/dist/lib/Components/SearchInput/SearchInput.d.ts +4 -4
- package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/lib/Components/SegmentedControl/SegmentedControl.js +54 -52
- package/dist/lib/Components/SegmentedControl/types.d.ts +4 -0
- package/dist/lib/Components/SegmentedControl/types.d.ts.map +1 -1
- package/dist/lib/Components/Select/Select.d.ts +1 -1
- package/dist/lib/Components/Select/Select.d.ts.map +1 -1
- package/dist/lib/Components/Select/Select.js +41 -39
- package/dist/lib/Components/Select/types.d.ts +1 -1
- package/dist/lib/Components/Select/types.d.ts.map +1 -1
- package/dist/lib/Components/SideBar/SideBar.js +9 -9
- package/dist/lib/Components/Skeleton/Skeleton.js +4 -4
- package/dist/lib/Components/Switch/Switch.js +5 -5
- package/dist/lib/Components/Table/Table.d.ts +1 -1
- package/dist/lib/Components/Table/Table.d.ts.map +1 -1
- package/dist/lib/Components/Table/Table.js +47 -42
- package/dist/lib/Components/Table/types.d.ts +7 -0
- package/dist/lib/Components/Table/types.d.ts.map +1 -1
- package/dist/lib/Components/Table/utils/useThrottledScrollBottom.js +3 -3
- package/dist/lib/Components/TextInput/TextInput.d.ts +4 -4
- package/dist/lib/Symbols/Icons/Lightbulb.d.ts +29 -0
- package/dist/lib/Symbols/Icons/Lightbulb.d.ts.map +1 -0
- package/dist/lib/Symbols/Icons/Lightbulb.js +28 -0
- package/dist/lib/Symbols/index.d.ts +1 -0
- package/dist/lib/Symbols/index.d.ts.map +1 -1
- package/dist/lib/Symbols/index.js +270 -268
- package/dist/libs/utils-shared/dist/index.js +146 -133
- package/dist/package.json +2 -2
- package/package.json +2 -2
|
@@ -1,133 +1,133 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as M, createContext as
|
|
3
|
-
import { clsx as
|
|
4
|
-
import { twMerge as
|
|
5
|
-
function
|
|
1
|
+
import { jsx as W } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as M, createContext as L, useRef as R, useContext as E } from "react";
|
|
3
|
+
import { clsx as q } from "clsx";
|
|
4
|
+
import { twMerge as I } from "tailwind-merge";
|
|
5
|
+
function J(e) {
|
|
6
6
|
return e ? e.split(/[-_ ]+/).map((t) => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase()).join("") : "";
|
|
7
7
|
}
|
|
8
|
-
const N = 48,
|
|
9
|
-
function
|
|
8
|
+
const N = 48, B = 17, F = 2;
|
|
9
|
+
function V(e) {
|
|
10
10
|
const t = e.replace(/\D/g, "").length;
|
|
11
11
|
return Math.max(
|
|
12
|
-
|
|
13
|
-
N - t *
|
|
12
|
+
B,
|
|
13
|
+
N - t * F
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function w(e, t = !0) {
|
|
17
17
|
if (!e) return "";
|
|
18
|
-
const
|
|
19
|
-
return
|
|
18
|
+
const l = e.includes("."), [o, a] = e.split("."), u = o.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
19
|
+
return l && t ? a ? `${u}.${a}` : `${u}.` : u;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function X(e, t = {}) {
|
|
22
22
|
const {
|
|
23
|
-
allowDecimals:
|
|
24
|
-
thousandsSeparator:
|
|
25
|
-
maxIntegerLength:
|
|
26
|
-
maxDecimalLength:
|
|
23
|
+
allowDecimals: l = !0,
|
|
24
|
+
thousandsSeparator: o = !0,
|
|
25
|
+
maxIntegerLength: a = 9,
|
|
26
|
+
maxDecimalLength: u = 9
|
|
27
27
|
} = t, r = e.replace(",", ".").replace(/[^\d.]/g, "");
|
|
28
28
|
let n = r;
|
|
29
|
-
if (n = n.replace(/^0+(?=\d)/, ""), !
|
|
30
|
-
return n = n.replace(/\D/g, ""),
|
|
29
|
+
if (n = n.replace(/^0+(?=\d)/, ""), !l)
|
|
30
|
+
return n = n.replace(/\D/g, ""), a > 0 && n.length > a && (n = n.slice(0, a)), o ? w(n) : n;
|
|
31
31
|
n === "." && (n = "0.");
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
34
|
-
let i = n.slice(0,
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
n =
|
|
32
|
+
const c = n.indexOf(".");
|
|
33
|
+
if (c !== -1) {
|
|
34
|
+
let i = n.slice(0, c), d = n.slice(c + 1).replace(/\./g, "");
|
|
35
|
+
a > 0 && i.length > a && (i = i.slice(0, a)), d = d.slice(0, u), i === "" && (i = "0");
|
|
36
|
+
const h = r.endsWith(".") || n.endsWith(".");
|
|
37
|
+
n = d.length > 0 ? `${i}.${d}` : h ? `${i}.` : i;
|
|
38
38
|
} else
|
|
39
|
-
|
|
40
|
-
return
|
|
39
|
+
a > 0 && n.length > a && (n = n.slice(0, a));
|
|
40
|
+
return o ? w(n) : n;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function z(e, t) {
|
|
43
43
|
if (Object.is(e, t)) return !0;
|
|
44
|
-
const
|
|
45
|
-
return
|
|
46
|
-
(r) => Object.prototype.hasOwnProperty.call(
|
|
44
|
+
const l = e, o = t, a = Object.keys(l), u = Object.keys(o);
|
|
45
|
+
return a.length !== u.length ? !1 : a.every(
|
|
46
|
+
(r) => Object.prototype.hasOwnProperty.call(o, r) && Object.is(l[r], o[r])
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
const
|
|
51
|
-
const n =
|
|
52
|
-
return
|
|
49
|
+
function K(e, t) {
|
|
50
|
+
const l = L(t), o = ({ children: u, value: r }) => {
|
|
51
|
+
const n = R(r);
|
|
52
|
+
return z(n.current, r) || (n.current = r), /* @__PURE__ */ W(l.Provider, { value: n.current, children: u });
|
|
53
53
|
};
|
|
54
|
-
|
|
55
|
-
function
|
|
56
|
-
consumerName:
|
|
54
|
+
o.displayName = e + "Provider";
|
|
55
|
+
function a({
|
|
56
|
+
consumerName: u,
|
|
57
57
|
contextRequired: r
|
|
58
58
|
}) {
|
|
59
|
-
const n =
|
|
59
|
+
const n = E(l);
|
|
60
60
|
if (n)
|
|
61
61
|
return n;
|
|
62
62
|
if (r)
|
|
63
63
|
throw new Error(
|
|
64
|
-
`${
|
|
64
|
+
`${u} must be used within ${e}`
|
|
65
65
|
);
|
|
66
66
|
return t || {};
|
|
67
67
|
}
|
|
68
|
-
return [
|
|
68
|
+
return [o, a];
|
|
69
69
|
}
|
|
70
|
-
const [
|
|
70
|
+
const [ee, U] = K("Disabled", { disabled: !1 }), te = ({
|
|
71
71
|
consumerName: e,
|
|
72
72
|
contextRequired: t,
|
|
73
|
-
mergeWith:
|
|
73
|
+
mergeWith: l
|
|
74
74
|
}) => {
|
|
75
|
-
const
|
|
75
|
+
const o = U({
|
|
76
76
|
consumerName: e,
|
|
77
77
|
contextRequired: t ?? !1
|
|
78
78
|
});
|
|
79
|
-
return !!(
|
|
79
|
+
return !!(l?.disabled || o.disabled);
|
|
80
80
|
};
|
|
81
|
-
function
|
|
82
|
-
return q(
|
|
81
|
+
function ne(...e) {
|
|
82
|
+
return I(q(e));
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function T(e, t) {
|
|
85
85
|
if (typeof e == "function")
|
|
86
86
|
return e(t);
|
|
87
87
|
typeof e == "object" && e !== null && "current" in e && (e.current = t);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function H(...e) {
|
|
90
90
|
const t = /* @__PURE__ */ new Map();
|
|
91
|
-
return (
|
|
92
|
-
if (
|
|
93
|
-
e.forEach((
|
|
94
|
-
const
|
|
95
|
-
typeof
|
|
91
|
+
return (l) => {
|
|
92
|
+
if (l === null) {
|
|
93
|
+
e.forEach((o) => {
|
|
94
|
+
const a = t.get(o);
|
|
95
|
+
typeof a == "function" && a(), T(o, null);
|
|
96
96
|
}), t.clear();
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
|
-
e.forEach((
|
|
100
|
-
const
|
|
101
|
-
typeof
|
|
99
|
+
e.forEach((o) => {
|
|
100
|
+
const a = T(o, l);
|
|
101
|
+
typeof a == "function" && t.set(o, a);
|
|
102
102
|
});
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
return M(() =>
|
|
105
|
+
function re(...e) {
|
|
106
|
+
return M(() => H(...e), e);
|
|
107
107
|
}
|
|
108
|
-
const
|
|
108
|
+
const le = ({
|
|
109
109
|
currentStep: e,
|
|
110
110
|
totalSteps: t,
|
|
111
|
-
size:
|
|
112
|
-
label:
|
|
113
|
-
strokeWidth:
|
|
114
|
-
arcPercentage:
|
|
111
|
+
size: l,
|
|
112
|
+
label: o,
|
|
113
|
+
strokeWidth: a = 4,
|
|
114
|
+
arcPercentage: u = 0.75
|
|
115
115
|
}) => {
|
|
116
|
-
const r = Math.min(Math.max(e, 0), t), n =
|
|
116
|
+
const r = Math.min(Math.max(e, 0), t), n = o ?? `${r}/${t}`, c = t <= 0 ? 0 : r / t, i = (l - a) / 2, d = l / 2, h = l / 2, f = 2 * Math.PI * i, p = f * u, x = p * (1 - c), g = r <= 0, D = `${p} ${f}`, P = g ? p - 2 : x;
|
|
117
117
|
return {
|
|
118
118
|
displayLabel: n,
|
|
119
|
-
progress:
|
|
119
|
+
progress: c,
|
|
120
120
|
r: i,
|
|
121
|
-
cx:
|
|
122
|
-
cy:
|
|
123
|
-
circumference:
|
|
121
|
+
cx: d,
|
|
122
|
+
cy: h,
|
|
123
|
+
circumference: f,
|
|
124
124
|
trackArcLength: p,
|
|
125
|
-
trackDashArray: `${p} ${
|
|
125
|
+
trackDashArray: `${p} ${f}`,
|
|
126
126
|
progressDashArray: D,
|
|
127
|
-
progressDashOffset:
|
|
128
|
-
showMinimalDot:
|
|
127
|
+
progressDashOffset: P,
|
|
128
|
+
showMinimalDot: g
|
|
129
129
|
};
|
|
130
|
-
},
|
|
130
|
+
}, ae = (e) => M(
|
|
131
131
|
() => ({
|
|
132
132
|
integerPart: Array.from(e.integerPart, (t) => ({
|
|
133
133
|
value: t,
|
|
@@ -139,57 +139,57 @@ const re = ({
|
|
|
139
139
|
})) : []
|
|
140
140
|
}),
|
|
141
141
|
[e.integerPart, e.decimalPart]
|
|
142
|
-
),
|
|
143
|
-
if (t) return
|
|
144
|
-
const
|
|
145
|
-
return e.currencyPosition === "end" ? `${
|
|
142
|
+
), oe = (e, t, l) => {
|
|
143
|
+
if (t) return l;
|
|
144
|
+
const o = e.decimalPart ? `${e.decimalSeparator}${e.decimalPart}` : "", a = `${e.integerPart}${o}`;
|
|
145
|
+
return e.currencyPosition === "end" ? `${a} ${e.currencyText}` : `${e.currencyText} ${a}`;
|
|
146
146
|
};
|
|
147
|
-
function
|
|
148
|
-
const { leading:
|
|
149
|
-
let r = null, n = null,
|
|
150
|
-
const p =
|
|
151
|
-
i =
|
|
152
|
-
const m =
|
|
153
|
-
return
|
|
154
|
-
}, D = (
|
|
155
|
-
const m =
|
|
147
|
+
function Q(e, t, l = {}) {
|
|
148
|
+
const { leading: o = !1, trailing: a = !0, maxWait: u } = l;
|
|
149
|
+
let r = null, n = null, c = null, i = 0, d = null, h = null, f;
|
|
150
|
+
const p = u !== void 0, x = p ? Math.max(u, t) : 0, g = (s) => {
|
|
151
|
+
i = s;
|
|
152
|
+
const m = d, b = h;
|
|
153
|
+
return d = null, h = null, f = e.apply(b, m), f;
|
|
154
|
+
}, D = (s) => {
|
|
155
|
+
const m = c ? s - c : 0;
|
|
156
156
|
return t - m;
|
|
157
|
-
},
|
|
158
|
-
const m =
|
|
159
|
-
return
|
|
160
|
-
},
|
|
161
|
-
const
|
|
162
|
-
if (
|
|
163
|
-
|
|
157
|
+
}, P = (s) => {
|
|
158
|
+
const m = c ? s - c : t, b = s - i;
|
|
159
|
+
return c === null || m >= t || m < 0 || p && b >= x;
|
|
160
|
+
}, v = (s) => (r = null, a && d ? g(s) : (d = null, h = null, f)), y = () => {
|
|
161
|
+
const s = Date.now();
|
|
162
|
+
if (P(s)) {
|
|
163
|
+
v(s);
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
|
-
r = setTimeout(
|
|
167
|
-
},
|
|
168
|
-
const
|
|
169
|
-
n = null,
|
|
170
|
-
},
|
|
171
|
-
r !== null && clearTimeout(r), n !== null && clearTimeout(n), i = 0,
|
|
172
|
-
}, A = () => r === null && n === null ?
|
|
173
|
-
const m = Date.now(),
|
|
174
|
-
if (
|
|
166
|
+
r = setTimeout(y, D(s));
|
|
167
|
+
}, S = () => {
|
|
168
|
+
const s = Date.now();
|
|
169
|
+
n = null, d && (g(s), r !== null && (clearTimeout(r), r = setTimeout(y, t)));
|
|
170
|
+
}, j = (s) => (i = s, r = setTimeout(y, t), p && (n = setTimeout(S, x)), o ? g(s) : f), k = () => {
|
|
171
|
+
r !== null && clearTimeout(r), n !== null && clearTimeout(n), i = 0, d = null, h = null, c = null, r = null, n = null;
|
|
172
|
+
}, A = () => r === null && n === null ? f : v(Date.now()), O = () => r !== null || n !== null, $ = function(...s) {
|
|
173
|
+
const m = Date.now(), b = P(m);
|
|
174
|
+
if (d = s, h = this, c = m, b) {
|
|
175
175
|
if (r === null)
|
|
176
|
-
return
|
|
176
|
+
return j(m);
|
|
177
177
|
if (p)
|
|
178
|
-
return clearTimeout(r), r = setTimeout(
|
|
178
|
+
return clearTimeout(r), r = setTimeout(y, t), g(m);
|
|
179
179
|
}
|
|
180
|
-
return r === null && (r = setTimeout(
|
|
180
|
+
return r === null && (r = setTimeout(y, t)), f;
|
|
181
181
|
};
|
|
182
|
-
return
|
|
182
|
+
return $.cancel = k, $.flush = A, $.pending = O, $;
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
const { leading:
|
|
186
|
-
return
|
|
187
|
-
leading:
|
|
188
|
-
trailing:
|
|
184
|
+
function se(e, t, l = {}) {
|
|
185
|
+
const { leading: o = !0, trailing: a = !0 } = l;
|
|
186
|
+
return Q(e, t, {
|
|
187
|
+
leading: o,
|
|
188
|
+
trailing: a,
|
|
189
189
|
maxWait: t
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
-
const
|
|
192
|
+
const ue = ({
|
|
193
193
|
onClick: e,
|
|
194
194
|
disabled: t
|
|
195
195
|
}) => e ? t ? {
|
|
@@ -199,28 +199,41 @@ const ce = ({
|
|
|
199
199
|
} : {
|
|
200
200
|
role: "button",
|
|
201
201
|
tabIndex: 0,
|
|
202
|
-
onKeyDown: (
|
|
203
|
-
(
|
|
202
|
+
onKeyDown: (l) => {
|
|
203
|
+
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), e?.(l));
|
|
204
204
|
},
|
|
205
205
|
onClick: e
|
|
206
|
-
} : void 0
|
|
206
|
+
} : void 0, C = " ", ie = ({
|
|
207
|
+
label: e,
|
|
208
|
+
placeholder: t
|
|
209
|
+
}) => {
|
|
210
|
+
const l = typeof t == "string" && t.trim().length > 0 ? t : void 0;
|
|
211
|
+
return e ? {
|
|
212
|
+
inputPlaceholder: l ?? C,
|
|
213
|
+
labelStaysFloatedWithPlaceholder: l !== void 0
|
|
214
|
+
} : {
|
|
215
|
+
inputPlaceholder: t ?? C,
|
|
216
|
+
labelStaysFloatedWithPlaceholder: !1
|
|
217
|
+
};
|
|
218
|
+
};
|
|
207
219
|
export {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
220
|
+
ee as DisabledProvider,
|
|
221
|
+
T as assignRef,
|
|
222
|
+
oe as buildAriaLabel,
|
|
223
|
+
ne as cn,
|
|
224
|
+
K as createSafeContext,
|
|
225
|
+
Q as debounce,
|
|
226
|
+
w as formatThousands,
|
|
227
|
+
ue as getButtonA11yProps,
|
|
228
|
+
V as getFontSize,
|
|
229
|
+
le as getStepperCalculations,
|
|
230
|
+
H as mergeRefs,
|
|
231
|
+
ie as resolveBaseInputPlaceholder,
|
|
232
|
+
z as shallowEqual,
|
|
233
|
+
X as textFormatter,
|
|
234
|
+
se as throttle,
|
|
235
|
+
J as toPascalCase,
|
|
236
|
+
te as useDisabledContext,
|
|
237
|
+
re as useMergedRef,
|
|
238
|
+
ae as useSplitText
|
|
226
239
|
};
|
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.31",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"keywords": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
56
56
|
"class-variance-authority": "^0.7.1",
|
|
57
57
|
"@tanstack/react-table": "^8.21.3",
|
|
58
|
-
"@ledgerhq/lumen-design-core": "0.1.
|
|
58
|
+
"@ledgerhq/lumen-design-core": "0.1.13",
|
|
59
59
|
"clsx": "^2.1.1",
|
|
60
60
|
"react": "^18.0.0 || ^19.0.0",
|
|
61
61
|
"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.32",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"keywords": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
56
56
|
"class-variance-authority": "^0.7.1",
|
|
57
57
|
"@tanstack/react-table": "^8.21.3",
|
|
58
|
-
"@ledgerhq/lumen-design-core": "0.1.
|
|
58
|
+
"@ledgerhq/lumen-design-core": "0.1.14",
|
|
59
59
|
"clsx": "^2.1.1",
|
|
60
60
|
"react": "^18.0.0 || ^19.0.0",
|
|
61
61
|
"react-dom": "^18.0.0 || ^19.0.0",
|