@sth87/shadcn-design-system 0.2.1 → 0.2.2
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/AI_CONTEXT.md +2 -0
- package/dist/cjs/components/Select/Select.cjs +1 -1
- package/dist/cjs/components/Table/data-table-column-header.cjs +1 -1
- package/dist/cjs/components/Table/data-table.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/combobox.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/select.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/table.cjs +1 -1
- package/dist/cjs/styles/index.css +1 -1
- package/dist/esm/components/Select/Select.js +86 -80
- package/dist/esm/components/Table/data-table-column-header.js +50 -25
- package/dist/esm/components/Table/data-table.js +77 -55
- package/dist/esm/packages/ui/src/components/combobox.js +52 -47
- package/dist/esm/packages/ui/src/components/select.js +121 -116
- package/dist/esm/packages/ui/src/components/table.js +23 -14
- package/dist/esm/styles/index.css +1 -1
- package/dist/types/components/Select/Select.d.ts +4 -0
- package/dist/types/components/Select/Select.d.ts.map +1 -1
- package/dist/types/components/Table/data-table-column-header.d.ts.map +1 -1
- package/dist/types/components/Table/data-table.d.ts +5 -0
- package/dist/types/components/Table/data-table.d.ts.map +1 -1
- package/dist/types/packages/ui/src/components/combobox.d.ts +3 -1
- package/dist/types/packages/ui/src/components/combobox.d.ts.map +1 -1
- package/dist/types/packages/ui/src/components/select.d.ts +3 -1
- package/dist/types/packages/ui/src/components/select.d.ts.map +1 -1
- package/dist/types/packages/ui/src/components/table.d.ts +4 -1
- package/dist/types/packages/ui/src/components/table.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as a, jsx as d, Fragment as f } from "react/jsx-runtime";
|
|
2
2
|
import * as b from "react";
|
|
3
|
-
import { ChevronUp as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { Command as
|
|
6
|
-
import { Popover as
|
|
7
|
-
import { cn as
|
|
8
|
-
import { Label as
|
|
9
|
-
const
|
|
3
|
+
import { ChevronUp as I, ChevronDown as S, X as V, LoaderCircle as z, Check as D } from "lucide-react";
|
|
4
|
+
import { cva as E } from "class-variance-authority";
|
|
5
|
+
import { Command as F, CommandInput as G, CommandList as T, CommandEmpty as U, CommandGroup as X, CommandItem as q } from "./command.js";
|
|
6
|
+
import { Popover as A, PopoverTrigger as B, PopoverContent as J } from "./popover.js";
|
|
7
|
+
import { cn as i } from "../lib/utils.js";
|
|
8
|
+
import { Label as v } from "./label.js";
|
|
9
|
+
const K = E(
|
|
10
10
|
"ds:justify-between ds:relative ds:dark:bg-background ds:dark:hover:bg-input/50 ds:border-input ds:w-full ds:min-w-0 ds:rounded-md ds:border ds:border-border ds:bg-transparent ds:shadow-xs ds:transition-[color,box-shadow] ds:outline-none ds:file:inline-flex ds:file:h-7 ds:file:border-0 ds:file:bg-transparent ds:file:text-sm ds:file:font-medium ds:disabled:pointer-events-none ds:disabled:cursor-not-allowed ds:disabled:opacity-50 ds:focus-visible:border-ring ds:focus-visible:ring-ring/50 ds:focus-visible:ring-[3px] ds:aria-invalid:ring-destructive/20 ds:dark:aria-invalid:ring-destructive/40 ds:aria-invalid:border-destructive",
|
|
11
11
|
{
|
|
12
12
|
variants: {
|
|
@@ -30,47 +30,49 @@ const A = D(
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
|
-
function
|
|
33
|
+
function H({
|
|
34
34
|
value: t,
|
|
35
35
|
options: o,
|
|
36
36
|
placeHolder: l,
|
|
37
|
-
emptyText:
|
|
37
|
+
emptyText: h,
|
|
38
38
|
onChange: c,
|
|
39
|
-
onSearchChange:
|
|
40
|
-
shouldFilter:
|
|
39
|
+
onSearchChange: x,
|
|
40
|
+
shouldFilter: w,
|
|
41
|
+
loading: y = !1,
|
|
42
|
+
loadingText: C,
|
|
41
43
|
clearable: m,
|
|
42
|
-
className:
|
|
44
|
+
className: N,
|
|
43
45
|
dropdownClassName: u,
|
|
44
|
-
children:
|
|
46
|
+
children: k,
|
|
45
47
|
size: e,
|
|
46
|
-
state:
|
|
47
|
-
searchable:
|
|
48
|
+
state: j = "default",
|
|
49
|
+
searchable: L = !0,
|
|
48
50
|
tagRender: p,
|
|
49
51
|
disabled: r,
|
|
50
|
-
...
|
|
52
|
+
...O
|
|
51
53
|
}) {
|
|
52
|
-
const [n, g] = b.useState(!1),
|
|
54
|
+
const [n, g] = b.useState(!1), P = b.useCallback(
|
|
53
55
|
(s) => {
|
|
54
56
|
r || g(s);
|
|
55
57
|
},
|
|
56
58
|
[r]
|
|
57
59
|
);
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */ d(
|
|
60
|
-
|
|
60
|
+
return /* @__PURE__ */ a(A, { open: n, onOpenChange: P, modal: !0, children: [
|
|
61
|
+
/* @__PURE__ */ d(B, { asChild: !0, ...O, disabled: r, children: k ?? /* @__PURE__ */ a(
|
|
62
|
+
v,
|
|
61
63
|
{
|
|
62
64
|
"aria-disabled": r || void 0,
|
|
63
65
|
"data-disabled": r || void 0,
|
|
64
|
-
className:
|
|
65
|
-
|
|
66
|
+
className: i(
|
|
67
|
+
K({ size: e, state: j }),
|
|
66
68
|
r && "ds:pointer-events-none ds:cursor-not-allowed ds:opacity-50",
|
|
67
|
-
|
|
69
|
+
N
|
|
68
70
|
),
|
|
69
71
|
children: [
|
|
70
72
|
/* @__PURE__ */ d(
|
|
71
73
|
"span",
|
|
72
74
|
{
|
|
73
|
-
className:
|
|
75
|
+
className: i(
|
|
74
76
|
"ds:truncate ds:w-full ds:inline-block ds:align-middle ds:text-left",
|
|
75
77
|
{
|
|
76
78
|
"ds:pr-8": m
|
|
@@ -80,9 +82,9 @@ function Z({
|
|
|
80
82
|
}
|
|
81
83
|
),
|
|
82
84
|
n && /* @__PURE__ */ d(
|
|
83
|
-
|
|
85
|
+
I,
|
|
84
86
|
{
|
|
85
|
-
className:
|
|
87
|
+
className: i(
|
|
86
88
|
"ds:z-10 ds:opacity-50",
|
|
87
89
|
{
|
|
88
90
|
"ds:size-4 ds:min-w-4": e === "sm" || e === "xs",
|
|
@@ -93,9 +95,9 @@ function Z({
|
|
|
93
95
|
}
|
|
94
96
|
),
|
|
95
97
|
!n && /* @__PURE__ */ d(
|
|
96
|
-
|
|
98
|
+
S,
|
|
97
99
|
{
|
|
98
|
-
className:
|
|
100
|
+
className: i(
|
|
99
101
|
"ds:z-10 ds:opacity-50",
|
|
100
102
|
{
|
|
101
103
|
"ds:size-4 ds:min-w-4": e === "sm" || e === "xs",
|
|
@@ -109,53 +111,56 @@ function Z({
|
|
|
109
111
|
}
|
|
110
112
|
) }),
|
|
111
113
|
m && t && !r && /* @__PURE__ */ d(
|
|
112
|
-
|
|
114
|
+
v,
|
|
113
115
|
{
|
|
114
116
|
onClick: (s) => {
|
|
115
117
|
s.stopPropagation(), c?.("");
|
|
116
118
|
},
|
|
117
119
|
className: "ds:absolute ds:right-11 ds:top-1/2 ds:-translate-y-1/2 ds:rounded-sm ds:p-1 ds:text-muted-foreground ds:hover:bg-accent ds:hover:text-accent-foreground ds:cursor-pointer ds:size-6 ds:opacity-50",
|
|
118
|
-
children: /* @__PURE__ */ d(
|
|
120
|
+
children: /* @__PURE__ */ d(V, { className: "ds:h-4 ds:w-4" })
|
|
119
121
|
}
|
|
120
122
|
),
|
|
121
123
|
/* @__PURE__ */ d(
|
|
122
|
-
|
|
124
|
+
J,
|
|
123
125
|
{
|
|
124
|
-
className:
|
|
126
|
+
className: i("ds:p-0 ds:w-(--radix-popover-trigger-width)"),
|
|
125
127
|
onInteractOutside: (s) => {
|
|
126
128
|
s.target.closest('[data-slot="popover-trigger"]') && s.preventDefault();
|
|
127
129
|
},
|
|
128
|
-
children: /* @__PURE__ */
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
children: /* @__PURE__ */ a(F, { shouldFilter: w, children: [
|
|
131
|
+
L && /* @__PURE__ */ d(
|
|
132
|
+
G,
|
|
131
133
|
{
|
|
132
134
|
placeholder: l,
|
|
133
135
|
className: "ds:h-9",
|
|
134
|
-
onValueChange:
|
|
136
|
+
onValueChange: x
|
|
135
137
|
}
|
|
136
138
|
),
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
/* @__PURE__ */ d(
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
/* @__PURE__ */ d(T, { children: y ? /* @__PURE__ */ a("div", { className: "ds:flex ds:items-center ds:justify-center ds:gap-2 ds:py-6 ds:text-sm ds:text-muted-foreground", children: [
|
|
140
|
+
/* @__PURE__ */ d(z, { className: "ds:size-4 ds:animate-spin" }),
|
|
141
|
+
C ?? "Loading..."
|
|
142
|
+
] }) : /* @__PURE__ */ a(f, { children: [
|
|
143
|
+
/* @__PURE__ */ d(U, { children: h || "Not found" }),
|
|
144
|
+
/* @__PURE__ */ d(X, { children: o?.map((s) => /* @__PURE__ */ a(
|
|
145
|
+
q,
|
|
141
146
|
{
|
|
142
147
|
value: String(s.label),
|
|
143
148
|
onSelect: s?.disabled ? void 0 : () => {
|
|
144
149
|
c?.(s.value), g(!1);
|
|
145
150
|
},
|
|
146
|
-
className:
|
|
151
|
+
className: i(
|
|
147
152
|
s?.disabled && "ds:opacity-50 ds:cursor-not-allowed ds:grayscale",
|
|
148
153
|
t === s.value && "ds:bg-primary/10 ds:dark:bg-primary/20"
|
|
149
154
|
),
|
|
150
155
|
children: [
|
|
151
|
-
p ? p(s) : /* @__PURE__ */
|
|
156
|
+
p ? p(s) : /* @__PURE__ */ a(f, { children: [
|
|
152
157
|
s.icon && /* @__PURE__ */ d("span", { className: "ds:mr-2 ds:max-w-4 ds:max-h-4", children: s.icon }),
|
|
153
158
|
s.label
|
|
154
159
|
] }),
|
|
155
160
|
/* @__PURE__ */ d(
|
|
156
|
-
|
|
161
|
+
D,
|
|
157
162
|
{
|
|
158
|
-
className:
|
|
163
|
+
className: i(
|
|
159
164
|
"ds:ml-auto",
|
|
160
165
|
t === s.value ? "ds:opacity-100" : "ds:opacity-0"
|
|
161
166
|
// So sánh theo value
|
|
@@ -166,12 +171,12 @@ function Z({
|
|
|
166
171
|
},
|
|
167
172
|
s.value
|
|
168
173
|
)) })
|
|
169
|
-
] })
|
|
174
|
+
] }) })
|
|
170
175
|
] })
|
|
171
176
|
}
|
|
172
177
|
)
|
|
173
178
|
] });
|
|
174
179
|
}
|
|
175
180
|
export {
|
|
176
|
-
|
|
181
|
+
H as Combobox
|
|
177
182
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { ChevronUp as
|
|
1
|
+
import { jsx as s, jsxs as u, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronUp as L, ChevronDown as W, XIcon as E, LoaderCircle as D, CheckIcon as F } from "lucide-react";
|
|
3
3
|
import { cva as G } from "class-variance-authority";
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Command as I, CommandList as
|
|
6
|
-
import { Popover as
|
|
4
|
+
import { cn as x } from "../lib/utils.js";
|
|
5
|
+
import { Command as I, CommandList as j, CommandInput as R, CommandEmpty as q, CommandGroup as H, CommandItem as U, CommandSeparator as X } from "./command.js";
|
|
6
|
+
import { Popover as B, PopoverTrigger as J, PopoverContent as K } from "./popover.js";
|
|
7
7
|
import * as P from "react";
|
|
8
|
-
import { useState as N, useCallback as
|
|
9
|
-
import { Badge as
|
|
10
|
-
import { Label as
|
|
11
|
-
const
|
|
8
|
+
import { useState as N, useCallback as k, createContext as Q, useRef as A, useEffect as Y, useContext as Z } from "react";
|
|
9
|
+
import { Badge as O } from "./badge.js";
|
|
10
|
+
import { Label as $ } from "./label.js";
|
|
11
|
+
const T = G(
|
|
12
12
|
"ds:flex ds:h-auto ds:w-fit ds:items-center ds:justify-between ds:gap-2 ds:overflow-hidden ds:rounded-md ds:border ds:bg-transparent ds:shadow-xs ds:transition-[color,box-shadow] ds:outline-none ds:focus-visible:ring-[3px] ds:disabled:cursor-not-allowed ds:disabled:opacity-50 ds:data-[placeholder]:text-muted-foreground ds:dark:bg-background ds:dark:hover:bg-input/50 ds:[&_svg]:pointer-events-none ds:[&_svg]:shrink-0 ds:[&_svg:not([class*='size-'])]:size-4 ds:[&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
13
13
|
{
|
|
14
14
|
variants: {
|
|
@@ -31,67 +31,67 @@ const $ = G(
|
|
|
31
31
|
state: "default"
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
), _ =
|
|
35
|
-
function
|
|
34
|
+
), _ = Q(null);
|
|
35
|
+
function ae({
|
|
36
36
|
children: e,
|
|
37
37
|
values: n,
|
|
38
|
-
defaultValues:
|
|
38
|
+
defaultValues: a,
|
|
39
39
|
onValuesChange: r
|
|
40
40
|
}) {
|
|
41
|
-
const [
|
|
42
|
-
new Set(n ??
|
|
43
|
-
),
|
|
44
|
-
function b(
|
|
41
|
+
const [o, d] = N(!1), [l, m] = N(
|
|
42
|
+
new Set(n ?? a)
|
|
43
|
+
), y = n ? new Set(n) : l, [g, w] = N(/* @__PURE__ */ new Map());
|
|
44
|
+
function b(p) {
|
|
45
45
|
const f = (h) => {
|
|
46
46
|
const t = new Set(h);
|
|
47
|
-
return t.has(
|
|
47
|
+
return t.has(p) ? t.delete(p) : t.add(p), t;
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
m(f), r?.([...f(y)]);
|
|
50
50
|
}
|
|
51
|
-
const C =
|
|
52
|
-
|
|
51
|
+
const C = k((p, f) => {
|
|
52
|
+
w((h) => h.get(p) === f ? h : new Map(h).set(p, f));
|
|
53
53
|
}, []);
|
|
54
54
|
return /* @__PURE__ */ s(
|
|
55
55
|
_,
|
|
56
56
|
{
|
|
57
57
|
value: {
|
|
58
|
-
open:
|
|
59
|
-
setOpen:
|
|
60
|
-
selectedValues:
|
|
58
|
+
open: o,
|
|
59
|
+
setOpen: d,
|
|
60
|
+
selectedValues: y,
|
|
61
61
|
toggleValue: b,
|
|
62
62
|
items: g,
|
|
63
63
|
onItemAdded: C
|
|
64
64
|
},
|
|
65
|
-
children: /* @__PURE__ */ s(
|
|
65
|
+
children: /* @__PURE__ */ s(B, { open: o, onOpenChange: d, children: e })
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function ce({
|
|
70
70
|
className: e,
|
|
71
71
|
dropdownClassName: n,
|
|
72
|
-
children:
|
|
72
|
+
children: a,
|
|
73
73
|
size: r,
|
|
74
|
-
state:
|
|
75
|
-
disabled:
|
|
76
|
-
...
|
|
74
|
+
state: o = "default",
|
|
75
|
+
disabled: d,
|
|
76
|
+
...l
|
|
77
77
|
}) {
|
|
78
|
-
const { open:
|
|
79
|
-
return /* @__PURE__ */ s(
|
|
80
|
-
|
|
78
|
+
const { open: m } = z();
|
|
79
|
+
return /* @__PURE__ */ s(J, { asChild: !0, disabled: d, children: /* @__PURE__ */ u(
|
|
80
|
+
$,
|
|
81
81
|
{
|
|
82
|
-
"aria-disabled":
|
|
83
|
-
"data-disabled":
|
|
84
|
-
className:
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
"aria-disabled": d || void 0,
|
|
83
|
+
"data-disabled": d || void 0,
|
|
84
|
+
className: x(
|
|
85
|
+
T({ size: r, state: o }),
|
|
86
|
+
d && "ds:pointer-events-none ds:cursor-not-allowed ds:opacity-50",
|
|
87
87
|
e
|
|
88
88
|
),
|
|
89
89
|
children: [
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
a,
|
|
91
|
+
m && /* @__PURE__ */ s(
|
|
92
|
+
L,
|
|
93
93
|
{
|
|
94
|
-
className:
|
|
94
|
+
className: x(
|
|
95
95
|
"ds:z-10 ds:opacity-50",
|
|
96
96
|
{
|
|
97
97
|
"ds:size-4": r === "sm" || r === "xs",
|
|
@@ -101,10 +101,10 @@ function ae({
|
|
|
101
101
|
)
|
|
102
102
|
}
|
|
103
103
|
),
|
|
104
|
-
!
|
|
105
|
-
|
|
104
|
+
!m && /* @__PURE__ */ s(
|
|
105
|
+
W,
|
|
106
106
|
{
|
|
107
|
-
className:
|
|
107
|
+
className: x(
|
|
108
108
|
"ds:z-10 ds:opacity-50",
|
|
109
109
|
{
|
|
110
110
|
"ds:size-4": r === "sm" || r === "xs",
|
|
@@ -118,28 +118,28 @@ function ae({
|
|
|
118
118
|
}
|
|
119
119
|
) });
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function ue({
|
|
122
122
|
placeholder: e,
|
|
123
123
|
clickToRemove: n = !0,
|
|
124
|
-
className:
|
|
124
|
+
className: a,
|
|
125
125
|
overflowBehavior: r = "wrap-when-open",
|
|
126
|
-
...
|
|
126
|
+
...o
|
|
127
127
|
}) {
|
|
128
|
-
const { selectedValues:
|
|
128
|
+
const { selectedValues: d, toggleValue: l, items: m, open: y } = z(), [g, w] = N(0), b = A(null), C = A(null), p = r === "wrap" || r === "wrap-when-open" && y, f = k(() => {
|
|
129
129
|
if (b.current == null) return;
|
|
130
130
|
const t = b.current, i = C.current, v = t.querySelectorAll(
|
|
131
131
|
"[data-selected-item]"
|
|
132
132
|
);
|
|
133
|
-
i != null && (i.style.display = "none"), v.forEach((
|
|
133
|
+
i != null && (i.style.display = "none"), v.forEach((c) => c.style.removeProperty("display"));
|
|
134
134
|
let S = 0;
|
|
135
|
-
for (let
|
|
136
|
-
const M = v[
|
|
135
|
+
for (let c = v.length - 1; c >= 0; c--) {
|
|
136
|
+
const M = v[c];
|
|
137
137
|
if (t.scrollWidth <= t.clientWidth)
|
|
138
138
|
break;
|
|
139
|
-
S = v.length -
|
|
139
|
+
S = v.length - c, M.style.display = "none", i?.style.removeProperty("display");
|
|
140
140
|
}
|
|
141
|
-
|
|
142
|
-
}, []), h =
|
|
141
|
+
w(S);
|
|
142
|
+
}, []), h = k(
|
|
143
143
|
(t) => {
|
|
144
144
|
b.current = t;
|
|
145
145
|
const i = new ResizeObserver(f);
|
|
@@ -149,27 +149,27 @@ function ce({
|
|
|
149
149
|
},
|
|
150
150
|
[f]
|
|
151
151
|
);
|
|
152
|
-
return
|
|
152
|
+
return d.size === 0 && e ? /* @__PURE__ */ s("span", { className: "ds:min-w-0 ds:overflow-hidden ds:font-normal ds:text-muted-foreground", children: e }) : /* @__PURE__ */ u(
|
|
153
153
|
"div",
|
|
154
154
|
{
|
|
155
|
-
...
|
|
155
|
+
...o,
|
|
156
156
|
ref: h,
|
|
157
|
-
className:
|
|
157
|
+
className: x(
|
|
158
158
|
"ds:flex ds:w-fit ds:gap-1.5 ds:overflow-hidden",
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
p && "ds:h-full ds:flex-wrap",
|
|
160
|
+
a
|
|
161
161
|
),
|
|
162
162
|
children: [
|
|
163
|
-
[...
|
|
164
|
-
const i =
|
|
165
|
-
S.stopPropagation(),
|
|
163
|
+
[...d].filter((t) => m.has(t)).map((t) => {
|
|
164
|
+
const i = m.get(t), v = (S) => {
|
|
165
|
+
S.stopPropagation(), l(t);
|
|
166
166
|
};
|
|
167
167
|
if (P.isValidElement(i)) {
|
|
168
|
-
const S = typeof i.type == "string" && ["div", "span", "button", "a"].includes(i.type),
|
|
168
|
+
const S = typeof i.type == "string" && ["div", "span", "button", "a"].includes(i.type), c = i, M = S ? {
|
|
169
169
|
key: t,
|
|
170
170
|
onClick: n ? v : void 0,
|
|
171
|
-
className:
|
|
172
|
-
|
|
171
|
+
className: x(
|
|
172
|
+
c.props.className,
|
|
173
173
|
"ds:group ds:flex ds:items-center ds:gap-1 ds:whitespace-nowrap ds:hover:scale-105 ds:transition-transform",
|
|
174
174
|
{
|
|
175
175
|
"ds:cursor-pointer": n
|
|
@@ -181,16 +181,16 @@ function ce({
|
|
|
181
181
|
"data-selected-item": !0
|
|
182
182
|
};
|
|
183
183
|
return P.cloneElement(
|
|
184
|
-
|
|
184
|
+
c,
|
|
185
185
|
M,
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
|
|
186
|
+
/* @__PURE__ */ u(V, { children: [
|
|
187
|
+
c.props.children,
|
|
188
188
|
n && /* @__PURE__ */ s(E, { className: "ds:size-2 ds:text-muted-foreground ds:group-hover:text-destructive" })
|
|
189
189
|
] })
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
|
-
return /* @__PURE__ */
|
|
193
|
-
|
|
192
|
+
return /* @__PURE__ */ u(
|
|
193
|
+
O,
|
|
194
194
|
{
|
|
195
195
|
variant: "outline",
|
|
196
196
|
"data-selected-item": !0,
|
|
@@ -204,11 +204,11 @@ function ce({
|
|
|
204
204
|
t
|
|
205
205
|
);
|
|
206
206
|
}),
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
|
|
207
|
+
/* @__PURE__ */ u(
|
|
208
|
+
O,
|
|
209
209
|
{
|
|
210
210
|
style: {
|
|
211
|
-
display: g > 0 && !
|
|
211
|
+
display: g > 0 && !p ? "block" : "none"
|
|
212
212
|
},
|
|
213
213
|
variant: "outline",
|
|
214
214
|
ref: C,
|
|
@@ -222,17 +222,19 @@ function ce({
|
|
|
222
222
|
}
|
|
223
223
|
);
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function me({
|
|
226
226
|
search: e = !0,
|
|
227
227
|
onSearchChange: n,
|
|
228
|
-
|
|
229
|
-
|
|
228
|
+
loading: a = !1,
|
|
229
|
+
loadingText: r,
|
|
230
|
+
children: o,
|
|
231
|
+
...d
|
|
230
232
|
}) {
|
|
231
|
-
const
|
|
232
|
-
return /* @__PURE__ */
|
|
233
|
-
/* @__PURE__ */ s("div", { style: { display: "none" }, children: /* @__PURE__ */ s(I, { children: /* @__PURE__ */ s(
|
|
234
|
-
/* @__PURE__ */ s(
|
|
235
|
-
|
|
233
|
+
const l = typeof e == "object" ? !0 : e;
|
|
234
|
+
return /* @__PURE__ */ u(V, { children: [
|
|
235
|
+
/* @__PURE__ */ s("div", { style: { display: "none" }, children: /* @__PURE__ */ s(I, { children: /* @__PURE__ */ s(j, { children: o }) }) }),
|
|
236
|
+
/* @__PURE__ */ s(K, { className: "ds:min-w-[var(--radix-popover-trigger-width)] ds:p-0", children: /* @__PURE__ */ u(I, { ...d, children: [
|
|
237
|
+
l ? /* @__PURE__ */ s(
|
|
236
238
|
R,
|
|
237
239
|
{
|
|
238
240
|
placeholder: typeof e == "object" ? e.placeholder : void 0,
|
|
@@ -247,45 +249,48 @@ function ue({
|
|
|
247
249
|
className: "ds:sr-only"
|
|
248
250
|
}
|
|
249
251
|
),
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
] })
|
|
252
|
+
/* @__PURE__ */ s(j, { children: a ? /* @__PURE__ */ u("div", { className: "ds:flex ds:items-center ds:justify-center ds:gap-2 ds:py-6 ds:text-sm ds:text-muted-foreground", children: [
|
|
253
|
+
/* @__PURE__ */ s(D, { className: "ds:size-4 ds:animate-spin" }),
|
|
254
|
+
r ?? "Loading..."
|
|
255
|
+
] }) : /* @__PURE__ */ u(V, { children: [
|
|
256
|
+
l && /* @__PURE__ */ s(q, { children: typeof e == "object" ? e.emptyMessage : void 0 }),
|
|
257
|
+
o
|
|
258
|
+
] }) })
|
|
254
259
|
] }) })
|
|
255
260
|
] });
|
|
256
261
|
}
|
|
257
|
-
function
|
|
262
|
+
function pe({
|
|
258
263
|
value: e,
|
|
259
264
|
children: n,
|
|
260
|
-
badgeLabel:
|
|
265
|
+
badgeLabel: a,
|
|
261
266
|
onSelect: r,
|
|
262
|
-
icon:
|
|
263
|
-
tagRender:
|
|
264
|
-
...
|
|
267
|
+
icon: o,
|
|
268
|
+
tagRender: d,
|
|
269
|
+
...l
|
|
265
270
|
}) {
|
|
266
|
-
const { toggleValue:
|
|
267
|
-
return
|
|
268
|
-
g(e,
|
|
269
|
-
}, [e, n, g,
|
|
270
|
-
|
|
271
|
+
const { toggleValue: m, selectedValues: y, onItemAdded: g } = z(), w = y.has(e);
|
|
272
|
+
return Y(() => {
|
|
273
|
+
g(e, a ?? n);
|
|
274
|
+
}, [e, n, g, a]), /* @__PURE__ */ u(
|
|
275
|
+
U,
|
|
271
276
|
{
|
|
272
|
-
...
|
|
273
|
-
onSelect:
|
|
274
|
-
|
|
277
|
+
...l,
|
|
278
|
+
onSelect: l?.disabled ? void 0 : () => {
|
|
279
|
+
m(e), r?.(e);
|
|
275
280
|
},
|
|
276
|
-
className:
|
|
277
|
-
|
|
278
|
-
|
|
281
|
+
className: x(
|
|
282
|
+
l?.disabled && "ds:opacity-50 ds:cursor-not-allowed ds:grayscale",
|
|
283
|
+
w && "ds:bg-primary/10 ds:dark:bg-primary/20"
|
|
279
284
|
),
|
|
280
285
|
children: [
|
|
281
|
-
!
|
|
286
|
+
!d && o && /* @__PURE__ */ s("span", { className: "ds:mr-2 ds:max-w-4 ds:max-h-4", children: o }),
|
|
282
287
|
n,
|
|
283
288
|
/* @__PURE__ */ s(
|
|
284
289
|
F,
|
|
285
290
|
{
|
|
286
|
-
className:
|
|
291
|
+
className: x(
|
|
287
292
|
"ds:mr-2 ds:ml-auto ds:size-4",
|
|
288
|
-
|
|
293
|
+
w ? "ds:opacity-100" : "ds:opacity-0"
|
|
289
294
|
)
|
|
290
295
|
}
|
|
291
296
|
)
|
|
@@ -293,14 +298,14 @@ function me({
|
|
|
293
298
|
}
|
|
294
299
|
);
|
|
295
300
|
}
|
|
296
|
-
function
|
|
301
|
+
function fe(e) {
|
|
297
302
|
return /* @__PURE__ */ s(H, { ...e });
|
|
298
303
|
}
|
|
299
|
-
function
|
|
300
|
-
return /* @__PURE__ */ s(
|
|
304
|
+
function ge(e) {
|
|
305
|
+
return /* @__PURE__ */ s(X, { ...e });
|
|
301
306
|
}
|
|
302
|
-
function
|
|
303
|
-
const e =
|
|
307
|
+
function z() {
|
|
308
|
+
const e = Z(_);
|
|
304
309
|
if (e == null)
|
|
305
310
|
throw new Error(
|
|
306
311
|
"useMultiSelectContext must be used within a MultiSelectContext"
|
|
@@ -308,11 +313,11 @@ function k() {
|
|
|
308
313
|
return e;
|
|
309
314
|
}
|
|
310
315
|
export {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
ae as MultiSelect,
|
|
317
|
+
me as MultiSelectContent,
|
|
318
|
+
fe as MultiSelectGroup,
|
|
319
|
+
pe as MultiSelectItem,
|
|
320
|
+
ge as MultiSelectSeparator,
|
|
321
|
+
ce as MultiSelectTrigger,
|
|
322
|
+
ue as MultiSelectValue
|
|
318
323
|
};
|