@ledgerhq/lumen-ui-react 0.0.59 → 0.0.61

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 (35) hide show
  1. package/dist/index.js +83 -76
  2. package/dist/lib/Components/AmountInput/AmountInput.js +10 -10
  3. package/dist/lib/Components/BaseInput/BaseInput.js +4 -4
  4. package/dist/lib/Components/Dialog/Dialog.d.ts +1 -0
  5. package/dist/lib/Components/Dialog/Dialog.d.ts.map +1 -1
  6. package/dist/lib/Components/Dialog/Dialog.js +32 -31
  7. package/dist/lib/Components/Dialog/types.d.ts +6 -0
  8. package/dist/lib/Components/Dialog/types.d.ts.map +1 -1
  9. package/dist/lib/Components/Divider/Divider.d.ts +24 -0
  10. package/dist/lib/Components/Divider/Divider.d.ts.map +1 -0
  11. package/dist/lib/Components/Divider/Divider.js +23 -0
  12. package/dist/lib/Components/Divider/index.d.ts +3 -0
  13. package/dist/lib/Components/Divider/index.d.ts.map +1 -0
  14. package/dist/lib/Components/Divider/types.d.ts +9 -0
  15. package/dist/lib/Components/Divider/types.d.ts.map +1 -0
  16. package/dist/lib/Components/Link/Link.js +5 -5
  17. package/dist/lib/Components/ListItem/ListItem.js +5 -5
  18. package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
  19. package/dist/lib/Components/Menu/Menu.js +80 -78
  20. package/dist/lib/Components/Select/Select.d.ts.map +1 -1
  21. package/dist/lib/Components/Select/Select.js +76 -74
  22. package/dist/lib/Components/Spot/Spot.js +4 -4
  23. package/dist/lib/Components/ThemeProvider/ThemeProvider.js +2 -2
  24. package/dist/lib/Components/Tile/Tile.d.ts +75 -45
  25. package/dist/lib/Components/Tile/Tile.d.ts.map +1 -1
  26. package/dist/lib/Components/Tile/Tile.js +168 -99
  27. package/dist/lib/Components/Tile/index.d.ts +1 -1
  28. package/dist/lib/Components/Tile/index.d.ts.map +1 -1
  29. package/dist/lib/Components/Tile/types.d.ts +68 -26
  30. package/dist/lib/Components/Tile/types.d.ts.map +1 -1
  31. package/dist/lib/Components/index.d.ts +1 -0
  32. package/dist/lib/Components/index.d.ts.map +1 -1
  33. package/dist/libs/utils-shared/dist/index.js +52 -44
  34. package/dist/package.json +2 -2
  35. package/package.json +2 -2
@@ -1,76 +1,84 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { createContext as d, useMemo as h, useContext as g } from "react";
3
- import { clsx as x } from "clsx";
4
- import { twMerge as $ } from "tailwind-merge";
5
- function P(t) {
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { createContext as h, Children as g, isValidElement as m, useMemo as x, useContext as $ } from "react";
3
+ import { clsx as C } from "clsx";
4
+ import { twMerge as w } from "tailwind-merge";
5
+ function S(t) {
6
6
  return t ? t.split(/[-_ ]+/).map((n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase()).join("") : "";
7
7
  }
8
- const w = 48, C = 17, v = 2;
9
- function S(t) {
8
+ const v = 48, j = 17, y = 2;
9
+ function b(t) {
10
10
  const n = t.replace(/\D/g, "").length;
11
11
  return Math.max(
12
- C,
13
- w - n * v
12
+ j,
13
+ v - n * y
14
14
  );
15
15
  }
16
- function m(t, n = !0) {
16
+ function p(t, n = !0) {
17
17
  if (!t) return "";
18
- const a = t.includes("."), [c, r] = t.split("."), o = c.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
19
- return a && n ? r ? `${o}.${r}` : `${o}.` : o;
18
+ const a = t.includes("."), [i, r] = t.split("."), s = i.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
19
+ return a && n ? r ? `${s}.${r}` : `${s}.` : s;
20
20
  }
21
- function b(t, n = {}) {
21
+ function F(t, n = {}) {
22
22
  const {
23
23
  allowDecimals: a = !0,
24
- thousandsSeparator: c = !0,
24
+ thousandsSeparator: i = !0,
25
25
  maxIntegerLength: r = 9,
26
- maxDecimalLength: o = 9
27
- } = n, i = t.replace(",", ".").replace(/[^\d.]/g, "");
28
- let e = i;
26
+ maxDecimalLength: s = 9
27
+ } = n, o = t.replace(",", ".").replace(/[^\d.]/g, "");
28
+ let e = o;
29
29
  if (e = e.replace(/^0+(?=\d)/, ""), !a)
30
- return e = e.replace(/\D/g, ""), r > 0 && e.length > r && (e = e.slice(0, r)), c ? m(e) : e;
30
+ return e = e.replace(/\D/g, ""), r > 0 && e.length > r && (e = e.slice(0, r)), i ? p(e) : e;
31
31
  e === "." && (e = "0.");
32
32
  const u = e.indexOf(".");
33
33
  if (u !== -1) {
34
- let s = e.slice(0, u), l = e.slice(u + 1).replace(/\./g, "");
35
- r > 0 && s.length > r && (s = s.slice(0, r)), l = l.slice(0, o), s === "" && (s = "0");
36
- const f = i.endsWith(".") || e.endsWith(".");
37
- e = l.length > 0 ? `${s}.${l}` : f ? `${s}.` : s;
34
+ let l = e.slice(0, u), c = e.slice(u + 1).replace(/\./g, "");
35
+ r > 0 && l.length > r && (l = l.slice(0, r)), c = c.slice(0, s), l === "" && (l = "0");
36
+ const f = o.endsWith(".") || e.endsWith(".");
37
+ e = c.length > 0 ? `${l}.${c}` : f ? `${l}.` : l;
38
38
  } else
39
39
  r > 0 && e.length > r && (e = e.slice(0, r));
40
- return c ? m(e) : e;
40
+ return i ? p(e) : e;
41
41
  }
42
- function A(t, n) {
43
- const a = d(n), c = ({ children: o, value: i }) => {
44
- const e = h(
45
- () => i,
46
- Object.values(i ?? {})
42
+ function O(t, n) {
43
+ const a = h(n), i = ({ children: s, value: o }) => {
44
+ const e = x(
45
+ () => o,
46
+ Object.values(o ?? {})
47
47
  );
48
- return /* @__PURE__ */ p(a.Provider, { value: e, children: o });
48
+ return /* @__PURE__ */ d(a.Provider, { value: e, children: s });
49
49
  };
50
- c.displayName = t + "Provider";
50
+ i.displayName = t + "Provider";
51
51
  function r({
52
- consumerName: o,
53
- contextRequired: i
52
+ consumerName: s,
53
+ contextRequired: o
54
54
  }) {
55
- const e = g(a);
55
+ const e = $(a);
56
56
  if (e)
57
57
  return e;
58
- if (i)
58
+ if (o)
59
59
  throw new Error(
60
- `${o} must be used within ${t}`
60
+ `${s} must be used within ${t}`
61
61
  );
62
62
  return n || {};
63
63
  }
64
- return [c, r];
64
+ return [i, r];
65
65
  }
66
- function E(...t) {
67
- return $(x(t));
66
+ function P(...t) {
67
+ return w(C(t));
68
+ }
69
+ function z(t, n) {
70
+ const a = g.toArray(t), i = typeof n == "string" ? (o) => m(o) && o.props["data-slot"] === n : (o) => m(o) && o.type === n, r = a.find(i), s = a.filter((o) => !i(o));
71
+ return {
72
+ slotElement: r ?? null,
73
+ remainingChildren: s
74
+ };
68
75
  }
69
76
  export {
70
- E as cn,
71
- A as createSafeContext,
72
- m as formatThousands,
73
- S as getFontSize,
74
- b as textFormatter,
75
- P as toPascalCase
77
+ P as cn,
78
+ O as createSafeContext,
79
+ z as extractSlottable,
80
+ p as formatThousands,
81
+ b as getFontSize,
82
+ F as textFormatter,
83
+ S as toPascalCase
76
84
  };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react",
3
- "version": "0.0.58",
3
+ "version": "0.0.60",
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.12",
44
+ "@ledgerhq/lumen-utils-shared": "0.0.14",
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.59",
3
+ "version": "0.0.61",
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.13",
44
+ "@ledgerhq/lumen-utils-shared": "0.0.15",
45
45
  "i18next": "^23.7.0",
46
46
  "react-i18next": "^14.0.0"
47
47
  },