@commercetools/nimbus 0.0.0-canary-20260116161853 → 0.0.0-canary-20260119093042

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 (33) hide show
  1. package/dist/chunks/{DateField-C0JaKbSn.es.js → DateField-DCWy1Ysp.es.js} +2 -2
  2. package/dist/chunks/{DateField-C0JaKbSn.es.js.map → DateField-DCWy1Ysp.es.js.map} +1 -1
  3. package/dist/chunks/{DatePicker-yMmjwrzP.es.js → DatePicker-CL72jbDo.es.js} +2 -2
  4. package/dist/chunks/{DatePicker-yMmjwrzP.es.js.map → DatePicker-CL72jbDo.es.js.map} +1 -1
  5. package/dist/chunks/combobox-B7ck7gxL.cjs.js +2 -0
  6. package/dist/chunks/combobox-B7ck7gxL.cjs.js.map +1 -0
  7. package/dist/chunks/{combobox-h1qOiDJD.es.js → combobox-vjauyzlS.es.js} +365 -363
  8. package/dist/chunks/combobox-vjauyzlS.es.js.map +1 -0
  9. package/dist/chunks/{date-input-BR-AeTsM.es.js → date-input-Cd9q4qBj.es.js} +2 -2
  10. package/dist/chunks/{date-input-BR-AeTsM.es.js.map → date-input-Cd9q4qBj.es.js.map} +1 -1
  11. package/dist/chunks/{date-picker-4vPcj4T0.es.js → date-picker-B8VVNXU3.es.js} +5 -5
  12. package/dist/chunks/{date-picker-4vPcj4T0.es.js.map → date-picker-B8VVNXU3.es.js.map} +1 -1
  13. package/dist/chunks/{date-range-picker-D3cnZQYb.es.js → date-range-picker-BnbKgO1E.es.js} +5 -5
  14. package/dist/chunks/{date-range-picker-D3cnZQYb.es.js.map → date-range-picker-BnbKgO1E.es.js.map} +1 -1
  15. package/dist/chunks/{date-range-picker-field-BKmTQ50O.es.js → date-range-picker-field-BuI6eLMY.es.js} +2 -2
  16. package/dist/chunks/{date-range-picker-field-BKmTQ50O.es.js.map → date-range-picker-field-BuI6eLMY.es.js.map} +1 -1
  17. package/dist/chunks/{time-input-C_igRgEc.es.js → time-input-CCuIFoY2.es.js} +2 -2
  18. package/dist/chunks/{time-input-C_igRgEc.es.js.map → time-input-CCuIFoY2.es.js.map} +1 -1
  19. package/dist/components/combobox.cjs +1 -1
  20. package/dist/components/combobox.es.js +1 -1
  21. package/dist/components/date-input.es.js +1 -1
  22. package/dist/components/date-picker.es.js +1 -1
  23. package/dist/components/date-range-picker-field.es.js +1 -1
  24. package/dist/components/date-range-picker.es.js +1 -1
  25. package/dist/components/fields.es.js +1 -1
  26. package/dist/components/patterns.es.js +1 -1
  27. package/dist/components/time-input.es.js +1 -1
  28. package/dist/index.cjs +1 -1
  29. package/dist/index.es.js +6 -6
  30. package/package.json +6 -6
  31. package/dist/chunks/combobox-Do4z66WO.cjs.js +0 -2
  32. package/dist/chunks/combobox-Do4z66WO.cjs.js.map +0 -1
  33. package/dist/chunks/combobox-h1qOiDJD.es.js.map +0 -1
@@ -1,25 +1,25 @@
1
- import { jsx as g, jsxs as xe, Fragment as He } from "react/jsx-runtime";
2
- import { useReducer as St, useRef as O, useEffect as H, createContext as Qe, useMemo as J, useContext as Ee, useState as U, useCallback as R, isValidElement as wt, cloneElement as $t } from "react";
1
+ import { jsx as g, jsxs as ve, Fragment as He } from "react/jsx-runtime";
2
+ import { useReducer as St, useRef as A, useEffect as Y, createContext as Qe, useMemo as _, useContext as Pe, useState as Z, useCallback as R, isValidElement as wt, cloneElement as $t } from "react";
3
3
  import { d as Kt } from "./Header-CiYtrnTw.es.js";
4
4
  import { $ as Xe, a as It, b as Bt, c as Mt, d as At } from "./ListBox-RrHJjnuq.es.js";
5
- import { f as Ft, g as Tt } from "./CollectionBuilder-BOe312C_.es.js";
6
- import { createSlotRecipeContext as Ot } from "@chakra-ui/react";
7
- import { Close as Vt, KeyboardArrowDown as Lt, Check as Rt } from "@commercetools/nimbus-icons";
8
- import { e as ue } from "./extract-style-props-BdibuNZ7.es.js";
9
- import { P as Pt } from "./popover-CuA9VugH.es.js";
5
+ import { f as Ft, g as Ot } from "./CollectionBuilder-BOe312C_.es.js";
6
+ import { createSlotRecipeContext as Vt } from "@chakra-ui/react";
7
+ import { Close as Lt, KeyboardArrowDown as Tt, Check as Et } from "@commercetools/nimbus-icons";
8
+ import { e as fe } from "./extract-style-props-BdibuNZ7.es.js";
9
+ import { P as Rt } from "./popover-CuA9VugH.es.js";
10
10
  import { I as Ue } from "./icon-button-CosIm3oY.es.js";
11
- import { L as Et } from "./loading-spinner-gf62wtm3.es.js";
11
+ import { L as Pt } from "./loading-spinner-gf62wtm3.es.js";
12
12
  import { $ as Me, a as Dt } from "./Input-Cmg08oRP.es.js";
13
- import { $ as De, T as Le } from "./tag-group-BE8d6xcP.es.js";
13
+ import { $ as De, T as Te } from "./tag-group-BE8d6xcP.es.js";
14
14
  import { useSlotRecipe as zt } from "@chakra-ui/react/styled-system";
15
15
  import { b as Nt } from "./RSPContexts-DLgb84PF.es.js";
16
- import { $ as Re } from "./Button-BjcDZ5eb.es.js";
16
+ import { $ as Ee } from "./Button-BjcDZ5eb.es.js";
17
17
  import { $ as kt, e as Ye } from "./utils-B6pV5ewr.es.js";
18
18
  import { a as Wt } from "./Group-BQc9LuMT.es.js";
19
19
  import { $ as Gt } from "./Label-DIseLESi.es.js";
20
20
  import { h as qt } from "./Dialog-B0BQfdQa.es.js";
21
21
  import { $ as jt } from "./Text-DOcU1ycg.es.js";
22
- import { n as he, u as Ht } from "./normalize-messages-D5T4I93D.es.js";
22
+ import { n as xe, u as Ht } from "./normalize-messages-D5T4I93D.es.js";
23
23
  import { $ as Ut } from "./useListData-CX8_NxJv.es.js";
24
24
  import { a as Je } from "./mergeProps-Dsl8k3Ig.es.js";
25
25
  import { a as Jt } from "./useListState-Dd0Mtev3.es.js";
@@ -87,8 +87,8 @@ function Qt(e, t) {
87
87
  case "loadingMore":
88
88
  case "sorting":
89
89
  case "filtering":
90
- var x;
91
- (x = e.abortController) === null || x === void 0 || x.abort();
90
+ var h;
91
+ (h = e.abortController) === null || h === void 0 || h.abort();
92
92
  var d;
93
93
  return {
94
94
  ...e,
@@ -115,16 +115,16 @@ function Qt(e, t) {
115
115
  ...e.selectedKeys,
116
116
  ...(p = t.selectedKeys) !== null && p !== void 0 ? p : []
117
117
  ]);
118
- var T, M;
118
+ var K, T;
119
119
  return {
120
120
  ...e,
121
121
  state: "idle",
122
122
  items: [
123
123
  ...e.items,
124
- ...(T = t.items) !== null && T !== void 0 ? T : []
124
+ ...(K = t.items) !== null && K !== void 0 ? K : []
125
125
  ],
126
126
  selectedKeys: r,
127
- sortDescriptor: (M = t.sortDescriptor) !== null && M !== void 0 ? M : e.sortDescriptor,
127
+ sortDescriptor: (T = t.sortDescriptor) !== null && T !== void 0 ? T : e.sortDescriptor,
128
128
  abortController: void 0,
129
129
  cursor: t.cursor
130
130
  };
@@ -137,20 +137,20 @@ function Qt(e, t) {
137
137
  case "loading":
138
138
  case "sorting":
139
139
  case "filtering":
140
- var K;
141
- (K = e.abortController) === null || K === void 0 || K.abort();
142
- var h;
140
+ var I;
141
+ (I = e.abortController) === null || I === void 0 || I.abort();
142
+ var y;
143
143
  return {
144
144
  ...e,
145
- filterText: (h = t.filterText) !== null && h !== void 0 ? h : e.filterText,
145
+ filterText: (y = t.filterText) !== null && y !== void 0 ? y : e.filterText,
146
146
  state: t.type,
147
147
  // Reset items to an empty list if loading, but not when sorting.
148
148
  items: t.type === "loading" ? [] : e.items,
149
149
  abortController: t.abortController
150
150
  };
151
151
  case "loadingMore":
152
- var I;
153
- return (I = t.abortController) === null || I === void 0 || I.abort(), e;
152
+ var F;
153
+ return (F = t.abortController) === null || F === void 0 || F.abort(), e;
154
154
  case "update":
155
155
  var $;
156
156
  return {
@@ -181,41 +181,41 @@ function Xt(e) {
181
181
  ...d,
182
182
  abortController: p
183
183
  });
184
+ var K;
185
+ let y = (K = d.filterText) !== null && K !== void 0 ? K : l.filterText;
184
186
  var T;
185
- let h = (T = d.filterText) !== null && T !== void 0 ? T : l.filterText;
186
- var M;
187
- let I = await w({
187
+ let F = await w({
188
188
  items: l.items.slice(),
189
189
  selectedKeys: l.selectedKeys,
190
- sortDescriptor: (M = d.sortDescriptor) !== null && M !== void 0 ? M : l.sortDescriptor,
190
+ sortDescriptor: (T = d.sortDescriptor) !== null && T !== void 0 ? T : l.sortDescriptor,
191
191
  signal: p.signal,
192
192
  cursor: d.type === "loadingMore" ? l.cursor : void 0,
193
- filterText: h,
193
+ filterText: y,
194
194
  loadingState: l.state
195
195
  });
196
- var K;
197
- let $ = (K = I.filterText) !== null && K !== void 0 ? K : h;
196
+ var I;
197
+ let $ = (I = F.filterText) !== null && I !== void 0 ? I : y;
198
198
  u({
199
199
  type: "success",
200
- ...I,
200
+ ...F,
201
201
  abortController: p
202
- }), $ && $ !== h && !p.signal.aborted && b({
202
+ }), $ && $ !== y && !p.signal.aborted && b({
203
203
  type: "filtering",
204
204
  filterText: $
205
205
  }, t);
206
- } catch (h) {
206
+ } catch (y) {
207
207
  u({
208
208
  type: "error",
209
- error: h,
209
+ error: y,
210
210
  abortController: p
211
211
  });
212
212
  }
213
213
  };
214
- let x = O(!1);
215
- return H(() => {
216
- x.current || (b({
214
+ let h = A(!1);
215
+ return Y(() => {
216
+ h.current || (b({
217
217
  type: "loading"
218
- }, t), x.current = !0);
218
+ }, t), h.current = !0);
219
219
  }, []), {
220
220
  items: l.items,
221
221
  selectedKeys: l.selectedKeys,
@@ -263,61 +263,63 @@ function Xt(e) {
263
263
  }
264
264
  const Yt = /* @__PURE__ */ Qe(null);
265
265
  function Zt(e, t, r, s) {
266
- var o = this, n = O(null), c = O(0), l = O(0), u = O(null), b = O([]), x = O(), d = O(), w = O(e), p = O(!0);
266
+ var o = this, n = A(null), c = A(0), l = A(0), u = A(null), b = A([]), h = A(), d = A(), w = A(e), p = A(!0), K = A(), T = A();
267
267
  w.current = e;
268
- var T = typeof window < "u", M = !t && t !== 0 && T;
268
+ var I = typeof window < "u", y = !t && t !== 0 && I;
269
269
  if (typeof e != "function") throw new TypeError("Expected a function");
270
270
  t = +t || 0;
271
- var K = !!(r = r || {}).leading, h = !("trailing" in r) || !!r.trailing, I = "maxWait" in r, $ = "debounceOnServer" in r && !!r.debounceOnServer, Q = I ? Math.max(+r.maxWait || 0, t) : null;
272
- H(function() {
273
- return p.current = !0, function() {
274
- p.current = !1;
275
- };
276
- }, []);
277
- var de = J(function() {
278
- var D = function(y) {
279
- var V = b.current, Z = x.current;
280
- return b.current = x.current = null, c.current = y, l.current = l.current || y, d.current = w.current.apply(Z, V);
281
- }, G = function(y, V) {
282
- M && cancelAnimationFrame(u.current), u.current = M ? requestAnimationFrame(y) : setTimeout(y, V);
283
- }, re = function(y) {
271
+ var F = !!(r = r || {}).leading, $ = !("trailing" in r) || !!r.trailing, H = !!r.flushOnExit && $, U = "maxWait" in r, q = "debounceOnServer" in r && !!r.debounceOnServer, J = U ? Math.max(+r.maxWait || 0, t) : null, ne = _(function() {
272
+ var P = function(x) {
273
+ var O = b.current, D = h.current;
274
+ return b.current = h.current = null, c.current = x, l.current = l.current || x, d.current = w.current.apply(D, O);
275
+ }, Q = function(x, O) {
276
+ y && cancelAnimationFrame(u.current), u.current = y ? requestAnimationFrame(x) : setTimeout(x, O);
277
+ }, se = function(x) {
284
278
  if (!p.current) return !1;
285
- var V = y - n.current;
286
- return !n.current || V >= t || V < 0 || I && y - c.current >= Q;
287
- }, X = function(y) {
288
- return u.current = null, h && b.current ? D(y) : (b.current = x.current = null, d.current);
289
- }, Y = function y() {
290
- var V = Date.now();
291
- if (K && l.current === c.current && le(), re(V)) return X(V);
279
+ var O = x - n.current;
280
+ return !n.current || O >= t || O < 0 || U && x - c.current >= J;
281
+ }, le = function(x) {
282
+ return u.current = null, $ && b.current ? P(x) : (b.current = h.current = null, d.current);
283
+ }, B = function x() {
284
+ var O = Date.now();
285
+ if (F && l.current === c.current && me(), se(O)) return le(O);
292
286
  if (p.current) {
293
- var Z = t - (V - n.current), z = I ? Math.min(Z, Q - (V - c.current)) : Z;
294
- G(y, z);
287
+ var D = t - (O - n.current), j = U ? Math.min(D, J - (O - c.current)) : D;
288
+ Q(x, j);
295
289
  }
296
- }, le = function() {
297
- }, q = function() {
298
- if (T || $) {
299
- var y = Date.now(), V = re(y);
300
- if (b.current = [].slice.call(arguments), x.current = o, n.current = y, V) {
301
- if (!u.current && p.current) return c.current = n.current, G(Y, t), K ? D(n.current) : d.current;
302
- if (I) return G(Y, t), D(n.current);
290
+ }, me = function() {
291
+ }, ee = function() {
292
+ if (I || q) {
293
+ var x, O = Date.now(), D = se(O);
294
+ if (b.current = [].slice.call(arguments), h.current = o, n.current = O, H && !K.current && (K.current = function() {
295
+ var j;
296
+ ((j = global.document) == null ? void 0 : j.visibilityState) === "hidden" && T.current.flush();
297
+ }, (x = global.document) == null || x.addEventListener == null || x.addEventListener("visibilitychange", K.current)), D) {
298
+ if (!u.current && p.current) return c.current = n.current, Q(B, t), F ? P(n.current) : d.current;
299
+ if (U) return Q(B, t), P(n.current);
303
300
  }
304
- return u.current || G(Y, t), d.current;
301
+ return u.current || Q(B, t), d.current;
305
302
  }
306
303
  };
307
- return q.cancel = function() {
308
- var y = u.current;
309
- y && (M ? cancelAnimationFrame(u.current) : clearTimeout(u.current)), c.current = 0, b.current = n.current = x.current = u.current = null;
310
- }, q.isPending = function() {
304
+ return ee.cancel = function() {
305
+ var x = u.current;
306
+ x && (y ? cancelAnimationFrame(u.current) : clearTimeout(u.current)), c.current = 0, b.current = n.current = h.current = u.current = null;
307
+ }, ee.isPending = function() {
311
308
  return !!u.current;
312
- }, q.flush = function() {
313
- return u.current ? X(Date.now()) : d.current;
314
- }, q;
315
- }, [K, I, t, Q, h, M, T, $, s]);
316
- return de;
309
+ }, ee.flush = function() {
310
+ return u.current ? le(Date.now()) : d.current;
311
+ }, ee;
312
+ }, [F, U, t, J, $, H, y, I, q, s]);
313
+ return T.current = ne, Y(function() {
314
+ return p.current = !0, function() {
315
+ var P;
316
+ H && T.current.flush(), K.current && ((P = global.document) == null || P.removeEventListener == null || P.removeEventListener("visibilitychange", K.current), K.current = null), p.current = !1;
317
+ };
318
+ }, [H]), ne;
317
319
  }
318
- const { withProvider: _t, withContext: W } = /* @__PURE__ */ Ot({
320
+ const { withProvider: _t, withContext: G } = /* @__PURE__ */ Vt({
319
321
  key: "combobox"
320
- }), er = /* @__PURE__ */ _t("div", "root"), tr = /* @__PURE__ */ W("div", "trigger"), rr = /* @__PURE__ */ W("div", "leadingElement"), or = /* @__PURE__ */ W("div", "content"), nr = /* @__PURE__ */ W("div", "tagGroup"), sr = /* @__PURE__ */ W("div", "input"), lr = /* @__PURE__ */ W("div", "popover"), ir = /* @__PURE__ */ W("div", "listBox"), cr = /* @__PURE__ */ W("div", "section"), ar = /* @__PURE__ */ W("div", "option"), ur = /* @__PURE__ */ W("div", "optionIndicator"), dr = /* @__PURE__ */ W("div", "optionContent"), fr = {
322
+ }), er = /* @__PURE__ */ _t("div", "root"), tr = /* @__PURE__ */ G("div", "trigger"), rr = /* @__PURE__ */ G("div", "leadingElement"), or = /* @__PURE__ */ G("div", "content"), nr = /* @__PURE__ */ G("div", "tagGroup"), sr = /* @__PURE__ */ G("div", "input"), lr = /* @__PURE__ */ G("div", "popover"), ir = /* @__PURE__ */ G("div", "listBox"), cr = /* @__PURE__ */ G("div", "section"), ar = /* @__PURE__ */ G("div", "option"), ur = /* @__PURE__ */ G("div", "optionIndicator"), dr = /* @__PURE__ */ G("div", "optionContent"), fr = {
321
323
  clearSelection: "Clear selection",
322
324
  toggleOptions: "Toggle options",
323
325
  selectedValues: "Selected values",
@@ -343,11 +345,11 @@ const { withProvider: _t, withContext: W } = /* @__PURE__ */ Ot({
343
345
  selectedValues: "Valores selecionados",
344
346
  options: "Menu de opções"
345
347
  }, br = {
346
- en: /* @__PURE__ */ he(fr),
347
- de: /* @__PURE__ */ he(mr),
348
- es: /* @__PURE__ */ he(pr),
349
- "fr-FR": /* @__PURE__ */ he(gr),
350
- "pt-BR": /* @__PURE__ */ he(yr)
348
+ en: /* @__PURE__ */ xe(fr),
349
+ de: /* @__PURE__ */ xe(mr),
350
+ es: /* @__PURE__ */ xe(pr),
351
+ "fr-FR": /* @__PURE__ */ xe(gr),
352
+ "pt-BR": /* @__PURE__ */ xe(yr)
351
353
  };
352
354
  function Ze(e) {
353
355
  if (typeof e == "string" || typeof e == "number")
@@ -369,8 +371,8 @@ function xr(e) {
369
371
  name: e
370
372
  };
371
373
  }
372
- const vr = (e) => e ? e instanceof Set ? e : new Set(Array.isArray(e) ? e : [e]) : /* @__PURE__ */ new Set(), Cr = (e) => Array.from(e), Pe = /* @__PURE__ */ Qe(null), Ae = () => {
373
- const e = Ee(Pe);
374
+ const vr = (e) => e ? e instanceof Set ? e : new Set(Array.isArray(e) ? e : [e]) : /* @__PURE__ */ new Set(), Cr = (e) => Array.from(e), Re = /* @__PURE__ */ Qe(null), Ae = () => {
375
+ const e = Pe(Re);
374
376
  if (!e)
375
377
  throw new Error(
376
378
  "Nimbus - ComboBox components must be used within ComboBox.Root"
@@ -388,17 +390,17 @@ const vr = (e) => e ? e instanceof Set ? e : new Set(Array.isArray(e) ? e : [e])
388
390
  inputValue: u
389
391
  } = e;
390
392
  if (!t) return null;
391
- const b = J(() => {
393
+ const b = _(() => {
392
394
  if (o === "single") {
393
- const x = Array.from(s)[0];
394
- return x ? n === "text" || c ? Array.from(l).find(
395
- (w) => w.key === x
396
- )?.textValue || u || "" : String(x) : "";
395
+ const h = Array.from(s)[0];
396
+ return h ? n === "text" || c ? Array.from(l).find(
397
+ (w) => w.key === h
398
+ )?.textValue || u || "" : String(h) : "";
397
399
  } else {
398
- const x = Array.from(s);
399
- return n === "text" || c ? x.map((d) => Array.from(l).find(
400
+ const h = Array.from(s);
401
+ return n === "text" || c ? h.map((d) => Array.from(l).find(
400
402
  (p) => p.key === d
401
- )?.textValue || "").filter(Boolean).join(",") : x.join(",");
403
+ )?.textValue || "").filter(Boolean).join(",") : h.join(",");
402
404
  }
403
405
  }, [
404
406
  o,
@@ -431,72 +433,72 @@ function et(e) {
431
433
  leadingElement: l,
432
434
  inputValue: u,
433
435
  onInputChange: b,
434
- isLoading: x,
436
+ isLoading: h,
435
437
  allowsEmptyMenu: d,
436
438
  renderEmptyState: w,
437
439
  async: p,
438
- filter: T,
439
- allowsCustomOptions: M = !1,
440
- isDisabled: K = !1,
441
- isInvalid: h = !1,
442
- isRequired: I = !1,
440
+ filter: K,
441
+ allowsCustomOptions: T = !1,
442
+ isDisabled: I = !1,
443
+ isInvalid: y = !1,
444
+ isRequired: F = !1,
443
445
  isReadOnly: $ = !1
444
- } = e, Q = zt({ key: "combobox" }), [de, D] = Q.splitVariantProps(e), [G, re] = ue(D), X = O(null), Y = O(null), [le, q] = U([]), y = Xt({
446
+ } = e, H = zt({ key: "combobox" }), [U, q] = H.splitVariantProps(e), [J, ne] = fe(q), P = A(null), Q = A(null), [se, le] = Z([]), B = Xt({
445
447
  getKey: o,
446
- async load({ signal: B, filterText: N }) {
448
+ async load({ signal: M, filterText: k }) {
447
449
  if (!p) return { items: [] };
448
450
  const v = p.minSearchLength ?? 0;
449
- if (!N || N.length < v)
451
+ if (!k || k.length < v)
450
452
  return { items: [] };
451
453
  try {
452
- return { items: await p.load(N, B) };
453
- } catch (A) {
454
- if (A.name === "AbortError")
455
- throw A;
456
- const _ = A;
457
- return p.onError?.(_), { items: [] };
454
+ return { items: await p.load(k, M) };
455
+ } catch (V) {
456
+ if (V.name === "AbortError")
457
+ throw V;
458
+ const te = V;
459
+ return p.onError?.(te), { items: [] };
458
460
  }
459
461
  }
460
- }), [V, Z] = U(u), [z, ve] = U(!1), [ie, fe] = U([]), Fe = p?.debounce ?? 300, Ce = Zt((B) => {
461
- ve(!1), y.setFilterText(B);
462
+ }), [me, ee] = Z(u), [x, O] = Z(!1), [D, j] = Z([]), Fe = p?.debounce ?? 300, Ce = Zt((M) => {
463
+ O(!1), B.setFilterText(M);
462
464
  }, Fe), Se = R(
463
- (B) => {
464
- Z(B), ve(!0), Ce(B);
465
+ (M) => {
466
+ ee(M), O(!0), Ce(M);
465
467
  },
466
468
  [Ce]
467
- ), P = p ? V : u, we = p ? Se : b, j = p ? z || y.loadingState === "loading" || y.loadingState === "loadingMore" || y.loadingState === "filtering" : x, $e = p || M ? !0 : d, Ke = R(() => j ? P?.length ? `loading results for "${P}"` : "loading results" : P?.length && p?.minSearchLength && P.length >= p.minSearchLength ? `no results for "${P}"` : p?.minSearchLength ? `enter at least ${p?.minSearchLength} characters` : "type to search", [p?.minSearchLength, j, P]), Ie = R(() => j ? P?.length ? `loading results for "${P}"` : "loading results" : 'hit "enter" to create an option', [j, P]), pe = (M ? Ie : p ? Ke : void 0) ?? w, ce = J(() => {
468
- const B = p ? Array.from(y.items) : e.items, N = B ? Array.from(B) : [], v = new Set(N.map((oe) => o(oe)));
469
- let _ = [...le.filter(
470
- (oe) => !v.has(o(oe))
471
- ), ...N];
472
- if (p && r === "multiple" && ie.length > 0) {
473
- const oe = new Set(_.map((F) => o(F)));
474
- _ = [...ie.filter(
475
- (F) => !oe.has(o(F))
476
- ), ..._];
469
+ ), z = p ? me : u, we = p ? Se : b, X = p ? x || B.loadingState === "loading" || B.loadingState === "loadingMore" || B.loadingState === "filtering" : h, $e = p || T ? !0 : d, Ke = R(() => X ? z?.length ? `loading results for "${z}"` : "loading results" : z?.length && p?.minSearchLength && z.length >= p.minSearchLength ? `no results for "${z}"` : p?.minSearchLength ? `enter at least ${p?.minSearchLength} characters` : "type to search", [p?.minSearchLength, X, z]), Ie = R(() => X ? z?.length ? `loading results for "${z}"` : "loading results" : 'hit "enter" to create an option', [X, z]), ge = (T ? Ie : p ? Ke : void 0) ?? w, ue = _(() => {
470
+ const M = p ? Array.from(B.items) : e.items, k = M ? Array.from(M) : [], v = new Set(k.map((ie) => o(ie)));
471
+ let te = [...se.filter(
472
+ (ie) => !v.has(o(ie))
473
+ ), ...k];
474
+ if (p && r === "multiple" && D.length > 0) {
475
+ const ie = new Set(te.map((L) => o(L)));
476
+ te = [...D.filter(
477
+ (L) => !ie.has(o(L))
478
+ ), ...te];
477
479
  }
478
- return _;
480
+ return te;
479
481
  }, [
480
482
  p,
481
- y.items,
483
+ B.items,
482
484
  e.items,
483
- le,
484
- ie,
485
+ se,
486
+ D,
485
487
  r,
486
488
  o
487
- ]), ge = J(
489
+ ]), ye = _(
488
490
  () => ({
489
491
  selectionMode: r,
490
492
  size: s,
491
493
  getKey: o,
492
494
  getTextValue: n,
493
495
  leadingElement: l,
494
- triggerRef: X,
495
- inputRef: Y,
496
- isLoading: j,
497
- isDisabled: K,
498
- isRequired: I,
499
- isInvalid: h,
496
+ triggerRef: P,
497
+ inputRef: Q,
498
+ isLoading: X,
499
+ isDisabled: I,
500
+ isRequired: F,
501
+ isInvalid: y,
500
502
  isReadOnly: $
501
503
  }),
502
504
  [
@@ -504,96 +506,96 @@ function et(e) {
504
506
  o,
505
507
  n,
506
508
  l,
507
- X,
508
- Y,
509
- K,
509
+ P,
510
+ Q,
510
511
  I,
511
- h,
512
+ F,
513
+ y,
512
514
  $
513
515
  ]
514
- ), ye = J(() => {
515
- if (ce)
516
- return Array.from(ce).map((B) => {
517
- const N = "id" in B, v = "textValue" in B;
518
- return N && v ? B : {
519
- ...B,
520
- ...N ? {} : { id: o(B) },
521
- ...v ? {} : { textValue: n(B) }
516
+ ), be = _(() => {
517
+ if (ue)
518
+ return Array.from(ue).map((M) => {
519
+ const k = "id" in M, v = "textValue" in M;
520
+ return k && v ? M : {
521
+ ...M,
522
+ ...k ? {} : { id: o(M) },
523
+ ...v ? {} : { textValue: n(M) }
522
524
  };
523
525
  });
524
- }, [ce, o, n]), Te = J(
526
+ }, [ue, o, n]), Oe = _(
525
527
  () => /* @__PURE__ */ g(
526
- Pe.Provider,
528
+ Re.Provider,
527
529
  {
528
- value: ge,
529
- children: /* @__PURE__ */ g(Xe.Provider, { value: { items: ye }, children: typeof c == "function" ? c({
530
+ value: ye,
531
+ children: /* @__PURE__ */ g(Xe.Provider, { value: { items: be }, children: typeof c == "function" ? c({
530
532
  isOpen: !1,
531
- isDisabled: K,
532
- isInvalid: h,
533
- isRequired: I,
533
+ isDisabled: I,
534
+ isInvalid: y,
535
+ isRequired: F,
534
536
  defaultChildren: null
535
537
  }) : c })
536
538
  }
537
539
  ),
538
540
  [
539
541
  c,
540
- K,
541
- h,
542
542
  I,
543
- ye,
544
- ge
543
+ y,
544
+ F,
545
+ be,
546
+ ye
545
547
  ]
546
548
  );
547
549
  return /* @__PURE__ */ g(
548
550
  Ye,
549
551
  {
550
552
  values: [
551
- [Re, {}],
553
+ [Ee, {}],
552
554
  [Me, {}],
553
555
  [De, {}]
554
556
  ],
555
557
  children: /* @__PURE__ */ g(
556
- Pe.Provider,
558
+ Re.Provider,
557
559
  {
558
- value: ge,
560
+ value: ye,
559
561
  children: /* @__PURE__ */ g(
560
562
  er,
561
563
  {
562
564
  ref: t,
563
- ...de,
564
- ...G,
565
+ ...U,
566
+ ...J,
565
567
  size: s,
566
- "data-disabled": K,
567
- "data-invalid": h,
568
- "data-required": I,
568
+ "data-disabled": I,
569
+ "data-invalid": y,
570
+ "data-required": F,
569
571
  "data-readonly": $,
570
572
  "data-open": e.isOpen,
571
573
  role: "group",
572
- children: /* @__PURE__ */ g(Ft, { content: Te, children: (B) => (
574
+ children: /* @__PURE__ */ g(Ft, { content: Oe, children: (M) => (
573
575
  // Pass the built collection to ComboBoxRootInner which handles all behavior
574
576
  /* @__PURE__ */ g(
575
577
  Sr,
576
578
  {
577
- ...re,
579
+ ...ne,
578
580
  size: s,
579
- filter: T,
581
+ filter: K,
580
582
  selectionMode: r,
581
- inputValue: P,
583
+ inputValue: z,
582
584
  onInputChange: we,
583
585
  getKey: o,
584
586
  getTextValue: n,
585
587
  allowsEmptyMenu: $e,
586
- renderEmptyState: pe,
587
- isDisabled: K,
588
- isRequired: I,
589
- isInvalid: h,
588
+ renderEmptyState: ge,
589
+ isDisabled: I,
590
+ isRequired: F,
591
+ isInvalid: y,
590
592
  isReadOnly: $,
591
- collection: B,
592
- allowsCustomOptions: M,
593
+ collection: M,
594
+ allowsCustomOptions: T,
593
595
  asyncConfig: p,
594
- onAsyncSelectedItemsChange: p && r === "multiple" ? fe : void 0,
595
- onAddCustomItem: q,
596
- onAddAsyncSelectedItem: fe
596
+ onAsyncSelectedItemsChange: p && r === "multiple" ? j : void 0,
597
+ onAddCustomItem: le,
598
+ onAddAsyncSelectedItem: j
597
599
  }
598
600
  )
599
601
  ) })
@@ -615,110 +617,110 @@ const Sr = (e) => {
615
617
  selectedKeys: l = [],
616
618
  onSelectionChange: u,
617
619
  disabledKeys: b,
618
- inputValue: x = "",
620
+ inputValue: h = "",
619
621
  onInputChange: d,
620
622
  filter: w,
621
623
  placeholder: p,
622
- menuTrigger: T = "input",
623
- shouldCloseOnBlur: M = !0,
624
- shouldCloseOnSelect: K = !0,
625
- isOpen: h,
626
- defaultOpen: I = !1,
624
+ menuTrigger: K = "input",
625
+ shouldCloseOnBlur: T = !0,
626
+ shouldCloseOnSelect: I = !0,
627
+ isOpen: y,
628
+ defaultOpen: F = !1,
627
629
  onOpenChange: $,
628
- allowsEmptyMenu: Q = !1,
629
- renderEmptyState: de,
630
- allowsCustomOptions: D = !1,
631
- isValidNewOption: G,
632
- getNewOptionData: re = xr,
633
- onCreateOption: X,
634
- "aria-label": Y,
635
- "aria-labelledby": le,
636
- "aria-describedby": q,
637
- isDisabled: y = !1,
638
- isRequired: V = !1,
639
- isInvalid: Z = !1,
640
- isReadOnly: z = !1,
641
- shouldFocusWrap: ve = !0,
642
- autoFocus: ie = !1,
643
- name: fe,
630
+ allowsEmptyMenu: H = !1,
631
+ renderEmptyState: U,
632
+ allowsCustomOptions: q = !1,
633
+ isValidNewOption: J,
634
+ getNewOptionData: ne = xr,
635
+ onCreateOption: P,
636
+ "aria-label": Q,
637
+ "aria-labelledby": se,
638
+ "aria-describedby": le,
639
+ isDisabled: B = !1,
640
+ isRequired: me = !1,
641
+ isInvalid: ee = !1,
642
+ isReadOnly: x = !1,
643
+ shouldFocusWrap: O = !0,
644
+ autoFocus: D = !1,
645
+ name: j,
644
646
  formValue: Fe,
645
647
  validationBehavior: Ce = "aria",
646
648
  form: Se,
647
- validate: P,
649
+ validate: z,
648
650
  isLoading: we,
649
- asyncConfig: j,
651
+ asyncConfig: X,
650
652
  onAsyncSelectedItemsChange: $e,
651
653
  onAddCustomItem: Ke,
652
654
  onAddAsyncSelectedItem: Ie
653
- } = e, me = Je(), pe = Je(), ce = O(null), ge = O(null), ye = J(
655
+ } = e, pe = Je(), ge = Je(), ue = A(null), ye = A(null), be = _(
654
656
  () => vr(l),
655
657
  [l]
656
- ), Te = !!u, [B, N] = U(
657
- ye
658
- ), v = Te ? ye : B, A = d !== void 0, _ = () => {
659
- if (x) return x;
660
- if (A || r !== "single") return "";
658
+ ), Oe = !!u, [M, k] = Z(
659
+ be
660
+ ), v = Oe ? be : M, V = d !== void 0, te = () => {
661
+ if (h) return h;
662
+ if (V || r !== "single") return "";
661
663
  const i = Array.from(v);
662
664
  if (i.length === 0) return "";
663
665
  const a = i[0];
664
666
  return o.getItem(a)?.textValue ?? "";
665
- }, [oe, ee] = U(
666
- _
667
- ), F = A ? x : oe, te = O(F), [at, ze] = U(I), C = h ?? at, [Oe, be] = U(
667
+ }, [ie, re] = Z(
668
+ te
669
+ ), L = V ? h : ie, oe = A(L), [at, ze] = Z(F), C = y ?? at, [Ve, he] = Z(
668
670
  null
669
- ), L = R(
671
+ ), E = R(
670
672
  (i) => {
671
- h === void 0 && ze(i), $?.(i);
673
+ y === void 0 && ze(i), $?.(i);
672
674
  },
673
- [h, $]
674
- ), ut = J(() => {
675
- if (F.trim() === "")
675
+ [y, $]
676
+ ), ut = _(() => {
677
+ if (L.trim() === "")
676
678
  return o;
677
679
  if (r === "single") {
678
680
  const a = Array.from(v);
679
681
  if (a.length > 0) {
680
682
  const f = a[0];
681
- if (o.getItem(f)?.textValue === F)
683
+ if (o.getItem(f)?.textValue === L)
682
684
  return o;
683
685
  }
684
686
  }
685
687
  if (w) {
686
- const a = Array.from(o), f = Array.from(w(a, F)), S = new Set(f.map((Be) => Be.key));
687
- return o.filter?.((Be, Ve) => S.has(Ve.key)) ?? o;
688
+ const a = Array.from(o), f = Array.from(w(a, L)), S = new Set(f.map((Be) => Be.key));
689
+ return o.filter?.((Be, Le) => S.has(Le.key)) ?? o;
688
690
  }
689
- const i = F.toLowerCase();
691
+ const i = L.toLowerCase();
690
692
  return o.filter?.((a) => a.toLowerCase().includes(i)) ?? o;
691
- }, [o, F, w, r, v]), dt = J(
693
+ }, [o, L, w, r, v]), dt = _(
692
694
  () => r === "multiple" ? Array.from(v).map((i) => o.getItem(i)?.value).filter((i) => i !== void 0) : [],
693
695
  [r, v, o]
694
- ), [ft, mt] = U(null), pt = R(() => {
695
- const i = h === void 0 ? !C : !h;
696
- h === void 0 ? ze((a) => !a) : $?.(!h), i && (ne.current?.focus(), be("first"));
697
- }, [h, C, $]), gt = R(
696
+ ), [ft, mt] = Z(null), pt = R(() => {
697
+ const i = y === void 0 ? !C : !y;
698
+ y === void 0 ? ze((a) => !a) : $?.(!y), i && (ce.current?.focus(), he("first"));
699
+ }, [y, C, $]), gt = R(
698
700
  (i) => {
699
- A || ee(i), d?.(i), T === "input" && i !== te.current && L(!0), te.current = i;
701
+ V || re(i), d?.(i), K === "input" && i !== oe.current && E(!0), oe.current = i;
700
702
  },
701
- [A, d, T, L]
702
- ), k = R(
703
+ [V, d, K, E]
704
+ ), W = R(
703
705
  (i, a) => {
704
- let f = i === "all" ? new Set(Array.from(o).map((E) => E.key)) : i;
705
- const S = a ?? v, Be = f.size > 0 && Array.from(f).every((E) => S.has(E)) && f.size < S.size;
706
+ let f = i === "all" ? new Set(Array.from(o).map((N) => N.key)) : i;
707
+ const S = a ?? v, Be = f.size > 0 && Array.from(f).every((N) => S.has(N)) && f.size < S.size;
706
708
  if (r === "multiple" && f.size === 1 && !Be) {
707
- const E = Array.from(f)[0], ae = S.has(E), se = new Set(S);
708
- ae ? se.delete(E) : se.add(E), f = se;
709
+ const N = Array.from(f)[0], de = S.has(N), ae = new Set(S);
710
+ de ? ae.delete(N) : ae.add(N), f = ae;
709
711
  }
710
- const Ve = Cr(f);
711
- if (u ? u(Ve) : N(f), j && r === "multiple" && $e) {
712
- const E = Array.from(f).map((ae) => o.getItem(ae)?.value).filter((ae) => ae !== void 0);
713
- $e(E);
712
+ const Le = Cr(f);
713
+ if (u ? u(Le) : k(f), X && r === "multiple" && $e) {
714
+ const N = Array.from(f).map((de) => o.getItem(de)?.value).filter((de) => de !== void 0);
715
+ $e(N);
714
716
  }
715
717
  if (r === "single") {
716
- const E = Array.from(f)[0];
717
- if (E !== null) {
718
- const se = o.getItem(E)?.textValue ?? "";
719
- A || (ee(se), te.current = se), d?.(se);
718
+ const N = Array.from(f)[0];
719
+ if (N !== null) {
720
+ const ae = o.getItem(N)?.textValue ?? "";
721
+ V || (re(ae), oe.current = ae), d?.(ae);
720
722
  }
721
- K && L(!1);
723
+ I && E(!1);
722
724
  }
723
725
  },
724
726
  [
@@ -727,73 +729,73 @@ const Sr = (e) => {
727
729
  v,
728
730
  u,
729
731
  d,
730
- K,
731
- L,
732
- A
732
+ I,
733
+ E,
734
+ V
733
735
  ]
734
736
  ), m = Jt({
735
737
  selectionMode: r,
736
738
  collection: ut,
737
739
  selectedKeys: v,
738
- onSelectionChange: k,
740
+ onSelectionChange: W,
739
741
  disabledKeys: b
740
742
  }), yt = R(() => {
741
- m.selectionManager.setSelectedKeys(/* @__PURE__ */ new Set()), r === "single" && (A || (ee(""), te.current = ""), d?.(""));
742
- }, [m.selectionManager, r, A, d]), Ne = R(
743
+ m.selectionManager.setSelectedKeys(/* @__PURE__ */ new Set()), r === "single" && (V || (re(""), oe.current = ""), d?.(""));
744
+ }, [m.selectionManager, r, V, d]), Ne = R(
743
745
  (i) => {
744
- Ke?.((S) => [...S, i]), j && r === "multiple" && Ie?.((S) => [...S, i]);
746
+ Ke?.((S) => [...S, i]), X && r === "multiple" && Ie?.((S) => [...S, i]);
745
747
  const a = n(i), f = v;
746
748
  if (r === "single")
747
- k(/* @__PURE__ */ new Set([a]), f);
749
+ W(/* @__PURE__ */ new Set([a]), f);
748
750
  else {
749
751
  const S = new Set(f);
750
- S.add(a), k(S, f);
752
+ S.add(a), W(S, f);
751
753
  }
752
754
  },
753
755
  [
754
756
  Ke,
755
- j,
757
+ X,
756
758
  r,
757
759
  Ie,
758
760
  n,
759
761
  v,
760
- k
762
+ W
761
763
  ]
762
764
  ), ke = R(() => {
763
- if (!D) return !1;
764
- const i = F.trim();
765
+ if (!q) return !1;
766
+ const i = L.trim();
765
767
  if (!i || Array.from(o).some(
766
768
  (S) => S.textValue?.toLowerCase() === i.toLowerCase()
767
- ) || G && !G(i))
769
+ ) || J && !J(i))
768
770
  return !1;
769
- const f = re(i);
770
- return Ne(f), r === "multiple" ? (A || (ee(""), te.current = ""), d?.("")) : (A || (ee(i), te.current = i), d?.(i)), X?.(f), !0;
771
+ const f = ne(i);
772
+ return Ne(f), r === "multiple" ? (V || (re(""), oe.current = ""), d?.("")) : (V || (re(i), oe.current = i), d?.(i)), P?.(f), !0;
771
773
  }, [
772
- D,
773
- re,
774
- G,
775
- F,
774
+ q,
775
+ ne,
776
+ J,
777
+ L,
776
778
  o,
777
779
  r,
778
780
  d,
779
- X,
781
+ P,
780
782
  Ne,
781
- A,
782
- ee,
783
- te
783
+ V,
784
+ re,
785
+ oe
784
786
  ]), bt = R(
785
787
  (i) => {
786
- if (y || z) return;
788
+ if (B || x) return;
787
789
  const a = v, f = new Set(a);
788
- i.forEach((S) => f.delete(S)), k(f, a), f.size === 0 && ne.current?.focus();
790
+ i.forEach((S) => f.delete(S)), W(f, a), f.size === 0 && ce.current?.focus();
789
791
  },
790
- [v, k, y, z]
792
+ [v, W, B, x]
791
793
  ), ht = R(
792
794
  (i) => {
793
795
  switch (i.key) {
794
796
  case "ArrowDown":
795
797
  if (i.preventDefault(), !C)
796
- L(!0), be("first");
798
+ E(!0), he("first");
797
799
  else {
798
800
  const a = m.selectionManager.focusedKey, f = a ? m.collection.getKeyAfter(a) : m.collection.getFirstKey();
799
801
  m.selectionManager.setFocusedKey(
@@ -803,7 +805,7 @@ const Sr = (e) => {
803
805
  break;
804
806
  case "ArrowUp":
805
807
  if (i.preventDefault(), !C)
806
- L(!0), be("last");
808
+ E(!0), he("last");
807
809
  else {
808
810
  const a = m.selectionManager.focusedKey, f = a ? m.collection.getKeyBefore(a) : m.collection.getLastKey();
809
811
  m.selectionManager.setFocusedKey(
@@ -817,13 +819,13 @@ const Sr = (e) => {
817
819
  const a = m.selectionManager.focusedKey;
818
820
  if (r === "multiple") {
819
821
  const f = new Set(v);
820
- f.has(a) ? f.delete(a) : f.add(a), k(f);
822
+ f.has(a) ? f.delete(a) : f.add(a), W(f);
821
823
  } else
822
- k(/* @__PURE__ */ new Set([a])), m.selectionManager.setFocusedKey(null);
823
- } else C && !m.selectionManager.focusedKey && D && ke() && i.preventDefault();
824
+ W(/* @__PURE__ */ new Set([a])), m.selectionManager.setFocusedKey(null);
825
+ } else C && !m.selectionManager.focusedKey && q && ke() && i.preventDefault();
824
826
  break;
825
827
  case "Escape":
826
- C && (i.preventDefault(), L(!1), m.selectionManager.setFocusedKey(null));
828
+ C && (i.preventDefault(), E(!1), m.selectionManager.setFocusedKey(null));
827
829
  break;
828
830
  case "Home":
829
831
  if (C) {
@@ -840,14 +842,14 @@ const Sr = (e) => {
840
842
  }
841
843
  break;
842
844
  case "Backspace":
843
- if (F === "") {
845
+ if (L === "") {
844
846
  const a = Array.from(v);
845
847
  if (a.length > 0)
846
848
  if (i.preventDefault(), r === "single")
847
- k(/* @__PURE__ */ new Set());
849
+ W(/* @__PURE__ */ new Set());
848
850
  else {
849
851
  const f = new Set(a);
850
- f.delete(a[a.length - 1]), k(f);
852
+ f.delete(a[a.length - 1]), W(f);
851
853
  }
852
854
  }
853
855
  break;
@@ -857,42 +859,42 @@ const Sr = (e) => {
857
859
  C,
858
860
  m.selectionManager,
859
861
  m.collection,
860
- k,
861
- L,
862
- be,
862
+ W,
863
+ E,
864
+ he,
863
865
  r,
864
- F,
866
+ L,
865
867
  v,
866
- D,
868
+ q,
867
869
  ke
868
870
  ]
869
871
  ), xt = R(() => {
870
- T === "focus" && !y && !z && L(!0), r === "single" && F && ne.current && ne.current.select();
872
+ K === "focus" && !B && !x && E(!0), r === "single" && L && ce.current && ce.current.select();
871
873
  }, [
872
- T,
873
- y,
874
- z,
875
- L,
874
+ K,
875
+ B,
876
+ x,
877
+ E,
876
878
  r,
877
- F
879
+ L
878
880
  ]), vt = R(
879
881
  (i) => {
880
- if (!M) return;
882
+ if (!T) return;
881
883
  const a = i.currentTarget;
882
884
  setTimeout(() => {
883
885
  const f = document.activeElement;
884
- a.contains(f) || L(!1);
886
+ a.contains(f) || E(!1);
885
887
  }, 150);
886
888
  },
887
- [M, L]
888
- ), We = O(null);
889
- H(() => {
890
- ie && ne.current && !y && ne.current.focus();
891
- }, [ie, y]);
892
- const Ge = O(C);
893
- H(() => {
894
- h === void 0 && Ge.current !== C && (Ge.current = C, $?.(C));
895
- }, [C, h, $]), H(() => {
889
+ [T, E]
890
+ ), We = A(null);
891
+ Y(() => {
892
+ D && ce.current && !B && ce.current.focus();
893
+ }, [D, B]);
894
+ const Ge = A(C);
895
+ Y(() => {
896
+ y === void 0 && Ge.current !== C && (Ge.current = C, $?.(C));
897
+ }, [C, y, $]), Y(() => {
896
898
  if (r !== "single") return;
897
899
  const i = Array.from(m.selectionManager.selectedKeys), a = i.length > 0 ? i[0] : null;
898
900
  if (a === We.current) return;
@@ -901,35 +903,35 @@ const Sr = (e) => {
901
903
  if (a !== null && !f)
902
904
  return;
903
905
  const S = f?.textValue ?? "";
904
- A ? d?.(S) : (ee(S), te.current = S);
906
+ V ? d?.(S) : (re(S), oe.current = S);
905
907
  }, [
906
908
  r,
907
909
  m.selectionManager.selectedKeys,
908
910
  m.collection,
909
- A,
911
+ V,
910
912
  d
911
- ]), H(() => {
912
- if (C && Oe) {
913
- const i = Oe === "first" ? m.collection.getFirstKey() : m.collection.getLastKey();
914
- m.selectionManager.setFocusedKey(i ?? null), be(null);
913
+ ]), Y(() => {
914
+ if (C && Ve) {
915
+ const i = Ve === "first" ? m.collection.getFirstKey() : m.collection.getLastKey();
916
+ m.selectionManager.setFocusedKey(i ?? null), he(null);
915
917
  }
916
- }, [C, Oe, m.collection, m.selectionManager]), H(() => {
918
+ }, [C, Ve, m.collection, m.selectionManager]), Y(() => {
917
919
  C ? m.selectionManager.setFocused(!0) : (m.selectionManager.setFocused(!1), m.selectionManager.setFocusedKey(null));
918
920
  }, [C, m.selectionManager]);
919
- const qe = O(!1);
920
- m.collection.size > 0 && (qe.current = !0), H(() => {
921
- if (!C || Q || we || !qe.current) return;
922
- m.collection.size > 0 || L(!1);
921
+ const qe = A(!1);
922
+ m.collection.size > 0 && (qe.current = !0), Y(() => {
923
+ if (!C || H || we || !qe.current) return;
924
+ m.collection.size > 0 || E(!1);
923
925
  }, [
924
926
  C,
925
- Q,
927
+ H,
926
928
  we,
927
929
  m.collection.size,
928
- L,
929
- F
930
+ E,
931
+ L
930
932
  ]);
931
- const { triggerRef: je, inputRef: ne } = Ae();
932
- H(() => {
933
+ const { triggerRef: je, inputRef: ce } = Ae();
934
+ Y(() => {
933
935
  const i = je.current;
934
936
  if (!i) return;
935
937
  const a = () => {
@@ -948,33 +950,33 @@ const Sr = (e) => {
948
950
  [
949
951
  Me,
950
952
  {
951
- ref: ne,
953
+ ref: ce,
952
954
  role: "combobox",
953
955
  // ARIA role for autocomplete input
954
956
  "aria-autocomplete": "list",
955
957
  // Indicates suggestions are in a list
956
- "aria-controls": r === "multiple" ? `${pe} ${me}` : me,
958
+ "aria-controls": r === "multiple" ? `${ge} ${pe}` : pe,
957
959
  // Single-select: controls only listbox
958
960
  "aria-expanded": C,
959
961
  // Announces menu open/closed state
960
- "aria-activedescendant": m.selectionManager.focusedKey ? `${me}-option-${m.selectionManager.focusedKey}` : void 0,
961
- "aria-describedby": r === "multiple" ? `${pe} ${q ?? ""}` : q,
962
- "aria-label": Y,
963
- "aria-labelledby": le,
964
- value: F,
962
+ "aria-activedescendant": m.selectionManager.focusedKey ? `${pe}-option-${m.selectionManager.focusedKey}` : void 0,
963
+ "aria-describedby": r === "multiple" ? `${ge} ${le ?? ""}` : le,
964
+ "aria-label": Q,
965
+ "aria-labelledby": se,
966
+ value: L,
965
967
  onChange: (i) => gt(i.target.value),
966
968
  onKeyDown: ht,
967
969
  onFocus: xt,
968
970
  onBlur: vt,
969
- disabled: y,
970
- readOnly: z,
971
- required: V,
972
- "aria-invalid": Z,
971
+ disabled: B,
972
+ readOnly: x,
973
+ required: me,
974
+ "aria-invalid": ee,
973
975
  placeholder: p,
974
- name: fe,
976
+ name: j,
975
977
  form: Se,
976
978
  validationbehavior: Ce,
977
- validate: P
979
+ validate: z
978
980
  }
979
981
  ],
980
982
  // TagGroupContext: Props for ComboBox.TagGroup component (multi-select only)
@@ -982,7 +984,7 @@ const Sr = (e) => {
982
984
  [
983
985
  De,
984
986
  {
985
- id: pe,
987
+ id: ge,
986
988
  "aria-label": t.format("selectedValues"),
987
989
  items: dt,
988
990
  // Selected items to display as tags
@@ -993,13 +995,13 @@ const Sr = (e) => {
993
995
  // ButtonContext: Props for toggle and clear buttons
994
996
  // Uses "slots" pattern to configure multiple buttons via single context
995
997
  [
996
- Re,
998
+ Ee,
997
999
  {
998
1000
  slots: {
999
1001
  toggle: {
1000
1002
  onPress: pt,
1001
1003
  "aria-label": t.format("toggleOptions"),
1002
- isDisabled: y || z,
1004
+ isDisabled: B || x,
1003
1005
  isPressed: C
1004
1006
  // Visual indicator that menu is open
1005
1007
  },
@@ -1007,7 +1009,7 @@ const Sr = (e) => {
1007
1009
  onPress: yt,
1008
1010
  "aria-label": t.format("clearSelection"),
1009
1011
  style: v.size > 0 ? void 0 : { display: "none" },
1010
- isDisabled: y || z || m.selectionManager.selectedKeys.size === 0
1012
+ isDisabled: B || x || m.selectionManager.selectedKeys.size === 0
1011
1013
  // Disabled when nothing selected
1012
1014
  }
1013
1015
  }
@@ -1022,10 +1024,10 @@ const Sr = (e) => {
1022
1024
  // No-op onOpenChange: We control state internally, prevent React Aria from managing its own state
1023
1025
  onOpenChange: () => {
1024
1026
  },
1025
- ref: ge,
1027
+ ref: ye,
1026
1028
  triggerRef: je,
1027
1029
  // Popover positions relative to this element
1028
- scrollRef: ce,
1030
+ scrollRef: ue,
1029
1031
  // Enables scroll-into-view for keyboard navigation
1030
1032
  isNonModal: !0,
1031
1033
  // Non-modal: doesn't trap focus, allows interaction outside
@@ -1040,7 +1042,7 @@ const Sr = (e) => {
1040
1042
  clearContexts: [
1041
1043
  // Clear these contexts so popover content doesn't inherit combobox contexts
1042
1044
  Gt,
1043
- Re,
1045
+ Ee,
1044
1046
  Me,
1045
1047
  Wt,
1046
1048
  jt
@@ -1057,13 +1059,13 @@ const Sr = (e) => {
1057
1059
  {
1058
1060
  items: s,
1059
1061
  // Items to render (merged from outer component)
1060
- id: me,
1062
+ id: pe,
1061
1063
  // ID referenced by aria-controls on input
1062
- ref: ce,
1064
+ ref: ue,
1063
1065
  // Ref for scroll positioning
1064
- renderEmptyState: de,
1066
+ renderEmptyState: U,
1065
1067
  // Custom empty state renderer
1066
- shouldFocusWrap: ve,
1068
+ shouldFocusWrap: O,
1067
1069
  // Whether to wrap focus from last to first item
1068
1070
  "aria-label": t.format("options")
1069
1071
  }
@@ -1071,7 +1073,7 @@ const Sr = (e) => {
1071
1073
  // ListStateContext: React Aria's collection state for managing selection and focus
1072
1074
  [It, m]
1073
1075
  ];
1074
- return /* @__PURE__ */ xe(
1076
+ return /* @__PURE__ */ ve(
1075
1077
  Ye,
1076
1078
  {
1077
1079
  values: Ct,
@@ -1079,14 +1081,14 @@ const Sr = (e) => {
1079
1081
  /* @__PURE__ */ g(
1080
1082
  _e,
1081
1083
  {
1082
- name: fe,
1084
+ name: j,
1083
1085
  form: Se,
1084
1086
  selectedKeys: v,
1085
1087
  selectionMode: r,
1086
1088
  formValue: Fe,
1087
- allowsCustomOptions: D,
1089
+ allowsCustomOptions: q,
1088
1090
  collection: m.collection,
1089
- inputValue: F
1091
+ inputValue: L
1090
1092
  }
1091
1093
  ),
1092
1094
  c
@@ -1094,7 +1096,7 @@ const Sr = (e) => {
1094
1096
  }
1095
1097
  );
1096
1098
  }, tt = (e) => {
1097
- const [t, r] = ue(e), s = Ee(Me), { inputRef: o } = Ae();
1099
+ const [t, r] = fe(e), s = Pe(Me), { inputRef: o } = Ae();
1098
1100
  let n = "", c = "";
1099
1101
  s && typeof s == "object" && "value" in s && (n = s.value || "", c = s.placeholder || "");
1100
1102
  const l = Math.max(n.length || c.length || 1, 1);
@@ -1112,11 +1114,11 @@ tt.displayName = "ComboBox.Input";
1112
1114
  const wr = ({
1113
1115
  children: e
1114
1116
  }) => /* @__PURE__ */ g(rr, { children: e }), rt = (e) => {
1115
- const { selectionMode: t, size: r, getKey: s, getTextValue: o, isDisabled: n, isReadOnly: c } = Ae(), [l, u] = ue(e), b = Ee(De), x = (b && "items" in b ? b.items : void 0) ?? [];
1116
- return t !== "multiple" ? null : /* @__PURE__ */ g(nr, { ...l, ...u, asChild: !0, children: /* @__PURE__ */ g(Le.Root, { size: r, children: /* @__PURE__ */ g(Le.TagList, { items: x, display: "contents", children: (d) => {
1117
+ const { selectionMode: t, size: r, getKey: s, getTextValue: o, isDisabled: n, isReadOnly: c } = Ae(), [l, u] = fe(e), b = Pe(De), h = (b && "items" in b ? b.items : void 0) ?? [];
1118
+ return t !== "multiple" ? null : /* @__PURE__ */ g(nr, { ...l, ...u, asChild: !0, children: /* @__PURE__ */ g(Te.Root, { size: r, children: /* @__PURE__ */ g(Te.TagList, { items: h, display: "contents", children: (d) => {
1117
1119
  const w = s(d), p = o(d);
1118
1120
  return /* @__PURE__ */ g(
1119
- Le.Tag,
1121
+ Te.Tag,
1120
1122
  {
1121
1123
  id: w,
1122
1124
  textValue: p,
@@ -1133,11 +1135,11 @@ const ot = ({
1133
1135
  ...t
1134
1136
  }) => {
1135
1137
  const { triggerRef: r, leadingElement: s, inputRef: o, isLoading: n, isDisabled: c } = Ae();
1136
- return /* @__PURE__ */ xe(tr, { ref: r, onClick: (u) => {
1138
+ return /* @__PURE__ */ ve(tr, { ref: r, onClick: (u) => {
1137
1139
  !c && u.target instanceof HTMLElement && !u.target.closest("button") && o.current?.focus();
1138
1140
  }, ...t, children: [
1139
1141
  s && /* @__PURE__ */ g(wr, { children: s }),
1140
- /* @__PURE__ */ xe(or, { children: [
1142
+ /* @__PURE__ */ ve(or, { children: [
1141
1143
  /* @__PURE__ */ g(rt, {}),
1142
1144
  /* @__PURE__ */ g(tt, {})
1143
1145
  ] }),
@@ -1148,7 +1150,7 @@ const ot = ({
1148
1150
  size: "2xs",
1149
1151
  variant: "ghost",
1150
1152
  colorPalette: "primary",
1151
- children: /* @__PURE__ */ g(Vt, {})
1153
+ children: /* @__PURE__ */ g(Lt, {})
1152
1154
  }
1153
1155
  ),
1154
1156
  /* @__PURE__ */ g(
@@ -1159,7 +1161,7 @@ const ot = ({
1159
1161
  variant: "ghost",
1160
1162
  colorPalette: "neutral",
1161
1163
  excludeFromTabOrder: !0,
1162
- children: n ? /* @__PURE__ */ g(Et, { size: "xs", margin: "50" }) : /* @__PURE__ */ g(Lt, {})
1164
+ children: n ? /* @__PURE__ */ g(Pt, { size: "xs", margin: "50" }) : /* @__PURE__ */ g(Tt, {})
1163
1165
  }
1164
1166
  ),
1165
1167
  e
@@ -1171,9 +1173,9 @@ const nt = ({
1171
1173
  ref: t,
1172
1174
  ...r
1173
1175
  }) => {
1174
- const [s, o] = ue(r);
1176
+ const [s, o] = fe(r);
1175
1177
  return /* @__PURE__ */ g(lr, { asChild: !0, ...s, children: /* @__PURE__ */ g(
1176
- Pt,
1178
+ Rt,
1177
1179
  {
1178
1180
  ref: t,
1179
1181
  isNonModal: !0,
@@ -1189,7 +1191,7 @@ function st({
1189
1191
  ref: t,
1190
1192
  ...r
1191
1193
  }) {
1192
- const [s, o] = ue(r);
1194
+ const [s, o] = fe(r);
1193
1195
  return /* @__PURE__ */ g(ir, { ...s, ref: t, asChild: !0, children: /* @__PURE__ */ g(Bt, { ...o, children: typeof e == "function" ? (c) => {
1194
1196
  const l = e(c), u = c;
1195
1197
  return wt(l) && (u.id || u.textValue) ? $t(
@@ -1208,13 +1210,13 @@ function lt({
1208
1210
  ref: t,
1209
1211
  ...r
1210
1212
  }) {
1211
- const [s, o] = ue(r);
1213
+ const [s, o] = fe(r);
1212
1214
  return /* @__PURE__ */ g(ar, { ...s, asChild: !0, children: /* @__PURE__ */ g(Mt, { ref: t, ...o, children: (n) => {
1213
1215
  const c = typeof e == "function" ? e({
1214
1216
  ...n
1215
1217
  }) : e;
1216
- return n.selectionMode === "multiple" ? /* @__PURE__ */ xe(He, { children: [
1217
- /* @__PURE__ */ g(ur, { children: /* @__PURE__ */ g("span", { "data-selected": n.isSelected, children: n.isSelected && /* @__PURE__ */ g(Rt, {}) }) }),
1218
+ return n.selectionMode === "multiple" ? /* @__PURE__ */ ve(He, { children: [
1219
+ /* @__PURE__ */ g(ur, { children: /* @__PURE__ */ g("span", { "data-selected": n.isSelected, children: n.isSelected && /* @__PURE__ */ g(Et, {}) }) }),
1218
1220
  /* @__PURE__ */ g(dr, { children: c })
1219
1221
  ] }) : /* @__PURE__ */ g(He, { children: c });
1220
1222
  } }) });
@@ -1231,9 +1233,9 @@ function it({
1231
1233
  throw new Error(
1232
1234
  'ComboBox.Section: When "items" is provided, "children" must be a function'
1233
1235
  );
1234
- return /* @__PURE__ */ xe(At, { ref: s, ...o, children: [
1236
+ return /* @__PURE__ */ ve(At, { ref: s, ...o, children: [
1235
1237
  t && /* @__PURE__ */ g(cr, { asChild: !0, children: /* @__PURE__ */ g(Kt, { children: t }) }),
1236
- r ? /* @__PURE__ */ g(Tt, { items: r, children: (n) => typeof e == "function" ? e(n) : null }) : e
1238
+ r ? /* @__PURE__ */ g(Ot, { items: r, children: (n) => typeof e == "function" ? e(n) : null }) : e
1237
1239
  ] });
1238
1240
  }
1239
1241
  it.displayName = "ComboBox.Section";
@@ -1320,7 +1322,7 @@ function Fr(e = ct) {
1320
1322
  return n;
1321
1323
  };
1322
1324
  }
1323
- function Tr(e) {
1325
+ function Or(e) {
1324
1326
  return (t, r) => {
1325
1327
  if (!r.trim()) return t;
1326
1328
  const s = [];
@@ -1540,10 +1542,10 @@ const oo = {
1540
1542
  createMultiPropertyFilter: Mr,
1541
1543
  createRankedFilter: Ar,
1542
1544
  createMultiTermFilter: Fr,
1543
- createSectionAwareFilter: Tr
1545
+ createSectionAwareFilter: Or
1544
1546
  }
1545
1547
  };
1546
1548
  export {
1547
1549
  oo as C
1548
1550
  };
1549
- //# sourceMappingURL=combobox-h1qOiDJD.es.js.map
1551
+ //# sourceMappingURL=combobox-vjauyzlS.es.js.map