@alfadocs/ui-kit 0.17.1 → 0.17.3

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 (100) hide show
  1. package/dist/_chunks/{accordion-DOmxGEWU.js → accordion-CNcodXuO.js} +6 -6
  2. package/dist/_chunks/{ai-prompt-input-DEiQwIMn.js → ai-prompt-input-B-w5Rx3V.js} +184 -181
  3. package/dist/_chunks/{alert-pgdXrEO5.js → alert-DBnawbmf.js} +64 -59
  4. package/dist/_chunks/{audio-recorder-CRh4uyFL.js → audio-recorder-DNkQLW1G.js} +3 -3
  5. package/dist/_chunks/{autocomplete-mOg7WLOh.js → autocomplete-BxfabhZ8.js} +167 -164
  6. package/dist/_chunks/{balance-cell-renderer-DWWtX-VM.js → balance-cell-renderer-DJB6WDPe.js} +2 -2
  7. package/dist/_chunks/{chat-input-UK-bXU7u.js → chat-input-B3XmFGDw.js} +123 -122
  8. package/dist/_chunks/checkbox-group-Bwmt1ovQ.js +213 -0
  9. package/dist/_chunks/{checkbox-D5EHnB14.js → checkbox-mwbrPZDY.js} +75 -70
  10. package/dist/_chunks/{collapsible-CuxUBoHJ.js → collapsible-hHiyZp0b.js} +61 -63
  11. package/dist/_chunks/{color-picker-BPfcByHH.js → color-picker-Bm-gzpsh.js} +2 -2
  12. package/dist/_chunks/{combobox-D5tWe0t_.js → combobox-Da9eq00i.js} +214 -211
  13. package/dist/_chunks/{copy-field-BCHAZ8QV.js → copy-field-BAF4mt9h.js} +95 -132
  14. package/dist/_chunks/{date-picker-BlhtBhPo.js → date-picker-BIoSLRly.js} +222 -219
  15. package/dist/_chunks/{date-range-picker-C2hRu_Ke.js → date-range-picker-9gANFNG9.js} +81 -78
  16. package/dist/_chunks/{date-time-picker-B67mPZmP.js → date-time-picker-DG7BiGdb.js} +98 -95
  17. package/dist/_chunks/{dialog-DRp6Dejy.js → dialog-DUomPCRS.js} +69 -71
  18. package/dist/_chunks/{dropdown-menu-dyV7gHh_.js → dropdown-menu-DZxwF23X.js} +108 -110
  19. package/dist/_chunks/{freemium-paywall-BTEiVkes.js → freemium-paywall-DXc7XlGE.js} +98 -97
  20. package/dist/_chunks/{leo-sidebar-D3TuyH5_.js → leo-sidebar-DIsiTju3.js} +2 -2
  21. package/dist/_chunks/{list-DcjV0m5B.js → list-BdvDctBz.js} +184 -180
  22. package/dist/_chunks/{message-tray-Fsend-du.js → message-tray-BNAS8al4.js} +111 -111
  23. package/dist/_chunks/{multi-select-DooDzQIp.js → multi-select-CyspR5ZF.js} +157 -154
  24. package/dist/_chunks/{navigation-menu-DdufF-_4.js → navigation-menu-CyS1fBJ7.js} +85 -87
  25. package/dist/_chunks/{notification-tray-C3dYdLAF.js → notification-tray-D_69dXFY.js} +114 -114
  26. package/dist/_chunks/{number-input-DH00o0DN.js → number-input-BZXu6bPY.js} +92 -89
  27. package/dist/_chunks/{otp-input-BBXYvLx5.js → otp-input-BDF_iNpa.js} +92 -93
  28. package/dist/_chunks/{pagination-F1ei4khE.js → pagination-BWaXF7W0.js} +194 -211
  29. package/dist/_chunks/{patient-shell-BE0CdPOJ.js → patient-shell-BOOaWZA9.js} +3 -3
  30. package/dist/_chunks/{payment-form-CI77oIx1.js → payment-form-BjkuQeqR.js} +2 -2
  31. package/dist/_chunks/{pdf-viewer-CnEJvmXC.js → pdf-viewer-BG_nsFT5.js} +2 -2
  32. package/dist/_chunks/{radio-group-Cz1a4QCA.js → radio-group-BHZOxrIK.js} +4 -4
  33. package/dist/_chunks/{select-Ca6ibiDL.js → select-C92AT_OZ.js} +7 -7
  34. package/dist/_chunks/{sidebar-D8Lq065m.js → sidebar-BqzlRBvC.js} +271 -291
  35. package/dist/_chunks/{slider-CkR6CLun.js → slider-CfEzeseL.js} +4 -4
  36. package/dist/_chunks/{tabs-CRCyPpJo.js → tabs-aEQfQV3x.js} +8 -8
  37. package/dist/_chunks/{theme-toggle-B3meAb3y.js → theme-toggle-BswYl0Yp.js} +2 -2
  38. package/dist/_chunks/use-controllable-state-BiY4xTzM.js +23 -0
  39. package/dist/_chunks/use-copy-to-clipboard-Cyfc_dlv.js +43 -0
  40. package/dist/_chunks/use-persistent-state-i23OWy6G.js +24 -0
  41. package/dist/_chunks/{warning-stack-CeRihME9.js → warning-stack-CDH9TudY.js} +2 -2
  42. package/dist/_chunks/{workflow-map-D3MvrsZV.js → workflow-map-BeKe23uw.js} +3 -3
  43. package/dist/agent-catalog.json +1 -1
  44. package/dist/components/_shared/use-debounced-callback.d.ts +1 -5
  45. package/dist/components/_shared/use-direction.d.ts +1 -18
  46. package/dist/components/_shared/use-focus-trap.d.ts +1 -31
  47. package/dist/components/accordion/index.js +1 -1
  48. package/dist/components/ai-prompt-input/index.js +1 -1
  49. package/dist/components/alert/index.js +1 -1
  50. package/dist/components/audio-recorder/index.js +1 -1
  51. package/dist/components/autocomplete/index.js +1 -1
  52. package/dist/components/chat-input/index.js +1 -1
  53. package/dist/components/checkbox/index.js +1 -1
  54. package/dist/components/checkbox-group/index.js +1 -1
  55. package/dist/components/collapsible/index.js +1 -1
  56. package/dist/components/color-picker/index.js +1 -1
  57. package/dist/components/combobox/index.js +1 -1
  58. package/dist/components/command-palette/command-palette.d.ts +1 -1
  59. package/dist/components/copy-field/index.js +1 -1
  60. package/dist/components/data-table/index.js +1 -1
  61. package/dist/components/date-picker/index.js +1 -1
  62. package/dist/components/date-range-picker/index.js +1 -1
  63. package/dist/components/date-time-picker/index.js +1 -1
  64. package/dist/components/dialog/index.js +1 -1
  65. package/dist/components/dropdown-menu/index.js +1 -1
  66. package/dist/components/freemium-paywall/index.js +1 -1
  67. package/dist/components/icon-button-group/icon-button-group.d.ts +14 -14
  68. package/dist/components/list/index.js +1 -1
  69. package/dist/components/message-tray/index.js +1 -1
  70. package/dist/components/multi-select/index.js +1 -1
  71. package/dist/components/navigation-menu/index.js +1 -1
  72. package/dist/components/notification-tray/index.js +1 -1
  73. package/dist/components/number-input/index.js +1 -1
  74. package/dist/components/otp-input/index.js +1 -1
  75. package/dist/components/pagination/index.js +1 -1
  76. package/dist/components/payment-form/index.js +1 -1
  77. package/dist/components/pdf-viewer/index.js +1 -1
  78. package/dist/components/radio-group/index.js +1 -1
  79. package/dist/components/select/index.js +1 -1
  80. package/dist/components/sidebar/index.js +8 -7
  81. package/dist/components/sidebar/sidebar.d.ts +1 -1
  82. package/dist/components/slider/index.js +1 -1
  83. package/dist/components/tabs/index.js +1 -1
  84. package/dist/components/theme-toggle/index.js +1 -1
  85. package/dist/components/warning-stack/index.js +1 -1
  86. package/dist/components/workflow/index.js +1 -1
  87. package/dist/hooks/index.d.ts +8 -0
  88. package/dist/hooks/index.js +98 -15
  89. package/dist/hooks/use-debounced-callback.d.ts +19 -0
  90. package/dist/hooks/use-debounced-value.d.ts +16 -0
  91. package/dist/hooks/use-direction.d.ts +19 -0
  92. package/dist/hooks/use-focus-trap.d.ts +32 -0
  93. package/dist/hooks/use-isomorphic-layout-effect.d.ts +13 -0
  94. package/dist/hooks/use-persistent-state.d.ts +16 -0
  95. package/dist/index.js +493 -492
  96. package/dist/patterns/leo-assistant/index.js +1 -1
  97. package/dist/patterns/patient-shell/index.js +1 -1
  98. package/dist/tokens.css +1 -1
  99. package/package.json +4 -2
  100. package/dist/_chunks/checkbox-group-Qkm3Rg1S.js +0 -208
@@ -1,14 +1,15 @@
1
1
  import { jsx as n, jsxs as x } from "react/jsx-runtime";
2
- import { forwardRef as Me, useContext as Pe, useState as L, useRef as k, useMemo as O, useEffect as Q, useCallback as je, useLayoutEffect as $e } from "react";
3
- import * as z from "@radix-ui/react-popover";
2
+ import { forwardRef as qe, useContext as Me, useState as K, useRef as I, useMemo as F, useEffect as U, useCallback as Pe, useLayoutEffect as je } from "react";
3
+ import * as D from "@radix-ui/react-popover";
4
4
  import { _ as u } from "./index-4xgbg-sn.js";
5
- import { c as ue } from "./index-D2ZczOXr.js";
6
- import { useTranslation as Be } from "react-i18next";
7
- import { u as Ke, F as Ue } from "./form-field-context-B3APVHKx.js";
8
- import { T as de } from "./tooltip-DHik5yRI.js";
9
- import { c as Qe } from "./compose-refs-C0k0tdqF.js";
5
+ import { c as de } from "./index-D2ZczOXr.js";
6
+ import { useTranslation as $e } from "react-i18next";
7
+ import { u as Be, F as Ke } from "./form-field-context-B3APVHKx.js";
8
+ import { T as oe } from "./tooltip-DHik5yRI.js";
9
+ import { c as Ue } from "./compose-refs-C0k0tdqF.js";
10
+ import { u as Qe } from "./use-controllable-state-BiY4xTzM.js";
10
11
  import { g as Ye } from "./group-options-BvKhQ3xb.js";
11
- import { b as Y, c as Ge } from "./input-surface-xyERuLU_.js";
12
+ import { b as Q, c as Ge } from "./input-surface-xyERuLU_.js";
12
13
  import { u as He } from "./registry-C9nwlNyL.js";
13
14
  import { X as Xe } from "./x-CCcI3eJp.js";
14
15
  import { C as Je } from "./check-DPdL_Sm7.js";
@@ -83,7 +84,7 @@ const We = {
83
84
  description: "Each option emits its value as data-option-id."
84
85
  }
85
86
  }
86
- }, Ze = ue(
87
+ }, Ze = de(
87
88
  [
88
89
  "ds:inline-flex ds:flex-wrap ds:items-center ds:gap-1 ds:w-full",
89
90
  Ge,
@@ -93,14 +94,14 @@ const We = {
93
94
  {
94
95
  variants: {
95
96
  size: {
96
- sm: `ds:min-h-8 ds:ps-2 ds:pe-2 ds:py-1 ${Y.sm}`,
97
- md: `ds:min-h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:py-1.5 ${Y.md}`,
98
- lg: `ds:min-h-12 ds:ps-4 ds:pe-4 ds:py-2 ${Y.lg}`
97
+ sm: `ds:min-h-8 ds:ps-2 ds:pe-2 ds:py-1 ${Q.sm}`,
98
+ md: `ds:min-h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:py-1.5 ${Q.md}`,
99
+ lg: `ds:min-h-12 ds:ps-4 ds:pe-4 ds:py-2 ${Q.lg}`
99
100
  }
100
101
  },
101
102
  defaultVariants: { size: "md" }
102
103
  }
103
- ), le = ue(
104
+ ), ie = de(
104
105
  [
105
106
  "ds:inline-flex ds:items-center ds:gap-1",
106
107
  "ds:rounded-[var(--radius-sm)] ds:border ds:border-border ds:bg-muted",
@@ -147,98 +148,100 @@ const We = {
147
148
  "ds:data-[selected=true]:bg-muted ds:data-[selected=true]:text-foreground",
148
149
  "ds:aria-[disabled=true]:pointer-events-none ds:aria-[disabled=true]:opacity-50",
149
150
  "ds:data-[disabled=true]:pointer-events-none ds:data-[disabled=true]:opacity-50"
150
- ].join(" "), ce = [
151
+ ].join(" "), ae = [
151
152
  "ds:relative ds:flex ds:cursor-pointer ds:items-center",
152
153
  "ds:rounded-[var(--radius-sm)] ds:ps-2 ds:pe-2 ds:py-1.5",
153
154
  "ds:text-[var(--font-size-sm)] ds:font-medium ds:text-primary ds:outline-none ds:select-none",
154
155
  "ds:data-[selected=true]:bg-muted"
155
- ].join(" "), rt = "__ui-multiselect-select-all__", nt = "__ui-multiselect-clear-all__", fe = Me(
156
+ ].join(" "), rt = "__ui-multiselect-select-all__", nt = "__ui-multiselect-clear-all__", le = qe(
156
157
  function({
157
158
  options: c,
158
- value: G,
159
- defaultValue: me,
160
- onChange: v,
161
- onComplete: q,
162
- placeholder: pe,
163
- maxSelections: b,
164
- allowSelectAll: H = !1,
165
- allowClear: X = !1,
166
- filter: M,
167
- size: T = "md",
168
- disabled: he,
169
- className: ve,
170
- id: P,
159
+ value: ce,
160
+ defaultValue: ue,
161
+ onChange: fe,
162
+ onComplete: L,
163
+ placeholder: me,
164
+ maxSelections: v,
165
+ allowSelectAll: Y = !1,
166
+ allowClear: G = !1,
167
+ filter: O,
168
+ size: R = "md",
169
+ disabled: pe,
170
+ className: he,
171
+ id: z,
171
172
  ...ge
172
- }, be) {
173
- const { t: f } = Be(), y = Ke(), S = Pe(Ue) !== null, [ye, J] = L(
174
- me ?? []
175
- ), E = G !== void 0, r = E ? G : ye, [A, m] = L(!1), [p, j] = L(""), w = k(null), I = k([]), W = k(null), we = Qe(be, W), g = S && y.disabled || !!he, Ie = S && y.required, Z = S && y.invalid, xe = S && y.describedBy ? y.describedBy : void 0, ke = P ?? (S ? y.id : void 0), Se = O(() => {
173
+ }, ve) {
174
+ const { t: f } = $e(), b = Be(), k = Me(Ke) !== null, [be, q] = Qe({
175
+ value: ce,
176
+ defaultValue: ue ?? [],
177
+ onChange: fe
178
+ }), r = be ?? [], [C, m] = K(!1), [p, M] = K(""), y = I(null), w = I([]), H = I(null), ye = Ue(ve, H), g = k && b.disabled || !!pe, we = k && b.required, X = k && b.invalid, xe = k && b.describedBy ? b.describedBy : void 0, Ie = z ?? (k ? b.id : void 0), ke = F(() => {
176
179
  const e = /* @__PURE__ */ new Map();
177
180
  for (const t of c) e.set(t.value, t.label);
178
181
  return e;
179
- }, [c]), ee = typeof b == "number" && r.length >= b, N = (e) => {
180
- E || J(e), v == null || v(e);
181
- }, Ae = (e) => {
182
+ }, [c]), J = typeof v == "number" && r.length >= v, S = (e) => {
183
+ q(e);
184
+ }, Ce = (e) => {
182
185
  if (r.includes(e)) {
183
- N(r.filter((t) => t !== e));
186
+ S(r.filter((t) => t !== e));
184
187
  return;
185
188
  }
186
- ee || N([...r, e]);
187
- }, $ = (e) => {
189
+ J || S([...r, e]);
190
+ }, P = (e) => {
188
191
  const t = r.filter((s, o) => o !== e);
189
- return N(t), t;
190
- }, Ne = () => {
191
- const e = c.filter((s) => !s.disabled).map((s) => s.value), t = typeof b == "number" ? b : e.length;
192
- N(e.slice(0, t));
193
- }, _e = () => {
194
- N([]);
195
- }, te = k(r);
196
- Q(() => {
197
- te.current = r;
192
+ return S(t), t;
193
+ }, Se = () => {
194
+ const e = c.filter((s) => !s.disabled).map((s) => s.value), t = typeof v == "number" ? v : e.length;
195
+ S(e.slice(0, t));
196
+ }, Ae = () => {
197
+ S([]);
198
+ }, W = I(r);
199
+ U(() => {
200
+ W.current = r;
198
201
  }, [r]);
199
- const se = k(p);
200
- Q(() => {
201
- se.current = p;
202
+ const Z = I(p);
203
+ U(() => {
204
+ Z.current = p;
202
205
  }, [p]);
203
- const re = k(A);
204
- Q(() => {
205
- re.current = A;
206
- }, [A]);
207
- const B = je(
206
+ const ee = I(C);
207
+ U(() => {
208
+ ee.current = C;
209
+ }, [C]);
210
+ const j = Pe(
208
211
  (e) => {
209
- E || J(e), v == null || v(e);
212
+ q(e);
210
213
  },
211
- [E, v]
212
- ), Re = O(
214
+ [q]
215
+ ), Ne = F(
213
216
  () => ({
214
- getSelection: () => [...te.current],
215
- getQuery: () => se.current,
216
- getIsOpen: () => re.current,
217
- setSelection: (e) => B(e),
218
- clearSelection: () => B([]),
219
- setQuery: (e) => j(e),
217
+ getSelection: () => [...W.current],
218
+ getQuery: () => Z.current,
219
+ getIsOpen: () => ee.current,
220
+ setSelection: (e) => j(e),
221
+ clearSelection: () => j([]),
222
+ setQuery: (e) => M(e),
220
223
  open: () => m(!0),
221
224
  close: () => m(!1)
222
225
  }),
223
- [B]
226
+ [j]
224
227
  );
225
- He(We, Re, P);
226
- const ne = pe ?? f("inputs.multiSelect.placeholder", "Select…"), oe = O(() => {
228
+ He(We, Ne, z);
229
+ const te = me ?? f("inputs.multiSelect.placeholder", "Select…"), se = F(() => {
227
230
  if (!p) return c;
228
231
  const e = p.toLowerCase();
229
- return c.filter((t) => M ? M(p, t) : t.label.toLowerCase().includes(e));
230
- }, [c, p, M]), Ce = O(
231
- () => Ye(oe),
232
- [oe]
233
- ), Te = (e) => {
232
+ return c.filter((t) => O ? O(p, t) : t.label.toLowerCase().includes(e));
233
+ }, [c, p, O]), _e = F(
234
+ () => Ye(se),
235
+ [se]
236
+ ), Re = (e) => {
234
237
  var o;
235
238
  const t = e.currentTarget;
236
239
  if (e.key === "Backspace" && p === "" && r.length > 0) {
237
240
  e.preventDefault();
238
- const a = r.length - 1, l = $(a).length - 1;
241
+ const a = r.length - 1, l = P(a).length - 1;
239
242
  l >= 0 && requestAnimationFrame(() => {
240
243
  var h;
241
- (h = I.current[l]) == null || h.focus();
244
+ (h = w.current[l]) == null || h.focus();
242
245
  });
243
246
  return;
244
247
  }
@@ -248,7 +251,7 @@ const We = {
248
251
  if (a && e.key === "ArrowRight" || !a && e.key === "ArrowLeft") {
249
252
  e.preventDefault();
250
253
  const l = r.length - 1;
251
- (o = I.current[l]) == null || o.focus();
254
+ (o = w.current[l]) == null || o.focus();
252
255
  }
253
256
  return;
254
257
  }
@@ -256,50 +259,50 @@ const We = {
256
259
  m(!1);
257
260
  return;
258
261
  }
259
- !A && (e.key === "ArrowDown" || e.key === "Enter") && m(!0);
260
- }, Ee = (e) => (t) => {
261
- var d, l, h, R;
262
+ !C && (e.key === "ArrowDown" || e.key === "Enter") && m(!0);
263
+ }, Te = (e) => (t) => {
264
+ var d, l, h, N;
262
265
  if (t.key === "Backspace" || t.key === "Delete" || t.key === "Enter" || t.key === " ") {
263
266
  t.preventDefault(), t.stopPropagation();
264
- const D = $(e);
265
- if (D.length === 0) {
267
+ const V = P(e);
268
+ if (V.length === 0) {
266
269
  requestAnimationFrame(() => {
267
- var C;
268
- return (C = w.current) == null ? void 0 : C.focus();
270
+ var _;
271
+ return (_ = y.current) == null ? void 0 : _.focus();
269
272
  });
270
273
  return;
271
274
  }
272
- const qe = Math.min(e, D.length - 1);
275
+ const ze = Math.min(e, V.length - 1);
273
276
  requestAnimationFrame(() => {
274
- var C;
275
- (C = I.current[qe]) == null || C.focus();
277
+ var _;
278
+ (_ = w.current[ze]) == null || _.focus();
276
279
  });
277
280
  return;
278
281
  }
279
282
  const s = document.dir === "rtl", o = s ? "ArrowRight" : "ArrowLeft", a = s ? "ArrowLeft" : "ArrowRight";
280
283
  if (t.key === o) {
281
284
  t.preventDefault();
282
- const D = Math.max(0, e - 1);
283
- (d = I.current[D]) == null || d.focus();
285
+ const V = Math.max(0, e - 1);
286
+ (d = w.current[V]) == null || d.focus();
284
287
  return;
285
288
  }
286
289
  if (t.key === a) {
287
- t.preventDefault(), e < r.length - 1 ? (l = I.current[e + 1]) == null || l.focus() : (h = w.current) == null || h.focus();
290
+ t.preventDefault(), e < r.length - 1 ? (l = w.current[e + 1]) == null || l.focus() : (h = y.current) == null || h.focus();
288
291
  return;
289
292
  }
290
- t.key === "Escape" && (m(!1), (R = w.current) == null || R.focus());
291
- }, [V, K] = L(
293
+ t.key === "Escape" && (m(!1), (N = y.current) == null || N.focus());
294
+ }, [T, $] = K(
292
295
  Number.POSITIVE_INFINITY
293
296
  );
294
- $e(() => {
295
- const e = W.current;
297
+ je(() => {
298
+ const e = H.current;
296
299
  if (!e) return;
297
300
  const t = () => {
298
301
  const o = Array.from(
299
302
  e.querySelectorAll('[data-ui-chip="true"]')
300
303
  );
301
304
  if (o.length === 0) {
302
- K(Number.POSITIVE_INFINITY);
305
+ $(Number.POSITIVE_INFINITY);
303
306
  return;
304
307
  }
305
308
  const a = o[0].offsetTop;
@@ -307,57 +310,57 @@ const We = {
307
310
  for (const l of o)
308
311
  if (l.offsetTop === a) d++;
309
312
  else break;
310
- d === o.length ? K(Number.POSITIVE_INFINITY) : K(Math.max(1, d - 1));
313
+ d === o.length ? $(Number.POSITIVE_INFINITY) : $(Math.max(1, d - 1));
311
314
  };
312
315
  t();
313
316
  const s = new ResizeObserver(t);
314
317
  return s.observe(e), () => s.disconnect();
315
- }, [r.length, T]);
316
- const F = r.map((e) => ({
318
+ }, [r.length, R]);
319
+ const E = r.map((e) => ({
317
320
  value: e,
318
- label: Se.get(e) ?? e
319
- })), ie = V === Number.POSITIVE_INFINITY || V >= F.length, Ve = ie ? F : F.slice(0, V), ae = ie ? [] : F.slice(V), _ = ae.length, Fe = (e) => {
321
+ label: ke.get(e) ?? e
322
+ })), re = T === Number.POSITIVE_INFINITY || T >= E.length, Ee = re ? E : E.slice(0, T), ne = re ? [] : E.slice(T), A = ne.length, Ve = (e) => {
320
323
  var s;
321
324
  if (g) return;
322
325
  const t = e.target;
323
- t.closest('[data-ui-chip="true"]') || t.closest('[data-ui-chip-dismiss="true"]') || (m(!0), (s = w.current) == null || s.focus());
324
- }, De = (e) => {
326
+ t.closest('[data-ui-chip="true"]') || t.closest('[data-ui-chip-dismiss="true"]') || (m(!0), (s = y.current) == null || s.focus());
327
+ }, Fe = (e) => {
325
328
  if (g) {
326
329
  m(!1);
327
330
  return;
328
331
  }
329
- m(e), e || (j(""), q == null || q(r));
330
- }, Le = H || X, Oe = f("inputs.multiSelect.selected", {
332
+ m(e), e || (M(""), L == null || L(r));
333
+ }, De = Y || G, Le = f("inputs.multiSelect.selected", {
331
334
  count: r.length,
332
335
  defaultValue: `${r.length} selected`
333
- }), { onClick: U, ...ze } = ge;
334
- return /* @__PURE__ */ n(u, { shouldFilter: !1, label: Oe, children: /* @__PURE__ */ x(z.Root, { open: A, onOpenChange: De, children: [
335
- /* @__PURE__ */ n(z.Anchor, { asChild: !0, children: /* @__PURE__ */ x(
336
+ }), { onClick: B, ...Oe } = ge;
337
+ return /* @__PURE__ */ n(u, { shouldFilter: !1, label: Le, children: /* @__PURE__ */ x(D.Root, { open: C, onOpenChange: Fe, children: [
338
+ /* @__PURE__ */ n(D.Anchor, { asChild: !0, children: /* @__PURE__ */ x(
336
339
  "div",
337
340
  {
338
- ref: we,
339
- className: Ze({ size: T, className: ve }),
341
+ ref: ye,
342
+ className: Ze({ size: R, className: he }),
340
343
  "aria-disabled": g || void 0,
341
- "aria-invalid": Z || void 0,
344
+ "aria-invalid": X || void 0,
342
345
  "data-component": "multi-select",
343
- "data-component-id": P,
346
+ "data-component-id": z,
344
347
  onClick: (e) => {
345
- U == null || U(e), Fe(e);
348
+ B == null || B(e), Ve(e);
346
349
  },
347
- ...ze,
350
+ ...Oe,
348
351
  children: [
349
- Ve.map((e, t) => (
352
+ Ee.map((e, t) => (
350
353
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- chip pill receives focus via roving tabindex; chip removal uses an inner button
351
354
  /* @__PURE__ */ x(
352
355
  "span",
353
356
  {
354
357
  ref: (s) => {
355
- I.current[t] = s;
358
+ w.current[t] = s;
356
359
  },
357
360
  tabIndex: g ? -1 : 0,
358
361
  "data-ui-chip": "true",
359
- className: le({ size: T }),
360
- onKeyDown: Ee(t),
362
+ className: ie({ size: R }),
363
+ onKeyDown: Te(t),
361
364
  "aria-label": e.label,
362
365
  children: [
363
366
  /* @__PURE__ */ n("span", { children: e.label }),
@@ -373,9 +376,9 @@ const We = {
373
376
  }),
374
377
  disabled: g,
375
378
  onClick: (s) => {
376
- s.stopPropagation(), $(t), requestAnimationFrame(() => {
379
+ s.stopPropagation(), P(t), requestAnimationFrame(() => {
377
380
  var o;
378
- return (o = w.current) == null ? void 0 : o.focus();
381
+ return (o = y.current) == null ? void 0 : o.focus();
379
382
  });
380
383
  },
381
384
  className: et,
@@ -387,24 +390,24 @@ const We = {
387
390
  e.value
388
391
  )
389
392
  )),
390
- _ > 0 ? /* @__PURE__ */ n(
391
- de,
393
+ A > 0 ? /* @__PURE__ */ n(
394
+ oe,
392
395
  {
393
- label: ae.map((e) => e.label).join(", "),
396
+ label: ne.map((e) => e.label).join(", "),
394
397
  delayDuration: 200,
395
398
  children: /* @__PURE__ */ n(
396
399
  "span",
397
400
  {
398
- className: le({ size: T }),
401
+ className: ie({ size: R }),
399
402
  tabIndex: 0,
400
403
  role: "button",
401
404
  "aria-label": f("inputs.multiSelect.overflow", {
402
- count: _,
403
- defaultValue: `+${_} more`
405
+ count: A,
406
+ defaultValue: `+${A} more`
404
407
  }),
405
408
  children: /* @__PURE__ */ n("span", { children: f("inputs.multiSelect.overflow", {
406
- count: _,
407
- defaultValue: `+${_} more`
409
+ count: A,
410
+ defaultValue: `+${A} more`
408
411
  }) })
409
412
  }
410
413
  )
@@ -413,18 +416,18 @@ const We = {
413
416
  /* @__PURE__ */ n(
414
417
  u.Input,
415
418
  {
416
- ref: w,
419
+ ref: y,
417
420
  value: p,
418
- onValueChange: j,
419
- onKeyDown: Te,
421
+ onValueChange: M,
422
+ onKeyDown: Re,
420
423
  onFocus: () => {
421
424
  g || m(!0);
422
425
  },
423
- placeholder: r.length === 0 ? ne : "",
424
- id: ke,
426
+ placeholder: r.length === 0 ? te : "",
427
+ id: Ie,
425
428
  "aria-describedby": xe,
426
- "aria-invalid": Z || void 0,
427
- "aria-required": Ie || void 0,
429
+ "aria-invalid": X || void 0,
430
+ "aria-required": we || void 0,
428
431
  disabled: g,
429
432
  className: [
430
433
  "ds:flex-1 ds:min-w-[6rem] ds:bg-transparent ds:outline-none",
@@ -436,8 +439,8 @@ const We = {
436
439
  ]
437
440
  }
438
441
  ) }),
439
- /* @__PURE__ */ n(z.Portal, { children: /* @__PURE__ */ n(
440
- z.Content,
442
+ /* @__PURE__ */ n(D.Portal, { children: /* @__PURE__ */ n(
443
+ D.Content,
441
444
  {
442
445
  onOpenAutoFocus: (e) => e.preventDefault(),
443
446
  onCloseAutoFocus: (e) => e.preventDefault(),
@@ -449,39 +452,39 @@ const We = {
449
452
  {
450
453
  role: "listbox",
451
454
  "aria-multiselectable": "true",
452
- "aria-label": ne,
455
+ "aria-label": te,
453
456
  className: "ds:max-h-[20rem] ds:overflow-y-auto ds:p-1",
454
457
  children: [
455
- Le ? /* @__PURE__ */ x(u.Group, { children: [
456
- H ? /* @__PURE__ */ n(
458
+ De ? /* @__PURE__ */ x(u.Group, { children: [
459
+ Y ? /* @__PURE__ */ n(
457
460
  u.Item,
458
461
  {
459
462
  value: rt,
460
- onSelect: Ne,
461
- className: ce,
463
+ onSelect: Se,
464
+ className: ae,
462
465
  children: f("inputs.multiSelect.selectAll", "Select all")
463
466
  }
464
467
  ) : null,
465
- X ? /* @__PURE__ */ n(
468
+ G ? /* @__PURE__ */ n(
466
469
  u.Item,
467
470
  {
468
471
  value: nt,
469
- onSelect: _e,
470
- className: ce,
472
+ onSelect: Ae,
473
+ className: ae,
471
474
  children: f("inputs.multiSelect.clearAll", "Clear all")
472
475
  }
473
476
  ) : null
474
477
  ] }) : null,
475
478
  /* @__PURE__ */ n(u.Empty, { className: "ds:ps-2 ds:pe-2 ds:py-2 type-body-sm ds:text-muted-foreground", children: f("inputs.multiSelect.noOptions", "No options found") }),
476
- Ce.map(({ group: e, items: t }, s) => {
479
+ _e.map(({ group: e, items: t }, s) => {
477
480
  const o = t.map((a) => {
478
- const d = r.includes(a.value), l = !d && ee, h = !!a.disabled || l, R = /* @__PURE__ */ x(
481
+ const d = r.includes(a.value), l = !d && J, h = !!a.disabled || l, N = /* @__PURE__ */ x(
479
482
  u.Item,
480
483
  {
481
484
  value: a.value,
482
485
  disabled: h,
483
486
  onSelect: () => {
484
- h || Ae(a.value);
487
+ h || Ce(a.value);
485
488
  },
486
489
  "aria-selected": d,
487
490
  "aria-disabled": h || void 0,
@@ -505,17 +508,17 @@ const We = {
505
508
  a.value
506
509
  );
507
510
  return l ? /* @__PURE__ */ n(
508
- de,
511
+ oe,
509
512
  {
510
513
  label: f("inputs.multiSelect.maxReached", {
511
- count: b,
512
- defaultValue: `Maximum ${b} selections`
514
+ count: v,
515
+ defaultValue: `Maximum ${v} selections`
513
516
  }),
514
517
  delayDuration: 200,
515
- children: R
518
+ children: N
516
519
  },
517
520
  a.value
518
- ) : R;
521
+ ) : N;
519
522
  });
520
523
  return e ? /* @__PURE__ */ n(
521
524
  u.Group,
@@ -535,11 +538,11 @@ const We = {
535
538
  ] }) });
536
539
  }
537
540
  );
538
- fe.displayName = "MultiSelect";
539
- const bt = fe;
541
+ le.displayName = "MultiSelect";
542
+ const yt = le;
540
543
  export {
541
- bt as M,
544
+ yt as M,
542
545
  Ze as a,
543
546
  We as m
544
547
  };
545
- //# sourceMappingURL=multi-select-DooDzQIp.js.map
548
+ //# sourceMappingURL=multi-select-CyspR5ZF.js.map