@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.
Files changed (27) hide show
  1. package/dist/AI_CONTEXT.md +2 -0
  2. package/dist/cjs/components/Select/Select.cjs +1 -1
  3. package/dist/cjs/components/Table/data-table-column-header.cjs +1 -1
  4. package/dist/cjs/components/Table/data-table.cjs +1 -1
  5. package/dist/cjs/packages/ui/src/components/combobox.cjs +1 -1
  6. package/dist/cjs/packages/ui/src/components/select.cjs +1 -1
  7. package/dist/cjs/packages/ui/src/components/table.cjs +1 -1
  8. package/dist/cjs/styles/index.css +1 -1
  9. package/dist/esm/components/Select/Select.js +86 -80
  10. package/dist/esm/components/Table/data-table-column-header.js +50 -25
  11. package/dist/esm/components/Table/data-table.js +77 -55
  12. package/dist/esm/packages/ui/src/components/combobox.js +52 -47
  13. package/dist/esm/packages/ui/src/components/select.js +121 -116
  14. package/dist/esm/packages/ui/src/components/table.js +23 -14
  15. package/dist/esm/styles/index.css +1 -1
  16. package/dist/types/components/Select/Select.d.ts +4 -0
  17. package/dist/types/components/Select/Select.d.ts.map +1 -1
  18. package/dist/types/components/Table/data-table-column-header.d.ts.map +1 -1
  19. package/dist/types/components/Table/data-table.d.ts +5 -0
  20. package/dist/types/components/Table/data-table.d.ts.map +1 -1
  21. package/dist/types/packages/ui/src/components/combobox.d.ts +3 -1
  22. package/dist/types/packages/ui/src/components/combobox.d.ts.map +1 -1
  23. package/dist/types/packages/ui/src/components/select.d.ts +3 -1
  24. package/dist/types/packages/ui/src/components/select.d.ts.map +1 -1
  25. package/dist/types/packages/ui/src/components/table.d.ts +4 -1
  26. package/dist/types/packages/ui/src/components/table.d.ts.map +1 -1
  27. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
- import { jsxs as i, jsx as d, Fragment as P } from "react/jsx-runtime";
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 j, ChevronDown as I, X as S, Check as V } from "lucide-react";
4
- import { cva as D } from "class-variance-authority";
5
- import { Command as L, CommandInput as z, CommandList as E, CommandEmpty as F, CommandGroup as G, CommandItem as T } from "./command.js";
6
- import { Popover as U, PopoverTrigger as X, PopoverContent as q } from "./popover.js";
7
- import { cn as a } from "../lib/utils.js";
8
- import { Label as f } from "./label.js";
9
- const A = D(
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 Z({
33
+ function H({
34
34
  value: t,
35
35
  options: o,
36
36
  placeHolder: l,
37
- emptyText: v,
37
+ emptyText: h,
38
38
  onChange: c,
39
- onSearchChange: h,
40
- shouldFilter: x,
39
+ onSearchChange: x,
40
+ shouldFilter: w,
41
+ loading: y = !1,
42
+ loadingText: C,
41
43
  clearable: m,
42
- className: w,
44
+ className: N,
43
45
  dropdownClassName: u,
44
- children: y,
46
+ children: k,
45
47
  size: e,
46
- state: C = "default",
47
- searchable: N = !0,
48
+ state: j = "default",
49
+ searchable: L = !0,
48
50
  tagRender: p,
49
51
  disabled: r,
50
- ...k
52
+ ...O
51
53
  }) {
52
- const [n, g] = b.useState(!1), O = b.useCallback(
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__ */ i(U, { open: n, onOpenChange: O, modal: !0, children: [
59
- /* @__PURE__ */ d(X, { asChild: !0, ...k, disabled: r, children: y ?? /* @__PURE__ */ i(
60
- f,
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: a(
65
- A({ size: e, state: C }),
66
+ className: i(
67
+ K({ size: e, state: j }),
66
68
  r && "ds:pointer-events-none ds:cursor-not-allowed ds:opacity-50",
67
- w
69
+ N
68
70
  ),
69
71
  children: [
70
72
  /* @__PURE__ */ d(
71
73
  "span",
72
74
  {
73
- className: a(
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
- j,
85
+ I,
84
86
  {
85
- className: a(
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
- I,
98
+ S,
97
99
  {
98
- className: a(
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
- f,
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(S, { className: "ds:h-4 ds:w-4" })
120
+ children: /* @__PURE__ */ d(V, { className: "ds:h-4 ds:w-4" })
119
121
  }
120
122
  ),
121
123
  /* @__PURE__ */ d(
122
- q,
124
+ J,
123
125
  {
124
- className: a("ds:p-0 ds:w-(--radix-popover-trigger-width)"),
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__ */ i(L, { shouldFilter: x, children: [
129
- N && /* @__PURE__ */ d(
130
- z,
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: h
136
+ onValueChange: x
135
137
  }
136
138
  ),
137
- /* @__PURE__ */ i(E, { children: [
138
- /* @__PURE__ */ d(F, { children: v || "Not found" }),
139
- /* @__PURE__ */ d(G, { children: o?.map((s) => /* @__PURE__ */ i(
140
- T,
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: a(
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__ */ i(P, { children: [
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
- V,
161
+ D,
157
162
  {
158
- className: a(
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
- Z as Combobox
181
+ H as Combobox
177
182
  };
@@ -1,14 +1,14 @@
1
- import { jsx as s, jsxs as m, Fragment as O } from "react/jsx-runtime";
2
- import { ChevronUp as W, ChevronDown as D, XIcon as E, CheckIcon as F } from "lucide-react";
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 w } from "../lib/utils.js";
5
- import { Command as I, CommandList as z, CommandInput as R, CommandEmpty as q, CommandGroup as H, CommandItem as L, CommandSeparator as U } from "./command.js";
6
- import { Popover as X, PopoverTrigger as B, PopoverContent as J } from "./popover.js";
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 V, createContext as K, useRef as j, useEffect as Q, useContext as Y } from "react";
9
- import { Badge as A } from "./badge.js";
10
- import { Label as Z } from "./label.js";
11
- const $ = G(
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
- ), _ = K(null);
35
- function le({
34
+ ), _ = Q(null);
35
+ function ae({
36
36
  children: e,
37
37
  values: n,
38
- defaultValues: l,
38
+ defaultValues: a,
39
39
  onValuesChange: r
40
40
  }) {
41
- const [d, o] = N(!1), [p, c] = N(
42
- new Set(n ?? l)
43
- ), x = n ? new Set(n) : p, [g, y] = N(/* @__PURE__ */ new Map());
44
- function b(u) {
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(u) ? t.delete(u) : t.add(u), t;
47
+ return t.has(p) ? t.delete(p) : t.add(p), t;
48
48
  };
49
- c(f), r?.([...f(x)]);
49
+ m(f), r?.([...f(y)]);
50
50
  }
51
- const C = V((u, f) => {
52
- y((h) => h.get(u) === f ? h : new Map(h).set(u, f));
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: d,
59
- setOpen: o,
60
- selectedValues: x,
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(X, { open: d, onOpenChange: o, children: e })
65
+ children: /* @__PURE__ */ s(B, { open: o, onOpenChange: d, children: e })
66
66
  }
67
67
  );
68
68
  }
69
- function ae({
69
+ function ce({
70
70
  className: e,
71
71
  dropdownClassName: n,
72
- children: l,
72
+ children: a,
73
73
  size: r,
74
- state: d = "default",
75
- disabled: o,
76
- ...p
74
+ state: o = "default",
75
+ disabled: d,
76
+ ...l
77
77
  }) {
78
- const { open: c } = k();
79
- return /* @__PURE__ */ s(B, { asChild: !0, disabled: o, children: /* @__PURE__ */ m(
80
- Z,
78
+ const { open: m } = z();
79
+ return /* @__PURE__ */ s(J, { asChild: !0, disabled: d, children: /* @__PURE__ */ u(
80
+ $,
81
81
  {
82
- "aria-disabled": o || void 0,
83
- "data-disabled": o || void 0,
84
- className: w(
85
- $({ size: r, state: d }),
86
- o && "ds:pointer-events-none ds:cursor-not-allowed ds:opacity-50",
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
- l,
91
- c && /* @__PURE__ */ s(
92
- W,
90
+ a,
91
+ m && /* @__PURE__ */ s(
92
+ L,
93
93
  {
94
- className: w(
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
- !c && /* @__PURE__ */ s(
105
- D,
104
+ !m && /* @__PURE__ */ s(
105
+ W,
106
106
  {
107
- className: w(
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 ce({
121
+ function ue({
122
122
  placeholder: e,
123
123
  clickToRemove: n = !0,
124
- className: l,
124
+ className: a,
125
125
  overflowBehavior: r = "wrap-when-open",
126
- ...d
126
+ ...o
127
127
  }) {
128
- const { selectedValues: o, toggleValue: p, items: c, open: x } = k(), [g, y] = N(0), b = j(null), C = j(null), u = r === "wrap" || r === "wrap-when-open" && x, f = V(() => {
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((a) => a.style.removeProperty("display"));
133
+ i != null && (i.style.display = "none"), v.forEach((c) => c.style.removeProperty("display"));
134
134
  let S = 0;
135
- for (let a = v.length - 1; a >= 0; a--) {
136
- const M = v[a];
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 - a, M.style.display = "none", i?.style.removeProperty("display");
139
+ S = v.length - c, M.style.display = "none", i?.style.removeProperty("display");
140
140
  }
141
- y(S);
142
- }, []), h = V(
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 o.size === 0 && e ? /* @__PURE__ */ s("span", { className: "ds:min-w-0 ds:overflow-hidden ds:font-normal ds:text-muted-foreground", children: e }) : /* @__PURE__ */ m(
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
- ...d,
155
+ ...o,
156
156
  ref: h,
157
- className: w(
157
+ className: x(
158
158
  "ds:flex ds:w-fit ds:gap-1.5 ds:overflow-hidden",
159
- u && "ds:h-full ds:flex-wrap",
160
- l
159
+ p && "ds:h-full ds:flex-wrap",
160
+ a
161
161
  ),
162
162
  children: [
163
- [...o].filter((t) => c.has(t)).map((t) => {
164
- const i = c.get(t), v = (S) => {
165
- S.stopPropagation(), p(t);
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), a = i, M = S ? {
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: w(
172
- a.props.className,
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
- a,
184
+ c,
185
185
  M,
186
- /* @__PURE__ */ m(O, { children: [
187
- a.props.children,
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__ */ m(
193
- A,
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__ */ m(
208
- A,
207
+ /* @__PURE__ */ u(
208
+ O,
209
209
  {
210
210
  style: {
211
- display: g > 0 && !u ? "block" : "none"
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 ue({
225
+ function me({
226
226
  search: e = !0,
227
227
  onSearchChange: n,
228
- children: l,
229
- ...r
228
+ loading: a = !1,
229
+ loadingText: r,
230
+ children: o,
231
+ ...d
230
232
  }) {
231
- const d = typeof e == "object" ? !0 : e;
232
- return /* @__PURE__ */ m(O, { children: [
233
- /* @__PURE__ */ s("div", { style: { display: "none" }, children: /* @__PURE__ */ s(I, { children: /* @__PURE__ */ s(z, { children: l }) }) }),
234
- /* @__PURE__ */ s(J, { className: "ds:min-w-[var(--radix-popover-trigger-width)] ds:p-0", children: /* @__PURE__ */ m(I, { ...r, children: [
235
- d ? /* @__PURE__ */ s(
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__ */ m(z, { children: [
251
- d && /* @__PURE__ */ s(q, { children: typeof e == "object" ? e.emptyMessage : void 0 }),
252
- l
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 me({
262
+ function pe({
258
263
  value: e,
259
264
  children: n,
260
- badgeLabel: l,
265
+ badgeLabel: a,
261
266
  onSelect: r,
262
- icon: d,
263
- tagRender: o,
264
- ...p
267
+ icon: o,
268
+ tagRender: d,
269
+ ...l
265
270
  }) {
266
- const { toggleValue: c, selectedValues: x, onItemAdded: g } = k(), y = x.has(e);
267
- return Q(() => {
268
- g(e, l ?? n);
269
- }, [e, n, g, l]), /* @__PURE__ */ m(
270
- L,
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
- ...p,
273
- onSelect: p?.disabled ? void 0 : () => {
274
- c(e), r?.(e);
277
+ ...l,
278
+ onSelect: l?.disabled ? void 0 : () => {
279
+ m(e), r?.(e);
275
280
  },
276
- className: w(
277
- p?.disabled && "ds:opacity-50 ds:cursor-not-allowed ds:grayscale",
278
- y && "ds:bg-primary/10 ds:dark:bg-primary/20"
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
- !o && d && /* @__PURE__ */ s("span", { className: "ds:mr-2 ds:max-w-4 ds:max-h-4", children: d }),
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: w(
291
+ className: x(
287
292
  "ds:mr-2 ds:ml-auto ds:size-4",
288
- y ? "ds:opacity-100" : "ds:opacity-0"
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 pe(e) {
301
+ function fe(e) {
297
302
  return /* @__PURE__ */ s(H, { ...e });
298
303
  }
299
- function fe(e) {
300
- return /* @__PURE__ */ s(U, { ...e });
304
+ function ge(e) {
305
+ return /* @__PURE__ */ s(X, { ...e });
301
306
  }
302
- function k() {
303
- const e = Y(_);
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
- le as MultiSelect,
312
- ue as MultiSelectContent,
313
- pe as MultiSelectGroup,
314
- me as MultiSelectItem,
315
- fe as MultiSelectSeparator,
316
- ae as MultiSelectTrigger,
317
- ce as MultiSelectValue
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
  };