@box-kite/react 2.2.16 → 2.2.18

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 (76) hide show
  1. package/.claude/rules/box-kite-rules.md +3 -3
  2. package/.claude/skills/box-kite/SKILL.md +3 -3
  3. package/.claude/skills/box-kite/references/components.md +1 -1
  4. package/.claude/skills/box-kite/references/styling.md +1 -1
  5. package/.cursor/rules/box-kite.mdc +3 -3
  6. package/AGENTS.md +3 -3
  7. package/BOX_AI_CONTEXT.md +2 -2
  8. package/BOX_KITE_AI_CONTEXT.md +2 -2
  9. package/behavior.cjs +1 -1
  10. package/behavior.mjs +62 -62
  11. package/catalog.cjs +1 -1
  12. package/catalog.mjs +3 -3
  13. package/client.cjs +1 -1
  14. package/client.mjs +15 -15
  15. package/components/accordion.cjs +1 -1
  16. package/components/accordion.mjs +1 -1
  17. package/components/calendar.cjs +1 -1
  18. package/components/calendar.mjs +1 -1
  19. package/components/combobox.cjs +1 -1
  20. package/components/combobox.mjs +1 -1
  21. package/components/dashboard.cjs +1 -1
  22. package/components/dashboard.mjs +1 -1
  23. package/components/dataGrid.cjs +2 -2
  24. package/components/dataGrid.mjs +11 -11
  25. package/components/dateField.cjs +1 -1
  26. package/components/dateField.mjs +1 -1
  27. package/components/datePicker.cjs +1 -1
  28. package/components/datePicker.mjs +198 -198
  29. package/components/dialog.cjs +1 -1
  30. package/components/dialog.mjs +140 -132
  31. package/components/form.cjs +1 -1
  32. package/components/form.mjs +1 -1
  33. package/components/menu.cjs +1 -1
  34. package/components/menu.mjs +120 -119
  35. package/components/overlay.cjs +1 -1
  36. package/components/overlay.mjs +5 -4
  37. package/components/popover.cjs +1 -1
  38. package/components/popover.mjs +50 -49
  39. package/components/presence.cjs +1 -1
  40. package/components/presence.mjs +1 -1
  41. package/components/radioGroup.cjs +1 -1
  42. package/components/radioGroup.mjs +1 -1
  43. package/components/semantics.d.ts +29 -29
  44. package/components/slider.cjs +1 -1
  45. package/components/slider.mjs +1 -1
  46. package/components/sortableList.cjs +1 -1
  47. package/components/sortableList.mjs +1 -1
  48. package/components/swipeItem.cjs +1 -1
  49. package/components/swipeItem.mjs +12 -12
  50. package/components/tabs.cjs +1 -1
  51. package/components/tabs.mjs +2 -2
  52. package/components/toaster.cjs +1 -1
  53. package/components/toaster.mjs +133 -115
  54. package/components/tooltip.cjs +1 -1
  55. package/components/tooltip.mjs +1 -1
  56. package/components/virtualList.cjs +1 -1
  57. package/components/virtualList.mjs +1 -1
  58. package/docs/props.md +2 -2
  59. package/interactionListening.cjs +1 -1
  60. package/interactionListening.mjs +3 -3
  61. package/layer.cjs +1 -1
  62. package/layer.mjs +17 -14
  63. package/motion.cjs +1 -1
  64. package/motion.mjs +30 -20
  65. package/package.json +40 -40
  66. package/placement.cjs +1 -1
  67. package/placement.mjs +10 -10
  68. package/platform.cjs +1 -1
  69. package/platform.mjs +18 -11
  70. package/react/animation/useHeldContent.d.ts +6 -0
  71. package/react/animation/usePresence.d.ts +4 -0
  72. package/react-shared.cjs +1 -1
  73. package/react-shared.mjs +1 -1
  74. package/scrolling.cjs +1 -1
  75. package/scrolling.mjs +1 -1
  76. package/utils/dom/domUtils.d.ts +7 -0
package/behavior.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { d as e, f as t, m as n, p as r, t as i } from "./platform.mjs";
1
+ import { g as e, h as t, m as n, p as r, t as i } from "./platform.mjs";
2
2
  import { n as a } from "./effects.mjs";
3
3
  import { t as o } from "./keyboard.mjs";
4
4
  import { useCallback as s, useEffect as c, useRef as l, useState as u } from "react";
@@ -37,21 +37,21 @@ function g() {
37
37
  let e = m.filter((e) => !m.some((t) => t !== e && h(e, t)));
38
38
  return e[e.length - 1];
39
39
  }
40
- function _(t) {
41
- let { enabled: n = !0, onDismiss: i, inside: o, escapeKey: s = !0, outsidePointer: c = !0 } = t, l = d(o), u = f(i);
40
+ function _(e) {
41
+ let { enabled: n = !0, onDismiss: i, inside: o, escapeKey: s = !0, outsidePointer: c = !0 } = e, l = d(o), u = f(i);
42
42
  a(() => {
43
43
  if (!n) return;
44
- let t = { elements: () => (l.current ?? []).map((t) => e(t)).filter((e) => e !== null) };
45
- m.push(t);
44
+ let e = { elements: () => (l.current ?? []).map((e) => r(e)).filter((e) => e !== null) };
45
+ m.push(e);
46
46
  let i = new AbortController(), a = (e, t) => document.addEventListener(e, t, { signal: i.signal });
47
- return s && a("keydown", (e) => {
48
- e.key !== "Escape" || e.defaultPrevented || g() === t && u("escape", e);
47
+ return s && a("keydown", (t) => {
48
+ t.key !== "Escape" || t.defaultPrevented || g() === e && u("escape", t);
49
49
  }), c && a("pointerdown", (e) => {
50
- r(e, l.current ?? []) || u("outside-pointer", e);
50
+ t(e, l.current ?? []) || u("outside-pointer", e);
51
51
  }), () => {
52
52
  i.abort();
53
- let e = m.indexOf(t);
54
- e !== -1 && m.splice(e, 1);
53
+ let t = m.indexOf(e);
54
+ t !== -1 && m.splice(t, 1);
55
55
  };
56
56
  }, [
57
57
  n,
@@ -68,17 +68,17 @@ function v() {
68
68
  return e && e !== document.body ? e : null;
69
69
  }
70
70
  function y(e = {}) {
71
- let { enabled: n = !0, returnTo: r, preventScroll: i } = e, [a, o] = u(null), [s, l] = u(!1);
72
- n !== s && (l(n), n && o(v()));
71
+ let { enabled: t = !0, returnTo: r, preventScroll: i } = e, [a, o] = u(null), [s, l] = u(!1);
72
+ t !== s && (l(t), t && o(v()));
73
73
  let d = f(() => {
74
- (t(r) ?? a)?.focus({ preventScroll: i });
74
+ (n(r) ?? a)?.focus({ preventScroll: i });
75
75
  });
76
76
  return c(() => {
77
- if (n) return () => {
77
+ if (t) return () => {
78
78
  let e = document.activeElement;
79
79
  (!e || e === document.body || !document.contains(e)) && d();
80
80
  };
81
- }, [n, d]), { returnFocus: d };
81
+ }, [t, d]), { returnFocus: d };
82
82
  }
83
83
  //#endregion
84
84
  //#region src/react/a11y/useRovingFocus.ts
@@ -101,12 +101,12 @@ function S(e, t, n, r, i) {
101
101
  function C(e, t, n) {
102
102
  return S(e === 1 ? -1 : t, e, t, !1, n);
103
103
  }
104
- function w(e) {
105
- let { count: t, columns: r, columnIndexOf: i, pageSize: a = b, defaultActiveColumn: c = 0, onActiveCellChange: f, orientation: m = "vertical", loop: h = !0, activeIndex: g, defaultActiveIndex: _ = 0, onActiveIndexChange: v, isDisabled: y, textOf: w, focusItems: T = !0, onSelect: E } = e, [D, O] = p({
104
+ function w(t) {
105
+ let { count: n, columns: r, columnIndexOf: i, pageSize: a = b, defaultActiveColumn: c = 0, onActiveCellChange: f, orientation: m = "vertical", loop: h = !0, activeIndex: g, defaultActiveIndex: _ = 0, onActiveIndexChange: v, isDisabled: y, textOf: w, focusItems: T = !0, onSelect: E } = t, [D, O] = p({
106
106
  value: g,
107
107
  defaultValue: _,
108
108
  onChange: v
109
- }), k = Math.min(D, t - 1), A = r !== void 0, j = s((e) => typeof r == "function" ? r(e) : r ?? 0, [r]), M = s((e, t) => {
109
+ }), k = Math.min(D, n - 1), A = r !== void 0, j = s((e) => typeof r == "function" ? r(e) : r ?? 0, [r]), M = s((e, t) => {
110
110
  let n = j(e);
111
111
  if (!i) return x(t, n - 1);
112
112
  if (n <= 0) return -1;
@@ -127,8 +127,8 @@ function w(e) {
127
127
  ]), G = d({
128
128
  row: k,
129
129
  column: F
130
- }), K = d(N), q = d(f), J = d(j), Y = d(M), X = d(i), Z = s((e, n, r) => {
131
- let i = x(e, t - 1), a = Math.max(0, n), o = i < 0 ? -1 : Y.current(i, a), s = G.current;
130
+ }), K = d(N), q = d(f), J = d(j), Y = d(M), X = d(i), Z = s((e, t, r) => {
131
+ let i = x(e, n - 1), a = Math.max(0, t), o = i < 0 ? -1 : Y.current(i, a), s = G.current;
132
132
  return i === s.row && o === s.column ? s : (O(i, r), P(a), q.current?.({
133
133
  row: i,
134
134
  column: o
@@ -140,14 +140,14 @@ function w(e) {
140
140
  G,
141
141
  Y,
142
142
  q,
143
- t,
143
+ n,
144
144
  O
145
- ]), Q = s((e, n, r) => {
146
- let i = x(e, t - 1), a = i < 0 ? -1 : x(Math.max(0, n), J.current(i) - 1);
145
+ ]), Q = s((e, t, r) => {
146
+ let i = x(e, n - 1), a = i < 0 ? -1 : x(Math.max(0, t), J.current(i) - 1);
147
147
  return Z(i, a < 0 ? 0 : X.current?.(i, a) ?? a, r);
148
148
  }, [
149
149
  X,
150
- t,
150
+ n,
151
151
  Z,
152
152
  J
153
153
  ]), ee = s((e, t) => {
@@ -175,35 +175,35 @@ function w(e) {
175
175
  k,
176
176
  T,
177
177
  O
178
- ]), $ = s((e) => {
179
- let { row: r, column: i } = G.current, o = (t, n) => {
180
- e.preventDefault();
181
- let r = Q(t, n, {
178
+ ]), $ = s((t) => {
179
+ let { row: r, column: i } = G.current, o = (e, n) => {
180
+ t.preventDefault();
181
+ let r = Q(e, n, {
182
182
  reason: "keyboard",
183
- event: e
183
+ event: t
184
184
  });
185
185
  T && U(r.row, r.column);
186
- }, s = (t) => {
187
- e.preventDefault();
188
- let n = Z(t, K.current, {
186
+ }, s = (e) => {
187
+ t.preventDefault();
188
+ let n = Z(e, K.current, {
189
189
  reason: "keyboard",
190
- event: e
190
+ event: t
191
191
  });
192
192
  T && U(n.row, n.column);
193
- }, c = 2 ** 53 - 1, l = () => n(e.currentTarget) ? -1 : 1;
194
- switch (e.key) {
193
+ }, c = 2 ** 53 - 1, l = () => e(t.currentTarget) ? -1 : 1;
194
+ switch (t.key) {
195
195
  case "ArrowRight": return o(r, i + l());
196
196
  case "ArrowLeft": return o(r, i - l());
197
197
  case "ArrowDown": return s(r + 1);
198
198
  case "ArrowUp": return s(r - 1);
199
- case "Home": return e.ctrlKey || e.metaKey ? o(0, 0) : o(r, 0);
200
- case "End": return e.ctrlKey || e.metaKey ? o(t - 1, c) : o(r, c);
199
+ case "Home": return t.ctrlKey || t.metaKey ? o(0, 0) : o(r, 0);
200
+ case "End": return t.ctrlKey || t.metaKey ? o(n - 1, c) : o(r, c);
201
201
  case "PageDown": return s(r + a);
202
202
  case "PageUp": return s(r - a);
203
203
  }
204
204
  }, [
205
205
  G,
206
- t,
206
+ n,
207
207
  K,
208
208
  U,
209
209
  T,
@@ -216,51 +216,51 @@ function w(e) {
216
216
  activeColumn: F,
217
217
  setActiveIndex: O,
218
218
  setActiveCell: Q,
219
- onKeyDown: s((e) => {
220
- if (e.defaultPrevented) return;
219
+ onKeyDown: s((t) => {
220
+ if (t.defaultPrevented) return;
221
221
  if (A) {
222
- $(e);
222
+ $(t);
223
223
  return;
224
224
  }
225
- let r = m !== "horizontal", i = m !== "vertical", a = B.current, s = o.isOpen(a, e.timeStamp), c = (t, n) => {
226
- t !== -1 && t !== k && (e.preventDefault(), O(t, {
225
+ let r = m !== "horizontal", i = m !== "vertical", a = B.current, s = o.isOpen(a, t.timeStamp), c = (e, n) => {
226
+ e !== -1 && e !== k && (t.preventDefault(), O(e, {
227
227
  reason: n,
228
- event: e
229
- }), T && V(t));
228
+ event: t
229
+ }), T && V(e));
230
230
  };
231
- if (i && (e.key === "ArrowRight" || e.key === "ArrowLeft")) {
232
- let r = e.key === "ArrowRight" !== n(e.currentTarget);
233
- c(S(k, r ? 1 : -1, t, h, y), "keyboard");
231
+ if (i && (t.key === "ArrowRight" || t.key === "ArrowLeft")) {
232
+ let r = t.key === "ArrowRight" !== e(t.currentTarget);
233
+ c(S(k, r ? 1 : -1, n, h, y), "keyboard");
234
234
  return;
235
235
  }
236
- if (e.key === "ArrowDown" && r) {
237
- c(S(k, 1, t, h, y), "keyboard");
236
+ if (t.key === "ArrowDown" && r) {
237
+ c(S(k, 1, n, h, y), "keyboard");
238
238
  return;
239
239
  }
240
- if (e.key === "ArrowUp" && r) {
241
- c(S(k, -1, t, h, y), "keyboard");
240
+ if (t.key === "ArrowUp" && r) {
241
+ c(S(k, -1, n, h, y), "keyboard");
242
242
  return;
243
243
  }
244
- if (e.key === "Home") {
245
- c(C(1, t, y), "keyboard");
244
+ if (t.key === "Home") {
245
+ c(C(1, n, y), "keyboard");
246
246
  return;
247
247
  }
248
- if (e.key === "End") {
249
- c(C(-1, t, y), "keyboard");
248
+ if (t.key === "End") {
249
+ c(C(-1, n, y), "keyboard");
250
250
  return;
251
251
  }
252
- if (e.key === "Enter" || e.key === " " && !(s && w)) {
252
+ if (t.key === "Enter" || t.key === " " && !(s && w)) {
253
253
  if (!E || k === -1) return;
254
- e.preventDefault(), E(k, e);
254
+ t.preventDefault(), E(k, t);
255
255
  return;
256
256
  }
257
- if (w && o.isPrintable(e)) {
258
- let n = o.push(a, e.key, e.timeStamp);
259
- c(o.target(n, k, t, w, y), "typeahead");
257
+ if (w && o.isPrintable(t)) {
258
+ let e = o.push(a, t.key, t.timeStamp);
259
+ c(o.target(e, k, n, w, y), "typeahead");
260
260
  }
261
261
  }, [
262
262
  k,
263
- t,
263
+ n,
264
264
  V,
265
265
  T,
266
266
  y,