@alfadocs/ui-kit 0.97.2 → 0.98.1

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 (35) hide show
  1. package/dist/_chunks/{booking-BSpSMmJ2.js → booking-Bhbvef95.js} +2 -2
  2. package/dist/_chunks/{document-preview-DXl9migE.js → document-preview-DXsCEj4U.js} +2 -2
  3. package/dist/_chunks/{link-cell-renderer-flfZh2qY.js → link-cell-renderer-Bt-mXeQY.js} +2 -2
  4. package/dist/_chunks/{multi-select-D5QLBJM1.js → multi-select-CC52Qws6.js} +275 -263
  5. package/dist/_chunks/{muscle-scheme-CFBE2dme.js → muscle-scheme-kgCX5qfO.js} +2 -2
  6. package/dist/_chunks/{notes-panel-BLjlYBt-.js → notes-panel-BKwd-bOV.js} +2 -2
  7. package/dist/_chunks/{patient-summary-card-vn1H4xWj.js → patient-summary-card-C-iVDo53.js} +4 -2
  8. package/dist/_chunks/{patient-table-CvZTIM2R.js → patient-table-QEVsFvwq.js} +2 -2
  9. package/dist/_chunks/{public-header.agent-rX_VA6hd.js → public-header.agent-_8W9biCO.js} +4 -2
  10. package/dist/_chunks/{rich-text-editor-RRkBN_WB.js → rich-text-editor-DHpV2q6d.js} +4 -4
  11. package/dist/_chunks/{sign-document-DI561d1C.js → sign-document-cH9CboWB.js} +2 -2
  12. package/dist/_chunks/{signature-capture-DN52VNKL.js → signature-capture-D6ut9_IR.js} +2 -2
  13. package/dist/_chunks/{tabs-CVTukWRD.js → tabs-CBb2AidH.js} +17 -17
  14. package/dist/_chunks/{warning-stack-CAHQ0xxS.js → warning-stack-DKeAfj5M.js} +3 -3
  15. package/dist/agent-catalog.json +291 -1
  16. package/dist/agent-i18n/en.json +23 -0
  17. package/dist/components/booking/index.js +1 -1
  18. package/dist/components/data-table/index.js +1 -1
  19. package/dist/components/document-preview/index.js +1 -1
  20. package/dist/components/multi-select/index.js +1 -1
  21. package/dist/components/muscle-scheme/index.js +1 -1
  22. package/dist/components/notes-panel/index.js +1 -1
  23. package/dist/components/patient-summary-card/index.js +1 -1
  24. package/dist/components/patient-table/index.js +1 -1
  25. package/dist/components/public-header/index.js +1 -1
  26. package/dist/components/rich-text-editor/index.js +1 -1
  27. package/dist/components/sign-document/index.js +1 -1
  28. package/dist/components/signature-capture/index.js +1 -1
  29. package/dist/components/skeleton-scheme/index.js +1 -1
  30. package/dist/components/tabs/index.js +1 -1
  31. package/dist/components/warning-stack/index.js +1 -1
  32. package/dist/host-compat.css +578 -0
  33. package/dist/index.js +14 -14
  34. package/dist/tokens.css +1 -1
  35. package/package.json +10 -3
@@ -1,20 +1,20 @@
1
- import { jsx as r, jsxs as w } from "react/jsx-runtime";
2
- import { forwardRef as Ke, useContext as Me, useState as B, useRef as I, useMemo as V, useEffect as U, useCallback as je } from "react";
3
- import * as q from "@radix-ui/react-popover";
4
- import { _ as u } from "./index-4xgbg-sn.js";
5
- import { c as le } from "./index-D2ZczOXr.js";
6
- import { useTranslation as Pe } from "react-i18next";
7
- import { u as $e, F as Be } from "./form-field-context-B3APVHKx.js";
8
- import { T as ie } from "./tooltip-DvmfrNvB.js";
9
- import { c as Ue } from "./compose-refs-C0k0tdqF.js";
10
- import { u as Qe } from "./use-controllable-state-BiY4xTzM.js";
11
- import { u as Ye } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
12
- import { g as Ge } from "./group-options-BvKhQ3xb.js";
13
- import { b as Q, c as He } from "./input-surface-xyERuLU_.js";
14
- import { u as Xe } from "./registry-DvAUVLHh.js";
15
- import { X as Je } from "./x-B5YnXwCz.js";
16
- import { C as We } from "./check-DrFSN__t.js";
17
- const Ze = {
1
+ import { jsx as n, jsxs as w } from "react/jsx-runtime";
2
+ import { forwardRef as Ue, useContext as Qe, useState as q, useRef as v, useMemo as O, useEffect as Y, useCallback as le } from "react";
3
+ import * as D from "@radix-ui/react-popover";
4
+ import { _ as c } from "./index-4xgbg-sn.js";
5
+ import { c as pe } from "./index-D2ZczOXr.js";
6
+ import { useTranslation as Ye } from "react-i18next";
7
+ import { u as Ge, F as He } from "./form-field-context-B3APVHKx.js";
8
+ import { T as de } from "./tooltip-DvmfrNvB.js";
9
+ import { c as We } from "./compose-refs-C0k0tdqF.js";
10
+ import { u as Xe } from "./use-controllable-state-BiY4xTzM.js";
11
+ import { u as G } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
12
+ import { g as Je } from "./group-options-BvKhQ3xb.js";
13
+ import { b as H, c as Ze } from "./input-surface-xyERuLU_.js";
14
+ import { u as et } from "./registry-DvAUVLHh.js";
15
+ import { X as tt } from "./x-B5YnXwCz.js";
16
+ import { C as st } from "./check-DrFSN__t.js";
17
+ const rt = {
18
18
  id: "multi-select",
19
19
  // Persisted multi-choice (selection state + set_selection) → select_multiple,
20
20
  // plus type-to-filter and open/close of the option list.
@@ -64,8 +64,8 @@ const Ze = {
64
64
  note: 'Select exactly options "a" and "b".'
65
65
  }
66
66
  ],
67
- invoke: (a, c) => {
68
- a.setSelection(c.values);
67
+ invoke: (a, l) => {
68
+ a.setSelection(l.values);
69
69
  }
70
70
  },
71
71
  clear_selection: {
@@ -92,8 +92,8 @@ const Ze = {
92
92
  idempotent: !0,
93
93
  descriptionKey: "ui.agent.multiSelect.actions.applyFilter",
94
94
  description: "Set the filter query for the option list.",
95
- invoke: (a, c) => {
96
- a.setQuery(c.query);
95
+ invoke: (a, l) => {
96
+ a.setQuery(l.query);
97
97
  }
98
98
  },
99
99
  open: {
@@ -127,24 +127,24 @@ const Ze = {
127
127
  description: "Each option emits its value as data-option-id."
128
128
  }
129
129
  }
130
- }, et = le(
130
+ }, nt = pe(
131
131
  [
132
132
  "ds:inline-flex ds:flex-wrap ds:items-center ds:gap-1 ds:w-full",
133
- He,
133
+ Ze,
134
134
  "ds:aria-[invalid=true]:border-destructive",
135
135
  "ds:aria-disabled:cursor-not-allowed ds:aria-disabled:opacity-50"
136
136
  ],
137
137
  {
138
138
  variants: {
139
139
  size: {
140
- sm: `ds:min-h-8 ds:ps-2 ds:pe-2 ds:py-1 ${Q.sm}`,
141
- md: `ds:min-h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:py-1.5 ${Q.md}`,
142
- lg: `ds:min-h-12 ds:ps-4 ds:pe-4 ds:py-2 ${Q.lg}`
140
+ sm: `ds:min-h-8 ds:ps-2 ds:pe-2 ds:py-1 ${H.sm}`,
141
+ md: `ds:min-h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:py-1.5 ${H.md}`,
142
+ lg: `ds:min-h-12 ds:ps-4 ds:pe-4 ds:py-2 ${H.lg}`
143
143
  }
144
144
  },
145
145
  defaultVariants: { size: "md" }
146
146
  }
147
- ), oe = le(
147
+ ), ce = pe(
148
148
  [
149
149
  "ds:inline-flex ds:items-center ds:gap-1",
150
150
  "ds:rounded-[var(--radius-sm)] ds:border ds:border-border ds:bg-muted",
@@ -164,7 +164,7 @@ const Ze = {
164
164
  },
165
165
  defaultVariants: { size: "md" }
166
166
  }
167
- ), tt = [
167
+ ), it = [
168
168
  "ds:inline-flex ds:items-center ds:justify-center ds:shrink-0",
169
169
  "ds:rounded-[var(--radius-sm)]",
170
170
  "ds:text-muted-foreground ds:hover:text-foreground",
@@ -173,7 +173,7 @@ const Ze = {
173
173
  "ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
174
174
  "ds:size-4",
175
175
  'ds:relative ds:before:absolute ds:before:inset-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[""]'
176
- ].join(" "), st = [
176
+ ].join(" "), ot = [
177
177
  "ds:z-[var(--z-dropdown)] ds:overflow-hidden",
178
178
  "ds:min-w-[var(--radix-popover-trigger-width)]",
179
179
  "ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-background ds:text-foreground",
@@ -184,34 +184,34 @@ const Ze = {
184
184
  "ds:data-[side=bottom]:slide-in-from-top-2",
185
185
  "ds:data-[side=top]:slide-in-from-bottom-2",
186
186
  "ds:motion-reduce:animate-none"
187
- ].join(" "), rt = [
187
+ ].join(" "), at = [
188
188
  "ds:relative ds:flex ds:cursor-pointer ds:items-center",
189
189
  "ds:rounded-[var(--radius-sm)] ds:ps-2 ds:pe-2 ds:py-1.5",
190
190
  "ds:text-[var(--font-size-sm)] ds:text-foreground ds:outline-none ds:select-none",
191
191
  "ds:data-[selected=true]:bg-muted ds:data-[selected=true]:text-foreground",
192
192
  "ds:aria-[disabled=true]:pointer-events-none ds:aria-[disabled=true]:opacity-50",
193
193
  "ds:data-[disabled=true]:pointer-events-none ds:data-[disabled=true]:opacity-50"
194
- ].join(" "), ae = [
194
+ ].join(" "), ue = [
195
195
  "ds:relative ds:flex ds:cursor-pointer ds:items-center",
196
196
  "ds:rounded-[var(--radius-sm)] ds:ps-2 ds:pe-2 ds:py-1.5",
197
197
  "ds:text-[var(--font-size-sm)] ds:font-medium ds:text-primary ds:outline-none ds:select-none",
198
198
  "ds:data-[selected=true]:bg-muted"
199
- ].join(" "), nt = "__ui-multiselect-select-all__", it = "__ui-multiselect-clear-all__", de = Ke(
199
+ ].join(" "), lt = "__ui-multiselect-select-all__", dt = "__ui-multiselect-clear-all__", me = Ue(
200
200
  function({
201
- options: c,
202
- value: ce,
203
- defaultValue: ue,
204
- onChange: pe,
205
- onComplete: O,
206
- placeholder: me,
207
- maxSelections: v,
208
- allowSelectAll: Y = !1,
209
- allowClear: G = !1,
210
- filter: D,
201
+ options: l,
202
+ value: fe,
203
+ defaultValue: he,
204
+ onChange: ge,
205
+ onComplete: L,
206
+ placeholder: ve,
207
+ maxSelections: b,
208
+ allowSelectAll: W = !1,
209
+ allowClear: X = !1,
210
+ filter: z,
211
211
  size: R = "md",
212
- disabled: fe,
213
- className: ge,
214
- id: L,
212
+ disabled: be,
213
+ className: ye,
214
+ id: M,
215
215
  // Pull `aria-label` out of the div spread so it names the combobox
216
216
  // INPUT (the interactive control) rather than the wrapper div. Lets a
217
217
  // consumer give the trigger a meaningful name when there's no visible
@@ -220,221 +220,233 @@ const Ze = {
220
220
  // ONLY set this when the control has no visible / FormField label —
221
221
  // `aria-label` wins over an associated `<label>`, so passing both would
222
222
  // silently override the visible text (WCAG 2.5.3 Label in Name).
223
- "aria-label": he,
224
- ...ve
225
- }, be) {
226
- const { t: p } = Pe(), b = $e(), y = Me(Be) !== null, [ye, z] = Qe({
227
- value: ce,
228
- defaultValue: ue ?? [],
229
- onChange: pe
230
- }), n = ye ?? [], [k, m] = B(!1), [f, K] = B(""), S = I(null), x = I([]), H = I(null), Se = Ue(be, H), h = y && b.disabled || !!fe, xe = y && b.required, X = y && b.invalid, we = y && b.describedBy ? b.describedBy : void 0, Ie = L ?? (y ? b.id : void 0), ke = V(() => {
223
+ "aria-label": Se,
224
+ ...xe
225
+ }, Ie) {
226
+ const { t: u } = Ye(), y = Ge(), S = Qe(He) !== null, [we, K] = Xe({
227
+ value: fe,
228
+ defaultValue: he ?? [],
229
+ onChange: ge
230
+ }), i = we ?? [], [N, p] = q(!1), [m, j] = q(""), x = v(null), I = v([]), P = v(null), Ne = We(Ie, P), g = S && y.disabled || !!be, ke = S && y.required, J = S && y.invalid, Ce = S && y.describedBy ? y.describedBy : void 0, Ae = M ?? (S ? y.id : void 0), _e = O(() => {
231
231
  const e = /* @__PURE__ */ new Map();
232
- for (const t of c) e.set(t.value, t.label);
232
+ for (const t of l) e.set(t.value, t.label);
233
233
  return e;
234
- }, [c]), J = typeof v == "number" && n.length >= v, C = (e) => {
235
- z(e);
236
- }, Ce = (e) => {
237
- if (n.includes(e)) {
238
- C(n.filter((t) => t !== e));
234
+ }, [l]), Z = typeof b == "number" && i.length >= b, k = (e) => {
235
+ K(e);
236
+ }, Re = (e) => {
237
+ if (i.includes(e)) {
238
+ k(i.filter((t) => t !== e));
239
239
  return;
240
240
  }
241
- J || C([...n, e]);
242
- }, M = (e) => {
243
- const t = n.filter((s, o) => o !== e);
244
- return C(t), t;
245
- }, Ae = () => {
246
- const e = c.filter((s) => !s.disabled).map((s) => s.value), t = typeof v == "number" ? v : e.length;
247
- C(e.slice(0, t));
248
- }, Ne = () => {
249
- C([]);
250
- }, W = I(n);
251
- U(() => {
252
- W.current = n;
253
- }, [n]);
254
- const Z = I(f);
255
- U(() => {
256
- Z.current = f;
257
- }, [f]);
258
- const ee = I(k);
259
- U(() => {
260
- ee.current = k;
261
- }, [k]);
262
- const j = je(
241
+ Z || k([...i, e]);
242
+ }, $ = (e) => {
243
+ const t = i.filter((s, o) => o !== e);
244
+ return k(t), t;
245
+ }, Te = () => {
246
+ const e = l.filter((s) => !s.disabled).map((s) => s.value), t = typeof b == "number" ? b : e.length;
247
+ k(e.slice(0, t));
248
+ }, Ee = () => {
249
+ k([]);
250
+ }, ee = v(i);
251
+ Y(() => {
252
+ ee.current = i;
253
+ }, [i]);
254
+ const te = v(m);
255
+ Y(() => {
256
+ te.current = m;
257
+ }, [m]);
258
+ const se = v(N);
259
+ Y(() => {
260
+ se.current = N;
261
+ }, [N]);
262
+ const B = le(
263
263
  (e) => {
264
- z(e);
264
+ K(e);
265
265
  },
266
- [z]
267
- ), _e = V(
266
+ [K]
267
+ ), Fe = O(
268
268
  () => ({
269
- getSelection: () => [...W.current],
270
- getQuery: () => Z.current,
271
- getIsOpen: () => ee.current,
272
- setSelection: (e) => j(e),
273
- clearSelection: () => j([]),
274
- setQuery: (e) => K(e),
275
- open: () => m(!0),
276
- close: () => m(!1)
269
+ getSelection: () => [...ee.current],
270
+ getQuery: () => te.current,
271
+ getIsOpen: () => se.current,
272
+ setSelection: (e) => B(e),
273
+ clearSelection: () => B([]),
274
+ setQuery: (e) => j(e),
275
+ open: () => p(!0),
276
+ close: () => p(!1)
277
277
  }),
278
- [j]
278
+ [B]
279
279
  );
280
- Xe(Ze, _e, L);
281
- const te = me ?? p("inputs.multiSelect.placeholder", "Select…"), se = V(() => {
282
- if (!f) return c;
283
- const e = f.toLowerCase();
284
- return c.filter((t) => D ? D(f, t) : t.label.toLowerCase().includes(e));
285
- }, [c, f, D]), Re = V(
286
- () => Ge(se),
287
- [se]
288
- ), Te = (e) => {
280
+ et(rt, Fe, M);
281
+ const re = ve ?? u("inputs.multiSelect.placeholder", "Select…"), ne = O(() => {
282
+ if (!m) return l;
283
+ const e = m.toLowerCase();
284
+ return l.filter((t) => z ? z(m, t) : t.label.toLowerCase().includes(e));
285
+ }, [l, m, z]), Ve = O(
286
+ () => Je(ne),
287
+ [ne]
288
+ ), qe = (e) => {
289
289
  var o;
290
290
  const t = e.currentTarget;
291
- if (e.key === "Backspace" && f === "" && n.length > 0) {
291
+ if (e.key === "Backspace" && m === "" && i.length > 0) {
292
292
  e.preventDefault();
293
- const i = n.length - 1, d = M(i).length - 1;
293
+ const r = i.length - 1, d = $(r).length - 1;
294
294
  d >= 0 && requestAnimationFrame(() => {
295
- var g;
296
- (g = x.current[d]) == null || g.focus();
295
+ var h;
296
+ (h = I.current[d]) == null || h.focus();
297
297
  });
298
298
  return;
299
299
  }
300
300
  const s = t.selectionStart === 0 && t.selectionEnd === 0;
301
- if ((e.key === "ArrowLeft" || e.key === "ArrowRight") && s && n.length > 0) {
302
- const i = document.dir === "rtl" || t.dir === "rtl";
303
- if (i && e.key === "ArrowRight" || !i && e.key === "ArrowLeft") {
301
+ if ((e.key === "ArrowLeft" || e.key === "ArrowRight") && s && i.length > 0) {
302
+ const r = document.dir === "rtl" || t.dir === "rtl";
303
+ if (r && e.key === "ArrowRight" || !r && e.key === "ArrowLeft") {
304
304
  e.preventDefault();
305
- const d = n.length - 1;
306
- (o = x.current[d]) == null || o.focus();
305
+ const d = i.length - 1;
306
+ (o = I.current[d]) == null || o.focus();
307
307
  }
308
308
  return;
309
309
  }
310
310
  if (e.key === "Escape") {
311
- m(!1);
311
+ p(!1);
312
312
  return;
313
313
  }
314
- !k && (e.key === "ArrowDown" || e.key === "Enter") && m(!0);
315
- }, Ee = (e) => (t) => {
316
- var l, d, g, N;
314
+ !N && (e.key === "ArrowDown" || e.key === "Enter") && p(!0);
315
+ }, Oe = (e) => (t) => {
316
+ var f, d, h, A;
317
317
  if (t.key === "Backspace" || t.key === "Delete" || t.key === "Enter" || t.key === " ") {
318
318
  t.preventDefault(), t.stopPropagation();
319
- const F = M(e);
320
- if (F.length === 0) {
319
+ const V = $(e);
320
+ if (V.length === 0) {
321
321
  requestAnimationFrame(() => {
322
322
  var _;
323
- return (_ = S.current) == null ? void 0 : _.focus();
323
+ return (_ = x.current) == null ? void 0 : _.focus();
324
324
  });
325
325
  return;
326
326
  }
327
- const ze = Math.min(e, F.length - 1);
327
+ const Be = Math.min(e, V.length - 1);
328
328
  requestAnimationFrame(() => {
329
329
  var _;
330
- (_ = x.current[ze]) == null || _.focus();
330
+ (_ = I.current[Be]) == null || _.focus();
331
331
  });
332
332
  return;
333
333
  }
334
- const s = document.dir === "rtl", o = s ? "ArrowRight" : "ArrowLeft", i = s ? "ArrowLeft" : "ArrowRight";
334
+ const s = document.dir === "rtl", o = s ? "ArrowRight" : "ArrowLeft", r = s ? "ArrowLeft" : "ArrowRight";
335
335
  if (t.key === o) {
336
336
  t.preventDefault();
337
- const F = Math.max(0, e - 1);
338
- (l = x.current[F]) == null || l.focus();
337
+ const V = Math.max(0, e - 1);
338
+ (f = I.current[V]) == null || f.focus();
339
339
  return;
340
340
  }
341
- if (t.key === i) {
342
- t.preventDefault(), e < n.length - 1 ? (d = x.current[e + 1]) == null || d.focus() : (g = S.current) == null || g.focus();
341
+ if (t.key === r) {
342
+ t.preventDefault(), e < i.length - 1 ? (d = I.current[e + 1]) == null || d.focus() : (h = x.current) == null || h.focus();
343
343
  return;
344
344
  }
345
- t.key === "Escape" && (m(!1), (N = S.current) == null || N.focus());
346
- }, [T, P] = B(
345
+ t.key === "Escape" && (p(!1), (A = x.current) == null || A.focus());
346
+ }, [T, U] = q(
347
347
  Number.POSITIVE_INFINITY
348
- );
349
- Ye(() => {
350
- const e = H.current;
348
+ ), [De, Le] = q(0), ie = v(-1), E = le(() => {
349
+ U(Number.POSITIVE_INFINITY), Le((e) => e + 1);
350
+ }, []);
351
+ G(() => {
352
+ const e = P.current;
351
353
  if (!e) return;
352
- const t = () => {
353
- const o = Array.from(
354
- e.querySelectorAll('[data-ui-chip="true"]')
354
+ const t = Array.from(
355
+ e.querySelectorAll('[data-ui-chip="true"]')
356
+ );
357
+ if (t.length === 0) {
358
+ U(Number.POSITIVE_INFINITY);
359
+ return;
360
+ }
361
+ const s = t[0].offsetTop;
362
+ let o = 0;
363
+ for (const r of t)
364
+ if (r.offsetTop === s) o++;
365
+ else break;
366
+ U(
367
+ o === t.length ? Number.POSITIVE_INFINITY : Math.max(1, o - 1)
368
+ );
369
+ }, [De]), G(() => {
370
+ E();
371
+ }, [i.length, R, E]), G(() => {
372
+ const e = P.current;
373
+ if (!e) return;
374
+ const t = new ResizeObserver((s) => {
375
+ var r;
376
+ const o = Math.round(
377
+ ((r = s[0]) == null ? void 0 : r.contentRect.width) ?? e.clientWidth
355
378
  );
356
- if (o.length === 0) {
357
- P(Number.POSITIVE_INFINITY);
358
- return;
359
- }
360
- const i = o[0].offsetTop;
361
- let l = 0;
362
- for (const d of o)
363
- if (d.offsetTop === i) l++;
364
- else break;
365
- l === o.length ? P(Number.POSITIVE_INFINITY) : P(Math.max(1, l - 1));
366
- };
367
- t();
368
- const s = new ResizeObserver(t);
369
- return s.observe(e), () => s.disconnect();
370
- }, [n.length, R]);
371
- const E = n.map((e) => ({
379
+ o !== ie.current && (ie.current = o, E());
380
+ });
381
+ return t.observe(e), () => t.disconnect();
382
+ }, [E]);
383
+ const F = i.map((e) => ({
372
384
  value: e,
373
- label: ke.get(e) ?? e
374
- })), re = T === Number.POSITIVE_INFINITY || T >= E.length, Fe = re ? E : E.slice(0, T), ne = re ? [] : E.slice(T), A = ne.length, Ve = (e) => {
385
+ label: _e.get(e) ?? e
386
+ })), oe = T === Number.POSITIVE_INFINITY || T >= F.length, ze = oe ? F : F.slice(0, T), ae = oe ? [] : F.slice(T), C = ae.length, Me = (e) => {
375
387
  var s;
376
- if (h) return;
388
+ if (g) return;
377
389
  const t = e.target;
378
- t.closest('[data-ui-chip="true"]') || t.closest('[data-ui-chip-dismiss="true"]') || (m(!0), (s = S.current) == null || s.focus());
379
- }, qe = (e) => {
380
- if (h) {
381
- m(!1);
390
+ t.closest('[data-ui-chip="true"]') || t.closest('[data-ui-chip-dismiss="true"]') || (p(!0), (s = x.current) == null || s.focus());
391
+ }, Ke = (e) => {
392
+ if (g) {
393
+ p(!1);
382
394
  return;
383
395
  }
384
- m(e), e || (K(""), O == null || O(n));
385
- }, Oe = Y || G, De = p("inputs.multiSelect.selected", {
386
- count: n.length,
387
- defaultValue: `${n.length} selected`
388
- }), { onClick: $, ...Le } = ve;
389
- return /* @__PURE__ */ r(u, { shouldFilter: !1, label: De, children: /* @__PURE__ */ w(q.Root, { open: k, onOpenChange: qe, children: [
390
- /* @__PURE__ */ r(q.Anchor, { asChild: !0, children: /* @__PURE__ */ w(
396
+ p(e), e || (j(""), L == null || L(i));
397
+ }, je = W || X, Pe = u("inputs.multiSelect.selected", {
398
+ count: i.length,
399
+ defaultValue: `${i.length} selected`
400
+ }), { onClick: Q, ...$e } = xe;
401
+ return /* @__PURE__ */ n(c, { shouldFilter: !1, label: Pe, children: /* @__PURE__ */ w(D.Root, { open: N, onOpenChange: Ke, children: [
402
+ /* @__PURE__ */ n(D.Anchor, { asChild: !0, children: /* @__PURE__ */ w(
391
403
  "div",
392
404
  {
393
- ref: Se,
394
- className: et({ size: R, className: ge }),
395
- "aria-disabled": h || void 0,
396
- "aria-invalid": X || void 0,
405
+ ref: Ne,
406
+ className: nt({ size: R, className: ye }),
407
+ "aria-disabled": g || void 0,
408
+ "aria-invalid": J || void 0,
397
409
  "data-component": "multi-select",
398
- "data-component-id": L,
410
+ "data-component-id": M,
399
411
  onClick: (e) => {
400
- $ == null || $(e), Ve(e);
412
+ Q == null || Q(e), Me(e);
401
413
  },
402
- ...Le,
414
+ ...$e,
403
415
  children: [
404
- Fe.map((e, t) => (
416
+ ze.map((e, t) => (
405
417
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- chip pill receives focus via roving tabindex; chip removal uses an inner button
406
418
  /* @__PURE__ */ w(
407
419
  "span",
408
420
  {
409
421
  ref: (s) => {
410
- x.current[t] = s;
422
+ I.current[t] = s;
411
423
  },
412
- tabIndex: h ? -1 : 0,
424
+ tabIndex: g ? -1 : 0,
413
425
  "data-ui-chip": "true",
414
- className: oe({ size: R }),
415
- onKeyDown: Ee(t),
426
+ className: ce({ size: R }),
427
+ onKeyDown: Oe(t),
416
428
  "aria-label": e.label,
417
429
  children: [
418
- /* @__PURE__ */ r("span", { children: e.label }),
419
- /* @__PURE__ */ r(
430
+ /* @__PURE__ */ n("span", { children: e.label }),
431
+ /* @__PURE__ */ n(
420
432
  "button",
421
433
  {
422
434
  type: "button",
423
435
  tabIndex: -1,
424
436
  "data-ui-chip-dismiss": "true",
425
- "aria-label": p("inputs.multiSelect.remove", {
437
+ "aria-label": u("inputs.multiSelect.remove", {
426
438
  label: e.label,
427
439
  defaultValue: `Remove ${e.label}`
428
440
  }),
429
- disabled: h,
441
+ disabled: g,
430
442
  onClick: (s) => {
431
- s.stopPropagation(), M(t), requestAnimationFrame(() => {
443
+ s.stopPropagation(), $(t), requestAnimationFrame(() => {
432
444
  var o;
433
- return (o = S.current) == null ? void 0 : o.focus();
445
+ return (o = x.current) == null ? void 0 : o.focus();
434
446
  });
435
447
  },
436
- className: tt,
437
- children: /* @__PURE__ */ r(Je, { "aria-hidden": "true", className: "ds:size-3.5" })
448
+ className: it,
449
+ children: /* @__PURE__ */ n(tt, { "aria-hidden": "true", className: "ds:size-3.5" })
438
450
  }
439
451
  )
440
452
  ]
@@ -442,46 +454,46 @@ const Ze = {
442
454
  e.value
443
455
  )
444
456
  )),
445
- A > 0 ? /* @__PURE__ */ r(
446
- ie,
457
+ C > 0 ? /* @__PURE__ */ n(
458
+ de,
447
459
  {
448
- label: ne.map((e) => e.label).join(", "),
460
+ label: ae.map((e) => e.label).join(", "),
449
461
  delayDuration: 200,
450
- children: /* @__PURE__ */ r(
462
+ children: /* @__PURE__ */ n(
451
463
  "span",
452
464
  {
453
- className: oe({ size: R }),
465
+ className: ce({ size: R }),
454
466
  tabIndex: 0,
455
467
  role: "button",
456
- "aria-label": p("inputs.multiSelect.overflow", {
457
- count: A,
458
- defaultValue: `+${A} more`
468
+ "aria-label": u("inputs.multiSelect.overflow", {
469
+ count: C,
470
+ defaultValue: `+${C} more`
459
471
  }),
460
- children: /* @__PURE__ */ r("span", { children: p("inputs.multiSelect.overflow", {
461
- count: A,
462
- defaultValue: `+${A} more`
472
+ children: /* @__PURE__ */ n("span", { children: u("inputs.multiSelect.overflow", {
473
+ count: C,
474
+ defaultValue: `+${C} more`
463
475
  }) })
464
476
  }
465
477
  )
466
478
  }
467
479
  ) : null,
468
- /* @__PURE__ */ r(
469
- u.Input,
480
+ /* @__PURE__ */ n(
481
+ c.Input,
470
482
  {
471
- ref: S,
472
- value: f,
473
- onValueChange: K,
474
- onKeyDown: Te,
483
+ ref: x,
484
+ value: m,
485
+ onValueChange: j,
486
+ onKeyDown: qe,
475
487
  onFocus: () => {
476
- h || m(!0);
488
+ g || p(!0);
477
489
  },
478
- placeholder: n.length === 0 ? te : "",
479
- id: Ie,
480
- "aria-label": y ? void 0 : he,
481
- "aria-describedby": we,
482
- "aria-invalid": X || void 0,
483
- "aria-required": xe || void 0,
484
- disabled: h,
490
+ placeholder: i.length === 0 ? re : "",
491
+ id: Ae,
492
+ "aria-label": S ? void 0 : Se,
493
+ "aria-describedby": Ce,
494
+ "aria-invalid": J || void 0,
495
+ "aria-required": ke || void 0,
496
+ disabled: g,
485
497
  className: [
486
498
  "ds:flex-1 ds:min-w-[6rem] ds:bg-transparent ds:outline-none",
487
499
  "ds:placeholder:text-muted-foreground ds:text-start",
@@ -492,109 +504,109 @@ const Ze = {
492
504
  ]
493
505
  }
494
506
  ) }),
495
- /* @__PURE__ */ r(q.Portal, { children: /* @__PURE__ */ r(
496
- q.Content,
507
+ /* @__PURE__ */ n(D.Portal, { children: /* @__PURE__ */ n(
508
+ D.Content,
497
509
  {
498
510
  onOpenAutoFocus: (e) => e.preventDefault(),
499
511
  onCloseAutoFocus: (e) => e.preventDefault(),
500
512
  align: "start",
501
513
  sideOffset: 4,
502
- className: st,
514
+ className: ot,
503
515
  children: /* @__PURE__ */ w(
504
- u.List,
516
+ c.List,
505
517
  {
506
518
  role: "listbox",
507
519
  "aria-multiselectable": "true",
508
- "aria-label": te,
520
+ "aria-label": re,
509
521
  className: "ds:max-h-[20rem] ds:overflow-y-auto ds:p-1",
510
522
  children: [
511
- Oe ? /* @__PURE__ */ w(u.Group, { children: [
512
- Y ? /* @__PURE__ */ r(
513
- u.Item,
523
+ je ? /* @__PURE__ */ w(c.Group, { children: [
524
+ W ? /* @__PURE__ */ n(
525
+ c.Item,
514
526
  {
515
- value: nt,
516
- onSelect: Ae,
517
- className: ae,
518
- children: p("inputs.multiSelect.selectAll", "Select all")
527
+ value: lt,
528
+ onSelect: Te,
529
+ className: ue,
530
+ children: u("inputs.multiSelect.selectAll", "Select all")
519
531
  }
520
532
  ) : null,
521
- G ? /* @__PURE__ */ r(
522
- u.Item,
533
+ X ? /* @__PURE__ */ n(
534
+ c.Item,
523
535
  {
524
- value: it,
525
- onSelect: Ne,
526
- className: ae,
527
- children: p("inputs.multiSelect.clearAll", "Clear all")
536
+ value: dt,
537
+ onSelect: Ee,
538
+ className: ue,
539
+ children: u("inputs.multiSelect.clearAll", "Clear all")
528
540
  }
529
541
  ) : null
530
542
  ] }) : null,
531
- /* @__PURE__ */ r(u.Empty, { className: "ds:ps-2 ds:pe-2 ds:py-2 type-body-sm ds:text-muted-foreground", children: p("inputs.multiSelect.noOptions", "No options found") }),
532
- Re.map(({ group: e, items: t }, s) => {
533
- const o = t.map((i) => {
534
- const l = n.includes(i.value), d = !l && J, g = !!i.disabled || d, N = /* @__PURE__ */ w(
535
- u.Item,
543
+ /* @__PURE__ */ n(c.Empty, { className: "ds:ps-2 ds:pe-2 ds:py-2 type-body-sm ds:text-muted-foreground", children: u("inputs.multiSelect.noOptions", "No options found") }),
544
+ Ve.map(({ group: e, items: t }, s) => {
545
+ const o = t.map((r) => {
546
+ const f = i.includes(r.value), d = !f && Z, h = !!r.disabled || d, A = /* @__PURE__ */ w(
547
+ c.Item,
536
548
  {
537
- value: i.value,
538
- "data-option-id": i.value,
539
- disabled: g,
549
+ value: r.value,
550
+ "data-option-id": r.value,
551
+ disabled: h,
540
552
  onSelect: () => {
541
- g || Ce(i.value);
553
+ h || Re(r.value);
542
554
  },
543
- "aria-selected": l,
544
- "aria-disabled": g || void 0,
545
- className: rt,
555
+ "aria-selected": f,
556
+ "aria-disabled": h || void 0,
557
+ className: at,
546
558
  children: [
547
- /* @__PURE__ */ r(
559
+ /* @__PURE__ */ n(
548
560
  "span",
549
561
  {
550
562
  className: [
551
563
  "ds:inline-flex ds:items-center ds:justify-center ds:me-[var(--spacing-xs)] ds:shrink-0",
552
564
  "ds:size-4 ds:rounded-[var(--radius-sm)] ds:border ds:border-border",
553
- l ? "ds:bg-primary ds:border-primary ds:text-primary-foreground" : "ds:bg-background"
565
+ f ? "ds:bg-primary ds:border-primary ds:text-primary-foreground" : "ds:bg-background"
554
566
  ].join(" "),
555
567
  "aria-hidden": "true",
556
- children: l ? /* @__PURE__ */ r(We, { className: "ds:size-3.5" }) : null
568
+ children: f ? /* @__PURE__ */ n(st, { className: "ds:size-3.5" }) : null
557
569
  }
558
570
  ),
559
- i.startAdornment ? (
571
+ r.startAdornment ? (
560
572
  // Decorative by contract — the accessible name comes
561
573
  // from the option label.
562
- /* @__PURE__ */ r(
574
+ /* @__PURE__ */ n(
563
575
  "span",
564
576
  {
565
577
  "aria-hidden": "true",
566
578
  className: "ds:inline-flex ds:items-center ds:shrink-0 ds:me-[var(--spacing-xs)]",
567
- children: i.startAdornment
579
+ children: r.startAdornment
568
580
  }
569
581
  )
570
582
  ) : null,
571
- /* @__PURE__ */ r("span", { className: "ds:flex-1 ds:text-start", children: i.label })
583
+ /* @__PURE__ */ n("span", { className: "ds:flex-1 ds:text-start", children: r.label })
572
584
  ]
573
585
  },
574
- i.value
586
+ r.value
575
587
  );
576
- return d ? /* @__PURE__ */ r(
577
- ie,
588
+ return d ? /* @__PURE__ */ n(
589
+ de,
578
590
  {
579
- label: p("inputs.multiSelect.maxReached", {
580
- count: v,
581
- defaultValue: `Maximum ${v} selections`
591
+ label: u("inputs.multiSelect.maxReached", {
592
+ count: b,
593
+ defaultValue: `Maximum ${b} selections`
582
594
  }),
583
595
  delayDuration: 200,
584
- children: N
596
+ children: A
585
597
  },
586
- i.value
587
- ) : N;
598
+ r.value
599
+ ) : A;
588
600
  });
589
- return e ? /* @__PURE__ */ r(
590
- u.Group,
601
+ return e ? /* @__PURE__ */ n(
602
+ c.Group,
591
603
  {
592
604
  heading: e,
593
605
  className: "ds:[&_[cmdk-group-heading]]:ps-2 ds:[&_[cmdk-group-heading]]:pe-2 ds:[&_[cmdk-group-heading]]:py-1 ds:[&_[cmdk-group-heading]]:type-eyebrow ds:[&_[cmdk-group-heading]]:text-muted-foreground",
594
606
  children: o
595
607
  },
596
608
  `group-${e}`
597
- ) : /* @__PURE__ */ r(u.Group, { children: o }, `group-${s}`);
609
+ ) : /* @__PURE__ */ n(c.Group, { children: o }, `group-${s}`);
598
610
  })
599
611
  ]
600
612
  }
@@ -604,11 +616,11 @@ const Ze = {
604
616
  ] }) });
605
617
  }
606
618
  );
607
- de.displayName = "MultiSelect";
608
- const xt = de;
619
+ me.displayName = "MultiSelect";
620
+ const kt = me;
609
621
  export {
610
- xt as M,
611
- et as a,
612
- Ze as m
622
+ kt as M,
623
+ nt as a,
624
+ rt as m
613
625
  };
614
- //# sourceMappingURL=multi-select-D5QLBJM1.js.map
626
+ //# sourceMappingURL=multi-select-CC52Qws6.js.map