@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.
- package/dist/_virtual/dynamic-import-helper.js +1 -8
- package/dist/index.js +70 -69
- 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/ThemeProvider/ThemeProvider.d.ts +2 -9
- package/dist/lib/Components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/lib/Components/ThemeProvider/ThemeProvider.js +14 -25
- package/dist/lib/Components/ThemeProvider/ThemeProvider.types.d.ts +9 -3
- package/dist/lib/Components/ThemeProvider/ThemeProvider.types.d.ts.map +1 -1
- package/dist/lib/Components/ThemeProvider/ThemeProvider.types.js +8 -0
- package/dist/lib/Components/ThemeProvider/useRootColorModeSideEffect.d.ts +3 -3
- package/dist/lib/Components/ThemeProvider/useRootColorModeSideEffect.d.ts.map +1 -1
- package/dist/lib/Components/ThemeProvider/useRootColorModeSideEffect.js +20 -14
- 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,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,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as n, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { createSafeContext as N, cn as c } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
-
import { cva as
|
|
3
|
+
import { cva as s } from "class-variance-authority";
|
|
4
4
|
import { useThrottledScrollBottom as T } from "./utils/useThrottledScrollBottom.js";
|
|
5
5
|
import { Spot as g } from "../Spot/Spot.js";
|
|
6
6
|
import { Information as w } from "../../Symbols/Icons/Information.js";
|
|
7
|
-
import { useCommonTranslation as
|
|
8
|
-
import { ChevronUpDown as
|
|
9
|
-
import { ChevronDescending as
|
|
7
|
+
import { useCommonTranslation as C } from "../../../i18n/useCommonTranslation.js";
|
|
8
|
+
import { ChevronUpDown as R } from "../../Symbols/Icons/ChevronUpDown.js";
|
|
9
|
+
import { ChevronDescending as B } from "../../Symbols/Icons/ChevronDescending.js";
|
|
10
10
|
import { ChevronAscending as j } from "../../Symbols/Icons/ChevronAscending.js";
|
|
11
11
|
import { InteractiveIcon as H } from "../InteractiveIcon/InteractiveIcon.js";
|
|
12
|
-
const [A, u] = N("Table"), I =
|
|
12
|
+
const [A, u] = N("Table"), I = s(
|
|
13
13
|
"relative scrollbar-none w-full max-w-full border-collapse overflow-x-auto rounded-lg",
|
|
14
14
|
{
|
|
15
15
|
variants: {
|
|
@@ -25,7 +25,7 @@ const [A, u] = N("Table"), I = o(
|
|
|
25
25
|
className: a,
|
|
26
26
|
onScrollBottom: l,
|
|
27
27
|
loading: r,
|
|
28
|
-
ref:
|
|
28
|
+
ref: o,
|
|
29
29
|
...i
|
|
30
30
|
}) => {
|
|
31
31
|
const d = T({
|
|
@@ -36,7 +36,7 @@ const [A, u] = N("Table"), I = o(
|
|
|
36
36
|
"div",
|
|
37
37
|
{
|
|
38
38
|
...i,
|
|
39
|
-
ref:
|
|
39
|
+
ref: o,
|
|
40
40
|
className: I({ appearance: e, className: a }),
|
|
41
41
|
onScroll: d,
|
|
42
42
|
children: t
|
|
@@ -44,7 +44,7 @@ const [A, u] = N("Table"), I = o(
|
|
|
44
44
|
) });
|
|
45
45
|
};
|
|
46
46
|
L.displayName = "TableRoot";
|
|
47
|
-
const
|
|
47
|
+
const S = ({ children: t, className: e, ref: a, ...l }) => /* @__PURE__ */ n(
|
|
48
48
|
"table",
|
|
49
49
|
{
|
|
50
50
|
...l,
|
|
@@ -53,28 +53,28 @@ const V = ({ children: t, className: e, ref: a, ...l }) => /* @__PURE__ */ n(
|
|
|
53
53
|
children: t
|
|
54
54
|
}
|
|
55
55
|
);
|
|
56
|
-
|
|
57
|
-
const
|
|
56
|
+
S.displayName = "Table";
|
|
57
|
+
const V = ({
|
|
58
58
|
children: t,
|
|
59
59
|
className: e,
|
|
60
60
|
ref: a,
|
|
61
61
|
...l
|
|
62
62
|
}) => /* @__PURE__ */ n("thead", { ref: a, className: e, ...l, children: t });
|
|
63
|
-
|
|
64
|
-
const
|
|
63
|
+
V.displayName = "TableHeader";
|
|
64
|
+
const k = ({
|
|
65
65
|
children: t,
|
|
66
66
|
className: e,
|
|
67
67
|
ref: a,
|
|
68
68
|
...l
|
|
69
69
|
}) => /* @__PURE__ */ n("tbody", { ref: a, className: e, ...l, children: t });
|
|
70
|
-
|
|
71
|
-
const
|
|
70
|
+
k.displayName = "TableBody";
|
|
71
|
+
const q = ({
|
|
72
72
|
children: t,
|
|
73
73
|
className: e,
|
|
74
74
|
clickable: a = !1,
|
|
75
75
|
onClick: l,
|
|
76
76
|
ref: r,
|
|
77
|
-
...
|
|
77
|
+
...o
|
|
78
78
|
}) => /* @__PURE__ */ n(
|
|
79
79
|
"tr",
|
|
80
80
|
{
|
|
@@ -85,19 +85,19 @@ const z = ({
|
|
|
85
85
|
a && "cursor-pointer outline-none select-none hover:bg-base-transparent-hover active:bg-base-transparent-pressed",
|
|
86
86
|
e
|
|
87
87
|
),
|
|
88
|
-
...
|
|
88
|
+
...o,
|
|
89
89
|
children: t
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
|
-
|
|
93
|
-
const
|
|
92
|
+
q.displayName = "TableRow";
|
|
93
|
+
const z = s("sticky top-0", {
|
|
94
94
|
variants: {
|
|
95
95
|
appearance: {
|
|
96
96
|
"no-background": "bg-canvas",
|
|
97
97
|
plain: "bg-surface"
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
}),
|
|
100
|
+
}), G = ({
|
|
101
101
|
children: t,
|
|
102
102
|
className: e,
|
|
103
103
|
ref: a,
|
|
@@ -111,21 +111,21 @@ const G = o("sticky top-0", {
|
|
|
111
111
|
"tr",
|
|
112
112
|
{
|
|
113
113
|
ref: a,
|
|
114
|
-
className:
|
|
114
|
+
className: z({ appearance: r, className: e }),
|
|
115
115
|
...l,
|
|
116
116
|
children: t
|
|
117
117
|
}
|
|
118
118
|
);
|
|
119
119
|
};
|
|
120
|
-
|
|
121
|
-
const
|
|
120
|
+
G.displayName = "TableHeaderRow";
|
|
121
|
+
const M = ({
|
|
122
122
|
children: t,
|
|
123
123
|
className: e,
|
|
124
124
|
colSpan: a = 1,
|
|
125
125
|
ref: l,
|
|
126
126
|
...r
|
|
127
127
|
}) => {
|
|
128
|
-
const { appearance:
|
|
128
|
+
const { appearance: o } = u({
|
|
129
129
|
consumerName: "TableGroupHeaderRow",
|
|
130
130
|
contextRequired: !0
|
|
131
131
|
});
|
|
@@ -134,15 +134,15 @@ const k = ({
|
|
|
134
134
|
{
|
|
135
135
|
className: c(
|
|
136
136
|
"flex h-32 w-full items-center bg-muted px-12 body-3 text-base",
|
|
137
|
-
|
|
137
|
+
o === "no-background" && "rounded-sm"
|
|
138
138
|
),
|
|
139
139
|
children: t
|
|
140
140
|
}
|
|
141
141
|
) }) });
|
|
142
142
|
};
|
|
143
|
-
|
|
143
|
+
M.displayName = "TableGroupHeaderRow";
|
|
144
144
|
const p = {
|
|
145
|
-
root:
|
|
145
|
+
root: s(
|
|
146
146
|
"h-64 truncate p-12 body-3 text-base first:rounded-l-md last:rounded-r-md",
|
|
147
147
|
{
|
|
148
148
|
variants: {
|
|
@@ -156,7 +156,7 @@ const p = {
|
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
),
|
|
159
|
-
inner:
|
|
159
|
+
inner: s("flex flex-1 justify-end", {
|
|
160
160
|
variants: {
|
|
161
161
|
align: {
|
|
162
162
|
start: "text-start justify-start",
|
|
@@ -170,18 +170,18 @@ const p = {
|
|
|
170
170
|
hideBelow: a,
|
|
171
171
|
align: l = "start",
|
|
172
172
|
ref: r,
|
|
173
|
-
...
|
|
173
|
+
...o
|
|
174
174
|
}) => /* @__PURE__ */ n(
|
|
175
175
|
"td",
|
|
176
176
|
{
|
|
177
177
|
ref: r,
|
|
178
178
|
className: p.root({ hideBelow: a, className: e }),
|
|
179
|
-
...
|
|
179
|
+
...o,
|
|
180
180
|
children: /* @__PURE__ */ n("div", { className: p.inner({ align: l }), children: t })
|
|
181
181
|
}
|
|
182
182
|
);
|
|
183
183
|
J.displayName = "TableCell";
|
|
184
|
-
const K =
|
|
184
|
+
const K = s("flex items-center gap-12 truncate", {
|
|
185
185
|
variants: {
|
|
186
186
|
align: {
|
|
187
187
|
start: "text-start",
|
|
@@ -194,12 +194,12 @@ const K = o("flex items-center gap-12 truncate", {
|
|
|
194
194
|
leadingContent: a,
|
|
195
195
|
title: l,
|
|
196
196
|
description: r,
|
|
197
|
-
ref:
|
|
197
|
+
ref: o,
|
|
198
198
|
...i
|
|
199
199
|
}) => /* @__PURE__ */ m(
|
|
200
200
|
"div",
|
|
201
201
|
{
|
|
202
|
-
ref:
|
|
202
|
+
ref: o,
|
|
203
203
|
className: K({ align: e, className: t }),
|
|
204
204
|
...i,
|
|
205
205
|
children: [
|
|
@@ -213,7 +213,7 @@ const K = o("flex items-center gap-12 truncate", {
|
|
|
213
213
|
);
|
|
214
214
|
P.displayName = "TableCellContent";
|
|
215
215
|
const f = {
|
|
216
|
-
root:
|
|
216
|
+
root: s("group h-40 truncate p-12 body-3 text-base", {
|
|
217
217
|
variants: {
|
|
218
218
|
hideBelow: {
|
|
219
219
|
xs: "hidden xs:table-cell",
|
|
@@ -224,7 +224,7 @@ const f = {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
}),
|
|
227
|
-
content:
|
|
227
|
+
content: s("flex min-w-0 items-center gap-4 truncate", {
|
|
228
228
|
variants: {
|
|
229
229
|
align: {
|
|
230
230
|
start: "text-start justify-start",
|
|
@@ -232,7 +232,7 @@ const f = {
|
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
}),
|
|
235
|
-
trailingContent:
|
|
235
|
+
trailingContent: s(
|
|
236
236
|
"flex items-center justify-center opacity-0 group-hover:opacity-100"
|
|
237
237
|
)
|
|
238
238
|
}, U = ({
|
|
@@ -241,7 +241,7 @@ const f = {
|
|
|
241
241
|
scope: a = "col",
|
|
242
242
|
hideBelow: l,
|
|
243
243
|
align: r = "start",
|
|
244
|
-
trailingContent:
|
|
244
|
+
trailingContent: o,
|
|
245
245
|
ref: i,
|
|
246
246
|
...d
|
|
247
247
|
}) => /* @__PURE__ */ n(
|
|
@@ -253,7 +253,7 @@ const f = {
|
|
|
253
253
|
...d,
|
|
254
254
|
children: /* @__PURE__ */ n("div", { className: "min-w-0", children: /* @__PURE__ */ m("div", { className: f.content({ align: r }), children: [
|
|
255
255
|
/* @__PURE__ */ n("span", { className: c("truncate", r === "end" && "order-1"), children: t }),
|
|
256
|
-
/* @__PURE__ */ n("div", { className: "flex items-center justify-center opacity-0 group-hover:opacity-100", children:
|
|
256
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-center opacity-0 group-hover:opacity-100", children: o })
|
|
257
257
|
] }) })
|
|
258
258
|
}
|
|
259
259
|
);
|
|
@@ -343,10 +343,10 @@ const W = ({
|
|
|
343
343
|
W.displayName = "TableInfoIcon";
|
|
344
344
|
const X = {
|
|
345
345
|
asc: j,
|
|
346
|
-
desc:
|
|
347
|
-
idle:
|
|
346
|
+
desc: B,
|
|
347
|
+
idle: R
|
|
348
348
|
}, v = {
|
|
349
|
-
root:
|
|
349
|
+
root: s(
|
|
350
350
|
[
|
|
351
351
|
"flex min-w-0 cursor-pointer items-center gap-4",
|
|
352
352
|
"rounded-xs focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus"
|
|
@@ -360,7 +360,7 @@ const X = {
|
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
362
|
),
|
|
363
|
-
icon:
|
|
363
|
+
icon: s("", {
|
|
364
364
|
variants: {
|
|
365
365
|
active: {
|
|
366
366
|
true: "opacity-100",
|
|
@@ -374,11 +374,11 @@ const X = {
|
|
|
374
374
|
align: a = "start",
|
|
375
375
|
onToggleSort: l,
|
|
376
376
|
className: r,
|
|
377
|
-
onClick:
|
|
377
|
+
onClick: o,
|
|
378
378
|
ref: i,
|
|
379
379
|
...d
|
|
380
380
|
}) => {
|
|
381
|
-
const { t: b } =
|
|
381
|
+
const { t: b } = C(), x = X[e || "idle"], h = {
|
|
382
382
|
asc: b("table.ascAriaLabel"),
|
|
383
383
|
desc: b("table.descAriaLabel")
|
|
384
384
|
};
|
|
@@ -391,7 +391,7 @@ const X = {
|
|
|
391
391
|
className: v.root({ align: a, className: r }),
|
|
392
392
|
"aria-label": e ? h[e] : void 0,
|
|
393
393
|
onClick: (y) => {
|
|
394
|
-
|
|
394
|
+
o?.(y), l?.(e === "asc" ? "desc" : "asc");
|
|
395
395
|
},
|
|
396
396
|
children: [
|
|
397
397
|
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: t }),
|
|
@@ -410,20 +410,20 @@ const X = {
|
|
|
410
410
|
};
|
|
411
411
|
Y.displayName = "TableSortButton";
|
|
412
412
|
export {
|
|
413
|
-
|
|
413
|
+
S as Table,
|
|
414
414
|
E as TableActionBar,
|
|
415
415
|
F as TableActionBarLeading,
|
|
416
416
|
O as TableActionBarTrailing,
|
|
417
|
-
|
|
417
|
+
k as TableBody,
|
|
418
418
|
J as TableCell,
|
|
419
419
|
P as TableCellContent,
|
|
420
|
-
|
|
421
|
-
|
|
420
|
+
M as TableGroupHeaderRow,
|
|
421
|
+
V as TableHeader,
|
|
422
422
|
U as TableHeaderCell,
|
|
423
|
-
|
|
423
|
+
G as TableHeaderRow,
|
|
424
424
|
W as TableInfoIcon,
|
|
425
425
|
Q as TableLoadingRow,
|
|
426
426
|
L as TableRoot,
|
|
427
|
-
|
|
427
|
+
q as TableRow,
|
|
428
428
|
Y as TableSortButton
|
|
429
429
|
};
|
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
import { throttle as h } from "../../../../libs/utils-shared/dist/index.js";
|
|
2
|
-
import { useMemo as L, useRef as
|
|
2
|
+
import { useMemo as L, useRef as s, useEffect as _ } from "react";
|
|
3
3
|
import { TABLE_SCROLL_BOTTOM_THRESHOLD_IN_ROW as R, TABLE_CELL_HEIGHT as a } from "../constants.js";
|
|
4
4
|
const m = 150, E = ({
|
|
5
5
|
element: t,
|
|
6
|
-
threshold:
|
|
6
|
+
threshold: r = 10
|
|
7
7
|
}) => {
|
|
8
|
-
const { scrollTop:
|
|
9
|
-
return
|
|
8
|
+
const { scrollTop: c, scrollHeight: n, clientHeight: e } = t;
|
|
9
|
+
return c + e >= n - r;
|
|
10
10
|
}, p = ({
|
|
11
11
|
onScrollBottom: t,
|
|
12
|
-
loading:
|
|
13
|
-
thresholdInRow:
|
|
12
|
+
loading: r = !1,
|
|
13
|
+
thresholdInRow: c = R
|
|
14
14
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
() =>
|
|
17
|
-
[
|
|
18
|
-
), e =
|
|
19
|
-
e.current = t,
|
|
20
|
-
const
|
|
15
|
+
const n = L(
|
|
16
|
+
() => c * a,
|
|
17
|
+
[c]
|
|
18
|
+
), e = s(t), u = s(r);
|
|
19
|
+
e.current = t, u.current = r;
|
|
20
|
+
const l = s(null), f = L(() => {
|
|
21
21
|
if (!t)
|
|
22
22
|
return;
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
const i = h((o) => {
|
|
24
|
+
u.current || !e.current || E({ element: o, threshold: n }) && e.current();
|
|
25
25
|
}, m);
|
|
26
|
-
return
|
|
27
|
-
const T =
|
|
28
|
-
T &&
|
|
26
|
+
return l.current = i, (o) => {
|
|
27
|
+
const T = o.currentTarget;
|
|
28
|
+
T && i(T);
|
|
29
29
|
};
|
|
30
|
-
}, [t,
|
|
30
|
+
}, [t, n]);
|
|
31
31
|
return _(() => () => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, [i]), i;
|
|
32
|
+
l.current?.cancel();
|
|
33
|
+
}, [f]), f;
|
|
35
34
|
};
|
|
36
35
|
export {
|
|
37
36
|
E as isScrolledToBottom,
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare const ThemeProvider: FC<ThemeProviderProps>;
|
|
4
|
-
declare const useTheme: () => {
|
|
5
|
-
toggleMode: () => void;
|
|
6
|
-
mode: ThemeMode;
|
|
7
|
-
setMode: (mode: ThemeMode) => void;
|
|
8
|
-
locale: ThemeProviderProps["locale"];
|
|
9
|
-
};
|
|
10
|
-
export { ThemeProvider, useTheme };
|
|
2
|
+
import { ThemeProviderProps } from './ThemeProvider.types';
|
|
3
|
+
export declare const ThemeProvider: FC<ThemeProviderProps>;
|
|
11
4
|
//# sourceMappingURL=ThemeProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/ThemeProvider/ThemeProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/ThemeProvider/ThemeProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAiB,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAU1E,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAoBhD,CAAC"}
|
|
@@ -1,35 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { createSafeContext as i } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { useMemo as f } from "react";
|
|
4
|
+
import { COLOR_SCHEMES as s } from "./ThemeProvider.types.js";
|
|
5
|
+
import { useRootColorModeSideEffect as n } from "./useRootColorModeSideEffect.js";
|
|
6
|
+
import { I18nProvider as d } from "../../../i18n/I18nProvider.js";
|
|
7
|
+
const [p] = i("ThemeProvider"), M = ({
|
|
8
|
+
children: t,
|
|
9
|
+
colorScheme: r = s.system,
|
|
9
10
|
locale: o
|
|
10
11
|
}) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const d = c(
|
|
12
|
+
n({ colorScheme: r });
|
|
13
|
+
const m = f(
|
|
14
14
|
() => ({
|
|
15
|
-
|
|
16
|
-
setMode: n,
|
|
15
|
+
colorScheme: r,
|
|
17
16
|
locale: o
|
|
18
17
|
}),
|
|
19
|
-
[
|
|
18
|
+
[r, o]
|
|
20
19
|
);
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
}, P = () => {
|
|
23
|
-
const e = p({
|
|
24
|
-
consumerName: "useTheme",
|
|
25
|
-
contextRequired: !0
|
|
26
|
-
});
|
|
27
|
-
return {
|
|
28
|
-
...e,
|
|
29
|
-
toggleMode: () => e.setMode(e.mode === m ? T : m)
|
|
30
|
-
};
|
|
20
|
+
return /* @__PURE__ */ e(p, { value: m, children: /* @__PURE__ */ e(d, { locale: o, children: t }) });
|
|
31
21
|
};
|
|
32
22
|
export {
|
|
33
|
-
|
|
34
|
-
P as useTheme
|
|
23
|
+
M as ThemeProvider
|
|
35
24
|
};
|