@ledgerhq/lumen-ui-react 0.1.42 → 0.1.43

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.
@@ -120,7 +120,7 @@ const ae = l(
120
120
  const { selectedValue: n } = p({
121
121
  consumerName: "SelectInputTrigger",
122
122
  contextRequired: !0
123
- }), i = n != null && n !== "";
123
+ }), i = n !== null && n !== "";
124
124
  return /* @__PURE__ */ u(
125
125
  x,
126
126
  {
@@ -1,36 +1,36 @@
1
- import { useState as b, useCallback as i, useMemo as u } from "react";
2
- import { useControllableState as x } from "../../../../utils/useControllableState/useControllableState.js";
3
- import { groupItemsByKey as m, defaultLabelFilter as G } from "../utils/groupItems.js";
1
+ import { useState as b, useCallback as f, useMemo as u } from "react";
2
+ import { useControllableState as v } from "../../../../utils/useControllableState/useControllableState.js";
3
+ import { groupItemsByKey as d, defaultLabelFilter as x } from "../utils/groupItems.js";
4
4
  function B({
5
5
  items: r,
6
6
  filter: s,
7
- filteredItems: o,
8
- searchValue: d,
7
+ filteredItems: a,
8
+ searchValue: m,
9
9
  defaultSearchValue: p,
10
10
  onSearchValueChange: S
11
11
  }) {
12
- const [c, h] = b(!1), [t, f] = x({
13
- prop: d,
12
+ const [c, h] = b(!1), [t, i] = v({
13
+ prop: m,
14
14
  defaultProp: p ?? "",
15
15
  onChange: S
16
- }), g = i(() => (h(!0), () => h(!1)), []), V = i(
16
+ }), g = f(() => (h(!0), () => h(!1)), []), V = f(
17
17
  (e) => {
18
- f(e);
18
+ i(e);
19
19
  },
20
- [f]
21
- ), a = c ? s === void 0 ? G : s : null, n = u(
22
- () => r.some((e) => e.group != null),
20
+ [i]
21
+ ), l = c ? s === void 0 ? x : s : null, n = u(
22
+ () => r.some((e) => e.group !== void 0),
23
23
  [r]
24
- ), l = u(
25
- () => n ? m(r) : null,
24
+ ), o = u(
25
+ () => n ? d(r) : null,
26
26
  [r, n]
27
- ), C = u(() => !a || !t.trim() ? l ?? r : l ? l.map((e) => ({
27
+ ), C = u(() => !l || !t.trim() ? o ?? r : o ? o.map((e) => ({
28
28
  ...e,
29
- items: e.items.filter((F) => a(F, t))
30
- })).filter((e) => e.items.length > 0) : r.filter((e) => a(e, t)), [l, r, t, a]), I = u(() => o ? n ? m(o) : o : null, [o, n]) ?? C;
29
+ items: e.items.filter((F) => l(F, t))
30
+ })).filter((e) => e.items.length > 0) : r.filter((e) => l(e, t)), [o, r, t, l]), I = u(() => a ? n ? d(a) : a : null, [a, n]) ?? C;
31
31
  return {
32
32
  isGrouped: n,
33
- groupedItems: l,
33
+ groupedItems: o,
34
34
  filteredItemsForRoot: I,
35
35
  resolvedSearchValue: t,
36
36
  searchMounted: c,
@@ -30,13 +30,14 @@ function H(e, t = {}) {
30
30
  return n = n.replace(/\D/g, ""), a > 0 && n.length > a && (n = n.slice(0, a)), s ? w(n) : n;
31
31
  n === "." && (n = "0.");
32
32
  const c = n.indexOf(".");
33
- if (c !== -1) {
33
+ if (c === -1)
34
+ a > 0 && n.length > a && (n = n.slice(0, a));
35
+ else {
34
36
  let u = n.slice(0, c), d = n.slice(c + 1).replace(/\./g, "");
35
37
  a > 0 && u.length > a && (u = u.slice(0, a)), d = d.slice(0, i), u === "" && (u = "0");
36
38
  const h = r.endsWith(".") || n.endsWith(".");
37
39
  n = d.length > 0 ? `${u}.${d}` : h ? `${u}.` : u;
38
- } else
39
- a > 0 && n.length > a && (n = n.slice(0, a));
40
+ }
40
41
  return s ? w(n) : n;
41
42
  }
42
43
  function F(e, t) {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "keywords": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
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.1.5",
44
+ "@ledgerhq/lumen-utils-shared": "0.1.6",
45
45
  "i18next": "^23.7.0",
46
46
  "react-i18next": "^14.0.0"
47
47
  },
@@ -54,7 +54,7 @@
54
54
  "@radix-ui/react-tooltip": "^1.2.8",
55
55
  "class-variance-authority": "^0.7.1",
56
56
  "@tanstack/react-table": "^8.21.3",
57
- "@ledgerhq/lumen-design-core": "0.1.17",
57
+ "@ledgerhq/lumen-design-core": "0.1.18",
58
58
  "clsx": "^2.1.1",
59
59
  "react": "^18.0.0 || ^19.0.0",
60
60
  "react-dom": "^18.0.0 || ^19.0.0",