@konstructio/ui 0.1.2-alpha.3 → 0.1.2-alpha.5
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-D-NOEWMX.js} +3 -3
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/{chevron-down-BLZPftpV.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/Badge/Badge.js +2 -2
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/components/Item/Item.js +16 -15
- package/dist/components/Checkbox/Checkbox.js +5 -4
- 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 +545 -543
- package/dist/components/Dropdown/Dropdown.js +36 -24
- package/dist/components/Dropdown/Dropdown.variants.js +25 -7
- 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/Input/Input.js +1 -1
- package/dist/components/Loading/Loading.js +2 -2
- 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/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 +6 -5
- 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 +8 -7
- package/dist/components/VirtualizedTable/VirtualizedTable.js +99 -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 +73 -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 +1870 -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 +778 -0
- package/dist/components/index.js +44 -40
- package/dist/{createLucideIcon-DbC6TvM5.js → createLucideIcon-D2CN7Ma9.js} +4 -4
- package/dist/debounce-BFejQm9P.js +200 -0
- package/dist/{index-D3xzCzcO.js → index-B7t8D14s.js} +2 -2
- package/dist/index-BAEWsOG1.js +27 -0
- package/dist/{index-C9T9HQaa.js → index-BITvcJAz.js} +1 -1
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/{index-BAraV3ai.js → index-Bnb0ezr3.js} +1 -1
- package/dist/{index-DB2XhXHn.js → index-C84F4YyO.js} +11 -10
- package/dist/index-Cd2vhaop.js +137 -0
- package/dist/{index-iXyXtdgP.js → index-DBbEcSUG.js} +1 -1
- package/dist/index-Dx2grAuN.js +1742 -0
- package/dist/{index-BXuxPoz7.js → index-DzIBBMjs.js} +18 -17
- package/dist/{index-h-Ul0anl.js → index-N2OStZoU.js} +1 -1
- package/dist/{index-Oq5GlCHP.js → index-os7vysFS.js} +1 -1
- package/dist/index-ti1b9kqV.js +14 -0
- package/dist/index.d.ts +94 -5
- package/dist/index.js +41 -37
- package/dist/package.json +26 -22
- package/dist/styles.css +1 -1
- package/dist/{x-BPcqkRZd.js → x-4F_5p77m.js} +1 -1
- package/package.json +26 -22
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/chevron-up-RLP4nX7V.js +0 -54
- package/dist/index-CZnD2QxM.js +0 -32
- package/dist/index-CrBonFvu.js +0 -144
|
@@ -1,131 +1,163 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Loading as
|
|
4
|
-
import { Typography as
|
|
1
|
+
import { jsxs as p, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as K, useId as Q, useRef as R, useImperativeHandle as S, useMemo as X, useEffect as g } from "react";
|
|
3
|
+
import { Loading as Y } from "../../Loading/Loading.js";
|
|
4
|
+
import { Typography as Z } from "../../Typography/Typography.js";
|
|
5
5
|
import { cn as s } from "../../../utils/index.js";
|
|
6
|
-
import { labelVariants as
|
|
7
|
-
import { useDropdown as
|
|
8
|
-
import { List as
|
|
9
|
-
import {
|
|
10
|
-
import { useDropdownContext as
|
|
11
|
-
|
|
6
|
+
import { labelVariants as B, inputVariants as ee, dropdownVariants as te } from "../Dropdown.variants.js";
|
|
7
|
+
import { useDropdown as ae } from "../hooks/useDropdown.js";
|
|
8
|
+
import { List as re } from "./List/List.js";
|
|
9
|
+
import { c as T } from "../../../createLucideIcon-D2CN7Ma9.js";
|
|
10
|
+
import { useDropdownContext as ne } from "../contexts/dropdown.hook.js";
|
|
11
|
+
/**
|
|
12
|
+
* @license lucide-react v0.545.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/
|
|
17
|
+
const le = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], oe = T("chevron-up", le);
|
|
18
|
+
/**
|
|
19
|
+
* @license lucide-react v0.545.0 - ISC
|
|
20
|
+
*
|
|
21
|
+
* This source code is licensed under the ISC license.
|
|
22
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
23
|
+
*/
|
|
24
|
+
const se = [
|
|
25
|
+
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
26
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
27
|
+
], ce = T("search", se), we = K(
|
|
12
28
|
({
|
|
13
|
-
|
|
14
|
-
|
|
29
|
+
additionalOptions: V,
|
|
30
|
+
className: _,
|
|
31
|
+
defaultValue: x,
|
|
15
32
|
error: f,
|
|
16
|
-
iconClassName:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
iconClassName: $,
|
|
34
|
+
inputClassName: D,
|
|
35
|
+
isLoading: L,
|
|
36
|
+
isRequired: h,
|
|
37
|
+
label: v,
|
|
38
|
+
labelClassName: F,
|
|
39
|
+
listClassName: M,
|
|
40
|
+
listItemClassName: A,
|
|
41
|
+
name: c,
|
|
42
|
+
options: n,
|
|
43
|
+
placeholder: N,
|
|
44
|
+
searchable: w = !1,
|
|
45
|
+
showSearchIcon: C,
|
|
46
|
+
theme: H,
|
|
47
|
+
wrapperClassName: P,
|
|
48
|
+
onBlur: j,
|
|
49
|
+
...z
|
|
50
|
+
}, U) => {
|
|
51
|
+
const I = Q(), t = R(null), E = R(null), { wrapperRef: i, wrapperInputRef: O, handleOpen: k } = ae({
|
|
52
|
+
ulRef: E,
|
|
53
|
+
inputRef: t
|
|
54
|
+
}), { isOpen: m, searchTerm: W, value: l, toggleOpen: q, setValue: y, setSearchTerm: b } = ne(), d = c ? `${I}-${c}` : I;
|
|
55
|
+
S(U, () => t.current, [t]);
|
|
56
|
+
const r = X(() => n.find(({ value: e }) => e === l), [n, l]);
|
|
57
|
+
g(() => {
|
|
58
|
+
t.current && (t.current.value = l ? r?.value : "");
|
|
59
|
+
}, [r, l]), g(() => {
|
|
60
|
+
if (x && !l) {
|
|
61
|
+
const e = n && n.find((o) => o.value === x);
|
|
62
|
+
e && y(e.value);
|
|
40
63
|
}
|
|
41
|
-
}, [
|
|
64
|
+
}, [x, n, y, l]), g(() => {
|
|
42
65
|
const e = new AbortController();
|
|
43
|
-
return
|
|
44
|
-
const
|
|
45
|
-
(!
|
|
66
|
+
return i.current?.addEventListener("focusout", (o) => {
|
|
67
|
+
const u = o.relatedTarget;
|
|
68
|
+
(!u || !i.current?.contains(u)) && (b(""), t.current?.value || j?.());
|
|
46
69
|
}), () => {
|
|
47
70
|
e.abort();
|
|
48
71
|
};
|
|
49
|
-
}, [
|
|
50
|
-
const
|
|
72
|
+
}, [q, i, b, j, l]);
|
|
73
|
+
const G = (e) => {
|
|
51
74
|
const o = e.target.value;
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
(
|
|
75
|
+
b(o);
|
|
76
|
+
const u = n.find(
|
|
77
|
+
(J) => J.value.toLocaleLowerCase() === o.toLocaleLowerCase()
|
|
55
78
|
);
|
|
56
|
-
|
|
79
|
+
u && y(u.value);
|
|
57
80
|
};
|
|
58
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ p(
|
|
59
82
|
"div",
|
|
60
83
|
{
|
|
61
|
-
ref:
|
|
62
|
-
className: s("flex flex-col w-full relative",
|
|
63
|
-
"data-theme":
|
|
84
|
+
ref: i,
|
|
85
|
+
className: s("flex flex-col w-full relative", P),
|
|
86
|
+
"data-theme": H,
|
|
64
87
|
children: [
|
|
65
|
-
|
|
88
|
+
v ? /* @__PURE__ */ p(
|
|
66
89
|
"label",
|
|
67
90
|
{
|
|
68
|
-
id:
|
|
69
|
-
className: s(
|
|
70
|
-
htmlFor:
|
|
71
|
-
onClick:
|
|
91
|
+
id: d,
|
|
92
|
+
className: s(B({ className: F })),
|
|
93
|
+
htmlFor: d,
|
|
94
|
+
onClick: k,
|
|
72
95
|
children: [
|
|
73
|
-
|
|
74
|
-
|
|
96
|
+
v,
|
|
97
|
+
h && /* @__PURE__ */ a("span", { className: "text-red-600 ml-1", children: "*" })
|
|
75
98
|
]
|
|
76
99
|
}
|
|
77
100
|
) : null,
|
|
78
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ p(
|
|
79
102
|
"div",
|
|
80
103
|
{
|
|
81
|
-
ref:
|
|
82
|
-
id:
|
|
83
|
-
className: s(
|
|
104
|
+
ref: O,
|
|
105
|
+
id: d,
|
|
106
|
+
className: s(te({ className: _, hasError: !!f })),
|
|
84
107
|
role: "combobox",
|
|
85
|
-
onClick:
|
|
86
|
-
"aria-expanded":
|
|
108
|
+
onClick: k,
|
|
109
|
+
"aria-expanded": m,
|
|
87
110
|
tabIndex: 0,
|
|
88
|
-
"aria-labelledby":
|
|
111
|
+
"aria-labelledby": d,
|
|
89
112
|
children: [
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
|
|
92
|
-
|
|
113
|
+
/* @__PURE__ */ p("div", { className: "flex gap-2.5 items-center flex-1", children: [
|
|
114
|
+
r?.leftIcon && !C && /* @__PURE__ */ a("span", { className: "w-4 h-4 flex justify-center items-center dark:text-slate-50", children: r.leftIcon }),
|
|
115
|
+
C && /* @__PURE__ */ a(ce, { className: "w-4 h-4 text-zinc-500 select-none dark:text-slate-300 dark:group-focus-within:text-slate-50 transition-colors duration-300" }),
|
|
116
|
+
w ? /* @__PURE__ */ a(
|
|
93
117
|
"input",
|
|
94
118
|
{
|
|
119
|
+
ref: t,
|
|
95
120
|
type: "text",
|
|
96
|
-
value:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
),
|
|
121
|
+
value: m ? W : r?.label || "",
|
|
122
|
+
name: c,
|
|
123
|
+
onChange: G,
|
|
124
|
+
placeholder: N,
|
|
125
|
+
className: s(ee({ className: D }), {
|
|
126
|
+
"text-red-700 placeholder:text-red-700": !!f
|
|
127
|
+
}),
|
|
105
128
|
onClick: (e) => {
|
|
106
|
-
e.stopPropagation(),
|
|
129
|
+
e.stopPropagation(), k();
|
|
107
130
|
},
|
|
108
|
-
"aria-label":
|
|
109
|
-
"aria-labelledby":
|
|
131
|
+
"aria-label": v || N,
|
|
132
|
+
"aria-labelledby": d,
|
|
133
|
+
required: h,
|
|
134
|
+
autoComplete: "off",
|
|
135
|
+
autoCapitalize: "words",
|
|
136
|
+
...z
|
|
110
137
|
}
|
|
111
|
-
) : /* @__PURE__ */
|
|
112
|
-
|
|
138
|
+
) : /* @__PURE__ */ a(
|
|
139
|
+
Z,
|
|
113
140
|
{
|
|
114
141
|
variant: "body2",
|
|
115
|
-
className: s(
|
|
116
|
-
"text-
|
|
117
|
-
|
|
118
|
-
|
|
142
|
+
className: s(
|
|
143
|
+
"flex-1 text-zinc-400 text-sm dark:text-slate-400",
|
|
144
|
+
{
|
|
145
|
+
"text-red-700": !!f,
|
|
146
|
+
"select-none": !r,
|
|
147
|
+
"text-slate-800 dark:text-slate-50": r
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
children: r?.label || N
|
|
119
151
|
}
|
|
120
152
|
)
|
|
121
153
|
] }),
|
|
122
|
-
|
|
123
|
-
|
|
154
|
+
L ? /* @__PURE__ */ a(Y, { className: "w-4 h-4 text-zinc-500 select-none" }) : !C && /* @__PURE__ */ a(
|
|
155
|
+
oe,
|
|
124
156
|
{
|
|
125
|
-
"data-state":
|
|
157
|
+
"data-state": m ? "open" : "closed",
|
|
126
158
|
className: s(
|
|
127
|
-
"w-4 h-4 text-zinc-500 transition-all duration-
|
|
128
|
-
|
|
159
|
+
"w-4 h-4 text-zinc-500 transition-all duration-100 data-[state=open]:rotate-0 data-[state=closed]:rotate-180 select-none dark:group-focus-within:text-slate-50",
|
|
160
|
+
$,
|
|
129
161
|
{
|
|
130
162
|
"text-red-700": !!f
|
|
131
163
|
}
|
|
@@ -135,29 +167,32 @@ const fe = W(
|
|
|
135
167
|
]
|
|
136
168
|
}
|
|
137
169
|
),
|
|
138
|
-
/* @__PURE__ */
|
|
170
|
+
!w && /* @__PURE__ */ a(
|
|
139
171
|
"input",
|
|
140
172
|
{
|
|
141
|
-
ref:
|
|
173
|
+
ref: t,
|
|
142
174
|
type: "text",
|
|
143
|
-
name:
|
|
175
|
+
name: c,
|
|
144
176
|
className: "hidden",
|
|
145
177
|
"aria-hidden": "true",
|
|
146
|
-
required:
|
|
178
|
+
required: h,
|
|
179
|
+
...z
|
|
147
180
|
}
|
|
148
181
|
),
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
|
|
182
|
+
m && /* @__PURE__ */ a(
|
|
183
|
+
re,
|
|
151
184
|
{
|
|
152
|
-
ref:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
185
|
+
ref: E,
|
|
186
|
+
additionalOptions: V,
|
|
187
|
+
className: M,
|
|
188
|
+
itemClassName: A,
|
|
189
|
+
name: c,
|
|
190
|
+
wrapperRef: i,
|
|
191
|
+
wrapperInputRef: O,
|
|
192
|
+
inputRef: t,
|
|
193
|
+
options: n,
|
|
194
|
+
isLoading: !!L,
|
|
195
|
+
searchable: w
|
|
161
196
|
}
|
|
162
197
|
)
|
|
163
198
|
]
|
|
@@ -166,5 +201,5 @@ const fe = W(
|
|
|
166
201
|
}
|
|
167
202
|
);
|
|
168
203
|
export {
|
|
169
|
-
|
|
204
|
+
we as Wrapper
|
|
170
205
|
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { createContext as e } from "react";
|
|
2
|
-
const
|
|
2
|
+
const t = e({
|
|
3
|
+
highlightSearchEnabled: !1,
|
|
3
4
|
isOpen: !1,
|
|
4
|
-
|
|
5
|
-
throw new Error("toggleOpen function must be overridden");
|
|
6
|
-
},
|
|
5
|
+
searchTerm: "",
|
|
7
6
|
value: void 0,
|
|
7
|
+
setSearchTerm() {
|
|
8
|
+
throw new Error("setSearchTerm function must be overridden");
|
|
9
|
+
},
|
|
8
10
|
setValue() {
|
|
9
11
|
throw new Error("setValue function must be overridden");
|
|
10
12
|
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
throw new Error("setSearchTerm function must be overridden");
|
|
13
|
+
toggleOpen() {
|
|
14
|
+
throw new Error("toggleOpen function must be overridden");
|
|
14
15
|
}
|
|
15
16
|
});
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
+
t as DropdownContext
|
|
18
19
|
};
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { DropdownContext as
|
|
4
|
-
import { useToggle as
|
|
5
|
-
const
|
|
6
|
-
const [
|
|
7
|
-
(
|
|
8
|
-
r?.({ target: { value:
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as p, useState as d, useCallback as v } from "react";
|
|
3
|
+
import { DropdownContext as S } from "./dropdown.context.js";
|
|
4
|
+
import { useToggle as b } from "../../../hooks/useToggle.js";
|
|
5
|
+
const D = ({ children: s, value: n, name: e, highlightSearch: c = !1, onChange: r, onBlur: t }) => {
|
|
6
|
+
const l = p(c), [h, i] = b(!1), [m, g] = d(""), u = v(
|
|
7
|
+
(o, a) => {
|
|
8
|
+
a?.current && (a.current.value = o), r?.({ target: { value: o, name: e ?? "" } }), t?.();
|
|
9
9
|
},
|
|
10
|
-
[r, e,
|
|
10
|
+
[r, e, t]
|
|
11
11
|
);
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
|
|
12
|
+
return /* @__PURE__ */ f(
|
|
13
|
+
S.Provider,
|
|
14
14
|
{
|
|
15
15
|
value: {
|
|
16
|
-
|
|
17
|
-
isOpen:
|
|
18
|
-
searchTerm:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
highlightSearchEnabled: l.current,
|
|
17
|
+
isOpen: h,
|
|
18
|
+
searchTerm: m,
|
|
19
|
+
value: n,
|
|
20
|
+
setSearchTerm: g,
|
|
21
|
+
setValue: u,
|
|
22
|
+
toggleOpen: i
|
|
22
23
|
},
|
|
23
|
-
children:
|
|
24
|
+
children: s
|
|
24
25
|
}
|
|
25
26
|
);
|
|
26
27
|
};
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
+
D as DropdownProvider
|
|
29
30
|
};
|
|
@@ -1,59 +1,58 @@
|
|
|
1
|
-
import { useRef as c, useEffect as
|
|
1
|
+
import { useRef as c, useEffect as u, useCallback as f } from "react";
|
|
2
2
|
import { useDropdownContext as g } from "../contexts/dropdown.hook.js";
|
|
3
|
-
const
|
|
4
|
-
const o = c(null), t = c(null), {
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
}, r = (
|
|
9
|
-
o.current?.contains(
|
|
3
|
+
const w = ({ ulRef: l, inputRef: i }) => {
|
|
4
|
+
const o = c(null), t = c(null), { toggleOpen: n } = g();
|
|
5
|
+
u(() => {
|
|
6
|
+
const e = new AbortController(), s = (a) => {
|
|
7
|
+
a.key === "Escape" && n(!1);
|
|
8
|
+
}, r = (a) => {
|
|
9
|
+
o.current?.contains(a.target) || n(!1);
|
|
10
10
|
};
|
|
11
11
|
return document.addEventListener("keydown", s, {
|
|
12
|
-
signal:
|
|
12
|
+
signal: e.signal
|
|
13
13
|
}), document.addEventListener("mousedown", r, {
|
|
14
|
-
signal:
|
|
14
|
+
signal: e.signal
|
|
15
15
|
}), document.addEventListener(
|
|
16
16
|
"visibilitychange",
|
|
17
17
|
() => {
|
|
18
|
-
document.hidden &&
|
|
18
|
+
document.hidden && n(!1);
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
signal:
|
|
21
|
+
signal: e.signal
|
|
22
22
|
}
|
|
23
23
|
), t.current?.addEventListener(
|
|
24
24
|
"focus",
|
|
25
25
|
() => {
|
|
26
|
-
|
|
26
|
+
n(!0);
|
|
27
27
|
},
|
|
28
|
-
{ signal:
|
|
28
|
+
{ signal: e.signal }
|
|
29
29
|
), () => {
|
|
30
|
-
|
|
30
|
+
e.abort();
|
|
31
31
|
};
|
|
32
|
-
}, [
|
|
33
|
-
const
|
|
32
|
+
}, [n, o]), u(() => {
|
|
33
|
+
const e = new AbortController();
|
|
34
34
|
return t.current?.addEventListener(
|
|
35
35
|
"keydown",
|
|
36
36
|
(s) => {
|
|
37
37
|
if (s.key === "ArrowDown") {
|
|
38
|
-
const r =
|
|
38
|
+
const r = l.current?.querySelector("li");
|
|
39
39
|
r && r.focus();
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
|
-
{ signal:
|
|
42
|
+
{ signal: e.signal }
|
|
43
43
|
), () => {
|
|
44
|
-
|
|
44
|
+
e.abort();
|
|
45
45
|
};
|
|
46
|
-
}, [t,
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
}, [i,
|
|
46
|
+
}, [t, l]);
|
|
47
|
+
const d = f(() => {
|
|
48
|
+
n(!0), requestAnimationFrame(() => i?.current?.focus());
|
|
49
|
+
}, [i, n]);
|
|
50
50
|
return {
|
|
51
51
|
wrapperRef: o,
|
|
52
52
|
wrapperInputRef: t,
|
|
53
|
-
handleOpen:
|
|
54
|
-
handleOpenIfClosed: p
|
|
53
|
+
handleOpen: d
|
|
55
54
|
};
|
|
56
55
|
};
|
|
57
56
|
export {
|
|
58
|
-
|
|
57
|
+
w as useDropdown
|
|
59
58
|
};
|
|
@@ -1,58 +1,62 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { useDropdownContext as
|
|
3
|
-
const
|
|
1
|
+
import { useRef as g, useEffect as i } from "react";
|
|
2
|
+
import { useDropdownContext as d } from "../contexts/dropdown.hook.js";
|
|
3
|
+
const w = ({
|
|
4
|
+
inputRef: s,
|
|
5
|
+
searchable: l,
|
|
4
6
|
ulRef: t,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
wrapperInputRef: u,
|
|
8
|
+
wrapperRef: a
|
|
7
9
|
}) => {
|
|
8
|
-
const r =
|
|
9
|
-
|
|
10
|
-
const
|
|
10
|
+
const r = g(0), { isOpen: f } = d();
|
|
11
|
+
i(() => {
|
|
12
|
+
const c = t.current?.querySelectorAll("li") ?? [], e = Array.from(c).filter(
|
|
13
|
+
(n) => n.getAttribute("data-action") !== "true"
|
|
14
|
+
), o = new AbortController(), m = () => {
|
|
11
15
|
r.current < e.length - 1 ? (r.current = r.current + 1, e[r.current].focus()) : (r.current = 0, e[0].focus());
|
|
12
|
-
},
|
|
13
|
-
r.current > 0 ? (r.current = r.current - 1, e[r.current].focus()) : (r.current = 0,
|
|
16
|
+
}, b = () => {
|
|
17
|
+
r.current > 0 ? (r.current = r.current - 1, e[r.current].focus()) : (r.current = 0, s?.current && l ? s.current.focus() : u.current?.focus());
|
|
14
18
|
};
|
|
15
19
|
return t.current?.addEventListener(
|
|
16
20
|
"keydown",
|
|
17
|
-
(
|
|
18
|
-
switch (
|
|
21
|
+
(n) => {
|
|
22
|
+
switch (n.preventDefault(), n.key) {
|
|
19
23
|
case "ArrowDown": {
|
|
20
|
-
|
|
24
|
+
m();
|
|
21
25
|
break;
|
|
22
26
|
}
|
|
23
27
|
case "Tab": {
|
|
24
|
-
|
|
28
|
+
n.shiftKey ? b() : m();
|
|
25
29
|
break;
|
|
26
30
|
}
|
|
27
31
|
case "ArrowUp": {
|
|
28
|
-
r.current === 0 ?
|
|
32
|
+
r.current === 0 ? u.current?.focus() : b();
|
|
29
33
|
break;
|
|
30
34
|
}
|
|
31
35
|
case "Enter": {
|
|
32
|
-
e[r.current]
|
|
36
|
+
e[r.current]?.click();
|
|
33
37
|
break;
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
40
|
},
|
|
37
|
-
{ signal:
|
|
41
|
+
{ signal: o.signal }
|
|
38
42
|
), () => {
|
|
39
|
-
|
|
43
|
+
o.abort();
|
|
40
44
|
};
|
|
41
|
-
}, [t, r,
|
|
42
|
-
const
|
|
43
|
-
return
|
|
45
|
+
}, [t, r, u, s, l]), i(() => {
|
|
46
|
+
const c = new AbortController();
|
|
47
|
+
return a.current?.addEventListener(
|
|
44
48
|
"mouseenter",
|
|
45
49
|
() => {
|
|
46
|
-
(t.current?.querySelectorAll("li") ?? []).forEach((
|
|
50
|
+
(t.current?.querySelectorAll("li") ?? []).forEach((o) => o.blur());
|
|
47
51
|
},
|
|
48
|
-
{ signal:
|
|
52
|
+
{ signal: c.signal }
|
|
49
53
|
), () => {
|
|
50
|
-
|
|
54
|
+
c.abort();
|
|
51
55
|
};
|
|
52
|
-
}, [t,
|
|
53
|
-
|
|
54
|
-
}, [
|
|
56
|
+
}, [t, a]), i(() => {
|
|
57
|
+
f || (r.current = 0);
|
|
58
|
+
}, [f]);
|
|
55
59
|
};
|
|
56
60
|
export {
|
|
57
|
-
|
|
61
|
+
w as useNavigationUlList
|
|
58
62
|
};
|
|
@@ -2,7 +2,7 @@ import { jsxs as h, jsx as p } from "react/jsx-runtime";
|
|
|
2
2
|
import v, { forwardRef as x, useState as C, useRef as w, useCallback as b, useEffect as E } from "react";
|
|
3
3
|
import { cn as l } from "../../utils/index.js";
|
|
4
4
|
import { Button as P } from "../Button/Button.js";
|
|
5
|
-
import { P as c } from "../../index-
|
|
5
|
+
import { P as c } from "../../index-N2OStZoU.js";
|
|
6
6
|
function m() {
|
|
7
7
|
return m = Object.assign || function(e) {
|
|
8
8
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -5,7 +5,7 @@ import { Checkbox as C } from "../../../Checkbox/Checkbox.js";
|
|
|
5
5
|
import { cn as n } from "../../../../utils/index.js";
|
|
6
6
|
import { filterButtonIconVariants as y, filterButtonVariants as N } from "../../Filter.variants.js";
|
|
7
7
|
import { useBadgeMultiSelect as B } from "./BadgeMultiSelect.hook.js";
|
|
8
|
-
import { C as O } from "../../../../chevron-down-
|
|
8
|
+
import { C as O } from "../../../../chevron-down-MZvQoT2F.js";
|
|
9
9
|
const $ = ({
|
|
10
10
|
options: i,
|
|
11
11
|
label: p,
|
|
@@ -5,7 +5,7 @@ import { DatePicker as w } from "../../../Datepicker/DatePicker.js";
|
|
|
5
5
|
import { cn as o } from "../../../../utils/index.js";
|
|
6
6
|
import { filterButtonIconVariants as x, filterButtonVariants as y } from "../../Filter.variants.js";
|
|
7
7
|
import { useDateFilterDropdown as D } from "./DateFilterDropdown.hook.js";
|
|
8
|
-
import { C as N } from "../../../../chevron-down-
|
|
8
|
+
import { C as N } from "../../../../chevron-down-MZvQoT2F.js";
|
|
9
9
|
const R = ({
|
|
10
10
|
label: s,
|
|
11
11
|
position: l = "left",
|
|
@@ -4,7 +4,7 @@ import { cn as u } from "../../utils/index.js";
|
|
|
4
4
|
import { inputVariants as $ } from "./Input.variants.js";
|
|
5
5
|
import { SearchIcon as L } from "../../assets/icons/components/Search.js";
|
|
6
6
|
import { Warning as T } from "../../assets/icons/components/Warning.js";
|
|
7
|
-
import { P as i } from "../../index-
|
|
7
|
+
import { P as i } from "../../index-N2OStZoU.js";
|
|
8
8
|
function h() {
|
|
9
9
|
return h = Object.assign || function(t) {
|
|
10
10
|
for (var n = 1; n < arguments.length; n++) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { cn as c } from "../../utils/index.js";
|
|
3
3
|
import { loadingVariants as i } from "./Loading.variants.js";
|
|
4
|
-
import { c as t } from "../../createLucideIcon-
|
|
4
|
+
import { c as t } from "../../createLucideIcon-D2CN7Ma9.js";
|
|
5
5
|
/**
|
|
6
|
-
* @license lucide-react v0.
|
|
6
|
+
* @license lucide-react v0.545.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 "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import "../../index-
|
|
4
|
-
import { M as d } from "../../Modal-
|
|
3
|
+
import "../../index-BITvcJAz.js";
|
|
4
|
+
import { M as d } from "../../Modal-D-NOEWMX.js";
|
|
5
5
|
import "./components/Header/Header.js";
|
|
6
6
|
import "./components/Body/Body.js";
|
|
7
7
|
import "./components/Footer/Footer.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "../../../../index-
|
|
2
|
+
import "../../../../index-DBbEcSUG.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../../../../Combination-VYaRRJBZ.js";
|
|
5
|
-
import { W as f } from "../../../../Modal-
|
|
5
|
+
import { W as f } from "../../../../Modal-D-NOEWMX.js";
|
|
6
6
|
import "../../../../utils/index.js";
|
|
7
7
|
import "./Wrapper.variants.js";
|
|
8
|
-
import "../../../../x-
|
|
8
|
+
import "../../../../x-4F_5p77m.js";
|
|
9
9
|
export {
|
|
10
10
|
f as Wrapper
|
|
11
11
|
};
|