@konstructio/ui 0.1.2-alpha.67 → 0.1.2-alpha.69
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/AdditionalOptions-C2FDVZhu.js +45 -0
- package/dist/Modal-BGcucTHv.js +120 -0
- package/dist/assets/icons/components/CloudLockOutline.d.ts +3 -0
- package/dist/assets/icons/components/CloudLockOutline.js +28 -0
- package/dist/assets/icons/components/index.d.ts +1 -0
- package/dist/assets/icons/components/index.js +106 -104
- package/dist/assets/icons/index.js +106 -104
- package/dist/components/ButtonGroup/ButtonGroup.js +65 -61
- package/dist/components/ButtonGroup/ButtonGroup.types.d.ts +6 -0
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +32 -30
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.types.d.ts +3 -1
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.variants.d.ts +4 -1
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.variants.js +37 -17
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/Modal.types.d.ts +7 -2
- package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -2
- package/dist/components/Modal/components/Wrapper/Wrapper.types.d.ts +3 -0
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +2 -2
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/Select/Select.d.ts +1 -0
- package/dist/components/Select/Select.js +65 -42
- package/dist/components/Select/Select.types.d.ts +18 -2
- package/dist/components/Select/Select.variants.js +1 -1
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.d.ts +3 -0
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.js +11 -0
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.types.d.ts +4 -0
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.variants.d.ts +1 -0
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.variants.js +26 -0
- package/dist/components/Select/components/List/List.js +131 -132
- package/dist/components/Select/components/List/List.types.d.ts +1 -0
- package/dist/components/Select/components/List/List.variants.d.ts +1 -0
- package/dist/components/Select/components/List/List.variants.js +18 -3
- package/dist/components/Select/components/Wrapper.d.ts +3 -1
- package/dist/components/Select/components/Wrapper.js +65 -63
- package/dist/components/Select/components/index.d.ts +1 -0
- package/dist/components/Select/components/index.js +8 -6
- package/dist/components/index.js +1 -1
- package/dist/icons.d.ts +1 -1
- package/dist/icons.js +106 -104
- package/dist/index.js +1 -1
- package/dist/package.json +3 -3
- package/dist/{proxy-BIRlSMN_.js → proxy-CngVm5qA.js} +1834 -1852
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/dist/Modal--z642-Wv.js +0 -112
|
@@ -1,182 +1,181 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { ListItem as
|
|
9
|
-
import { listVariants as
|
|
10
|
-
import { DEFAULT_LIST_SIZE as
|
|
11
|
-
import { useSelectContext as
|
|
12
|
-
const
|
|
1
|
+
import { jsxs as N, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { d as K } from "../../../../debounce-DJveWHr_.js";
|
|
3
|
+
import { forwardRef as Q, useRef as O, useState as W, useImperativeHandle as X, useMemo as j, useEffect as Y, Fragment as $ } from "react";
|
|
4
|
+
import { Loading as R } from "../../../Loading/Loading.js";
|
|
5
|
+
import { cn as s } from "../../../../utils/index.js";
|
|
6
|
+
import { useNavigationUlList as ee } from "../../hooks/useNavigationList.js";
|
|
7
|
+
import { A as te, i as re } from "../../../../AdditionalOptions-C2FDVZhu.js";
|
|
8
|
+
import { ListItem as g } from "../ListItem/ListItem.js";
|
|
9
|
+
import { listGroupLabelVariants as oe, listVariants as ne } from "./List.variants.js";
|
|
10
|
+
import { DEFAULT_LIST_SIZE as se } from "../../constants/pagination.js";
|
|
11
|
+
import { useSelectContext as ae } from "../../contexts/select.hook.js";
|
|
12
|
+
const Le = Q(
|
|
13
13
|
({
|
|
14
|
-
additionalOptions:
|
|
15
|
-
className:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
noOptionsText:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} =
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
const t =
|
|
14
|
+
additionalOptions: A,
|
|
15
|
+
className: I,
|
|
16
|
+
groupedOptions: l,
|
|
17
|
+
inputRef: c,
|
|
18
|
+
isLoading: P,
|
|
19
|
+
itemClassName: u,
|
|
20
|
+
name: T,
|
|
21
|
+
searchable: f = !1,
|
|
22
|
+
listItemSecondRowClassName: p,
|
|
23
|
+
wrapperInputRef: U,
|
|
24
|
+
isInfiniteScrollEnabled: h,
|
|
25
|
+
noOptionsText: F,
|
|
26
|
+
onFetchMoreOptions: b
|
|
27
|
+
}, V) => {
|
|
28
|
+
const m = O(null), L = O(null), [v, k] = W(!1), {
|
|
29
|
+
canContinueFetching: d,
|
|
30
|
+
canFilter: y,
|
|
31
|
+
isOpen: _,
|
|
32
|
+
isTyping: E,
|
|
33
|
+
options: G,
|
|
34
|
+
page: w,
|
|
35
|
+
searchTerm: n,
|
|
36
|
+
setCanContinueFetching: q,
|
|
37
|
+
setOptions: z,
|
|
38
|
+
setPage: D
|
|
39
|
+
} = ae();
|
|
40
|
+
X(V, () => m.current, [m]);
|
|
41
|
+
const a = l.length > 0 && re(l[0]), x = f && y ? G.filter((e) => {
|
|
42
|
+
const t = n.toLowerCase();
|
|
43
43
|
return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(t);
|
|
44
|
-
}) :
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
}) : G, C = j(() => {
|
|
45
|
+
if (!a)
|
|
46
|
+
return [];
|
|
47
|
+
const e = l;
|
|
48
|
+
if (!f || !y || !n)
|
|
49
|
+
return e;
|
|
50
|
+
const t = n.toLowerCase();
|
|
51
|
+
return e.map((r) => ({
|
|
52
|
+
...r,
|
|
53
|
+
options: r.options.filter(
|
|
54
|
+
(i) => i.label.toLowerCase().includes(t)
|
|
55
|
+
)
|
|
56
|
+
})).filter((r) => r.options.length > 0);
|
|
57
|
+
}, [a, l, f, y, n]), H = a ? C.flatMap((e) => e.options) : x;
|
|
58
|
+
ee({
|
|
59
|
+
ulRef: m,
|
|
60
|
+
wrapperInputRef: U,
|
|
61
|
+
searchable: f,
|
|
62
|
+
filteredOptions: H
|
|
50
63
|
});
|
|
51
|
-
const
|
|
52
|
-
(e, t,
|
|
53
|
-
),
|
|
54
|
-
() =>
|
|
64
|
+
const M = x.filter(
|
|
65
|
+
(e, t, r) => t === r.findIndex((i) => i.value === e.value)
|
|
66
|
+
), S = a ? C.length === 0 : x.length === 0, Z = j(
|
|
67
|
+
() => K(async (e) => {
|
|
55
68
|
const [t] = e;
|
|
56
|
-
if (t.isIntersecting && !
|
|
69
|
+
if (t.isIntersecting && !v && b && d)
|
|
57
70
|
try {
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
page:
|
|
61
|
-
pageSize:
|
|
62
|
-
termOfSearch:
|
|
71
|
+
k(!0);
|
|
72
|
+
const r = w + 1, { data: i, hasMore: B } = await b({
|
|
73
|
+
page: r,
|
|
74
|
+
pageSize: se,
|
|
75
|
+
termOfSearch: n
|
|
63
76
|
});
|
|
64
|
-
|
|
77
|
+
D(r), q(B), z((J) => [...J, ...i]);
|
|
65
78
|
} catch {
|
|
66
79
|
console.error("Error fetching more options");
|
|
67
80
|
} finally {
|
|
68
|
-
|
|
81
|
+
k(!1);
|
|
69
82
|
}
|
|
70
83
|
}, 100),
|
|
71
|
-
[
|
|
84
|
+
[v, b, n, w]
|
|
72
85
|
);
|
|
73
|
-
return
|
|
74
|
-
if (
|
|
75
|
-
const e = new IntersectionObserver(
|
|
86
|
+
return Y(() => {
|
|
87
|
+
if (h && d && L.current && !E) {
|
|
88
|
+
const e = new IntersectionObserver(Z, {
|
|
76
89
|
threshold: 0.1
|
|
77
90
|
});
|
|
78
|
-
return e.observe(
|
|
91
|
+
return e.observe(L.current), () => e.disconnect();
|
|
79
92
|
}
|
|
80
93
|
}, [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
]), /* @__PURE__ */
|
|
94
|
+
h,
|
|
95
|
+
d,
|
|
96
|
+
v,
|
|
97
|
+
E,
|
|
98
|
+
w
|
|
99
|
+
]), /* @__PURE__ */ N(
|
|
87
100
|
"ul",
|
|
88
101
|
{
|
|
89
|
-
ref:
|
|
90
|
-
title:
|
|
102
|
+
ref: m,
|
|
103
|
+
title: T,
|
|
91
104
|
role: "listbox",
|
|
92
|
-
className:
|
|
93
|
-
"data-state":
|
|
105
|
+
className: s(ne({ className: I })),
|
|
106
|
+
"data-state": _ ? "open" : "closed",
|
|
94
107
|
children: [
|
|
95
|
-
|
|
96
|
-
|
|
108
|
+
P ? /* @__PURE__ */ o(
|
|
109
|
+
g,
|
|
97
110
|
{
|
|
98
|
-
className:
|
|
111
|
+
className: s("select-none", u),
|
|
99
112
|
isClickable: !1,
|
|
100
|
-
inputRef:
|
|
113
|
+
inputRef: c,
|
|
101
114
|
value: "Loading...",
|
|
102
115
|
label: "Loading...",
|
|
103
|
-
listItemSecondRowClassName:
|
|
116
|
+
listItemSecondRowClassName: p
|
|
104
117
|
}
|
|
105
|
-
) :
|
|
106
|
-
|
|
118
|
+
) : S ? /* @__PURE__ */ o(
|
|
119
|
+
g,
|
|
107
120
|
{
|
|
108
121
|
isEmpty: !0,
|
|
109
|
-
className:
|
|
122
|
+
className: s("select-none", u),
|
|
110
123
|
isClickable: !1,
|
|
111
|
-
inputRef:
|
|
112
|
-
value:
|
|
113
|
-
label:
|
|
114
|
-
listItemSecondRowClassName:
|
|
124
|
+
inputRef: c,
|
|
125
|
+
value: F ?? "",
|
|
126
|
+
label: F ?? "No options",
|
|
127
|
+
listItemSecondRowClassName: p
|
|
115
128
|
}
|
|
116
|
-
) :
|
|
117
|
-
|
|
129
|
+
) : a ? C.map((e) => /* @__PURE__ */ N($, { children: [
|
|
130
|
+
/* @__PURE__ */ o(
|
|
131
|
+
"li",
|
|
132
|
+
{
|
|
133
|
+
role: "presentation",
|
|
134
|
+
"aria-hidden": "true",
|
|
135
|
+
"data-action": "true",
|
|
136
|
+
className: s(oe()),
|
|
137
|
+
children: e.groupLabel
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
e.options.map((t) => /* @__PURE__ */ o(
|
|
141
|
+
g,
|
|
142
|
+
{
|
|
143
|
+
className: s("select-none", u),
|
|
144
|
+
isClickable: !0,
|
|
145
|
+
inputRef: c,
|
|
146
|
+
listItemSecondRowClassName: p,
|
|
147
|
+
...t
|
|
148
|
+
},
|
|
149
|
+
t.value
|
|
150
|
+
))
|
|
151
|
+
] }, e.groupLabel)) : M.map((e) => /* @__PURE__ */ o(
|
|
152
|
+
g,
|
|
118
153
|
{
|
|
119
|
-
className:
|
|
154
|
+
className: s("select-none", u),
|
|
120
155
|
isClickable: !0,
|
|
121
|
-
inputRef:
|
|
122
|
-
listItemSecondRowClassName:
|
|
156
|
+
inputRef: c,
|
|
157
|
+
listItemSecondRowClassName: p,
|
|
123
158
|
...e
|
|
124
159
|
},
|
|
125
160
|
e.value
|
|
126
161
|
)),
|
|
127
|
-
|
|
162
|
+
h && d && /* @__PURE__ */ o(
|
|
128
163
|
"li",
|
|
129
164
|
{
|
|
130
|
-
ref:
|
|
165
|
+
ref: L,
|
|
131
166
|
role: "option",
|
|
132
167
|
"data-action": "true",
|
|
133
168
|
className: "flex items-center justify-center py-3",
|
|
134
169
|
onClick: (e) => e.stopPropagation(),
|
|
135
|
-
children: /* @__PURE__ */
|
|
170
|
+
children: /* @__PURE__ */ o(R, { className: "w-4 h-4 text-aurora-500 select-none" })
|
|
136
171
|
}
|
|
137
172
|
),
|
|
138
|
-
|
|
139
|
-
"li",
|
|
140
|
-
{
|
|
141
|
-
role: "option",
|
|
142
|
-
"data-action": "true",
|
|
143
|
-
onClick: () => q(!1),
|
|
144
|
-
children: /* @__PURE__ */ r(
|
|
145
|
-
B,
|
|
146
|
-
{
|
|
147
|
-
className: o(
|
|
148
|
-
"flex",
|
|
149
|
-
"min-h-10",
|
|
150
|
-
"py-2",
|
|
151
|
-
"px-6",
|
|
152
|
-
"w-full",
|
|
153
|
-
"h-full",
|
|
154
|
-
"gap-1",
|
|
155
|
-
"items-center",
|
|
156
|
-
"text-sm",
|
|
157
|
-
"[&>svg]:-ml-1",
|
|
158
|
-
"[&>svg]:w-3.5",
|
|
159
|
-
"[&>svg]:h-3.5",
|
|
160
|
-
"[&>svg]:shrink-0",
|
|
161
|
-
"cursor-pointer",
|
|
162
|
-
"select-none",
|
|
163
|
-
"hover:bg-gray-50",
|
|
164
|
-
"hover:dark:bg-metal-700",
|
|
165
|
-
"focus:outline-0",
|
|
166
|
-
"text-blue-600",
|
|
167
|
-
"dark:text-aurora-500"
|
|
168
|
-
),
|
|
169
|
-
children: e
|
|
170
|
-
}
|
|
171
|
-
)
|
|
172
|
-
},
|
|
173
|
-
t
|
|
174
|
-
))
|
|
173
|
+
/* @__PURE__ */ o(te, { additionalOptions: A })
|
|
175
174
|
]
|
|
176
175
|
}
|
|
177
176
|
);
|
|
178
177
|
}
|
|
179
178
|
);
|
|
180
179
|
export {
|
|
181
|
-
|
|
180
|
+
Le as List
|
|
182
181
|
};
|
|
@@ -2,6 +2,7 @@ import { ComponentRef, RefObject } from 'react';
|
|
|
2
2
|
import { SelectProps } from '../../Select.types';
|
|
3
3
|
export type ListProps = Pick<SelectProps, 'name' | 'options' | 'theme' | 'additionalOptions'> & {
|
|
4
4
|
className?: string;
|
|
5
|
+
groupedOptions: SelectProps['options'];
|
|
5
6
|
inputRef?: RefObject<ComponentRef<'input'> | null>;
|
|
6
7
|
isLoading: boolean;
|
|
7
8
|
itemClassName?: string;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { c as t } from "../../../../index-D29mdTf5.js";
|
|
2
|
-
const
|
|
2
|
+
const r = t([
|
|
3
|
+
"flex",
|
|
4
|
+
"items-center",
|
|
5
|
+
"h-8",
|
|
6
|
+
"px-6",
|
|
7
|
+
"py-1.5",
|
|
8
|
+
"text-[11px]",
|
|
9
|
+
"font-medium",
|
|
10
|
+
"uppercase",
|
|
11
|
+
"tracking-[0.25px]",
|
|
12
|
+
"text-metal-50",
|
|
13
|
+
"pointer-events-none",
|
|
14
|
+
"select-none",
|
|
15
|
+
"cursor-default"
|
|
16
|
+
]), a = t([
|
|
3
17
|
"scrollbar",
|
|
4
18
|
"absolute",
|
|
5
19
|
"bg-white",
|
|
@@ -7,7 +21,7 @@ const o = t([
|
|
|
7
21
|
"flex-col",
|
|
8
22
|
"mt-1",
|
|
9
23
|
"overflow-hidden",
|
|
10
|
-
"rounded
|
|
24
|
+
"rounded",
|
|
11
25
|
"shadow-2xs",
|
|
12
26
|
"top-full",
|
|
13
27
|
"w-full",
|
|
@@ -27,5 +41,6 @@ const o = t([
|
|
|
27
41
|
"[&>li:last-child]:mb-2"
|
|
28
42
|
]);
|
|
29
43
|
export {
|
|
30
|
-
|
|
44
|
+
r as listGroupLabelVariants,
|
|
45
|
+
a as listVariants
|
|
31
46
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { ComponentRef, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
import { SelectProps } from '../Select.types';
|
|
3
|
-
export declare const Wrapper: ForwardRefExoticComponent<Omit<SelectProps, 'options'> &
|
|
3
|
+
export declare const Wrapper: ForwardRefExoticComponent<Omit<SelectProps, 'options'> & {
|
|
4
|
+
groupedOptions: SelectProps['options'];
|
|
5
|
+
} & RefAttributes<ComponentRef<'input'>>>;
|
|
@@ -1,98 +1,99 @@
|
|
|
1
1
|
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Typography as
|
|
2
|
+
import { forwardRef as ae, useId as re, useRef as w, useMemo as ne, useImperativeHandle as le, useEffect as se } from "react";
|
|
3
|
+
import { Typography as oe } from "../../Typography/Typography.js";
|
|
4
4
|
import { cn as n } from "../../../utils/index.js";
|
|
5
|
-
import { labelVariants as
|
|
6
|
-
import { useSelect as
|
|
7
|
-
import { List as
|
|
8
|
-
import { c as
|
|
9
|
-
import { LoaderIcon as
|
|
10
|
-
import { C as
|
|
11
|
-
import { useSelectContext as
|
|
12
|
-
const
|
|
5
|
+
import { labelVariants as ce, inputVariants as ie, selectVariants as me } from "../Select.variants.js";
|
|
6
|
+
import { useSelect as pe } from "../hooks/useSelect.js";
|
|
7
|
+
import { List as ue } from "./List/List.js";
|
|
8
|
+
import { c as fe } from "../../../createLucideIcon-CP-mMPfa.js";
|
|
9
|
+
import { LoaderIcon as de } from "../../../assets/icons/components/Loader.js";
|
|
10
|
+
import { C as xe } from "../../../chevron-up-IlDPxR7j.js";
|
|
11
|
+
import { useSelectContext as he } from "../contexts/select.hook.js";
|
|
12
|
+
const ve = [
|
|
13
13
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
14
14
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
15
|
-
],
|
|
15
|
+
], Ne = fe("search", ve), Oe = ae(
|
|
16
16
|
({
|
|
17
17
|
additionalOptions: z,
|
|
18
18
|
className: O,
|
|
19
19
|
defaultValue: x,
|
|
20
20
|
disabled: t = !1,
|
|
21
21
|
error: f,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
groupedOptions: R,
|
|
23
|
+
iconClassName: F,
|
|
24
|
+
inputClassName: S,
|
|
25
|
+
isInfiniteScrollEnabled: T = !1,
|
|
25
26
|
isLoading: g,
|
|
26
27
|
isRequired: h,
|
|
27
28
|
label: v,
|
|
28
|
-
labelAction:
|
|
29
|
-
labelClassName:
|
|
30
|
-
labelWrapperClassName:
|
|
31
|
-
listClassName:
|
|
32
|
-
listItemClassName:
|
|
33
|
-
listItemSecondRowClassName:
|
|
29
|
+
labelAction: E,
|
|
30
|
+
labelClassName: M,
|
|
31
|
+
labelWrapperClassName: W,
|
|
32
|
+
listClassName: _,
|
|
33
|
+
listItemClassName: $,
|
|
34
|
+
listItemSecondRowClassName: H,
|
|
34
35
|
name: d,
|
|
35
|
-
noOptionsText:
|
|
36
|
+
noOptionsText: P,
|
|
36
37
|
placeholder: N,
|
|
37
38
|
searchable: k = !1,
|
|
38
39
|
showSearchIcon: C,
|
|
39
|
-
theme:
|
|
40
|
-
wrapperClassName:
|
|
41
|
-
onFetchMoreOptions:
|
|
42
|
-
onBlur:
|
|
43
|
-
onSearchChange:
|
|
40
|
+
theme: U,
|
|
41
|
+
wrapperClassName: q,
|
|
42
|
+
onFetchMoreOptions: A,
|
|
43
|
+
onBlur: B,
|
|
44
|
+
onSearchChange: D,
|
|
44
45
|
...y
|
|
45
|
-
},
|
|
46
|
-
const I =
|
|
46
|
+
}, G) => {
|
|
47
|
+
const I = re(), c = w(null), j = w(null), J = w(0), {
|
|
47
48
|
isOpen: i,
|
|
48
49
|
options: l,
|
|
49
|
-
searchTerm:
|
|
50
|
+
searchTerm: K,
|
|
50
51
|
value: s,
|
|
51
|
-
setCanFilter:
|
|
52
|
-
setSearchTerm:
|
|
52
|
+
setCanFilter: Q,
|
|
53
|
+
setSearchTerm: X,
|
|
53
54
|
setValue: m,
|
|
54
|
-
toggleOpen:
|
|
55
|
-
} =
|
|
55
|
+
toggleOpen: Y
|
|
56
|
+
} = he(), e = ne(() => l.find(({ value: a }) => a === s), [l, s]), { wrapperRef: Z, wrapperInputRef: L, handleOpen: V } = pe({
|
|
56
57
|
ulRef: j,
|
|
57
58
|
inputRef: c,
|
|
58
59
|
disabled: t,
|
|
59
60
|
internalValue: e,
|
|
60
|
-
onBlur:
|
|
61
|
+
onBlur: B
|
|
61
62
|
}), p = d ? `${I}-${d}` : I;
|
|
62
|
-
|
|
63
|
+
le(G, () => c.current, [c]), se(() => {
|
|
63
64
|
if (x && !s) {
|
|
64
65
|
const a = l && l.find((u) => u.value === x);
|
|
65
66
|
a && m(a.value);
|
|
66
67
|
}
|
|
67
68
|
}, [x, l, m, s]);
|
|
68
|
-
const
|
|
69
|
+
const ee = (a) => {
|
|
69
70
|
const u = a.target.value;
|
|
70
|
-
|
|
71
|
+
Q(!0), m(""), X(u ?? ""), D?.(u);
|
|
71
72
|
const b = l.find(
|
|
72
|
-
(
|
|
73
|
+
(te) => te.value.toLocaleLowerCase() === u.toLocaleLowerCase()
|
|
73
74
|
);
|
|
74
75
|
m(b ? b.value : e?.value ?? "");
|
|
75
76
|
};
|
|
76
77
|
return /* @__PURE__ */ o(
|
|
77
78
|
"div",
|
|
78
79
|
{
|
|
79
|
-
ref:
|
|
80
|
-
className: n("flex flex-col gap-2 w-full relative",
|
|
81
|
-
"data-theme":
|
|
80
|
+
ref: Z,
|
|
81
|
+
className: n("flex flex-col gap-2 w-full relative", q),
|
|
82
|
+
"data-theme": U,
|
|
82
83
|
children: [
|
|
83
84
|
v ? /* @__PURE__ */ o(
|
|
84
85
|
"div",
|
|
85
86
|
{
|
|
86
87
|
className: n(
|
|
87
88
|
"flex items-center justify-between",
|
|
88
|
-
|
|
89
|
+
W
|
|
89
90
|
),
|
|
90
91
|
children: [
|
|
91
92
|
/* @__PURE__ */ o(
|
|
92
93
|
"label",
|
|
93
94
|
{
|
|
94
95
|
id: p,
|
|
95
|
-
className: n(
|
|
96
|
+
className: n(ce({ className: M })),
|
|
96
97
|
htmlFor: p,
|
|
97
98
|
onClick: () => !t && V(),
|
|
98
99
|
children: [
|
|
@@ -101,7 +102,7 @@ const he = [
|
|
|
101
102
|
]
|
|
102
103
|
}
|
|
103
104
|
),
|
|
104
|
-
|
|
105
|
+
E
|
|
105
106
|
]
|
|
106
107
|
}
|
|
107
108
|
) : null,
|
|
@@ -111,18 +112,18 @@ const he = [
|
|
|
111
112
|
ref: L,
|
|
112
113
|
id: p,
|
|
113
114
|
className: n(
|
|
114
|
-
|
|
115
|
+
me({ className: O, hasError: !!f, disabled: t })
|
|
115
116
|
),
|
|
116
117
|
role: "combobox",
|
|
117
|
-
onClick: () => !t &&
|
|
118
|
+
onClick: () => !t && Y(!i),
|
|
118
119
|
"aria-expanded": i,
|
|
119
|
-
tabIndex:
|
|
120
|
+
tabIndex: J.current,
|
|
120
121
|
"aria-labelledby": p,
|
|
121
122
|
children: [
|
|
122
123
|
/* @__PURE__ */ o("div", { className: "flex gap-2.5 items-center flex-1", children: [
|
|
123
124
|
e?.leftIcon && !C && /* @__PURE__ */ r("span", { className: "w-4 h-4 flex justify-center items-center dark:text-metal-50", children: e.leftIcon }),
|
|
124
125
|
C && /* @__PURE__ */ r(
|
|
125
|
-
|
|
126
|
+
Ne,
|
|
126
127
|
{
|
|
127
128
|
className: n(
|
|
128
129
|
"w-4",
|
|
@@ -140,10 +141,10 @@ const he = [
|
|
|
140
141
|
"input",
|
|
141
142
|
{
|
|
142
143
|
type: "text",
|
|
143
|
-
value: i ?
|
|
144
|
-
onChange:
|
|
144
|
+
value: i ? K : e?.label ?? s ?? "",
|
|
145
|
+
onChange: ee,
|
|
145
146
|
placeholder: N,
|
|
146
|
-
className: n(
|
|
147
|
+
className: n(ie({ className: S }), {
|
|
147
148
|
"text-red-700 placeholder:text-red-700": !!f
|
|
148
149
|
}),
|
|
149
150
|
onClick: (a) => {
|
|
@@ -159,7 +160,7 @@ const he = [
|
|
|
159
160
|
...y
|
|
160
161
|
}
|
|
161
162
|
) : /* @__PURE__ */ o(
|
|
162
|
-
|
|
163
|
+
oe,
|
|
163
164
|
{
|
|
164
165
|
variant: "body2",
|
|
165
166
|
className: n(
|
|
@@ -181,18 +182,18 @@ const he = [
|
|
|
181
182
|
)
|
|
182
183
|
] }),
|
|
183
184
|
g ? /* @__PURE__ */ r(
|
|
184
|
-
|
|
185
|
+
de,
|
|
185
186
|
{
|
|
186
187
|
size: 16,
|
|
187
188
|
className: "text-metal-400 animate-spin select-none"
|
|
188
189
|
}
|
|
189
190
|
) : !C && /* @__PURE__ */ r(
|
|
190
|
-
|
|
191
|
+
xe,
|
|
191
192
|
{
|
|
192
193
|
"data-state": i ? "open" : "closed",
|
|
193
194
|
className: n(
|
|
194
195
|
"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-metal-50",
|
|
195
|
-
|
|
196
|
+
F,
|
|
196
197
|
{
|
|
197
198
|
"text-red-700": !!f,
|
|
198
199
|
"text-metal-400/50 dark:group-focus-within:text-zinc-500": t
|
|
@@ -218,22 +219,23 @@ const he = [
|
|
|
218
219
|
}
|
|
219
220
|
),
|
|
220
221
|
i && /* @__PURE__ */ r(
|
|
221
|
-
|
|
222
|
+
ue,
|
|
222
223
|
{
|
|
223
224
|
ref: j,
|
|
224
225
|
additionalOptions: z,
|
|
225
|
-
className:
|
|
226
|
-
|
|
226
|
+
className: _,
|
|
227
|
+
groupedOptions: R,
|
|
228
|
+
itemClassName: $,
|
|
227
229
|
name: d,
|
|
228
230
|
wrapperInputRef: L,
|
|
229
231
|
inputRef: c,
|
|
230
232
|
options: l,
|
|
231
233
|
isLoading: !!g,
|
|
232
234
|
searchable: k,
|
|
233
|
-
listItemSecondRowClassName:
|
|
234
|
-
isInfiniteScrollEnabled:
|
|
235
|
-
onFetchMoreOptions:
|
|
236
|
-
noOptionsText:
|
|
235
|
+
listItemSecondRowClassName: H,
|
|
236
|
+
isInfiniteScrollEnabled: T,
|
|
237
|
+
onFetchMoreOptions: A,
|
|
238
|
+
noOptionsText: P
|
|
237
239
|
}
|
|
238
240
|
)
|
|
239
241
|
]
|
|
@@ -242,5 +244,5 @@ const he = [
|
|
|
242
244
|
}
|
|
243
245
|
);
|
|
244
246
|
export {
|
|
245
|
-
|
|
247
|
+
Oe as Wrapper
|
|
246
248
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { A as t } from "../../../AdditionalOptions-C2FDVZhu.js";
|
|
2
|
+
import { EmptyList as e } from "./EmptyList.js";
|
|
3
|
+
import { List as m } from "./List/List.js";
|
|
4
|
+
import { Wrapper as s } from "./Wrapper.js";
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
-
e as
|
|
7
|
-
|
|
6
|
+
t as AdditionalOptions,
|
|
7
|
+
e as EmptyList,
|
|
8
|
+
m as List,
|
|
9
|
+
s as Wrapper
|
|
8
10
|
};
|
package/dist/components/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { Filter as k } from "./Filter/Filter.js";
|
|
|
17
17
|
import { ImageUpload as F } from "./ImageUpload/ImageUpload.js";
|
|
18
18
|
import { Input as M } from "./Input/Input.js";
|
|
19
19
|
import { Loading as y } from "./Loading/Loading.js";
|
|
20
|
-
import { M as U } from "../Modal
|
|
20
|
+
import { M as U } from "../Modal-BGcucTHv.js";
|
|
21
21
|
import { MultiSelectDropdown as j } from "./MultiSelectDropdown/MultiSelectDropdown.js";
|
|
22
22
|
import { PhoneNumberInput as H } from "./PhoneNumberInput/PhoneNumberInput.js";
|
|
23
23
|
import { PieChart as K } from "./PieChart/PieChart.js";
|