@zentauri-ui/zentauri-components 2.1.6 → 2.1.8
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 +12 -8
- package/cli/cli.integration.test.ts +36 -0
- package/cli/index.mjs +43 -7
- package/cli/props.json +462 -3
- package/cli/registry.json +29 -0
- package/cli/rewrite-imports.mjs +29 -4
- package/cli/rewrite-imports.test.ts +35 -0
- package/dist/{chunk-WWKAJHIV.mjs → chunk-4PAHLHYF.mjs} +3 -3
- package/dist/{chunk-WWKAJHIV.mjs.map → chunk-4PAHLHYF.mjs.map} +1 -1
- package/dist/chunk-4SLVTSHM.js +241 -0
- package/dist/chunk-4SLVTSHM.js.map +1 -0
- package/dist/chunk-6OVDBAMI.js +19 -0
- package/dist/{chunk-3W2UUKWP.js.map → chunk-6OVDBAMI.js.map} +1 -1
- package/dist/chunk-74SKXGTM.js +4 -0
- package/dist/chunk-74SKXGTM.js.map +1 -0
- package/dist/{chunk-QE7OJW4J.js → chunk-BAAXQPZ7.js} +6 -6
- package/dist/{chunk-QE7OJW4J.js.map → chunk-BAAXQPZ7.js.map} +1 -1
- package/dist/chunk-CYKSS5S5.mjs +128 -0
- package/dist/chunk-CYKSS5S5.mjs.map +1 -0
- package/dist/chunk-D7ZTSAA6.mjs +221 -0
- package/dist/chunk-D7ZTSAA6.mjs.map +1 -0
- package/dist/{chunk-VA6SB6NN.js → chunk-DPNTQ4AK.js} +73 -6
- package/dist/chunk-DPNTQ4AK.js.map +1 -0
- package/dist/chunk-HMDH4BQJ.js +123 -0
- package/dist/chunk-HMDH4BQJ.js.map +1 -0
- package/dist/chunk-I7EBE7BD.js +98 -0
- package/dist/chunk-I7EBE7BD.js.map +1 -0
- package/dist/chunk-IHDM7AHY.mjs +233 -0
- package/dist/chunk-IHDM7AHY.mjs.map +1 -0
- package/dist/chunk-L5QORCUO.js +225 -0
- package/dist/chunk-L5QORCUO.js.map +1 -0
- package/dist/chunk-LHBJD57K.mjs +143 -0
- package/dist/chunk-LHBJD57K.mjs.map +1 -0
- package/dist/{chunk-CHI6MBTI.mjs → chunk-OWVQVAOY.mjs} +3 -3
- package/dist/{chunk-CHI6MBTI.mjs.map → chunk-OWVQVAOY.mjs.map} +1 -1
- package/dist/chunk-OYAJG2BO.js +83 -0
- package/dist/chunk-OYAJG2BO.js.map +1 -0
- package/dist/chunk-PTU5ZAYX.js +145 -0
- package/dist/chunk-PTU5ZAYX.js.map +1 -0
- package/dist/chunk-QKO5DA4N.mjs +81 -0
- package/dist/chunk-QKO5DA4N.mjs.map +1 -0
- package/dist/chunk-T7PIKDUZ.js +130 -0
- package/dist/chunk-T7PIKDUZ.js.map +1 -0
- package/dist/chunk-TDK5TVJE.mjs +3 -0
- package/dist/chunk-TDK5TVJE.mjs.map +1 -0
- package/dist/{chunk-A4IB3C23.mjs → chunk-UVP3MUBU.mjs} +58 -7
- package/dist/chunk-UVP3MUBU.mjs.map +1 -0
- package/dist/chunk-VBNW2B4D.mjs +3 -0
- package/dist/chunk-VBNW2B4D.mjs.map +1 -0
- package/dist/chunk-W6DO36XD.mjs +96 -0
- package/dist/chunk-W6DO36XD.mjs.map +1 -0
- package/dist/chunk-XR3J46TZ.js +4 -0
- package/dist/chunk-XR3J46TZ.js.map +1 -0
- package/dist/chunk-ZOHCADDL.mjs +121 -0
- package/dist/chunk-ZOHCADDL.mjs.map +1 -0
- package/dist/design-system/data-table.d.ts +8 -0
- package/dist/design-system/data-table.d.ts.map +1 -0
- package/dist/design-system/facade.js +6 -6
- package/dist/design-system/facade.mjs +5 -5
- package/dist/design-system/index.d.ts +2 -0
- package/dist/design-system/index.d.ts.map +1 -1
- package/dist/design-system/split-button.d.ts +25 -0
- package/dist/design-system/split-button.d.ts.map +1 -0
- package/dist/hooks/useTableFilter.js +6 -116
- package/dist/hooks/useTableFilter.js.map +1 -1
- package/dist/hooks/useTableFilter.mjs +1 -118
- package/dist/hooks/useTableFilter.mjs.map +1 -1
- package/dist/hooks/useTableSort.js +6 -91
- package/dist/hooks/useTableSort.js.map +1 -1
- package/dist/hooks/useTableSort.mjs +1 -93
- package/dist/hooks/useTableSort.mjs.map +1 -1
- package/dist/hooks/useVirtualList.js +6 -76
- package/dist/hooks/useVirtualList.js.map +1 -1
- package/dist/hooks/useVirtualList.mjs +1 -78
- package/dist/hooks/useVirtualList.mjs.map +1 -1
- package/dist/ui/buttons/animated.js +8 -8
- package/dist/ui/buttons/animated.mjs +6 -6
- package/dist/ui/buttons.js +10 -9
- package/dist/ui/buttons.mjs +8 -7
- package/dist/ui/checkbox.js +7 -123
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/checkbox.mjs +2 -126
- package/dist/ui/checkbox.mjs.map +1 -1
- package/dist/ui/data-table/data-table-base.d.ts +6 -0
- package/dist/ui/data-table/data-table-base.d.ts.map +1 -0
- package/dist/ui/data-table/data-table.d.ts +6 -0
- package/dist/ui/data-table/data-table.d.ts.map +1 -0
- package/dist/ui/data-table/index.d.ts +4 -0
- package/dist/ui/data-table/index.d.ts.map +1 -0
- package/dist/ui/data-table/types.d.ts +92 -0
- package/dist/ui/data-table/types.d.ts.map +1 -0
- package/dist/ui/data-table/variants.d.ts +8 -0
- package/dist/ui/data-table/variants.d.ts.map +1 -0
- package/dist/ui/data-table.js +620 -0
- package/dist/ui/data-table.js.map +1 -0
- package/dist/ui/data-table.mjs +611 -0
- package/dist/ui/data-table.mjs.map +1 -0
- package/dist/ui/dropdown/dropdown.d.ts +1 -1
- package/dist/ui/dropdown/dropdown.d.ts.map +1 -1
- package/dist/ui/dropdown/types.d.ts +2 -2
- package/dist/ui/dropdown/types.d.ts.map +1 -1
- package/dist/ui/dropdown.js +31 -231
- package/dist/ui/dropdown.js.map +1 -1
- package/dist/ui/dropdown.mjs +4 -229
- package/dist/ui/dropdown.mjs.map +1 -1
- package/dist/ui/dynamic-stepper.js +18 -18
- package/dist/ui/dynamic-stepper.mjs +7 -7
- package/dist/ui/inputs.js +7 -138
- package/dist/ui/inputs.js.map +1 -1
- package/dist/ui/inputs.mjs +2 -141
- package/dist/ui/inputs.mjs.map +1 -1
- package/dist/ui/pagination.js +20 -221
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/pagination.mjs +8 -223
- package/dist/ui/pagination.mjs.map +1 -1
- package/dist/ui/split-button/index.d.ts +4 -0
- package/dist/ui/split-button/index.d.ts.map +1 -0
- package/dist/ui/split-button/split-button-base.d.ts +6 -0
- package/dist/ui/split-button/split-button-base.d.ts.map +1 -0
- package/dist/ui/split-button/split-button.d.ts +6 -0
- package/dist/ui/split-button/split-button.d.ts.map +1 -0
- package/dist/ui/split-button/types.d.ts +30 -0
- package/dist/ui/split-button/types.d.ts.map +1 -0
- package/dist/ui/split-button/variants.d.ts +16 -0
- package/dist/ui/split-button/variants.d.ts.map +1 -0
- package/dist/ui/split-button.js +287 -0
- package/dist/ui/split-button.js.map +1 -0
- package/dist/ui/split-button.mjs +278 -0
- package/dist/ui/split-button.mjs.map +1 -0
- package/dist/ui/table.js +1 -0
- package/dist/ui/table.mjs +1 -0
- package/package.json +1 -1
- package/src/design-system/data-table.ts +20 -0
- package/src/design-system/index.ts +2 -0
- package/src/design-system/split-button.ts +38 -0
- package/src/ui/data-table/data-table-base.tsx +701 -0
- package/src/ui/data-table/data-table.test.tsx +389 -0
- package/src/ui/data-table/data-table.tsx +11 -0
- package/src/ui/data-table/index.ts +24 -0
- package/src/ui/data-table/types.ts +121 -0
- package/src/ui/data-table/variants.ts +21 -0
- package/src/ui/dropdown/dropdown.tsx +7 -3
- package/src/ui/dropdown/types.ts +2 -2
- package/src/ui/split-button/index.ts +19 -0
- package/src/ui/split-button/split-button-base.tsx +232 -0
- package/src/ui/split-button/split-button.test.tsx +208 -0
- package/src/ui/split-button/split-button.tsx +9 -0
- package/src/ui/split-button/types.ts +46 -0
- package/src/ui/split-button/variants.ts +46 -0
- package/dist/chunk-3W2UUKWP.js +0 -19
- package/dist/chunk-A4IB3C23.mjs.map +0 -1
- package/dist/chunk-VA6SB6NN.js.map +0 -1
|
@@ -1,99 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var chunkI7EBE7BD_js = require('../chunk-I7EBE7BD.js');
|
|
4
5
|
require('../chunk-PZ5AY32C.js');
|
|
5
|
-
var react = require('react');
|
|
6
6
|
|
|
7
|
-
function nextSortDirection(currentDirection) {
|
|
8
|
-
if (currentDirection === "ascending") {
|
|
9
|
-
return "descending";
|
|
10
|
-
}
|
|
11
|
-
if (currentDirection === "descending") {
|
|
12
|
-
return "none";
|
|
13
|
-
}
|
|
14
|
-
return "ascending";
|
|
15
|
-
}
|
|
16
|
-
function normalizeSortState(nextSort) {
|
|
17
|
-
if (!nextSort.sortKey || nextSort.sortDirection === "none") {
|
|
18
|
-
return { sortKey: void 0, sortDirection: "none" };
|
|
19
|
-
}
|
|
20
|
-
return nextSort;
|
|
21
|
-
}
|
|
22
|
-
function useTableSort({
|
|
23
|
-
sortKey,
|
|
24
|
-
defaultSortKey,
|
|
25
|
-
sortDirection,
|
|
26
|
-
defaultSortDirection = "none",
|
|
27
|
-
onSortChange
|
|
28
|
-
} = {}) {
|
|
29
|
-
const [internalSort, setInternalSort] = react.useState(
|
|
30
|
-
() => normalizeSortState({
|
|
31
|
-
sortKey: defaultSortKey,
|
|
32
|
-
sortDirection: defaultSortDirection
|
|
33
|
-
})
|
|
34
|
-
);
|
|
35
|
-
const isSortKeyControlled = sortKey !== void 0;
|
|
36
|
-
const isSortDirectionControlled = sortDirection !== void 0;
|
|
37
|
-
const currentSort = normalizeSortState({
|
|
38
|
-
sortKey: isSortKeyControlled ? sortKey : internalSort.sortKey,
|
|
39
|
-
sortDirection: isSortDirectionControlled ? sortDirection : internalSort.sortDirection
|
|
40
|
-
});
|
|
41
|
-
const setSort = react.useCallback(
|
|
42
|
-
(nextSort) => {
|
|
43
|
-
const normalized = normalizeSortState(nextSort);
|
|
44
|
-
if (!isSortKeyControlled || !isSortDirectionControlled) {
|
|
45
|
-
setInternalSort((previousSort) => ({
|
|
46
|
-
sortKey: isSortKeyControlled ? previousSort.sortKey : normalized.sortKey,
|
|
47
|
-
sortDirection: isSortDirectionControlled ? previousSort.sortDirection : normalized.sortDirection
|
|
48
|
-
}));
|
|
49
|
-
}
|
|
50
|
-
onSortChange?.(normalized);
|
|
51
|
-
},
|
|
52
|
-
[isSortDirectionControlled, isSortKeyControlled, onSortChange]
|
|
53
|
-
);
|
|
54
|
-
const clearSort = react.useCallback(() => {
|
|
55
|
-
setSort({ sortKey: void 0, sortDirection: "none" });
|
|
56
|
-
}, [setSort]);
|
|
57
|
-
const toggleSort = react.useCallback(
|
|
58
|
-
(nextSortKey) => {
|
|
59
|
-
const direction = currentSort.sortKey === nextSortKey ? nextSortDirection(currentSort.sortDirection) : "ascending";
|
|
60
|
-
setSort({
|
|
61
|
-
sortKey: nextSortKey,
|
|
62
|
-
sortDirection: direction
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
[currentSort.sortDirection, currentSort.sortKey, setSort]
|
|
66
|
-
);
|
|
67
|
-
const getSortProps = react.useCallback(
|
|
68
|
-
(nextSortKey) => ({
|
|
69
|
-
sortKey: nextSortKey,
|
|
70
|
-
sortDirection: currentSort.sortKey === nextSortKey ? currentSort.sortDirection : "none",
|
|
71
|
-
onSortChange: (nextSort) => {
|
|
72
|
-
setSort(nextSort);
|
|
73
|
-
}
|
|
74
|
-
}),
|
|
75
|
-
[currentSort.sortDirection, currentSort.sortKey, setSort]
|
|
76
|
-
);
|
|
77
|
-
return react.useMemo(
|
|
78
|
-
() => ({
|
|
79
|
-
sortKey: currentSort.sortKey,
|
|
80
|
-
sortDirection: currentSort.sortDirection,
|
|
81
|
-
setSort,
|
|
82
|
-
clearSort,
|
|
83
|
-
toggleSort,
|
|
84
|
-
getSortProps
|
|
85
|
-
}),
|
|
86
|
-
[
|
|
87
|
-
clearSort,
|
|
88
|
-
currentSort.sortDirection,
|
|
89
|
-
currentSort.sortKey,
|
|
90
|
-
getSortProps,
|
|
91
|
-
setSort,
|
|
92
|
-
toggleSort
|
|
93
|
-
]
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
7
|
|
|
97
|
-
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "useTableSort", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkI7EBE7BD_js.useTableSort; }
|
|
12
|
+
});
|
|
98
13
|
//# sourceMappingURL=useTableSort.js.map
|
|
99
14
|
//# sourceMappingURL=useTableSort.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"useTableSort.js"}
|
|
@@ -1,97 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
export { useTableSort } from '../chunk-W6DO36XD.mjs';
|
|
2
3
|
import '../chunk-J5LGTIGS.mjs';
|
|
3
|
-
import { useState, useCallback, useMemo } from 'react';
|
|
4
|
-
|
|
5
|
-
function nextSortDirection(currentDirection) {
|
|
6
|
-
if (currentDirection === "ascending") {
|
|
7
|
-
return "descending";
|
|
8
|
-
}
|
|
9
|
-
if (currentDirection === "descending") {
|
|
10
|
-
return "none";
|
|
11
|
-
}
|
|
12
|
-
return "ascending";
|
|
13
|
-
}
|
|
14
|
-
function normalizeSortState(nextSort) {
|
|
15
|
-
if (!nextSort.sortKey || nextSort.sortDirection === "none") {
|
|
16
|
-
return { sortKey: void 0, sortDirection: "none" };
|
|
17
|
-
}
|
|
18
|
-
return nextSort;
|
|
19
|
-
}
|
|
20
|
-
function useTableSort({
|
|
21
|
-
sortKey,
|
|
22
|
-
defaultSortKey,
|
|
23
|
-
sortDirection,
|
|
24
|
-
defaultSortDirection = "none",
|
|
25
|
-
onSortChange
|
|
26
|
-
} = {}) {
|
|
27
|
-
const [internalSort, setInternalSort] = useState(
|
|
28
|
-
() => normalizeSortState({
|
|
29
|
-
sortKey: defaultSortKey,
|
|
30
|
-
sortDirection: defaultSortDirection
|
|
31
|
-
})
|
|
32
|
-
);
|
|
33
|
-
const isSortKeyControlled = sortKey !== void 0;
|
|
34
|
-
const isSortDirectionControlled = sortDirection !== void 0;
|
|
35
|
-
const currentSort = normalizeSortState({
|
|
36
|
-
sortKey: isSortKeyControlled ? sortKey : internalSort.sortKey,
|
|
37
|
-
sortDirection: isSortDirectionControlled ? sortDirection : internalSort.sortDirection
|
|
38
|
-
});
|
|
39
|
-
const setSort = useCallback(
|
|
40
|
-
(nextSort) => {
|
|
41
|
-
const normalized = normalizeSortState(nextSort);
|
|
42
|
-
if (!isSortKeyControlled || !isSortDirectionControlled) {
|
|
43
|
-
setInternalSort((previousSort) => ({
|
|
44
|
-
sortKey: isSortKeyControlled ? previousSort.sortKey : normalized.sortKey,
|
|
45
|
-
sortDirection: isSortDirectionControlled ? previousSort.sortDirection : normalized.sortDirection
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
onSortChange?.(normalized);
|
|
49
|
-
},
|
|
50
|
-
[isSortDirectionControlled, isSortKeyControlled, onSortChange]
|
|
51
|
-
);
|
|
52
|
-
const clearSort = useCallback(() => {
|
|
53
|
-
setSort({ sortKey: void 0, sortDirection: "none" });
|
|
54
|
-
}, [setSort]);
|
|
55
|
-
const toggleSort = useCallback(
|
|
56
|
-
(nextSortKey) => {
|
|
57
|
-
const direction = currentSort.sortKey === nextSortKey ? nextSortDirection(currentSort.sortDirection) : "ascending";
|
|
58
|
-
setSort({
|
|
59
|
-
sortKey: nextSortKey,
|
|
60
|
-
sortDirection: direction
|
|
61
|
-
});
|
|
62
|
-
},
|
|
63
|
-
[currentSort.sortDirection, currentSort.sortKey, setSort]
|
|
64
|
-
);
|
|
65
|
-
const getSortProps = useCallback(
|
|
66
|
-
(nextSortKey) => ({
|
|
67
|
-
sortKey: nextSortKey,
|
|
68
|
-
sortDirection: currentSort.sortKey === nextSortKey ? currentSort.sortDirection : "none",
|
|
69
|
-
onSortChange: (nextSort) => {
|
|
70
|
-
setSort(nextSort);
|
|
71
|
-
}
|
|
72
|
-
}),
|
|
73
|
-
[currentSort.sortDirection, currentSort.sortKey, setSort]
|
|
74
|
-
);
|
|
75
|
-
return useMemo(
|
|
76
|
-
() => ({
|
|
77
|
-
sortKey: currentSort.sortKey,
|
|
78
|
-
sortDirection: currentSort.sortDirection,
|
|
79
|
-
setSort,
|
|
80
|
-
clearSort,
|
|
81
|
-
toggleSort,
|
|
82
|
-
getSortProps
|
|
83
|
-
}),
|
|
84
|
-
[
|
|
85
|
-
clearSort,
|
|
86
|
-
currentSort.sortDirection,
|
|
87
|
-
currentSort.sortKey,
|
|
88
|
-
getSortProps,
|
|
89
|
-
setSort,
|
|
90
|
-
toggleSort
|
|
91
|
-
]
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export { useTableSort };
|
|
96
4
|
//# sourceMappingURL=useTableSort.mjs.map
|
|
97
5
|
//# sourceMappingURL=useTableSort.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"useTableSort.mjs"}
|
|
@@ -1,84 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var chunkOYAJG2BO_js = require('../chunk-OYAJG2BO.js');
|
|
4
5
|
require('../chunk-PZ5AY32C.js');
|
|
5
|
-
var react = require('react');
|
|
6
6
|
|
|
7
|
-
function useVirtualList({
|
|
8
|
-
itemCount,
|
|
9
|
-
itemHeight,
|
|
10
|
-
overscan = 3
|
|
11
|
-
}) {
|
|
12
|
-
const [container, setContainer] = react.useState(null);
|
|
13
|
-
const [scrollTop, setScrollTop] = react.useState(0);
|
|
14
|
-
const [viewportHeight, setViewportHeight] = react.useState(0);
|
|
15
|
-
const setContainerRef = react.useCallback((node) => {
|
|
16
|
-
setContainer(node);
|
|
17
|
-
}, []);
|
|
18
|
-
react.useEffect(() => {
|
|
19
|
-
if (container == null) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
const onScroll = () => {
|
|
23
|
-
setScrollTop(container.scrollTop);
|
|
24
|
-
};
|
|
25
|
-
const measure = () => {
|
|
26
|
-
setViewportHeight(container.clientHeight);
|
|
27
|
-
};
|
|
28
|
-
measure();
|
|
29
|
-
onScroll();
|
|
30
|
-
container.addEventListener("scroll", onScroll, { passive: true });
|
|
31
|
-
let observer;
|
|
32
|
-
if (typeof ResizeObserver !== "undefined") {
|
|
33
|
-
observer = new ResizeObserver(measure);
|
|
34
|
-
observer.observe(container);
|
|
35
|
-
}
|
|
36
|
-
return () => {
|
|
37
|
-
container.removeEventListener("scroll", onScroll);
|
|
38
|
-
observer?.disconnect();
|
|
39
|
-
};
|
|
40
|
-
}, [container]);
|
|
41
|
-
const safeItemCount = Math.max(0, Math.floor(itemCount));
|
|
42
|
-
const safeItemHeight = Math.max(1, itemHeight);
|
|
43
|
-
const safeOverscan = Math.max(0, Math.floor(overscan));
|
|
44
|
-
const totalHeight = safeItemCount * safeItemHeight;
|
|
45
|
-
const startIndex = safeItemCount === 0 ? 0 : Math.max(0, Math.floor(scrollTop / safeItemHeight) - safeOverscan);
|
|
46
|
-
const endIndex = safeItemCount === 0 ? -1 : Math.min(
|
|
47
|
-
safeItemCount - 1,
|
|
48
|
-
Math.ceil((scrollTop + viewportHeight) / safeItemHeight) - 1 + safeOverscan
|
|
49
|
-
);
|
|
50
|
-
const virtualItems = react.useMemo(() => {
|
|
51
|
-
const items = [];
|
|
52
|
-
for (let index = startIndex; index <= endIndex; index += 1) {
|
|
53
|
-
items.push({
|
|
54
|
-
index,
|
|
55
|
-
start: index * safeItemHeight,
|
|
56
|
-
size: safeItemHeight
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
return items;
|
|
60
|
-
}, [endIndex, safeItemHeight, startIndex]);
|
|
61
|
-
const scrollToIndex = react.useCallback(
|
|
62
|
-
(index) => {
|
|
63
|
-
if (container == null || safeItemCount === 0) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const clamped = Math.min(Math.max(index, 0), safeItemCount - 1);
|
|
67
|
-
container.scrollTop = clamped * safeItemHeight;
|
|
68
|
-
setScrollTop(container.scrollTop);
|
|
69
|
-
},
|
|
70
|
-
[container, safeItemCount, safeItemHeight]
|
|
71
|
-
);
|
|
72
|
-
return {
|
|
73
|
-
setContainerRef,
|
|
74
|
-
virtualItems,
|
|
75
|
-
totalHeight,
|
|
76
|
-
startIndex,
|
|
77
|
-
endIndex,
|
|
78
|
-
scrollToIndex
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
7
|
|
|
82
|
-
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "useVirtualList", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkOYAJG2BO_js.useVirtualList; }
|
|
12
|
+
});
|
|
83
13
|
//# sourceMappingURL=useVirtualList.js.map
|
|
84
14
|
//# sourceMappingURL=useVirtualList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"useVirtualList.js"}
|
|
@@ -1,82 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
export { useVirtualList } from '../chunk-QKO5DA4N.mjs';
|
|
2
3
|
import '../chunk-J5LGTIGS.mjs';
|
|
3
|
-
import { useState, useCallback, useEffect, useMemo } from 'react';
|
|
4
|
-
|
|
5
|
-
function useVirtualList({
|
|
6
|
-
itemCount,
|
|
7
|
-
itemHeight,
|
|
8
|
-
overscan = 3
|
|
9
|
-
}) {
|
|
10
|
-
const [container, setContainer] = useState(null);
|
|
11
|
-
const [scrollTop, setScrollTop] = useState(0);
|
|
12
|
-
const [viewportHeight, setViewportHeight] = useState(0);
|
|
13
|
-
const setContainerRef = useCallback((node) => {
|
|
14
|
-
setContainer(node);
|
|
15
|
-
}, []);
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
if (container == null) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const onScroll = () => {
|
|
21
|
-
setScrollTop(container.scrollTop);
|
|
22
|
-
};
|
|
23
|
-
const measure = () => {
|
|
24
|
-
setViewportHeight(container.clientHeight);
|
|
25
|
-
};
|
|
26
|
-
measure();
|
|
27
|
-
onScroll();
|
|
28
|
-
container.addEventListener("scroll", onScroll, { passive: true });
|
|
29
|
-
let observer;
|
|
30
|
-
if (typeof ResizeObserver !== "undefined") {
|
|
31
|
-
observer = new ResizeObserver(measure);
|
|
32
|
-
observer.observe(container);
|
|
33
|
-
}
|
|
34
|
-
return () => {
|
|
35
|
-
container.removeEventListener("scroll", onScroll);
|
|
36
|
-
observer?.disconnect();
|
|
37
|
-
};
|
|
38
|
-
}, [container]);
|
|
39
|
-
const safeItemCount = Math.max(0, Math.floor(itemCount));
|
|
40
|
-
const safeItemHeight = Math.max(1, itemHeight);
|
|
41
|
-
const safeOverscan = Math.max(0, Math.floor(overscan));
|
|
42
|
-
const totalHeight = safeItemCount * safeItemHeight;
|
|
43
|
-
const startIndex = safeItemCount === 0 ? 0 : Math.max(0, Math.floor(scrollTop / safeItemHeight) - safeOverscan);
|
|
44
|
-
const endIndex = safeItemCount === 0 ? -1 : Math.min(
|
|
45
|
-
safeItemCount - 1,
|
|
46
|
-
Math.ceil((scrollTop + viewportHeight) / safeItemHeight) - 1 + safeOverscan
|
|
47
|
-
);
|
|
48
|
-
const virtualItems = useMemo(() => {
|
|
49
|
-
const items = [];
|
|
50
|
-
for (let index = startIndex; index <= endIndex; index += 1) {
|
|
51
|
-
items.push({
|
|
52
|
-
index,
|
|
53
|
-
start: index * safeItemHeight,
|
|
54
|
-
size: safeItemHeight
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
return items;
|
|
58
|
-
}, [endIndex, safeItemHeight, startIndex]);
|
|
59
|
-
const scrollToIndex = useCallback(
|
|
60
|
-
(index) => {
|
|
61
|
-
if (container == null || safeItemCount === 0) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const clamped = Math.min(Math.max(index, 0), safeItemCount - 1);
|
|
65
|
-
container.scrollTop = clamped * safeItemHeight;
|
|
66
|
-
setScrollTop(container.scrollTop);
|
|
67
|
-
},
|
|
68
|
-
[container, safeItemCount, safeItemHeight]
|
|
69
|
-
);
|
|
70
|
-
return {
|
|
71
|
-
setContainerRef,
|
|
72
|
-
virtualItems,
|
|
73
|
-
totalHeight,
|
|
74
|
-
startIndex,
|
|
75
|
-
endIndex,
|
|
76
|
-
scrollToIndex
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export { useVirtualList };
|
|
81
4
|
//# sourceMappingURL=useVirtualList.mjs.map
|
|
82
5
|
//# sourceMappingURL=useVirtualList.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"useVirtualList.mjs"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../../chunk-
|
|
4
|
+
var chunk6OVDBAMI_js = require('../../chunk-6OVDBAMI.js');
|
|
5
|
+
require('../../chunk-DPNTQ4AK.js');
|
|
6
6
|
require('../../chunk-FBUY6K6S.js');
|
|
7
|
+
require('../../chunk-OH5VOGNW.js');
|
|
8
|
+
require('../../chunk-Y7BU5RC4.js');
|
|
7
9
|
require('../../chunk-NDF3HORF.js');
|
|
8
10
|
require('../../chunk-USLNTKVQ.js');
|
|
9
11
|
require('../../chunk-D7ATXPVI.js');
|
|
10
12
|
require('../../chunk-IEHY6KNM.js');
|
|
11
13
|
require('../../chunk-3MK7CWEX.js');
|
|
14
|
+
require('../../chunk-22FJROCI.js');
|
|
12
15
|
require('../../chunk-UJXFD4SK.js');
|
|
13
16
|
require('../../chunk-3EJCQXGV.js');
|
|
14
17
|
require('../../chunk-6KVTKYTB.js');
|
|
15
18
|
require('../../chunk-L7W4NRK6.js');
|
|
16
19
|
require('../../chunk-KWBGLH7G.js');
|
|
17
|
-
require('../../chunk-
|
|
18
|
-
require('../../chunk-Y7BU5RC4.js');
|
|
20
|
+
require('../../chunk-WGN2CBG6.js');
|
|
19
21
|
require('../../chunk-SRSRY5K2.js');
|
|
20
22
|
require('../../chunk-UG3GF2BD.js');
|
|
21
23
|
require('../../chunk-BZTAA3MK.js');
|
|
22
24
|
require('../../chunk-PZ25OHJE.js');
|
|
23
25
|
require('../../chunk-HOOZYA4N.js');
|
|
24
26
|
require('../../chunk-CJCOURVM.js');
|
|
25
|
-
require('../../chunk-22FJROCI.js');
|
|
26
27
|
require('../../chunk-KJMW7S5X.js');
|
|
27
28
|
require('../../chunk-3CYJQ6KF.js');
|
|
28
29
|
require('../../chunk-3453DQNL.js');
|
|
29
30
|
require('../../chunk-DYSXCJGL.js');
|
|
30
31
|
require('../../chunk-A7MU6SFI.js');
|
|
31
|
-
require('../../chunk-WGN2CBG6.js');
|
|
32
32
|
require('../../chunk-NYO3W5GY.js');
|
|
33
33
|
require('../../chunk-HNRCPZCK.js');
|
|
34
34
|
require('../../chunk-J2SUGU3X.js');
|
|
@@ -103,7 +103,7 @@ var ButtonAnimated = (props) => {
|
|
|
103
103
|
target,
|
|
104
104
|
rel: target === "_blank" ? "noopener noreferrer" : void 0,
|
|
105
105
|
"data-slot": "button",
|
|
106
|
-
className: chunkZS5756ZC_js.cn(
|
|
106
|
+
className: chunkZS5756ZC_js.cn(chunk6OVDBAMI_js.buttonVariants({ appearance: appearance2, size: size2 }), className2),
|
|
107
107
|
initial: false,
|
|
108
108
|
...motionProps2,
|
|
109
109
|
...rest2,
|
|
@@ -128,7 +128,7 @@ var ButtonAnimated = (props) => {
|
|
|
128
128
|
ref,
|
|
129
129
|
type,
|
|
130
130
|
"data-slot": "button",
|
|
131
|
-
className: chunkZS5756ZC_js.cn(
|
|
131
|
+
className: chunkZS5756ZC_js.cn(chunk6OVDBAMI_js.buttonVariants({ appearance, size }), className),
|
|
132
132
|
initial: false,
|
|
133
133
|
...motionProps,
|
|
134
134
|
...rest,
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { buttonVariants } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
2
|
+
import { buttonVariants } from '../../chunk-4PAHLHYF.mjs';
|
|
3
|
+
import '../../chunk-UVP3MUBU.mjs';
|
|
4
4
|
import '../../chunk-2NQKFH26.mjs';
|
|
5
|
+
import '../../chunk-XY3TKIIH.mjs';
|
|
6
|
+
import '../../chunk-FX5KR2GP.mjs';
|
|
5
7
|
import '../../chunk-ZBAKTM2R.mjs';
|
|
6
8
|
import '../../chunk-4ZBMDWWY.mjs';
|
|
7
9
|
import '../../chunk-YH6MOKHR.mjs';
|
|
8
10
|
import '../../chunk-T4ZLTKV2.mjs';
|
|
9
11
|
import '../../chunk-PUSCPBT2.mjs';
|
|
12
|
+
import '../../chunk-523VQLCW.mjs';
|
|
10
13
|
import '../../chunk-3VW4HMJT.mjs';
|
|
11
14
|
import '../../chunk-LRYKMXKI.mjs';
|
|
12
15
|
import '../../chunk-XFJIX2YP.mjs';
|
|
13
16
|
import '../../chunk-4WG3VNVL.mjs';
|
|
14
17
|
import '../../chunk-YPTHTFVF.mjs';
|
|
15
|
-
import '../../chunk-
|
|
16
|
-
import '../../chunk-FX5KR2GP.mjs';
|
|
18
|
+
import '../../chunk-JEDMUBYI.mjs';
|
|
17
19
|
import '../../chunk-EJ3UMMCS.mjs';
|
|
18
20
|
import '../../chunk-EE53BIXR.mjs';
|
|
19
21
|
import '../../chunk-YXU2MJMT.mjs';
|
|
20
22
|
import '../../chunk-3IE4IELX.mjs';
|
|
21
23
|
import '../../chunk-BUEI4RMR.mjs';
|
|
22
24
|
import '../../chunk-5AOVTY2X.mjs';
|
|
23
|
-
import '../../chunk-523VQLCW.mjs';
|
|
24
25
|
import '../../chunk-SS3T3BUL.mjs';
|
|
25
26
|
import '../../chunk-SCWQSQBJ.mjs';
|
|
26
27
|
import '../../chunk-ZPGYR2UP.mjs';
|
|
27
28
|
import '../../chunk-MBEQ4GQ7.mjs';
|
|
28
29
|
import '../../chunk-34LHS26H.mjs';
|
|
29
|
-
import '../../chunk-JEDMUBYI.mjs';
|
|
30
30
|
import '../../chunk-YKTANA3H.mjs';
|
|
31
31
|
import '../../chunk-ENYZGL4R.mjs';
|
|
32
32
|
import '../../chunk-2VPXQ2LA.mjs';
|
package/dist/ui/buttons.js
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
require('../chunk-
|
|
4
|
+
require('../chunk-XR3J46TZ.js');
|
|
5
|
+
var chunkBAAXQPZ7_js = require('../chunk-BAAXQPZ7.js');
|
|
6
|
+
var chunk6OVDBAMI_js = require('../chunk-6OVDBAMI.js');
|
|
7
|
+
require('../chunk-DPNTQ4AK.js');
|
|
7
8
|
require('../chunk-FBUY6K6S.js');
|
|
9
|
+
require('../chunk-OH5VOGNW.js');
|
|
10
|
+
require('../chunk-Y7BU5RC4.js');
|
|
8
11
|
require('../chunk-NDF3HORF.js');
|
|
9
12
|
require('../chunk-USLNTKVQ.js');
|
|
10
13
|
require('../chunk-D7ATXPVI.js');
|
|
11
14
|
require('../chunk-IEHY6KNM.js');
|
|
12
15
|
require('../chunk-3MK7CWEX.js');
|
|
16
|
+
require('../chunk-22FJROCI.js');
|
|
13
17
|
require('../chunk-UJXFD4SK.js');
|
|
14
18
|
require('../chunk-3EJCQXGV.js');
|
|
15
19
|
require('../chunk-6KVTKYTB.js');
|
|
16
20
|
require('../chunk-L7W4NRK6.js');
|
|
17
21
|
require('../chunk-KWBGLH7G.js');
|
|
18
|
-
require('../chunk-
|
|
19
|
-
require('../chunk-Y7BU5RC4.js');
|
|
22
|
+
require('../chunk-WGN2CBG6.js');
|
|
20
23
|
require('../chunk-SRSRY5K2.js');
|
|
21
24
|
require('../chunk-UG3GF2BD.js');
|
|
22
25
|
require('../chunk-BZTAA3MK.js');
|
|
23
26
|
require('../chunk-PZ25OHJE.js');
|
|
24
27
|
require('../chunk-HOOZYA4N.js');
|
|
25
28
|
require('../chunk-CJCOURVM.js');
|
|
26
|
-
require('../chunk-22FJROCI.js');
|
|
27
29
|
require('../chunk-KJMW7S5X.js');
|
|
28
30
|
require('../chunk-3CYJQ6KF.js');
|
|
29
31
|
require('../chunk-3453DQNL.js');
|
|
30
32
|
require('../chunk-DYSXCJGL.js');
|
|
31
33
|
require('../chunk-A7MU6SFI.js');
|
|
32
|
-
require('../chunk-WGN2CBG6.js');
|
|
33
34
|
require('../chunk-NYO3W5GY.js');
|
|
34
35
|
require('../chunk-HNRCPZCK.js');
|
|
35
36
|
require('../chunk-J2SUGU3X.js');
|
|
@@ -52,11 +53,11 @@ require('../chunk-PZ5AY32C.js');
|
|
|
52
53
|
|
|
53
54
|
Object.defineProperty(exports, "Button", {
|
|
54
55
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunkBAAXQPZ7_js.Button; }
|
|
56
57
|
});
|
|
57
58
|
Object.defineProperty(exports, "buttonVariants", {
|
|
58
59
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunk6OVDBAMI_js.buttonVariants; }
|
|
60
61
|
});
|
|
61
62
|
//# sourceMappingURL=buttons.js.map
|
|
62
63
|
//# sourceMappingURL=buttons.js.map
|
package/dist/ui/buttons.mjs
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
|
|
2
|
+
import '../chunk-VBNW2B4D.mjs';
|
|
3
|
+
export { Button } from '../chunk-OWVQVAOY.mjs';
|
|
4
|
+
export { buttonVariants } from '../chunk-4PAHLHYF.mjs';
|
|
5
|
+
import '../chunk-UVP3MUBU.mjs';
|
|
5
6
|
import '../chunk-2NQKFH26.mjs';
|
|
7
|
+
import '../chunk-XY3TKIIH.mjs';
|
|
8
|
+
import '../chunk-FX5KR2GP.mjs';
|
|
6
9
|
import '../chunk-ZBAKTM2R.mjs';
|
|
7
10
|
import '../chunk-4ZBMDWWY.mjs';
|
|
8
11
|
import '../chunk-YH6MOKHR.mjs';
|
|
9
12
|
import '../chunk-T4ZLTKV2.mjs';
|
|
10
13
|
import '../chunk-PUSCPBT2.mjs';
|
|
14
|
+
import '../chunk-523VQLCW.mjs';
|
|
11
15
|
import '../chunk-3VW4HMJT.mjs';
|
|
12
16
|
import '../chunk-LRYKMXKI.mjs';
|
|
13
17
|
import '../chunk-XFJIX2YP.mjs';
|
|
14
18
|
import '../chunk-4WG3VNVL.mjs';
|
|
15
19
|
import '../chunk-YPTHTFVF.mjs';
|
|
16
|
-
import '../chunk-
|
|
17
|
-
import '../chunk-FX5KR2GP.mjs';
|
|
20
|
+
import '../chunk-JEDMUBYI.mjs';
|
|
18
21
|
import '../chunk-EJ3UMMCS.mjs';
|
|
19
22
|
import '../chunk-EE53BIXR.mjs';
|
|
20
23
|
import '../chunk-YXU2MJMT.mjs';
|
|
21
24
|
import '../chunk-3IE4IELX.mjs';
|
|
22
25
|
import '../chunk-BUEI4RMR.mjs';
|
|
23
26
|
import '../chunk-5AOVTY2X.mjs';
|
|
24
|
-
import '../chunk-523VQLCW.mjs';
|
|
25
27
|
import '../chunk-SS3T3BUL.mjs';
|
|
26
28
|
import '../chunk-SCWQSQBJ.mjs';
|
|
27
29
|
import '../chunk-ZPGYR2UP.mjs';
|
|
28
30
|
import '../chunk-MBEQ4GQ7.mjs';
|
|
29
31
|
import '../chunk-34LHS26H.mjs';
|
|
30
|
-
import '../chunk-JEDMUBYI.mjs';
|
|
31
32
|
import '../chunk-YKTANA3H.mjs';
|
|
32
33
|
import '../chunk-ENYZGL4R.mjs';
|
|
33
34
|
import '../chunk-2VPXQ2LA.mjs';
|