@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.
Files changed (58) hide show
  1. package/dist/lib/Components/AddressInput/AddressInput.d.ts +4 -4
  2. package/dist/lib/Components/AmountDisplay/AmountDisplay.js +13 -13
  3. package/dist/lib/Components/AmountInput/AmountInput.js +14 -14
  4. package/dist/lib/Components/Banner/Banner.js +5 -5
  5. package/dist/lib/Components/BaseInput/BaseInput.d.ts +1 -1
  6. package/dist/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
  7. package/dist/lib/Components/BaseInput/BaseInput.js +134 -85
  8. package/dist/lib/Components/BaseInput/types.d.ts +12 -4
  9. package/dist/lib/Components/BaseInput/types.d.ts.map +1 -1
  10. package/dist/lib/Components/Button/Button.js +8 -8
  11. package/dist/lib/Components/Card/Card.js +12 -12
  12. package/dist/lib/Components/CardButton/CardButton.js +4 -4
  13. package/dist/lib/Components/DataTable/DataTable.d.ts +1 -1
  14. package/dist/lib/Components/DataTable/DataTable.d.ts.map +1 -1
  15. package/dist/lib/Components/DataTable/DataTable.js +101 -99
  16. package/dist/lib/Components/DataTable/types.d.ts +8 -0
  17. package/dist/lib/Components/DataTable/types.d.ts.map +1 -1
  18. package/dist/lib/Components/Dialog/Dialog.js +13 -13
  19. package/dist/lib/Components/Dialog/DialogHeader/DialogHeader.js +12 -12
  20. package/dist/lib/Components/DotCount/DotCount.js +4 -4
  21. package/dist/lib/Components/InteractiveIcon/InteractiveIcon.js +4 -4
  22. package/dist/lib/Components/Link/Link.js +6 -6
  23. package/dist/lib/Components/ListItem/ListItem.js +3 -3
  24. package/dist/lib/Components/MediaButton/MediaButton.js +4 -4
  25. package/dist/lib/Components/MediaImage/MediaImage.js +9 -9
  26. package/dist/lib/Components/NavBar/CoinCapsule.js +4 -4
  27. package/dist/lib/Components/NavBar/NavBar.js +26 -26
  28. package/dist/lib/Components/Popover/Popover.js +6 -6
  29. package/dist/lib/Components/SearchInput/SearchInput.d.ts +4 -4
  30. package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
  31. package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  32. package/dist/lib/Components/SegmentedControl/SegmentedControl.js +54 -52
  33. package/dist/lib/Components/SegmentedControl/types.d.ts +4 -0
  34. package/dist/lib/Components/SegmentedControl/types.d.ts.map +1 -1
  35. package/dist/lib/Components/Select/Select.d.ts +1 -1
  36. package/dist/lib/Components/Select/Select.d.ts.map +1 -1
  37. package/dist/lib/Components/Select/Select.js +41 -39
  38. package/dist/lib/Components/Select/types.d.ts +1 -1
  39. package/dist/lib/Components/Select/types.d.ts.map +1 -1
  40. package/dist/lib/Components/SideBar/SideBar.js +9 -9
  41. package/dist/lib/Components/Skeleton/Skeleton.js +4 -4
  42. package/dist/lib/Components/Switch/Switch.js +5 -5
  43. package/dist/lib/Components/Table/Table.d.ts +1 -1
  44. package/dist/lib/Components/Table/Table.d.ts.map +1 -1
  45. package/dist/lib/Components/Table/Table.js +47 -42
  46. package/dist/lib/Components/Table/types.d.ts +7 -0
  47. package/dist/lib/Components/Table/types.d.ts.map +1 -1
  48. package/dist/lib/Components/Table/utils/useThrottledScrollBottom.js +3 -3
  49. package/dist/lib/Components/TextInput/TextInput.d.ts +4 -4
  50. package/dist/lib/Symbols/Icons/Lightbulb.d.ts +29 -0
  51. package/dist/lib/Symbols/Icons/Lightbulb.d.ts.map +1 -0
  52. package/dist/lib/Symbols/Icons/Lightbulb.js +28 -0
  53. package/dist/lib/Symbols/index.d.ts +1 -0
  54. package/dist/lib/Symbols/index.d.ts.map +1 -1
  55. package/dist/lib/Symbols/index.js +270 -268
  56. package/dist/libs/utils-shared/dist/index.js +146 -133
  57. package/dist/package.json +2 -2
  58. package/package.json +2 -2
@@ -1,133 +1,133 @@
1
- import { jsx as S } from "react/jsx-runtime";
2
- import { useMemo as M, createContext as R, useRef as E, useContext as L } from "react";
3
- import { clsx as W } from "clsx";
4
- import { twMerge as q } from "tailwind-merge";
5
- function G(e) {
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, I = 17, z = 2;
9
- function H(e) {
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
- I,
13
- N - t * z
12
+ B,
13
+ N - t * F
14
14
  );
15
15
  }
16
- function T(e, t = !0) {
16
+ function w(e, t = !0) {
17
17
  if (!e) return "";
18
- const a = e.includes("."), [u, l] = e.split("."), o = u.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
19
- return a && t ? l ? `${o}.${l}` : `${o}.` : o;
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 V(e, t = {}) {
21
+ function X(e, t = {}) {
22
22
  const {
23
- allowDecimals: a = !0,
24
- thousandsSeparator: u = !0,
25
- maxIntegerLength: l = 9,
26
- maxDecimalLength: o = 9
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)/, ""), !a)
30
- return n = n.replace(/\D/g, ""), l > 0 && n.length > l && (n = n.slice(0, l)), u ? T(n) : n;
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 s = n.indexOf(".");
33
- if (s !== -1) {
34
- let i = n.slice(0, s), f = n.slice(s + 1).replace(/\./g, "");
35
- l > 0 && i.length > l && (i = i.slice(0, l)), f = f.slice(0, o), i === "" && (i = "0");
36
- const g = r.endsWith(".") || n.endsWith(".");
37
- n = f.length > 0 ? `${i}.${f}` : g ? `${i}.` : i;
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
- l > 0 && n.length > l && (n = n.slice(0, l));
40
- return u ? T(n) : n;
39
+ a > 0 && n.length > a && (n = n.slice(0, a));
40
+ return o ? w(n) : n;
41
41
  }
42
- function B(e, t) {
42
+ function z(e, t) {
43
43
  if (Object.is(e, t)) return !0;
44
- const a = e, u = t, l = Object.keys(a), o = Object.keys(u);
45
- return l.length !== o.length ? !1 : l.every(
46
- (r) => Object.prototype.hasOwnProperty.call(u, r) && Object.is(a[r], u[r])
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 F(e, t) {
50
- const a = R(t), u = ({ children: o, value: r }) => {
51
- const n = E(r);
52
- return B(n.current, r) || (n.current = r), /* @__PURE__ */ S(a.Provider, { value: n.current, children: o });
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
- u.displayName = e + "Provider";
55
- function l({
56
- consumerName: o,
54
+ o.displayName = e + "Provider";
55
+ function a({
56
+ consumerName: u,
57
57
  contextRequired: r
58
58
  }) {
59
- const n = L(a);
59
+ const n = E(l);
60
60
  if (n)
61
61
  return n;
62
62
  if (r)
63
63
  throw new Error(
64
- `${o} must be used within ${e}`
64
+ `${u} must be used within ${e}`
65
65
  );
66
66
  return t || {};
67
67
  }
68
- return [u, l];
68
+ return [o, a];
69
69
  }
70
- const [X, K] = F("Disabled", { disabled: !1 }), ee = ({
70
+ const [ee, U] = K("Disabled", { disabled: !1 }), te = ({
71
71
  consumerName: e,
72
72
  contextRequired: t,
73
- mergeWith: a
73
+ mergeWith: l
74
74
  }) => {
75
- const u = K({
75
+ const o = U({
76
76
  consumerName: e,
77
77
  contextRequired: t ?? !1
78
78
  });
79
- return !!(a?.disabled || u.disabled);
79
+ return !!(l?.disabled || o.disabled);
80
80
  };
81
- function te(...e) {
82
- return q(W(e));
81
+ function ne(...e) {
82
+ return I(q(e));
83
83
  }
84
- function v(e, t) {
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 U(...e) {
89
+ function H(...e) {
90
90
  const t = /* @__PURE__ */ new Map();
91
- return (a) => {
92
- if (a === null) {
93
- e.forEach((u) => {
94
- const l = t.get(u);
95
- typeof l == "function" && l(), v(u, null);
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((u) => {
100
- const l = v(u, a);
101
- typeof l == "function" && t.set(u, l);
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 ne(...e) {
106
- return M(() => U(...e), e);
105
+ function re(...e) {
106
+ return M(() => H(...e), e);
107
107
  }
108
- const re = ({
108
+ const le = ({
109
109
  currentStep: e,
110
110
  totalSteps: t,
111
- size: a,
112
- label: u,
113
- strokeWidth: l = 4,
114
- arcPercentage: o = 0.75
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 = u ?? `${r}/${t}`, s = t <= 0 ? 0 : r / t, i = (a - l) / 2, f = a / 2, g = a / 2, d = 2 * Math.PI * i, p = d * o, b = p * (1 - s), h = r <= 0, D = `${p} ${d}`, $ = h ? p - 2 : b;
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: s,
119
+ progress: c,
120
120
  r: i,
121
- cx: f,
122
- cy: g,
123
- circumference: d,
121
+ cx: d,
122
+ cy: h,
123
+ circumference: f,
124
124
  trackArcLength: p,
125
- trackDashArray: `${p} ${d}`,
125
+ trackDashArray: `${p} ${f}`,
126
126
  progressDashArray: D,
127
- progressDashOffset: $,
128
- showMinimalDot: h
127
+ progressDashOffset: P,
128
+ showMinimalDot: g
129
129
  };
130
- }, le = (e) => M(
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
- ), ae = (e, t, a) => {
143
- if (t) return a;
144
- const u = e.decimalPart ? `${e.decimalSeparator}${e.decimalPart}` : "", l = `${e.integerPart}${u}`;
145
- return e.currencyPosition === "end" ? `${l} ${e.currencyText}` : `${e.currencyText} ${l}`;
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 J(e, t, a = {}) {
148
- const { leading: u = !1, trailing: l = !0, maxWait: o } = a;
149
- let r = null, n = null, s = null, i = 0, f = null, g = null, d;
150
- const p = o !== void 0, b = p ? Math.max(o, t) : 0, h = (c) => {
151
- i = c;
152
- const m = f, y = g;
153
- return f = null, g = null, d = e.apply(y, m), d;
154
- }, D = (c) => {
155
- const m = s ? c - s : 0;
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
- }, $ = (c) => {
158
- const m = s ? c - s : t, y = c - i;
159
- return s === null || m >= t || m < 0 || p && y >= b;
160
- }, w = (c) => (r = null, l && f ? h(c) : (f = null, g = null, d)), x = () => {
161
- const c = Date.now();
162
- if ($(c)) {
163
- w(c);
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(x, D(c));
167
- }, k = () => {
168
- const c = Date.now();
169
- n = null, f && (h(c), r !== null && (clearTimeout(r), r = setTimeout(x, t)));
170
- }, C = (c) => (i = c, r = setTimeout(x, t), p && (n = setTimeout(k, b)), u ? h(c) : d), j = () => {
171
- r !== null && clearTimeout(r), n !== null && clearTimeout(n), i = 0, f = null, g = null, s = null, r = null, n = null;
172
- }, A = () => r === null && n === null ? d : w(Date.now()), O = () => r !== null || n !== null, P = function(...c) {
173
- const m = Date.now(), y = $(m);
174
- if (f = c, g = this, s = m, y) {
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 C(m);
176
+ return j(m);
177
177
  if (p)
178
- return clearTimeout(r), r = setTimeout(x, t), h(m);
178
+ return clearTimeout(r), r = setTimeout(y, t), g(m);
179
179
  }
180
- return r === null && (r = setTimeout(x, t)), d;
180
+ return r === null && (r = setTimeout(y, t)), f;
181
181
  };
182
- return P.cancel = j, P.flush = A, P.pending = O, P;
182
+ return $.cancel = k, $.flush = A, $.pending = O, $;
183
183
  }
184
- function ue(e, t, a = {}) {
185
- const { leading: u = !0, trailing: l = !0 } = a;
186
- return J(e, t, {
187
- leading: u,
188
- trailing: l,
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 ce = ({
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: (a) => {
203
- (a.key === "Enter" || a.key === " ") && (a.preventDefault(), e?.(a));
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
- X as DisabledProvider,
209
- v as assignRef,
210
- ae as buildAriaLabel,
211
- te as cn,
212
- F as createSafeContext,
213
- J as debounce,
214
- T as formatThousands,
215
- ce as getButtonA11yProps,
216
- H as getFontSize,
217
- re as getStepperCalculations,
218
- U as mergeRefs,
219
- B as shallowEqual,
220
- V as textFormatter,
221
- ue as throttle,
222
- G as toPascalCase,
223
- ee as useDisabledContext,
224
- ne as useMergedRef,
225
- le as useSplitText
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.29",
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.12",
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.30",
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.13",
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",