@konstructio/ui 0.1.2-alpha.14 → 0.1.2-alpha.16
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/{chevron-down-Cx07rtLP.js → chevron-down-J5nS1Tu0.js} +2 -2
- package/dist/{chevron-right-DCDOrc04.js → chevron-right-DeMVrnIg.js} +3 -3
- package/dist/components/Badge/Badge.js +2 -2
- package/dist/components/Button/Button.variants.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +1 -1
- package/dist/components/Dropdown/components/List/List.js +55 -51
- package/dist/components/Dropdown/components/ListItem/ListItem.js +58 -36
- package/dist/components/Dropdown/components/Wrapper.js +39 -37
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
- package/dist/components/Loading/Loading.js +2 -2
- package/dist/components/PieChart/PieChart.js +460 -461
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.js +37 -35
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +2 -2
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.provider.js +58 -56
- package/dist/{createLucideIcon-DnY-81vT.js → createLucideIcon-DGhJ8Z4k.js} +4 -4
- package/dist/index.d.ts +6 -2
- package/dist/package.json +9 -9
- package/dist/styles.css +1 -1
- package/package.json +9 -9
|
@@ -3,7 +3,7 @@ import { useId as N, useState as y, useRef as E, useCallback as O, useEffect as
|
|
|
3
3
|
import { cn as m } from "../../../../utils/index.js";
|
|
4
4
|
import { timePickerVariants as L } from "../../TimePicker.variants.js";
|
|
5
5
|
import { WrapperList as j } from "../WrapperList/WrapperList.js";
|
|
6
|
-
import { C as P } from "../../../../chevron-down-
|
|
6
|
+
import { C as P } from "../../../../chevron-down-J5nS1Tu0.js";
|
|
7
7
|
import { useTimePickerContext as R } from "../../contexts/time-picker.hook.js";
|
|
8
8
|
const V = ({
|
|
9
9
|
name: d,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
2
|
+
import { useMemo as I } from "react";
|
|
3
3
|
import { cn as s } from "../../utils/index.js";
|
|
4
|
-
import { TableProvider as
|
|
5
|
-
import { Filter as
|
|
6
|
-
import { Header as
|
|
7
|
-
import { Body as
|
|
8
|
-
import { Pagination as
|
|
9
|
-
import { TruncateText as
|
|
10
|
-
import { Actions as
|
|
11
|
-
const
|
|
4
|
+
import { TableProvider as K } from "./contexts/table.provider.js";
|
|
5
|
+
import { Filter as M } from "./components/Filter/Filter.js";
|
|
6
|
+
import { Header as P } from "./components/Header/Header.js";
|
|
7
|
+
import { Body as k } from "./components/Body/Body.js";
|
|
8
|
+
import { Pagination as q } from "./components/Pagination/Pagination.js";
|
|
9
|
+
import { TruncateText as C } from "./components/TruncateText/TruncateText.js";
|
|
10
|
+
import { Actions as E } from "./components/Actions/Actions.js";
|
|
11
|
+
const F = ({
|
|
12
12
|
id: c,
|
|
13
13
|
ariaLabel: n,
|
|
14
14
|
columns: d,
|
|
@@ -21,23 +21,24 @@ const E = ({
|
|
|
21
21
|
classNameTable: h,
|
|
22
22
|
classNameWrapperTable: x,
|
|
23
23
|
fetchData: A,
|
|
24
|
+
queryOptions: v,
|
|
24
25
|
// Pagination
|
|
25
|
-
showPagination:
|
|
26
|
+
showPagination: y,
|
|
26
27
|
showTotalItems: o,
|
|
27
28
|
showDropdownPagination: i,
|
|
28
29
|
showDotPagination: a,
|
|
29
30
|
showFormPagination: l,
|
|
30
|
-
pageSizes:
|
|
31
|
+
pageSizes: z,
|
|
31
32
|
// Filter
|
|
32
|
-
showFilter:
|
|
33
|
-
showFilterInput:
|
|
34
|
-
filterSearchPlaceholder:
|
|
35
|
-
multiSelectFilter:
|
|
36
|
-
filterActions:
|
|
37
|
-
showResetButton:
|
|
33
|
+
showFilter: V = !1,
|
|
34
|
+
showFilterInput: g,
|
|
35
|
+
filterSearchPlaceholder: j = "",
|
|
36
|
+
multiSelectFilter: w,
|
|
37
|
+
filterActions: B,
|
|
38
|
+
showResetButton: H = !0
|
|
38
39
|
}) => {
|
|
39
|
-
const t =
|
|
40
|
-
() =>
|
|
40
|
+
const t = I(
|
|
41
|
+
() => y || [
|
|
41
42
|
o,
|
|
42
43
|
i,
|
|
43
44
|
a,
|
|
@@ -46,22 +47,23 @@ const E = ({
|
|
|
46
47
|
[]
|
|
47
48
|
);
|
|
48
49
|
return /* @__PURE__ */ r(
|
|
49
|
-
|
|
50
|
+
K,
|
|
50
51
|
{
|
|
51
52
|
id: c,
|
|
52
53
|
columns: d,
|
|
53
54
|
data: f,
|
|
54
55
|
fetchData: A,
|
|
55
56
|
totalItems: p,
|
|
57
|
+
queryOptions: v,
|
|
56
58
|
children: /* @__PURE__ */ m("section", { className: u, children: [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
V && /* @__PURE__ */ r(
|
|
60
|
+
M,
|
|
59
61
|
{
|
|
60
|
-
actions:
|
|
61
|
-
multiSelectFilter:
|
|
62
|
-
placeholder:
|
|
63
|
-
showFilterInput:
|
|
64
|
-
showResetButton:
|
|
62
|
+
actions: B,
|
|
63
|
+
multiSelectFilter: w,
|
|
64
|
+
placeholder: j,
|
|
65
|
+
showFilterInput: g,
|
|
66
|
+
showResetButton: H
|
|
65
67
|
}
|
|
66
68
|
),
|
|
67
69
|
/* @__PURE__ */ r(
|
|
@@ -81,37 +83,37 @@ const E = ({
|
|
|
81
83
|
"aria-label": n,
|
|
82
84
|
children: [
|
|
83
85
|
/* @__PURE__ */ r(
|
|
84
|
-
|
|
86
|
+
P,
|
|
85
87
|
{
|
|
86
88
|
className: N,
|
|
87
89
|
classNameArrows: T,
|
|
88
90
|
classNameActiveArrows: b
|
|
89
91
|
}
|
|
90
92
|
),
|
|
91
|
-
/* @__PURE__ */ r(
|
|
93
|
+
/* @__PURE__ */ r(k, {})
|
|
92
94
|
]
|
|
93
95
|
}
|
|
94
96
|
)
|
|
95
97
|
}
|
|
96
98
|
),
|
|
97
99
|
t && /* @__PURE__ */ r(
|
|
98
|
-
|
|
100
|
+
q,
|
|
99
101
|
{
|
|
100
102
|
showTotalItems: o,
|
|
101
103
|
showDropdownPagination: i,
|
|
102
104
|
showDotPagination: a,
|
|
103
105
|
showFormPagination: l,
|
|
104
|
-
pageSizes:
|
|
106
|
+
pageSizes: z
|
|
105
107
|
}
|
|
106
108
|
)
|
|
107
109
|
] })
|
|
108
110
|
}
|
|
109
111
|
);
|
|
110
|
-
}, e =
|
|
112
|
+
}, e = F;
|
|
111
113
|
e.displayName = "KonstructVirtualizedTable";
|
|
112
|
-
e.TruncateText =
|
|
113
|
-
e.Actions =
|
|
114
|
+
e.TruncateText = C;
|
|
115
|
+
e.Actions = E;
|
|
114
116
|
export {
|
|
115
|
-
|
|
117
|
+
C as TruncateText,
|
|
116
118
|
e as VirtualizedTable
|
|
117
119
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Button as r } from "../../../Button/Button.js";
|
|
3
3
|
import { cn as s } from "../../../../utils/index.js";
|
|
4
|
-
import { c as n } from "../../../../createLucideIcon-
|
|
4
|
+
import { c as n } from "../../../../createLucideIcon-DGhJ8Z4k.js";
|
|
5
5
|
/**
|
|
6
|
-
* @license lucide-react v0.
|
|
6
|
+
* @license lucide-react v0.548.0 - ISC
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the ISC license.
|
|
9
9
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { memo as u } from "react";
|
|
3
3
|
import { cn as p } from "../../../../utils/index.js";
|
|
4
|
-
import { C as g, a as d } from "../../../../chevron-right-
|
|
4
|
+
import { C as g, a as d } from "../../../../chevron-right-DeMVrnIg.js";
|
|
5
5
|
import { useTableContext as f } from "../../contexts/table.hook.js";
|
|
6
6
|
const r = u(
|
|
7
7
|
({
|
|
@@ -1,82 +1,84 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { u as
|
|
4
|
-
import { useState as t, useMemo as
|
|
5
|
-
import { TableContext as
|
|
6
|
-
import { DEFAULT_PAGE_SIZE as
|
|
7
|
-
const
|
|
8
|
-
children:
|
|
9
|
-
id:
|
|
10
|
-
data:
|
|
11
|
-
columns:
|
|
12
|
-
totalItems:
|
|
13
|
-
fetchData:
|
|
1
|
+
import { jsx as E } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as _ } from "@tanstack/react-query";
|
|
3
|
+
import { u as j, g as k, a as q } from "../../../index-Dx2grAuN.js";
|
|
4
|
+
import { useState as t, useMemo as A, useCallback as n } from "react";
|
|
5
|
+
import { TableContext as K } from "./table.context.js";
|
|
6
|
+
import { DEFAULT_PAGE_SIZE as G } from "../constants/pagination.js";
|
|
7
|
+
const B = ({
|
|
8
|
+
children: S,
|
|
9
|
+
id: r,
|
|
10
|
+
data: f = [],
|
|
11
|
+
columns: h = [],
|
|
12
|
+
totalItems: p,
|
|
13
|
+
fetchData: g,
|
|
14
|
+
queryOptions: M = {}
|
|
14
15
|
}) => {
|
|
15
|
-
const [
|
|
16
|
-
() => Math.ceil(
|
|
17
|
-
[
|
|
18
|
-
), [a, w] = t({}), { data:
|
|
16
|
+
const [m, u] = t([]), [c, d] = t(0), [l, C] = t(), [o, b] = t(G), [i, y] = t(p), P = A(
|
|
17
|
+
() => Math.ceil(i / o),
|
|
18
|
+
[i, o]
|
|
19
|
+
), [a, w] = t({}), { data: O, isLoading: T, isFetching: F } = _({
|
|
19
20
|
queryKey: [
|
|
20
|
-
|
|
21
|
-
r,
|
|
22
|
-
o,
|
|
21
|
+
...typeof r == "string" ? [r] : r,
|
|
23
22
|
c,
|
|
23
|
+
o,
|
|
24
|
+
l,
|
|
24
25
|
JSON.stringify(a)
|
|
25
26
|
],
|
|
26
27
|
refetchOnMount: !1,
|
|
27
28
|
refetchOnWindowFocus: !1,
|
|
28
|
-
initialData:
|
|
29
|
-
queryFn: () =>
|
|
30
|
-
page: Math.max(
|
|
29
|
+
initialData: f,
|
|
30
|
+
queryFn: g ? () => g({
|
|
31
|
+
page: Math.max(c + 1, 1),
|
|
31
32
|
pageSize: o,
|
|
32
|
-
termOfSearch:
|
|
33
|
+
termOfSearch: l,
|
|
33
34
|
...Object.keys(a).length > 0 ? a : {}
|
|
34
|
-
}).then(({ data: e, totalItemsCount: s }) => (s &&
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
}).then(({ data: e, totalItemsCount: s }) => (s && y(s), e)) : void 0,
|
|
36
|
+
...M
|
|
37
|
+
}), R = n((e) => {
|
|
38
|
+
C(e), d(0);
|
|
39
|
+
}, []), v = n((e, s) => {
|
|
40
|
+
const z = e.toLowerCase().replace(/\s+/g, "_");
|
|
41
|
+
w((D) => ({
|
|
42
|
+
...D,
|
|
43
|
+
[z]: s
|
|
42
44
|
}));
|
|
43
|
-
}, []), x = n((e) =>
|
|
44
|
-
(e) =>
|
|
45
|
+
}, []), x = n((e) => d(e), []), I = n(
|
|
46
|
+
(e) => b(e),
|
|
45
47
|
[]
|
|
46
|
-
),
|
|
47
|
-
data:
|
|
48
|
-
columns:
|
|
48
|
+
), L = j({
|
|
49
|
+
data: O,
|
|
50
|
+
columns: h,
|
|
49
51
|
state: {
|
|
50
|
-
sorting:
|
|
52
|
+
sorting: m
|
|
51
53
|
},
|
|
52
|
-
onSortingChange:
|
|
53
|
-
getCoreRowModel:
|
|
54
|
-
getSortedRowModel:
|
|
54
|
+
onSortingChange: u,
|
|
55
|
+
getCoreRowModel: q(),
|
|
56
|
+
getSortedRowModel: k()
|
|
55
57
|
});
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
|
|
58
|
+
return /* @__PURE__ */ E(
|
|
59
|
+
K.Provider,
|
|
58
60
|
{
|
|
59
61
|
value: {
|
|
60
|
-
sortedData:
|
|
61
|
-
table:
|
|
62
|
-
tableFetching:
|
|
63
|
-
tableLoading:
|
|
64
|
-
totalItems:
|
|
65
|
-
termOfSearch:
|
|
66
|
-
page:
|
|
62
|
+
sortedData: m,
|
|
63
|
+
table: L,
|
|
64
|
+
tableFetching: F,
|
|
65
|
+
tableLoading: T,
|
|
66
|
+
totalItems: i,
|
|
67
|
+
termOfSearch: l,
|
|
68
|
+
page: c,
|
|
67
69
|
multiselectSelected: a,
|
|
68
70
|
pageSize: o,
|
|
69
71
|
totalPages: P,
|
|
70
72
|
handlePage: x,
|
|
71
|
-
onPageSize:
|
|
72
|
-
onChangeTermOfSearch:
|
|
73
|
-
onSorting:
|
|
74
|
-
onSelectMultiselect:
|
|
73
|
+
onPageSize: I,
|
|
74
|
+
onChangeTermOfSearch: R,
|
|
75
|
+
onSorting: u,
|
|
76
|
+
onSelectMultiselect: v
|
|
75
77
|
},
|
|
76
|
-
children:
|
|
78
|
+
children: S
|
|
77
79
|
}
|
|
78
80
|
);
|
|
79
81
|
};
|
|
80
82
|
export {
|
|
81
|
-
|
|
83
|
+
B as TableProvider
|
|
82
84
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { forwardRef as l, createElement as n } from "react";
|
|
2
2
|
/**
|
|
3
|
-
* @license lucide-react v0.
|
|
3
|
+
* @license lucide-react v0.548.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -17,7 +17,7 @@ const w = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), h = (t)
|
|
|
17
17
|
return !0;
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
|
-
* @license lucide-react v0.
|
|
20
|
+
* @license lucide-react v0.548.0 - ISC
|
|
21
21
|
*
|
|
22
22
|
* This source code is licensed under the ISC license.
|
|
23
23
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -34,7 +34,7 @@ var g = {
|
|
|
34
34
|
strokeLinejoin: "round"
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
|
-
* @license lucide-react v0.
|
|
37
|
+
* @license lucide-react v0.548.0 - ISC
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -69,7 +69,7 @@ const A = l(
|
|
|
69
69
|
)
|
|
70
70
|
);
|
|
71
71
|
/**
|
|
72
|
-
* @license lucide-react v0.
|
|
72
|
+
* @license lucide-react v0.548.0 - ISC
|
|
73
73
|
*
|
|
74
74
|
* This source code is licensed under the ISC license.
|
|
75
75
|
* See the LICENSE file in the root directory of this source tree.
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { RefAttributes } from 'react';
|
|
|
23
23
|
import { RowData as RowData_2 } from '@tanstack/react-table';
|
|
24
24
|
import { SliderProps } from '@radix-ui/react-slider';
|
|
25
25
|
import { TabsContentProps } from '@radix-ui/react-tabs';
|
|
26
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
26
27
|
import { VariantProps } from 'class-variance-authority';
|
|
27
28
|
|
|
28
29
|
declare type Action<TData> = {
|
|
@@ -229,6 +230,7 @@ declare type DropdownProps = VariantProps<typeof dropdownVariants> & Omit<InputH
|
|
|
229
230
|
labelClassName?: string;
|
|
230
231
|
listClassName?: string;
|
|
231
232
|
listItemClassName?: string;
|
|
233
|
+
listItemSecondRowClassName?: string;
|
|
232
234
|
options: Option_3[];
|
|
233
235
|
searchable?: boolean;
|
|
234
236
|
showSearchIcon?: boolean;
|
|
@@ -449,6 +451,7 @@ declare type Option_2 = {
|
|
|
449
451
|
|
|
450
452
|
declare type Option_3 = {
|
|
451
453
|
label: string | ReactNode;
|
|
454
|
+
subLabel?: string | ReactNode;
|
|
452
455
|
leftIcon?: ReactNode | string;
|
|
453
456
|
value: string;
|
|
454
457
|
};
|
|
@@ -575,7 +578,7 @@ declare type Props_3<TData extends RowData> = CellContext<TData, string> & {
|
|
|
575
578
|
};
|
|
576
579
|
|
|
577
580
|
declare type Props_4<TData extends RowData_2> = VariantProps<typeof virtualizeTableVariants> & {
|
|
578
|
-
id: string;
|
|
581
|
+
id: string | string[];
|
|
579
582
|
ariaLabel?: string;
|
|
580
583
|
columns: ColumnDef_2<TData, string>[];
|
|
581
584
|
data: TData[];
|
|
@@ -585,7 +588,8 @@ declare type Props_4<TData extends RowData_2> = VariantProps<typeof virtualizeTa
|
|
|
585
588
|
classNameHeaderTable?: string;
|
|
586
589
|
classNameTable?: string;
|
|
587
590
|
classNameWrapperTable?: string;
|
|
588
|
-
|
|
591
|
+
queryOptions?: Omit<UseQueryOptions<any, any, any, any>, 'queryKey' | 'queryFn'>;
|
|
592
|
+
fetchData?: (params: Record<string, string | number | string[] | number[] | undefined>) => Promise<{
|
|
589
593
|
data: TData[];
|
|
590
594
|
totalItemsCount?: number;
|
|
591
595
|
}>;
|
package/dist/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@konstructio/ui",
|
|
3
3
|
"description": "A set of reusable and customizable React components built for konstruct.io",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.1.2-alpha.
|
|
5
|
+
"version": "0.1.2-alpha.15",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"cmdk": "^1.1.1",
|
|
73
73
|
"countries-and-timezones": "^3.8.0",
|
|
74
74
|
"js-cookie": "^3.0.5",
|
|
75
|
-
"lucide-react": "^0.
|
|
76
|
-
"react-chartjs-2": "^5.3.
|
|
75
|
+
"lucide-react": "^0.548.0",
|
|
76
|
+
"react-chartjs-2": "^5.3.1",
|
|
77
77
|
"react-day-picker": "^9.11.1",
|
|
78
78
|
"react-feather": "^2.0.10",
|
|
79
79
|
"react-focus-lock": "^2.13.6",
|
|
@@ -114,10 +114,10 @@
|
|
|
114
114
|
},
|
|
115
115
|
"devDependencies": {
|
|
116
116
|
"@faker-js/faker": "^10.1.0",
|
|
117
|
-
"@rollup/plugin-alias": "^
|
|
118
|
-
"@storybook/addon-docs": "^
|
|
119
|
-
"@storybook/addon-links": "^
|
|
120
|
-
"@storybook/react-vite": "^
|
|
117
|
+
"@rollup/plugin-alias": "^6.0.0",
|
|
118
|
+
"@storybook/addon-docs": "^10.0.0",
|
|
119
|
+
"@storybook/addon-links": "^10.0.0",
|
|
120
|
+
"@storybook/react-vite": "^10.0.0",
|
|
121
121
|
"@tailwindcss/vite": "^4.1.16",
|
|
122
122
|
"@tanstack/react-query": "^5.90.5",
|
|
123
123
|
"@testing-library/jest-dom": "^6.9.1",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"@types/react-dom": "^19.2.2",
|
|
131
131
|
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
132
132
|
"@typescript-eslint/parser": "^8.46.2",
|
|
133
|
-
"@vitejs/plugin-react": "^5.0
|
|
133
|
+
"@vitejs/plugin-react": "^5.1.0",
|
|
134
134
|
"@vitest/coverage-v8": "^3.2.4",
|
|
135
135
|
"autoprefixer": "^10.4.21",
|
|
136
136
|
"eslint": "^9.38.0",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"postcss": "^8.5.6",
|
|
148
148
|
"prettier": "^3.6.2",
|
|
149
149
|
"rimraf": "^6.0.1",
|
|
150
|
-
"storybook": "^
|
|
150
|
+
"storybook": "^10.0.0",
|
|
151
151
|
"tailwindcss": "^4.1.16",
|
|
152
152
|
"ts-node": "^10.9.2",
|
|
153
153
|
"typescript": "^5.9.3",
|