@ledgerhq/lumen-ui-react 0.1.4 → 0.1.6

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,188 +1,188 @@
1
- import { jsx as c, jsxs as u } from "react/jsx-runtime";
2
- import { createSafeContext as h, cn as x } from "../../../libs/utils-shared/dist/index.js";
3
- import { flexRender as b } from "@tanstack/react-table";
4
- import { useCallback as N, Fragment as B } from "react";
5
- import { TableRoot as C, Table as S, TableLoadingRow as H, TableHeader as k, TableHeaderRow as G, TableHeaderCell as v, TableSortButton as q, TableBody as T, TableGroupHeaderRow as I, TableRow as F, TableCell as M } from "../Table/Table.js";
1
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
2
+ import { createSafeContext as y, cn as C } from "../../../libs/utils-shared/dist/index.js";
3
+ import { flexRender as m } from "@tanstack/react-table";
4
+ import { useCallback as x, Fragment as N } from "react";
5
+ import { TableRoot as B, Table as S, TableLoadingRow as k, TableHeader as H, TableHeaderRow as G, TableHeaderCell as v, TableSortButton as q, TableBody as T, TableGroupHeaderRow as I, TableRow as F, TableCell as M } from "../Table/Table.js";
6
6
  import { SearchInput as j } from "../SearchInput/SearchInput.js";
7
- const [P, d] = h("DataTableContext"), V = ({
8
- table: t,
7
+ const [P, d] = y("DataTableContext"), V = ({
8
+ table: n,
9
9
  appearance: r = "no-background",
10
- paginationMode: n = "none",
11
- loading: a = !1,
12
- onScrollBottom: e,
13
- onRowClick: l,
14
- groupBy: o,
15
- renderGroupHeader: s,
16
- hideHeader: i = !1,
17
- children: f,
18
- className: y,
10
+ paginationMode: o = "none",
11
+ loading: e = !1,
12
+ onScrollBottom: a,
13
+ onRowClick: t,
14
+ groupBy: c,
15
+ renderGroupHeader: i,
16
+ hideHeader: s = !1,
17
+ children: h,
18
+ className: f,
19
19
  ref: w,
20
20
  ...R
21
- }) => /* @__PURE__ */ c(
21
+ }) => /* @__PURE__ */ l(
22
22
  P,
23
23
  {
24
24
  value: {
25
- hideHeader: i,
26
- paginationMode: n,
27
- table: t,
25
+ hideHeader: s,
26
+ paginationMode: o,
27
+ table: n,
28
28
  appearance: r,
29
- loading: a,
30
- onScrollBottom: e,
31
- onRowClick: l,
32
- groupBy: o,
33
- renderGroupHeader: s
29
+ loading: e,
30
+ onScrollBottom: a,
31
+ onRowClick: t,
32
+ groupBy: c,
33
+ renderGroupHeader: i
34
34
  },
35
- children: /* @__PURE__ */ c("div", { ref: w, className: x("flex flex-col", y), ...R, children: f })
35
+ children: /* @__PURE__ */ l("div", { ref: w, className: C("flex flex-col", f), ...R, children: h })
36
36
  }
37
37
  );
38
38
  V.displayName = "DataTableRoot";
39
39
  const p = ({
40
- className: t,
40
+ className: n,
41
41
  ref: r,
42
- ...n
42
+ ...o
43
43
  }) => {
44
- const { table: a } = d({
44
+ const { table: e } = d({
45
45
  consumerName: "DataTableHeader",
46
46
  contextRequired: !0
47
47
  });
48
- return /* @__PURE__ */ c(k, { ref: r, className: t, ...n, children: a.getHeaderGroups().map((e) => /* @__PURE__ */ c(G, { children: e.headers.map((l) => {
49
- const o = l.column.columnDef.meta;
50
- return /* @__PURE__ */ c(
48
+ return /* @__PURE__ */ l(H, { ref: r, className: n, ...o, children: e.getHeaderGroups().map((a) => /* @__PURE__ */ l(G, { children: a.headers.map((t) => {
49
+ const c = t.column.columnDef.meta;
50
+ return /* @__PURE__ */ l(
51
51
  v,
52
52
  {
53
- align: o == null ? void 0 : o.align,
54
- hideBelow: o == null ? void 0 : o.hideBelow,
55
- className: o == null ? void 0 : o.className,
56
- trailingContent: o == null ? void 0 : o.headerTrailingContent,
57
- children: l.isPlaceholder ? null : l.column.getCanSort() ? /* @__PURE__ */ c(
53
+ align: c?.align,
54
+ hideBelow: c?.hideBelow,
55
+ className: c?.className,
56
+ trailingContent: c?.headerTrailingContent,
57
+ children: t.isPlaceholder ? null : t.column.getCanSort() ? /* @__PURE__ */ l(
58
58
  q,
59
59
  {
60
- sortDirection: l.column.getIsSorted() || void 0,
61
- onClick: l.column.getToggleSortingHandler(),
62
- align: o == null ? void 0 : o.align,
63
- children: b(
64
- l.column.columnDef.header,
65
- l.getContext()
60
+ sortDirection: t.column.getIsSorted() || void 0,
61
+ onClick: t.column.getToggleSortingHandler(),
62
+ align: c?.align,
63
+ children: m(
64
+ t.column.columnDef.header,
65
+ t.getContext()
66
66
  )
67
67
  }
68
- ) : b(
69
- l.column.columnDef.header,
70
- l.getContext()
68
+ ) : m(
69
+ t.column.columnDef.header,
70
+ t.getContext()
71
71
  )
72
72
  },
73
- l.id
73
+ t.id
74
74
  );
75
- }) }, e.id)) });
75
+ }) }, a.id)) });
76
76
  };
77
77
  p.displayName = "DataTableHeader";
78
- const J = ({ className: t, ref: r, ...n }) => {
78
+ const J = ({ className: n, ref: r, ...o }) => {
79
79
  const {
80
- appearance: a,
81
- paginationMode: e,
82
- hideHeader: l,
83
- loading: o,
84
- onScrollBottom: s,
85
- groupBy: i
80
+ appearance: e,
81
+ paginationMode: a,
82
+ hideHeader: t,
83
+ loading: c,
84
+ onScrollBottom: i,
85
+ groupBy: s
86
86
  } = d({
87
87
  consumerName: "DataTable",
88
88
  contextRequired: !0
89
89
  });
90
90
  return /* @__PURE__ */ u(
91
- C,
91
+ B,
92
92
  {
93
93
  ref: r,
94
- appearance: a,
95
- loading: o,
96
- onScrollBottom: s,
97
- className: t,
98
- ...n,
94
+ appearance: e,
95
+ loading: c,
96
+ onScrollBottom: i,
97
+ className: n,
98
+ ...o,
99
99
  children: [
100
100
  /* @__PURE__ */ u(S, { children: [
101
- !l && /* @__PURE__ */ c(p, {}),
102
- i ? /* @__PURE__ */ c(g, {}) : /* @__PURE__ */ c(D, {})
101
+ !t && /* @__PURE__ */ l(p, {}),
102
+ s ? /* @__PURE__ */ l(D, {}) : /* @__PURE__ */ l(g, {})
103
103
  ] }),
104
- e === "infinite-scroll" && /* @__PURE__ */ c(H, {})
104
+ a === "infinite-scroll" && /* @__PURE__ */ l(k, {})
105
105
  ]
106
106
  }
107
107
  );
108
108
  };
109
109
  J.displayName = "DataTable";
110
- const D = ({ className: t, ref: r, ...n }) => {
111
- const { table: a } = d({
110
+ const g = ({ className: n, ref: r, ...o }) => {
111
+ const { table: e } = d({
112
112
  consumerName: "DataTableBody",
113
113
  contextRequired: !0
114
114
  });
115
- return /* @__PURE__ */ c(T, { ref: r, className: t, ...n, children: a.getRowModel().rows.map((e) => /* @__PURE__ */ c(m, { row: e }, e.id)) });
115
+ return /* @__PURE__ */ l(T, { ref: r, className: n, ...o, children: e.getRowModel().rows.map((a) => /* @__PURE__ */ l(b, { row: a }, a.id)) });
116
116
  };
117
- D.displayName = "DataTableBody";
118
- const K = (t, r) => {
119
- const n = [];
120
- let a = null;
121
- for (const e of t) {
122
- const l = r(e);
123
- (!a || a.key !== l) && (a = { key: l, rows: [], count: 0 }, n.push(a)), a.rows.push(e), a.count++;
117
+ g.displayName = "DataTableBody";
118
+ const K = (n, r) => {
119
+ const o = [];
120
+ let e = null;
121
+ for (const a of n) {
122
+ const t = r(a);
123
+ (!e || e.key !== t) && (e = { key: t, rows: [], count: 0 }, o.push(e)), e.rows.push(a), e.count++;
124
124
  }
125
- return n;
126
- }, g = ({
127
- className: t,
125
+ return o;
126
+ }, D = ({
127
+ className: n,
128
128
  ref: r,
129
- ...n
129
+ ...o
130
130
  }) => {
131
- const { table: a, groupBy: e, renderGroupHeader: l } = d({
131
+ const { table: e, groupBy: a, renderGroupHeader: t } = d({
132
132
  consumerName: "DataTableGroupedBody",
133
133
  contextRequired: !0
134
- }), o = K(a.getRowModel().rows, e);
135
- return /* @__PURE__ */ c(T, { ref: r, className: t, ...n, children: o.map((s) => /* @__PURE__ */ u(B, { children: [
136
- /* @__PURE__ */ c(I, { colSpan: s.rows[0].getVisibleCells().length, children: l ? l({ row: s.rows[0], count: s.count }) : s.key }),
137
- s.rows.map((i) => /* @__PURE__ */ c(m, { row: i }, i.id))
138
- ] }, s.key)) });
134
+ }), c = K(e.getRowModel().rows, a);
135
+ return /* @__PURE__ */ l(T, { ref: r, className: n, ...o, children: c.map((i) => /* @__PURE__ */ u(N, { children: [
136
+ /* @__PURE__ */ l(I, { colSpan: i.rows[0].getVisibleCells().length, children: t ? t({ row: i.rows[0], count: i.count }) : i.key }),
137
+ i.rows.map((s) => /* @__PURE__ */ l(b, { row: s }, s.id))
138
+ ] }, i.key)) });
139
139
  };
140
- g.displayName = "DataTableGroupedBody";
141
- const m = ({ row: t }) => {
140
+ D.displayName = "DataTableGroupedBody";
141
+ const b = ({ row: n }) => {
142
142
  const { onRowClick: r } = d({
143
143
  consumerName: "DataTableRow",
144
144
  contextRequired: !0
145
- }), n = !!r;
146
- return /* @__PURE__ */ c(
145
+ }), o = !!r;
146
+ return /* @__PURE__ */ l(
147
147
  F,
148
148
  {
149
- clickable: n,
150
- onClick: n ? () => r == null ? void 0 : r(t) : void 0,
151
- children: t.getVisibleCells().map((a) => {
152
- const e = a.column.columnDef.meta;
153
- return /* @__PURE__ */ c(
149
+ clickable: o,
150
+ onClick: o ? () => r?.(n) : void 0,
151
+ children: n.getVisibleCells().map((e) => {
152
+ const a = e.column.columnDef.meta;
153
+ return /* @__PURE__ */ l(
154
154
  M,
155
155
  {
156
- align: e == null ? void 0 : e.align,
157
- hideBelow: e == null ? void 0 : e.hideBelow,
158
- className: e == null ? void 0 : e.className,
159
- children: b(a.column.columnDef.cell, a.getContext())
156
+ align: a?.align,
157
+ hideBelow: a?.hideBelow,
158
+ className: a?.className,
159
+ children: m(e.column.columnDef.cell, e.getContext())
160
160
  },
161
- a.id
161
+ e.id
162
162
  );
163
163
  })
164
164
  }
165
165
  );
166
166
  };
167
- m.displayName = "DataTableRow";
167
+ b.displayName = "DataTableRow";
168
168
  const L = ({
169
- onChange: t,
169
+ onChange: n,
170
170
  ...r
171
171
  }) => {
172
- const { table: n } = d({
172
+ const { table: o } = d({
173
173
  consumerName: "DataTableGlobalSearchInput",
174
174
  contextRequired: !0
175
- }), a = N(
176
- (e) => {
177
- n.setGlobalFilter(e.target.value), t == null || t(e);
175
+ }), e = x(
176
+ (a) => {
177
+ o.setGlobalFilter(a.target.value), n?.(a);
178
178
  },
179
- [n, t]
179
+ [o, n]
180
180
  );
181
- return /* @__PURE__ */ c(
181
+ return /* @__PURE__ */ l(
182
182
  j,
183
183
  {
184
- value: n.getState().globalFilter ?? "",
185
- onChange: a,
184
+ value: o.getState().globalFilter ?? "",
185
+ onChange: e,
186
186
  ...r
187
187
  }
188
188
  );
@@ -1,10 +1,10 @@
1
1
  import { jsx as a, jsxs as l } from "react/jsx-runtime";
2
2
  import { cn as o } from "../../../libs/utils-shared/dist/index.js";
3
3
  import * as t from "@radix-ui/react-dropdown-menu";
4
- import { Check as c } from "../../Symbols/Icons/Check.js";
5
- import { Divider as b } from "../Divider/Divider.js";
6
- import { ChevronRight as N } from "../../Symbols/Icons/ChevronRight.js";
7
- const p = o(
4
+ import { Check as u } from "../../Symbols/Icons/Check.js";
5
+ import { Divider as p } from "../Divider/Divider.js";
6
+ import { ChevronRight as b } from "../../Symbols/Icons/ChevronRight.js";
7
+ const c = o(
8
8
  "z-menu min-w-160 overflow-hidden rounded-sm bg-muted p-8",
9
9
  "shadow-sm",
10
10
  "data-[state=open]:animate-fade-in",
@@ -17,14 +17,14 @@ const p = o(
17
17
  "focus:bg-base-transparent-hover",
18
18
  "active:bg-base-transparent-pressed",
19
19
  "data-disabled:pointer-events-none data-disabled:text-disabled"
20
- ), g = o("px-8 py-4 body-3-semi-bold text-muted"), y = o(
20
+ ), N = o("px-8 py-4 body-3-semi-bold text-muted"), g = o(
21
21
  m,
22
22
  "data-[state=open]:bg-base-transparent-hover"
23
23
  );
24
- function j({ ...e }) {
24
+ function P({ ...e }) {
25
25
  return /* @__PURE__ */ a(t.Root, { "data-slot": "menu", ...e });
26
26
  }
27
- const f = ({ ref: e, ...n }) => /* @__PURE__ */ a(
27
+ const y = ({ ref: e, ...n }) => /* @__PURE__ */ a(
28
28
  t.Trigger,
29
29
  {
30
30
  ref: e,
@@ -32,24 +32,24 @@ const f = ({ ref: e, ...n }) => /* @__PURE__ */ a(
32
32
  ...n
33
33
  }
34
34
  );
35
- f.displayName = t.Trigger.displayName;
36
- function G({ ...e }) {
35
+ y.displayName = t.Trigger.displayName;
36
+ function j({ ...e }) {
37
37
  return /* @__PURE__ */ a(t.Group, { "data-slot": "menu-group", ...e });
38
38
  }
39
- function L({
39
+ function G({
40
40
  ...e
41
41
  }) {
42
42
  return /* @__PURE__ */ a(t.Portal, { ...e });
43
43
  }
44
- function D({
44
+ function L({
45
45
  ...e
46
46
  }) {
47
47
  return /* @__PURE__ */ a(t.Sub, { ...e });
48
48
  }
49
- function K({ ...e }) {
49
+ function D({ ...e }) {
50
50
  return /* @__PURE__ */ a(t.RadioGroup, { "data-slot": "menu-radio-group", ...e });
51
51
  }
52
- const h = ({
52
+ const f = ({
53
53
  ref: e,
54
54
  className: n,
55
55
  inset: s,
@@ -60,26 +60,26 @@ const h = ({
60
60
  {
61
61
  ref: e,
62
62
  "data-slot": "menu-sub-trigger",
63
- className: o(y, s && "pl-32", n),
63
+ className: o(g, s && "pl-32", n),
64
64
  ...r,
65
65
  children: [
66
66
  i,
67
- /* @__PURE__ */ a(N, { size: 20, className: "ml-auto text-muted" })
67
+ /* @__PURE__ */ a(b, { size: 20, className: "ml-auto text-muted" })
68
68
  ]
69
69
  }
70
70
  );
71
- h.displayName = t.SubTrigger.displayName;
72
- const x = ({ ref: e, className: n, ...s }) => /* @__PURE__ */ a(
71
+ f.displayName = t.SubTrigger.displayName;
72
+ const h = ({ ref: e, className: n, ...s }) => /* @__PURE__ */ a(
73
73
  t.SubContent,
74
74
  {
75
75
  ref: e,
76
76
  "data-slot": "menu-sub-content",
77
- className: o(p, n),
77
+ className: o(c, n),
78
78
  ...s
79
79
  }
80
80
  );
81
- x.displayName = t.SubContent.displayName;
82
- const M = ({
81
+ h.displayName = t.SubContent.displayName;
82
+ const x = ({
83
83
  ref: e,
84
84
  className: n,
85
85
  sideOffset: s = 4,
@@ -91,17 +91,16 @@ const M = ({
91
91
  ref: e,
92
92
  "data-slot": "menu-content",
93
93
  sideOffset: s,
94
- className: o(p, n),
94
+ className: o(c, n),
95
95
  onClick: (d) => {
96
- var u;
97
- d.stopPropagation(), (u = r.onClick) == null || u.call(r, d);
96
+ d.stopPropagation(), r.onClick?.(d);
98
97
  },
99
98
  align: i,
100
99
  ...r
101
100
  }
102
101
  ) });
103
- M.displayName = t.Content.displayName;
104
- const S = ({ ref: e, className: n, inset: s, ...i }) => /* @__PURE__ */ a(
102
+ x.displayName = t.Content.displayName;
103
+ const M = ({ ref: e, className: n, inset: s, ...i }) => /* @__PURE__ */ a(
105
104
  t.Item,
106
105
  {
107
106
  ref: e,
@@ -110,8 +109,8 @@ const S = ({ ref: e, className: n, inset: s, ...i }) => /* @__PURE__ */ a(
110
109
  ...i
111
110
  }
112
111
  );
113
- S.displayName = t.Item.displayName;
114
- const C = ({
112
+ M.displayName = t.Item.displayName;
113
+ const S = ({
115
114
  ref: e,
116
115
  className: n,
117
116
  children: s,
@@ -127,12 +126,12 @@ const C = ({
127
126
  ...r,
128
127
  children: [
129
128
  s,
130
- /* @__PURE__ */ a("span", { className: "ml-auto flex size-24 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(c, { size: 24, className: "text-active" }) }) })
129
+ /* @__PURE__ */ a("span", { className: "ml-auto flex size-24 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(u, { size: 24, className: "text-active" }) }) })
131
130
  ]
132
131
  }
133
132
  );
134
- C.displayName = t.CheckboxItem.displayName;
135
- const I = ({
133
+ S.displayName = t.CheckboxItem.displayName;
134
+ const C = ({
136
135
  ref: e,
137
136
  className: n,
138
137
  children: s,
@@ -146,12 +145,12 @@ const I = ({
146
145
  ...i,
147
146
  children: [
148
147
  s,
149
- /* @__PURE__ */ a("span", { className: "ml-auto flex size-24 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(c, { size: 24, className: "text-active" }) }) })
148
+ /* @__PURE__ */ a("span", { className: "ml-auto flex size-24 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(u, { size: 24, className: "text-active" }) }) })
150
149
  ]
151
150
  }
152
151
  );
153
- I.displayName = t.RadioItem.displayName;
154
- const v = ({
152
+ C.displayName = t.RadioItem.displayName;
153
+ const I = ({
155
154
  ref: e,
156
155
  className: n,
157
156
  inset: s,
@@ -161,26 +160,26 @@ const v = ({
161
160
  {
162
161
  ref: e,
163
162
  "data-slot": "menu-label",
164
- className: o(g, s && "pl-32", n),
163
+ className: o(N, s && "pl-32", n),
165
164
  ...i
166
165
  }
167
166
  );
168
- v.displayName = t.Label.displayName;
169
- const k = ({ ref: e, className: n, ...s }) => /* @__PURE__ */ a(b, { ref: e, className: o("mx-8 my-4 w-auto", n), ...s });
170
- k.displayName = "MenuSeparator";
167
+ I.displayName = t.Label.displayName;
168
+ const v = ({ ref: e, className: n, ...s }) => /* @__PURE__ */ a(p, { ref: e, className: o("mx-8 my-4 w-auto", n), ...s });
169
+ v.displayName = "MenuSeparator";
171
170
  export {
172
- j as Menu,
173
- C as MenuCheckboxItem,
174
- M as MenuContent,
175
- G as MenuGroup,
176
- S as MenuItem,
177
- v as MenuLabel,
178
- L as MenuPortal,
179
- K as MenuRadioGroup,
180
- I as MenuRadioItem,
181
- k as MenuSeparator,
182
- D as MenuSub,
183
- x as MenuSubContent,
184
- h as MenuSubTrigger,
185
- f as MenuTrigger
171
+ P as Menu,
172
+ S as MenuCheckboxItem,
173
+ x as MenuContent,
174
+ j as MenuGroup,
175
+ M as MenuItem,
176
+ I as MenuLabel,
177
+ G as MenuPortal,
178
+ D as MenuRadioGroup,
179
+ C as MenuRadioItem,
180
+ v as MenuSeparator,
181
+ L as MenuSub,
182
+ h as MenuSubContent,
183
+ f as MenuSubTrigger,
184
+ y as MenuTrigger
186
185
  };