@box-kite/react 2.2.14 → 2.2.16

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