@pibit.ai/cure-design-system 0.6.4 → 0.6.6

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 (50) hide show
  1. package/dist/applications/date-picker/calendar.d.ts +1 -1
  2. package/dist/applications/date-picker/calendar.d.ts.map +1 -1
  3. package/dist/applications/date-picker/calendar.js +162 -157
  4. package/dist/applications/date-picker/cell.d.ts.map +1 -1
  5. package/dist/applications/date-picker/cell.js +58 -51
  6. package/dist/applications/date-picker/date-input.d.ts +2 -2
  7. package/dist/applications/date-picker/date-input.d.ts.map +1 -1
  8. package/dist/applications/date-picker/date-input.js +21 -17
  9. package/dist/applications/date-picker/date-picker.d.ts +4 -1
  10. package/dist/applications/date-picker/date-picker.d.ts.map +1 -1
  11. package/dist/applications/date-picker/date-picker.js +136 -116
  12. package/dist/applications/date-picker/date-range-picker.d.ts +4 -0
  13. package/dist/applications/date-picker/date-range-picker.d.ts.map +1 -1
  14. package/dist/applications/date-picker/date-range-picker.js +245 -197
  15. package/dist/applications/date-picker/date-time-calendar.d.ts +1 -1
  16. package/dist/applications/date-picker/date-time-calendar.d.ts.map +1 -1
  17. package/dist/applications/date-picker/date-time-calendar.js +70 -60
  18. package/dist/applications/date-picker/range-calendar.d.ts +1 -1
  19. package/dist/applications/date-picker/range-calendar.d.ts.map +1 -1
  20. package/dist/applications/date-picker/range-calendar.js +99 -90
  21. package/dist/applications/date-picker/range-preset.d.ts +4 -1
  22. package/dist/applications/date-picker/range-preset.d.ts.map +1 -1
  23. package/dist/applications/date-picker/range-preset.js +23 -17
  24. package/dist/applications/date-picker/sizes.d.ts +12 -0
  25. package/dist/applications/date-picker/sizes.d.ts.map +1 -0
  26. package/dist/applications/date-picker/sizes.js +22 -0
  27. package/dist/applications/date-picker/styles.js +1 -1
  28. package/dist/applications/date-picker/time-field.js +21 -21
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +167 -166
  32. package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
  33. package/dist/patterns/table/TableWrapper.js +122 -121
  34. package/dist/patterns/table/toolbar/ToolbarRadio.d.ts.map +1 -1
  35. package/dist/patterns/table/toolbar/ToolbarRadio.js +17 -16
  36. package/dist/patterns/table-component/TableComponent.d.ts.map +1 -1
  37. package/dist/patterns/table-component/TableComponent.js +100 -99
  38. package/dist/primitives/checkbox/checkbox.d.ts +53 -19
  39. package/dist/primitives/checkbox/checkbox.d.ts.map +1 -1
  40. package/dist/primitives/checkbox/checkbox.js +164 -45
  41. package/dist/primitives/checkbox/index.d.ts +1 -1
  42. package/dist/primitives/checkbox/index.d.ts.map +1 -1
  43. package/dist/primitives/dropdown/dropdown.d.ts.map +1 -1
  44. package/dist/primitives/dropdown/dropdown.js +18 -18
  45. package/dist/primitives/select/multi-select.d.ts.map +1 -1
  46. package/dist/primitives/select/multi-select.js +419 -422
  47. package/dist/primitives/toggle/toggle.d.ts.map +1 -1
  48. package/dist/primitives/toggle/toggle.js +4 -1
  49. package/dist/styles/components.css +1 -1
  50. package/package.json +1 -1
@@ -1,33 +1,33 @@
1
- import { jsx as l, jsxs as P, Fragment as ge } from "react/jsx-runtime";
2
- import { useId as me, useCallback as K, useMemo as C, useRef as G, useState as ue, createContext as we, useContext as H, useLayoutEffect as ye } from "react";
1
+ import { jsx as s, jsxs as M, Fragment as me } from "react/jsx-runtime";
2
+ import { useId as ge, useCallback as L, useMemo as B, useRef as G, useState as ue, createContext as we, useContext as H, useLayoutEffect as ye } from "react";
3
3
  import { useFilter as be, useInteractOutside as xe, FocusScope as ve, useFocusManager as De } from "react-aria";
4
- import { Minus as ke, ChevronDown as Ne, SearchMd as Te } from "@untitledui/icons";
5
- import { ComboBox as Se, ListBox as Re, ComboBoxStateContext as Y, ButtonContext as B, Group as Fe, Input as Me } from "react-aria-components";
4
+ import { ChevronDown as Ne, SearchMd as ke } from "@untitledui/icons";
5
+ import { ComboBox as Te, ListBox as Se, ComboBoxStateContext as Z, ButtonContext as ee, Group as Re, Input as Fe } from "react-aria-components";
6
6
  import { useListData as Ae } from "../../node_modules/react-stately/dist/private/data/useListData.js";
7
- import { Avatar as Ee } from "../avatar/avatar.js";
8
- import { HintText as Pe } from "../input/hint-text.js";
9
- import { Label as Ke } from "../input/label.js";
10
- import { Popover as Le } from "./popover.js";
11
- import { sizes as ze } from "./select-shared.js";
12
- import { TagCloseX as Oe } from "../tags/base-components/tag-close-x.js";
13
- import { SelectItem as qe } from "./select-item.js";
7
+ import { Avatar as Me } from "../avatar/avatar.js";
8
+ import { HintText as Ee } from "../input/hint-text.js";
9
+ import { Label as Pe } from "../input/label.js";
10
+ import { Popover as Ke } from "./popover.js";
11
+ import { sizes as Le } from "./select-shared.js";
12
+ import { TagCloseX as ze } from "../tags/base-components/tag-close-x.js";
13
+ import { SelectItem as Oe } from "./select-item.js";
14
14
  import { cx as k } from "../../utils/cn.js";
15
- import { getPlatformShortcutLabel as _e } from "../../utils/keyboard-shortcut.js";
16
- import { useResizeObserver as fe } from "../../hooks/use-resize-observer.js";
17
- import { SelectCheckbox as We } from "./select-checkbox.js";
18
- import { multiSelectItemMatchesFilter as oe, shouldClearMultiSelectFilterOnSelection as ae, getMultiSelectSelectAllLabel as je } from "./multi-select-utils.js";
15
+ import { getPlatformShortcutLabel as qe } from "../../utils/keyboard-shortcut.js";
16
+ import { useResizeObserver as de } from "../../hooks/use-resize-observer.js";
17
+ import { SelectCheckbox as _e } from "./select-checkbox.js";
18
+ import { multiSelectItemMatchesFilter as oe, getMultiSelectSelectAllLabel as We, shouldClearMultiSelectFilterOnSelection as je } from "./multi-select-utils.js";
19
19
  const Ve = {
20
20
  sm: "py-1.5 px-2 min-h-8 h-auto",
21
21
  md: "py-1.5 px-3 min-h-9 h-auto",
22
22
  lg: "py-2.5 px-3.5 min-h-11 h-auto"
23
23
  };
24
- function He(...s) {
25
- return (b) => {
26
- for (const f of s)
27
- f != null && (typeof f == "function" ? f(b) : f.current = b);
24
+ function Ge(...c) {
25
+ return (y) => {
26
+ for (const d of c)
27
+ d != null && (typeof d == "function" ? d(y) : d.current = y);
28
28
  };
29
29
  }
30
- const I = {
30
+ const te = {
31
31
  sm: "text-xs",
32
32
  md: "text-sm",
33
33
  lg: "text-md"
@@ -36,94 +36,94 @@ const I = {
36
36
  md: "text-sm",
37
37
  lg: "text-sm"
38
38
  };
39
- function $e(s) {
40
- return document.getElementById(s);
39
+ function He(c) {
40
+ return document.getElementById(c);
41
41
  }
42
- function Ge({
43
- triggerRef: s,
44
- popoverRef: b
42
+ function $e({
43
+ triggerRef: c,
44
+ popoverRef: y
45
45
  }) {
46
- const f = H(Y);
46
+ const d = H(Z);
47
47
  return xe({
48
- ref: b,
49
- isDisabled: !(f != null && f.isOpen),
50
- onInteractOutside: (p) => {
51
- var i;
52
- (i = s.current) != null && i.contains(p.target) || f == null || f.close();
48
+ ref: y,
49
+ isDisabled: !(d != null && d.isOpen),
50
+ onInteractOutside: (m) => {
51
+ var l;
52
+ (l = c.current) != null && l.contains(m.target) || d == null || d.close();
53
53
  }
54
54
  }), null;
55
55
  }
56
- function de(s) {
57
- const b = s.target;
58
- b instanceof Element && b.closest("input, textarea, [contenteditable='true']") || s.preventDefault();
56
+ function re(c) {
57
+ const y = c.target;
58
+ y instanceof Element && y.closest("input, textarea, [contenteditable='true']") || c.preventDefault();
59
59
  }
60
60
  const Ue = ({
61
- value: s,
62
- placeholder: b,
63
- listboxId: f,
64
- onChange: p
61
+ value: c,
62
+ placeholder: y,
63
+ listboxId: d,
64
+ onChange: m
65
65
  }) => {
66
- const i = H(Y), w = (e) => {
67
- e.stopPropagation(), i == null || i.open();
68
- }, S = (e) => {
69
- e.stopPropagation(), de(e);
70
- }, d = (e) => {
66
+ const l = H(Z), b = (e) => {
67
+ e.stopPropagation(), l == null || l.open();
68
+ }, T = (e) => {
69
+ e.stopPropagation(), re(e);
70
+ }, p = (e) => {
71
71
  e.stopPropagation();
72
- }, o = (e) => {
72
+ }, a = (e) => {
73
73
  var r;
74
- const a = $e(f), y = a ? Array.from(a.querySelectorAll('[role="option"]')) : [];
74
+ const o = He(d), g = o ? Array.from(o.querySelectorAll('[role="option"]')) : [];
75
75
  switch (e.key) {
76
76
  case "ArrowDown":
77
- e.preventDefault(), y.length > 0 && ((a == null ? void 0 : a.querySelector(
77
+ e.preventDefault(), g.length > 0 && ((o == null ? void 0 : o.querySelector(
78
78
  '[role="option"][data-focused="true"]'
79
- )) ?? y[0]).focus();
79
+ )) ?? g[0]).focus();
80
80
  return;
81
81
  case "ArrowUp":
82
- e.preventDefault(), y.length > 0 && y[y.length - 1].focus();
82
+ e.preventDefault(), g.length > 0 && g[g.length - 1].focus();
83
83
  return;
84
84
  case "Enter":
85
85
  if (((r = document.activeElement) == null ? void 0 : r.getAttribute("role")) === "option")
86
86
  return;
87
- y.length > 0 && (e.preventDefault(), ((a == null ? void 0 : a.querySelector(
87
+ g.length > 0 && (e.preventDefault(), ((o == null ? void 0 : o.querySelector(
88
88
  '[role="option"][data-focused="true"]'
89
- )) ?? y[0]).click());
89
+ )) ?? g[0]).click());
90
90
  return;
91
91
  case "Escape":
92
- e.preventDefault(), i == null || i.close();
92
+ e.preventDefault(), l == null || l.close();
93
93
  return;
94
94
  default:
95
95
  (e.key.length === 1 || e.key === "Backspace" || e.key === "Delete" || e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End" || e.key === "Tab") && e.stopPropagation();
96
96
  }
97
97
  };
98
- return /* @__PURE__ */ l(
98
+ return /* @__PURE__ */ s(
99
99
  "div",
100
100
  {
101
101
  "data-nested-select-overlay": !0,
102
102
  className: "sticky top-0 z-10 border-b border-tertiary bg-primary p-1.5",
103
- onMouseDown: S,
104
- onPointerDown: d,
103
+ onMouseDown: T,
104
+ onPointerDown: p,
105
105
  onClick: (e) => e.stopPropagation(),
106
- children: /* @__PURE__ */ P(
106
+ children: /* @__PURE__ */ M(
107
107
  "div",
108
108
  {
109
109
  className: "flex h-8 items-center gap-2 rounded-lg bg-secondary px-2",
110
- onMouseDown: S,
110
+ onMouseDown: T,
111
111
  children: [
112
- /* @__PURE__ */ l(Te, { "aria-hidden": !0, className: "size-4 shrink-0 text-fg-quaternary" }),
113
- /* @__PURE__ */ l(
112
+ /* @__PURE__ */ s(ke, { "aria-hidden": !0, className: "size-4 shrink-0 text-fg-quaternary" }),
113
+ /* @__PURE__ */ s(
114
114
  "input",
115
115
  {
116
116
  type: "text",
117
117
  role: "combobox",
118
118
  "aria-autocomplete": "list",
119
- "aria-expanded": (i == null ? void 0 : i.isOpen) ?? !1,
120
- "aria-controls": f,
121
- value: s,
122
- onChange: p,
123
- onMouseDown: w,
124
- onKeyDown: o,
125
- onFocus: () => i == null ? void 0 : i.open(),
126
- placeholder: b,
119
+ "aria-expanded": (l == null ? void 0 : l.isOpen) ?? !1,
120
+ "aria-controls": d,
121
+ value: c,
122
+ onChange: m,
123
+ onMouseDown: b,
124
+ onKeyDown: a,
125
+ onFocus: () => l == null ? void 0 : l.open(),
126
+ placeholder: y,
127
127
  className: "w-full bg-transparent text-xs text-primary outline-none placeholder:text-placeholder_subtle",
128
128
  autoFocus: !1
129
129
  }
@@ -133,7 +133,7 @@ const Ue = ({
133
133
  )
134
134
  }
135
135
  );
136
- }, pe = we({
136
+ }, fe = we({
137
137
  size: "sm",
138
138
  selectedKeys: [],
139
139
  selectedItems: {},
@@ -145,324 +145,321 @@ const Ue = ({
145
145
  chipClassName: void 0,
146
146
  searchable: !1
147
147
  }), Xe = ({
148
- items: s,
149
- children: b,
150
- size: f = "sm",
151
- selectedItems: p,
152
- onItemCleared: i,
153
- onItemInserted: w,
154
- onBulkSelectionChange: S,
155
- shortcut: d,
156
- placeholder: o = "Search",
148
+ items: c,
149
+ children: y,
150
+ size: d = "sm",
151
+ selectedItems: m,
152
+ onItemCleared: l,
153
+ onItemInserted: b,
154
+ onBulkSelectionChange: T,
155
+ shortcut: p,
156
+ placeholder: a = "Search",
157
157
  showAvatar: e = !0,
158
- readOnly: a = !1,
159
- chipClassName: y,
158
+ readOnly: o = !1,
159
+ chipClassName: g,
160
160
  searchable: r = !1,
161
- searchPlaceholder: M = "Search...",
162
- showSelectAll: N = !1,
161
+ searchPlaceholder: S = "Search...",
162
+ showSelectAll: R = !1,
163
163
  endAdornment: $,
164
- description: W,
164
+ description: j,
165
165
  onOpenChange: u,
166
166
  // Omit these props to avoid conflicts with the `Select` component
167
167
  name: h,
168
- className: A,
169
- ...g
168
+ className: F,
169
+ ...f
170
170
  }) => {
171
- var se;
172
- const z = me(), { contains: j } = be({ sensitivity: "base" }), R = (se = p == null ? void 0 : p.items) != null && se.length ? p.items.map((t) => t.id) : [], x = K(
173
- (t) => R.some((c) => String(c) === String(t)),
174
- [R]
175
- ), U = K(
176
- (t, c) => {
177
- const v = oe(
178
- t,
179
- c,
180
- j
171
+ var ae;
172
+ const _ = ge(), { contains: V } = be({ sensitivity: "base" }), E = (ae = m == null ? void 0 : m.items) != null && ae.length ? m.items.map((n) => n.id) : [], v = L(
173
+ (n) => E.some((i) => String(i) === String(n)),
174
+ [E]
175
+ ), X = L(
176
+ (n, i) => {
177
+ const A = oe(
178
+ n,
179
+ i,
180
+ V
181
181
  );
182
- return (N || !x(t.id)) && v;
182
+ return (R || !v(n.id)) && A;
183
183
  },
184
- [j, x, N]
185
- ), m = Ae({
186
- initialItems: s,
187
- filter: U
188
- }), L = !!(r && m.filterText.trim()), T = C(() => s != null && s.length ? L ? s.filter(
189
- (t) => oe(t, m.filterText, j)
190
- ) : s : [], [s, L, m.filterText, j]), O = C(() => {
191
- if (T.length === 0) return "unselected";
192
- const t = T.filter(
193
- (c) => x(c.id)
184
+ [V, v, R]
185
+ ), w = Ae({
186
+ initialItems: c,
187
+ filter: X
188
+ }), z = !!(r && w.filterText.trim()), D = B(() => c != null && c.length ? z ? c.filter(
189
+ (n) => oe(n, w.filterText, V)
190
+ ) : c : [], [c, z, w.filterText, V]), P = B(() => {
191
+ if (D.length === 0) return "unselected";
192
+ const n = D.filter(
193
+ (i) => v(i.id)
194
194
  ).length;
195
- return t === 0 ? "unselected" : t === T.length ? "selected" : "indeterminate";
196
- }, [T, x]), n = K(() => {
197
- const t = O !== "selected", c = T.map((D) => D.id), v = new Set(c.map(String)), E = t ? [.../* @__PURE__ */ new Set([...R, ...c])] : R.filter((D) => !v.has(String(D))), V = T.filter((D) => !x(D.id)), le = T.filter((D) => x(D.id)).map((D) => D.id);
198
- if (t && V.length > 0 ? p.append(...V) : !t && le.length > 0 && p.remove(...le), S) {
199
- S(E);
195
+ return n === 0 ? "unselected" : n === D.length ? "selected" : "indeterminate";
196
+ }, [D, v]), t = G(!1), N = L(() => {
197
+ t.current = !0, setTimeout(() => {
198
+ t.current = !1;
199
+ }, 0);
200
+ }, []), J = L(() => {
201
+ N();
202
+ const n = P !== "selected", i = D.map((x) => x.id), A = new Set(i.map(String)), K = n ? [.../* @__PURE__ */ new Set([...E, ...i])] : E.filter((x) => !A.has(String(x))), W = D.filter((x) => !v(x.id)), U = D.filter((x) => v(x.id)).map((x) => x.id);
203
+ if (n && W.length > 0 ? m.append(...W) : !n && U.length > 0 && m.remove(...U), T) {
204
+ T(K);
200
205
  return;
201
206
  }
202
- if (t) {
203
- for (const D of T)
204
- x(D.id) || w == null || w(D.id);
207
+ if (n) {
208
+ for (const x of D)
209
+ v(x.id) || b == null || b(x.id);
205
210
  return;
206
211
  }
207
- for (const D of T)
208
- x(D.id) && (i == null || i(D.id));
212
+ for (const x of D)
213
+ v(x.id) && (l == null || l(x.id));
209
214
  }, [
210
- O,
215
+ N,
216
+ P,
217
+ D,
218
+ E,
219
+ m,
220
+ v,
211
221
  T,
212
- R,
213
- p,
214
- x,
215
- S,
216
- w,
217
- i
218
- ]), F = K(
219
- (t) => {
220
- const c = t.values().next().value;
221
- c && (p.remove(c), i == null || i(c));
222
+ b,
223
+ l
224
+ ]), Q = L(
225
+ (n) => {
226
+ const i = n.values().next().value;
227
+ i && (m.remove(i), l == null || l(i));
222
228
  },
223
- [p, i]
224
- ), q = G(null), X = (t) => {
225
- if (t == null)
229
+ [m, l]
230
+ ), O = G(null), Y = (n) => {
231
+ if (n == null || t.current)
226
232
  return;
227
- const c = String(t);
228
- if (q.current === c)
233
+ const i = String(n);
234
+ if (O.current === i)
229
235
  return;
230
- q.current = c, setTimeout(() => {
231
- q.current === c && (q.current = null);
236
+ O.current = i, setTimeout(() => {
237
+ O.current === i && (O.current = null);
232
238
  }, 0);
233
- const v = m.getItem(t) ?? (s == null ? void 0 : s.find((E) => String(E.id) === String(t)));
234
- if (v) {
235
- if (x(t)) {
236
- const E = R.find((V) => String(V) === c) ?? t;
237
- p.remove(E), i == null || i(E);
239
+ const A = w.getItem(n) ?? (c == null ? void 0 : c.find((K) => String(K.id) === String(n)));
240
+ if (A) {
241
+ if (v(n)) {
242
+ const K = E.find((W) => String(W) === i) ?? n;
243
+ m.remove(K), l == null || l(K);
238
244
  } else
239
- p.append(v), w == null || w(t);
240
- ae(r) && m.setFilterText("");
245
+ m.append(A), b == null || b(n);
246
+ je(r) && w.setFilterText("");
241
247
  }
242
- }, J = K(
243
- (t) => {
244
- if (!N || t === "all" || q.current !== null)
245
- return;
246
- const c = Array.from(t);
247
- for (const v of R)
248
- c.some((E) => String(E) === String(v)) || (p.remove(v), i == null || i(v));
249
- for (const v of c)
250
- if (!x(v)) {
251
- const E = m.getItem(v) ?? (s == null ? void 0 : s.find((V) => String(V.id) === String(v)));
252
- E && (p.append(E), w == null || w(v));
253
- }
254
- ae(r) && m.setFilterText("");
248
+ }, pe = L(
249
+ (n) => {
250
+ n || (O.current = null, t.current = !1, r && w.setFilterText("")), u == null || u(n);
255
251
  },
256
- [
257
- N,
258
- R,
259
- p,
260
- x,
261
- m,
262
- s,
263
- i,
264
- w,
265
- r
266
- ]
267
- ), Q = K(
268
- (t) => {
269
- !t && r && m.setFilterText(""), u == null || u(t);
270
- },
271
- [m, u, r]
272
- ), ee = (t) => {
273
- a || m.setFilterText(t);
274
- }, _ = G(null), te = G(null), [he, re] = ue(0), Z = K(() => {
275
- var c;
276
- if (!_.current) return;
277
- let t = (c = _.current) == null ? void 0 : c.getBoundingClientRect();
278
- re(t.width);
279
- }, [_, re]);
280
- fe({
281
- ref: _,
282
- onResize: Z,
252
+ [w, u, r]
253
+ ), ne = (n) => {
254
+ o || w.setFilterText(n);
255
+ }, q = G(null), C = G(null), [he, ie] = ue(0), I = L(() => {
256
+ var i;
257
+ if (!q.current) return;
258
+ let n = (i = q.current) == null ? void 0 : i.getBoundingClientRect();
259
+ ie(n.width);
260
+ }, [q, ie]);
261
+ de({
262
+ ref: q,
263
+ onResize: I,
283
264
  box: "border-box"
284
265
  });
285
- const ne = N && !!(s != null && s.length) && (!L || T.length > 0), ie = je(L);
286
- return /* @__PURE__ */ l(
287
- pe.Provider,
266
+ const se = R && !!(c != null && c.length) && (!z || D.length > 0), le = We(z);
267
+ return /* @__PURE__ */ s(
268
+ fe.Provider,
288
269
  {
289
270
  value: {
290
- size: f,
291
- selectedKeys: R,
292
- selectedItems: p,
293
- onInputChange: ee,
294
- onRemove: F,
271
+ size: d,
272
+ selectedKeys: E,
273
+ selectedItems: m,
274
+ onInputChange: ne,
275
+ onRemove: Q,
295
276
  showAvatar: e,
296
- chipClassName: y,
277
+ chipClassName: g,
297
278
  searchable: r
298
279
  },
299
- children: /* @__PURE__ */ l(
300
- Se,
280
+ children: /* @__PURE__ */ s(
281
+ Te,
301
282
  {
302
283
  allowsEmptyCollection: !0,
303
284
  allowsCustomValue: !1,
304
- menuTrigger: r || a ? "manual" : "focus",
305
- items: m.items,
306
- onInputChange: r ? void 0 : ee,
307
- inputValue: r ? "" : m.filterText,
285
+ menuTrigger: r || o ? "manual" : "focus",
286
+ items: w.items,
287
+ onInputChange: r ? void 0 : ne,
288
+ inputValue: r ? "" : w.filterText,
308
289
  selectedKey: null,
309
- onSelectionChange: X,
310
- onOpenChange: Q,
311
- ...g,
312
- children: (t) => /* @__PURE__ */ P("div", { className: "flex flex-col gap-1.5", children: [
313
- /* @__PURE__ */ l(
314
- Ge,
290
+ onSelectionChange: Y,
291
+ onOpenChange: pe,
292
+ ...f,
293
+ children: (n) => /* @__PURE__ */ M("div", { className: "flex flex-col gap-1.5", children: [
294
+ /* @__PURE__ */ s(
295
+ $e,
315
296
  {
316
- triggerRef: _,
317
- popoverRef: te
297
+ triggerRef: q,
298
+ popoverRef: C
318
299
  }
319
300
  ),
320
- g.label && /* @__PURE__ */ l(
321
- Ke,
301
+ f.label && /* @__PURE__ */ s(
302
+ Pe,
322
303
  {
323
- isRequired: t.isRequired,
324
- tooltip: g.tooltip,
325
- className: ce[f],
326
- children: g.label
304
+ isRequired: n.isRequired,
305
+ tooltip: f.tooltip,
306
+ className: ce[d],
307
+ children: f.label
327
308
  }
328
309
  ),
329
- W && /* @__PURE__ */ l(
310
+ j && /* @__PURE__ */ s(
330
311
  "p",
331
312
  {
332
313
  className: k(
333
314
  "text-tertiary",
334
- ce[f],
315
+ ce[d],
335
316
  "-mt-0.5 leading-[18px]"
336
317
  ),
337
- children: W
318
+ children: j
338
319
  }
339
320
  ),
340
- /* @__PURE__ */ l(
321
+ /* @__PURE__ */ s(
341
322
  Qe,
342
323
  {
343
- size: f,
344
- shortcut: d,
345
- ref: _,
346
- placeholder: o,
347
- readOnly: a,
348
- isInvalid: t.isInvalid,
324
+ size: d,
325
+ shortcut: p,
326
+ ref: q,
327
+ placeholder: a,
328
+ readOnly: o,
329
+ isInvalid: n.isInvalid,
349
330
  endAdornment: $,
350
- onFocus: Z,
351
- onPointerEnter: Z
331
+ onFocus: I,
332
+ onPointerEnter: I
352
333
  }
353
334
  ),
354
- (r || ne || m.items.length > 0) && /* @__PURE__ */ P(
355
- Le,
335
+ (r || se || w.items.length > 0) && /* @__PURE__ */ s(
336
+ Ke,
356
337
  {
357
338
  size: "md",
358
- ref: te,
359
- triggerRef: _,
360
- className: k("flex flex-col", g == null ? void 0 : g.popoverClassName),
339
+ ref: C,
340
+ triggerRef: q,
341
+ className: k("flex flex-col", f == null ? void 0 : f.popoverClassName),
361
342
  style: { width: Math.max(he, 40) },
362
- onMouseDown: (c) => {
363
- c.stopPropagation(), de(c);
343
+ onMouseDown: (i) => {
344
+ i.stopPropagation(), re(i);
364
345
  },
365
- onPointerDown: (c) => c.stopPropagation(),
366
- children: [
367
- r && /* @__PURE__ */ l(
368
- Ue,
369
- {
370
- listboxId: z,
371
- value: m.filterText,
372
- placeholder: M,
373
- onChange: (c) => m.setFilterText(c.target.value)
374
- }
375
- ),
376
- ne && /* @__PURE__ */ P(
377
- "div",
378
- {
379
- className: k(
380
- "flex shrink-0 items-center gap-2 border-b border-secondary px-3 py-2.5",
381
- "cursor-pointer hover:bg-secondary_subtle transition-colors",
382
- g.isDisabled && "cursor-not-allowed opacity-50"
346
+ onPointerDown: (i) => i.stopPropagation(),
347
+ children: /* @__PURE__ */ M(
348
+ "div",
349
+ {
350
+ className: "flex min-h-0 w-full flex-1 flex-col",
351
+ onMouseDownCapture: (i) => {
352
+ var W, U;
353
+ if (re(i), !i.defaultPrevented)
354
+ return;
355
+ const A = (W = q.current) == null ? void 0 : W.querySelector("input"), K = document.activeElement;
356
+ A && K !== A && !((U = C.current) != null && U.contains(K)) && A.focus({ preventScroll: !0 });
357
+ },
358
+ children: [
359
+ r && /* @__PURE__ */ s(
360
+ Ue,
361
+ {
362
+ listboxId: _,
363
+ value: w.filterText,
364
+ placeholder: S,
365
+ onChange: (i) => w.setFilterText(i.target.value)
366
+ }
367
+ ),
368
+ se && /* @__PURE__ */ M(
369
+ "div",
370
+ {
371
+ role: "checkbox",
372
+ tabIndex: f.isDisabled ? -1 : 0,
373
+ "aria-disabled": f.isDisabled || void 0,
374
+ "aria-checked": P === "indeterminate" ? "mixed" : P === "selected",
375
+ "aria-label": le,
376
+ className: k(
377
+ "flex shrink-0 items-center gap-2 border-b border-secondary px-3 py-2.5",
378
+ "cursor-pointer hover:bg-secondary_subtle transition-colors",
379
+ f.isDisabled && "cursor-not-allowed opacity-50"
380
+ ),
381
+ onPointerDown: f.isDisabled ? void 0 : (i) => {
382
+ i.stopPropagation(), N();
383
+ },
384
+ onClick: f.isDisabled ? void 0 : J,
385
+ onKeyDown: f.isDisabled ? void 0 : (i) => {
386
+ (i.key === " " || i.key === "Enter") && (i.preventDefault(), J());
387
+ },
388
+ children: [
389
+ /* @__PURE__ */ s(
390
+ _e,
391
+ {
392
+ size: d === "lg" ? "md" : "sm",
393
+ checked: P === "indeterminate" ? "indeterminate" : P === "selected",
394
+ disabled: f.isDisabled,
395
+ tabIndex: -1,
396
+ "aria-hidden": !0,
397
+ className: "pointer-events-none"
398
+ }
399
+ ),
400
+ /* @__PURE__ */ s(
401
+ "span",
402
+ {
403
+ className: k(
404
+ "font-medium text-primary",
405
+ te[d]
406
+ ),
407
+ children: le
408
+ }
409
+ )
410
+ ]
411
+ }
383
412
  ),
384
- onClick: g.isDisabled ? void 0 : n,
385
- children: [
386
- O === "indeterminate" ? /* @__PURE__ */ l(
387
- "span",
413
+ /* @__PURE__ */ M("div", { className: "flex-1 overflow-y-auto", children: [
414
+ w.items.length === 0 && r && z && /* @__PURE__ */ s("div", { className: "flex items-center justify-center py-6", children: /* @__PURE__ */ s("p", { className: k("text-tertiary", te[d]), children: "No results" }) }),
415
+ /* @__PURE__ */ s(
416
+ Se,
388
417
  {
418
+ id: _,
419
+ selectionMode: "multiple",
420
+ selectedKeys: R ? new Set(E) : void 0,
389
421
  className: k(
390
- "flex size-4 shrink-0 items-center justify-center rounded ring-1 ring-inset",
391
- "bg-brand-solid ring-bg-brand-solid text-fg-white"
422
+ "size-full outline-hidden",
423
+ w.items.length === 0 && "hidden"
392
424
  ),
393
- "aria-hidden": !0,
394
- children: /* @__PURE__ */ l(ke, { className: "size-3 stroke-[2.5]" })
395
- }
396
- ) : /* @__PURE__ */ l(
397
- We,
398
- {
399
- size: f === "lg" ? "md" : "sm",
400
- checked: O === "selected",
401
- onCheckedChange: n,
402
- onClick: (c) => c.stopPropagation(),
403
- disabled: g.isDisabled,
404
- "aria-label": ie
405
- }
406
- ),
407
- /* @__PURE__ */ l(
408
- "span",
409
- {
410
- className: k("font-medium text-primary", I[f]),
411
- children: ie
425
+ children: y
412
426
  }
413
427
  )
414
- ]
415
- }
416
- ),
417
- /* @__PURE__ */ P("div", { className: "flex-1 overflow-y-auto", children: [
418
- m.items.length === 0 && r && L && /* @__PURE__ */ l("div", { className: "flex items-center justify-center py-6", children: /* @__PURE__ */ l("p", { className: k("text-tertiary", I[f]), children: "No results" }) }),
419
- /* @__PURE__ */ l(
420
- Re,
421
- {
422
- id: z,
423
- selectionMode: "multiple",
424
- selectedKeys: N ? new Set(R) : void 0,
425
- onSelectionChange: N ? J : void 0,
426
- className: k(
427
- "size-full outline-hidden",
428
- m.items.length === 0 && "hidden"
429
- ),
430
- children: b
431
- }
432
- )
433
- ] })
434
- ]
428
+ ] })
429
+ ]
430
+ }
431
+ )
435
432
  }
436
433
  ),
437
- g.hint && /* @__PURE__ */ l(Pe, { isInvalid: t.isInvalid, children: g.hint })
434
+ f.hint && /* @__PURE__ */ s(Ee, { isInvalid: n.isInvalid, children: f.hint })
438
435
  ] })
439
436
  }
440
437
  )
441
438
  }
442
439
  );
443
440
  }, Je = ({
444
- isDisabled: s,
445
- shortcut: b,
446
- shortcutClassName: f,
447
- placeholder: p,
448
- readOnly: i = !1,
449
- isFocusWithin: w,
450
- inputRef: S
441
+ isDisabled: c,
442
+ shortcut: y,
443
+ shortcutClassName: d,
444
+ placeholder: m,
445
+ readOnly: l = !1,
446
+ isFocusWithin: b,
447
+ inputRef: T
451
448
  }) => {
452
- var U, m, L, T, O;
453
- const d = De(), o = H(pe), e = H(Y), a = w || !!(e != null && e.isOpen), y = G(null), [r, M] = ue(!1), N = (U = o == null ? void 0 : o.selectedItems) == null ? void 0 : U.items, $ = (N == null ? void 0 : N.map((n) => n.id).join("\0")) ?? "", W = (e == null ? void 0 : e.inputValue) ?? "", u = K(() => {
454
- const n = y.current;
455
- if (!n || a) {
456
- M(!1);
449
+ var X, w, z, D, P;
450
+ const p = De(), a = H(fe), e = H(Z), o = b || !!(e != null && e.isOpen), g = G(null), [r, S] = ue(!1), R = (X = a == null ? void 0 : a.selectedItems) == null ? void 0 : X.items, $ = (R == null ? void 0 : R.map((t) => t.id).join("\0")) ?? "", j = (e == null ? void 0 : e.inputValue) ?? "", u = L(() => {
451
+ const t = g.current;
452
+ if (!t || o) {
453
+ S(!1);
457
454
  return;
458
455
  }
459
- const F = n.scrollWidth > n.clientWidth + 0.5;
460
- M(
461
- F && n.scrollLeft + n.clientWidth < n.scrollWidth - 1
456
+ const N = t.scrollWidth > t.clientWidth + 0.5;
457
+ S(
458
+ N && t.scrollLeft + t.clientWidth < t.scrollWidth - 1
462
459
  );
463
- }, [a]);
464
- fe({
465
- ref: y,
460
+ }, [o]);
461
+ de({
462
+ ref: g,
466
463
  onResize: u,
467
464
  box: "border-box"
468
465
  }), ye(() => {
@@ -470,150 +467,150 @@ const Ue = ({
470
467
  }, [
471
468
  u,
472
469
  $,
473
- a,
474
- W
470
+ o,
471
+ j
475
472
  ]);
476
- const h = (n) => {
477
- var F;
478
- n.preventDefault(), (F = S.current) == null || F.focus({ preventScroll: !0 });
479
- }, A = (n) => {
480
- if (!(!(n.currentTarget.selectionStart === 0 && n.currentTarget.selectionEnd === 0) && n.currentTarget.value !== ""))
481
- switch (n.key) {
473
+ const h = (t) => {
474
+ var N;
475
+ t.preventDefault(), (N = T.current) == null || N.focus({ preventScroll: !0 });
476
+ }, F = (t) => {
477
+ if (!(!(t.currentTarget.selectionStart === 0 && t.currentTarget.selectionEnd === 0) && t.currentTarget.value !== ""))
478
+ switch (t.key) {
482
479
  case "Backspace":
483
480
  case "ArrowLeft":
484
- d == null || d.focusPrevious({ wrap: !1, tabbable: !1 });
481
+ p == null || p.focusPrevious({ wrap: !1, tabbable: !1 });
485
482
  break;
486
483
  case "ArrowRight":
487
- d == null || d.focusNext({ wrap: !1, tabbable: !1 });
484
+ p == null || p.focusNext({ wrap: !1, tabbable: !1 });
488
485
  break;
489
486
  }
490
- }, g = o == null ? void 0 : o.searchable, z = (n) => {
491
- n.stopPropagation(), e && !e.isOpen && e.open();
492
- }, j = () => {
493
- g && e && !e.isOpen && e.open();
494
- }, R = (n, F) => {
495
- var X, J, Q;
496
- if (n.key === "Tab")
487
+ }, f = a == null ? void 0 : a.searchable, _ = (t) => {
488
+ t.stopPropagation(), e && !e.isOpen && e.open();
489
+ }, V = () => {
490
+ f && e && !e.isOpen && e.open();
491
+ }, E = (t, N) => {
492
+ var Q, O, Y;
493
+ if (t.key === "Tab")
497
494
  return;
498
- n.preventDefault();
499
- const q = ((Q = (J = (X = o == null ? void 0 : o.selectedItems) == null ? void 0 : X.items) == null ? void 0 : J[0]) == null ? void 0 : Q.id) === F;
500
- switch (n.key) {
495
+ t.preventDefault();
496
+ const J = ((Y = (O = (Q = a == null ? void 0 : a.selectedItems) == null ? void 0 : Q.items) == null ? void 0 : O[0]) == null ? void 0 : Y.id) === N;
497
+ switch (t.key) {
501
498
  case " ":
502
499
  case "Enter":
503
500
  case "Backspace":
504
- q ? d == null || d.focusNext({ wrap: !1, tabbable: !1 }) : d == null || d.focusPrevious({ wrap: !1, tabbable: !1 }), o.onRemove(/* @__PURE__ */ new Set([F]));
501
+ J ? p == null || p.focusNext({ wrap: !1, tabbable: !1 }) : p == null || p.focusPrevious({ wrap: !1, tabbable: !1 }), a.onRemove(/* @__PURE__ */ new Set([N]));
505
502
  break;
506
503
  case "ArrowLeft":
507
- d == null || d.focusPrevious({ wrap: !1, tabbable: !1 });
504
+ p == null || p.focusPrevious({ wrap: !1, tabbable: !1 });
508
505
  break;
509
506
  case "ArrowRight":
510
- d == null || d.focusNext({ wrap: !1, tabbable: !1 });
507
+ p == null || p.focusNext({ wrap: !1, tabbable: !1 });
511
508
  break;
512
509
  case "Escape":
513
510
  e == null || e.close();
514
511
  break;
515
512
  }
516
- }, x = ((L = (m = o == null ? void 0 : o.selectedItems) == null ? void 0 : m.items) == null ? void 0 : L.length) === 0;
517
- return /* @__PURE__ */ P("div", { className: "relative min-w-0 w-full flex-1", children: [
518
- /* @__PURE__ */ P(
513
+ }, v = ((z = (w = a == null ? void 0 : a.selectedItems) == null ? void 0 : w.items) == null ? void 0 : z.length) === 0;
514
+ return /* @__PURE__ */ M("div", { className: "relative min-w-0 w-full flex-1", children: [
515
+ /* @__PURE__ */ M(
519
516
  "div",
520
517
  {
521
- ref: y,
522
- onScroll: a ? void 0 : u,
518
+ ref: g,
519
+ onScroll: o ? void 0 : u,
523
520
  className: k(
524
521
  "flex w-full min-w-0 gap-1.5",
525
- a ? k(
522
+ o ? k(
526
523
  "flex-wrap items-start overflow-y-auto scrollbar-hide"
527
524
  // multiSelectExpandedMaxHeight[controlSize],
528
525
  ) : "flex-nowrap items-center overflow-x-auto overflow-y-hidden scrollbar-hide"
529
526
  ),
530
527
  children: [
531
- /* @__PURE__ */ l(B.Provider, { value: null, children: !x && ((O = (T = o == null ? void 0 : o.selectedItems) == null ? void 0 : T.items) == null ? void 0 : O.map((n) => /* @__PURE__ */ P(
528
+ /* @__PURE__ */ s(ee.Provider, { value: null, children: !v && ((P = (D = a == null ? void 0 : a.selectedItems) == null ? void 0 : D.items) == null ? void 0 : P.map((t) => /* @__PURE__ */ M(
532
529
  "span",
533
530
  {
534
531
  "data-multiselect-chip": !0,
535
532
  className: k(
536
533
  "flex items-center rounded-md bg-primary py-0.5 pr-1 pl-1.25 ring-1 ring-[var(--color-gray-100)] ring-inset",
537
- !a && "shrink-0",
538
- o == null ? void 0 : o.chipClassName
534
+ !o && "shrink-0",
535
+ a == null ? void 0 : a.chipClassName
539
536
  ),
540
537
  children: [
541
- /* @__PURE__ */ P(
538
+ /* @__PURE__ */ M(
542
539
  "span",
543
540
  {
544
541
  className: "flex min-w-0 items-center",
545
542
  onMouseDown: h,
546
543
  children: [
547
- (o == null ? void 0 : o.showAvatar) && /* @__PURE__ */ l(
548
- Ee,
544
+ (a == null ? void 0 : a.showAvatar) && /* @__PURE__ */ s(
545
+ Me,
549
546
  {
550
547
  size: "xxs",
551
- alt: n == null ? void 0 : n.label,
552
- src: n == null ? void 0 : n.avatarUrl,
553
- initials: n == null ? void 0 : n.initials
548
+ alt: t == null ? void 0 : t.label,
549
+ src: t == null ? void 0 : t.avatarUrl,
550
+ initials: t == null ? void 0 : t.initials
554
551
  }
555
552
  ),
556
- /* @__PURE__ */ l("p", { className: "ml-1.25 truncate text-xs font-medium whitespace-nowrap text-secondary select-none", children: n == null ? void 0 : n.label })
553
+ /* @__PURE__ */ s("p", { className: "ml-1.25 truncate text-xs font-medium whitespace-nowrap text-secondary select-none", children: t == null ? void 0 : t.label })
557
554
  ]
558
555
  }
559
556
  ),
560
- /* @__PURE__ */ l(
561
- Oe,
557
+ /* @__PURE__ */ s(
558
+ ze,
562
559
  {
563
560
  size: "md",
564
- isDisabled: s,
565
- preventFocusOnPress: !a,
561
+ isDisabled: c,
562
+ preventFocusOnPress: !o,
566
563
  className: "ml-0.75",
567
- onKeyDown: (F) => R(F, n.id),
568
- onPress: () => o.onRemove(/* @__PURE__ */ new Set([n.id]))
564
+ onKeyDown: (N) => E(N, t.id),
565
+ onPress: () => a.onRemove(/* @__PURE__ */ new Set([t.id]))
569
566
  }
570
567
  )
571
568
  ]
572
569
  },
573
- n.id
570
+ t.id
574
571
  ))) }),
575
- /* @__PURE__ */ P(
572
+ /* @__PURE__ */ M(
576
573
  "div",
577
574
  {
578
575
  className: k(
579
576
  "relative flex flex-1 flex-row items-center",
580
- a ? "min-w-[20%]" : "min-w-0",
581
- !x && "ml-0.5",
582
- b && "min-w-[30%]"
577
+ o ? "min-w-[20%]" : "min-w-0",
578
+ !v && "ml-0.5",
579
+ y && "min-w-[30%]"
583
580
  ),
584
581
  children: [
585
- /* @__PURE__ */ l(
586
- Me,
582
+ /* @__PURE__ */ s(
583
+ Fe,
587
584
  {
588
- ref: S,
589
- placeholder: x ? p : void 0,
590
- onKeyDown: A,
591
- onMouseDown: z,
592
- onFocus: j,
593
- readOnly: i || g,
585
+ ref: T,
586
+ placeholder: v ? m : void 0,
587
+ onKeyDown: F,
588
+ onMouseDown: _,
589
+ onFocus: V,
590
+ readOnly: l || f,
594
591
  className: k(
595
592
  "w-full min-w-0 flex-[1_0_0] appearance-none bg-transparent text-ellipsis text-primary caret-alpha-black/90 outline-none placeholder:text-placeholder_subtle focus:outline-hidden disabled:cursor-not-allowed disabled:text-disabled disabled:placeholder:text-disabled",
596
- i && "cursor-default",
597
- I[(o == null ? void 0 : o.size) || "sm"]
593
+ l && "cursor-default",
594
+ te[(a == null ? void 0 : a.size) || "sm"]
598
595
  )
599
596
  }
600
597
  ),
601
- b && /* @__PURE__ */ l(
598
+ y && /* @__PURE__ */ s(
602
599
  "div",
603
600
  {
604
601
  "aria-hidden": "true",
605
602
  className: k(
606
603
  "absolute inset-y-0.5 right-0.5 z-10 flex items-center rounded-r-[inherit] bg-linear-to-r from-transparent to-bg-primary to-40% pl-8",
607
- f
604
+ d
608
605
  ),
609
- children: /* @__PURE__ */ l(
606
+ children: /* @__PURE__ */ s(
610
607
  "span",
611
608
  {
612
609
  className: k(
613
610
  "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset",
614
- s && "bg-transparent text-disabled"
611
+ c && "bg-transparent text-disabled"
615
612
  ),
616
- children: _e(["meta"], "K")
613
+ children: qe(["meta"], "K")
617
614
  }
618
615
  )
619
616
  }
@@ -624,7 +621,7 @@ const Ue = ({
624
621
  ]
625
622
  }
626
623
  ),
627
- !a && r && /* @__PURE__ */ l(
624
+ !o && r && /* @__PURE__ */ s(
628
625
  "div",
629
626
  {
630
627
  "aria-hidden": !0,
@@ -633,82 +630,82 @@ const Ue = ({
633
630
  )
634
631
  ] });
635
632
  }, Qe = ({
636
- size: s,
637
- shortcut: b,
638
- placeholder: f,
639
- shortcutClassName: p,
640
- placeholderIcon: i = null,
641
- readOnly: w = !1,
642
- isDisabled: S,
643
- isInvalid: d,
644
- ref: o,
633
+ size: c,
634
+ shortcut: y,
635
+ placeholder: d,
636
+ shortcutClassName: m,
637
+ placeholderIcon: l = null,
638
+ readOnly: b = !1,
639
+ isDisabled: T,
640
+ isInvalid: p,
641
+ ref: a,
645
642
  endAdornment: e,
646
- ...a
643
+ ...o
647
644
  }) => {
648
- const y = G(null), r = H(Y), M = H(B), N = M && typeof M == "object" && "ref" in M ? M.ref : void 0, $ = C(
649
- () => He(o ?? void 0, N ?? void 0),
650
- [o, N]
651
- ), W = K(
645
+ const g = G(null), r = H(Z), S = H(ee), R = S && typeof S == "object" && "ref" in S ? S.ref : void 0, $ = B(
646
+ () => Ge(a ?? void 0, R ?? void 0),
647
+ [a, R]
648
+ ), j = L(
652
649
  (u) => {
653
- var A, g;
654
- if (S)
650
+ var F, f;
651
+ if (T)
655
652
  return;
656
653
  const h = u.target;
657
654
  if (h instanceof Element && !h.closest("button")) {
658
- if (w) {
655
+ if (b) {
659
656
  if (h.closest("input") || h.closest("[data-multiselect-chip]"))
660
657
  return;
661
- u.preventDefault(), r != null && r.isOpen ? (r.close(), (A = y.current) == null || A.blur()) : r == null || r.open();
658
+ u.preventDefault(), r != null && r.isOpen ? (r.close(), (F = g.current) == null || F.blur()) : r == null || r.open();
662
659
  return;
663
660
  }
664
- h.closest("input") || (u.preventDefault(), (g = y.current) == null || g.focus({ preventScroll: !0 }));
661
+ h.closest("input") || (u.preventDefault(), (f = g.current) == null || f.focus({ preventScroll: !0 }));
665
662
  }
666
663
  },
667
- [S, w, r]
664
+ [T, b, r]
668
665
  );
669
- return /* @__PURE__ */ l(
670
- Fe,
666
+ return /* @__PURE__ */ s(
667
+ Re,
671
668
  {
672
- ...a,
669
+ ...o,
673
670
  ref: $,
674
671
  onMouseDown: (u) => {
675
672
  var h;
676
- u.stopPropagation(), (h = a.onMouseDown) == null || h.call(a, u);
673
+ u.stopPropagation(), (h = o.onMouseDown) == null || h.call(o, u);
677
674
  },
678
675
  onPointerDown: (u) => {
679
676
  var h;
680
- u.stopPropagation(), (h = a.onPointerDown) == null || h.call(a, u);
677
+ u.stopPropagation(), (h = o.onPointerDown) == null || h.call(o, u);
681
678
  },
682
679
  onMouseDownCapture: (u) => {
683
680
  var h;
684
- (h = a.onMouseDownCapture) == null || h.call(a, u), W(u);
681
+ (h = o.onMouseDownCapture) == null || h.call(o, u), j(u);
685
682
  },
686
683
  className: ({ isFocusWithin: u, isDisabled: h }) => {
687
- const A = u || !!(r != null && r.isOpen);
684
+ const F = u || !!(r != null && r.isOpen);
688
685
  return k(
689
686
  "relative flex w-full gap-2 rounded-md bg-primary ring-1 outline-hidden duration-100 ease-linear ring-inset",
690
- d ? "ring-error" : u ? "ring-brand" : "ring-[var(--color-border-secondary)]",
687
+ p ? "ring-error" : u ? "ring-brand" : "ring-[var(--color-border-secondary)]",
691
688
  h && "cursor-not-allowed bg-disabled_subtle",
692
- A ? "items-start" : "items-center",
693
- A ? Ve[s] : ze[s].root
689
+ F ? "items-start" : "items-center",
690
+ F ? Ve[c] : Le[c].root
694
691
  );
695
692
  },
696
- children: ({ isDisabled: u, isFocusWithin: h }) => /* @__PURE__ */ P(ge, { children: [
697
- i && /* @__PURE__ */ l(i, { className: "pointer-events-none size-5 shrink-0 text-fg-quaternary" }),
698
- /* @__PURE__ */ l(ve, { contain: !1, autoFocus: !1, restoreFocus: !1, children: /* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ l(
693
+ children: ({ isDisabled: u, isFocusWithin: h }) => /* @__PURE__ */ M(me, { children: [
694
+ l && /* @__PURE__ */ s(l, { className: "pointer-events-none size-5 shrink-0 text-fg-quaternary" }),
695
+ /* @__PURE__ */ s(ve, { contain: !1, autoFocus: !1, restoreFocus: !1, children: /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ s(
699
696
  Je,
700
697
  {
701
- inputRef: y,
698
+ inputRef: g,
702
699
  isDisabled: u,
703
700
  isFocusWithin: h,
704
- shortcut: b,
705
- shortcutClassName: p,
706
- placeholder: f,
707
- readOnly: w
701
+ shortcut: y,
702
+ shortcutClassName: m,
703
+ placeholder: d,
704
+ readOnly: b
708
705
  }
709
706
  ) }) }),
710
- e ? /* @__PURE__ */ l(B.Provider, { value: null, children: /* @__PURE__ */ l("div", { className: "flex shrink-0 items-center self-center", children: e }) }) : null,
711
- /* @__PURE__ */ l(
707
+ e ? /* @__PURE__ */ s(ee.Provider, { value: null, children: /* @__PURE__ */ s("div", { className: "flex shrink-0 items-center self-center", children: e }) }) : null,
708
+ /* @__PURE__ */ s(
712
709
  "button",
713
710
  {
714
711
  type: "button",
@@ -716,15 +713,15 @@ const Ue = ({
716
713
  disabled: u,
717
714
  "aria-label": r != null && r.isOpen ? "Close options" : "Open options",
718
715
  className: "shrink-0 self-center rounded p-0.5 text-fg-quaternary hover:text-fg-secondary disabled:cursor-not-allowed disabled:opacity-50",
719
- onMouseDown: (A) => {
720
- var g, z;
721
- A.preventDefault(), A.stopPropagation(), r != null && r.isOpen ? (r.close(), (g = y.current) == null || g.blur()) : (r == null || r.open(), (z = y.current) == null || z.focus({ preventScroll: !0 }));
716
+ onMouseDown: (F) => {
717
+ var f, _;
718
+ F.preventDefault(), F.stopPropagation(), r != null && r.isOpen ? (r.close(), (f = g.current) == null || f.blur()) : (r == null || r.open(), (_ = g.current) == null || _.focus({ preventScroll: !0 }));
722
719
  },
723
- children: /* @__PURE__ */ l(
720
+ children: /* @__PURE__ */ s(
724
721
  Ne,
725
722
  {
726
723
  "aria-hidden": "true",
727
- className: s === "lg" ? "size-5" : "size-4"
724
+ className: c === "lg" ? "size-5" : "size-4"
728
725
  }
729
726
  )
730
727
  }
@@ -733,7 +730,7 @@ const Ue = ({
733
730
  }
734
731
  );
735
732
  }, Ye = Xe;
736
- Ye.Item = qe;
733
+ Ye.Item = Oe;
737
734
  export {
738
735
  Ye as MultiSelect,
739
736
  Xe as MultiSelectBase,