@clasing/ui 2.0.7 → 2.0.8
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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-DSjHHn1r.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-DSjHHn1r.cjs"),I=require("../badge-CS2XfLYQ.cjs"),m=require("../command-CHisYTN-.cjs"),N=require("../popover-BnLx2OY6.cjs"),n=require("react"),v=require("../icon-component-DTlgy__B.cjs"),V=n.createContext(null);function k({children:t,values:r,defaultValues:i,onValuesChange:u,isLoading:d,onSearchChange:c,loadingText:f="Loading...",noResultsText:a="No results found"}){const[h,p]=n.useState(!1),[y,j]=n.useState(new Set(r??i)),[b,x]=n.useState(new Map),[S,E]=n.useState("");function o(s){const g=R=>{const C=new Set(R);return C.has(s)?C.delete(s):C.add(s),C};j(g),u?.([...g(y)])}const l=n.useCallback((s,g)=>{x(R=>R.get(s)===g?R:new Map(R).set(s,g))},[]),w=n.useCallback(s=>{E(s),c?.(s)},[c]);return e.jsxRuntimeExports.jsx(V,{value:{open:h,setOpen:p,selectedValues:r?new Set(r):y,toggleValue:o,items:b,onItemAdded:l,isLoading:d,searchValue:S,onSearchChange:w,loadingText:f,noResultsText:a},children:e.jsxRuntimeExports.jsx(N.Popover,{open:h,onOpenChange:p,children:t})})}function z({className:t,children:r,size:i="md",...u}){const{open:d}=M();return e.jsxRuntimeExports.jsx(N.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{...u,role:u.role??"combobox","aria-expanded":u["aria-expanded"]??d,"data-size":i,className:e.cn("border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='text-'])]:text-muted-foreground flex w-fit items-center justify-between gap-2 overflow-hidden rounded-md border bg-transparent whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i==="xs"&&'label-sm h-7 px-2 py-1 [&_svg:not([class*="size-"])]:size-3.5',i==="sm"&&"label-md h-8 px-2 py-1",i==="md"&&"label-lg h-12 px-3 py-1",i==="lg"&&"label-xl h-16 px-4 py-2",t),children:[r,e.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconSelector",className:"size-4 shrink-0 opacity-50"})]})})}function P({placeholder:t,clickToRemove:r=!0,className:i,overflowBehavior:u="wrap-when-open",...d}){const{selectedValues:c,toggleValue:f,items:a,open:h}=M(),[p,y]=n.useState(0),j=n.useRef(null),b=n.useRef(null),x=n.useRef(new Set),S=u==="wrap"||u==="wrap-when-open"&&h;n.useEffect(()=>{S&&x.current.forEach(o=>o.style.removeProperty("display"))},[S]);const E=n.useCallback(()=>{if(j.current==null)return;const o=j.current,l=b.current;l!=null&&(l.style.display="none"),x.current.forEach(s=>s.style.removeProperty("display"));let w=0;for(let s=x.current.size-1;s>=0;s--){const g=[...x.current][s];if(o.scrollWidth<=o.clientWidth)break;w=x.current.size-s,g.style.display="none",l?.style.removeProperty("display")}y(w)},[]);return n.useEffect(()=>{if(j.current==null)return;const o=new ResizeObserver(E);return o.observe(j.current),()=>o.disconnect()},[E]),n.useLayoutEffect(()=>{E()},[c,E]),c.size===0&&t?e.jsxRuntimeExports.jsx("span",{className:"text-muted-foreground font-normal",children:t}):e.jsxRuntimeExports.jsxs("div",{...d,ref:j,className:e.cn("flex min-h-[1.75rem] w-full gap-1.5 overflow-hidden",S&&"flex-wrap",i),children:[[...c].filter(o=>a.has(o)).map(o=>e.jsxRuntimeExports.jsxs(I.Badge,{ref:l=>{if(l!=null)return x.current.add(l),()=>{x.current.delete(l)}},variant:"outline",className:"group flex items-center gap-1",onClick:r?l=>{l.stopPropagation(),f(o)}:void 0,children:[a.get(o),r&&e.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconX",className:"text-muted-foreground group-hover:text-destructive size-2"})]},o)),e.jsxRuntimeExports.jsxs(I.Badge,{style:{display:p>0&&!S?"block":"none"},variant:"outline",ref:b,children:["+",p]})]})}function q({search:t=!0,children:r,...i}){const{isLoading:u,onSearchChange:d,searchValue:c,noResultsText:f}=M(),a=typeof t=="object"?!0:t;return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{style:{display:"none"},children:e.jsxRuntimeExports.jsx(m.Command,{children:e.jsxRuntimeExports.jsx(m.CommandList,{children:r})})}),e.jsxRuntimeExports.jsx(N.PopoverContent,{className:"min-w-[var(--radix-popover-trigger-width)] p-0",children:e.jsxRuntimeExports.jsxs(m.Command,{...i,children:[a?e.jsxRuntimeExports.jsx(m.CommandInput,{placeholder:typeof t=="object"?t.placeholder:void 0,value:c,onValueChange:d}):e.jsxRuntimeExports.jsx("button",{autoFocus:!0,"aria-hidden":"true",className:"sr-only"}),e.jsxRuntimeExports.jsx(m.CommandList,{children:u?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconLoader2",className:"text-muted-foreground size-4 animate-spin"}),e.jsxRuntimeExports.jsx("span",{className:"text-muted-foreground ml-2 text-sm",children:u})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[a&&e.jsxRuntimeExports.jsx(m.CommandEmpty,{children:f}),r]})})]})})]})}function O({value:t,children:r,badgeLabel:i,onSelect:u,...d}){const{toggleValue:c,selectedValues:f,onItemAdded:a}=M(),h=f.has(t);return n.useEffect(()=>{a(t,i??r)},[t,r,a,i]),e.jsxRuntimeExports.jsxs(m.CommandItem,{...d,value:t,onSelect:p=>{c(p),u?.(p)},children:[e.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconCheck",className:e.cn("mr-2 size-4",h?"opacity-100":"opacity-0")}),r]})}function L(t){return e.jsxRuntimeExports.jsx(m.CommandGroup,{...t})}function _(t){return e.jsxRuntimeExports.jsx(m.CommandSeparator,{...t})}function M(){const t=n.useContext(V);if(t==null)throw new Error("useMultiSelectContext must be used within a MultiSelectContext");return t}exports.MultiSelect=k;exports.MultiSelectContent=q;exports.MultiSelectGroup=L;exports.MultiSelectItem=O;exports.MultiSelectSeparator=_;exports.MultiSelectTrigger=z;exports.MultiSelectValue=P;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Button } from '@/components/button';
|
|
2
2
|
import { Command, CommandGroup, CommandItem, CommandSeparator } from '@/components/command';
|
|
3
3
|
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
4
|
-
declare function MultiSelect({ children, values, defaultValues, onValuesChange, }: {
|
|
4
|
+
declare function MultiSelect({ children, values, defaultValues, onValuesChange, isLoading, onSearchChange, loadingText, noResultsText, }: {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
values?: string[];
|
|
7
7
|
defaultValues?: string[];
|
|
8
8
|
onValuesChange?: (values: string[]) => void;
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
onSearchChange?: (value: string) => void;
|
|
11
|
+
loadingText?: string;
|
|
12
|
+
noResultsText?: string;
|
|
9
13
|
}): import("react/jsx-runtime").JSX.Element;
|
|
10
14
|
declare function MultiSelectTrigger({ className, children, size, ...props }: {
|
|
11
15
|
className?: string;
|
|
@@ -1,70 +1,84 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { B as
|
|
3
|
-
import { C as
|
|
4
|
-
import { P as
|
|
5
|
-
import { createContext as
|
|
6
|
-
import { I as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
children:
|
|
10
|
-
values:
|
|
11
|
-
defaultValues:
|
|
12
|
-
onValuesChange:
|
|
1
|
+
import { j as e, c as z } from "../index-DBpnlzOP.js";
|
|
2
|
+
import { B as E } from "../badge-B4oRxQ-G.js";
|
|
3
|
+
import { C as P, f as R, d as _, b as A, c as L, e as F, g as W } from "../command-CGUB58ej.js";
|
|
4
|
+
import { P as G, b as T, c as B } from "../popover-C6pozFVL.js";
|
|
5
|
+
import { createContext as X, useState as y, useCallback as I, useEffect as k, useRef as V, useLayoutEffect as q, useContext as D } from "react";
|
|
6
|
+
import { I as N } from "../icon-component-DGImZz3K.js";
|
|
7
|
+
const O = X(null);
|
|
8
|
+
function Z({
|
|
9
|
+
children: t,
|
|
10
|
+
values: r,
|
|
11
|
+
defaultValues: o,
|
|
12
|
+
onValuesChange: a,
|
|
13
|
+
isLoading: u,
|
|
14
|
+
onSearchChange: l,
|
|
15
|
+
loadingText: p = "Loading...",
|
|
16
|
+
noResultsText: c = "No results found"
|
|
13
17
|
}) {
|
|
14
|
-
const [
|
|
15
|
-
new Set(
|
|
16
|
-
), [
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
return
|
|
18
|
+
const [h, m] = y(!1), [b, f] = y(
|
|
19
|
+
new Set(r ?? o)
|
|
20
|
+
), [v, d] = y(/* @__PURE__ */ new Map()), [g, j] = y("");
|
|
21
|
+
function s(n) {
|
|
22
|
+
const x = (w) => {
|
|
23
|
+
const C = new Set(w);
|
|
24
|
+
return C.has(n) ? C.delete(n) : C.add(n), C;
|
|
21
25
|
};
|
|
22
|
-
|
|
26
|
+
f(x), a?.([...x(b)]);
|
|
23
27
|
}
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
}, [])
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
const i = I((n, x) => {
|
|
29
|
+
d((w) => w.get(n) === x ? w : new Map(w).set(n, x));
|
|
30
|
+
}, []), S = I(
|
|
31
|
+
(n) => {
|
|
32
|
+
j(n), l?.(n);
|
|
33
|
+
},
|
|
34
|
+
[l]
|
|
35
|
+
);
|
|
36
|
+
return /* @__PURE__ */ e.jsx(
|
|
37
|
+
O,
|
|
29
38
|
{
|
|
30
39
|
value: {
|
|
31
|
-
open:
|
|
40
|
+
open: h,
|
|
32
41
|
setOpen: m,
|
|
33
|
-
selectedValues:
|
|
34
|
-
toggleValue:
|
|
35
|
-
items:
|
|
36
|
-
onItemAdded:
|
|
42
|
+
selectedValues: r ? new Set(r) : b,
|
|
43
|
+
toggleValue: s,
|
|
44
|
+
items: v,
|
|
45
|
+
onItemAdded: i,
|
|
46
|
+
isLoading: u,
|
|
47
|
+
searchValue: g,
|
|
48
|
+
onSearchChange: S,
|
|
49
|
+
loadingText: p,
|
|
50
|
+
noResultsText: c
|
|
37
51
|
},
|
|
38
|
-
children: /* @__PURE__ */
|
|
52
|
+
children: /* @__PURE__ */ e.jsx(G, { open: h, onOpenChange: m, children: t })
|
|
39
53
|
}
|
|
40
54
|
);
|
|
41
55
|
}
|
|
42
|
-
function
|
|
43
|
-
className:
|
|
44
|
-
children:
|
|
45
|
-
size:
|
|
46
|
-
...
|
|
56
|
+
function $({
|
|
57
|
+
className: t,
|
|
58
|
+
children: r,
|
|
59
|
+
size: o = "md",
|
|
60
|
+
...a
|
|
47
61
|
}) {
|
|
48
|
-
const { open:
|
|
49
|
-
return /* @__PURE__ */
|
|
62
|
+
const { open: u } = M();
|
|
63
|
+
return /* @__PURE__ */ e.jsx(B, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
50
64
|
"button",
|
|
51
65
|
{
|
|
52
|
-
...
|
|
53
|
-
role:
|
|
54
|
-
"aria-expanded":
|
|
55
|
-
"data-size":
|
|
56
|
-
className:
|
|
66
|
+
...a,
|
|
67
|
+
role: a.role ?? "combobox",
|
|
68
|
+
"aria-expanded": a["aria-expanded"] ?? u,
|
|
69
|
+
"data-size": o,
|
|
70
|
+
className: z(
|
|
57
71
|
"border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='text-'])]:text-muted-foreground flex w-fit items-center justify-between gap-2 overflow-hidden rounded-md border bg-transparent whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
72
|
+
o === "xs" && 'label-sm h-7 px-2 py-1 [&_svg:not([class*="size-"])]:size-3.5',
|
|
73
|
+
o === "sm" && "label-md h-8 px-2 py-1",
|
|
74
|
+
o === "md" && "label-lg h-12 px-3 py-1",
|
|
75
|
+
o === "lg" && "label-xl h-16 px-4 py-2",
|
|
76
|
+
t
|
|
63
77
|
),
|
|
64
78
|
children: [
|
|
65
|
-
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
|
|
79
|
+
r,
|
|
80
|
+
/* @__PURE__ */ e.jsx(
|
|
81
|
+
N,
|
|
68
82
|
{
|
|
69
83
|
iconName: "IconSelector",
|
|
70
84
|
className: "size-4 shrink-0 opacity-50"
|
|
@@ -74,65 +88,65 @@ function Y({
|
|
|
74
88
|
}
|
|
75
89
|
) });
|
|
76
90
|
}
|
|
77
|
-
function
|
|
78
|
-
placeholder:
|
|
79
|
-
clickToRemove:
|
|
80
|
-
className:
|
|
81
|
-
overflowBehavior:
|
|
82
|
-
...
|
|
91
|
+
function ee({
|
|
92
|
+
placeholder: t,
|
|
93
|
+
clickToRemove: r = !0,
|
|
94
|
+
className: o,
|
|
95
|
+
overflowBehavior: a = "wrap-when-open",
|
|
96
|
+
...u
|
|
83
97
|
}) {
|
|
84
|
-
const { selectedValues:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}, [
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
let
|
|
93
|
-
for (let
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
98
|
+
const { selectedValues: l, toggleValue: p, items: c, open: h } = M(), [m, b] = y(0), f = V(null), v = V(null), d = V(/* @__PURE__ */ new Set()), g = a === "wrap" || a === "wrap-when-open" && h;
|
|
99
|
+
k(() => {
|
|
100
|
+
g && d.current.forEach((s) => s.style.removeProperty("display"));
|
|
101
|
+
}, [g]);
|
|
102
|
+
const j = I(() => {
|
|
103
|
+
if (f.current == null) return;
|
|
104
|
+
const s = f.current, i = v.current;
|
|
105
|
+
i != null && (i.style.display = "none"), d.current.forEach((n) => n.style.removeProperty("display"));
|
|
106
|
+
let S = 0;
|
|
107
|
+
for (let n = d.current.size - 1; n >= 0; n--) {
|
|
108
|
+
const x = [...d.current][n];
|
|
109
|
+
if (s.scrollWidth <= s.clientWidth)
|
|
96
110
|
break;
|
|
97
|
-
|
|
111
|
+
S = d.current.size - n, x.style.display = "none", i?.style.removeProperty("display");
|
|
98
112
|
}
|
|
99
|
-
b(
|
|
113
|
+
b(S);
|
|
100
114
|
}, []);
|
|
101
|
-
return
|
|
102
|
-
if (
|
|
103
|
-
const
|
|
104
|
-
return
|
|
105
|
-
}, [
|
|
106
|
-
|
|
107
|
-
}, [
|
|
115
|
+
return k(() => {
|
|
116
|
+
if (f.current == null) return;
|
|
117
|
+
const s = new ResizeObserver(j);
|
|
118
|
+
return s.observe(f.current), () => s.disconnect();
|
|
119
|
+
}, [j]), q(() => {
|
|
120
|
+
j();
|
|
121
|
+
}, [l, j]), l.size === 0 && t ? /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground font-normal", children: t }) : /* @__PURE__ */ e.jsxs(
|
|
108
122
|
"div",
|
|
109
123
|
{
|
|
110
|
-
...
|
|
111
|
-
ref:
|
|
112
|
-
className:
|
|
124
|
+
...u,
|
|
125
|
+
ref: f,
|
|
126
|
+
className: z(
|
|
113
127
|
"flex min-h-[1.75rem] w-full gap-1.5 overflow-hidden",
|
|
114
|
-
|
|
115
|
-
|
|
128
|
+
g && "flex-wrap",
|
|
129
|
+
o
|
|
116
130
|
),
|
|
117
131
|
children: [
|
|
118
|
-
[...
|
|
119
|
-
|
|
132
|
+
[...l].filter((s) => c.has(s)).map((s) => /* @__PURE__ */ e.jsxs(
|
|
133
|
+
E,
|
|
120
134
|
{
|
|
121
|
-
ref: (
|
|
122
|
-
if (
|
|
123
|
-
return
|
|
124
|
-
|
|
135
|
+
ref: (i) => {
|
|
136
|
+
if (i != null)
|
|
137
|
+
return d.current.add(i), () => {
|
|
138
|
+
d.current.delete(i);
|
|
125
139
|
};
|
|
126
140
|
},
|
|
127
141
|
variant: "outline",
|
|
128
142
|
className: "group flex items-center gap-1",
|
|
129
|
-
onClick:
|
|
130
|
-
|
|
143
|
+
onClick: r ? (i) => {
|
|
144
|
+
i.stopPropagation(), p(s);
|
|
131
145
|
} : void 0,
|
|
132
146
|
children: [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
147
|
+
c.get(s),
|
|
148
|
+
r && /* @__PURE__ */ e.jsx(
|
|
149
|
+
N,
|
|
136
150
|
{
|
|
137
151
|
iconName: "IconX",
|
|
138
152
|
className: "text-muted-foreground group-hover:text-destructive size-2"
|
|
@@ -140,19 +154,19 @@ function Z({
|
|
|
140
154
|
)
|
|
141
155
|
]
|
|
142
156
|
},
|
|
143
|
-
|
|
157
|
+
s
|
|
144
158
|
)),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
|
|
159
|
+
/* @__PURE__ */ e.jsxs(
|
|
160
|
+
E,
|
|
147
161
|
{
|
|
148
162
|
style: {
|
|
149
|
-
display:
|
|
163
|
+
display: m > 0 && !g ? "block" : "none"
|
|
150
164
|
},
|
|
151
165
|
variant: "outline",
|
|
152
|
-
ref:
|
|
166
|
+
ref: v,
|
|
153
167
|
children: [
|
|
154
168
|
"+",
|
|
155
|
-
|
|
169
|
+
m
|
|
156
170
|
]
|
|
157
171
|
}
|
|
158
172
|
)
|
|
@@ -160,79 +174,90 @@ function Z({
|
|
|
160
174
|
}
|
|
161
175
|
);
|
|
162
176
|
}
|
|
163
|
-
function
|
|
164
|
-
search:
|
|
165
|
-
children:
|
|
166
|
-
...
|
|
177
|
+
function te({
|
|
178
|
+
search: t = !0,
|
|
179
|
+
children: r,
|
|
180
|
+
...o
|
|
167
181
|
}) {
|
|
168
|
-
const
|
|
169
|
-
return /* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
|
|
173
|
-
|
|
182
|
+
const { isLoading: a, onSearchChange: u, searchValue: l, noResultsText: p } = M(), c = typeof t == "object" ? !0 : t;
|
|
183
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
184
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "none" }, children: /* @__PURE__ */ e.jsx(P, { children: /* @__PURE__ */ e.jsx(R, { children: r }) }) }),
|
|
185
|
+
/* @__PURE__ */ e.jsx(T, { className: "min-w-[var(--radix-popover-trigger-width)] p-0", children: /* @__PURE__ */ e.jsxs(P, { ...o, children: [
|
|
186
|
+
c ? /* @__PURE__ */ e.jsx(
|
|
187
|
+
_,
|
|
174
188
|
{
|
|
175
|
-
placeholder: typeof
|
|
189
|
+
placeholder: typeof t == "object" ? t.placeholder : void 0,
|
|
190
|
+
value: l,
|
|
191
|
+
onValueChange: u
|
|
176
192
|
}
|
|
177
|
-
) : /* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
193
|
+
) : /* @__PURE__ */ e.jsx("button", { autoFocus: !0, "aria-hidden": "true", className: "sr-only" }),
|
|
194
|
+
/* @__PURE__ */ e.jsx(R, { children: a ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center py-6", children: [
|
|
195
|
+
/* @__PURE__ */ e.jsx(
|
|
196
|
+
N,
|
|
197
|
+
{
|
|
198
|
+
iconName: "IconLoader2",
|
|
199
|
+
className: "text-muted-foreground size-4 animate-spin"
|
|
200
|
+
}
|
|
201
|
+
),
|
|
202
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground ml-2 text-sm", children: a })
|
|
203
|
+
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
204
|
+
c && /* @__PURE__ */ e.jsx(A, { children: p }),
|
|
205
|
+
r
|
|
206
|
+
] }) })
|
|
182
207
|
] }) })
|
|
183
208
|
] });
|
|
184
209
|
}
|
|
185
|
-
function
|
|
186
|
-
value:
|
|
187
|
-
children:
|
|
188
|
-
badgeLabel:
|
|
189
|
-
onSelect:
|
|
190
|
-
...
|
|
210
|
+
function ne({
|
|
211
|
+
value: t,
|
|
212
|
+
children: r,
|
|
213
|
+
badgeLabel: o,
|
|
214
|
+
onSelect: a,
|
|
215
|
+
...u
|
|
191
216
|
}) {
|
|
192
|
-
const { toggleValue:
|
|
193
|
-
return
|
|
194
|
-
|
|
195
|
-
}, [
|
|
196
|
-
|
|
217
|
+
const { toggleValue: l, selectedValues: p, onItemAdded: c } = M(), h = p.has(t);
|
|
218
|
+
return k(() => {
|
|
219
|
+
c(t, o ?? r);
|
|
220
|
+
}, [t, r, c, o]), /* @__PURE__ */ e.jsxs(
|
|
221
|
+
F,
|
|
197
222
|
{
|
|
198
|
-
...
|
|
199
|
-
value:
|
|
200
|
-
onSelect: (
|
|
201
|
-
m
|
|
223
|
+
...u,
|
|
224
|
+
value: t,
|
|
225
|
+
onSelect: (m) => {
|
|
226
|
+
l(m), a?.(m);
|
|
202
227
|
},
|
|
203
228
|
children: [
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
|
|
229
|
+
/* @__PURE__ */ e.jsx(
|
|
230
|
+
N,
|
|
206
231
|
{
|
|
207
232
|
iconName: "IconCheck",
|
|
208
|
-
className:
|
|
233
|
+
className: z("mr-2 size-4", h ? "opacity-100" : "opacity-0")
|
|
209
234
|
}
|
|
210
235
|
),
|
|
211
|
-
|
|
236
|
+
r
|
|
212
237
|
]
|
|
213
238
|
}
|
|
214
239
|
);
|
|
215
240
|
}
|
|
216
|
-
function
|
|
217
|
-
return /* @__PURE__ */
|
|
241
|
+
function re(t) {
|
|
242
|
+
return /* @__PURE__ */ e.jsx(L, { ...t });
|
|
218
243
|
}
|
|
219
|
-
function
|
|
220
|
-
return /* @__PURE__ */
|
|
244
|
+
function se(t) {
|
|
245
|
+
return /* @__PURE__ */ e.jsx(W, { ...t });
|
|
221
246
|
}
|
|
222
247
|
function M() {
|
|
223
|
-
const
|
|
224
|
-
if (
|
|
248
|
+
const t = D(O);
|
|
249
|
+
if (t == null)
|
|
225
250
|
throw new Error(
|
|
226
251
|
"useMultiSelectContext must be used within a MultiSelectContext"
|
|
227
252
|
);
|
|
228
|
-
return
|
|
253
|
+
return t;
|
|
229
254
|
}
|
|
230
255
|
export {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
256
|
+
Z as MultiSelect,
|
|
257
|
+
te as MultiSelectContent,
|
|
258
|
+
re as MultiSelectGroup,
|
|
259
|
+
ne as MultiSelectItem,
|
|
260
|
+
se as MultiSelectSeparator,
|
|
261
|
+
$ as MultiSelectTrigger,
|
|
262
|
+
ee as MultiSelectValue
|
|
238
263
|
};
|