@versini/ui-table 4.0.8 → 4.0.10
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/README.md +43 -1
- package/dist/components/Table/Table.js +472 -442
- package/dist/index.js +3 -3
- package/package.json +6 -4
|
@@ -1,181 +1,66 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
ASC: "asc",
|
|
6
|
-
DESC: "desc"
|
|
7
|
-
}, ge = ({
|
|
8
|
-
mode: e,
|
|
9
|
-
className: r,
|
|
10
|
-
wrapperClassName: t,
|
|
11
|
-
stickyHeader: a,
|
|
12
|
-
stickyFooter: l
|
|
13
|
-
}) => ({
|
|
14
|
-
wrapper: s(
|
|
15
|
-
"not-prose relative w-full rounded-lg shadow-md",
|
|
16
|
-
{
|
|
17
|
-
"overflow-x-auto": !a && !l,
|
|
18
|
-
"overflow-y-scroll": a || l,
|
|
19
|
-
"bg-surface-darker": e === "dark" || e === "system",
|
|
20
|
-
"bg-surface-light": e === "light" || e === "alt-system",
|
|
21
|
-
"dark:bg-surface-light": e === "system",
|
|
22
|
-
"dark:bg-surface-darker": e === "alt-system",
|
|
23
|
-
"text-copy-light": e === "dark",
|
|
24
|
-
"text-copy-dark": e === "light",
|
|
25
|
-
"text-copy-light dark:text-copy-dark": e === "system",
|
|
26
|
-
"text-copy-dark dark:text-copy-light": e === "alt-system"
|
|
27
|
-
},
|
|
28
|
-
t
|
|
29
|
-
),
|
|
30
|
-
table: s("my-0 w-full text-left text-sm", r, {
|
|
31
|
-
"text-copy-light": e === "dark",
|
|
32
|
-
"text-copy-dark": e === "light",
|
|
33
|
-
"text-copy-light dark:text-copy-dark": e === "system",
|
|
34
|
-
"text-copy-dark dark:text-copy-light": e === "alt-system"
|
|
35
|
-
}),
|
|
36
|
-
caption: s("py-2 text-sm font-bold", {
|
|
37
|
-
"text-copy-light": e === "dark",
|
|
38
|
-
"text-copy-dark": e === "light",
|
|
39
|
-
"text-copy-light dark:text-copy-dark": e === "system",
|
|
40
|
-
"text-copy-dark dark:text-copy-light": e === "alt-system"
|
|
41
|
-
})
|
|
42
|
-
}), he = ({
|
|
43
|
-
className: e,
|
|
44
|
-
stickyHeader: r,
|
|
45
|
-
mode: t
|
|
46
|
-
}) => s(
|
|
47
|
-
{
|
|
48
|
-
"sticky top-0 z-10": r,
|
|
49
|
-
"shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem]": r && t === "dark",
|
|
50
|
-
"shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem] dark:shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem]": r && t === "system",
|
|
51
|
-
"shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem]": r && t === "light",
|
|
52
|
-
"shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem] dark:shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem]": r && t === "alt-system"
|
|
53
|
-
},
|
|
54
|
-
e
|
|
55
|
-
), be = ({
|
|
56
|
-
className: e,
|
|
57
|
-
stickyFooter: r,
|
|
58
|
-
mode: t
|
|
59
|
-
}) => s(
|
|
60
|
-
{
|
|
61
|
-
"sticky bottom-0 z-10": r,
|
|
62
|
-
"shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem]": r && t === "dark",
|
|
63
|
-
"shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem] dark:shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem]": r && t === "system",
|
|
64
|
-
"shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem]": r && t === "light",
|
|
65
|
-
"shadow-[rgb(65_65_65_/30%)_-0_0.5rem_1rem] dark:shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem]": r && t === "alt-system"
|
|
66
|
-
},
|
|
67
|
-
e
|
|
68
|
-
), ue = ({
|
|
69
|
-
mode: e,
|
|
70
|
-
className: r,
|
|
71
|
-
cellWrapper: t
|
|
72
|
-
}) => t === z || t === W ? s(
|
|
73
|
-
{
|
|
74
|
-
"bg-table-head-dark": e === "dark" || e === "system",
|
|
75
|
-
"bg-table-head-light": e === "light" || e === "alt-system",
|
|
76
|
-
"dark:bg-table-head-light": e === "system",
|
|
77
|
-
"dark:bg-table-head-dark": e === "alt-system"
|
|
78
|
-
},
|
|
79
|
-
r
|
|
80
|
-
) : s(
|
|
81
|
-
"border-b last:border-0",
|
|
82
|
-
{
|
|
83
|
-
"border-table-dark": e === "dark" || e === "system",
|
|
84
|
-
"odd:bg-table-dark-odd even:bg-table-dark-even": t === x && e === "dark",
|
|
85
|
-
"border-table-light": e === "light" || e === "alt-system",
|
|
86
|
-
"odd:bg-table-light-odd even:bg-table-light-even": t === x && e === "light",
|
|
87
|
-
"dark:border-table-light": e === "system",
|
|
88
|
-
"odd:bg-table-dark-odd even:bg-table-dark-even dark:odd:bg-table-light-odd dark:even:bg-table-light-even": t === x && e === "system",
|
|
89
|
-
"dark:border-table-dark": e === "alt-system",
|
|
90
|
-
"odd:bg-table-light-odd even:bg-table-light-even dark:odd:bg-table-dark-odd dark:even:bg-table-dark-even": t === x && e === "alt-system"
|
|
91
|
-
},
|
|
92
|
-
r
|
|
93
|
-
), me = ({
|
|
94
|
-
cellWrapper: e,
|
|
95
|
-
className: r,
|
|
96
|
-
compact: t,
|
|
97
|
-
mode: a,
|
|
98
|
-
align: l
|
|
99
|
-
}) => ({
|
|
100
|
-
alignClasses: s({
|
|
101
|
-
"flex justify-start text-left": l === "left",
|
|
102
|
-
"flex justify-center text-center": l === "center",
|
|
103
|
-
"flex justify-end text-right": l === "right"
|
|
104
|
-
}),
|
|
105
|
-
mainClasses: s(
|
|
106
|
-
{
|
|
107
|
-
"text-copy-light": a === "dark" || a === "system",
|
|
108
|
-
"text-copy-dark": a === "light" || a === "alt-system",
|
|
109
|
-
"dark:text-copy-dark": a === "system",
|
|
110
|
-
"dark:text-copy-light": a === "alt-system",
|
|
111
|
-
"px-4 py-3": !t && (e === z || e === W),
|
|
112
|
-
"p-4": !t && e === x,
|
|
113
|
-
"px-2 py-1.5": t
|
|
114
|
-
},
|
|
115
|
-
r
|
|
116
|
-
)
|
|
117
|
-
}), ye = ({
|
|
118
|
-
buttonClassName: e
|
|
119
|
-
}) => s("rounded-none text-sm", e), q = "av-button", D = "icon", K = "button", P = "link", fe = ({
|
|
1
|
+
import { jsx as o, jsxs as N, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
+
import S, { useRef as w, useLayoutEffect as q, useEffect as U, useState as ne, useMemo as K, useCallback as de, useContext as B } from "react";
|
|
3
|
+
import l from "clsx";
|
|
4
|
+
const Y = "av-button", W = "icon", Q = "button", P = "link", he = ({
|
|
120
5
|
type: e,
|
|
121
6
|
size: r,
|
|
122
7
|
labelRight: t,
|
|
123
8
|
labelLeft: a,
|
|
124
|
-
align:
|
|
125
|
-
animated:
|
|
9
|
+
align: s,
|
|
10
|
+
animated: i
|
|
126
11
|
}) => {
|
|
127
|
-
const
|
|
12
|
+
const c = "max-h-8 py-0 px-2", d = "max-h-9 h-8 px-3", n = "max-h-12 py-2 px-4";
|
|
128
13
|
switch (e) {
|
|
129
|
-
case
|
|
14
|
+
case Q:
|
|
130
15
|
case P:
|
|
131
|
-
return
|
|
132
|
-
[
|
|
16
|
+
return l({
|
|
17
|
+
[c]: r === "small",
|
|
133
18
|
[d]: r === "medium",
|
|
134
|
-
[
|
|
19
|
+
[n]: r === "large"
|
|
135
20
|
});
|
|
136
|
-
case
|
|
137
|
-
return
|
|
138
|
-
"justify-center":
|
|
139
|
-
"justify-start":
|
|
140
|
-
"justify-end":
|
|
141
|
-
"h-6 w-6 p-0": r === "small" && !
|
|
142
|
-
"h-6 px-2": r === "small" && !
|
|
143
|
-
"h-8 w-8 p-1": r === "medium" && !
|
|
144
|
-
"h-8 px-3": r === "medium" && !
|
|
145
|
-
"h-12 w-12 p-2": r === "large" && !
|
|
146
|
-
"h-12 px-4": r === "large" && !
|
|
147
|
-
"h-6 py-0": r === "small" &&
|
|
148
|
-
"h-6": r === "small" &&
|
|
149
|
-
"h-8 py-1": r === "medium" &&
|
|
150
|
-
"h-8": r === "medium" &&
|
|
151
|
-
"h-12 py-2": r === "large" &&
|
|
152
|
-
"h-12": r === "large" &&
|
|
21
|
+
case W:
|
|
22
|
+
return l("flex items-center", {
|
|
23
|
+
"justify-center": s === "center",
|
|
24
|
+
"justify-start": s === "left",
|
|
25
|
+
"justify-end": s === "right",
|
|
26
|
+
"h-6 w-6 p-0": r === "small" && !i && !(t || a),
|
|
27
|
+
"h-6 px-2": r === "small" && !i && (t || a),
|
|
28
|
+
"h-8 w-8 p-1": r === "medium" && !i && !(t || a),
|
|
29
|
+
"h-8 px-3": r === "medium" && !i && (t || a),
|
|
30
|
+
"h-12 w-12 p-2": r === "large" && !i && !(t || a),
|
|
31
|
+
"h-12 px-4": r === "large" && !i && (t || a),
|
|
32
|
+
"h-6 py-0": r === "small" && i && !(t || a),
|
|
33
|
+
"h-6": r === "small" && i && (t || a),
|
|
34
|
+
"h-8 py-1": r === "medium" && i && !(t || a),
|
|
35
|
+
"h-8": r === "medium" && i && (t || a),
|
|
36
|
+
"h-12 py-2": r === "large" && i && !(t || a),
|
|
37
|
+
"h-12": r === "large" && i && (t || a)
|
|
153
38
|
});
|
|
154
39
|
}
|
|
155
|
-
},
|
|
40
|
+
}, ge = ({
|
|
156
41
|
type: e,
|
|
157
42
|
size: r,
|
|
158
43
|
labelRight: t,
|
|
159
44
|
labelLeft: a
|
|
160
45
|
}) => {
|
|
161
|
-
const
|
|
46
|
+
const s = "text-sm font-medium", i = "text-base font-medium", c = "text-lg font-medium";
|
|
162
47
|
switch (e) {
|
|
163
|
-
case
|
|
48
|
+
case Q:
|
|
164
49
|
case P:
|
|
165
|
-
return
|
|
50
|
+
return l({
|
|
166
51
|
"text-center": e === P,
|
|
167
|
-
[
|
|
168
|
-
[
|
|
169
|
-
[
|
|
52
|
+
[s]: r === "small",
|
|
53
|
+
[i]: r === "medium",
|
|
54
|
+
[c]: r === "large"
|
|
170
55
|
});
|
|
171
|
-
case
|
|
172
|
-
return
|
|
173
|
-
[
|
|
174
|
-
[
|
|
175
|
-
[
|
|
56
|
+
case W:
|
|
57
|
+
return l({
|
|
58
|
+
[s]: r === "small" && (t || a),
|
|
59
|
+
[i]: r === "medium" && (t || a),
|
|
60
|
+
[c]: r === "large" && (t || a)
|
|
176
61
|
});
|
|
177
62
|
}
|
|
178
|
-
},
|
|
63
|
+
}, me = ({
|
|
179
64
|
mode: e,
|
|
180
65
|
noBackground: r,
|
|
181
66
|
truncate: t,
|
|
@@ -184,23 +69,23 @@ const z = "thead", W = "tfoot", x = "tbody", R = {
|
|
|
184
69
|
if (r)
|
|
185
70
|
return "not-prose";
|
|
186
71
|
if (a === "primary")
|
|
187
|
-
return
|
|
72
|
+
return l("not-prose", {
|
|
188
73
|
truncate: t,
|
|
189
|
-
"text-copy-
|
|
190
|
-
"text-copy-
|
|
191
|
-
"dark:text-copy-
|
|
192
|
-
"dark:text-copy-
|
|
74
|
+
"text-copy-dark": e === "dark" || e === "system",
|
|
75
|
+
"text-copy-light": e === "light" || e === "alt-system",
|
|
76
|
+
"dark:text-copy-light": e === "system",
|
|
77
|
+
"dark:text-copy-dark": e === "alt-system"
|
|
193
78
|
});
|
|
194
79
|
if (a === "secondary")
|
|
195
|
-
return
|
|
80
|
+
return l("not-prose", {
|
|
196
81
|
truncate: t,
|
|
197
|
-
"text-copy-light": e === "
|
|
198
|
-
"text-copy-
|
|
199
|
-
"dark:text-copy-
|
|
200
|
-
"dark:text-copy-light": e === "system"
|
|
82
|
+
"text-copy-light": e === "dark" || e === "system",
|
|
83
|
+
"text-copy-dark": e === "light" || e === "alt-system",
|
|
84
|
+
"dark:text-copy-dark": e === "system",
|
|
85
|
+
"dark:text-copy-light": e === "alt-system"
|
|
201
86
|
});
|
|
202
87
|
if (a === "danger")
|
|
203
|
-
return
|
|
88
|
+
return l("not-prose", {
|
|
204
89
|
truncate: t,
|
|
205
90
|
"text-copy-light": e === "dark" || e === "system",
|
|
206
91
|
"text-copy-lighter": e === "light" || e === "alt-system",
|
|
@@ -208,31 +93,31 @@ const z = "thead", W = "tfoot", x = "tbody", R = {
|
|
|
208
93
|
"dark:text-copy-light": e === "alt-system"
|
|
209
94
|
});
|
|
210
95
|
if (a === "selected")
|
|
211
|
-
return
|
|
96
|
+
return l("not-prose text-copy-lighter", {
|
|
212
97
|
truncate: t
|
|
213
98
|
});
|
|
214
|
-
},
|
|
99
|
+
}, be = ({
|
|
215
100
|
mode: e,
|
|
216
101
|
noBackground: r,
|
|
217
102
|
variant: t
|
|
218
103
|
}) => {
|
|
219
104
|
if (!r) {
|
|
220
105
|
if (t === "primary")
|
|
221
|
-
return
|
|
222
|
-
"bg-action-
|
|
223
|
-
"bg-action-
|
|
224
|
-
"bg-action-
|
|
225
|
-
"bg-action-
|
|
106
|
+
return l({
|
|
107
|
+
"bg-action-light": e === "dark",
|
|
108
|
+
"bg-action-dark": e === "light",
|
|
109
|
+
"bg-action-light dark:bg-action-dark": e === "system",
|
|
110
|
+
"bg-action-dark dark:bg-action-light": e === "alt-system"
|
|
226
111
|
});
|
|
227
112
|
if (t === "secondary")
|
|
228
|
-
return
|
|
229
|
-
"bg-action-
|
|
230
|
-
"bg-action-
|
|
231
|
-
"bg-action-
|
|
232
|
-
"bg-action-
|
|
113
|
+
return l({
|
|
114
|
+
"bg-action-light": e === "light",
|
|
115
|
+
"bg-action-dark": e === "dark",
|
|
116
|
+
"bg-action-light dark:bg-action-dark": e === "alt-system",
|
|
117
|
+
"bg-action-dark dark:bg-action-light": e === "system"
|
|
233
118
|
});
|
|
234
119
|
if (t === "danger")
|
|
235
|
-
return
|
|
120
|
+
return l({
|
|
236
121
|
"bg-action-danger-dark": e === "dark",
|
|
237
122
|
"bg-action-danger-light": e === "light",
|
|
238
123
|
"bg-action-danger-dark dark:bg-action-danger-light": e === "system",
|
|
@@ -241,13 +126,13 @@ const z = "thead", W = "tfoot", x = "tbody", R = {
|
|
|
241
126
|
if (t === "selected")
|
|
242
127
|
return "bg-action-selected-dark";
|
|
243
128
|
}
|
|
244
|
-
},
|
|
129
|
+
}, ue = ({
|
|
245
130
|
radius: e
|
|
246
|
-
}) =>
|
|
131
|
+
}) => l({
|
|
247
132
|
"rounded-full": e === "large",
|
|
248
133
|
"rounded-md": e === "medium",
|
|
249
134
|
"rounded-xs": e === "small"
|
|
250
|
-
}),
|
|
135
|
+
}), ye = ({
|
|
251
136
|
mode: e,
|
|
252
137
|
disabled: r,
|
|
253
138
|
variant: t
|
|
@@ -255,21 +140,29 @@ const z = "thead", W = "tfoot", x = "tbody", R = {
|
|
|
255
140
|
if (r)
|
|
256
141
|
return "";
|
|
257
142
|
if (t === "primary")
|
|
258
|
-
return
|
|
259
|
-
"hover:
|
|
260
|
-
"hover:
|
|
261
|
-
"
|
|
262
|
-
"
|
|
143
|
+
return l({
|
|
144
|
+
"hover:text-copy-dark-hover": e === "dark" || e === "system",
|
|
145
|
+
"hover:text-copy-light-hover": e === "light" || e === "alt-system",
|
|
146
|
+
"dark:hover:text-copy-light-hover": e === "system",
|
|
147
|
+
"dark:hover:text-copy-dark-hover": e === "alt-system",
|
|
148
|
+
"hover:bg-action-light-hover": e === "dark",
|
|
149
|
+
"hover:bg-action-dark-hover": e === "light",
|
|
150
|
+
"hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system",
|
|
151
|
+
"hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system"
|
|
263
152
|
});
|
|
264
153
|
if (t === "secondary")
|
|
265
|
-
return
|
|
266
|
-
"hover:
|
|
267
|
-
"hover:
|
|
268
|
-
"
|
|
269
|
-
"
|
|
154
|
+
return l({
|
|
155
|
+
"hover:text-copy-light-hover": e === "dark" || e === "system",
|
|
156
|
+
"hover:text-copy-dark-hover": e === "light" || e === "alt-system",
|
|
157
|
+
"dark:hover:text-copy-dark-hover": e === "system",
|
|
158
|
+
"dark:hover:text-copy-light-hover": e === "alt-system",
|
|
159
|
+
"hover:bg-action-light-hover": e === "light",
|
|
160
|
+
"hover:bg-action-dark-hover": e === "dark",
|
|
161
|
+
"hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system",
|
|
162
|
+
"hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system"
|
|
270
163
|
});
|
|
271
164
|
if (t === "danger")
|
|
272
|
-
return
|
|
165
|
+
return l("hover:text-copy-light-hover", {
|
|
273
166
|
"hover:bg-action-danger-dark-hover": e === "dark",
|
|
274
167
|
"hover:bg-action-danger-light-hover": e === "light",
|
|
275
168
|
"hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
|
|
@@ -277,7 +170,7 @@ const z = "thead", W = "tfoot", x = "tbody", R = {
|
|
|
277
170
|
});
|
|
278
171
|
if (t === "selected")
|
|
279
172
|
return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
|
|
280
|
-
},
|
|
173
|
+
}, ke = ({
|
|
281
174
|
mode: e,
|
|
282
175
|
disabled: r,
|
|
283
176
|
variant: t
|
|
@@ -285,21 +178,29 @@ const z = "thead", W = "tfoot", x = "tbody", R = {
|
|
|
285
178
|
if (r)
|
|
286
179
|
return "";
|
|
287
180
|
if (t === "primary")
|
|
288
|
-
return
|
|
289
|
-
"active:
|
|
290
|
-
"active:
|
|
291
|
-
"
|
|
292
|
-
"
|
|
181
|
+
return l({
|
|
182
|
+
"active:text-copy-dark-active": e === "dark" || e === "system",
|
|
183
|
+
"active:text-copy-light-active": e === "light" || e === "alt-system",
|
|
184
|
+
"dark:active:text-copy-light-active": e === "system",
|
|
185
|
+
"dark:active:text-copy-dark-active": e === "alt-system",
|
|
186
|
+
"active:bg-action-light-active": e === "dark",
|
|
187
|
+
"active:bg-action-dark-active": e === "light",
|
|
188
|
+
"active:bg-action-light-active dark:active:bg-action-dark-active": e === "system",
|
|
189
|
+
"active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system"
|
|
293
190
|
});
|
|
294
191
|
if (t === "secondary")
|
|
295
|
-
return
|
|
296
|
-
"active:
|
|
297
|
-
"active:
|
|
298
|
-
"
|
|
299
|
-
"
|
|
192
|
+
return l({
|
|
193
|
+
"active:text-copy-light-active": e === "dark" || e === "system",
|
|
194
|
+
"active:text-copy-dark-active": e === "light" || e === "alt-system",
|
|
195
|
+
"dark:active:text-copy-dark-active": e === "system",
|
|
196
|
+
"dark:active:text-copy-light-active": e === "alt-system",
|
|
197
|
+
"active:bg-action-light-active": e === "light",
|
|
198
|
+
"active:bg-action-dark-active": e === "dark",
|
|
199
|
+
"active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system",
|
|
200
|
+
"active:bg-action-dark-active dark:active:bg-action-light-active": e === "system"
|
|
300
201
|
});
|
|
301
202
|
if (t === "danger")
|
|
302
|
-
return
|
|
203
|
+
return l("active:text-copy-lighter-active", {
|
|
303
204
|
"active:bg-action-danger-dark-active": e === "dark",
|
|
304
205
|
"active:bg-action-danger-light-active": e === "light",
|
|
305
206
|
"active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
|
|
@@ -307,7 +208,7 @@ const z = "thead", W = "tfoot", x = "tbody", R = {
|
|
|
307
208
|
});
|
|
308
209
|
if (t === "selected")
|
|
309
210
|
return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
|
|
310
|
-
},
|
|
211
|
+
}, ve = ({
|
|
311
212
|
mode: e,
|
|
312
213
|
noBorder: r,
|
|
313
214
|
variant: t
|
|
@@ -315,21 +216,21 @@ const z = "thead", W = "tfoot", x = "tbody", R = {
|
|
|
315
216
|
if (r)
|
|
316
217
|
return "border border-transparent";
|
|
317
218
|
if (t === "primary")
|
|
318
|
-
return
|
|
319
|
-
"border-border-
|
|
219
|
+
return l("border", {
|
|
220
|
+
"border-border-medium": e === "dark",
|
|
320
221
|
"border-border-accent": e === "light",
|
|
321
|
-
"border-border-
|
|
322
|
-
"border-border-accent dark:border-border-
|
|
222
|
+
"border-border-medium dark:border-border-accent": e === "system",
|
|
223
|
+
"border-border-accent dark:border-border-medium": e === "alt-system"
|
|
323
224
|
});
|
|
324
225
|
if (t === "secondary")
|
|
325
|
-
return
|
|
326
|
-
"border-border-
|
|
226
|
+
return l("border", {
|
|
227
|
+
"border-border-medium": e === "light",
|
|
327
228
|
"border-border-accent": e === "dark",
|
|
328
|
-
"border-border-
|
|
329
|
-
"border-border-accent dark:border-border-
|
|
229
|
+
"border-border-medium dark:border-border-accent": e === "alt-system",
|
|
230
|
+
"border-border-accent dark:border-border-medium": e === "system"
|
|
330
231
|
});
|
|
331
232
|
if (t === "danger")
|
|
332
|
-
return
|
|
233
|
+
return l("border", {
|
|
333
234
|
"border-border-danger-dark": e === "dark",
|
|
334
235
|
"border-border-danger-medium": e === "light",
|
|
335
236
|
"border-border-danger-dark dark:border-border-danger-medium": e === "system",
|
|
@@ -337,110 +238,124 @@ const z = "thead", W = "tfoot", x = "tbody", R = {
|
|
|
337
238
|
});
|
|
338
239
|
if (t === "selected")
|
|
339
240
|
return "border border-border-selected-dark";
|
|
340
|
-
},
|
|
241
|
+
}, pe = ({
|
|
341
242
|
focusMode: e
|
|
342
|
-
}) =>
|
|
243
|
+
}) => l("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
343
244
|
"focus:outline-focus-dark": e === "dark",
|
|
344
245
|
"focus:outline-focus-light": e === "light",
|
|
345
246
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
346
247
|
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
347
|
-
}),
|
|
248
|
+
}), fe = ({
|
|
348
249
|
mode: e,
|
|
349
250
|
raw: r,
|
|
350
|
-
iconClassName: t
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
251
|
+
iconClassName: t,
|
|
252
|
+
variant: a = "primary"
|
|
253
|
+
}) => {
|
|
254
|
+
if (r)
|
|
255
|
+
return "";
|
|
256
|
+
let s = {};
|
|
257
|
+
return a === "primary" ? s = {
|
|
258
|
+
"text-copy-dark": e === "dark" || e === "system",
|
|
259
|
+
"text-copy-light": e === "light" || e === "alt-system",
|
|
260
|
+
"dark:text-copy-light": e === "system",
|
|
261
|
+
"dark:text-copy-dark": e === "alt-system"
|
|
262
|
+
} : a === "secondary" ? s = {
|
|
354
263
|
"text-copy-light": e === "dark" || e === "system",
|
|
355
|
-
"
|
|
356
|
-
"dark:text-copy-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
264
|
+
"text-copy-dark": e === "light" || e === "alt-system",
|
|
265
|
+
"dark:text-copy-dark": e === "system",
|
|
266
|
+
"dark:text-copy-light": e === "alt-system"
|
|
267
|
+
} : a === "danger" ? s = {
|
|
268
|
+
"text-copy-light": e === "dark" || e === "system",
|
|
269
|
+
"text-copy-lighter": e === "light" || e === "alt-system",
|
|
270
|
+
"dark:text-copy-lighter": e === "system",
|
|
271
|
+
"dark:text-copy-light": e === "alt-system"
|
|
272
|
+
} : a === "selected" && (s = {
|
|
273
|
+
"text-copy-lighter": !0
|
|
274
|
+
}), l(s, t);
|
|
275
|
+
}, xe = ({
|
|
360
276
|
animated: e
|
|
361
|
-
}) =>
|
|
277
|
+
}) => l({
|
|
362
278
|
"transition-opacity duration-300 ease-in-out": e
|
|
363
|
-
}),
|
|
279
|
+
}), _e = ({
|
|
364
280
|
type: e,
|
|
365
281
|
className: r,
|
|
366
282
|
raw: t,
|
|
367
283
|
mode: a,
|
|
368
|
-
focusMode:
|
|
369
|
-
disabled:
|
|
370
|
-
fullWidth:
|
|
284
|
+
focusMode: s,
|
|
285
|
+
disabled: i,
|
|
286
|
+
fullWidth: c,
|
|
371
287
|
size: d,
|
|
372
|
-
noBorder:
|
|
373
|
-
labelRight:
|
|
374
|
-
labelLeft:
|
|
375
|
-
noBackground:
|
|
376
|
-
variant:
|
|
377
|
-
truncate:
|
|
288
|
+
noBorder: n,
|
|
289
|
+
labelRight: g,
|
|
290
|
+
labelLeft: b,
|
|
291
|
+
noBackground: h,
|
|
292
|
+
variant: m,
|
|
293
|
+
truncate: p,
|
|
378
294
|
align: L,
|
|
379
295
|
radius: M,
|
|
380
296
|
animated: T
|
|
381
|
-
}) => (
|
|
382
|
-
|
|
383
|
-
|
|
297
|
+
}) => (m || (m = "primary"), t ? l(Y, r) : l(
|
|
298
|
+
Y,
|
|
299
|
+
me({
|
|
384
300
|
mode: a,
|
|
385
|
-
variant:
|
|
386
|
-
noBackground:
|
|
387
|
-
truncate:
|
|
301
|
+
variant: m,
|
|
302
|
+
noBackground: h,
|
|
303
|
+
truncate: p
|
|
388
304
|
}),
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
305
|
+
be({ mode: a, noBackground: h, variant: m }),
|
|
306
|
+
ue({ radius: M }),
|
|
307
|
+
he({
|
|
392
308
|
type: e,
|
|
393
309
|
size: d,
|
|
394
|
-
labelRight:
|
|
395
|
-
labelLeft:
|
|
310
|
+
labelRight: g,
|
|
311
|
+
labelLeft: b,
|
|
396
312
|
align: L,
|
|
397
313
|
animated: T
|
|
398
314
|
}),
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
315
|
+
ge({ type: e, size: d, labelRight: g, labelLeft: b }),
|
|
316
|
+
ve({ mode: a, variant: m, noBorder: n }),
|
|
317
|
+
pe({ focusMode: s }),
|
|
318
|
+
ye({ mode: a, variant: m, disabled: i }),
|
|
319
|
+
ke({ mode: a, variant: m, disabled: i }),
|
|
404
320
|
{
|
|
405
|
-
"w-full":
|
|
406
|
-
"disabled:cursor-not-allowed disabled:opacity-50":
|
|
321
|
+
"w-full": c,
|
|
322
|
+
"disabled:cursor-not-allowed disabled:opacity-50": i
|
|
407
323
|
},
|
|
408
|
-
|
|
324
|
+
l({
|
|
409
325
|
"transition-[width] duration-300 ease-in": T
|
|
410
326
|
}),
|
|
411
327
|
r
|
|
412
|
-
)),
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
return /* @__PURE__ */ i(
|
|
328
|
+
)), we = (e, r, t) => {
|
|
329
|
+
!r && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof e?.currentTarget?.focus == "function" && e.currentTarget.focus(), typeof t == "function" && t(e);
|
|
330
|
+
}, X = S.forwardRef((e, r) => {
|
|
331
|
+
const { onClick: t, noInternalClick: a = !1, ...s } = e;
|
|
332
|
+
return /* @__PURE__ */ o(
|
|
418
333
|
"button",
|
|
419
334
|
{
|
|
420
335
|
ref: r,
|
|
421
|
-
onClick: (
|
|
422
|
-
|
|
336
|
+
onClick: (i) => {
|
|
337
|
+
we(i, a, t);
|
|
423
338
|
},
|
|
424
|
-
...
|
|
339
|
+
...s
|
|
425
340
|
}
|
|
426
341
|
);
|
|
427
342
|
});
|
|
428
|
-
|
|
429
|
-
function
|
|
343
|
+
X.displayName = "BaseButton";
|
|
344
|
+
function Ne() {
|
|
430
345
|
const e = w(!1);
|
|
431
346
|
return U(() => (e.current = !0, () => {
|
|
432
347
|
e.current = !1;
|
|
433
348
|
}), []), de(() => e.current, []);
|
|
434
349
|
}
|
|
435
|
-
function
|
|
436
|
-
return
|
|
350
|
+
function Ce(e) {
|
|
351
|
+
return K(() => e.every((r) => r == null) ? () => {
|
|
437
352
|
} : (r) => {
|
|
438
353
|
e.forEach((t) => {
|
|
439
354
|
typeof t == "function" ? t(r) : t != null && (t.current = r);
|
|
440
355
|
});
|
|
441
356
|
}, [...e]);
|
|
442
357
|
}
|
|
443
|
-
const
|
|
358
|
+
const Be = {
|
|
444
359
|
x: 0,
|
|
445
360
|
y: 0,
|
|
446
361
|
width: 0,
|
|
@@ -451,165 +366,165 @@ const ze = {
|
|
|
451
366
|
right: 0
|
|
452
367
|
};
|
|
453
368
|
function A(e) {
|
|
454
|
-
const r =
|
|
455
|
-
const
|
|
456
|
-
|
|
457
|
-
a.current && r() &&
|
|
369
|
+
const r = Ne(), t = w(0), a = w(null), [s, i] = ne(Be), c = K(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((d) => {
|
|
370
|
+
const n = d[0];
|
|
371
|
+
n && (cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
|
|
372
|
+
a.current && r() && i(n.contentRect);
|
|
458
373
|
}));
|
|
459
374
|
}), [r]);
|
|
460
|
-
return U(() => (a.current &&
|
|
461
|
-
|
|
462
|
-
}), [
|
|
375
|
+
return U(() => (a.current && c?.observe(a.current, e), () => {
|
|
376
|
+
c?.disconnect(), t.current && cancelAnimationFrame(t.current);
|
|
377
|
+
}), [c, e]), [a, s];
|
|
463
378
|
}
|
|
464
|
-
const
|
|
379
|
+
const R = {
|
|
465
380
|
small: 24,
|
|
466
381
|
// w-6
|
|
467
382
|
medium: 32,
|
|
468
383
|
// w-8
|
|
469
384
|
large: 48
|
|
470
385
|
// w-12
|
|
471
|
-
},
|
|
472
|
-
small:
|
|
386
|
+
}, Te = {
|
|
387
|
+
small: 16,
|
|
473
388
|
// px-2 x 2
|
|
474
|
-
medium:
|
|
389
|
+
medium: 24,
|
|
475
390
|
// px-3 x 2
|
|
476
|
-
large:
|
|
391
|
+
large: 32
|
|
477
392
|
// px-4 x 2
|
|
478
|
-
},
|
|
393
|
+
}, Ie = 2, Re = 300, Z = S.forwardRef(
|
|
479
394
|
({
|
|
480
395
|
children: e,
|
|
481
396
|
disabled: r = !1,
|
|
482
397
|
mode: t = "system",
|
|
483
398
|
focusMode: a = "system",
|
|
484
|
-
fullWidth:
|
|
485
|
-
className:
|
|
486
|
-
type:
|
|
399
|
+
fullWidth: s = !1,
|
|
400
|
+
className: i,
|
|
401
|
+
type: c = "button",
|
|
487
402
|
raw: d = !1,
|
|
488
|
-
noBorder:
|
|
489
|
-
"aria-label":
|
|
490
|
-
label:
|
|
491
|
-
size:
|
|
492
|
-
labelRight:
|
|
493
|
-
labelLeft:
|
|
403
|
+
noBorder: n = !1,
|
|
404
|
+
"aria-label": g,
|
|
405
|
+
label: b,
|
|
406
|
+
size: h = "medium",
|
|
407
|
+
labelRight: m,
|
|
408
|
+
labelLeft: p,
|
|
494
409
|
noBackground: L = !1,
|
|
495
410
|
align: M = "center",
|
|
496
411
|
radius: T = "large",
|
|
497
|
-
variant:
|
|
412
|
+
variant: H = "secondary",
|
|
498
413
|
iconClassName: te,
|
|
499
|
-
animated:
|
|
414
|
+
animated: k = !1,
|
|
500
415
|
...re
|
|
501
416
|
}, ae) => {
|
|
502
|
-
const
|
|
503
|
-
type:
|
|
417
|
+
const se = _e({
|
|
418
|
+
type: W,
|
|
504
419
|
mode: t,
|
|
505
420
|
focusMode: a,
|
|
506
|
-
fullWidth:
|
|
421
|
+
fullWidth: s,
|
|
507
422
|
disabled: r,
|
|
508
423
|
raw: d,
|
|
509
|
-
className:
|
|
510
|
-
noBorder:
|
|
511
|
-
size:
|
|
512
|
-
labelRight:
|
|
513
|
-
labelLeft:
|
|
424
|
+
className: i,
|
|
425
|
+
noBorder: n,
|
|
426
|
+
size: h,
|
|
427
|
+
labelRight: m,
|
|
428
|
+
labelLeft: p,
|
|
514
429
|
noBackground: L,
|
|
515
430
|
align: M,
|
|
516
431
|
radius: T,
|
|
517
|
-
variant:
|
|
518
|
-
animated:
|
|
519
|
-
}),
|
|
520
|
-
return
|
|
521
|
-
I && I.current &&
|
|
522
|
-
}, [
|
|
523
|
-
if (
|
|
524
|
-
let
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
},
|
|
432
|
+
variant: H,
|
|
433
|
+
animated: k
|
|
434
|
+
}), le = fe({ mode: t, raw: d, iconClassName: te, variant: H }), F = xe({ animated: k }), ie = "flex items-center justify-center relative w-full h-full overflow-hidden", [u, V] = A(), [y, O] = A(), [I, G] = A(), j = w(0), v = w(null), f = w(null), oe = Ce([ae, v]);
|
|
435
|
+
return q(() => {
|
|
436
|
+
I && I.current && k && (j.current = G.width + Te[h] + (n ? 0 : Ie), v.current && !v.current.style.width && (v.current.style.width = `${R[h]}px`));
|
|
437
|
+
}, [G, I, h, n, k]), q(() => {
|
|
438
|
+
if (v && v.current && k) {
|
|
439
|
+
let x = R[h];
|
|
440
|
+
m && u && V.width > 0 ? x = V.width + j.current : p && y && O.width > 0 && (x = O.width + j.current), f.current && clearTimeout(f.current), x !== parseInt(v.current.style.width || "0", 10) && (u.current && (u.current.style.opacity = "0"), y.current && (y.current.style.opacity = "0"), v.current.style.width = `${x}px`, x > R[h] && (f.current = setTimeout(() => {
|
|
441
|
+
u.current && m && (u.current.style.opacity = "1"), y.current && p && (y.current.style.opacity = "1"), f.current = null;
|
|
442
|
+
}, Re * 0.8))), x === R[h] && (u.current && (u.current.style.opacity = "0"), y.current && (y.current.style.opacity = "0"));
|
|
528
443
|
}
|
|
529
444
|
}, [
|
|
530
445
|
V,
|
|
531
|
-
b,
|
|
532
446
|
m,
|
|
447
|
+
u,
|
|
533
448
|
O,
|
|
534
|
-
|
|
449
|
+
p,
|
|
535
450
|
y,
|
|
536
|
-
|
|
537
|
-
|
|
451
|
+
h,
|
|
452
|
+
k
|
|
538
453
|
]), U(() => () => {
|
|
539
|
-
|
|
540
|
-
}, []), /* @__PURE__ */
|
|
541
|
-
|
|
454
|
+
f.current && clearTimeout(f.current);
|
|
455
|
+
}, []), /* @__PURE__ */ o(
|
|
456
|
+
X,
|
|
542
457
|
{
|
|
543
|
-
ref:
|
|
544
|
-
className:
|
|
458
|
+
ref: oe,
|
|
459
|
+
className: se,
|
|
545
460
|
disabled: r,
|
|
546
|
-
type:
|
|
547
|
-
"aria-label":
|
|
461
|
+
type: c,
|
|
462
|
+
"aria-label": g || b,
|
|
548
463
|
...re,
|
|
549
|
-
children: /* @__PURE__ */ N("div", { className:
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
|
|
464
|
+
children: /* @__PURE__ */ N("div", { className: ie, children: [
|
|
465
|
+
/* @__PURE__ */ o(
|
|
466
|
+
J,
|
|
552
467
|
{
|
|
553
|
-
label:
|
|
468
|
+
label: p,
|
|
554
469
|
labelRef: y,
|
|
555
|
-
labelClass:
|
|
470
|
+
labelClass: F,
|
|
556
471
|
labelInnerClass: "pr-2",
|
|
557
|
-
initiallyHidden:
|
|
472
|
+
initiallyHidden: k
|
|
558
473
|
}
|
|
559
474
|
),
|
|
560
|
-
/* @__PURE__ */
|
|
561
|
-
/* @__PURE__ */
|
|
562
|
-
|
|
475
|
+
/* @__PURE__ */ o("span", { ref: I, className: le, children: e }),
|
|
476
|
+
/* @__PURE__ */ o(
|
|
477
|
+
J,
|
|
563
478
|
{
|
|
564
|
-
label:
|
|
565
|
-
labelRef:
|
|
566
|
-
labelClass:
|
|
479
|
+
label: m,
|
|
480
|
+
labelRef: u,
|
|
481
|
+
labelClass: F,
|
|
567
482
|
labelInnerClass: "pl-2",
|
|
568
|
-
initiallyHidden:
|
|
483
|
+
initiallyHidden: k
|
|
569
484
|
}
|
|
570
485
|
)
|
|
571
486
|
] })
|
|
572
487
|
}
|
|
573
488
|
);
|
|
574
489
|
}
|
|
575
|
-
),
|
|
490
|
+
), J = ({
|
|
576
491
|
labelRef: e,
|
|
577
492
|
labelClass: r,
|
|
578
493
|
label: t,
|
|
579
494
|
labelInnerClass: a,
|
|
580
|
-
initiallyHidden:
|
|
581
|
-
}) => /* @__PURE__ */
|
|
495
|
+
initiallyHidden: s = !1
|
|
496
|
+
}) => /* @__PURE__ */ o(
|
|
582
497
|
"span",
|
|
583
498
|
{
|
|
584
499
|
ref: e,
|
|
585
500
|
className: r,
|
|
586
|
-
style:
|
|
587
|
-
children: t && /* @__PURE__ */
|
|
501
|
+
style: s ? { opacity: 0 } : void 0,
|
|
502
|
+
children: t && /* @__PURE__ */ o("span", { className: a, children: t })
|
|
588
503
|
}
|
|
589
504
|
);
|
|
590
|
-
|
|
505
|
+
Z.displayName = "ButtonIcon";
|
|
591
506
|
/*!
|
|
592
|
-
@versini/ui-button
|
|
507
|
+
@versini/ui-button v7.0.0
|
|
593
508
|
© 2025 gizmette.com
|
|
594
509
|
*/
|
|
595
510
|
try {
|
|
596
511
|
window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
|
|
597
|
-
version: "
|
|
598
|
-
buildTime: "
|
|
512
|
+
version: "7.0.0",
|
|
513
|
+
buildTime: "08/07/2025 04:11 PM EDT",
|
|
599
514
|
homepage: "https://github.com/aversini/ui-components",
|
|
600
515
|
license: "MIT"
|
|
601
516
|
});
|
|
602
517
|
} catch {
|
|
603
518
|
}
|
|
604
|
-
const
|
|
519
|
+
const ee = S.forwardRef(
|
|
605
520
|
({
|
|
606
521
|
children: e,
|
|
607
522
|
mode: r = "system",
|
|
608
523
|
className: t,
|
|
609
524
|
active: a = !1,
|
|
610
|
-
...
|
|
611
|
-
},
|
|
612
|
-
const
|
|
525
|
+
...s
|
|
526
|
+
}, i) => {
|
|
527
|
+
const c = a ? l(
|
|
613
528
|
"relative",
|
|
614
529
|
"focus-within:static",
|
|
615
530
|
"focus-within:after:border-transparent",
|
|
@@ -626,45 +541,45 @@ const Z = S.forwardRef(
|
|
|
626
541
|
"after:border-table-light dark:after:border-table-dark": r === "alt-system"
|
|
627
542
|
}
|
|
628
543
|
) : "";
|
|
629
|
-
return /* @__PURE__ */
|
|
630
|
-
|
|
544
|
+
return /* @__PURE__ */ o("div", { className: c, children: /* @__PURE__ */ o(
|
|
545
|
+
Z,
|
|
631
546
|
{
|
|
632
|
-
className:
|
|
633
|
-
ref:
|
|
547
|
+
className: l("justify-center", t),
|
|
548
|
+
ref: i,
|
|
634
549
|
mode: r,
|
|
635
550
|
radius: "small",
|
|
636
|
-
...
|
|
551
|
+
...s,
|
|
637
552
|
children: e
|
|
638
553
|
}
|
|
639
554
|
) });
|
|
640
555
|
}
|
|
641
556
|
);
|
|
642
|
-
|
|
643
|
-
const
|
|
557
|
+
ee.displayName = "ButtonSort";
|
|
558
|
+
const $ = ({
|
|
644
559
|
children: e,
|
|
645
560
|
fill: r,
|
|
646
561
|
viewBox: t,
|
|
647
562
|
className: a,
|
|
648
|
-
defaultViewBox:
|
|
649
|
-
size:
|
|
650
|
-
title:
|
|
563
|
+
defaultViewBox: s,
|
|
564
|
+
size: i,
|
|
565
|
+
title: c,
|
|
651
566
|
semantic: d = !1,
|
|
652
|
-
...
|
|
567
|
+
...n
|
|
653
568
|
}) => {
|
|
654
|
-
const
|
|
655
|
-
return /* @__PURE__ */
|
|
569
|
+
const g = l(i, a);
|
|
570
|
+
return /* @__PURE__ */ o(ce, { children: /* @__PURE__ */ N(
|
|
656
571
|
"svg",
|
|
657
572
|
{
|
|
658
573
|
xmlns: "http://www.w3.org/2000/svg",
|
|
659
|
-
className:
|
|
660
|
-
viewBox: t ||
|
|
574
|
+
className: g,
|
|
575
|
+
viewBox: t || s,
|
|
661
576
|
fill: r || "currentColor",
|
|
662
577
|
role: "img",
|
|
663
578
|
"aria-hidden": !d,
|
|
664
579
|
focusable: !1,
|
|
665
|
-
...
|
|
580
|
+
...n,
|
|
666
581
|
children: [
|
|
667
|
-
|
|
582
|
+
c && d && /* @__PURE__ */ o("title", { children: c }),
|
|
668
583
|
e
|
|
669
584
|
]
|
|
670
585
|
}
|
|
@@ -683,82 +598,82 @@ try {
|
|
|
683
598
|
});
|
|
684
599
|
} catch {
|
|
685
600
|
}
|
|
686
|
-
const
|
|
601
|
+
const Ee = ({
|
|
687
602
|
className: e,
|
|
688
603
|
viewBox: r,
|
|
689
604
|
title: t,
|
|
690
605
|
monotone: a,
|
|
691
|
-
...
|
|
606
|
+
...s
|
|
692
607
|
}) => /* @__PURE__ */ N(
|
|
693
|
-
|
|
608
|
+
$,
|
|
694
609
|
{
|
|
695
610
|
defaultViewBox: "0 0 576 512",
|
|
696
611
|
size: "size-5",
|
|
697
612
|
viewBox: r,
|
|
698
613
|
className: e,
|
|
699
614
|
title: t || "Sort",
|
|
700
|
-
...
|
|
615
|
+
...s,
|
|
701
616
|
children: [
|
|
702
|
-
/* @__PURE__ */
|
|
617
|
+
/* @__PURE__ */ o(
|
|
703
618
|
"path",
|
|
704
619
|
{
|
|
705
620
|
d: "M297.4 137.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l41.3-41.4V448c0 17.7 14.3 32 32 32s32-14.3 32-32V141.3l41.4 41.4c12.5 12.5 32.8 12.5 45.3 0 6.2-6.2 9.4-14.4 9.4-22.6s-3.1-16.4-9.4-22.6l-96-96c-6.3-6.4-14.5-9.5-22.7-9.5s-16.4 3.1-22.6 9.4z",
|
|
706
621
|
opacity: a ? "1" : "0.4"
|
|
707
622
|
}
|
|
708
623
|
),
|
|
709
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ o("path", { d: "M137.4 470.6c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 370.7V64c0-17.7-14.3-32-32-32s-32 14.3-32 32v306.7l-41.4-41.3c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96z" })
|
|
710
625
|
]
|
|
711
626
|
}
|
|
712
|
-
),
|
|
627
|
+
), Se = ({
|
|
713
628
|
className: e,
|
|
714
629
|
viewBox: r,
|
|
715
630
|
title: t,
|
|
716
631
|
monotone: a,
|
|
717
|
-
...
|
|
632
|
+
...s
|
|
718
633
|
}) => /* @__PURE__ */ N(
|
|
719
|
-
|
|
634
|
+
$,
|
|
720
635
|
{
|
|
721
636
|
defaultViewBox: "0 0 576 512",
|
|
722
637
|
size: "size-5",
|
|
723
638
|
viewBox: r,
|
|
724
639
|
className: e,
|
|
725
640
|
title: t || "Sort Down",
|
|
726
|
-
...
|
|
641
|
+
...s,
|
|
727
642
|
children: [
|
|
728
|
-
/* @__PURE__ */
|
|
643
|
+
/* @__PURE__ */ o(
|
|
729
644
|
"path",
|
|
730
645
|
{
|
|
731
646
|
d: "M288 64c0-17.7 14.3-32 32-32h224c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32m0 128c0-17.7 14.3-32 32-32h160c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32m0 128c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32h-96c-17.7 0-32-14.3-32-32m0 128c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32h-32c-17.7 0-32-14.3-32-32",
|
|
732
647
|
opacity: a ? "1" : "0.4"
|
|
733
648
|
}
|
|
734
649
|
),
|
|
735
|
-
/* @__PURE__ */
|
|
650
|
+
/* @__PURE__ */ o("path", { d: "M128 480c9 0 17.5-3.8 23.6-10.4l88-96c11.9-13 11.1-33.3-2-45.2s-33.3-11.1-45.2 2L160 365.7V64c0-17.7-14.3-32-32-32S96 46.3 96 64v301.7l-32.4-35.3c-11.9-13-32.2-13.9-45.2-2s-13.9 32.2-2 45.2l88 96c6.1 6.6 14.6 10.4 23.6 10.4" })
|
|
736
651
|
]
|
|
737
652
|
}
|
|
738
|
-
),
|
|
653
|
+
), ze = ({
|
|
739
654
|
className: e,
|
|
740
655
|
viewBox: r,
|
|
741
656
|
title: t,
|
|
742
657
|
monotone: a,
|
|
743
|
-
...
|
|
658
|
+
...s
|
|
744
659
|
}) => /* @__PURE__ */ N(
|
|
745
|
-
|
|
660
|
+
$,
|
|
746
661
|
{
|
|
747
662
|
defaultViewBox: "0 0 576 512",
|
|
748
663
|
size: "size-5",
|
|
749
664
|
viewBox: r,
|
|
750
665
|
className: e,
|
|
751
666
|
title: t || "Sort Up",
|
|
752
|
-
...
|
|
667
|
+
...s,
|
|
753
668
|
children: [
|
|
754
|
-
/* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ o(
|
|
755
670
|
"path",
|
|
756
671
|
{
|
|
757
672
|
d: "M288 64c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32h-32c-17.7 0-32-14.3-32-32m0 128c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32h-96c-17.7 0-32-14.3-32-32m0 128c0-17.7 14.3-32 32-32h160c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32m0 128c0-17.7 14.3-32 32-32h224c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32",
|
|
758
673
|
opacity: a ? "1" : "0.4"
|
|
759
674
|
}
|
|
760
675
|
),
|
|
761
|
-
/* @__PURE__ */
|
|
676
|
+
/* @__PURE__ */ o("path", { d: "M128 32c9 0 17.5 3.8 23.6 10.4l88 96c11.9 13 11.1 33.3-2 45.2s-33.3 11.1-45.2-2L160 146.3V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V146.3l-32.4 35.3c-11.9 13-32.2 13.9-45.2 2s-13.9-32.2-2-45.2l88-96C110.5 35.8 119 32 128 32" })
|
|
762
677
|
]
|
|
763
678
|
}
|
|
764
679
|
);
|
|
@@ -781,148 +696,263 @@ const C = S.createContext({
|
|
|
781
696
|
stickyHeader: !1,
|
|
782
697
|
stickyFooter: !1,
|
|
783
698
|
compact: !1
|
|
784
|
-
}),
|
|
699
|
+
}), z = "thead", D = "tfoot", _ = "tbody", E = {
|
|
700
|
+
ASC: "asc",
|
|
701
|
+
DESC: "desc"
|
|
702
|
+
}, Le = ({
|
|
703
|
+
mode: e,
|
|
704
|
+
className: r,
|
|
705
|
+
wrapperClassName: t,
|
|
706
|
+
stickyHeader: a,
|
|
707
|
+
stickyFooter: s
|
|
708
|
+
}) => ({
|
|
709
|
+
wrapper: l(
|
|
710
|
+
"not-prose relative w-full rounded-lg shadow-md",
|
|
711
|
+
{
|
|
712
|
+
"overflow-x-auto": !a && !s,
|
|
713
|
+
"overflow-y-scroll": a || s,
|
|
714
|
+
"bg-surface-darker": e === "dark" || e === "system",
|
|
715
|
+
"bg-surface-light": e === "light" || e === "alt-system",
|
|
716
|
+
"dark:bg-surface-light": e === "system",
|
|
717
|
+
"dark:bg-surface-darker": e === "alt-system",
|
|
718
|
+
"text-copy-light": e === "dark",
|
|
719
|
+
"text-copy-dark": e === "light",
|
|
720
|
+
"text-copy-light dark:text-copy-dark": e === "system",
|
|
721
|
+
"text-copy-dark dark:text-copy-light": e === "alt-system"
|
|
722
|
+
},
|
|
723
|
+
t
|
|
724
|
+
),
|
|
725
|
+
table: l("my-0 w-full text-left text-sm", r, {
|
|
726
|
+
"text-copy-light": e === "dark",
|
|
727
|
+
"text-copy-dark": e === "light",
|
|
728
|
+
"text-copy-light dark:text-copy-dark": e === "system",
|
|
729
|
+
"text-copy-dark dark:text-copy-light": e === "alt-system"
|
|
730
|
+
}),
|
|
731
|
+
caption: l("py-2 text-sm font-bold", {
|
|
732
|
+
"text-copy-light": e === "dark",
|
|
733
|
+
"text-copy-dark": e === "light",
|
|
734
|
+
"text-copy-light dark:text-copy-dark": e === "system",
|
|
735
|
+
"text-copy-dark dark:text-copy-light": e === "alt-system"
|
|
736
|
+
})
|
|
737
|
+
}), Me = ({
|
|
738
|
+
className: e,
|
|
739
|
+
stickyHeader: r,
|
|
740
|
+
mode: t
|
|
741
|
+
}) => l(
|
|
742
|
+
{
|
|
743
|
+
"sticky top-0 z-10": r,
|
|
744
|
+
"shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem]": r && t === "dark",
|
|
745
|
+
"shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem] dark:shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem]": r && t === "system",
|
|
746
|
+
"shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem]": r && t === "light",
|
|
747
|
+
"shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem] dark:shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem]": r && t === "alt-system"
|
|
748
|
+
},
|
|
749
|
+
e
|
|
750
|
+
), Ve = ({
|
|
751
|
+
className: e,
|
|
752
|
+
stickyFooter: r,
|
|
753
|
+
mode: t
|
|
754
|
+
}) => l(
|
|
755
|
+
{
|
|
756
|
+
"sticky bottom-0 z-10": r,
|
|
757
|
+
"shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem]": r && t === "dark",
|
|
758
|
+
"shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem] dark:shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem]": r && t === "system",
|
|
759
|
+
"shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem]": r && t === "light",
|
|
760
|
+
"shadow-[rgb(65_65_65_/30%)_-0_0.5rem_1rem] dark:shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem]": r && t === "alt-system"
|
|
761
|
+
},
|
|
762
|
+
e
|
|
763
|
+
), Oe = ({
|
|
764
|
+
mode: e,
|
|
765
|
+
className: r,
|
|
766
|
+
cellWrapper: t
|
|
767
|
+
}) => t === z || t === D ? l(
|
|
768
|
+
{
|
|
769
|
+
"bg-table-head-dark": e === "dark" || e === "system",
|
|
770
|
+
"bg-table-head-light": e === "light" || e === "alt-system",
|
|
771
|
+
"dark:bg-table-head-light": e === "system",
|
|
772
|
+
"dark:bg-table-head-dark": e === "alt-system"
|
|
773
|
+
},
|
|
774
|
+
r
|
|
775
|
+
) : l(
|
|
776
|
+
"border-b last:border-0",
|
|
777
|
+
{
|
|
778
|
+
"border-table-dark": e === "dark" || e === "system",
|
|
779
|
+
"odd:bg-table-dark-odd even:bg-table-dark-even": t === _ && e === "dark",
|
|
780
|
+
"border-table-light": e === "light" || e === "alt-system",
|
|
781
|
+
"odd:bg-table-light-odd even:bg-table-light-even": t === _ && e === "light",
|
|
782
|
+
"dark:border-table-light": e === "system",
|
|
783
|
+
"odd:bg-table-dark-odd even:bg-table-dark-even dark:odd:bg-table-light-odd dark:even:bg-table-light-even": t === _ && e === "system",
|
|
784
|
+
"dark:border-table-dark": e === "alt-system",
|
|
785
|
+
"odd:bg-table-light-odd even:bg-table-light-even dark:odd:bg-table-dark-odd dark:even:bg-table-dark-even": t === _ && e === "alt-system"
|
|
786
|
+
},
|
|
787
|
+
r
|
|
788
|
+
), je = ({
|
|
789
|
+
cellWrapper: e,
|
|
790
|
+
className: r,
|
|
791
|
+
compact: t,
|
|
792
|
+
mode: a,
|
|
793
|
+
align: s
|
|
794
|
+
}) => ({
|
|
795
|
+
alignClasses: l({
|
|
796
|
+
"flex justify-start text-left": s === "left",
|
|
797
|
+
"flex justify-center text-center": s === "center",
|
|
798
|
+
"flex justify-end text-right": s === "right"
|
|
799
|
+
}),
|
|
800
|
+
mainClasses: l(
|
|
801
|
+
{
|
|
802
|
+
"text-copy-light": a === "dark" || a === "system",
|
|
803
|
+
"text-copy-dark": a === "light" || a === "alt-system",
|
|
804
|
+
"dark:text-copy-dark": a === "system",
|
|
805
|
+
"dark:text-copy-light": a === "alt-system",
|
|
806
|
+
"px-4 py-3": !t && (e === z || e === D),
|
|
807
|
+
"p-4": !t && e === _,
|
|
808
|
+
"px-2 py-1.5": t
|
|
809
|
+
},
|
|
810
|
+
r
|
|
811
|
+
)
|
|
812
|
+
}), Ae = ({
|
|
813
|
+
buttonClassName: e
|
|
814
|
+
}) => l("rounded-none text-sm", e), De = ({
|
|
785
815
|
children: e,
|
|
786
816
|
mode: r = "system",
|
|
787
817
|
caption: t,
|
|
788
818
|
compact: a,
|
|
789
|
-
summary:
|
|
790
|
-
className:
|
|
791
|
-
wrapperClassName:
|
|
819
|
+
summary: s,
|
|
820
|
+
className: i,
|
|
821
|
+
wrapperClassName: c,
|
|
792
822
|
maxHeight: d,
|
|
793
|
-
stickyHeader:
|
|
794
|
-
stickyFooter:
|
|
795
|
-
...
|
|
823
|
+
stickyHeader: n,
|
|
824
|
+
stickyFooter: g,
|
|
825
|
+
...b
|
|
796
826
|
}) => {
|
|
797
|
-
const
|
|
827
|
+
const h = Le({
|
|
798
828
|
mode: r,
|
|
799
|
-
className:
|
|
800
|
-
wrapperClassName:
|
|
801
|
-
stickyHeader:
|
|
802
|
-
stickyFooter:
|
|
829
|
+
className: i,
|
|
830
|
+
wrapperClassName: c,
|
|
831
|
+
stickyHeader: n,
|
|
832
|
+
stickyFooter: g
|
|
803
833
|
});
|
|
804
|
-
return /* @__PURE__ */
|
|
834
|
+
return /* @__PURE__ */ o(
|
|
805
835
|
C.Provider,
|
|
806
836
|
{
|
|
807
|
-
value: { mode: r, stickyHeader:
|
|
808
|
-
children: /* @__PURE__ */
|
|
837
|
+
value: { mode: r, stickyHeader: n, stickyFooter: g, compact: a },
|
|
838
|
+
children: /* @__PURE__ */ o(
|
|
809
839
|
"div",
|
|
810
840
|
{
|
|
811
|
-
className:
|
|
841
|
+
className: h.wrapper,
|
|
812
842
|
...d && {
|
|
813
843
|
style: { maxHeight: d }
|
|
814
844
|
},
|
|
815
|
-
children: /* @__PURE__ */ N("table", { className:
|
|
816
|
-
t && /* @__PURE__ */
|
|
845
|
+
children: /* @__PURE__ */ N("table", { className: h.table, summary: s, ...b, children: [
|
|
846
|
+
t && /* @__PURE__ */ o("caption", { className: h.caption, children: t }),
|
|
817
847
|
e
|
|
818
848
|
] })
|
|
819
849
|
}
|
|
820
850
|
)
|
|
821
851
|
}
|
|
822
852
|
);
|
|
823
|
-
},
|
|
853
|
+
}, He = ({
|
|
824
854
|
children: e,
|
|
825
855
|
className: r,
|
|
826
856
|
...t
|
|
827
857
|
}) => {
|
|
828
858
|
const a = B(C);
|
|
829
859
|
a.cellWrapper = z;
|
|
830
|
-
const
|
|
860
|
+
const s = Me({
|
|
831
861
|
className: r,
|
|
832
862
|
mode: a.mode,
|
|
833
863
|
stickyHeader: a.stickyHeader
|
|
834
864
|
});
|
|
835
|
-
return /* @__PURE__ */
|
|
865
|
+
return /* @__PURE__ */ o("thead", { className: s, ...t, children: e });
|
|
836
866
|
}, Fe = ({
|
|
837
867
|
children: e,
|
|
838
868
|
className: r,
|
|
839
869
|
...t
|
|
840
870
|
}) => {
|
|
841
871
|
const a = B(C);
|
|
842
|
-
a.cellWrapper =
|
|
843
|
-
const
|
|
872
|
+
a.cellWrapper = D;
|
|
873
|
+
const s = Ve({
|
|
844
874
|
className: r,
|
|
845
875
|
mode: a.mode,
|
|
846
876
|
stickyFooter: a.stickyFooter
|
|
847
877
|
});
|
|
848
|
-
return /* @__PURE__ */
|
|
878
|
+
return /* @__PURE__ */ o("tfoot", { className: s, ...t, children: e });
|
|
849
879
|
}, Ge = ({ children: e, ...r }) => {
|
|
850
880
|
const t = B(C);
|
|
851
|
-
return t.cellWrapper =
|
|
881
|
+
return t.cellWrapper = _, /* @__PURE__ */ o("tbody", { ...r, children: e });
|
|
852
882
|
}, qe = ({
|
|
853
883
|
children: e,
|
|
854
884
|
className: r,
|
|
855
885
|
...t
|
|
856
886
|
}) => {
|
|
857
|
-
const a = B(C),
|
|
887
|
+
const a = B(C), s = Oe({
|
|
858
888
|
mode: a.mode,
|
|
859
889
|
cellWrapper: a.cellWrapper,
|
|
860
890
|
className: r
|
|
861
891
|
});
|
|
862
|
-
return /* @__PURE__ */
|
|
892
|
+
return /* @__PURE__ */ o("tr", { className: s, ...t, children: e });
|
|
863
893
|
}, Pe = ({
|
|
864
894
|
children: e,
|
|
865
895
|
component: r,
|
|
866
896
|
className: t,
|
|
867
897
|
align: a,
|
|
868
|
-
...
|
|
898
|
+
...s
|
|
869
899
|
}) => {
|
|
870
|
-
const
|
|
871
|
-
cellWrapper:
|
|
900
|
+
const i = B(C), c = r || (i.cellWrapper === z ? "th" : "td"), { mainClasses: d, alignClasses: n } = je({
|
|
901
|
+
cellWrapper: i.cellWrapper,
|
|
872
902
|
className: t,
|
|
873
|
-
mode:
|
|
874
|
-
compact:
|
|
903
|
+
mode: i.mode,
|
|
904
|
+
compact: i.compact,
|
|
875
905
|
align: a
|
|
876
906
|
});
|
|
877
|
-
return a ? /* @__PURE__ */
|
|
907
|
+
return a ? /* @__PURE__ */ o(c, { className: d, ...s, children: /* @__PURE__ */ o("div", { className: n, children: e }) }) : /* @__PURE__ */ o(c, { className: d, ...s, children: e });
|
|
878
908
|
}, Ye = ({
|
|
879
909
|
align: e,
|
|
880
910
|
children: r,
|
|
881
911
|
buttonClassName: t,
|
|
882
912
|
className: a,
|
|
883
|
-
component:
|
|
884
|
-
focusMode:
|
|
885
|
-
mode:
|
|
913
|
+
component: s,
|
|
914
|
+
focusMode: i = "alt-system",
|
|
915
|
+
mode: c = "alt-system",
|
|
886
916
|
onClick: d,
|
|
887
|
-
sortDirection:
|
|
888
|
-
sortedCell:
|
|
889
|
-
cellId:
|
|
890
|
-
...
|
|
917
|
+
sortDirection: n,
|
|
918
|
+
sortedCell: g,
|
|
919
|
+
cellId: b,
|
|
920
|
+
...h
|
|
891
921
|
}) => {
|
|
892
|
-
const
|
|
893
|
-
return /* @__PURE__ */
|
|
922
|
+
const m = Ae({ buttonClassName: t });
|
|
923
|
+
return /* @__PURE__ */ o(
|
|
894
924
|
Pe,
|
|
895
925
|
{
|
|
896
|
-
component:
|
|
926
|
+
component: s,
|
|
897
927
|
className: a,
|
|
898
928
|
role: "columnheader",
|
|
899
|
-
"aria-sort":
|
|
900
|
-
...
|
|
901
|
-
children: /* @__PURE__ */
|
|
902
|
-
|
|
929
|
+
"aria-sort": n === E.ASC && g === b ? "ascending" : n === E.DESC && g === b ? "descending" : "other",
|
|
930
|
+
...h,
|
|
931
|
+
children: /* @__PURE__ */ o(
|
|
932
|
+
ee,
|
|
903
933
|
{
|
|
904
|
-
active:
|
|
905
|
-
className:
|
|
934
|
+
active: g === b,
|
|
935
|
+
className: m,
|
|
906
936
|
onClick: d,
|
|
907
937
|
align: e,
|
|
908
938
|
noBorder: !0,
|
|
909
|
-
focusMode:
|
|
910
|
-
mode:
|
|
939
|
+
focusMode: i,
|
|
940
|
+
mode: c,
|
|
911
941
|
fullWidth: !0,
|
|
912
942
|
labelRight: r,
|
|
913
|
-
children:
|
|
943
|
+
children: n === E.ASC && g === b ? /* @__PURE__ */ o(ze, { className: "size-4", monotone: !0 }) : n === E.DESC && g === b ? /* @__PURE__ */ o(Se, { className: "size-4", monotone: !0 }) : /* @__PURE__ */ o(Ee, { className: "size-4", monotone: !0 })
|
|
914
944
|
}
|
|
915
945
|
)
|
|
916
946
|
}
|
|
917
947
|
);
|
|
918
948
|
};
|
|
919
949
|
export {
|
|
920
|
-
|
|
950
|
+
De as Table,
|
|
921
951
|
Ge as TableBody,
|
|
922
952
|
Pe as TableCell,
|
|
923
953
|
Ye as TableCellSort,
|
|
924
|
-
|
|
954
|
+
E as TableCellSortDirections,
|
|
925
955
|
Fe as TableFooter,
|
|
926
|
-
|
|
956
|
+
He as TableHead,
|
|
927
957
|
qe as TableRow
|
|
928
958
|
};
|