@sth87/shadcn-design-system 0.2.0 → 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 +4 -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 +138 -115
  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 +57 -43
  13. package/dist/esm/packages/ui/src/components/select.js +163 -148
  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 +8 -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 +5 -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 +4 -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 k } 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 O, ChevronDown as P, X as j, Check as I } from "lucide-react";
4
- import { cva as S } from "class-variance-authority";
5
- import { Command as D, CommandInput as L, CommandList as V, CommandEmpty as z, CommandGroup as E, CommandItem as F } from "./command.js";
6
- import { Popover as G, PopoverTrigger as T, PopoverContent as U } from "./popover.js";
7
- import { cn as a } from "../lib/utils.js";
8
- import { Label as f } from "./label.js";
9
- const X = S(
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,45 +30,49 @@ const X = S(
30
30
  }
31
31
  }
32
32
  );
33
- function W({
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: x,
40
+ shouldFilter: w,
41
+ loading: y = !1,
42
+ loadingText: C,
39
43
  clearable: m,
40
- className: h,
44
+ className: N,
41
45
  dropdownClassName: u,
42
- children: x,
46
+ children: k,
43
47
  size: e,
44
- state: w = "default",
45
- searchable: y = !0,
48
+ state: j = "default",
49
+ searchable: L = !0,
46
50
  tagRender: p,
47
51
  disabled: r,
48
- ...C
52
+ ...O
49
53
  }) {
50
- const [n, g] = b.useState(!1), N = b.useCallback(
54
+ const [n, g] = b.useState(!1), P = b.useCallback(
51
55
  (s) => {
52
56
  r || g(s);
53
57
  },
54
58
  [r]
55
59
  );
56
- return /* @__PURE__ */ i(G, { open: n, onOpenChange: N, modal: !0, children: [
57
- /* @__PURE__ */ d(T, { asChild: !0, ...C, disabled: r, children: x ?? /* @__PURE__ */ i(
58
- 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,
59
63
  {
60
64
  "aria-disabled": r || void 0,
61
65
  "data-disabled": r || void 0,
62
- className: a(
63
- X({ size: e, state: w }),
66
+ className: i(
67
+ K({ size: e, state: j }),
64
68
  r && "ds:pointer-events-none ds:cursor-not-allowed ds:opacity-50",
65
- h
69
+ N
66
70
  ),
67
71
  children: [
68
72
  /* @__PURE__ */ d(
69
73
  "span",
70
74
  {
71
- className: a(
75
+ className: i(
72
76
  "ds:truncate ds:w-full ds:inline-block ds:align-middle ds:text-left",
73
77
  {
74
78
  "ds:pr-8": m
@@ -78,9 +82,9 @@ function W({
78
82
  }
79
83
  ),
80
84
  n && /* @__PURE__ */ d(
81
- O,
85
+ I,
82
86
  {
83
- className: a(
87
+ className: i(
84
88
  "ds:z-10 ds:opacity-50",
85
89
  {
86
90
  "ds:size-4 ds:min-w-4": e === "sm" || e === "xs",
@@ -91,9 +95,9 @@ function W({
91
95
  }
92
96
  ),
93
97
  !n && /* @__PURE__ */ d(
94
- P,
98
+ S,
95
99
  {
96
- className: a(
100
+ className: i(
97
101
  "ds:z-10 ds:opacity-50",
98
102
  {
99
103
  "ds:size-4 ds:min-w-4": e === "sm" || e === "xs",
@@ -107,46 +111,56 @@ function W({
107
111
  }
108
112
  ) }),
109
113
  m && t && !r && /* @__PURE__ */ d(
110
- f,
114
+ v,
111
115
  {
112
116
  onClick: (s) => {
113
117
  s.stopPropagation(), c?.("");
114
118
  },
115
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",
116
- children: /* @__PURE__ */ d(j, { className: "ds:h-4 ds:w-4" })
120
+ children: /* @__PURE__ */ d(V, { className: "ds:h-4 ds:w-4" })
117
121
  }
118
122
  ),
119
123
  /* @__PURE__ */ d(
120
- U,
124
+ J,
121
125
  {
122
- className: a("ds:p-0 ds:w-(--radix-popover-trigger-width)"),
126
+ className: i("ds:p-0 ds:w-(--radix-popover-trigger-width)"),
123
127
  onInteractOutside: (s) => {
124
128
  s.target.closest('[data-slot="popover-trigger"]') && s.preventDefault();
125
129
  },
126
- children: /* @__PURE__ */ i(D, { children: [
127
- y && /* @__PURE__ */ d(L, { placeholder: l, className: "ds:h-9" }),
128
- /* @__PURE__ */ i(V, { children: [
129
- /* @__PURE__ */ d(z, { children: v || "Not found" }),
130
- /* @__PURE__ */ d(E, { children: o?.map((s) => /* @__PURE__ */ i(
131
- F,
130
+ children: /* @__PURE__ */ a(F, { shouldFilter: w, children: [
131
+ L && /* @__PURE__ */ d(
132
+ G,
133
+ {
134
+ placeholder: l,
135
+ className: "ds:h-9",
136
+ onValueChange: x
137
+ }
138
+ ),
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,
132
146
  {
133
147
  value: String(s.label),
134
148
  onSelect: s?.disabled ? void 0 : () => {
135
149
  c?.(s.value), g(!1);
136
150
  },
137
- className: a(
151
+ className: i(
138
152
  s?.disabled && "ds:opacity-50 ds:cursor-not-allowed ds:grayscale",
139
153
  t === s.value && "ds:bg-primary/10 ds:dark:bg-primary/20"
140
154
  ),
141
155
  children: [
142
- p ? p(s) : /* @__PURE__ */ i(k, { children: [
156
+ p ? p(s) : /* @__PURE__ */ a(f, { children: [
143
157
  s.icon && /* @__PURE__ */ d("span", { className: "ds:mr-2 ds:max-w-4 ds:max-h-4", children: s.icon }),
144
158
  s.label
145
159
  ] }),
146
160
  /* @__PURE__ */ d(
147
- I,
161
+ D,
148
162
  {
149
- className: a(
163
+ className: i(
150
164
  "ds:ml-auto",
151
165
  t === s.value ? "ds:opacity-100" : "ds:opacity-0"
152
166
  // So sánh theo value
@@ -157,12 +171,12 @@ function W({
157
171
  },
158
172
  s.value
159
173
  )) })
160
- ] })
174
+ ] }) })
161
175
  ] })
162
176
  }
163
177
  )
164
178
  ] });
165
179
  }
166
180
  export {
167
- W as Combobox
181
+ H as Combobox
168
182
  };
@@ -1,14 +1,14 @@
1
- import { jsx as r, 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,86 +31,86 @@ 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
- values: s,
38
- defaultValues: i,
39
- onValuesChange: t
37
+ values: n,
38
+ defaultValues: a,
39
+ onValuesChange: r
40
40
  }) {
41
- const [a, d] = N(!1), [p, c] = N(
42
- new Set(s ?? i)
43
- ), x = s ? new Set(s) : 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
- const n = new Set(h);
47
- return n.has(u) ? n.delete(u) : n.add(u), n;
46
+ const t = new Set(h);
47
+ return t.has(p) ? t.delete(p) : t.add(p), t;
48
48
  };
49
- c(f), t?.([...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
- return /* @__PURE__ */ r(
54
+ return /* @__PURE__ */ s(
55
55
  _,
56
56
  {
57
57
  value: {
58
- open: a,
58
+ open: o,
59
59
  setOpen: d,
60
- selectedValues: x,
60
+ selectedValues: y,
61
61
  toggleValue: b,
62
62
  items: g,
63
63
  onItemAdded: C
64
64
  },
65
- children: /* @__PURE__ */ r(X, { open: a, onOpenChange: d, 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
- dropdownClassName: s,
72
- children: i,
73
- size: t,
74
- state: a = "default",
71
+ dropdownClassName: n,
72
+ children: a,
73
+ size: r,
74
+ state: o = "default",
75
75
  disabled: d,
76
- ...p
76
+ ...l
77
77
  }) {
78
- const { open: c } = k();
79
- return /* @__PURE__ */ r(B, { asChild: !0, disabled: d, 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
82
  "aria-disabled": d || void 0,
83
83
  "data-disabled": d || void 0,
84
- className: w(
85
- $({ size: t, state: a }),
84
+ className: x(
85
+ T({ size: r, state: o }),
86
86
  d && "ds:pointer-events-none ds:cursor-not-allowed ds:opacity-50",
87
87
  e
88
88
  ),
89
89
  children: [
90
- i,
91
- c && /* @__PURE__ */ r(
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
- "ds:size-4": t === "sm" || t === "xs",
98
- "ds:size-5": t === "lg" || t === "xl"
97
+ "ds:size-4": r === "sm" || r === "xs",
98
+ "ds:size-5": r === "lg" || r === "xl"
99
99
  },
100
- s
100
+ n
101
101
  )
102
102
  }
103
103
  ),
104
- !c && /* @__PURE__ */ r(
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
- "ds:size-4": t === "sm" || t === "xs",
111
- "ds:size-5": t === "lg" || t === "xl"
110
+ "ds:size-4": r === "sm" || r === "xs",
111
+ "ds:size-5": r === "lg" || r === "xl"
112
112
  },
113
- s
113
+ n
114
114
  )
115
115
  }
116
116
  )
@@ -118,97 +118,97 @@ function ae({
118
118
  }
119
119
  ) });
120
120
  }
121
- function ce({
121
+ function ue({
122
122
  placeholder: e,
123
- clickToRemove: s = !0,
124
- className: i,
125
- overflowBehavior: t = "wrap-when-open",
126
- ...a
123
+ clickToRemove: n = !0,
124
+ className: a,
125
+ overflowBehavior: r = "wrap-when-open",
126
+ ...o
127
127
  }) {
128
- const { selectedValues: d, toggleValue: p, items: c, open: x } = k(), [g, y] = N(0), b = j(null), C = j(null), u = t === "wrap" || t === "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
- const n = b.current, o = C.current, v = n.querySelectorAll(
130
+ const t = b.current, i = C.current, v = t.querySelectorAll(
131
131
  "[data-selected-item]"
132
132
  );
133
- o != null && (o.style.display = "none"), v.forEach((l) => l.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 l = v.length - 1; l >= 0; l--) {
136
- const M = v[l];
137
- if (n.scrollWidth <= n.clientWidth)
135
+ for (let c = v.length - 1; c >= 0; c--) {
136
+ const M = v[c];
137
+ if (t.scrollWidth <= t.clientWidth)
138
138
  break;
139
- S = v.length - l, M.style.display = "none", o?.style.removeProperty("display");
139
+ S = v.length - c, M.style.display = "none", i?.style.removeProperty("display");
140
140
  }
141
- y(S);
142
- }, []), h = V(
143
- (n) => {
144
- b.current = n;
145
- const o = new ResizeObserver(f);
146
- return o.observe(n), () => {
147
- o.disconnect(), b.current = null;
141
+ w(S);
142
+ }, []), h = k(
143
+ (t) => {
144
+ b.current = t;
145
+ const i = new ResizeObserver(f);
146
+ return i.observe(t), () => {
147
+ i.disconnect(), b.current = null;
148
148
  };
149
149
  },
150
150
  [f]
151
151
  );
152
- return d.size === 0 && e ? /* @__PURE__ */ r("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
- ...a,
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
- i
159
+ p && "ds:h-full ds:flex-wrap",
160
+ a
161
161
  ),
162
162
  children: [
163
- [...d].filter((n) => c.has(n)).map((n) => {
164
- const o = c.get(n), v = (S) => {
165
- S.stopPropagation(), p(n);
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
- if (P.isValidElement(o)) {
168
- const S = typeof o.type == "string" && ["div", "span", "button", "a"].includes(o.type), l = o, M = S ? {
169
- key: n,
170
- onClick: s ? v : void 0,
171
- className: w(
172
- l.props.className,
167
+ if (P.isValidElement(i)) {
168
+ const S = typeof i.type == "string" && ["div", "span", "button", "a"].includes(i.type), c = i, M = S ? {
169
+ key: t,
170
+ onClick: n ? v : void 0,
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
- "ds:cursor-pointer": s
175
+ "ds:cursor-pointer": n
176
176
  }
177
177
  ),
178
178
  "data-selected-item": !0
179
179
  } : {
180
- key: n,
180
+ key: t,
181
181
  "data-selected-item": !0
182
182
  };
183
183
  return P.cloneElement(
184
- l,
184
+ c,
185
185
  M,
186
- /* @__PURE__ */ m(O, { children: [
187
- l.props.children,
188
- s && /* @__PURE__ */ r(E, { className: "ds:size-2 ds:text-muted-foreground ds:group-hover:text-destructive" })
186
+ /* @__PURE__ */ u(V, { children: [
187
+ c.props.children,
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,
197
197
  className: "ds:group ds:flex ds:items-center ds:gap-1",
198
- onClick: s ? v : void 0,
198
+ onClick: n ? v : void 0,
199
199
  children: [
200
- o,
201
- s && /* @__PURE__ */ r(E, { className: "ds:size-2 ds:text-muted-foreground ds:group-hover:text-destructive" })
200
+ i,
201
+ n && /* @__PURE__ */ s(E, { className: "ds:size-2 ds:text-muted-foreground ds:group-hover:text-destructive" })
202
202
  ]
203
203
  },
204
- n
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,60 +222,75 @@ function ce({
222
222
  }
223
223
  );
224
224
  }
225
- function ue({
225
+ function me({
226
226
  search: e = !0,
227
- children: s,
228
- ...i
227
+ onSearchChange: n,
228
+ loading: a = !1,
229
+ loadingText: r,
230
+ children: o,
231
+ ...d
229
232
  }) {
230
- const t = typeof e == "object" ? !0 : e;
231
- return /* @__PURE__ */ m(O, { children: [
232
- /* @__PURE__ */ r("div", { style: { display: "none" }, children: /* @__PURE__ */ r(I, { children: /* @__PURE__ */ r(z, { children: s }) }) }),
233
- /* @__PURE__ */ r(J, { className: "ds:min-w-[var(--radix-popover-trigger-width)] ds:p-0", children: /* @__PURE__ */ m(I, { ...i, children: [
234
- t ? /* @__PURE__ */ r(
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(
235
238
  R,
236
239
  {
237
- placeholder: typeof e == "object" ? e.placeholder : void 0
240
+ placeholder: typeof e == "object" ? e.placeholder : void 0,
241
+ onValueChange: n
242
+ }
243
+ ) : /* @__PURE__ */ s(
244
+ "button",
245
+ {
246
+ type: "button",
247
+ "aria-label": "Search",
248
+ autoFocus: !0,
249
+ className: "ds:sr-only"
238
250
  }
239
- ) : /* @__PURE__ */ r("button", { autoFocus: !0, className: "ds:sr-only" }),
240
- /* @__PURE__ */ m(z, { children: [
241
- t && /* @__PURE__ */ r(q, { children: typeof e == "object" ? e.emptyMessage : void 0 }),
242
- s
243
- ] })
251
+ ),
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
+ ] }) })
244
259
  ] }) })
245
260
  ] });
246
261
  }
247
- function me({
262
+ function pe({
248
263
  value: e,
249
- children: s,
250
- badgeLabel: i,
251
- onSelect: t,
252
- icon: a,
264
+ children: n,
265
+ badgeLabel: a,
266
+ onSelect: r,
267
+ icon: o,
253
268
  tagRender: d,
254
- ...p
269
+ ...l
255
270
  }) {
256
- const { toggleValue: c, selectedValues: x, onItemAdded: g } = k(), y = x.has(e);
257
- return Q(() => {
258
- g(e, i ?? s);
259
- }, [e, s, g, i]), /* @__PURE__ */ m(
260
- 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,
261
276
  {
262
- ...p,
263
- onSelect: p?.disabled ? void 0 : () => {
264
- c(e), t?.(e);
277
+ ...l,
278
+ onSelect: l?.disabled ? void 0 : () => {
279
+ m(e), r?.(e);
265
280
  },
266
- className: w(
267
- p?.disabled && "ds:opacity-50 ds:cursor-not-allowed ds:grayscale",
268
- 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"
269
284
  ),
270
285
  children: [
271
- !d && a && /* @__PURE__ */ r("span", { className: "ds:mr-2 ds:max-w-4 ds:max-h-4", children: a }),
272
- s,
273
- /* @__PURE__ */ r(
286
+ !d && o && /* @__PURE__ */ s("span", { className: "ds:mr-2 ds:max-w-4 ds:max-h-4", children: o }),
287
+ n,
288
+ /* @__PURE__ */ s(
274
289
  F,
275
290
  {
276
- className: w(
291
+ className: x(
277
292
  "ds:mr-2 ds:ml-auto ds:size-4",
278
- y ? "ds:opacity-100" : "ds:opacity-0"
293
+ w ? "ds:opacity-100" : "ds:opacity-0"
279
294
  )
280
295
  }
281
296
  )
@@ -283,14 +298,14 @@ function me({
283
298
  }
284
299
  );
285
300
  }
286
- function pe(e) {
287
- return /* @__PURE__ */ r(H, { ...e });
288
- }
289
301
  function fe(e) {
290
- return /* @__PURE__ */ r(U, { ...e });
302
+ return /* @__PURE__ */ s(H, { ...e });
303
+ }
304
+ function ge(e) {
305
+ return /* @__PURE__ */ s(X, { ...e });
291
306
  }
292
- function k() {
293
- const e = Y(_);
307
+ function z() {
308
+ const e = Z(_);
294
309
  if (e == null)
295
310
  throw new Error(
296
311
  "useMultiSelectContext must be used within a MultiSelectContext"
@@ -298,11 +313,11 @@ function k() {
298
313
  return e;
299
314
  }
300
315
  export {
301
- le as MultiSelect,
302
- ue as MultiSelectContent,
303
- pe as MultiSelectGroup,
304
- me as MultiSelectItem,
305
- fe as MultiSelectSeparator,
306
- ae as MultiSelectTrigger,
307
- 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
308
323
  };