@ledgerhq/lumen-ui-react 0.1.41 → 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.
@@ -1 +1 @@
1
- {"version":3,"file":"MediaButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/MediaButton/MediaButton.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA4BhD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,WAAW,GAAI,6IAYzB,gBAAgB,4CA4ClB,CAAC"}
1
+ {"version":3,"file":"MediaButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/MediaButton/MediaButton.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAiFhD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,WAAW,GAAI,6IAYzB,gBAAgB,4CA6ClB,CAAC"}
@@ -1,10 +1,10 @@
1
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
- import { useDisabledContext as h, cn as u } from "../../../libs/utils-shared/dist/index.js";
3
- import { Slot as S, Slottable as x } from "@radix-ui/react-slot";
4
- import { cva as C } from "class-variance-authority";
5
- import { baseButtonVariants as b } from "../Button/BaseButton.js";
6
- import { ChevronDown as z } from "../../Symbols/Icons/ChevronDown.js";
7
- const y = C("gap-8 body-2-semi-bold", {
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import { useDisabledContext as C, cn as u } from "../../../libs/utils-shared/dist/index.js";
3
+ import { Slot as g, Slottable as v } from "@radix-ui/react-slot";
4
+ import { cva as S } from "class-variance-authority";
5
+ import { baseButtonVariants as z } from "../Button/BaseButton.js";
6
+ import { ChevronDown as x } from "../../Symbols/Icons/ChevronDown.js";
7
+ const y = S("gap-8 body-2-semi-bold", {
8
8
  variants: {
9
9
  size: {
10
10
  sm: "",
@@ -14,60 +14,114 @@ const y = C("gap-8 body-2-semi-bold", {
14
14
  flat: "",
15
15
  rounded: "",
16
16
  none: ""
17
+ },
18
+ hasChevron: {
19
+ true: "",
20
+ false: ""
17
21
  }
18
22
  },
19
23
  compoundVariants: [
20
- { size: "md", leadingContentShape: "flat", class: "px-16 py-12" },
21
- { size: "md", leadingContentShape: "rounded", class: "py-8 pr-16 pl-8" },
22
- { size: "md", leadingContentShape: "none", class: "px-16 py-14" },
23
- { size: "sm", leadingContentShape: "flat", class: "px-12 py-10" },
24
- { size: "sm", leadingContentShape: "rounded", class: "py-8 pr-10 pl-8" },
25
- { size: "sm", leadingContentShape: "none", class: "px-12 py-10" }
24
+ {
25
+ size: "md",
26
+ leadingContentShape: ["flat", "none"],
27
+ hasChevron: !0,
28
+ class: "py-14 pr-12 pl-16"
29
+ },
30
+ {
31
+ size: "sm",
32
+ leadingContentShape: ["flat", "none"],
33
+ hasChevron: !0,
34
+ class: "py-10 pr-8 pl-12"
35
+ },
36
+ {
37
+ size: "md",
38
+ leadingContentShape: "rounded",
39
+ hasChevron: !0,
40
+ class: "py-8 pr-12 pl-8"
41
+ },
42
+ {
43
+ size: "sm",
44
+ leadingContentShape: "rounded",
45
+ hasChevron: !0,
46
+ class: "p-8"
47
+ },
48
+ {
49
+ size: "md",
50
+ leadingContentShape: "flat",
51
+ hasChevron: !1,
52
+ class: "px-16 py-12"
53
+ },
54
+ {
55
+ size: "md",
56
+ leadingContentShape: "none",
57
+ hasChevron: !1,
58
+ class: "px-16 py-14"
59
+ },
60
+ {
61
+ size: "sm",
62
+ leadingContentShape: ["flat", "none"],
63
+ hasChevron: !1,
64
+ class: "px-12 py-10"
65
+ },
66
+ {
67
+ size: "md",
68
+ leadingContentShape: "rounded",
69
+ hasChevron: !1,
70
+ class: "py-8 pr-16 pl-8"
71
+ },
72
+ {
73
+ size: "sm",
74
+ leadingContentShape: "rounded",
75
+ hasChevron: !1,
76
+ class: "py-8 pr-10 pl-8"
77
+ }
26
78
  ],
27
79
  defaultVariants: {
28
80
  size: "md",
29
- leadingContentShape: "none"
81
+ leadingContentShape: "none",
82
+ hasChevron: !0
30
83
  }
31
84
  }), k = ({
32
- ref: i,
33
- className: l,
85
+ ref: r,
86
+ className: i,
34
87
  appearance: p = "gray",
35
- size: m = "md",
36
- disabled: r = !1,
88
+ size: d = "md",
89
+ disabled: h = !1,
37
90
  asChild: n = !1,
38
91
  leadingContent: a,
39
- leadingContentShape: d = "flat",
40
- hideChevron: c = !1,
41
- children: s,
42
- ...f
92
+ leadingContentShape: m = "flat",
93
+ hideChevron: s = !1,
94
+ children: t,
95
+ ...c
43
96
  }) => {
44
- const t = h({
97
+ const o = C({
45
98
  consumerName: "MediaButton",
46
- mergeWith: { disabled: r }
47
- }), g = a ? d : "none";
48
- return /* @__PURE__ */ o(
49
- n ? S : "button",
99
+ mergeWith: { disabled: h }
100
+ }), f = a ? m : "none";
101
+ return /* @__PURE__ */ l(
102
+ n ? g : "button",
50
103
  {
51
- ref: i,
104
+ ref: r,
52
105
  className: u(
53
- b({
106
+ z({
54
107
  appearance: p,
55
- disabled: t,
108
+ disabled: o,
56
109
  loading: !1
57
110
  }),
58
111
  y({
59
- size: m,
60
- leadingContentShape: g
112
+ size: d,
113
+ leadingContentShape: f,
114
+ hasChevron: !s
61
115
  }),
62
- l
116
+ i
63
117
  ),
64
- disabled: t,
65
- ...f,
118
+ disabled: o,
119
+ ...c,
66
120
  children: [
67
121
  a && /* @__PURE__ */ e("span", { className: "inline-flex shrink-0 items-center", children: a }),
68
- /* @__PURE__ */ o("span", { className: "flex items-center gap-2", children: [
69
- n ? /* @__PURE__ */ e(x, { children: s }) : /* @__PURE__ */ e("span", { className: "line-clamp-1 text-left", children: s }),
70
- !c && /* @__PURE__ */ e(z, { size: 20 })
122
+ /* @__PURE__ */ l("span", { className: "flex items-center gap-2", children: [
123
+ n ? /* @__PURE__ */ e(v, { children: t }) : /* @__PURE__ */ e("span", { className: "line-clamp-1 text-left", children: t }),
124
+ !s && /* @__PURE__ */ e(x, { size: 20 })
71
125
  ] })
72
126
  ]
73
127
  }
@@ -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.40",
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.41",
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",