@konstructio/ui 0.1.2-alpha.2 → 0.1.2-alpha.20
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-BLZPftpV.js → chevron-down-J5nS1Tu0.js} +2 -2
- package/dist/chevron-right-DeMVrnIg.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 +31 -28
- package/dist/components/Badge/Badge.variants.js +7 -5
- 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 +1 -1
- package/dist/components/Checkbox/Checkbox.js +5 -4
- package/dist/components/Checkbox/Checkbox.variants.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 +32 -9
- package/dist/components/Dropdown/components/List/List.js +64 -45
- package/dist/components/Dropdown/components/List/List.variants.js +9 -7
- package/dist/components/Dropdown/components/ListItem/ListItem.js +70 -24
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +9 -7
- package/dist/components/Dropdown/components/Wrapper.js +154 -108
- 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 +30 -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 +649 -648
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -28
- package/dist/components/Skeleton/Skeleton.js +42 -0
- 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 +57 -55
- package/dist/components/VirtualizedTable/VirtualizedTable.js +121 -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 +40 -0
- package/dist/components/VirtualizedTable/components/Body/Body.js +26 -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 +88 -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 +84 -0
- package/dist/components/index.js +44 -40
- package/dist/{createLucideIcon-DbC6TvM5.js → createLucideIcon-DGhJ8Z4k.js} +4 -4
- package/dist/debounce-BFejQm9P.js +200 -0
- package/dist/ellipsis-vertical-DpnVYRxI.js +15 -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 +121 -10
- package/dist/index.js +41 -37
- package/dist/package.json +33 -25
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +191 -167
- package/dist/{x-BPcqkRZd.js → x-4F_5p77m.js} +1 -1
- package/package.json +33 -25
- 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,133 +1,174 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Loading as
|
|
4
|
-
import { Typography as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { labelVariants as
|
|
7
|
-
import { useDropdown as
|
|
8
|
-
import { List as
|
|
9
|
-
import {
|
|
10
|
-
import { useDropdownContext as
|
|
11
|
-
|
|
1
|
+
import { jsxs as x, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as X, useId as Y, useRef as T, useImperativeHandle as Z, useMemo as B, useEffect as z } from "react";
|
|
3
|
+
import { Loading as ee } from "../../Loading/Loading.js";
|
|
4
|
+
import { Typography as te } from "../../Typography/Typography.js";
|
|
5
|
+
import { cn as c } from "../../../utils/index.js";
|
|
6
|
+
import { labelVariants as ae, inputVariants as re, dropdownVariants as ne } from "../Dropdown.variants.js";
|
|
7
|
+
import { useDropdown as oe } from "../hooks/useDropdown.js";
|
|
8
|
+
import { List as le } from "./List/List.js";
|
|
9
|
+
import { c as V } from "../../../createLucideIcon-DGhJ8Z4k.js";
|
|
10
|
+
import { useDropdownContext as se } from "../contexts/dropdown.hook.js";
|
|
11
|
+
/**
|
|
12
|
+
* @license lucide-react v0.548.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 ce = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], ie = V("chevron-up", ce);
|
|
18
|
+
/**
|
|
19
|
+
* @license lucide-react v0.548.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 ue = [
|
|
25
|
+
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
26
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
27
|
+
], fe = V("search", ue), ge = X(
|
|
12
28
|
({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
additionalOptions: _,
|
|
30
|
+
className: $,
|
|
31
|
+
defaultValue: h,
|
|
32
|
+
disabled: r = !1,
|
|
33
|
+
error: m,
|
|
34
|
+
iconClassName: D,
|
|
35
|
+
inputClassName: F,
|
|
36
|
+
isLoading: j,
|
|
37
|
+
isRequired: v,
|
|
38
|
+
label: w,
|
|
39
|
+
labelClassName: M,
|
|
40
|
+
listClassName: A,
|
|
41
|
+
listItemClassName: H,
|
|
42
|
+
listItemSecondRowClassName: P,
|
|
43
|
+
name: i,
|
|
44
|
+
options: o,
|
|
45
|
+
placeholder: N,
|
|
46
|
+
searchable: k = !1,
|
|
47
|
+
onSearchChange: U,
|
|
48
|
+
showSearchIcon: C,
|
|
49
|
+
theme: W,
|
|
50
|
+
wrapperClassName: q,
|
|
51
|
+
onBlur: I,
|
|
52
|
+
...b
|
|
53
|
+
}, G) => {
|
|
54
|
+
const E = Y(), t = T(null), O = T(null), { wrapperRef: u, wrapperInputRef: R, handleOpen: g } = oe({
|
|
55
|
+
ulRef: O,
|
|
56
|
+
inputRef: t,
|
|
57
|
+
disabled: r
|
|
58
|
+
}), { isOpen: p, searchTerm: J, value: l, toggleOpen: K, setValue: y, setSearchTerm: L } = se(), f = i ? `${E}-${i}` : E;
|
|
59
|
+
Z(G, () => t.current, [t]);
|
|
60
|
+
const n = B(() => o.find(({ value: e }) => e === l), [o, l]);
|
|
61
|
+
z(() => {
|
|
62
|
+
t.current && (t.current.value = l ? n?.value : "");
|
|
63
|
+
}, [n, l]), z(() => {
|
|
64
|
+
if (h && !l) {
|
|
65
|
+
const e = o && o.find((s) => s.value === h);
|
|
66
|
+
e && y(e.value);
|
|
40
67
|
}
|
|
41
|
-
}, [
|
|
68
|
+
}, [h, o, y, l]), z(() => {
|
|
42
69
|
const e = new AbortController();
|
|
43
|
-
return
|
|
44
|
-
const d =
|
|
45
|
-
(!d || !
|
|
70
|
+
return u.current?.addEventListener("focusout", (s) => {
|
|
71
|
+
const d = s.relatedTarget;
|
|
72
|
+
(!d || !u.current?.contains(d)) && (L(""), t.current?.value || I?.());
|
|
46
73
|
}), () => {
|
|
47
74
|
e.abort();
|
|
48
75
|
};
|
|
49
|
-
}, [
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
const d =
|
|
54
|
-
(
|
|
76
|
+
}, [K, u, L, I, l]);
|
|
77
|
+
const Q = (e) => {
|
|
78
|
+
const s = e.target.value;
|
|
79
|
+
U?.(s), L(s);
|
|
80
|
+
const d = o.find(
|
|
81
|
+
(S) => S.value.toLocaleLowerCase() === s.toLocaleLowerCase()
|
|
55
82
|
);
|
|
56
|
-
d &&
|
|
83
|
+
d && y(d.value);
|
|
57
84
|
};
|
|
58
|
-
return /* @__PURE__ */
|
|
85
|
+
return /* @__PURE__ */ x(
|
|
59
86
|
"div",
|
|
60
87
|
{
|
|
61
|
-
ref:
|
|
62
|
-
className:
|
|
63
|
-
"data-theme":
|
|
88
|
+
ref: u,
|
|
89
|
+
className: c("flex flex-col w-full relative", q),
|
|
90
|
+
"data-theme": W,
|
|
64
91
|
children: [
|
|
65
|
-
|
|
92
|
+
w ? /* @__PURE__ */ x(
|
|
66
93
|
"label",
|
|
67
94
|
{
|
|
68
|
-
id:
|
|
69
|
-
className:
|
|
70
|
-
htmlFor:
|
|
71
|
-
onClick:
|
|
95
|
+
id: f,
|
|
96
|
+
className: c(ae({ className: M })),
|
|
97
|
+
htmlFor: f,
|
|
98
|
+
onClick: () => !r && g(),
|
|
72
99
|
children: [
|
|
73
|
-
|
|
74
|
-
|
|
100
|
+
w,
|
|
101
|
+
v && /* @__PURE__ */ a("span", { className: "text-red-600 ml-1", children: "*" })
|
|
75
102
|
]
|
|
76
103
|
}
|
|
77
104
|
) : null,
|
|
78
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ x(
|
|
79
106
|
"div",
|
|
80
107
|
{
|
|
81
108
|
ref: R,
|
|
82
|
-
id:
|
|
83
|
-
className:
|
|
109
|
+
id: f,
|
|
110
|
+
className: c(
|
|
111
|
+
ne({ className: $, hasError: !!m, disabled: r })
|
|
112
|
+
),
|
|
84
113
|
role: "combobox",
|
|
85
|
-
onClick:
|
|
86
|
-
"aria-expanded":
|
|
114
|
+
onClick: () => !r && g(),
|
|
115
|
+
"aria-expanded": p,
|
|
87
116
|
tabIndex: 0,
|
|
88
|
-
"aria-labelledby":
|
|
117
|
+
"aria-labelledby": f,
|
|
89
118
|
children: [
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
|
|
92
|
-
|
|
119
|
+
/* @__PURE__ */ x("div", { className: "flex gap-2.5 items-center flex-1", children: [
|
|
120
|
+
n?.leftIcon && !C && /* @__PURE__ */ a("span", { className: "w-4 h-4 flex justify-center items-center dark:text-slate-50", children: n.leftIcon }),
|
|
121
|
+
C && /* @__PURE__ */ a(fe, { 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" }),
|
|
122
|
+
k ? /* @__PURE__ */ a(
|
|
93
123
|
"input",
|
|
94
124
|
{
|
|
125
|
+
ref: t,
|
|
95
126
|
type: "text",
|
|
96
|
-
value:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
),
|
|
127
|
+
value: p ? J : n?.label || "",
|
|
128
|
+
name: i,
|
|
129
|
+
onChange: Q,
|
|
130
|
+
placeholder: N,
|
|
131
|
+
className: c(re({ className: F }), {
|
|
132
|
+
"text-red-700 placeholder:text-red-700": !!m
|
|
133
|
+
}),
|
|
105
134
|
onClick: (e) => {
|
|
106
|
-
e.stopPropagation(),
|
|
135
|
+
e.stopPropagation(), r || g();
|
|
107
136
|
},
|
|
108
|
-
"aria-label":
|
|
109
|
-
"aria-labelledby":
|
|
137
|
+
"aria-label": w || N,
|
|
138
|
+
"aria-labelledby": f,
|
|
139
|
+
required: v,
|
|
140
|
+
autoComplete: "off",
|
|
141
|
+
autoCapitalize: "words",
|
|
142
|
+
disabled: r,
|
|
143
|
+
...b
|
|
110
144
|
}
|
|
111
|
-
) : /* @__PURE__ */
|
|
112
|
-
|
|
145
|
+
) : /* @__PURE__ */ a(
|
|
146
|
+
te,
|
|
113
147
|
{
|
|
114
148
|
variant: "body2",
|
|
115
|
-
className:
|
|
116
|
-
"text-
|
|
117
|
-
|
|
118
|
-
|
|
149
|
+
className: c(
|
|
150
|
+
"flex-1 text-zinc-400 text-sm dark:text-slate-400",
|
|
151
|
+
{
|
|
152
|
+
"text-red-700": !!m,
|
|
153
|
+
"select-none": !n,
|
|
154
|
+
"text-slate-800 dark:text-slate-50": n,
|
|
155
|
+
"text-slate-400/50 dark:text-slate-50/50": r
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
children: n?.label || N
|
|
119
159
|
}
|
|
120
160
|
)
|
|
121
161
|
] }),
|
|
122
|
-
|
|
123
|
-
|
|
162
|
+
j ? /* @__PURE__ */ a(ee, { className: "w-4 h-4 text-zinc-500 select-none" }) : !C && /* @__PURE__ */ a(
|
|
163
|
+
ie,
|
|
124
164
|
{
|
|
125
|
-
"data-state":
|
|
126
|
-
className:
|
|
127
|
-
"w-4 h-4 text-zinc-500 transition-all duration-
|
|
128
|
-
|
|
165
|
+
"data-state": p ? "open" : "closed",
|
|
166
|
+
className: c(
|
|
167
|
+
"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",
|
|
168
|
+
D,
|
|
129
169
|
{
|
|
130
|
-
"text-red-700": !!
|
|
170
|
+
"text-red-700": !!m,
|
|
171
|
+
"text-slate-400/50 dark:group-focus-within:text-zinc-500": r
|
|
131
172
|
}
|
|
132
173
|
)
|
|
133
174
|
}
|
|
@@ -135,29 +176,34 @@ const fe = W(
|
|
|
135
176
|
]
|
|
136
177
|
}
|
|
137
178
|
),
|
|
138
|
-
/* @__PURE__ */
|
|
179
|
+
!k && /* @__PURE__ */ a(
|
|
139
180
|
"input",
|
|
140
181
|
{
|
|
141
|
-
ref:
|
|
182
|
+
ref: t,
|
|
142
183
|
type: "text",
|
|
143
|
-
name:
|
|
184
|
+
name: i,
|
|
144
185
|
className: "hidden",
|
|
145
186
|
"aria-hidden": "true",
|
|
146
|
-
required:
|
|
187
|
+
required: v,
|
|
188
|
+
inert: !0,
|
|
189
|
+
...b
|
|
147
190
|
}
|
|
148
191
|
),
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
|
|
192
|
+
p && /* @__PURE__ */ a(
|
|
193
|
+
le,
|
|
151
194
|
{
|
|
152
195
|
ref: O,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
196
|
+
additionalOptions: _,
|
|
197
|
+
className: A,
|
|
198
|
+
itemClassName: H,
|
|
199
|
+
name: i,
|
|
200
|
+
wrapperRef: u,
|
|
157
201
|
wrapperInputRef: R,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
202
|
+
inputRef: t,
|
|
203
|
+
options: o,
|
|
204
|
+
isLoading: !!j,
|
|
205
|
+
searchable: k,
|
|
206
|
+
listItemSecondRowClassName: P
|
|
161
207
|
}
|
|
162
208
|
)
|
|
163
209
|
]
|
|
@@ -166,5 +212,5 @@ const fe = W(
|
|
|
166
212
|
}
|
|
167
213
|
);
|
|
168
214
|
export {
|
|
169
|
-
|
|
215
|
+
ge as Wrapper
|
|
170
216
|
};
|
|
@@ -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,57 +1,60 @@
|
|
|
1
|
-
import { useRef as c, useEffect as
|
|
2
|
-
import { useDropdownContext as
|
|
3
|
-
const b = ({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { useRef as c, useEffect as u, useCallback as g } from "react";
|
|
2
|
+
import { useDropdownContext as m } from "../contexts/dropdown.hook.js";
|
|
3
|
+
const b = ({
|
|
4
|
+
ulRef: i,
|
|
5
|
+
inputRef: l,
|
|
6
|
+
disabled: d
|
|
7
|
+
}) => {
|
|
8
|
+
const o = c(null), t = c(null), { toggleOpen: n } = m();
|
|
9
|
+
u(() => {
|
|
10
|
+
const e = new AbortController(), s = (a) => {
|
|
11
|
+
a.key === "Escape" && n(!1);
|
|
12
|
+
}, r = (a) => {
|
|
13
|
+
o.current?.contains(a.target) || n(!1);
|
|
10
14
|
};
|
|
11
15
|
return document.addEventListener("keydown", s, {
|
|
12
|
-
signal:
|
|
16
|
+
signal: e.signal
|
|
13
17
|
}), document.addEventListener("mousedown", r, {
|
|
14
|
-
signal:
|
|
18
|
+
signal: e.signal
|
|
15
19
|
}), document.addEventListener(
|
|
16
20
|
"visibilitychange",
|
|
17
21
|
() => {
|
|
18
|
-
document.hidden &&
|
|
22
|
+
document.hidden && n(!1);
|
|
19
23
|
},
|
|
20
24
|
{
|
|
21
|
-
signal:
|
|
25
|
+
signal: e.signal
|
|
22
26
|
}
|
|
23
27
|
), t.current?.addEventListener(
|
|
24
28
|
"focus",
|
|
25
29
|
() => {
|
|
26
|
-
|
|
30
|
+
d || n(!0);
|
|
27
31
|
},
|
|
28
|
-
{ signal:
|
|
32
|
+
{ signal: e.signal }
|
|
29
33
|
), () => {
|
|
30
|
-
|
|
34
|
+
e.abort();
|
|
31
35
|
};
|
|
32
|
-
}, [
|
|
33
|
-
const
|
|
36
|
+
}, [n, o]), u(() => {
|
|
37
|
+
const e = new AbortController();
|
|
34
38
|
return t.current?.addEventListener(
|
|
35
39
|
"keydown",
|
|
36
40
|
(s) => {
|
|
37
41
|
if (s.key === "ArrowDown") {
|
|
38
|
-
const r =
|
|
42
|
+
const r = i.current?.querySelector("li");
|
|
39
43
|
r && r.focus();
|
|
40
44
|
}
|
|
41
45
|
},
|
|
42
|
-
{ signal:
|
|
46
|
+
{ signal: e.signal }
|
|
43
47
|
), () => {
|
|
44
|
-
|
|
48
|
+
e.abort();
|
|
45
49
|
};
|
|
46
|
-
}, [t,
|
|
47
|
-
const f =
|
|
48
|
-
|
|
49
|
-
}, [
|
|
50
|
+
}, [t, i]);
|
|
51
|
+
const f = g(() => {
|
|
52
|
+
n(!0), requestAnimationFrame(() => l?.current?.focus());
|
|
53
|
+
}, [l, n]);
|
|
50
54
|
return {
|
|
51
55
|
wrapperRef: o,
|
|
52
56
|
wrapperInputRef: t,
|
|
53
|
-
handleOpen: f
|
|
54
|
-
handleOpenIfClosed: p
|
|
57
|
+
handleOpen: f
|
|
55
58
|
};
|
|
56
59
|
};
|
|
57
60
|
export {
|
|
@@ -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-J5nS1Tu0.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-J5nS1Tu0.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-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 "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import "
|
|
4
|
-
import { M as d } from "../../Modal-
|
|
3
|
+
import "react-dom";
|
|
4
|
+
import { M as d } from "../../Modal-B8jrP02v.js";
|
|
5
5
|
import "./components/Header/Header.js";
|
|
6
6
|
import "./components/Body/Body.js";
|
|
7
7
|
import "./components/Footer/Footer.js";
|