@pibit.ai/cure-design-system 0.6.1 → 0.6.3
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/applications/progressive-loading-indicator/index.d.ts +2 -0
- package/dist/applications/progressive-loading-indicator/index.d.ts.map +1 -0
- package/dist/applications/progressive-loading-indicator/progressive-loading-indicator.d.ts +26 -0
- package/dist/applications/progressive-loading-indicator/progressive-loading-indicator.d.ts.map +1 -0
- package/dist/applications/progressive-loading-indicator/progressive-loading-indicator.js +77 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +124 -122
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +12 -0
- package/dist/primitives/button/button.d.ts.map +1 -1
- package/dist/primitives/button/button.js +3 -4
- package/dist/primitives/select/multi-select.d.ts.map +1 -1
- package/dist/primitives/select/multi-select.js +428 -387
- package/dist/primitives/select/searchable-select.d.ts +3 -1
- package/dist/primitives/select/searchable-select.d.ts.map +1 -1
- package/dist/primitives/select/searchable-select.js +254 -229
- package/dist/primitives/select/select-item.d.ts.map +1 -1
- package/dist/primitives/select/select-item.js +19 -18
- package/dist/styles/components.css +1 -1
- package/package.json +1 -1
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { useFilter as
|
|
4
|
-
import { Minus as
|
|
5
|
-
import { ComboBox as
|
|
6
|
-
import { useListData as
|
|
7
|
-
import { Avatar as
|
|
8
|
-
import { HintText as
|
|
9
|
-
import { Label as
|
|
10
|
-
import { Popover as
|
|
11
|
-
import { sizes as
|
|
12
|
-
import { TagCloseX as
|
|
13
|
-
import { SelectItem as
|
|
14
|
-
import { cx as
|
|
15
|
-
import { getPlatformShortcutLabel as
|
|
16
|
-
import { useResizeObserver as
|
|
17
|
-
import { SelectCheckbox as
|
|
18
|
-
import { multiSelectItemMatchesFilter as
|
|
19
|
-
const
|
|
1
|
+
import { jsx as l, jsxs as P, Fragment as ge } from "react/jsx-runtime";
|
|
2
|
+
import { useId as me, useCallback as K, useMemo as C, useRef as G, useState as ue, createContext as we, useContext as H, useLayoutEffect as ye } from "react";
|
|
3
|
+
import { useFilter as be, useInteractOutside as xe, FocusScope as ve, useFocusManager as De } from "react-aria";
|
|
4
|
+
import { Minus as ke, ChevronDown as Ne, SearchMd as Te } from "@untitledui/icons";
|
|
5
|
+
import { ComboBox as Se, ListBox as Re, ComboBoxStateContext as Y, ButtonContext as B, Group as Fe, Input as Me } from "react-aria-components";
|
|
6
|
+
import { useListData as Ae } from "../../node_modules/react-stately/dist/private/data/useListData.js";
|
|
7
|
+
import { Avatar as Ee } from "../avatar/avatar.js";
|
|
8
|
+
import { HintText as Pe } from "../input/hint-text.js";
|
|
9
|
+
import { Label as Ke } from "../input/label.js";
|
|
10
|
+
import { Popover as Le } from "./popover.js";
|
|
11
|
+
import { sizes as ze } from "./select-shared.js";
|
|
12
|
+
import { TagCloseX as Oe } from "../tags/base-components/tag-close-x.js";
|
|
13
|
+
import { SelectItem as qe } from "./select-item.js";
|
|
14
|
+
import { cx as k } from "../../utils/cn.js";
|
|
15
|
+
import { getPlatformShortcutLabel as _e } from "../../utils/keyboard-shortcut.js";
|
|
16
|
+
import { useResizeObserver as fe } from "../../hooks/use-resize-observer.js";
|
|
17
|
+
import { SelectCheckbox as We } from "./select-checkbox.js";
|
|
18
|
+
import { multiSelectItemMatchesFilter as oe, shouldClearMultiSelectFilterOnSelection as ae, getMultiSelectSelectAllLabel as je } from "./multi-select-utils.js";
|
|
19
|
+
const Ve = {
|
|
20
20
|
sm: "py-1.5 px-2 min-h-8 h-auto",
|
|
21
21
|
md: "py-1.5 px-3 min-h-9 h-auto",
|
|
22
22
|
lg: "py-2.5 px-3.5 min-h-11 h-auto"
|
|
23
23
|
};
|
|
24
|
-
function
|
|
24
|
+
function He(...s) {
|
|
25
25
|
return (b) => {
|
|
26
|
-
for (const
|
|
27
|
-
|
|
26
|
+
for (const f of s)
|
|
27
|
+
f != null && (typeof f == "function" ? f(b) : f.current = b);
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
const
|
|
30
|
+
const I = {
|
|
31
31
|
sm: "text-xs",
|
|
32
32
|
md: "text-sm",
|
|
33
33
|
lg: "text-md"
|
|
34
|
-
},
|
|
34
|
+
}, ce = {
|
|
35
35
|
sm: "text-xs",
|
|
36
36
|
md: "text-sm",
|
|
37
37
|
lg: "text-sm"
|
|
38
38
|
};
|
|
39
|
-
function
|
|
40
|
-
return document.getElementById(
|
|
39
|
+
function $e(s) {
|
|
40
|
+
return document.getElementById(s);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
triggerRef:
|
|
42
|
+
function Ge({
|
|
43
|
+
triggerRef: s,
|
|
44
44
|
popoverRef: b
|
|
45
45
|
}) {
|
|
46
|
-
const
|
|
47
|
-
return
|
|
46
|
+
const f = H(Y);
|
|
47
|
+
return xe({
|
|
48
48
|
ref: b,
|
|
49
|
-
isDisabled: !(
|
|
50
|
-
onInteractOutside: (
|
|
51
|
-
var
|
|
52
|
-
(
|
|
49
|
+
isDisabled: !(f != null && f.isOpen),
|
|
50
|
+
onInteractOutside: (p) => {
|
|
51
|
+
var i;
|
|
52
|
+
(i = s.current) != null && i.contains(p.target) || f == null || f.close();
|
|
53
53
|
}
|
|
54
54
|
}), null;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
const b =
|
|
58
|
-
b instanceof Element && b.closest("input, textarea, [contenteditable='true']") ||
|
|
56
|
+
function de(s) {
|
|
57
|
+
const b = s.target;
|
|
58
|
+
b instanceof Element && b.closest("input, textarea, [contenteditable='true']") || s.preventDefault();
|
|
59
59
|
}
|
|
60
|
-
const
|
|
61
|
-
value:
|
|
60
|
+
const Ue = ({
|
|
61
|
+
value: s,
|
|
62
62
|
placeholder: b,
|
|
63
|
-
listboxId:
|
|
64
|
-
onChange:
|
|
63
|
+
listboxId: f,
|
|
64
|
+
onChange: p
|
|
65
65
|
}) => {
|
|
66
|
-
const
|
|
67
|
-
e.stopPropagation(),
|
|
68
|
-
},
|
|
69
|
-
e.stopPropagation(),
|
|
70
|
-
},
|
|
66
|
+
const i = H(Y), w = (e) => {
|
|
67
|
+
e.stopPropagation(), i == null || i.open();
|
|
68
|
+
}, S = (e) => {
|
|
69
|
+
e.stopPropagation(), de(e);
|
|
70
|
+
}, d = (e) => {
|
|
71
71
|
e.stopPropagation();
|
|
72
|
-
},
|
|
72
|
+
}, o = (e) => {
|
|
73
73
|
var r;
|
|
74
|
-
const a =
|
|
74
|
+
const a = $e(f), y = a ? Array.from(a.querySelectorAll('[role="option"]')) : [];
|
|
75
75
|
switch (e.key) {
|
|
76
76
|
case "ArrowDown":
|
|
77
|
-
e.preventDefault(),
|
|
77
|
+
e.preventDefault(), y.length > 0 && ((a == null ? void 0 : a.querySelector(
|
|
78
78
|
'[role="option"][data-focused="true"]'
|
|
79
|
-
)) ??
|
|
79
|
+
)) ?? y[0]).focus();
|
|
80
80
|
return;
|
|
81
81
|
case "ArrowUp":
|
|
82
|
-
e.preventDefault(),
|
|
82
|
+
e.preventDefault(), y.length > 0 && y[y.length - 1].focus();
|
|
83
83
|
return;
|
|
84
84
|
case "Enter":
|
|
85
85
|
if (((r = document.activeElement) == null ? void 0 : r.getAttribute("role")) === "option")
|
|
86
86
|
return;
|
|
87
|
-
|
|
87
|
+
y.length > 0 && (e.preventDefault(), ((a == null ? void 0 : a.querySelector(
|
|
88
88
|
'[role="option"][data-focused="true"]'
|
|
89
|
-
)) ??
|
|
89
|
+
)) ?? y[0]).click());
|
|
90
90
|
return;
|
|
91
91
|
case "Escape":
|
|
92
|
-
e.preventDefault(),
|
|
92
|
+
e.preventDefault(), i == null || i.close();
|
|
93
93
|
return;
|
|
94
94
|
default:
|
|
95
95
|
(e.key.length === 1 || e.key === "Backspace" || e.key === "Delete" || e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End" || e.key === "Tab") && e.stopPropagation();
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ l(
|
|
99
99
|
"div",
|
|
100
100
|
{
|
|
101
101
|
"data-nested-select-overlay": !0,
|
|
102
102
|
className: "sticky top-0 z-10 border-b border-tertiary bg-primary p-1.5",
|
|
103
|
-
onMouseDown:
|
|
104
|
-
onPointerDown:
|
|
103
|
+
onMouseDown: S,
|
|
104
|
+
onPointerDown: d,
|
|
105
105
|
onClick: (e) => e.stopPropagation(),
|
|
106
|
-
children: /* @__PURE__ */
|
|
106
|
+
children: /* @__PURE__ */ P(
|
|
107
107
|
"div",
|
|
108
108
|
{
|
|
109
109
|
className: "flex h-8 items-center gap-2 rounded-lg bg-secondary px-2",
|
|
110
|
-
onMouseDown:
|
|
110
|
+
onMouseDown: S,
|
|
111
111
|
children: [
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ l(Te, { "aria-hidden": !0, className: "size-4 shrink-0 text-fg-quaternary" }),
|
|
113
|
+
/* @__PURE__ */ l(
|
|
114
114
|
"input",
|
|
115
115
|
{
|
|
116
116
|
type: "text",
|
|
117
117
|
role: "combobox",
|
|
118
118
|
"aria-autocomplete": "list",
|
|
119
|
-
"aria-expanded": (
|
|
120
|
-
"aria-controls":
|
|
121
|
-
value:
|
|
122
|
-
onChange:
|
|
123
|
-
onMouseDown:
|
|
124
|
-
onKeyDown:
|
|
125
|
-
onFocus: () =>
|
|
119
|
+
"aria-expanded": (i == null ? void 0 : i.isOpen) ?? !1,
|
|
120
|
+
"aria-controls": f,
|
|
121
|
+
value: s,
|
|
122
|
+
onChange: p,
|
|
123
|
+
onMouseDown: w,
|
|
124
|
+
onKeyDown: o,
|
|
125
|
+
onFocus: () => i == null ? void 0 : i.open(),
|
|
126
126
|
placeholder: b,
|
|
127
127
|
className: "w-full bg-transparent text-xs text-primary outline-none placeholder:text-placeholder_subtle",
|
|
128
128
|
autoFocus: !1
|
|
@@ -133,7 +133,7 @@ const He = ({
|
|
|
133
133
|
)
|
|
134
134
|
}
|
|
135
135
|
);
|
|
136
|
-
},
|
|
136
|
+
}, pe = we({
|
|
137
137
|
size: "sm",
|
|
138
138
|
selectedKeys: [],
|
|
139
139
|
selectedItems: {},
|
|
@@ -144,247 +144,288 @@ const He = ({
|
|
|
144
144
|
showAvatar: !0,
|
|
145
145
|
chipClassName: void 0,
|
|
146
146
|
searchable: !1
|
|
147
|
-
}),
|
|
148
|
-
items:
|
|
147
|
+
}), Xe = ({
|
|
148
|
+
items: s,
|
|
149
149
|
children: b,
|
|
150
|
-
size:
|
|
151
|
-
selectedItems:
|
|
152
|
-
onItemCleared:
|
|
153
|
-
onItemInserted:
|
|
154
|
-
onBulkSelectionChange:
|
|
155
|
-
shortcut:
|
|
156
|
-
placeholder:
|
|
150
|
+
size: f = "sm",
|
|
151
|
+
selectedItems: p,
|
|
152
|
+
onItemCleared: i,
|
|
153
|
+
onItemInserted: w,
|
|
154
|
+
onBulkSelectionChange: S,
|
|
155
|
+
shortcut: d,
|
|
156
|
+
placeholder: o = "Search",
|
|
157
157
|
showAvatar: e = !0,
|
|
158
158
|
readOnly: a = !1,
|
|
159
|
-
chipClassName:
|
|
159
|
+
chipClassName: y,
|
|
160
160
|
searchable: r = !1,
|
|
161
|
-
searchPlaceholder:
|
|
162
|
-
showSelectAll:
|
|
163
|
-
endAdornment:
|
|
164
|
-
description:
|
|
165
|
-
onOpenChange:
|
|
161
|
+
searchPlaceholder: M = "Search...",
|
|
162
|
+
showSelectAll: N = !1,
|
|
163
|
+
endAdornment: $,
|
|
164
|
+
description: W,
|
|
165
|
+
onOpenChange: u,
|
|
166
166
|
// Omit these props to avoid conflicts with the `Select` component
|
|
167
|
-
name:
|
|
168
|
-
className:
|
|
169
|
-
...
|
|
167
|
+
name: h,
|
|
168
|
+
className: A,
|
|
169
|
+
...g
|
|
170
170
|
}) => {
|
|
171
|
-
var
|
|
172
|
-
const
|
|
173
|
-
(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
171
|
+
var se;
|
|
172
|
+
const z = me(), { contains: j } = be({ sensitivity: "base" }), R = (se = p == null ? void 0 : p.items) != null && se.length ? p.items.map((t) => t.id) : [], x = K(
|
|
173
|
+
(t) => R.some((c) => String(c) === String(t)),
|
|
174
|
+
[R]
|
|
175
|
+
), U = K(
|
|
176
|
+
(t, c) => {
|
|
177
|
+
const v = oe(
|
|
178
|
+
t,
|
|
179
|
+
c,
|
|
180
|
+
j
|
|
178
181
|
);
|
|
179
|
-
return (
|
|
182
|
+
return (N || !x(t.id)) && v;
|
|
180
183
|
},
|
|
181
|
-
[
|
|
182
|
-
),
|
|
183
|
-
initialItems:
|
|
184
|
-
filter:
|
|
185
|
-
}),
|
|
186
|
-
(
|
|
187
|
-
) :
|
|
188
|
-
if (
|
|
189
|
-
const
|
|
190
|
-
(
|
|
184
|
+
[j, x, N]
|
|
185
|
+
), m = Ae({
|
|
186
|
+
initialItems: s,
|
|
187
|
+
filter: U
|
|
188
|
+
}), L = !!(r && m.filterText.trim()), T = C(() => s != null && s.length ? L ? s.filter(
|
|
189
|
+
(t) => oe(t, m.filterText, j)
|
|
190
|
+
) : s : [], [s, L, m.filterText, j]), O = C(() => {
|
|
191
|
+
if (T.length === 0) return "unselected";
|
|
192
|
+
const t = T.filter(
|
|
193
|
+
(c) => x(c.id)
|
|
191
194
|
).length;
|
|
192
|
-
return
|
|
193
|
-
}, [
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
if (n && te.length > 0 ? m.append(...te) : !n && re.length > 0 && m.remove(...re), k) {
|
|
198
|
-
k(ue);
|
|
195
|
+
return t === 0 ? "unselected" : t === T.length ? "selected" : "indeterminate";
|
|
196
|
+
}, [T, x]), n = K(() => {
|
|
197
|
+
const t = O !== "selected", c = T.map((D) => D.id), v = new Set(c.map(String)), E = t ? [.../* @__PURE__ */ new Set([...R, ...c])] : R.filter((D) => !v.has(String(D))), V = T.filter((D) => !x(D.id)), le = T.filter((D) => x(D.id)).map((D) => D.id);
|
|
198
|
+
if (t && V.length > 0 ? p.append(...V) : !t && le.length > 0 && p.remove(...le), S) {
|
|
199
|
+
S(E);
|
|
199
200
|
return;
|
|
200
201
|
}
|
|
201
|
-
if (
|
|
202
|
-
for (const
|
|
203
|
-
|
|
202
|
+
if (t) {
|
|
203
|
+
for (const D of T)
|
|
204
|
+
x(D.id) || w == null || w(D.id);
|
|
204
205
|
return;
|
|
205
206
|
}
|
|
206
|
-
for (const
|
|
207
|
-
|
|
207
|
+
for (const D of T)
|
|
208
|
+
x(D.id) && (i == null || i(D.id));
|
|
208
209
|
}, [
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
k,
|
|
210
|
+
O,
|
|
211
|
+
T,
|
|
212
|
+
R,
|
|
213
|
+
p,
|
|
214
214
|
x,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
215
|
+
S,
|
|
216
|
+
w,
|
|
217
|
+
i
|
|
218
|
+
]), F = K(
|
|
219
|
+
(t) => {
|
|
220
|
+
const c = t.values().next().value;
|
|
221
|
+
c && (p.remove(c), i == null || i(c));
|
|
220
222
|
},
|
|
221
|
-
[
|
|
222
|
-
),
|
|
223
|
-
if (
|
|
223
|
+
[p, i]
|
|
224
|
+
), q = G(null), X = (t) => {
|
|
225
|
+
if (t == null)
|
|
224
226
|
return;
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
(
|
|
229
|
-
|
|
227
|
+
const c = String(t);
|
|
228
|
+
if (q.current === c)
|
|
229
|
+
return;
|
|
230
|
+
q.current = c, setTimeout(() => {
|
|
231
|
+
q.current === c && (q.current = null);
|
|
232
|
+
}, 0);
|
|
233
|
+
const v = m.getItem(t) ?? (s == null ? void 0 : s.find((E) => String(E.id) === String(t)));
|
|
234
|
+
if (v) {
|
|
235
|
+
if (x(t)) {
|
|
236
|
+
const E = R.find((V) => String(V) === c) ?? t;
|
|
237
|
+
p.remove(E), i == null || i(E);
|
|
238
|
+
} else
|
|
239
|
+
p.append(v), w == null || w(t);
|
|
240
|
+
ae(r) && m.setFilterText("");
|
|
241
|
+
}
|
|
242
|
+
}, J = K(
|
|
243
|
+
(t) => {
|
|
244
|
+
if (!N || t === "all" || q.current !== null)
|
|
245
|
+
return;
|
|
246
|
+
const c = Array.from(t);
|
|
247
|
+
for (const v of R)
|
|
248
|
+
c.some((E) => String(E) === String(v)) || (p.remove(v), i == null || i(v));
|
|
249
|
+
for (const v of c)
|
|
250
|
+
if (!x(v)) {
|
|
251
|
+
const E = m.getItem(v) ?? (s == null ? void 0 : s.find((V) => String(V.id) === String(v)));
|
|
252
|
+
E && (p.append(E), w == null || w(v));
|
|
253
|
+
}
|
|
254
|
+
ae(r) && m.setFilterText("");
|
|
230
255
|
},
|
|
231
|
-
[
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
256
|
+
[
|
|
257
|
+
N,
|
|
258
|
+
R,
|
|
259
|
+
p,
|
|
260
|
+
x,
|
|
261
|
+
m,
|
|
262
|
+
s,
|
|
263
|
+
i,
|
|
264
|
+
w,
|
|
265
|
+
r
|
|
266
|
+
]
|
|
267
|
+
), Q = K(
|
|
268
|
+
(t) => {
|
|
269
|
+
!t && r && m.setFilterText(""), u == null || u(t);
|
|
270
|
+
},
|
|
271
|
+
[m, u, r]
|
|
272
|
+
), ee = (t) => {
|
|
273
|
+
a || m.setFilterText(t);
|
|
274
|
+
}, _ = G(null), te = G(null), [he, re] = ue(0), Z = K(() => {
|
|
275
|
+
var c;
|
|
276
|
+
if (!_.current) return;
|
|
277
|
+
let t = (c = _.current) == null ? void 0 : c.getBoundingClientRect();
|
|
278
|
+
re(t.width);
|
|
279
|
+
}, [_, re]);
|
|
280
|
+
fe({
|
|
281
|
+
ref: _,
|
|
282
|
+
onResize: Z,
|
|
243
283
|
box: "border-box"
|
|
244
284
|
});
|
|
245
|
-
const
|
|
246
|
-
return /* @__PURE__ */
|
|
247
|
-
|
|
285
|
+
const ne = N && !!(s != null && s.length) && (!L || T.length > 0), ie = je(L);
|
|
286
|
+
return /* @__PURE__ */ l(
|
|
287
|
+
pe.Provider,
|
|
248
288
|
{
|
|
249
289
|
value: {
|
|
250
|
-
size:
|
|
251
|
-
selectedKeys:
|
|
252
|
-
selectedItems:
|
|
253
|
-
onInputChange:
|
|
254
|
-
onRemove:
|
|
290
|
+
size: f,
|
|
291
|
+
selectedKeys: R,
|
|
292
|
+
selectedItems: p,
|
|
293
|
+
onInputChange: ee,
|
|
294
|
+
onRemove: F,
|
|
255
295
|
showAvatar: e,
|
|
256
|
-
chipClassName:
|
|
296
|
+
chipClassName: y,
|
|
257
297
|
searchable: r
|
|
258
298
|
},
|
|
259
|
-
children: /* @__PURE__ */
|
|
260
|
-
|
|
299
|
+
children: /* @__PURE__ */ l(
|
|
300
|
+
Se,
|
|
261
301
|
{
|
|
262
302
|
allowsEmptyCollection: !0,
|
|
263
303
|
allowsCustomValue: !1,
|
|
264
304
|
menuTrigger: r || a ? "manual" : "focus",
|
|
265
|
-
items:
|
|
266
|
-
onInputChange: r ? void 0 :
|
|
267
|
-
inputValue: r ? "" :
|
|
305
|
+
items: m.items,
|
|
306
|
+
onInputChange: r ? void 0 : ee,
|
|
307
|
+
inputValue: r ? "" : m.filterText,
|
|
268
308
|
selectedKey: null,
|
|
269
|
-
onSelectionChange:
|
|
270
|
-
onOpenChange:
|
|
271
|
-
...
|
|
272
|
-
children: (
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
-
|
|
309
|
+
onSelectionChange: X,
|
|
310
|
+
onOpenChange: Q,
|
|
311
|
+
...g,
|
|
312
|
+
children: (t) => /* @__PURE__ */ P("div", { className: "flex flex-col gap-1.5", children: [
|
|
313
|
+
/* @__PURE__ */ l(
|
|
314
|
+
Ge,
|
|
275
315
|
{
|
|
276
|
-
triggerRef:
|
|
277
|
-
popoverRef:
|
|
316
|
+
triggerRef: _,
|
|
317
|
+
popoverRef: te
|
|
278
318
|
}
|
|
279
319
|
),
|
|
280
|
-
|
|
281
|
-
|
|
320
|
+
g.label && /* @__PURE__ */ l(
|
|
321
|
+
Ke,
|
|
282
322
|
{
|
|
283
|
-
isRequired:
|
|
284
|
-
tooltip:
|
|
285
|
-
className:
|
|
286
|
-
children:
|
|
323
|
+
isRequired: t.isRequired,
|
|
324
|
+
tooltip: g.tooltip,
|
|
325
|
+
className: ce[f],
|
|
326
|
+
children: g.label
|
|
287
327
|
}
|
|
288
328
|
),
|
|
289
|
-
|
|
329
|
+
W && /* @__PURE__ */ l(
|
|
290
330
|
"p",
|
|
291
331
|
{
|
|
292
|
-
className:
|
|
332
|
+
className: k(
|
|
293
333
|
"text-tertiary",
|
|
294
|
-
|
|
334
|
+
ce[f],
|
|
295
335
|
"-mt-0.5 leading-[18px]"
|
|
296
336
|
),
|
|
297
|
-
children:
|
|
337
|
+
children: W
|
|
298
338
|
}
|
|
299
339
|
),
|
|
300
|
-
/* @__PURE__ */
|
|
301
|
-
|
|
340
|
+
/* @__PURE__ */ l(
|
|
341
|
+
Qe,
|
|
302
342
|
{
|
|
303
|
-
size:
|
|
304
|
-
shortcut:
|
|
305
|
-
ref:
|
|
306
|
-
placeholder:
|
|
343
|
+
size: f,
|
|
344
|
+
shortcut: d,
|
|
345
|
+
ref: _,
|
|
346
|
+
placeholder: o,
|
|
307
347
|
readOnly: a,
|
|
308
|
-
isInvalid:
|
|
309
|
-
endAdornment:
|
|
310
|
-
onFocus:
|
|
311
|
-
onPointerEnter:
|
|
348
|
+
isInvalid: t.isInvalid,
|
|
349
|
+
endAdornment: $,
|
|
350
|
+
onFocus: Z,
|
|
351
|
+
onPointerEnter: Z
|
|
312
352
|
}
|
|
313
353
|
),
|
|
314
|
-
(r ||
|
|
315
|
-
|
|
354
|
+
(r || ne || m.items.length > 0) && /* @__PURE__ */ P(
|
|
355
|
+
Le,
|
|
316
356
|
{
|
|
317
357
|
size: "md",
|
|
318
|
-
ref:
|
|
319
|
-
triggerRef:
|
|
320
|
-
className:
|
|
321
|
-
style: { width: Math.max(
|
|
322
|
-
onMouseDown: (
|
|
323
|
-
|
|
358
|
+
ref: te,
|
|
359
|
+
triggerRef: _,
|
|
360
|
+
className: k("flex flex-col", g == null ? void 0 : g.popoverClassName),
|
|
361
|
+
style: { width: Math.max(he, 40) },
|
|
362
|
+
onMouseDown: (c) => {
|
|
363
|
+
c.stopPropagation(), de(c);
|
|
324
364
|
},
|
|
325
|
-
onPointerDown: (
|
|
365
|
+
onPointerDown: (c) => c.stopPropagation(),
|
|
326
366
|
children: [
|
|
327
|
-
r && /* @__PURE__ */
|
|
328
|
-
|
|
367
|
+
r && /* @__PURE__ */ l(
|
|
368
|
+
Ue,
|
|
329
369
|
{
|
|
330
|
-
listboxId:
|
|
331
|
-
value:
|
|
332
|
-
placeholder:
|
|
333
|
-
onChange: (
|
|
370
|
+
listboxId: z,
|
|
371
|
+
value: m.filterText,
|
|
372
|
+
placeholder: M,
|
|
373
|
+
onChange: (c) => m.setFilterText(c.target.value)
|
|
334
374
|
}
|
|
335
375
|
),
|
|
336
|
-
|
|
376
|
+
ne && /* @__PURE__ */ P(
|
|
337
377
|
"div",
|
|
338
378
|
{
|
|
339
|
-
className:
|
|
379
|
+
className: k(
|
|
340
380
|
"flex shrink-0 items-center gap-2 border-b border-secondary px-3 py-2.5",
|
|
341
381
|
"cursor-pointer hover:bg-secondary_subtle transition-colors",
|
|
342
|
-
|
|
382
|
+
g.isDisabled && "cursor-not-allowed opacity-50"
|
|
343
383
|
),
|
|
344
|
-
onClick:
|
|
384
|
+
onClick: g.isDisabled ? void 0 : n,
|
|
345
385
|
children: [
|
|
346
|
-
|
|
386
|
+
O === "indeterminate" ? /* @__PURE__ */ l(
|
|
347
387
|
"span",
|
|
348
388
|
{
|
|
349
|
-
className:
|
|
389
|
+
className: k(
|
|
350
390
|
"flex size-4 shrink-0 items-center justify-center rounded ring-1 ring-inset",
|
|
351
391
|
"bg-brand-solid ring-bg-brand-solid text-fg-white"
|
|
352
392
|
),
|
|
353
393
|
"aria-hidden": !0,
|
|
354
|
-
children: /* @__PURE__ */
|
|
394
|
+
children: /* @__PURE__ */ l(ke, { className: "size-3 stroke-[2.5]" })
|
|
355
395
|
}
|
|
356
|
-
) : /* @__PURE__ */
|
|
357
|
-
|
|
396
|
+
) : /* @__PURE__ */ l(
|
|
397
|
+
We,
|
|
358
398
|
{
|
|
359
|
-
size:
|
|
360
|
-
checked:
|
|
361
|
-
onCheckedChange:
|
|
362
|
-
onClick: (
|
|
363
|
-
disabled:
|
|
364
|
-
"aria-label":
|
|
399
|
+
size: f === "lg" ? "md" : "sm",
|
|
400
|
+
checked: O === "selected",
|
|
401
|
+
onCheckedChange: n,
|
|
402
|
+
onClick: (c) => c.stopPropagation(),
|
|
403
|
+
disabled: g.isDisabled,
|
|
404
|
+
"aria-label": ie
|
|
365
405
|
}
|
|
366
406
|
),
|
|
367
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ l(
|
|
368
408
|
"span",
|
|
369
409
|
{
|
|
370
|
-
className:
|
|
371
|
-
children:
|
|
410
|
+
className: k("font-medium text-primary", I[f]),
|
|
411
|
+
children: ie
|
|
372
412
|
}
|
|
373
413
|
)
|
|
374
414
|
]
|
|
375
415
|
}
|
|
376
416
|
),
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
-
|
|
379
|
-
/* @__PURE__ */
|
|
380
|
-
|
|
417
|
+
/* @__PURE__ */ P("div", { className: "flex-1 overflow-y-auto", children: [
|
|
418
|
+
m.items.length === 0 && r && L && /* @__PURE__ */ l("div", { className: "flex items-center justify-center py-6", children: /* @__PURE__ */ l("p", { className: k("text-tertiary", I[f]), children: "No results" }) }),
|
|
419
|
+
/* @__PURE__ */ l(
|
|
420
|
+
Re,
|
|
381
421
|
{
|
|
382
|
-
id:
|
|
422
|
+
id: z,
|
|
383
423
|
selectionMode: "multiple",
|
|
384
|
-
selectedKeys:
|
|
385
|
-
|
|
424
|
+
selectedKeys: N ? new Set(R) : void 0,
|
|
425
|
+
onSelectionChange: N ? J : void 0,
|
|
426
|
+
className: k(
|
|
386
427
|
"size-full outline-hidden",
|
|
387
|
-
|
|
428
|
+
m.items.length === 0 && "hidden"
|
|
388
429
|
),
|
|
389
430
|
children: b
|
|
390
431
|
}
|
|
@@ -393,186 +434,186 @@ const He = ({
|
|
|
393
434
|
]
|
|
394
435
|
}
|
|
395
436
|
),
|
|
396
|
-
|
|
437
|
+
g.hint && /* @__PURE__ */ l(Pe, { isInvalid: t.isInvalid, children: g.hint })
|
|
397
438
|
] })
|
|
398
439
|
}
|
|
399
440
|
)
|
|
400
441
|
}
|
|
401
442
|
);
|
|
402
|
-
},
|
|
403
|
-
isDisabled:
|
|
443
|
+
}, Je = ({
|
|
444
|
+
isDisabled: s,
|
|
404
445
|
shortcut: b,
|
|
405
|
-
shortcutClassName:
|
|
406
|
-
placeholder:
|
|
407
|
-
readOnly:
|
|
408
|
-
isFocusWithin:
|
|
409
|
-
inputRef:
|
|
446
|
+
shortcutClassName: f,
|
|
447
|
+
placeholder: p,
|
|
448
|
+
readOnly: i = !1,
|
|
449
|
+
isFocusWithin: w,
|
|
450
|
+
inputRef: S
|
|
410
451
|
}) => {
|
|
411
|
-
var
|
|
412
|
-
const
|
|
413
|
-
const
|
|
414
|
-
if (!
|
|
415
|
-
|
|
452
|
+
var U, m, L, T, O;
|
|
453
|
+
const d = De(), o = H(pe), e = H(Y), a = w || !!(e != null && e.isOpen), y = G(null), [r, M] = ue(!1), N = (U = o == null ? void 0 : o.selectedItems) == null ? void 0 : U.items, $ = (N == null ? void 0 : N.map((n) => n.id).join("\0")) ?? "", W = (e == null ? void 0 : e.inputValue) ?? "", u = K(() => {
|
|
454
|
+
const n = y.current;
|
|
455
|
+
if (!n || a) {
|
|
456
|
+
M(!1);
|
|
416
457
|
return;
|
|
417
458
|
}
|
|
418
|
-
const
|
|
419
|
-
|
|
420
|
-
|
|
459
|
+
const F = n.scrollWidth > n.clientWidth + 0.5;
|
|
460
|
+
M(
|
|
461
|
+
F && n.scrollLeft + n.clientWidth < n.scrollWidth - 1
|
|
421
462
|
);
|
|
422
463
|
}, [a]);
|
|
423
|
-
|
|
424
|
-
ref:
|
|
425
|
-
onResize:
|
|
464
|
+
fe({
|
|
465
|
+
ref: y,
|
|
466
|
+
onResize: u,
|
|
426
467
|
box: "border-box"
|
|
427
|
-
}),
|
|
428
|
-
|
|
468
|
+
}), ye(() => {
|
|
469
|
+
u();
|
|
429
470
|
}, [
|
|
430
|
-
|
|
431
|
-
|
|
471
|
+
u,
|
|
472
|
+
$,
|
|
432
473
|
a,
|
|
433
|
-
|
|
474
|
+
W
|
|
434
475
|
]);
|
|
435
|
-
const
|
|
436
|
-
var
|
|
437
|
-
|
|
438
|
-
},
|
|
439
|
-
if (!(!(
|
|
440
|
-
switch (
|
|
476
|
+
const h = (n) => {
|
|
477
|
+
var F;
|
|
478
|
+
n.preventDefault(), (F = S.current) == null || F.focus({ preventScroll: !0 });
|
|
479
|
+
}, A = (n) => {
|
|
480
|
+
if (!(!(n.currentTarget.selectionStart === 0 && n.currentTarget.selectionEnd === 0) && n.currentTarget.value !== ""))
|
|
481
|
+
switch (n.key) {
|
|
441
482
|
case "Backspace":
|
|
442
483
|
case "ArrowLeft":
|
|
443
|
-
|
|
484
|
+
d == null || d.focusPrevious({ wrap: !1, tabbable: !1 });
|
|
444
485
|
break;
|
|
445
486
|
case "ArrowRight":
|
|
446
|
-
|
|
487
|
+
d == null || d.focusNext({ wrap: !1, tabbable: !1 });
|
|
447
488
|
break;
|
|
448
489
|
}
|
|
449
|
-
},
|
|
450
|
-
|
|
451
|
-
},
|
|
452
|
-
|
|
453
|
-
},
|
|
454
|
-
var
|
|
455
|
-
if (
|
|
490
|
+
}, g = o == null ? void 0 : o.searchable, z = (n) => {
|
|
491
|
+
n.stopPropagation(), e && !e.isOpen && e.open();
|
|
492
|
+
}, j = () => {
|
|
493
|
+
g && e && !e.isOpen && e.open();
|
|
494
|
+
}, R = (n, F) => {
|
|
495
|
+
var X, J, Q;
|
|
496
|
+
if (n.key === "Tab")
|
|
456
497
|
return;
|
|
457
|
-
|
|
458
|
-
const
|
|
459
|
-
switch (
|
|
498
|
+
n.preventDefault();
|
|
499
|
+
const q = ((Q = (J = (X = o == null ? void 0 : o.selectedItems) == null ? void 0 : X.items) == null ? void 0 : J[0]) == null ? void 0 : Q.id) === F;
|
|
500
|
+
switch (n.key) {
|
|
460
501
|
case " ":
|
|
461
502
|
case "Enter":
|
|
462
503
|
case "Backspace":
|
|
463
|
-
|
|
504
|
+
q ? d == null || d.focusNext({ wrap: !1, tabbable: !1 }) : d == null || d.focusPrevious({ wrap: !1, tabbable: !1 }), o.onRemove(/* @__PURE__ */ new Set([F]));
|
|
464
505
|
break;
|
|
465
506
|
case "ArrowLeft":
|
|
466
|
-
|
|
507
|
+
d == null || d.focusPrevious({ wrap: !1, tabbable: !1 });
|
|
467
508
|
break;
|
|
468
509
|
case "ArrowRight":
|
|
469
|
-
|
|
510
|
+
d == null || d.focusNext({ wrap: !1, tabbable: !1 });
|
|
470
511
|
break;
|
|
471
512
|
case "Escape":
|
|
472
513
|
e == null || e.close();
|
|
473
514
|
break;
|
|
474
515
|
}
|
|
475
|
-
},
|
|
476
|
-
return /* @__PURE__ */
|
|
477
|
-
/* @__PURE__ */
|
|
516
|
+
}, x = ((L = (m = o == null ? void 0 : o.selectedItems) == null ? void 0 : m.items) == null ? void 0 : L.length) === 0;
|
|
517
|
+
return /* @__PURE__ */ P("div", { className: "relative min-w-0 w-full flex-1", children: [
|
|
518
|
+
/* @__PURE__ */ P(
|
|
478
519
|
"div",
|
|
479
520
|
{
|
|
480
|
-
ref:
|
|
481
|
-
onScroll: a ? void 0 :
|
|
482
|
-
className:
|
|
521
|
+
ref: y,
|
|
522
|
+
onScroll: a ? void 0 : u,
|
|
523
|
+
className: k(
|
|
483
524
|
"flex w-full min-w-0 gap-1.5",
|
|
484
|
-
a ?
|
|
525
|
+
a ? k(
|
|
485
526
|
"flex-wrap items-start overflow-y-auto scrollbar-hide"
|
|
486
527
|
// multiSelectExpandedMaxHeight[controlSize],
|
|
487
528
|
) : "flex-nowrap items-center overflow-x-auto overflow-y-hidden scrollbar-hide"
|
|
488
529
|
),
|
|
489
530
|
children: [
|
|
490
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ l(B.Provider, { value: null, children: !x && ((O = (T = o == null ? void 0 : o.selectedItems) == null ? void 0 : T.items) == null ? void 0 : O.map((n) => /* @__PURE__ */ P(
|
|
491
532
|
"span",
|
|
492
533
|
{
|
|
493
534
|
"data-multiselect-chip": !0,
|
|
494
|
-
className:
|
|
535
|
+
className: k(
|
|
495
536
|
"flex items-center rounded-md bg-primary py-0.5 pr-1 pl-1.25 ring-1 ring-[var(--color-gray-100)] ring-inset",
|
|
496
537
|
!a && "shrink-0",
|
|
497
|
-
|
|
538
|
+
o == null ? void 0 : o.chipClassName
|
|
498
539
|
),
|
|
499
540
|
children: [
|
|
500
|
-
/* @__PURE__ */
|
|
541
|
+
/* @__PURE__ */ P(
|
|
501
542
|
"span",
|
|
502
543
|
{
|
|
503
544
|
className: "flex min-w-0 items-center",
|
|
504
|
-
onMouseDown:
|
|
545
|
+
onMouseDown: h,
|
|
505
546
|
children: [
|
|
506
|
-
(
|
|
507
|
-
|
|
547
|
+
(o == null ? void 0 : o.showAvatar) && /* @__PURE__ */ l(
|
|
548
|
+
Ee,
|
|
508
549
|
{
|
|
509
550
|
size: "xxs",
|
|
510
|
-
alt:
|
|
511
|
-
src:
|
|
512
|
-
initials:
|
|
551
|
+
alt: n == null ? void 0 : n.label,
|
|
552
|
+
src: n == null ? void 0 : n.avatarUrl,
|
|
553
|
+
initials: n == null ? void 0 : n.initials
|
|
513
554
|
}
|
|
514
555
|
),
|
|
515
|
-
/* @__PURE__ */
|
|
556
|
+
/* @__PURE__ */ l("p", { className: "ml-1.25 truncate text-xs font-medium whitespace-nowrap text-secondary select-none", children: n == null ? void 0 : n.label })
|
|
516
557
|
]
|
|
517
558
|
}
|
|
518
559
|
),
|
|
519
|
-
/* @__PURE__ */
|
|
520
|
-
|
|
560
|
+
/* @__PURE__ */ l(
|
|
561
|
+
Oe,
|
|
521
562
|
{
|
|
522
563
|
size: "md",
|
|
523
|
-
isDisabled:
|
|
564
|
+
isDisabled: s,
|
|
524
565
|
preventFocusOnPress: !a,
|
|
525
566
|
className: "ml-0.75",
|
|
526
|
-
onKeyDown: (
|
|
527
|
-
onPress: () =>
|
|
567
|
+
onKeyDown: (F) => R(F, n.id),
|
|
568
|
+
onPress: () => o.onRemove(/* @__PURE__ */ new Set([n.id]))
|
|
528
569
|
}
|
|
529
570
|
)
|
|
530
571
|
]
|
|
531
572
|
},
|
|
532
|
-
|
|
573
|
+
n.id
|
|
533
574
|
))) }),
|
|
534
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ P(
|
|
535
576
|
"div",
|
|
536
577
|
{
|
|
537
|
-
className:
|
|
578
|
+
className: k(
|
|
538
579
|
"relative flex flex-1 flex-row items-center",
|
|
539
580
|
a ? "min-w-[20%]" : "min-w-0",
|
|
540
|
-
!
|
|
581
|
+
!x && "ml-0.5",
|
|
541
582
|
b && "min-w-[30%]"
|
|
542
583
|
),
|
|
543
584
|
children: [
|
|
544
|
-
/* @__PURE__ */
|
|
545
|
-
|
|
585
|
+
/* @__PURE__ */ l(
|
|
586
|
+
Me,
|
|
546
587
|
{
|
|
547
|
-
ref:
|
|
548
|
-
placeholder:
|
|
549
|
-
onKeyDown:
|
|
550
|
-
onMouseDown:
|
|
551
|
-
onFocus:
|
|
552
|
-
readOnly:
|
|
553
|
-
className:
|
|
588
|
+
ref: S,
|
|
589
|
+
placeholder: x ? p : void 0,
|
|
590
|
+
onKeyDown: A,
|
|
591
|
+
onMouseDown: z,
|
|
592
|
+
onFocus: j,
|
|
593
|
+
readOnly: i || g,
|
|
594
|
+
className: k(
|
|
554
595
|
"w-full min-w-0 flex-[1_0_0] appearance-none bg-transparent text-ellipsis text-primary caret-alpha-black/90 outline-none placeholder:text-placeholder_subtle focus:outline-hidden disabled:cursor-not-allowed disabled:text-disabled disabled:placeholder:text-disabled",
|
|
555
|
-
|
|
556
|
-
|
|
596
|
+
i && "cursor-default",
|
|
597
|
+
I[(o == null ? void 0 : o.size) || "sm"]
|
|
557
598
|
)
|
|
558
599
|
}
|
|
559
600
|
),
|
|
560
|
-
b && /* @__PURE__ */
|
|
601
|
+
b && /* @__PURE__ */ l(
|
|
561
602
|
"div",
|
|
562
603
|
{
|
|
563
604
|
"aria-hidden": "true",
|
|
564
|
-
className:
|
|
605
|
+
className: k(
|
|
565
606
|
"absolute inset-y-0.5 right-0.5 z-10 flex items-center rounded-r-[inherit] bg-linear-to-r from-transparent to-bg-primary to-40% pl-8",
|
|
566
|
-
|
|
607
|
+
f
|
|
567
608
|
),
|
|
568
|
-
children: /* @__PURE__ */
|
|
609
|
+
children: /* @__PURE__ */ l(
|
|
569
610
|
"span",
|
|
570
611
|
{
|
|
571
|
-
className:
|
|
612
|
+
className: k(
|
|
572
613
|
"pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset",
|
|
573
|
-
|
|
614
|
+
s && "bg-transparent text-disabled"
|
|
574
615
|
),
|
|
575
|
-
children:
|
|
616
|
+
children: _e(["meta"], "K")
|
|
576
617
|
}
|
|
577
618
|
)
|
|
578
619
|
}
|
|
@@ -583,7 +624,7 @@ const He = ({
|
|
|
583
624
|
]
|
|
584
625
|
}
|
|
585
626
|
),
|
|
586
|
-
!a && r && /* @__PURE__ */
|
|
627
|
+
!a && r && /* @__PURE__ */ l(
|
|
587
628
|
"div",
|
|
588
629
|
{
|
|
589
630
|
"aria-hidden": !0,
|
|
@@ -591,99 +632,99 @@ const He = ({
|
|
|
591
632
|
}
|
|
592
633
|
)
|
|
593
634
|
] });
|
|
594
|
-
},
|
|
595
|
-
size:
|
|
635
|
+
}, Qe = ({
|
|
636
|
+
size: s,
|
|
596
637
|
shortcut: b,
|
|
597
|
-
placeholder:
|
|
598
|
-
shortcutClassName:
|
|
599
|
-
placeholderIcon:
|
|
600
|
-
readOnly:
|
|
601
|
-
isDisabled:
|
|
602
|
-
isInvalid:
|
|
603
|
-
ref:
|
|
638
|
+
placeholder: f,
|
|
639
|
+
shortcutClassName: p,
|
|
640
|
+
placeholderIcon: i = null,
|
|
641
|
+
readOnly: w = !1,
|
|
642
|
+
isDisabled: S,
|
|
643
|
+
isInvalid: d,
|
|
644
|
+
ref: o,
|
|
604
645
|
endAdornment: e,
|
|
605
646
|
...a
|
|
606
647
|
}) => {
|
|
607
|
-
const
|
|
608
|
-
() =>
|
|
609
|
-
[
|
|
610
|
-
),
|
|
611
|
-
(
|
|
612
|
-
var
|
|
613
|
-
if (
|
|
648
|
+
const y = G(null), r = H(Y), M = H(B), N = M && typeof M == "object" && "ref" in M ? M.ref : void 0, $ = C(
|
|
649
|
+
() => He(o ?? void 0, N ?? void 0),
|
|
650
|
+
[o, N]
|
|
651
|
+
), W = K(
|
|
652
|
+
(u) => {
|
|
653
|
+
var A, g;
|
|
654
|
+
if (S)
|
|
614
655
|
return;
|
|
615
|
-
const
|
|
616
|
-
if (
|
|
617
|
-
if (
|
|
618
|
-
if (
|
|
656
|
+
const h = u.target;
|
|
657
|
+
if (h instanceof Element && !h.closest("button")) {
|
|
658
|
+
if (w) {
|
|
659
|
+
if (h.closest("input") || h.closest("[data-multiselect-chip]"))
|
|
619
660
|
return;
|
|
620
|
-
|
|
661
|
+
u.preventDefault(), r != null && r.isOpen ? (r.close(), (A = y.current) == null || A.blur()) : r == null || r.open();
|
|
621
662
|
return;
|
|
622
663
|
}
|
|
623
|
-
|
|
664
|
+
h.closest("input") || (u.preventDefault(), (g = y.current) == null || g.focus({ preventScroll: !0 }));
|
|
624
665
|
}
|
|
625
666
|
},
|
|
626
|
-
[
|
|
667
|
+
[S, w, r]
|
|
627
668
|
);
|
|
628
|
-
return /* @__PURE__ */
|
|
629
|
-
|
|
669
|
+
return /* @__PURE__ */ l(
|
|
670
|
+
Fe,
|
|
630
671
|
{
|
|
631
672
|
...a,
|
|
632
|
-
ref:
|
|
633
|
-
onMouseDown: (
|
|
634
|
-
var
|
|
635
|
-
|
|
673
|
+
ref: $,
|
|
674
|
+
onMouseDown: (u) => {
|
|
675
|
+
var h;
|
|
676
|
+
u.stopPropagation(), (h = a.onMouseDown) == null || h.call(a, u);
|
|
636
677
|
},
|
|
637
|
-
onPointerDown: (
|
|
638
|
-
var
|
|
639
|
-
|
|
678
|
+
onPointerDown: (u) => {
|
|
679
|
+
var h;
|
|
680
|
+
u.stopPropagation(), (h = a.onPointerDown) == null || h.call(a, u);
|
|
640
681
|
},
|
|
641
|
-
onMouseDownCapture: (
|
|
642
|
-
var
|
|
643
|
-
(
|
|
682
|
+
onMouseDownCapture: (u) => {
|
|
683
|
+
var h;
|
|
684
|
+
(h = a.onMouseDownCapture) == null || h.call(a, u), W(u);
|
|
644
685
|
},
|
|
645
|
-
className: ({ isFocusWithin:
|
|
646
|
-
const
|
|
647
|
-
return
|
|
686
|
+
className: ({ isFocusWithin: u, isDisabled: h }) => {
|
|
687
|
+
const A = u || !!(r != null && r.isOpen);
|
|
688
|
+
return k(
|
|
648
689
|
"relative flex w-full gap-2 rounded-md bg-primary ring-1 outline-hidden duration-100 ease-linear ring-inset",
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
690
|
+
d ? "ring-error" : u ? "ring-brand" : "ring-[var(--color-border-secondary)]",
|
|
691
|
+
h && "cursor-not-allowed bg-disabled_subtle",
|
|
692
|
+
A ? "items-start" : "items-center",
|
|
693
|
+
A ? Ve[s] : ze[s].root
|
|
653
694
|
);
|
|
654
695
|
},
|
|
655
|
-
children: ({ isDisabled:
|
|
656
|
-
|
|
657
|
-
/* @__PURE__ */
|
|
658
|
-
|
|
696
|
+
children: ({ isDisabled: u, isFocusWithin: h }) => /* @__PURE__ */ P(ge, { children: [
|
|
697
|
+
i && /* @__PURE__ */ l(i, { className: "pointer-events-none size-5 shrink-0 text-fg-quaternary" }),
|
|
698
|
+
/* @__PURE__ */ l(ve, { contain: !1, autoFocus: !1, restoreFocus: !1, children: /* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ l(
|
|
699
|
+
Je,
|
|
659
700
|
{
|
|
660
|
-
inputRef:
|
|
661
|
-
isDisabled:
|
|
662
|
-
isFocusWithin:
|
|
701
|
+
inputRef: y,
|
|
702
|
+
isDisabled: u,
|
|
703
|
+
isFocusWithin: h,
|
|
663
704
|
shortcut: b,
|
|
664
|
-
shortcutClassName:
|
|
665
|
-
placeholder:
|
|
666
|
-
readOnly:
|
|
705
|
+
shortcutClassName: p,
|
|
706
|
+
placeholder: f,
|
|
707
|
+
readOnly: w
|
|
667
708
|
}
|
|
668
709
|
) }) }),
|
|
669
|
-
e ? /* @__PURE__ */
|
|
670
|
-
/* @__PURE__ */
|
|
710
|
+
e ? /* @__PURE__ */ l(B.Provider, { value: null, children: /* @__PURE__ */ l("div", { className: "flex shrink-0 items-center self-center", children: e }) }) : null,
|
|
711
|
+
/* @__PURE__ */ l(
|
|
671
712
|
"button",
|
|
672
713
|
{
|
|
673
714
|
type: "button",
|
|
674
715
|
tabIndex: -1,
|
|
675
|
-
disabled:
|
|
716
|
+
disabled: u,
|
|
676
717
|
"aria-label": r != null && r.isOpen ? "Close options" : "Open options",
|
|
677
718
|
className: "shrink-0 self-center rounded p-0.5 text-fg-quaternary hover:text-fg-secondary disabled:cursor-not-allowed disabled:opacity-50",
|
|
678
|
-
onMouseDown: (
|
|
679
|
-
var
|
|
680
|
-
|
|
719
|
+
onMouseDown: (A) => {
|
|
720
|
+
var g, z;
|
|
721
|
+
A.preventDefault(), A.stopPropagation(), r != null && r.isOpen ? (r.close(), (g = y.current) == null || g.blur()) : (r == null || r.open(), (z = y.current) == null || z.focus({ preventScroll: !0 }));
|
|
681
722
|
},
|
|
682
|
-
children: /* @__PURE__ */
|
|
683
|
-
|
|
723
|
+
children: /* @__PURE__ */ l(
|
|
724
|
+
Ne,
|
|
684
725
|
{
|
|
685
726
|
"aria-hidden": "true",
|
|
686
|
-
className:
|
|
727
|
+
className: s === "lg" ? "size-5" : "size-4"
|
|
687
728
|
}
|
|
688
729
|
)
|
|
689
730
|
}
|
|
@@ -691,10 +732,10 @@ const He = ({
|
|
|
691
732
|
] })
|
|
692
733
|
}
|
|
693
734
|
);
|
|
694
|
-
},
|
|
695
|
-
|
|
735
|
+
}, Ye = Xe;
|
|
736
|
+
Ye.Item = qe;
|
|
696
737
|
export {
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
738
|
+
Ye as MultiSelect,
|
|
739
|
+
Xe as MultiSelectBase,
|
|
740
|
+
Qe as MultiSelectTagsValue
|
|
700
741
|
};
|