@konstructio/ui 0.1.1-alpha.6 → 0.1.2-alpha.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/dist/{Modal-V67Uz78z.js → Modal-B8jrP02v.js} +20 -20
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/{chevron-down-CVce9Mvh.js → chevron-down-MZvQoT2F.js} +2 -2
- package/dist/chevron-right-VYBOBhRt.js +19 -0
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +46 -54
- package/dist/components/Autocomplete/Autocomplete.variants.js +29 -48
- package/dist/components/Autocomplete/components/List/List.js +37 -47
- package/dist/components/Autocomplete/components/List/List.variants.js +34 -69
- package/dist/components/Badge/Badge.js +2 -2
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/components/Item/Item.js +24 -23
- package/dist/components/Button/Button.variants.js +110 -134
- package/dist/components/Checkbox/Checkbox.js +5 -4
- package/dist/components/Checkbox/Checkbox.variants.js +9 -8
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +2 -2
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +2 -2
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +949 -898
- package/dist/components/Dropdown/Dropdown.js +36 -24
- package/dist/components/Dropdown/Dropdown.variants.js +32 -14
- package/dist/components/Dropdown/components/List/List.js +59 -44
- package/dist/components/Dropdown/components/List/List.variants.js +9 -7
- package/dist/components/Dropdown/components/ListItem/ListItem.js +48 -24
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +9 -7
- package/dist/components/Dropdown/components/Wrapper.js +141 -106
- package/dist/components/Dropdown/contexts/dropdown.context.js +9 -8
- package/dist/components/Dropdown/contexts/dropdown.provider.js +20 -19
- package/dist/components/Dropdown/hooks/useDropdown.js +26 -27
- package/dist/components/Dropdown/hooks/useNavigationList.js +32 -28
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
- package/dist/components/Filter/components/ResetButton/ResetButton.js +16 -11
- package/dist/components/Input/Input.js +48 -48
- package/dist/components/Input/Input.variants.js +10 -10
- package/dist/components/Loading/Loading.js +2 -2
- package/dist/components/Loading/Loading.variants.js +4 -4
- package/dist/components/Modal/Modal.js +2 -2
- package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -3
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +2 -2
- package/dist/components/PieChart/PieChart.js +217 -215
- package/dist/components/Radio/Radio.variants.js +4 -4
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -28
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +94 -89
- package/dist/components/Switch/Switch.variants.js +16 -12
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +45 -24
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +9 -8
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +98 -49
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Toast/Toast.js +57 -55
- package/dist/components/VirtualizedTable/VirtualizedTable.js +117 -0
- package/dist/components/VirtualizedTable/VirtualizedTable.variants.js +5 -0
- package/dist/components/VirtualizedTable/assets/chevron-down.js +25 -0
- package/dist/components/VirtualizedTable/assets/chevron-up.js +25 -0
- package/dist/components/VirtualizedTable/assets/index.js +6 -0
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +46 -0
- package/dist/components/VirtualizedTable/components/Body/Body.js +25 -0
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +165 -0
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +34 -0
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +86 -0
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +48 -0
- package/dist/components/VirtualizedTable/components/Header/Header.js +82 -0
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +45 -0
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1871 -0
- package/dist/components/VirtualizedTable/components/index.js +14 -0
- package/dist/components/VirtualizedTable/constants/index.js +5 -0
- package/dist/components/VirtualizedTable/constants/pagination.js +5 -0
- package/dist/components/VirtualizedTable/contexts/index.js +8 -0
- package/dist/components/VirtualizedTable/contexts/table.context.js +31 -0
- package/dist/components/VirtualizedTable/contexts/table.hook.js +11 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +82 -0
- package/dist/components/index.js +44 -40
- package/dist/{createLucideIcon-BpsAkT97.js → createLucideIcon-D2CN7Ma9.js} +4 -4
- package/dist/debounce-BFejQm9P.js +200 -0
- package/dist/{index-D3xzCzcO.js → index-0XtjXVpJ.js} +2 -2
- package/dist/index-BAEWsOG1.js +27 -0
- package/dist/index-BVRIAMfe.js +36 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/{index-Oq5GlCHP.js → index-Bn4c-gww.js} +1 -1
- package/dist/index-CffpTFMi.js +137 -0
- package/dist/{index-BAraV3ai.js → index-DQJhMz8c.js} +1 -1
- package/dist/index-DdXGVVBv.js +15 -0
- package/dist/index-Dx2grAuN.js +1742 -0
- package/dist/{index-h-Ul0anl.js → index-N2OStZoU.js} +1 -1
- package/dist/{index-BXuxPoz7.js → index-amYX3uxF.js} +18 -17
- package/dist/{index-DB2XhXHn.js → index-l3NwplN0.js} +11 -10
- package/dist/{index-iXyXtdgP.js → index-sp5ZfG6g.js} +1 -1
- package/dist/index.d.ts +112 -10
- package/dist/index.js +41 -37
- package/dist/package.json +31 -23
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +204 -189
- package/dist/ui/kubefirst-theme.css +3 -1
- package/dist/ui/theme.css +2 -2
- package/dist/{x-BPcqkRZd.js → x-4F_5p77m.js} +1 -1
- package/package.json +31 -23
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/chevron-up-RLP4nX7V.js +0 -54
- package/dist/index-C9T9HQaa.js +0 -423
- package/dist/index-CZnD2QxM.js +0 -32
- package/dist/index-CrBonFvu.js +0 -144
|
@@ -1,86 +1,135 @@
|
|
|
1
1
|
import "../Item/Item.js";
|
|
2
|
-
import { List as
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { forwardRef as w, useId as
|
|
5
|
-
import { Tag as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { useTagSelect as
|
|
8
|
-
import { labelVariants as
|
|
9
|
-
import { X as
|
|
10
|
-
import {
|
|
11
|
-
import { useTagSelect as
|
|
12
|
-
|
|
2
|
+
import { List as j } from "../List/List.js";
|
|
3
|
+
import { jsxs as g, jsx as i } from "react/jsx-runtime";
|
|
4
|
+
import b, { forwardRef as w, useId as k, useImperativeHandle as T } from "react";
|
|
5
|
+
import { Tag as P } from "../../../Tag/Tag.js";
|
|
6
|
+
import { cn as l } from "../../../../utils/index.js";
|
|
7
|
+
import { useTagSelect as C } from "../../hooks/useTagSelect.js";
|
|
8
|
+
import { labelVariants as S, tagSelectVariants as z, wrapperVariants as R } from "../../TagSelect.variants.js";
|
|
9
|
+
import { X as _ } from "../../../../x-4F_5p77m.js";
|
|
10
|
+
import { P as p } from "../../../../index-N2OStZoU.js";
|
|
11
|
+
import { useTagSelect as I } from "../../contexts/TagSelect.hook.js";
|
|
12
|
+
function u() {
|
|
13
|
+
return u = Object.assign || function(e) {
|
|
14
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
15
|
+
var t = arguments[o];
|
|
16
|
+
for (var r in t)
|
|
17
|
+
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
|
|
18
|
+
}
|
|
19
|
+
return e;
|
|
20
|
+
}, u.apply(this, arguments);
|
|
21
|
+
}
|
|
22
|
+
function L(e, o) {
|
|
23
|
+
if (e == null) return {};
|
|
24
|
+
var t = W(e, o), r, n;
|
|
25
|
+
if (Object.getOwnPropertySymbols) {
|
|
26
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
27
|
+
for (n = 0; n < a.length; n++)
|
|
28
|
+
r = a[n], !(o.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
}
|
|
32
|
+
function W(e, o) {
|
|
33
|
+
if (e == null) return {};
|
|
34
|
+
var t = {}, r = Object.keys(e), n, a;
|
|
35
|
+
for (a = 0; a < r.length; a++)
|
|
36
|
+
n = r[a], !(o.indexOf(n) >= 0) && (t[n] = e[n]);
|
|
37
|
+
return t;
|
|
38
|
+
}
|
|
39
|
+
var d = w(function(e, o) {
|
|
40
|
+
var t = e.color, r = t === void 0 ? "currentColor" : t, n = e.size, a = n === void 0 ? 24 : n, c = L(e, ["color", "size"]);
|
|
41
|
+
return /* @__PURE__ */ b.createElement("svg", u({
|
|
42
|
+
ref: o,
|
|
43
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
44
|
+
width: a,
|
|
45
|
+
height: a,
|
|
46
|
+
viewBox: "0 0 24 24",
|
|
47
|
+
fill: "none",
|
|
48
|
+
stroke: r,
|
|
49
|
+
strokeWidth: "2",
|
|
50
|
+
strokeLinecap: "round",
|
|
51
|
+
strokeLinejoin: "round"
|
|
52
|
+
}, c), /* @__PURE__ */ b.createElement("polyline", {
|
|
53
|
+
points: "18 15 12 9 6 15"
|
|
54
|
+
}));
|
|
55
|
+
});
|
|
56
|
+
d.propTypes = {
|
|
57
|
+
color: p.string,
|
|
58
|
+
size: p.oneOfType([p.string, p.number])
|
|
59
|
+
};
|
|
60
|
+
d.displayName = "ChevronUp";
|
|
61
|
+
const G = w(
|
|
13
62
|
({
|
|
14
|
-
label:
|
|
15
|
-
labelClassName:
|
|
63
|
+
label: e,
|
|
64
|
+
labelClassName: o,
|
|
16
65
|
name: t,
|
|
17
|
-
placeholder:
|
|
18
|
-
theme:
|
|
19
|
-
wrapperClassName:
|
|
20
|
-
},
|
|
21
|
-
const
|
|
22
|
-
return
|
|
66
|
+
placeholder: r = "Select a value...",
|
|
67
|
+
theme: n,
|
|
68
|
+
wrapperClassName: a
|
|
69
|
+
}, c) => {
|
|
70
|
+
const h = k(), { selectedTags: v, isOpen: m, onOpen: x, onRemoveTag: y, inputRef: f } = I(), { wrapperRef: O, handleOpen: N } = C();
|
|
71
|
+
return T(c, () => f.current, [f]), /* @__PURE__ */ g(
|
|
23
72
|
"div",
|
|
24
73
|
{
|
|
25
|
-
ref:
|
|
26
|
-
className:
|
|
27
|
-
|
|
28
|
-
className:
|
|
74
|
+
ref: O,
|
|
75
|
+
className: l(
|
|
76
|
+
R({
|
|
77
|
+
className: a
|
|
29
78
|
})
|
|
30
79
|
),
|
|
31
|
-
"data-theme":
|
|
80
|
+
"data-theme": n,
|
|
32
81
|
children: [
|
|
33
|
-
|
|
82
|
+
e ? /* @__PURE__ */ i(
|
|
34
83
|
"label",
|
|
35
84
|
{
|
|
36
|
-
htmlFor: t ??
|
|
37
|
-
className:
|
|
38
|
-
|
|
39
|
-
className:
|
|
85
|
+
htmlFor: t ?? h,
|
|
86
|
+
className: l(
|
|
87
|
+
S({
|
|
88
|
+
className: o
|
|
40
89
|
})
|
|
41
90
|
),
|
|
42
|
-
onClick: () =>
|
|
43
|
-
children:
|
|
91
|
+
onClick: () => x(!0),
|
|
92
|
+
children: e
|
|
44
93
|
}
|
|
45
94
|
) : null,
|
|
46
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ g(
|
|
47
96
|
"div",
|
|
48
97
|
{
|
|
49
|
-
id: t ??
|
|
50
|
-
className:
|
|
98
|
+
id: t ?? h,
|
|
99
|
+
className: l(z()),
|
|
51
100
|
role: "combobox",
|
|
52
|
-
onClick:
|
|
53
|
-
"aria-expanded":
|
|
101
|
+
onClick: N,
|
|
102
|
+
"aria-expanded": m,
|
|
54
103
|
children: [
|
|
55
|
-
|
|
56
|
-
|
|
104
|
+
v.length === 0 ? /* @__PURE__ */ i("span", { className: "text-base text-inherit select-none", children: r }) : /* @__PURE__ */ i("div", { className: "flex flex-wrap gap-1.5", children: v.map((s) => /* @__PURE__ */ i(
|
|
105
|
+
P,
|
|
57
106
|
{
|
|
58
|
-
...
|
|
107
|
+
...s,
|
|
59
108
|
className: "select-none",
|
|
60
|
-
rightIcon: /* @__PURE__ */
|
|
61
|
-
"data-value":
|
|
109
|
+
rightIcon: /* @__PURE__ */ i(_, { className: "w-3 h-3", onClick: () => y(s) }),
|
|
110
|
+
"data-value": s.label
|
|
62
111
|
},
|
|
63
|
-
|
|
112
|
+
s.id
|
|
64
113
|
)) }),
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
|
|
114
|
+
/* @__PURE__ */ i(
|
|
115
|
+
d,
|
|
67
116
|
{
|
|
68
|
-
className:
|
|
117
|
+
className: l(
|
|
69
118
|
"w-4 h-4 text-inherit transition-all duration-50 shrink-0",
|
|
70
|
-
|
|
119
|
+
m ? "rotate-0" : "rotate-180"
|
|
71
120
|
)
|
|
72
121
|
}
|
|
73
122
|
)
|
|
74
123
|
]
|
|
75
124
|
}
|
|
76
125
|
),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
126
|
+
/* @__PURE__ */ i("input", { ref: f, type: "text", name: t, className: "hidden" }),
|
|
127
|
+
m ? /* @__PURE__ */ i(j, {}) : null
|
|
79
128
|
]
|
|
80
129
|
}
|
|
81
130
|
);
|
|
82
131
|
}
|
|
83
132
|
);
|
|
84
133
|
export {
|
|
85
|
-
|
|
134
|
+
G as Wrapper
|
|
86
135
|
};
|
|
@@ -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-MZvQoT2F.js";
|
|
7
7
|
import { useTimePickerContext as R } from "../../contexts/time-picker.hook.js";
|
|
8
8
|
const V = ({
|
|
9
9
|
name: d,
|
|
@@ -2,24 +2,26 @@ import { jsx as i, jsxs as A, Fragment as se } from "react/jsx-runtime";
|
|
|
2
2
|
import { u as ae, S as B } from "../../index-DQH6odE9.js";
|
|
3
3
|
import * as n from "react";
|
|
4
4
|
import { useRef as xe, useEffect as be, useMemo as oe, isValidElement as re, useCallback as ge } from "react";
|
|
5
|
-
import
|
|
6
|
-
import { c as
|
|
7
|
-
import { c as
|
|
8
|
-
import { B as
|
|
9
|
-
import { P as
|
|
5
|
+
import * as Se from "react-dom";
|
|
6
|
+
import { c as Ie, a as Ne, b as x, u as Ae } from "../../index-BfXxHr_2.js";
|
|
7
|
+
import { c as De } from "../../index-Cvx4lqTq.js";
|
|
8
|
+
import { B as Fe, R as _e } from "../../index-CffpTFMi.js";
|
|
9
|
+
import { P as Le } from "../../index-DdXGVVBv.js";
|
|
10
|
+
import { P as Me } from "../../index-C1g_chDT.js";
|
|
11
|
+
import { P as D, d as Oe } from "../../index-BVRIAMfe.js";
|
|
10
12
|
import { u as $ } from "../../index-0ioNhtNM.js";
|
|
11
|
-
import { V as ie, R as ke } from "../../index-
|
|
13
|
+
import { V as ie, R as ke } from "../../index-sp5ZfG6g.js";
|
|
12
14
|
import { cn as j } from "../../utils/index.js";
|
|
13
15
|
import { closeToastVariants as Ve, toastVariants as Ke, viewportToastVariants as He } from "./Toast.variants.js";
|
|
14
|
-
import { X as We } from "../../x-
|
|
15
|
-
var Q = "ToastProvider", [Z, Xe, $e] =
|
|
16
|
+
import { X as We } from "../../x-4F_5p77m.js";
|
|
17
|
+
var Q = "ToastProvider", [Z, Xe, $e] = De("Toast"), [ce, bt] = Ie("Toast", [$e]), [Ue, U] = ce(Q), ue = (e) => {
|
|
16
18
|
const {
|
|
17
19
|
__scopeToast: r,
|
|
18
20
|
label: o = "Notification",
|
|
19
21
|
duration: t = 5e3,
|
|
20
22
|
swipeDirection: c = "right",
|
|
21
23
|
swipeThreshold: d = 50,
|
|
22
|
-
children:
|
|
24
|
+
children: f
|
|
23
25
|
} = e, [T, v] = n.useState(null), [a, E] = n.useState(0), w = n.useRef(!1), S = n.useRef(!1);
|
|
24
26
|
return o.trim() || console.error(
|
|
25
27
|
`Invalid prop \`label\` supplied to \`${Q}\`. Expected non-empty \`string\`.`
|
|
@@ -38,7 +40,7 @@ var Q = "ToastProvider", [Z, Xe, $e] = Fe("Toast"), [ce, xt] = Ne("Toast", [$e])
|
|
|
38
40
|
onToastRemove: n.useCallback(() => E((b) => b - 1), []),
|
|
39
41
|
isFocusedToastEscapeKeyDownRef: w,
|
|
40
42
|
isClosePausedRef: S,
|
|
41
|
-
children:
|
|
43
|
+
children: f
|
|
42
44
|
}
|
|
43
45
|
) });
|
|
44
46
|
};
|
|
@@ -50,7 +52,7 @@ var le = "ToastViewport", Ye = ["F8"], z = "toast.viewportPause", G = "toast.vie
|
|
|
50
52
|
hotkey: t = Ye,
|
|
51
53
|
label: c = "Notifications ({hotkey})",
|
|
52
54
|
...d
|
|
53
|
-
} = e,
|
|
55
|
+
} = e, f = U(le, o), T = Xe(o), v = n.useRef(null), a = n.useRef(null), E = n.useRef(null), w = n.useRef(null), S = ae(r, w, f.onViewportChange), b = t.join("+").replace(/Key/g, "").replace(/Digit/g, ""), R = f.toastCount > 0;
|
|
54
56
|
n.useEffect(() => {
|
|
55
57
|
const u = (h) => {
|
|
56
58
|
t.length !== 0 && t.every((m) => h[m] || h.code === m) && w.current?.focus();
|
|
@@ -59,55 +61,55 @@ var le = "ToastViewport", Ye = ["F8"], z = "toast.viewportPause", G = "toast.vie
|
|
|
59
61
|
}, [t]), n.useEffect(() => {
|
|
60
62
|
const u = v.current, h = w.current;
|
|
61
63
|
if (R && u && h) {
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
64
|
+
const p = () => {
|
|
65
|
+
if (!f.isClosePausedRef.current) {
|
|
64
66
|
const y = new CustomEvent(z);
|
|
65
|
-
h.dispatchEvent(y),
|
|
67
|
+
h.dispatchEvent(y), f.isClosePausedRef.current = !0;
|
|
66
68
|
}
|
|
67
69
|
}, m = () => {
|
|
68
|
-
if (
|
|
70
|
+
if (f.isClosePausedRef.current) {
|
|
69
71
|
const y = new CustomEvent(G);
|
|
70
|
-
h.dispatchEvent(y),
|
|
72
|
+
h.dispatchEvent(y), f.isClosePausedRef.current = !1;
|
|
71
73
|
}
|
|
72
74
|
}, P = (y) => {
|
|
73
75
|
!u.contains(y.relatedTarget) && m();
|
|
74
76
|
}, C = () => {
|
|
75
77
|
u.contains(document.activeElement) || m();
|
|
76
78
|
};
|
|
77
|
-
return u.addEventListener("focusin",
|
|
78
|
-
u.removeEventListener("focusin",
|
|
79
|
+
return u.addEventListener("focusin", p), u.addEventListener("focusout", P), u.addEventListener("pointermove", p), u.addEventListener("pointerleave", C), window.addEventListener("blur", p), window.addEventListener("focus", m), () => {
|
|
80
|
+
u.removeEventListener("focusin", p), u.removeEventListener("focusout", P), u.removeEventListener("pointermove", p), u.removeEventListener("pointerleave", C), window.removeEventListener("blur", p), window.removeEventListener("focus", m);
|
|
79
81
|
};
|
|
80
82
|
}
|
|
81
|
-
}, [R,
|
|
83
|
+
}, [R, f.isClosePausedRef]);
|
|
82
84
|
const l = n.useCallback(
|
|
83
85
|
({ tabbingDirection: u }) => {
|
|
84
|
-
const
|
|
86
|
+
const p = T().map((m) => {
|
|
85
87
|
const P = m.ref.current, C = [P, ...nt(P)];
|
|
86
88
|
return u === "forwards" ? C : C.reverse();
|
|
87
89
|
});
|
|
88
|
-
return (u === "forwards" ?
|
|
90
|
+
return (u === "forwards" ? p.reverse() : p).flat();
|
|
89
91
|
},
|
|
90
92
|
[T]
|
|
91
93
|
);
|
|
92
94
|
return n.useEffect(() => {
|
|
93
95
|
const u = w.current;
|
|
94
96
|
if (u) {
|
|
95
|
-
const h = (
|
|
96
|
-
const m =
|
|
97
|
-
if (
|
|
98
|
-
const C = document.activeElement, y =
|
|
99
|
-
if (
|
|
97
|
+
const h = (p) => {
|
|
98
|
+
const m = p.altKey || p.ctrlKey || p.metaKey;
|
|
99
|
+
if (p.key === "Tab" && !m) {
|
|
100
|
+
const C = document.activeElement, y = p.shiftKey;
|
|
101
|
+
if (p.target === u && y) {
|
|
100
102
|
a.current?.focus();
|
|
101
103
|
return;
|
|
102
104
|
}
|
|
103
105
|
const _ = l({ tabbingDirection: y ? "backwards" : "forwards" }), V = _.findIndex((N) => N === C);
|
|
104
|
-
q(_.slice(V + 1)) ?
|
|
106
|
+
q(_.slice(V + 1)) ? p.preventDefault() : y ? a.current?.focus() : E.current?.focus();
|
|
105
107
|
}
|
|
106
108
|
};
|
|
107
109
|
return u.addEventListener("keydown", h), () => u.removeEventListener("keydown", h);
|
|
108
110
|
}
|
|
109
111
|
}, [T, l]), /* @__PURE__ */ A(
|
|
110
|
-
|
|
112
|
+
Fe,
|
|
111
113
|
{
|
|
112
114
|
ref: v,
|
|
113
115
|
role: "region",
|
|
@@ -146,9 +148,9 @@ var le = "ToastViewport", Ye = ["F8"], z = "toast.viewportPause", G = "toast.vie
|
|
|
146
148
|
}
|
|
147
149
|
);
|
|
148
150
|
de.displayName = le;
|
|
149
|
-
var
|
|
151
|
+
var fe = "ToastFocusProxy", J = n.forwardRef(
|
|
150
152
|
(e, r) => {
|
|
151
|
-
const { __scopeToast: o, onFocusFromOutsideViewport: t, ...c } = e, d = U(
|
|
153
|
+
const { __scopeToast: o, onFocusFromOutsideViewport: t, ...c } = e, d = U(fe, o);
|
|
152
154
|
return /* @__PURE__ */ i(
|
|
153
155
|
ie,
|
|
154
156
|
{
|
|
@@ -156,28 +158,28 @@ var pe = "ToastFocusProxy", J = n.forwardRef(
|
|
|
156
158
|
...c,
|
|
157
159
|
ref: r,
|
|
158
160
|
style: { position: "fixed" },
|
|
159
|
-
onFocus: (
|
|
160
|
-
const T =
|
|
161
|
+
onFocus: (f) => {
|
|
162
|
+
const T = f.relatedTarget;
|
|
161
163
|
!d.viewport?.contains(T) && t();
|
|
162
164
|
}
|
|
163
165
|
}
|
|
164
166
|
);
|
|
165
167
|
}
|
|
166
168
|
);
|
|
167
|
-
J.displayName =
|
|
168
|
-
var O = "Toast", Be = "toast.swipeStart", je = "toast.swipeMove", qe = "toast.swipeCancel", ze = "toast.swipeEnd",
|
|
169
|
+
J.displayName = fe;
|
|
170
|
+
var O = "Toast", Be = "toast.swipeStart", je = "toast.swipeMove", qe = "toast.swipeCancel", ze = "toast.swipeEnd", pe = n.forwardRef(
|
|
169
171
|
(e, r) => {
|
|
170
|
-
const { forceMount: o, open: t, defaultOpen: c, onOpenChange: d, ...
|
|
172
|
+
const { forceMount: o, open: t, defaultOpen: c, onOpenChange: d, ...f } = e, [T, v] = Ne({
|
|
171
173
|
prop: t,
|
|
172
174
|
defaultProp: c ?? !0,
|
|
173
175
|
onChange: d,
|
|
174
176
|
caller: O
|
|
175
177
|
});
|
|
176
|
-
return /* @__PURE__ */ i(
|
|
178
|
+
return /* @__PURE__ */ i(Me, { present: o || T, children: /* @__PURE__ */ i(
|
|
177
179
|
Qe,
|
|
178
180
|
{
|
|
179
181
|
open: T,
|
|
180
|
-
...
|
|
182
|
+
...f,
|
|
181
183
|
ref: r,
|
|
182
184
|
onClose: () => v(!1),
|
|
183
185
|
onPause: $(e.onPause),
|
|
@@ -200,7 +202,7 @@ var O = "Toast", Be = "toast.swipeStart", je = "toast.swipeMove", qe = "toast.sw
|
|
|
200
202
|
) });
|
|
201
203
|
}
|
|
202
204
|
);
|
|
203
|
-
|
|
205
|
+
pe.displayName = O;
|
|
204
206
|
var [Ge, Je] = ce(O, {
|
|
205
207
|
onClose() {
|
|
206
208
|
}
|
|
@@ -211,7 +213,7 @@ var [Ge, Je] = ce(O, {
|
|
|
211
213
|
type: t = "foreground",
|
|
212
214
|
duration: c,
|
|
213
215
|
open: d,
|
|
214
|
-
onClose:
|
|
216
|
+
onClose: f,
|
|
215
217
|
onEscapeKeyDown: T,
|
|
216
218
|
onPause: v,
|
|
217
219
|
onResume: a,
|
|
@@ -220,8 +222,8 @@ var [Ge, Je] = ce(O, {
|
|
|
220
222
|
onSwipeCancel: S,
|
|
221
223
|
onSwipeEnd: b,
|
|
222
224
|
...R
|
|
223
|
-
} = e, l = U(O, o), [u, h] = n.useState(null),
|
|
224
|
-
u?.contains(document.activeElement) && l.viewport?.focus(),
|
|
225
|
+
} = e, l = U(O, o), [u, h] = n.useState(null), p = ae(r, (s) => h(s)), m = n.useRef(null), P = n.useRef(null), C = c || l.duration, y = n.useRef(0), F = n.useRef(C), k = n.useRef(0), { onToastAdd: _, onToastRemove: V } = l, N = $(() => {
|
|
226
|
+
u?.contains(document.activeElement) && l.viewport?.focus(), f();
|
|
225
227
|
}), K = n.useCallback(
|
|
226
228
|
(s) => {
|
|
227
229
|
!s || s === 1 / 0 || (window.clearTimeout(k.current), y.current = (/* @__PURE__ */ new Date()).getTime(), k.current = window.setTimeout(N, s));
|
|
@@ -257,7 +259,7 @@ var [Ge, Je] = ce(O, {
|
|
|
257
259
|
),
|
|
258
260
|
/* @__PURE__ */ i(Ge, { scope: o, onClose: N, children: Se.createPortal(
|
|
259
261
|
/* @__PURE__ */ i(Z.ItemSlot, { scope: o, children: /* @__PURE__ */ i(
|
|
260
|
-
|
|
262
|
+
_e,
|
|
261
263
|
{
|
|
262
264
|
asChild: !0,
|
|
263
265
|
onEscapeKeyDown: x(T, () => {
|
|
@@ -270,7 +272,7 @@ var [Ge, Je] = ce(O, {
|
|
|
270
272
|
"data-state": d ? "open" : "closed",
|
|
271
273
|
"data-swipe-direction": l.swipeDirection,
|
|
272
274
|
...R,
|
|
273
|
-
ref:
|
|
275
|
+
ref: p,
|
|
274
276
|
style: { userSelect: "none", touchAction: "none", ...e.style },
|
|
275
277
|
onKeyDown: x(e.onKeyDown, (s) => {
|
|
276
278
|
s.key === "Escape" && (T?.(s.nativeEvent), s.nativeEvent.defaultPrevented || (l.isFocusedToastEscapeKeyDownRef.current = !0, N()));
|
|
@@ -314,11 +316,11 @@ var [Ge, Je] = ce(O, {
|
|
|
314
316
|
] }) : null;
|
|
315
317
|
}
|
|
316
318
|
), Ze = (e) => {
|
|
317
|
-
const { __scopeToast: r, children: o, ...t } = e, c = U(O, r), [d,
|
|
318
|
-
return ot(() =>
|
|
319
|
+
const { __scopeToast: r, children: o, ...t } = e, c = U(O, r), [d, f] = n.useState(!1), [T, v] = n.useState(!1);
|
|
320
|
+
return ot(() => f(!0)), n.useEffect(() => {
|
|
319
321
|
const a = window.setTimeout(() => v(!0), 1e3);
|
|
320
322
|
return () => window.clearTimeout(a);
|
|
321
|
-
}, []), T ? null : /* @__PURE__ */ i(
|
|
323
|
+
}, []), T ? null : /* @__PURE__ */ i(Le, { asChild: !0, children: /* @__PURE__ */ i(ie, { ...t, children: d && /* @__PURE__ */ A(se, { children: [
|
|
322
324
|
c.label,
|
|
323
325
|
" ",
|
|
324
326
|
o
|
|
@@ -380,8 +382,8 @@ function Pe(e) {
|
|
|
380
382
|
const c = t.ariaHidden || t.hidden || t.style.display === "none", d = t.dataset.radixToastAnnounceExclude === "";
|
|
381
383
|
if (!c)
|
|
382
384
|
if (d) {
|
|
383
|
-
const
|
|
384
|
-
|
|
385
|
+
const f = t.dataset.radixToastAnnounceAlt;
|
|
386
|
+
f && r.push(f);
|
|
385
387
|
} else
|
|
386
388
|
r.push(...Pe(t));
|
|
387
389
|
}
|
|
@@ -389,7 +391,7 @@ function Pe(e) {
|
|
|
389
391
|
}
|
|
390
392
|
function X(e, r, o, { discrete: t }) {
|
|
391
393
|
const c = o.originalEvent.currentTarget, d = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: o });
|
|
392
|
-
r && c.addEventListener(e, r, { once: !0 }), t ?
|
|
394
|
+
r && c.addEventListener(e, r, { once: !0 }), t ? Oe(c, d) : c.dispatchEvent(d);
|
|
393
395
|
}
|
|
394
396
|
var ne = (e, r, o = 0) => {
|
|
395
397
|
const t = Math.abs(e.x), c = Math.abs(e.y), d = t > c;
|
|
@@ -398,7 +400,7 @@ var ne = (e, r, o = 0) => {
|
|
|
398
400
|
function ot(e = () => {
|
|
399
401
|
}) {
|
|
400
402
|
const r = $(e);
|
|
401
|
-
|
|
403
|
+
Ae(() => {
|
|
402
404
|
let o = 0, t = 0;
|
|
403
405
|
return o = window.requestAnimationFrame(() => t = window.requestAnimationFrame(r)), () => {
|
|
404
406
|
window.cancelAnimationFrame(o), window.cancelAnimationFrame(t);
|
|
@@ -422,15 +424,15 @@ function q(e) {
|
|
|
422
424
|
const r = document.activeElement;
|
|
423
425
|
return e.some((o) => o === r ? !0 : (o.focus(), document.activeElement !== r));
|
|
424
426
|
}
|
|
425
|
-
var st = ue, at = de, it =
|
|
426
|
-
const
|
|
427
|
+
var st = ue, at = de, it = pe, ct = me, ut = Te, lt = ve;
|
|
428
|
+
const gt = ({
|
|
427
429
|
title: e,
|
|
428
430
|
duration: r = 5e3,
|
|
429
431
|
titleClassName: o,
|
|
430
432
|
descriptionClassName: t,
|
|
431
433
|
description: c,
|
|
432
434
|
children: d,
|
|
433
|
-
theme:
|
|
435
|
+
theme: f,
|
|
434
436
|
showCloseButton: T = !0,
|
|
435
437
|
closeButtonClassName: v,
|
|
436
438
|
className: a,
|
|
@@ -448,7 +450,7 @@ const bt = ({
|
|
|
448
450
|
it,
|
|
449
451
|
{
|
|
450
452
|
className: j(Ke({ className: a })),
|
|
451
|
-
"data-theme":
|
|
453
|
+
"data-theme": f,
|
|
452
454
|
open: E,
|
|
453
455
|
onOpenChange: w,
|
|
454
456
|
children: [
|
|
@@ -474,5 +476,5 @@ const bt = ({
|
|
|
474
476
|
] });
|
|
475
477
|
};
|
|
476
478
|
export {
|
|
477
|
-
|
|
479
|
+
gt as Toast
|
|
478
480
|
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as H } from "react";
|
|
3
|
+
import { cn as s } from "../../utils/index.js";
|
|
4
|
+
import { TableProvider as I } from "./contexts/table.provider.js";
|
|
5
|
+
import { Filter as K } from "./components/Filter/Filter.js";
|
|
6
|
+
import { Header as M } from "./components/Header/Header.js";
|
|
7
|
+
import { Body as P } from "./components/Body/Body.js";
|
|
8
|
+
import { Pagination as k } from "./components/Pagination/Pagination.js";
|
|
9
|
+
import { TruncateText as q } from "./components/TruncateText/TruncateText.js";
|
|
10
|
+
import { Actions as C } from "./components/Actions/Actions.js";
|
|
11
|
+
const E = ({
|
|
12
|
+
id: c,
|
|
13
|
+
ariaLabel: n,
|
|
14
|
+
columns: d,
|
|
15
|
+
data: f,
|
|
16
|
+
totalItems: p = -1 / 0,
|
|
17
|
+
className: u,
|
|
18
|
+
classNameHeaderActiveArrows: b,
|
|
19
|
+
classNameHeaderArrows: T,
|
|
20
|
+
classNameHeaderTable: N,
|
|
21
|
+
classNameTable: h,
|
|
22
|
+
classNameWrapperTable: x,
|
|
23
|
+
fetchData: A,
|
|
24
|
+
// Pagination
|
|
25
|
+
showPagination: v,
|
|
26
|
+
showTotalItems: o,
|
|
27
|
+
showDropdownPagination: i,
|
|
28
|
+
showDotPagination: a,
|
|
29
|
+
showFormPagination: l,
|
|
30
|
+
pageSizes: y,
|
|
31
|
+
// Filter
|
|
32
|
+
showFilter: z = !1,
|
|
33
|
+
showFilterInput: V,
|
|
34
|
+
filterSearchPlaceholder: g = "",
|
|
35
|
+
multiSelectFilter: j,
|
|
36
|
+
filterActions: w,
|
|
37
|
+
showResetButton: B = !0
|
|
38
|
+
}) => {
|
|
39
|
+
const t = H(
|
|
40
|
+
() => v || [
|
|
41
|
+
o,
|
|
42
|
+
i,
|
|
43
|
+
a,
|
|
44
|
+
l
|
|
45
|
+
].some(Boolean),
|
|
46
|
+
[]
|
|
47
|
+
);
|
|
48
|
+
return /* @__PURE__ */ r(
|
|
49
|
+
I,
|
|
50
|
+
{
|
|
51
|
+
id: c,
|
|
52
|
+
columns: d,
|
|
53
|
+
data: f,
|
|
54
|
+
fetchData: A,
|
|
55
|
+
totalItems: p,
|
|
56
|
+
children: /* @__PURE__ */ m("section", { className: u, children: [
|
|
57
|
+
z && /* @__PURE__ */ r(
|
|
58
|
+
K,
|
|
59
|
+
{
|
|
60
|
+
actions: w,
|
|
61
|
+
multiSelectFilter: j,
|
|
62
|
+
placeholder: g,
|
|
63
|
+
showFilterInput: V,
|
|
64
|
+
showResetButton: B
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ r(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
className: s(
|
|
71
|
+
"shadow rounded-t-lg",
|
|
72
|
+
{
|
|
73
|
+
"overflow-hidden rounded-lg": !t
|
|
74
|
+
},
|
|
75
|
+
x
|
|
76
|
+
),
|
|
77
|
+
children: /* @__PURE__ */ m(
|
|
78
|
+
"table",
|
|
79
|
+
{
|
|
80
|
+
className: s("w-full border-collapse", h),
|
|
81
|
+
"aria-label": n,
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ r(
|
|
84
|
+
M,
|
|
85
|
+
{
|
|
86
|
+
className: N,
|
|
87
|
+
classNameArrows: T,
|
|
88
|
+
classNameActiveArrows: b
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ r(P, {})
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
t && /* @__PURE__ */ r(
|
|
98
|
+
k,
|
|
99
|
+
{
|
|
100
|
+
showTotalItems: o,
|
|
101
|
+
showDropdownPagination: i,
|
|
102
|
+
showDotPagination: a,
|
|
103
|
+
showFormPagination: l,
|
|
104
|
+
pageSizes: y
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
] })
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}, e = E;
|
|
111
|
+
e.displayName = "KonstructVirtualizedTable";
|
|
112
|
+
e.TruncateText = q;
|
|
113
|
+
e.Actions = C;
|
|
114
|
+
export {
|
|
115
|
+
q as TruncateText,
|
|
116
|
+
e as VirtualizedTable
|
|
117
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
const l = ({
|
|
3
|
+
className: t,
|
|
4
|
+
onClick: e
|
|
5
|
+
}) => /* @__PURE__ */ o(
|
|
6
|
+
"svg",
|
|
7
|
+
{
|
|
8
|
+
width: "7",
|
|
9
|
+
height: "5",
|
|
10
|
+
viewBox: "0 0 7 5",
|
|
11
|
+
fill: "none",
|
|
12
|
+
className: t,
|
|
13
|
+
onClick: e,
|
|
14
|
+
children: /* @__PURE__ */ o(
|
|
15
|
+
"path",
|
|
16
|
+
{
|
|
17
|
+
d: "M0.8225 0L3.5 2.67167L6.1775 0L7 0.8225L3.5 4.3225L0 0.8225L0.8225 0Z",
|
|
18
|
+
fill: "currentColor"
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
export {
|
|
24
|
+
l as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
const l = ({
|
|
3
|
+
className: r,
|
|
4
|
+
onClick: t
|
|
5
|
+
}) => /* @__PURE__ */ o(
|
|
6
|
+
"svg",
|
|
7
|
+
{
|
|
8
|
+
width: "7",
|
|
9
|
+
height: "5",
|
|
10
|
+
viewBox: "0 0 7 5",
|
|
11
|
+
fill: "currentColor",
|
|
12
|
+
className: r,
|
|
13
|
+
onClick: t,
|
|
14
|
+
children: /* @__PURE__ */ o(
|
|
15
|
+
"path",
|
|
16
|
+
{
|
|
17
|
+
d: "M0.8225 4.99999L3.5 2.32832L6.1775 4.99999L7 4.17749L3.5 0.67749L0 4.17749L0.8225 4.99999Z",
|
|
18
|
+
fill: "currentColor"
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
export {
|
|
24
|
+
l as default
|
|
25
|
+
};
|