@box-kite/react 2.2.6 → 2.2.8

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