@ledgerhq/lumen-ui-react 0.1.4 → 0.1.5
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.
- package/dist/_virtual/dynamic-import-helper.js +1 -8
- package/dist/lib/Components/BaseInput/BaseInput.js +72 -75
- package/dist/lib/Components/DataTable/DataTable.js +108 -108
- package/dist/lib/Components/Menu/Menu.js +50 -51
- package/dist/lib/Components/SideBar/SideBar.js +57 -57
- package/dist/lib/Components/Table/Table.js +50 -50
- package/dist/lib/Components/Table/utils/useThrottledScrollBottom.js +20 -21
- package/dist/lib/Components/Tile/Tile.js +48 -48
- package/dist/lib/Components/TileButton/TileButton.js +24 -24
- package/dist/node_modules/react-i18next/dist/es/context.js +9 -12
- package/dist/package.json +1 -1
- package/dist/utils/useControllableState/useControllableState.js +17 -18
- package/package.json +1 -1
|
@@ -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
|
|
5
|
-
import { Divider as
|
|
6
|
-
import { ChevronRight as
|
|
7
|
-
const
|
|
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
|
-
),
|
|
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
|
|
24
|
+
function P({ ...e }) {
|
|
25
25
|
return /* @__PURE__ */ a(t.Root, { "data-slot": "menu", ...e });
|
|
26
26
|
}
|
|
27
|
-
const
|
|
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
|
-
|
|
36
|
-
function
|
|
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
|
|
39
|
+
function G({
|
|
40
40
|
...e
|
|
41
41
|
}) {
|
|
42
42
|
return /* @__PURE__ */ a(t.Portal, { ...e });
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function L({
|
|
45
45
|
...e
|
|
46
46
|
}) {
|
|
47
47
|
return /* @__PURE__ */ a(t.Sub, { ...e });
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function D({ ...e }) {
|
|
50
50
|
return /* @__PURE__ */ a(t.RadioGroup, { "data-slot": "menu-radio-group", ...e });
|
|
51
51
|
}
|
|
52
|
-
const
|
|
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(
|
|
63
|
+
className: o(g, s && "pl-32", n),
|
|
64
64
|
...r,
|
|
65
65
|
children: [
|
|
66
66
|
i,
|
|
67
|
-
/* @__PURE__ */ a(
|
|
67
|
+
/* @__PURE__ */ a(b, { size: 20, className: "ml-auto text-muted" })
|
|
68
68
|
]
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
|
-
|
|
72
|
-
const
|
|
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(
|
|
77
|
+
className: o(c, n),
|
|
78
78
|
...s
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
|
-
|
|
82
|
-
const
|
|
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(
|
|
94
|
+
className: o(c, n),
|
|
95
95
|
onClick: (d) => {
|
|
96
|
-
|
|
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
|
-
|
|
104
|
-
const
|
|
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
|
-
|
|
114
|
-
const
|
|
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(
|
|
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
|
-
|
|
135
|
-
const
|
|
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(
|
|
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
|
-
|
|
154
|
-
const
|
|
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(
|
|
163
|
+
className: o(N, s && "pl-32", n),
|
|
165
164
|
...i
|
|
166
165
|
}
|
|
167
166
|
);
|
|
168
|
-
|
|
169
|
-
const
|
|
170
|
-
|
|
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
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { createSafeContext as
|
|
1
|
+
import { jsx as a, jsxs as C, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { createSafeContext as k, cn as c } from "../../../libs/utils-shared/dist/index.js";
|
|
3
3
|
import { cva as v } from "class-variance-authority";
|
|
4
4
|
import { t as h } from "../../../node_modules/i18next/dist/esm/i18next.js";
|
|
5
|
-
import { useCallback as
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
import { useControllableState as
|
|
8
|
-
import { ExpandRight as
|
|
9
|
-
import { ExpandLeft as
|
|
10
|
-
const [
|
|
5
|
+
import { useCallback as B } from "react";
|
|
6
|
+
import { Tooltip as j, TooltipTrigger as P, TooltipContent as R } from "../Tooltip/Tooltip.js";
|
|
7
|
+
import { useControllableState as x } from "../../../utils/useControllableState/useControllableState.js";
|
|
8
|
+
import { ExpandRight as V } from "../../Symbols/Icons/ExpandRight.js";
|
|
9
|
+
import { ExpandLeft as q } from "../../Symbols/Icons/ExpandLeft.js";
|
|
10
|
+
const [z, S] = k("SideBar"), d = {
|
|
11
11
|
root: v(
|
|
12
12
|
[
|
|
13
13
|
"flex h-full flex-col justify-between gap-16 overflow-y-auto rounded-xl bg-muted-transparent p-16",
|
|
@@ -50,36 +50,36 @@ const [E, C] = j("SideBar"), m = {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
)
|
|
53
|
-
},
|
|
54
|
-
ref:
|
|
53
|
+
}, E = ({
|
|
54
|
+
ref: n,
|
|
55
55
|
collapsed: t,
|
|
56
56
|
defaultCollapsed: e = !1,
|
|
57
57
|
onCollapsedChange: o,
|
|
58
|
-
active:
|
|
59
|
-
defaultActive:
|
|
58
|
+
active: r,
|
|
59
|
+
defaultActive: i,
|
|
60
60
|
onActiveChange: s,
|
|
61
61
|
children: f,
|
|
62
|
-
className:
|
|
62
|
+
className: p,
|
|
63
63
|
...b
|
|
64
64
|
}) => {
|
|
65
|
-
const [
|
|
65
|
+
const [m, g] = x({
|
|
66
66
|
prop: t,
|
|
67
67
|
defaultProp: e,
|
|
68
68
|
onChange: o
|
|
69
|
-
}), [
|
|
70
|
-
prop:
|
|
71
|
-
defaultProp:
|
|
69
|
+
}), [u, l] = x({
|
|
70
|
+
prop: r,
|
|
71
|
+
defaultProp: i ?? "",
|
|
72
72
|
onChange: s
|
|
73
73
|
});
|
|
74
74
|
return /* @__PURE__ */ a(
|
|
75
|
-
|
|
75
|
+
z,
|
|
76
76
|
{
|
|
77
|
-
value: { collapsed:
|
|
77
|
+
value: { collapsed: m, setCollapsed: g, active: u, onActiveChange: l },
|
|
78
78
|
children: /* @__PURE__ */ a(
|
|
79
79
|
"nav",
|
|
80
80
|
{
|
|
81
|
-
ref:
|
|
82
|
-
className:
|
|
81
|
+
ref: n,
|
|
82
|
+
className: c(d.root({ collapsed: m }), p),
|
|
83
83
|
"aria-label": h("components.sideBar.navigationAriaLabel"),
|
|
84
84
|
...b,
|
|
85
85
|
children: f
|
|
@@ -88,110 +88,110 @@ const [E, C] = j("SideBar"), m = {
|
|
|
88
88
|
}
|
|
89
89
|
);
|
|
90
90
|
};
|
|
91
|
-
|
|
91
|
+
E.displayName = "SideBar";
|
|
92
92
|
const F = ({
|
|
93
|
-
ref:
|
|
93
|
+
ref: n,
|
|
94
94
|
children: t,
|
|
95
95
|
className: e,
|
|
96
96
|
...o
|
|
97
97
|
}) => /* @__PURE__ */ a(
|
|
98
98
|
"div",
|
|
99
99
|
{
|
|
100
|
-
ref:
|
|
101
|
-
className:
|
|
100
|
+
ref: n,
|
|
101
|
+
className: c(d.section(), e),
|
|
102
102
|
...o,
|
|
103
103
|
children: t
|
|
104
104
|
}
|
|
105
105
|
);
|
|
106
106
|
F.displayName = "SideBarLeading";
|
|
107
107
|
const J = ({
|
|
108
|
-
ref:
|
|
108
|
+
ref: n,
|
|
109
109
|
children: t,
|
|
110
110
|
className: e,
|
|
111
111
|
...o
|
|
112
112
|
}) => /* @__PURE__ */ a(
|
|
113
113
|
"div",
|
|
114
114
|
{
|
|
115
|
-
ref:
|
|
116
|
-
className:
|
|
115
|
+
ref: n,
|
|
116
|
+
className: c("mt-auto", d.section(), e),
|
|
117
117
|
...o,
|
|
118
118
|
children: t
|
|
119
119
|
}
|
|
120
120
|
);
|
|
121
121
|
J.displayName = "SideBarTrailing";
|
|
122
122
|
const K = ({
|
|
123
|
-
ref:
|
|
123
|
+
ref: n,
|
|
124
124
|
value: t,
|
|
125
125
|
icon: e,
|
|
126
126
|
activeIcon: o,
|
|
127
|
-
label:
|
|
128
|
-
tooltipContent:
|
|
127
|
+
label: r,
|
|
128
|
+
tooltipContent: i,
|
|
129
129
|
disabled: s = !1,
|
|
130
130
|
className: f,
|
|
131
|
-
onClick:
|
|
131
|
+
onClick: p,
|
|
132
132
|
...b
|
|
133
133
|
}) => {
|
|
134
|
-
const { collapsed:
|
|
134
|
+
const { collapsed: m, active: g, onActiveChange: u } = S({
|
|
135
135
|
consumerName: "SideBarItem",
|
|
136
136
|
contextRequired: !0
|
|
137
|
-
}),
|
|
138
|
-
(
|
|
139
|
-
s || (
|
|
137
|
+
}), l = g === t, N = l ? o : e, y = i ?? r, T = B(
|
|
138
|
+
(I) => {
|
|
139
|
+
s || (p?.(I), u?.(t));
|
|
140
140
|
},
|
|
141
|
-
[s,
|
|
142
|
-
), w = /* @__PURE__ */
|
|
141
|
+
[s, p, u, t]
|
|
142
|
+
), w = /* @__PURE__ */ C(L, { children: [
|
|
143
143
|
/* @__PURE__ */ a(N, { size: 20, className: "shrink-0" }),
|
|
144
|
-
|
|
145
|
-
] }),
|
|
144
|
+
r != null && /* @__PURE__ */ a("span", { className: "translate-x-8 truncate", children: r })
|
|
145
|
+
] }), A = /* @__PURE__ */ a(
|
|
146
146
|
"button",
|
|
147
147
|
{
|
|
148
|
-
ref:
|
|
148
|
+
ref: n,
|
|
149
149
|
type: "button",
|
|
150
150
|
disabled: s,
|
|
151
151
|
onClick: T,
|
|
152
|
-
className:
|
|
153
|
-
|
|
152
|
+
className: c(
|
|
153
|
+
d.item({ active: l, disabled: s }),
|
|
154
154
|
f
|
|
155
155
|
),
|
|
156
|
-
"aria-current":
|
|
156
|
+
"aria-current": l ? "page" : void 0,
|
|
157
157
|
...b,
|
|
158
158
|
children: w
|
|
159
159
|
}
|
|
160
160
|
);
|
|
161
|
-
return /* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */ a(
|
|
163
|
-
/* @__PURE__ */ a(
|
|
161
|
+
return /* @__PURE__ */ C(j, { open: m ? void 0 : !1, children: [
|
|
162
|
+
/* @__PURE__ */ a(P, { asChild: !0, children: A }),
|
|
163
|
+
/* @__PURE__ */ a(R, { side: "right", sideOffset: 8, children: y })
|
|
164
164
|
] });
|
|
165
165
|
};
|
|
166
166
|
K.displayName = "SideBarItem";
|
|
167
167
|
const O = ({
|
|
168
|
-
className:
|
|
168
|
+
className: n,
|
|
169
169
|
...t
|
|
170
170
|
}) => {
|
|
171
|
-
const { collapsed: e, setCollapsed: o } =
|
|
171
|
+
const { collapsed: e, setCollapsed: o } = S({
|
|
172
172
|
consumerName: "SideBarCollapseToggle",
|
|
173
173
|
contextRequired: !0
|
|
174
|
-
}),
|
|
174
|
+
}), r = B(() => {
|
|
175
175
|
o(!e);
|
|
176
|
-
}, [e, o]),
|
|
176
|
+
}, [e, o]), i = e ? V : q;
|
|
177
177
|
return /* @__PURE__ */ a(
|
|
178
178
|
"button",
|
|
179
179
|
{
|
|
180
180
|
type: "button",
|
|
181
|
-
onClick:
|
|
182
|
-
className:
|
|
183
|
-
|
|
184
|
-
|
|
181
|
+
onClick: r,
|
|
182
|
+
className: c(
|
|
183
|
+
d.item({ active: !1, disabled: !1 }),
|
|
184
|
+
n
|
|
185
185
|
),
|
|
186
186
|
"aria-label": e ? h("components.sideBar.expandAriaLabel") : h("components.sideBar.collapseAriaLabel"),
|
|
187
187
|
...t,
|
|
188
|
-
children: /* @__PURE__ */ a(
|
|
188
|
+
children: /* @__PURE__ */ a(i, { size: 20, className: "shrink-0" })
|
|
189
189
|
}
|
|
190
190
|
);
|
|
191
191
|
};
|
|
192
192
|
O.displayName = "SideBarCollapseToggle";
|
|
193
193
|
export {
|
|
194
|
-
|
|
194
|
+
E as SideBar,
|
|
195
195
|
O as SideBarCollapseToggle,
|
|
196
196
|
K as SideBarItem,
|
|
197
197
|
F as SideBarLeading,
|