@mzc-fe/design-system 0.0.11-rc.2 → 0.0.11-rc.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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import * as
|
|
4
|
-
import { MinusIcon as
|
|
3
|
+
import * as t from "@radix-ui/react-checkbox";
|
|
4
|
+
import { MinusIcon as n, CheckIcon as o } from "lucide-react";
|
|
5
5
|
import { cn as d } from "../../lib/utils.js";
|
|
6
|
-
function b({ className:
|
|
6
|
+
function b({ className: a, checked: e, ...i }) {
|
|
7
7
|
return /* @__PURE__ */ r(
|
|
8
|
-
|
|
8
|
+
t.Root,
|
|
9
9
|
{
|
|
10
10
|
"data-slot": "checkbox",
|
|
11
11
|
className: d(
|
|
@@ -17,16 +17,16 @@ function b({ className: i, checked: e, ...t }) {
|
|
|
17
17
|
"data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground",
|
|
18
18
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
19
19
|
"dark:bg-input/30 dark:data-[state=checked]:bg-primary dark:data-[state=indeterminate]:bg-primary dark:aria-invalid:ring-error/40",
|
|
20
|
-
|
|
20
|
+
a
|
|
21
21
|
),
|
|
22
22
|
checked: e,
|
|
23
|
-
...
|
|
23
|
+
...i,
|
|
24
24
|
children: /* @__PURE__ */ r(
|
|
25
|
-
|
|
25
|
+
t.Indicator,
|
|
26
26
|
{
|
|
27
27
|
"data-slot": "checkbox-indicator",
|
|
28
28
|
className: "grid place-content-center text-current transition-none",
|
|
29
|
-
children: e === "indeterminate" ? /* @__PURE__ */ r(
|
|
29
|
+
children: e === "indeterminate" ? /* @__PURE__ */ r(n, { className: "size-3.5 text-current" }) : /* @__PURE__ */ r(o, { className: "size-3.5 text-current" })
|
|
30
30
|
}
|
|
31
31
|
)
|
|
32
32
|
}
|
|
@@ -46,8 +46,10 @@ export type ComboboxTriggerProps = React.ComponentProps<"button"> & {
|
|
|
46
46
|
groupLabel?: string;
|
|
47
47
|
/** 트리거에 표시할 Avatar 등 앞쪽 요소 */
|
|
48
48
|
avatar?: React.ReactNode;
|
|
49
|
+
/** 다중 선택 시 노출할 최대 배지 개수. 초과분은 `+N` 배지로 축약 (undefined면 전체 노출) */
|
|
50
|
+
maxVisibleBadges?: number;
|
|
49
51
|
};
|
|
50
|
-
export declare function ComboboxTrigger({ className, placeholder, groupLabel, avatar, ...props }: ComboboxTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare function ComboboxTrigger({ className, placeholder, groupLabel, avatar, maxVisibleBadges, ...props }: ComboboxTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
51
53
|
export type ComboboxContentProps = React.ComponentProps<typeof PopoverPrimitive.Content> & {
|
|
52
54
|
/** 검색 필터 함수 (cmdk filter) */
|
|
53
55
|
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as k, Fragment as G } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import { Command as
|
|
3
|
+
import { Command as S } from "cmdk";
|
|
4
4
|
import "@radix-ui/react-accessible-icon";
|
|
5
5
|
import "@radix-ui/react-accordion";
|
|
6
6
|
import "@radix-ui/react-alert-dialog";
|
|
@@ -36,155 +36,170 @@ import "@radix-ui/react-toggle-group";
|
|
|
36
36
|
import "@radix-ui/react-toolbar";
|
|
37
37
|
import "@radix-ui/react-tooltip";
|
|
38
38
|
import "@radix-ui/react-visually-hidden";
|
|
39
|
-
import { XIcon as
|
|
40
|
-
import { cn as
|
|
41
|
-
import { Badge as
|
|
42
|
-
import { Checkbox as
|
|
43
|
-
const
|
|
39
|
+
import { XIcon as K, ChevronDownIcon as U, ChevronsUpDownIcon as V, SearchIcon as X, CheckIcon as $ } from "lucide-react";
|
|
40
|
+
import { cn as h } from "../../lib/utils.js";
|
|
41
|
+
import { Badge as P } from "../badge/badge.js";
|
|
42
|
+
import { Checkbox as q } from "../checkbox/checkbox.js";
|
|
43
|
+
const j = n.createContext(null);
|
|
44
44
|
function D() {
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
45
|
+
const r = n.useContext(j);
|
|
46
|
+
if (!r)
|
|
47
47
|
throw new Error("Combobox 하위 컴포넌트는 <Combobox> 내부에서 사용해야 합니다.");
|
|
48
|
-
return
|
|
48
|
+
return r;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
open:
|
|
50
|
+
function Re({
|
|
51
|
+
open: r,
|
|
52
52
|
defaultOpen: o = !1,
|
|
53
53
|
onOpenChange: s,
|
|
54
|
-
value:
|
|
55
|
-
defaultValue:
|
|
56
|
-
onValueChange:
|
|
57
|
-
multiple:
|
|
58
|
-
disabled:
|
|
59
|
-
children:
|
|
54
|
+
value: l,
|
|
55
|
+
defaultValue: d,
|
|
56
|
+
onValueChange: f,
|
|
57
|
+
multiple: v = !1,
|
|
58
|
+
disabled: t = !1,
|
|
59
|
+
children: i
|
|
60
60
|
}) {
|
|
61
|
-
const [
|
|
62
|
-
(
|
|
63
|
-
|
|
61
|
+
const [I, x] = n.useState(o), m = r ?? I, g = n.useCallback(
|
|
62
|
+
(c) => {
|
|
63
|
+
x(c), s?.(c);
|
|
64
64
|
},
|
|
65
65
|
[s]
|
|
66
|
-
), [
|
|
67
|
-
() =>
|
|
68
|
-
),
|
|
69
|
-
(
|
|
70
|
-
|
|
66
|
+
), [C, y] = n.useState(
|
|
67
|
+
() => d ?? (v ? [] : "")
|
|
68
|
+
), p = l ?? C, u = n.useCallback(
|
|
69
|
+
(c) => {
|
|
70
|
+
y(c), f?.(c);
|
|
71
71
|
},
|
|
72
|
-
[
|
|
73
|
-
), [
|
|
74
|
-
|
|
75
|
-
if (
|
|
76
|
-
const
|
|
77
|
-
return
|
|
72
|
+
[f]
|
|
73
|
+
), [a, b] = n.useState(() => /* @__PURE__ */ new Map()), w = n.useCallback((c, z) => {
|
|
74
|
+
b((N) => {
|
|
75
|
+
if (N.get(c) === z) return N;
|
|
76
|
+
const M = new Map(N);
|
|
77
|
+
return M.set(c, z), M;
|
|
78
78
|
});
|
|
79
|
-
}, []), [
|
|
80
|
-
_((
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
return
|
|
79
|
+
}, []), [A, _] = n.useState(() => /* @__PURE__ */ new Map()), R = n.useCallback((c, z) => {
|
|
80
|
+
_((N) => {
|
|
81
|
+
if (N.get(c) === z) return N;
|
|
82
|
+
const M = new Map(N);
|
|
83
|
+
return M.set(c, z), M;
|
|
84
84
|
});
|
|
85
|
-
}, []), [
|
|
86
|
-
|
|
85
|
+
}, []), [T, L] = n.useState(""), O = n.useCallback((c) => {
|
|
86
|
+
L(c);
|
|
87
87
|
}, []);
|
|
88
88
|
n.useEffect(() => {
|
|
89
|
-
|
|
90
|
-
}, [
|
|
91
|
-
const
|
|
89
|
+
m || L("");
|
|
90
|
+
}, [m]);
|
|
91
|
+
const F = n.useMemo(
|
|
92
92
|
() => ({
|
|
93
|
-
open:
|
|
94
|
-
onOpenChange:
|
|
95
|
-
value:
|
|
96
|
-
onValueChange:
|
|
97
|
-
multiple:
|
|
98
|
-
disabled:
|
|
99
|
-
labelMap:
|
|
100
|
-
registerLabel:
|
|
101
|
-
avatarMap:
|
|
102
|
-
registerAvatar:
|
|
103
|
-
searchValue:
|
|
104
|
-
onSearchValueChange:
|
|
93
|
+
open: m,
|
|
94
|
+
onOpenChange: g,
|
|
95
|
+
value: p,
|
|
96
|
+
onValueChange: u,
|
|
97
|
+
multiple: v,
|
|
98
|
+
disabled: t,
|
|
99
|
+
labelMap: a,
|
|
100
|
+
registerLabel: w,
|
|
101
|
+
avatarMap: A,
|
|
102
|
+
registerAvatar: R,
|
|
103
|
+
searchValue: T,
|
|
104
|
+
onSearchValueChange: O
|
|
105
105
|
}),
|
|
106
106
|
[
|
|
107
|
-
x,
|
|
108
|
-
d,
|
|
109
107
|
m,
|
|
110
|
-
|
|
111
|
-
t,
|
|
112
|
-
c,
|
|
108
|
+
g,
|
|
113
109
|
p,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
u,
|
|
111
|
+
v,
|
|
112
|
+
t,
|
|
113
|
+
a,
|
|
114
|
+
w,
|
|
115
|
+
A,
|
|
117
116
|
R,
|
|
118
|
-
|
|
117
|
+
T,
|
|
118
|
+
O
|
|
119
119
|
]
|
|
120
120
|
);
|
|
121
|
-
return /* @__PURE__ */ e(
|
|
121
|
+
return /* @__PURE__ */ e(j.Provider, { value: F, children: /* @__PURE__ */ e(E.Root, { "data-slot": "combobox", open: m, onOpenChange: g, children: i }) });
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
className:
|
|
123
|
+
function Te({
|
|
124
|
+
className: r,
|
|
125
125
|
placeholder: o = "Select...",
|
|
126
126
|
groupLabel: s,
|
|
127
|
-
avatar:
|
|
128
|
-
|
|
127
|
+
avatar: l,
|
|
128
|
+
maxVisibleBadges: d,
|
|
129
|
+
...f
|
|
129
130
|
}) {
|
|
130
|
-
const { open:
|
|
131
|
-
|
|
132
|
-
},
|
|
133
|
-
return /* @__PURE__ */ e(E.Trigger, { asChild: !0, children: /* @__PURE__ */
|
|
131
|
+
const { open: v, value: t, multiple: i, disabled: I, labelMap: x, avatarMap: m, onValueChange: g } = D(), C = i ? Array.isArray(t) && t.length > 0 : typeof t == "string" && t !== "", y = (a, b) => {
|
|
132
|
+
a.preventDefault(), a.stopPropagation(), Array.isArray(t) && g(t.filter((w) => w !== b));
|
|
133
|
+
}, p = C && typeof t == "string" ? x.get(t) ?? t : o, u = !i && typeof t == "string" && t !== "" ? m.get(t) ?? l : l;
|
|
134
|
+
return /* @__PURE__ */ e(E.Trigger, { asChild: !0, children: /* @__PURE__ */ k(
|
|
134
135
|
"button",
|
|
135
136
|
{
|
|
136
137
|
type: "button",
|
|
137
138
|
role: "combobox",
|
|
138
|
-
"aria-expanded":
|
|
139
|
-
disabled:
|
|
139
|
+
"aria-expanded": v,
|
|
140
|
+
disabled: I,
|
|
140
141
|
"data-slot": "combobox-trigger",
|
|
141
|
-
className:
|
|
142
|
+
className: h(
|
|
142
143
|
"border-input dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center gap-2 rounded-md border bg-transparent px-4 text-sm font-medium shadow-xs transition-[color,box-shadow] outline-none",
|
|
143
144
|
"hover:bg-accent-1/50",
|
|
144
145
|
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
145
146
|
"active:opacity-60",
|
|
146
147
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
147
|
-
!
|
|
148
|
-
!
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
!i && !s && "h-9 py-2",
|
|
149
|
+
!i && s && "h-12",
|
|
150
|
+
i && "min-h-9 py-2",
|
|
151
|
+
r
|
|
151
152
|
),
|
|
152
|
-
...
|
|
153
|
+
...f,
|
|
153
154
|
children: [
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
u && /* @__PURE__ */ e("span", { "data-slot": "combobox-trigger-avatar", className: "shrink-0", children: u }),
|
|
156
|
+
i && Array.isArray(t) ? /* @__PURE__ */ e("span", { className: "flex min-h-5 min-w-0 flex-1 flex-wrap items-center gap-1", children: t.length > 0 ? /* @__PURE__ */ k(G, { children: [
|
|
157
|
+
(d !== void 0 ? t.slice(0, d) : t).map((a) => /* @__PURE__ */ k(P, { variant: "outline", className: "gap-1 rounded-md px-2 py-0.5 text-xs font-semibold", children: [
|
|
158
|
+
m.get(a) && /* @__PURE__ */ e("span", { className: "shrink-0 [&_[data-slot=avatar-fallback]]:text-[6px] [&_[data-slot=avatar]]:size-3", children: m.get(a) }),
|
|
159
|
+
x.get(a) ?? a,
|
|
160
|
+
/* @__PURE__ */ e(
|
|
161
|
+
"span",
|
|
162
|
+
{
|
|
163
|
+
role: "button",
|
|
164
|
+
tabIndex: 0,
|
|
165
|
+
"aria-label": `Remove ${x.get(a) ?? a}`,
|
|
166
|
+
className: "hover:text-foreground text-muted-foreground inline-flex cursor-pointer rounded-sm outline-none focus-visible:ring-1",
|
|
167
|
+
onClick: (b) => y(b, a),
|
|
168
|
+
onKeyDown: (b) => {
|
|
169
|
+
(b.key === "Enter" || b.key === " ") && y(b, a);
|
|
170
|
+
},
|
|
171
|
+
children: /* @__PURE__ */ e(K, { className: "size-3" })
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
] }, a)),
|
|
175
|
+
d !== void 0 && t.length > d && /* @__PURE__ */ k(
|
|
176
|
+
P,
|
|
160
177
|
{
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
"
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
},
|
|
169
|
-
children: /* @__PURE__ */ e(j, { className: "size-3" })
|
|
178
|
+
"data-slot": "combobox-trigger-badge-overflow",
|
|
179
|
+
variant: "outline",
|
|
180
|
+
className: "rounded-md px-2 py-0.5 text-xs font-semibold",
|
|
181
|
+
children: [
|
|
182
|
+
"+",
|
|
183
|
+
t.length - d
|
|
184
|
+
]
|
|
170
185
|
}
|
|
171
186
|
)
|
|
172
|
-
] }
|
|
187
|
+
] }) : /* @__PURE__ */ e("span", { className: "text-muted-foreground truncate", children: o }) }) : s ? /* @__PURE__ */ k("span", { className: "flex min-w-0 flex-1 flex-col items-start gap-0.5", children: [
|
|
173
188
|
/* @__PURE__ */ e("span", { "data-slot": "combobox-group-label", className: "text-muted-foreground text-xs leading-none font-medium", children: s }),
|
|
174
|
-
/* @__PURE__ */ e("span", { className:
|
|
175
|
-
] }) : /* @__PURE__ */ e("span", { className:
|
|
176
|
-
s ? /* @__PURE__ */ e(
|
|
189
|
+
/* @__PURE__ */ e("span", { className: h("w-full truncate text-left", !C && "text-muted-foreground"), children: p })
|
|
190
|
+
] }) : /* @__PURE__ */ e("span", { className: h("min-w-0 flex-1 truncate text-left", !C && "text-muted-foreground"), children: p }),
|
|
191
|
+
s ? /* @__PURE__ */ e(U, { className: "size-4 shrink-0 opacity-50" }) : /* @__PURE__ */ e(V, { className: "size-4 shrink-0 opacity-50" })
|
|
177
192
|
]
|
|
178
193
|
}
|
|
179
194
|
) });
|
|
180
195
|
}
|
|
181
|
-
function
|
|
182
|
-
className:
|
|
196
|
+
function Le({
|
|
197
|
+
className: r,
|
|
183
198
|
align: o = "start",
|
|
184
199
|
sideOffset: s = 4,
|
|
185
|
-
filter:
|
|
186
|
-
children:
|
|
187
|
-
...
|
|
200
|
+
filter: l,
|
|
201
|
+
children: d,
|
|
202
|
+
...f
|
|
188
203
|
}) {
|
|
189
204
|
return /* @__PURE__ */ e(E.Portal, { children: /* @__PURE__ */ e(
|
|
190
205
|
E.Content,
|
|
@@ -192,141 +207,141 @@ function Re({
|
|
|
192
207
|
"data-slot": "combobox-content",
|
|
193
208
|
align: o,
|
|
194
209
|
sideOffset: s,
|
|
195
|
-
className:
|
|
210
|
+
className: h(
|
|
196
211
|
"w-(--radix-popover-trigger-width) min-w-[200px] origin-(--radix-popover-content-transform-origin) overflow-hidden rounded-md",
|
|
197
212
|
"border-border bg-popover z-50 border shadow-md outline-hidden",
|
|
198
213
|
"data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 duration-100",
|
|
199
|
-
|
|
214
|
+
r
|
|
200
215
|
),
|
|
201
|
-
...
|
|
216
|
+
...f,
|
|
202
217
|
children: /* @__PURE__ */ e(
|
|
203
|
-
|
|
218
|
+
S,
|
|
204
219
|
{
|
|
205
220
|
"data-slot": "combobox-command",
|
|
206
221
|
className: "bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden",
|
|
207
|
-
filter:
|
|
222
|
+
filter: l,
|
|
208
223
|
shouldFilter: !1,
|
|
209
|
-
children:
|
|
224
|
+
children: d
|
|
210
225
|
}
|
|
211
226
|
)
|
|
212
227
|
}
|
|
213
228
|
) });
|
|
214
229
|
}
|
|
215
|
-
function
|
|
216
|
-
const { searchValue: s, onSearchValueChange:
|
|
217
|
-
return /* @__PURE__ */
|
|
218
|
-
/* @__PURE__ */ e(
|
|
230
|
+
function Oe({ className: r, ...o }) {
|
|
231
|
+
const { searchValue: s, onSearchValueChange: l } = D();
|
|
232
|
+
return /* @__PURE__ */ k("div", { "data-slot": "combobox-input-wrapper", className: "border-border flex items-center gap-2 border-b px-3 py-2.5", children: [
|
|
233
|
+
/* @__PURE__ */ e(X, { className: "size-4 shrink-0 opacity-50" }),
|
|
219
234
|
/* @__PURE__ */ e(
|
|
220
|
-
|
|
235
|
+
S.Input,
|
|
221
236
|
{
|
|
222
237
|
"data-slot": "combobox-input",
|
|
223
238
|
value: s,
|
|
224
|
-
onValueChange:
|
|
225
|
-
className:
|
|
239
|
+
onValueChange: l,
|
|
240
|
+
className: h(
|
|
226
241
|
"placeholder:text-muted-foreground flex w-full bg-transparent text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
227
|
-
|
|
242
|
+
r
|
|
228
243
|
),
|
|
229
244
|
...o
|
|
230
245
|
}
|
|
231
246
|
)
|
|
232
247
|
] });
|
|
233
248
|
}
|
|
234
|
-
function
|
|
249
|
+
function Pe({ className: r, ...o }) {
|
|
235
250
|
return /* @__PURE__ */ e(
|
|
236
|
-
|
|
251
|
+
S.List,
|
|
237
252
|
{
|
|
238
253
|
"data-slot": "combobox-list",
|
|
239
|
-
className:
|
|
254
|
+
className: h("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", r),
|
|
240
255
|
...o
|
|
241
256
|
}
|
|
242
257
|
);
|
|
243
258
|
}
|
|
244
|
-
function
|
|
245
|
-
return /* @__PURE__ */ e(
|
|
259
|
+
function je({ ...r }) {
|
|
260
|
+
return /* @__PURE__ */ e(S.Empty, { "data-slot": "combobox-empty", className: "py-6 text-center text-sm", ...r });
|
|
246
261
|
}
|
|
247
|
-
function
|
|
262
|
+
function Fe({ className: r, ...o }) {
|
|
248
263
|
return /* @__PURE__ */ e(
|
|
249
|
-
|
|
264
|
+
S.Group,
|
|
250
265
|
{
|
|
251
266
|
"data-slot": "combobox-group",
|
|
252
|
-
className:
|
|
267
|
+
className: h(
|
|
253
268
|
"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
|
|
254
|
-
|
|
269
|
+
r
|
|
255
270
|
),
|
|
256
271
|
...o
|
|
257
272
|
}
|
|
258
273
|
);
|
|
259
274
|
}
|
|
260
|
-
function
|
|
275
|
+
function Ge({ className: r, ...o }) {
|
|
261
276
|
return /* @__PURE__ */ e(
|
|
262
|
-
|
|
277
|
+
S.Separator,
|
|
263
278
|
{
|
|
264
279
|
"data-slot": "combobox-separator",
|
|
265
|
-
className:
|
|
280
|
+
className: h("bg-border -mx-1 h-px", r),
|
|
266
281
|
...o
|
|
267
282
|
}
|
|
268
283
|
);
|
|
269
284
|
}
|
|
270
|
-
function
|
|
271
|
-
className:
|
|
285
|
+
function Ke({
|
|
286
|
+
className: r,
|
|
272
287
|
value: o,
|
|
273
288
|
icon: s,
|
|
274
|
-
avatar:
|
|
275
|
-
checkbox:
|
|
276
|
-
children:
|
|
277
|
-
onSelect:
|
|
278
|
-
...
|
|
289
|
+
avatar: l,
|
|
290
|
+
checkbox: d,
|
|
291
|
+
children: f,
|
|
292
|
+
onSelect: v,
|
|
293
|
+
...t
|
|
279
294
|
}) {
|
|
280
|
-
const { value:
|
|
295
|
+
const { value: i, onValueChange: I, multiple: x, onOpenChange: m, searchValue: g, registerLabel: C, registerAvatar: y } = D(), p = x ? Array.isArray(i) && i.includes(o) : i === o, u = typeof f == "string" ? f : void 0;
|
|
281
296
|
if (n.useEffect(() => {
|
|
282
|
-
|
|
283
|
-
}, [o,
|
|
284
|
-
|
|
285
|
-
}, [o,
|
|
286
|
-
if (!
|
|
287
|
-
const
|
|
288
|
-
return (
|
|
289
|
-
}, [
|
|
290
|
-
const
|
|
291
|
-
if (
|
|
292
|
-
if (Array.isArray(
|
|
293
|
-
const
|
|
294
|
-
|
|
297
|
+
u && C(o, u);
|
|
298
|
+
}, [o, u, C]), n.useEffect(() => {
|
|
299
|
+
l != null && y(o, l);
|
|
300
|
+
}, [o, l, y]), !n.useMemo(() => {
|
|
301
|
+
if (!g) return !0;
|
|
302
|
+
const A = g.toLowerCase();
|
|
303
|
+
return (u ?? o).toLowerCase().includes(A);
|
|
304
|
+
}, [g, u, o])) return null;
|
|
305
|
+
const b = () => {
|
|
306
|
+
if (x) {
|
|
307
|
+
if (Array.isArray(i)) {
|
|
308
|
+
const A = p ? i.filter((_) => _ !== o) : [...i, o];
|
|
309
|
+
I(A);
|
|
295
310
|
}
|
|
296
311
|
} else
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
},
|
|
300
|
-
return /* @__PURE__ */
|
|
301
|
-
|
|
312
|
+
I(p ? "" : o), m(!1);
|
|
313
|
+
v?.();
|
|
314
|
+
}, w = d ?? x;
|
|
315
|
+
return /* @__PURE__ */ k(
|
|
316
|
+
S.Item,
|
|
302
317
|
{
|
|
303
318
|
"data-slot": "combobox-item",
|
|
304
|
-
"data-selected":
|
|
305
|
-
className:
|
|
319
|
+
"data-selected": p,
|
|
320
|
+
className: h(
|
|
306
321
|
"data-[selected=true]:bg-accent-1 data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
307
|
-
|
|
322
|
+
r
|
|
308
323
|
),
|
|
309
324
|
value: o,
|
|
310
|
-
onSelect:
|
|
311
|
-
...
|
|
325
|
+
onSelect: b,
|
|
326
|
+
...t,
|
|
312
327
|
children: [
|
|
313
|
-
|
|
314
|
-
|
|
328
|
+
w && /* @__PURE__ */ e(q, { checked: p, className: "pointer-events-none size-4", tabIndex: -1, "aria-hidden": !0 }),
|
|
329
|
+
l != null && /* @__PURE__ */ e("span", { "data-slot": "combobox-item-avatar", className: "shrink-0", children: l }),
|
|
315
330
|
s != null && /* @__PURE__ */ e("span", { "data-slot": "combobox-item-icon", className: "shrink-0", children: s }),
|
|
316
|
-
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children:
|
|
317
|
-
!
|
|
331
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: f }),
|
|
332
|
+
!w && p && /* @__PURE__ */ e($, { className: "ml-auto size-4 shrink-0" })
|
|
318
333
|
]
|
|
319
334
|
}
|
|
320
335
|
);
|
|
321
336
|
}
|
|
322
337
|
export {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
338
|
+
Re as Combobox,
|
|
339
|
+
Le as ComboboxContent,
|
|
340
|
+
je as ComboboxEmpty,
|
|
341
|
+
Fe as ComboboxGroup,
|
|
342
|
+
Oe as ComboboxInput,
|
|
343
|
+
Ke as ComboboxItem,
|
|
344
|
+
Pe as ComboboxList,
|
|
345
|
+
Ge as ComboboxSeparator,
|
|
346
|
+
Te as ComboboxTrigger
|
|
332
347
|
};
|