@box-kite/react 2.3.1 → 2.4.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 (118) hide show
  1. package/.claude/rules/box-kite-rules.md +58 -94
  2. package/.claude/skills/box-kite/SKILL.md +69 -104
  3. package/.claude/skills/box-kite/references/components.md +8 -1
  4. package/.claude/skills/box-kite/references/patterns.md +1 -1
  5. package/.claude/skills/box-kite/references/rules.md +115 -0
  6. package/.claude/skills/box-kite/references/styling.md +5 -3
  7. package/.cursor/rules/box-kite.mdc +60 -96
  8. package/AGENTS.md +61 -97
  9. package/BOX_AI_CONTEXT.md +111 -40
  10. package/BOX_KITE_AI_CONTEXT.md +111 -40
  11. package/README.md +200 -721
  12. package/box.cjs +1 -1
  13. package/box.d.ts +5 -0
  14. package/box.mjs +5 -5
  15. package/catalog.cjs +1 -1
  16. package/catalog.mjs +53 -18
  17. package/client.cjs +1 -1
  18. package/client.mjs +85 -85
  19. package/components/accordion.cjs +1 -1
  20. package/components/accordion.mjs +1 -1
  21. package/components/button.cjs +1 -1
  22. package/components/button.mjs +1 -1
  23. package/components/calendar.cjs +1 -1
  24. package/components/calendar.mjs +1 -1
  25. package/components/chart.cjs +1 -1
  26. package/components/chart.mjs +3 -3
  27. package/components/checkbox.cjs +1 -1
  28. package/components/checkbox.mjs +1 -1
  29. package/components/combobox/comboboxListbox.d.ts +2 -1
  30. package/components/combobox.cjs +1 -1
  31. package/components/combobox.d.ts +1 -1
  32. package/components/combobox.mjs +200 -189
  33. package/components/dashboard.cjs +1 -1
  34. package/components/dashboard.mjs +1 -1
  35. package/components/dataGrid/contracts/dataGridContract.d.ts +2 -1
  36. package/components/dataGrid/useListLayout.d.ts +1 -1
  37. package/components/dataGrid.cjs +3 -3
  38. package/components/dataGrid.mjs +453 -453
  39. package/components/dateField.cjs +1 -1
  40. package/components/dateField.mjs +16 -16
  41. package/components/datePicker.cjs +1 -1
  42. package/components/datePicker.mjs +1 -1
  43. package/components/dateTime.cjs +1 -1
  44. package/components/dateTime.mjs +1 -1
  45. package/components/dialog.cjs +1 -1
  46. package/components/dialog.mjs +1 -1
  47. package/components/flex.cjs +1 -1
  48. package/components/flex.mjs +1 -1
  49. package/components/flow.cjs +1 -0
  50. package/components/flow.d.ts +56 -0
  51. package/components/flow.mjs +98 -0
  52. package/components/form.cjs +1 -1
  53. package/components/form.mjs +1 -1
  54. package/components/grid.cjs +1 -1
  55. package/components/grid.mjs +1 -1
  56. package/components/icon.cjs +1 -1
  57. package/components/icon.mjs +1 -1
  58. package/components/list.cjs +1 -1
  59. package/components/list.mjs +1 -1
  60. package/components/menu.cjs +1 -1
  61. package/components/menu.mjs +1 -1
  62. package/components/popover.cjs +1 -1
  63. package/components/popover.mjs +1 -1
  64. package/components/radioButton.cjs +1 -1
  65. package/components/radioButton.mjs +1 -1
  66. package/components/radioGroup.cjs +1 -1
  67. package/components/radioGroup.mjs +2 -1
  68. package/components/semantics.cjs +1 -1
  69. package/components/semantics.d.ts +32 -30
  70. package/components/semantics.mjs +3 -3
  71. package/components/skeleton.cjs +1 -1
  72. package/components/skeleton.d.ts +1 -1
  73. package/components/skeleton.mjs +3 -1
  74. package/components/slider.cjs +1 -1
  75. package/components/slider.mjs +1 -1
  76. package/components/sortableList.cjs +1 -1
  77. package/components/sortableList.mjs +1 -1
  78. package/components/svg.cjs +1 -1
  79. package/components/svg.mjs +14 -14
  80. package/components/swipeItem.cjs +1 -1
  81. package/components/swipeItem.mjs +1 -1
  82. package/components/tabs.cjs +1 -1
  83. package/components/tabs.mjs +1 -1
  84. package/components/textarea.cjs +1 -1
  85. package/components/textarea.d.ts +1 -1
  86. package/components/textarea.mjs +1 -1
  87. package/components/textbox.cjs +1 -1
  88. package/components/textbox.d.ts +1 -1
  89. package/components/textbox.mjs +1 -1
  90. package/components/timeZoneSelect.d.ts +1 -1
  91. package/components/toaster.cjs +1 -1
  92. package/components/toaster.mjs +14 -15
  93. package/components/tooltip.cjs +1 -1
  94. package/components/tooltip.mjs +1 -1
  95. package/components/virtualList.cjs +1 -1
  96. package/components/virtualList.mjs +1 -1
  97. package/components/visuallyHidden.cjs +1 -1
  98. package/components/visuallyHidden.mjs +1 -1
  99. package/docs/a11y.md +1 -2
  100. package/docs/components.md +1 -0
  101. package/docs/index.md +1 -1
  102. package/docs/props.md +1 -1
  103. package/effects.cjs +1 -1
  104. package/effects.mjs +2 -2
  105. package/identity.cjs +1 -1
  106. package/identity.mjs +5 -7
  107. package/package.json +50 -36
  108. package/react/boxClassNames.d.ts +2 -2
  109. package/react/effects.d.ts +5 -6
  110. package/react/identity/useIdentifier.d.ts +0 -3
  111. package/react-shared.cjs +1 -1
  112. package/react-shared.mjs +42 -3
  113. package/rsc.cjs +1 -1
  114. package/rsc.d.ts +1 -0
  115. package/rsc.mjs +2 -2
  116. package/utils/catalog/catalogContracts.d.ts +0 -10
  117. package/utils/flow/flowPalette.d.ts +17 -0
  118. package/utils/flow/flowUtils.d.ts +47 -0
@@ -83,7 +83,7 @@ var S;
83
83
  var C = S;
84
84
  //#endregion
85
85
  //#region src/components/combobox/comboboxChips.tsx
86
- function ee(e) {
86
+ function w(e) {
87
87
  let { selection: t, def: n, display: r, removeLabel: i, onRemove: a, disabled: o, variant: s } = e;
88
88
  return /* @__PURE__ */ b(y, { children: t.map((e) => {
89
89
  let t = C.labelOf(n, e);
@@ -124,7 +124,7 @@ function ee(e) {
124
124
  }
125
125
  //#endregion
126
126
  //#region src/utils/virtual/virtualUtils.ts
127
- var w;
127
+ var T;
128
128
  (function(e) {
129
129
  let t = e.DEFAULT_OVERSCAN = 4, n = e.DEFAULT_THRESHOLD = 100;
130
130
  e.DEFAULT_ITEM_HEIGHT = 36, e.DEFAULT_VIEW_HEIGHT = 248;
@@ -152,11 +152,11 @@ var w;
152
152
  };
153
153
  }
154
154
  e.windowFor = a;
155
- })(w ||= {});
156
- var T = w;
155
+ })(T ||= {});
156
+ var E = T;
157
157
  //#endregion
158
158
  //#region src/react/hooks/useVirtualization.ts
159
- function te(e) {
159
+ function ee(e) {
160
160
  let { count: n, scrollerRef: i, itemHeight: a, viewHeight: o, overscan: s, threshold: c, enabled: l, activeIndex: u } = e, [d, f] = v({
161
161
  top: 0,
162
162
  at: -1
@@ -165,7 +165,7 @@ function te(e) {
165
165
  viewHeight: 0
166
166
  }), g = _(null), y = h((e) => {
167
167
  g.current = e;
168
- }, []), b = T.shouldVirtualize(n, l, c), x = r(() => {
168
+ }, []), b = E.shouldVirtualize(n, l, c), x = r(() => {
169
169
  let e = i.current, t = g.current;
170
170
  if (!e || !t) return;
171
171
  let n = t.children, r = n[0], a = n[1], o = a ? a.offsetTop - r.offsetTop : r?.offsetHeight ?? 0, s = e.clientHeight;
@@ -191,10 +191,10 @@ function te(e) {
191
191
  top: e.currentTarget.scrollTop,
192
192
  at: u ?? -1
193
193
  });
194
- }), C = T.windowFor({
194
+ }), C = E.windowFor({
195
195
  count: n,
196
- itemHeight: a ?? (p.itemHeight > 0 ? p.itemHeight : T.DEFAULT_ITEM_HEIGHT),
197
- viewHeight: o ?? (p.viewHeight > 0 ? p.viewHeight : T.DEFAULT_VIEW_HEIGHT),
196
+ itemHeight: a ?? (p.itemHeight > 0 ? p.itemHeight : E.DEFAULT_ITEM_HEIGHT),
197
+ viewHeight: o ?? (p.viewHeight > 0 ? p.viewHeight : E.DEFAULT_VIEW_HEIGHT),
198
198
  scrollTop: d.top,
199
199
  overscan: s,
200
200
  activeIndex: u === d.at ? -1 : u
@@ -216,29 +216,29 @@ function te(e) {
216
216
  }
217
217
  //#endregion
218
218
  //#region src/components/combobox/comboboxListbox.tsx
219
- function ne(e, t, n, r) {
219
+ function te(e, t, n, r) {
220
220
  return e ? {
221
221
  role: "listbox",
222
- "aria-labelledby": r,
222
+ ...r,
223
223
  ...t ? { "aria-multiselectable": !0 } : {},
224
224
  ...n ? { "aria-busy": !0 } : {}
225
225
  } : { role: "status" };
226
226
  }
227
- function re(e) {
228
- let { presence: t, rows: r, def: i, display: a, selection: o, multiple: s, activeIndex: c, optionId: l, rowRef: u, onSelect: p } = e, { anchorRef: m, popupRef: g, listboxId: y, labelledBy: S, loading: ee, loadingText: w, emptyText: T, createLabel: re, variant: E, itemsProps: D } = e, { virtualize: O } = e, { present: k, ref: ie, props: ae } = t, A = (e) => C.keyOf(i, e), [j, oe] = v(!1), M = h((e) => oe(e === "top"), []), N = _(null), se = h((e) => {
229
- N.current = e, ie(e);
230
- }, [ie]), ce = typeof O == "object" ? O : {}, { virtualized: P, startIndex: F, endIndex: le, offsetY: ue, totalHeight: de, contentRef: fe, onScroll: pe } = te({
227
+ function ne(e) {
228
+ let { presence: t, rows: r, def: i, display: a, selection: o, multiple: s, activeIndex: c, optionId: l, rowRef: u, onSelect: p } = e, { anchorRef: m, popupRef: g, listboxId: y, name: S, loading: w, loadingText: T, emptyText: E, createLabel: ne, variant: D, itemsProps: O } = e, { virtualize: k } = e, { present: A, ref: re, props: ie } = t, j = (e) => C.keyOf(i, e), [M, ae] = v(!1), N = h((e) => ae(e === "top"), []), P = _(null), oe = h((e) => {
229
+ P.current = e, re(e);
230
+ }, [re]), se = typeof k == "object" ? k : {}, { virtualized: F, startIndex: I, endIndex: ce, offsetY: le, totalHeight: ue, contentRef: de, onScroll: fe } = ee({
231
231
  count: r.length,
232
- scrollerRef: N,
233
- enabled: typeof O == "boolean" ? O : void 0,
232
+ scrollerRef: P,
233
+ enabled: typeof k == "boolean" ? k : void 0,
234
234
  activeIndex: c,
235
- ...ce
236
- }), I = P ? r.slice(F, le) : r, L = (e, t) => {
237
- let n = P ? F + t : t, s = e.kind === "option" && C.isSelected(o, e.row, A), f = C.isRowDisabled(i, e);
235
+ ...se
236
+ }), L = F ? r.slice(I, ce) : r, R = (e, t) => {
237
+ let n = F ? I + t : t, s = e.kind === "option" && C.isSelected(o, e.row, j), f = C.isRowDisabled(i, e);
238
238
  return /* @__PURE__ */ b(d, {
239
239
  ref: u(n),
240
240
  component: "combobox.item",
241
- variant: [E, {
241
+ variant: [D, {
242
242
  create: e.kind === "create",
243
243
  highlighted: n === c
244
244
  }],
@@ -248,7 +248,7 @@ function re(e) {
248
248
  id: l(n),
249
249
  props: {
250
250
  role: "option",
251
- ...P ? {
251
+ ...F ? {
252
252
  "aria-setsize": r.length,
253
253
  "aria-posinset": n + 1
254
254
  } : {},
@@ -256,8 +256,8 @@ function re(e) {
256
256
  onMouseDown: (e) => e.preventDefault(),
257
257
  onClick: (e) => !f && p(n, e)
258
258
  },
259
- children: e.kind === "create" ? re(e.query) : a?.(e.row) ?? C.labelOf(i, e.row)
260
- }, e.kind === "option" ? A(e.row) : "create");
259
+ children: e.kind === "create" ? ne(e.query) : a?.(e.row) ?? C.labelOf(i, e.row)
260
+ }, e.kind === "option" ? j(e.row) : "create");
261
261
  };
262
262
  return /* @__PURE__ */ b(f, {
263
263
  ref: g,
@@ -266,222 +266,233 @@ function re(e) {
266
266
  align: "start",
267
267
  offset: .5,
268
268
  matchWidth: !0,
269
- onSideChange: M,
269
+ onSideChange: N,
270
270
  children: /* @__PURE__ */ x(n, {
271
- ref: se,
271
+ ref: oe,
272
272
  component: "combobox.items",
273
- ...D,
274
- variant: [E, {
275
- closed: !k && !j,
276
- closedUp: !k && j
273
+ ...O,
274
+ variant: [D, {
275
+ closed: !A && !M,
276
+ closedUp: !A && M
277
277
  }],
278
278
  id: y,
279
279
  props: {
280
- ...ne(r.length > 0, s, ee === !0, S),
281
- ...ae,
282
- ...P ? { onScroll: pe } : {}
280
+ ...te(r.length > 0, s, w === !0, S),
281
+ ...ie,
282
+ ...F ? { onScroll: fe } : {}
283
283
  },
284
- children: [P ? /* @__PURE__ */ b(n, {
285
- ref: fe,
284
+ children: [F ? /* @__PURE__ */ b(n, {
285
+ ref: de,
286
286
  component: "combobox.window",
287
- variant: E,
287
+ variant: D,
288
288
  style: {
289
- height: de,
290
- paddingTop: ue
289
+ height: ue,
290
+ paddingTop: le
291
291
  },
292
- children: I.map(L)
293
- }) : I.map(L), r.length === 0 && /* @__PURE__ */ b(n, {
292
+ children: L.map(R)
293
+ }) : L.map(R), r.length === 0 && /* @__PURE__ */ b(n, {
294
294
  component: "combobox.message",
295
- variant: E,
296
- children: ee ? w : T
295
+ variant: D,
296
+ children: w ? T : E
297
297
  })]
298
298
  })
299
299
  });
300
300
  }
301
301
  //#endregion
302
302
  //#region src/components/combobox.tsx
303
- var E = /* @__PURE__ */ new Set([
303
+ var D = /* @__PURE__ */ new Set([
304
304
  " ",
305
305
  "Home",
306
306
  "End",
307
307
  "ArrowLeft",
308
308
  "ArrowRight"
309
309
  ]);
310
- function D(f, m) {
311
- let { data: S, def: w, label: T, labelProps: te, placeholder: ne, name: D, disabled: O, props: k, itemsProps: ie, hideIcon: ae, filter: A = C.filterRows, loading: j, loadingText: oe = "Loading...", emptyText: M = "No results", createRow: N, createLabel: se = (e) => `Create "${e}"`, removeLabel: ce = (e) => `Remove ${e}`, virtualize: P, query: F, defaultQuery: le, onQueryChange: ue, open: de, defaultOpen: fe, onOpenChange: pe, multiple: I = !1, value: L, defaultValue: me, onValueChange: he, ...R } = f, z = s("combobox"), B = R.id ?? `${z}-field`, ge = `${z}-listbox`, V = `${z}-label`, H = T != null && T !== !1, _e = h((e) => `${z}-option-${e}`, [z]), U = _(null), ve = _(null), ye = _(null), be = h((t) => {
312
- ye.current = t, e(m, t);
313
- }, [m]), xe = r((e, t) => {
314
- he?.(I ? e : e[0] ?? null, t);
315
- }), Se = g(() => L === void 0 ? void 0 : C.toArray(L), [L]), [W, Ce] = c({
316
- value: Se,
317
- defaultValue: () => C.toArray(me),
318
- onChange: xe,
310
+ function O(f, m) {
311
+ let { data: S, def: T, label: E, labelProps: ee, placeholder: te, name: O, disabled: k, props: A, itemsProps: re, hideIcon: ie, filter: j = C.filterRows, loading: M, loadingText: ae = "Loading...", emptyText: N = "No results", createRow: P, createLabel: oe = (e) => `Create "${e}"`, removeLabel: se = (e) => `Remove ${e}`, virtualize: F, query: I, defaultQuery: ce, onQueryChange: le, open: ue, defaultOpen: de, onOpenChange: fe, multiple: L = !1, value: R, defaultValue: pe, onValueChange: me, id: he, ...z } = f, B = s("combobox"), ge = he ?? A?.id ?? `${B}-field`, _e = `${B}-listbox`, ve = `${B}-label`, ye = E != null && E !== !1, be = h((e) => `${B}-option-${e}`, [B]), V = _(null), xe = _(null), H = _(null), Se = h((t) => {
312
+ H.current = t, e(m, t);
313
+ }, [m]), Ce = r((e, t) => {
314
+ me?.(L ? e : e[0] ?? null, t);
315
+ }), we = g(() => R === void 0 ? void 0 : C.toArray(R), [R]), [U, Te] = c({
316
+ value: we,
317
+ defaultValue: () => C.toArray(pe),
318
+ onChange: Ce,
319
319
  interaction: {
320
320
  component: "combobox",
321
321
  type: "valueChange",
322
322
  content: ["value"]
323
323
  }
324
- }), [G, K] = c({
325
- value: de,
326
- defaultValue: fe ?? !1,
327
- onChange: pe,
324
+ }), [W, G] = c({
325
+ value: ue,
326
+ defaultValue: de ?? !1,
327
+ onChange: fe,
328
328
  interaction: {
329
329
  component: "combobox",
330
330
  type: "openChange"
331
331
  }
332
- }), [we, q] = i({
333
- value: F,
334
- defaultValue: le ?? "",
335
- onChange: ue
336
- }), [Te, J] = v(!1), Y = h((e) => C.keyOf(w, e), [w]), Ee = I || W[0] === void 0 ? "" : C.labelOf(w, W[0]), X = Te || we !== "" ? we : Ee, Z = g(() => C.rowsFor({
332
+ }), [Ee, K] = i({
333
+ value: I,
334
+ defaultValue: ce ?? "",
335
+ onChange: le
336
+ }), [De, q] = v(!1), J = h((e) => C.keyOf(T, e), [T]), Oe = L || U[0] === void 0 ? "" : C.labelOf(T, U[0]), Y = De || Ee !== "" ? Ee : Oe, X = g(() => C.rowsFor({
337
337
  data: S,
338
- def: w,
339
- query: X,
340
- filter: A,
341
- typed: Te,
342
- createRow: N
338
+ def: T,
339
+ query: Y,
340
+ filter: j,
341
+ typed: De,
342
+ createRow: P
343
343
  }), [
344
344
  S,
345
- w,
346
- X,
347
- A,
348
- Te,
349
- N
350
- ]), De = h((e) => Z[e] ? C.isRowDisabled(w, Z[e]) : !1, [Z, w]), Oe = r((e, t) => {
351
- K(!1, {
345
+ T,
346
+ Y,
347
+ j,
348
+ De,
349
+ P
350
+ ]), ke = h((e) => X[e] ? C.isRowDisabled(T, X[e]) : !1, [X, T]), Ae = r((e, t) => {
351
+ G(!1, {
352
352
  reason: e,
353
353
  event: t
354
- }), e !== "escape" && (J(!1), q("", {
354
+ }), e !== "escape" && (q(!1), K("", {
355
355
  reason: "close",
356
356
  event: t
357
357
  }));
358
- }), Q = r((e, t) => {
359
- let n = Z[e];
360
- if (!n || De(e)) return;
361
- let r = n.kind === "create" ? N?.(n.query) : n.row;
358
+ }), Z = r((e, t) => {
359
+ let n = X[e];
360
+ if (!n || ke(e)) return;
361
+ let r = n.kind === "create" ? P?.(n.query) : n.row;
362
362
  if (r == null) return;
363
- let i = C.isSelected(W, r, Y), a = n.kind === "create" ? "create" : i && I ? "deselect" : "select";
364
- Ce(C.toggle(W, r, I, Y), {
363
+ let i = C.isSelected(U, r, J), a = n.kind === "create" ? "create" : i && L ? "deselect" : "select";
364
+ Te(C.toggle(U, r, L, J), {
365
365
  reason: a,
366
366
  event: t
367
- }), J(!1), q("", {
367
+ }), q(!1), K("", {
368
368
  reason: "select",
369
369
  event: t
370
- }), I || K(!1, {
370
+ }), L || G(!1, {
371
371
  reason: "select",
372
372
  event: t
373
373
  });
374
- }), ke = o({
375
- count: Z.length,
374
+ }), je = o({
375
+ count: X.length,
376
376
  focusItems: !1,
377
377
  defaultActiveIndex: -1,
378
- isDisabled: De,
379
- onSelect: Q
380
- }), { activeIndex: $, setActiveIndex: Ae, activeItem: je } = ke;
378
+ isDisabled: ke,
379
+ onSelect: Z
380
+ }), { activeIndex: Q, setActiveIndex: Me, activeItem: Ne } = je;
381
381
  a({
382
- enabled: G,
383
- inside: [U, ve],
384
- onDismiss: (e, t) => Oe(e === "escape" ? "escape" : "outside-pointer", t)
382
+ enabled: W,
383
+ inside: [V, xe],
384
+ onDismiss: (e, t) => Ae(e === "escape" ? "escape" : "outside-pointer", t)
385
385
  }), t(() => {
386
- !G || $ === -1 || je()?.scrollIntoView?.({ block: "nearest" });
386
+ !W || Q === -1 || Ne()?.scrollIntoView?.({ block: "nearest" });
387
+ }, [
388
+ W,
389
+ Q,
390
+ Ne
391
+ ]);
392
+ let $ = ye ? ve : A?.["aria-labelledby"], Pe = A?.["aria-label"], [Fe, Ie] = v();
393
+ t(() => {
394
+ if (!W || $ || Pe) return;
395
+ let e = Array.from(H.current?.labels ?? [], (e) => e.textContent?.trim() ?? "").filter(Boolean).join(" ") || void 0;
396
+ e !== Fe && Ie(e);
387
397
  }, [
388
- G,
398
+ W,
389
399
  $,
390
- je
400
+ Pe,
401
+ Fe
391
402
  ]);
392
- let Me = (e, t, n) => {
393
- K(!0, {
403
+ let Le = $ ? { "aria-labelledby": $ } : { "aria-label": Pe ?? Fe }, Re = (e, t, n) => {
404
+ G(!0, {
394
405
  reason: n,
395
406
  event: t
396
407
  });
397
- let r = e === "none" ? -1 : C.activeIndexFor(Z, W, w, e);
398
- Ae(r, {
408
+ let r = e === "none" ? -1 : C.activeIndexFor(X, U, T, e);
409
+ Me(r, {
399
410
  reason: "programmatic",
400
411
  event: t
401
412
  });
402
- }, Ne = r((e) => {
403
- J(!0), q(e.target.value, {
413
+ }, ze = r((e) => {
414
+ q(!0), K(e.target.value, {
404
415
  reason: "input",
405
416
  event: e
406
- }), G || K(!0, {
417
+ }), W || G(!0, {
407
418
  reason: "input",
408
419
  event: e
409
- }), Ae(-1, {
420
+ }), Me(-1, {
410
421
  reason: "programmatic",
411
422
  event: e
412
423
  });
413
- }), Pe = r((e, t) => {
414
- Ce(W.filter((t) => Y(t) !== Y(e)), {
424
+ }), Be = r((e, t) => {
425
+ Te(U.filter((t) => J(t) !== J(e)), {
415
426
  reason: "remove",
416
427
  event: t
417
428
  });
418
- }), Fe = (e) => {
429
+ }), Ve = (e) => {
419
430
  let { key: t } = e;
420
431
  if (t === "ArrowDown" || t === "ArrowUp") {
421
- e.preventDefault(), Me(t === "ArrowUp" ? "last" : e.altKey ? "none" : "first", e, "trigger");
432
+ e.preventDefault(), Re(t === "ArrowUp" ? "last" : e.altKey ? "none" : "first", e, "trigger");
422
433
  return;
423
434
  }
424
- t === "Escape" && X !== "" && (J(!0), q("", {
435
+ t === "Escape" && Y !== "" && (q(!0), K("", {
425
436
  reason: "clear",
426
437
  event: e
427
438
  }));
428
- }, Ie = r((e) => {
429
- if (k?.onKeyDown?.(e), !(e.defaultPrevented || O)) {
430
- if (e.key === "Backspace" && I && X === "" && W.length > 0) {
431
- Pe(W[W.length - 1], e);
439
+ }, He = r((e) => {
440
+ if (A?.onKeyDown?.(e), !(e.defaultPrevented || k)) {
441
+ if (e.key === "Backspace" && L && Y === "" && U.length > 0) {
442
+ Be(U[U.length - 1], e);
432
443
  return;
433
444
  }
434
- if (!G) {
435
- Fe(e);
445
+ if (!W) {
446
+ Ve(e);
436
447
  return;
437
448
  }
438
449
  if (e.key === "Tab") {
439
- $ !== -1 && Q($, e), Oe("tab", e);
450
+ Q !== -1 && Z(Q, e), Ae("tab", e);
440
451
  return;
441
452
  }
442
453
  if (e.altKey && e.key === "ArrowUp") {
443
- e.preventDefault(), $ === -1 ? Oe("trigger", e) : Q($, e);
454
+ e.preventDefault(), Q === -1 ? Ae("trigger", e) : Z(Q, e);
444
455
  return;
445
456
  }
446
- if (E.has(e.key)) {
447
- Ae(-1, {
457
+ if (D.has(e.key)) {
458
+ Me(-1, {
448
459
  reason: "programmatic",
449
460
  event: e
450
461
  });
451
462
  return;
452
463
  }
453
- ke.onKeyDown(e);
464
+ je.onKeyDown(e);
454
465
  }
455
- }), Le = r((e) => {
456
- !O && !G && Me("first", e, "trigger");
457
- }), Re = r((e) => {
458
- O || e.target === ye.current || (e.preventDefault(), ye.current?.focus(), G || Me("first", e, "trigger"));
459
- }), ze = Z.length > 0 || j === !0 || M !== null, Be = G && $ !== -1 && Z.length > 0 ? _e($) : void 0, Ve = /* @__PURE__ */ b(n, {
466
+ }), Ue = r((e) => {
467
+ !k && !W && Re("first", e, "trigger");
468
+ }), We = r((e) => {
469
+ k || e.target === H.current || (e.preventDefault(), H.current?.focus(), W || Re("first", e, "trigger"));
470
+ }), Ge = X.length > 0 || M === !0 || N !== null, Ke = W && Q !== -1 && X.length > 0 ? be(Q) : void 0, qe = /* @__PURE__ */ b(n, {
460
471
  tag: "input",
461
472
  component: "combobox.field",
462
- ref: be,
463
- id: B,
464
- disabled: O,
473
+ ref: Se,
474
+ id: ge,
475
+ disabled: k,
465
476
  props: {
466
- ...k,
477
+ ...A,
467
478
  role: "combobox",
468
479
  "aria-autocomplete": "list",
469
- "aria-expanded": G,
470
- "aria-controls": G && ze ? ge : void 0,
471
- "aria-activedescendant": Be,
472
- "aria-labelledby": H ? V : k?.["aria-labelledby"],
480
+ "aria-expanded": W,
481
+ "aria-controls": W && Ge ? _e : void 0,
482
+ "aria-activedescendant": Ke,
483
+ "aria-labelledby": $,
473
484
  autoComplete: "off",
474
485
  spellCheck: !1,
475
486
  type: "text",
476
- value: X,
477
- placeholder: ne,
478
- onChange: Ne,
479
- onKeyDown: Ie,
480
- onClick: Le
487
+ value: Y,
488
+ placeholder: te,
489
+ onChange: ze,
490
+ onKeyDown: He,
491
+ onClick: Ue
481
492
  }
482
- }), He = !ae && /* @__PURE__ */ b(d, {
493
+ }), Je = !ie && /* @__PURE__ */ b(d, {
483
494
  component: "combobox.icon",
484
- rotate: G ? 180 : 0,
495
+ rotate: W ? 180 : 0,
485
496
  props: { "aria-hidden": !0 },
486
497
  children: /* @__PURE__ */ b(u, {
487
498
  viewBox: "0 0 10 6",
@@ -495,62 +506,62 @@ function D(f, m) {
495
506
  strokeLinejoin: "round"
496
507
  })
497
508
  })
498
- }), Ue = D === void 0 ? null : W.map((e) => /* @__PURE__ */ b(n, {
509
+ }), Ye = O === void 0 ? null : U.map((e) => /* @__PURE__ */ b(n, {
499
510
  tag: "input",
500
511
  props: {
501
512
  type: "hidden",
502
- name: D,
503
- value: String(Y(e))
513
+ name: O,
514
+ value: String(J(e))
504
515
  }
505
- }, Y(e))), We = ze && /* @__PURE__ */ b(p, {
506
- present: G,
507
- children: (e) => /* @__PURE__ */ b(re, {
516
+ }, J(e))), Xe = Ge && /* @__PURE__ */ b(p, {
517
+ present: W,
518
+ children: (e) => /* @__PURE__ */ b(ne, {
508
519
  presence: e,
509
- rows: Z,
510
- def: w,
511
- display: w.display,
512
- selection: W,
513
- multiple: I,
514
- activeIndex: $,
515
- optionId: _e,
516
- rowRef: (e) => ke.itemProps(e).ref,
517
- onSelect: Q,
518
- anchorRef: U,
519
- popupRef: ve,
520
- listboxId: ge,
521
- labelledBy: H ? V : B,
522
- loading: j,
523
- loadingText: oe,
524
- emptyText: M,
525
- createLabel: se,
526
- virtualize: P,
527
- variant: R.variant,
528
- itemsProps: ie
520
+ rows: X,
521
+ def: T,
522
+ display: T.display,
523
+ selection: U,
524
+ multiple: L,
525
+ activeIndex: Q,
526
+ optionId: be,
527
+ rowRef: (e) => je.itemProps(e).ref,
528
+ onSelect: Z,
529
+ anchorRef: V,
530
+ popupRef: xe,
531
+ listboxId: _e,
532
+ name: Le,
533
+ loading: M,
534
+ loadingText: ae,
535
+ emptyText: N,
536
+ createLabel: oe,
537
+ virtualize: F,
538
+ variant: z.variant,
539
+ itemsProps: re
529
540
  })
530
- }), Ge = /* @__PURE__ */ x(d, {
531
- ref: U,
541
+ }), Ze = /* @__PURE__ */ x(d, {
542
+ ref: V,
532
543
  component: "combobox",
533
544
  ai: "center",
534
545
  gap: 1,
535
546
  flexWrap: "wrap",
536
- ...R,
537
- props: { onPointerDown: Re },
547
+ ...z,
548
+ props: { onPointerDown: We },
538
549
  children: [
539
- Ue,
540
- I && /* @__PURE__ */ b(ee, {
541
- selection: W,
542
- def: w,
543
- display: w.display,
544
- removeLabel: ce,
545
- onRemove: Pe,
546
- disabled: O,
547
- variant: R.variant
550
+ Ye,
551
+ L && /* @__PURE__ */ b(w, {
552
+ selection: U,
553
+ def: T,
554
+ display: T.display,
555
+ removeLabel: se,
556
+ onRemove: Be,
557
+ disabled: k,
558
+ variant: z.variant
548
559
  }),
549
- Ve,
550
- He
560
+ qe,
561
+ Je
551
562
  ]
552
563
  });
553
- return H ? /* @__PURE__ */ x(d, {
564
+ return ye ? /* @__PURE__ */ x(d, {
554
565
  d: "column",
555
566
  gap: 1,
556
567
  width: "fit-content",
@@ -558,17 +569,17 @@ function D(f, m) {
558
569
  /* @__PURE__ */ b(n, {
559
570
  tag: "label",
560
571
  component: "combobox.label",
561
- id: V,
562
- ...te,
563
- props: { htmlFor: B },
564
- children: T
572
+ id: ve,
573
+ ...ee,
574
+ props: { htmlFor: ge },
575
+ children: E
565
576
  }),
566
- Ge,
567
- We
577
+ Ze,
578
+ Xe
568
579
  ]
569
- }) : /* @__PURE__ */ x(y, { children: [Ge, We] });
580
+ }) : /* @__PURE__ */ x(y, { children: [Ze, Xe] });
570
581
  }
571
- var O = m(D);
572
- O.displayName = "Combobox";
582
+ var k = m(O);
583
+ k.displayName = "Combobox";
573
584
  //#endregion
574
- export { C as ComboboxUtils, O as default };
585
+ export { C as ComboboxUtils, k as default };