@ledgerhq/lumen-ui-react 0.0.84 → 0.0.86

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CardButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/CardButton/CardButton.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAkB1C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,UAAU;sFASpB,eAAe;;CA2BjB,CAAC"}
1
+ {"version":3,"file":"CardButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/CardButton/CardButton.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAkB1C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,UAAU;sFASpB,eAAe;;CAgCjB,CAAC"}
@@ -3,11 +3,11 @@ import { cn as u } from "../../../libs/utils-shared/dist/index.js";
3
3
  import { cva as c } from "class-variance-authority";
4
4
  import { ChevronRight as m } from "../../Symbols/Icons/ChevronRight.js";
5
5
  const f = c(
6
- "inline-flex h-fit w-full cursor-pointer items-center gap-12 rounded-sm p-12 transition-colors focus-visible:outline-2 focus-visible:outline-focus disabled:cursor-default disabled:text-disabled",
6
+ "group inline-flex h-fit w-full cursor-pointer items-center gap-12 rounded-sm p-12 transition-colors focus-visible:outline-2 focus-visible:outline-focus disabled:cursor-default disabled:text-disabled",
7
7
  {
8
8
  variants: {
9
9
  appearance: {
10
- base: "bg-muted text-base hover:bg-muted-hover active:bg-muted-pressed disabled:bg-disabled",
10
+ base: "bg-surface text-base hover:bg-surface-hover active:bg-surface-pressed disabled:bg-disabled",
11
11
  outline: "bg-base-transparent text-base outline-dashed outline-1 outline-muted-subtle hover:bg-base-transparent-hover hover:outline-muted-subtle-hover focus-visible:outline-hidden focus-visible:outline-offset-0 active:bg-base-transparent-pressed active:outline-muted-subtle-pressed disabled:bg-base-transparent disabled:outline-disabled"
12
12
  }
13
13
  },
@@ -16,35 +16,41 @@ const f = c(
16
16
  }
17
17
  }
18
18
  ), p = ({
19
- ref: n,
20
- className: l,
21
- appearance: o,
22
- icon: d,
23
- title: r,
24
- description: t,
19
+ ref: l,
20
+ className: d,
21
+ appearance: r,
22
+ icon: n,
23
+ title: o,
24
+ description: s,
25
25
  hideChevron: b,
26
- ...s
26
+ ...t
27
27
  }) => {
28
- const a = d;
28
+ const a = n;
29
29
  return /* @__PURE__ */ i(
30
30
  "button",
31
31
  {
32
- ref: n,
32
+ ref: l,
33
33
  className: u(
34
- l,
34
+ d,
35
35
  f({
36
- appearance: o
36
+ appearance: r
37
37
  })
38
38
  ),
39
- disabled: s.disabled,
40
- ...s,
39
+ disabled: t.disabled,
40
+ ...t,
41
41
  children: [
42
42
  a && /* @__PURE__ */ e(a, { size: 24, className: "shrink-0" }),
43
43
  /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 flex-col gap-4 text-left", children: [
44
- /* @__PURE__ */ e("div", { className: "min-w-0 truncate body-2-semi-bold", children: r }),
45
- t && /* @__PURE__ */ e("div", { className: "line-clamp-2 min-w-0 body-3 text-muted", children: t })
44
+ /* @__PURE__ */ e("div", { className: "min-w-0 truncate body-2-semi-bold", children: o }),
45
+ s && /* @__PURE__ */ e("div", { className: "line-clamp-2 min-w-0 body-3 text-muted group-disabled:text-disabled", children: s })
46
46
  ] }),
47
- !b && /* @__PURE__ */ e(m, { size: 24, className: "shrink-0" })
47
+ !b && /* @__PURE__ */ e(
48
+ m,
49
+ {
50
+ size: 24,
51
+ className: "shrink-0 text-muted group-disabled:text-disabled"
52
+ }
53
+ )
48
54
  ]
49
55
  }
50
56
  );
@@ -1,54 +1,54 @@
1
- import { jsx as P } from "react/jsx-runtime";
2
- import { createContext as W, useMemo as O, use as j } from "react";
1
+ import { jsx as A } from "react/jsx-runtime";
2
+ import { createContext as W, useMemo as O, useContext as j } from "react";
3
3
  import { clsx as k } from "clsx";
4
4
  import { twMerge as N } from "tailwind-merge";
5
- function H(l) {
6
- return l ? l.split(/[-_ ]+/).map((t) => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase()).join("") : "";
5
+ function H(r) {
6
+ return r ? r.split(/[-_ ]+/).map((t) => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase()).join("") : "";
7
7
  }
8
8
  const q = 48, z = 17, E = 2;
9
- function J(l) {
10
- const t = l.replace(/\D/g, "").length;
9
+ function J(r) {
10
+ const t = r.replace(/\D/g, "").length;
11
11
  return Math.max(
12
12
  z,
13
13
  q - t * E
14
14
  );
15
15
  }
16
- function C(l, t = !0) {
17
- if (!l) return "";
18
- const o = l.includes("."), [m, r] = l.split("."), s = m.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
19
- return o && t ? r ? `${s}.${r}` : `${s}.` : s;
16
+ function y(r, t = !0) {
17
+ if (!r) return "";
18
+ const o = r.includes("."), [m, l] = r.split("."), s = m.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
19
+ return o && t ? l ? `${s}.${l}` : `${s}.` : s;
20
20
  }
21
- function K(l, t = {}) {
21
+ function K(r, t = {}) {
22
22
  const {
23
23
  allowDecimals: o = !0,
24
24
  thousandsSeparator: m = !0,
25
- maxIntegerLength: r = 9,
25
+ maxIntegerLength: l = 9,
26
26
  maxDecimalLength: s = 9
27
- } = t, n = l.replace(",", ".").replace(/[^\d.]/g, "");
27
+ } = t, n = r.replace(",", ".").replace(/[^\d.]/g, "");
28
28
  let e = n;
29
29
  if (e = e.replace(/^0+(?=\d)/, ""), !o)
30
- return e = e.replace(/\D/g, ""), r > 0 && e.length > r && (e = e.slice(0, r)), m ? C(e) : e;
30
+ return e = e.replace(/\D/g, ""), l > 0 && e.length > l && (e = e.slice(0, l)), m ? y(e) : e;
31
31
  e === "." && (e = "0.");
32
- const c = e.indexOf(".");
33
- if (c !== -1) {
34
- let a = e.slice(0, c), i = e.slice(c + 1).replace(/\./g, "");
35
- r > 0 && a.length > r && (a = a.slice(0, r)), i = i.slice(0, s), a === "" && (a = "0");
32
+ const i = e.indexOf(".");
33
+ if (i !== -1) {
34
+ let a = e.slice(0, i), c = e.slice(i + 1).replace(/\./g, "");
35
+ l > 0 && a.length > l && (a = a.slice(0, l)), c = c.slice(0, s), a === "" && (a = "0");
36
36
  const h = n.endsWith(".") || e.endsWith(".");
37
- e = i.length > 0 ? `${a}.${i}` : h ? `${a}.` : a;
37
+ e = c.length > 0 ? `${a}.${c}` : h ? `${a}.` : a;
38
38
  } else
39
- r > 0 && e.length > r && (e = e.slice(0, r));
40
- return m ? C(e) : e;
39
+ l > 0 && e.length > l && (e = e.slice(0, l));
40
+ return m ? y(e) : e;
41
41
  }
42
- function U(l, t) {
42
+ function U(r, t) {
43
43
  const o = W(t), m = ({ children: s, value: n }) => {
44
44
  const e = O(
45
45
  () => n,
46
46
  Object.values(n ?? {})
47
47
  );
48
- return /* @__PURE__ */ P(o, { value: e, children: s });
48
+ return /* @__PURE__ */ A(o.Provider, { value: e, children: s });
49
49
  };
50
- m.displayName = l + "Provider";
51
- function r({
50
+ m.displayName = r + "Provider";
51
+ function l({
52
52
  consumerName: s,
53
53
  contextRequired: n
54
54
  }) {
@@ -57,80 +57,80 @@ function U(l, t) {
57
57
  return e;
58
58
  if (n)
59
59
  throw new Error(
60
- `${s} must be used within ${l}`
60
+ `${s} must be used within ${r}`
61
61
  );
62
62
  return t || {};
63
63
  }
64
- return [m, r];
64
+ return [m, l];
65
65
  }
66
- function V(...l) {
67
- return N(k(l));
66
+ function V(...r) {
67
+ return N(k(r));
68
68
  }
69
69
  const _ = ({
70
- currentStep: l,
70
+ currentStep: r,
71
71
  totalSteps: t,
72
72
  size: o,
73
73
  label: m,
74
- strokeWidth: r = 4,
74
+ strokeWidth: l = 4,
75
75
  arcPercentage: s = 0.75
76
76
  }) => {
77
- const n = Math.min(Math.max(l, 0), t), e = m ?? `${n}/${t}`, c = t <= 0 ? 0 : n / t, a = (o - r) / 2, i = o / 2, h = o / 2, f = 2 * Math.PI * a, g = f * s, D = g * (1 - c), d = n <= 0, M = `${g} ${f}`, T = d ? g - 2 : D;
77
+ const n = Math.min(Math.max(r, 0), t), e = m ?? `${n}/${t}`, i = t <= 0 ? 0 : n / t, a = (o - l) / 2, c = o / 2, h = o / 2, f = 2 * Math.PI * a, g = f * s, D = g * (1 - i), d = n <= 0, C = `${g} ${f}`, T = d ? g - 2 : D;
78
78
  return {
79
79
  displayLabel: e,
80
- progress: c,
80
+ progress: i,
81
81
  r: a,
82
- cx: i,
82
+ cx: c,
83
83
  cy: h,
84
84
  circumference: f,
85
85
  trackArcLength: g,
86
86
  trackDashArray: `${g} ${f}`,
87
- progressDashArray: M,
87
+ progressDashArray: C,
88
88
  progressDashOffset: T,
89
89
  showMinimalDot: d
90
90
  };
91
91
  };
92
- function F(l, t, o = {}) {
93
- const { leading: m = !1, trailing: r = !0, maxWait: s } = o;
94
- let n = null, e = null, c = null, a = 0, i = null, h = null, f;
92
+ function F(r, t, o = {}) {
93
+ const { leading: m = !1, trailing: l = !0, maxWait: s } = o;
94
+ let n = null, e = null, i = null, a = 0, c = null, h = null, f;
95
95
  const g = s !== void 0, D = g ? Math.max(s, t) : 0, d = (u) => {
96
96
  a = u;
97
- const p = i, $ = h;
98
- return i = null, h = null, f = l.apply($, p), f;
99
- }, M = (u) => {
100
- const p = c ? u - c : 0;
97
+ const p = c, $ = h;
98
+ return c = null, h = null, f = r.apply($, p), f;
99
+ }, C = (u) => {
100
+ const p = i ? u - i : 0;
101
101
  return t - p;
102
102
  }, T = (u) => {
103
- const p = c ? u - c : t, $ = u - a;
104
- return c === null || p >= t || p < 0 || g && $ >= D;
105
- }, y = (u) => (n = null, r && i ? d(u) : (i = null, h = null, f)), x = () => {
103
+ const p = i ? u - i : t, $ = u - a;
104
+ return i === null || p >= t || p < 0 || g && $ >= D;
105
+ }, M = (u) => (n = null, l && c ? d(u) : (c = null, h = null, f)), x = () => {
106
106
  const u = Date.now();
107
107
  if (T(u)) {
108
- y(u);
108
+ M(u);
109
109
  return;
110
110
  }
111
- n = setTimeout(x, M(u));
111
+ n = setTimeout(x, C(u));
112
112
  }, b = () => {
113
113
  const u = Date.now();
114
- e = null, i && (d(u), n !== null && (clearTimeout(n), n = setTimeout(x, t)));
115
- }, L = (u) => (a = u, n = setTimeout(x, t), g && (e = setTimeout(b, D)), m ? d(u) : f), S = () => {
116
- n !== null && clearTimeout(n), e !== null && clearTimeout(e), a = 0, i = null, h = null, c = null, n = null, e = null;
117
- }, v = () => n === null && e === null ? f : y(Date.now()), A = () => n !== null || e !== null, w = function(...u) {
114
+ e = null, c && (d(u), n !== null && (clearTimeout(n), n = setTimeout(x, t)));
115
+ }, v = (u) => (a = u, n = setTimeout(x, t), g && (e = setTimeout(b, D)), m ? d(u) : f), L = () => {
116
+ n !== null && clearTimeout(n), e !== null && clearTimeout(e), a = 0, c = null, h = null, i = null, n = null, e = null;
117
+ }, P = () => n === null && e === null ? f : M(Date.now()), S = () => n !== null || e !== null, w = function(...u) {
118
118
  const p = Date.now(), $ = T(p);
119
- if (i = u, h = this, c = p, $) {
119
+ if (c = u, h = this, i = p, $) {
120
120
  if (n === null)
121
- return L(p);
121
+ return v(p);
122
122
  if (g)
123
123
  return clearTimeout(n), n = setTimeout(x, t), d(p);
124
124
  }
125
125
  return n === null && (n = setTimeout(x, t)), f;
126
126
  };
127
- return w.cancel = S, w.flush = v, w.pending = A, w;
127
+ return w.cancel = L, w.flush = P, w.pending = S, w;
128
128
  }
129
- function Q(l, t, o = {}) {
130
- const { leading: m = !0, trailing: r = !0 } = o;
131
- return F(l, t, {
129
+ function Q(r, t, o = {}) {
130
+ const { leading: m = !0, trailing: l = !0 } = o;
131
+ return F(r, t, {
132
132
  leading: m,
133
- trailing: r,
133
+ trailing: l,
134
134
  maxWait: t
135
135
  });
136
136
  }
@@ -138,7 +138,7 @@ export {
138
138
  V as cn,
139
139
  U as createSafeContext,
140
140
  F as debounce,
141
- C as formatThousands,
141
+ y as formatThousands,
142
142
  J as getFontSize,
143
143
  _ as getStepperCalculations,
144
144
  K as textFormatter,
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react",
3
- "version": "0.0.83",
3
+ "version": "0.0.85",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "keywords": [
@@ -41,7 +41,7 @@
41
41
  ]
42
42
  },
43
43
  "dependencies": {
44
- "@ledgerhq/lumen-utils-shared": "0.0.19",
44
+ "@ledgerhq/lumen-utils-shared": "0.0.20",
45
45
  "i18next": "^23.7.0",
46
46
  "react-i18next": "^14.0.0"
47
47
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react",
3
- "version": "0.0.84",
3
+ "version": "0.0.86",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "keywords": [