@box-kite/react 2.2.4 → 2.2.6

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 (167) hide show
  1. package/.claude/rules/box-kite-rules.md +11 -1
  2. package/.claude/skills/box-kite/SKILL.md +11 -1
  3. package/.claude/skills/box-kite/references/components.md +83 -3
  4. package/.cursor/rules/box-kite.mdc +11 -1
  5. package/AGENTS.md +11 -1
  6. package/BOX_AI_CONTEXT.md +371 -25
  7. package/BOX_KITE_AI_CONTEXT.md +371 -25
  8. package/behavior.cjs +1 -1
  9. package/behavior.mjs +57 -57
  10. package/box.cjs +1 -1
  11. package/box.d.ts +5 -0
  12. package/box.mjs +15 -15
  13. package/catalog.cjs +1 -1
  14. package/catalog.mjs +906 -0
  15. package/client.cjs +1 -1
  16. package/client.mjs +94 -80
  17. package/components/calendar.cjs +1 -0
  18. package/components/calendar.d.ts +77 -0
  19. package/components/calendar.mjs +483 -0
  20. package/components/dashboard.cjs +1 -1
  21. package/components/dashboard.mjs +1 -1
  22. package/components/dataGrid/components/dataGridBooleanValue.d.ts +11 -0
  23. package/components/dataGrid/components/dataGridDateParts.d.ts +40 -0
  24. package/components/dataGrid/components/dataGridDateValue.d.ts +14 -0
  25. package/components/dataGrid/components/dataGridList.d.ts +12 -0
  26. package/components/dataGrid/components/dataGridListAggregate.d.ts +7 -0
  27. package/components/dataGrid/components/dataGridListFilter.d.ts +7 -0
  28. package/components/dataGrid/components/dataGridListFilterSheet.d.ts +11 -0
  29. package/components/dataGrid/components/dataGridListFooter.d.ts +13 -0
  30. package/components/dataGrid/components/dataGridListGroup.d.ts +13 -0
  31. package/components/dataGrid/components/dataGridListItem.d.ts +21 -0
  32. package/components/dataGrid/components/dataGridListLayout.d.ts +20 -0
  33. package/components/dataGrid/components/dataGridListRecord.d.ts +11 -0
  34. package/components/dataGrid/components/dataGridListSelectionBar.d.ts +11 -0
  35. package/components/dataGrid/components/dataGridListSheet.d.ts +30 -0
  36. package/components/dataGrid/components/dataGridListSortSheet.d.ts +10 -0
  37. package/components/dataGrid/components/dataGridListToolbar.d.ts +10 -0
  38. package/components/dataGrid/components/dataGridListValue.d.ts +12 -0
  39. package/components/dataGrid/contracts/dataGridContract.d.ts +70 -11
  40. package/components/dataGrid/models/columnModel.d.ts +3 -1
  41. package/components/dataGrid/models/editModel.d.ts +3 -1
  42. package/components/dataGrid/models/gridModel.d.ts +3 -0
  43. package/components/dataGrid/models/listModel.d.ts +129 -0
  44. package/components/dataGrid/models/localeText.d.ts +36 -0
  45. package/components/dataGrid/models/viewportModel.d.ts +0 -2
  46. package/components/dataGrid/useDateParts.d.ts +17 -0
  47. package/components/dataGrid/useListLayout.d.ts +13 -0
  48. package/components/dataGrid.cjs +3 -3
  49. package/components/dataGrid.mjs +1251 -854
  50. package/components/dateField.cjs +1 -0
  51. package/components/dateField.d.ts +78 -0
  52. package/components/dateField.mjs +313 -0
  53. package/components/datePicker.cjs +1 -0
  54. package/components/datePicker.d.ts +120 -0
  55. package/components/datePicker.mjs +529 -0
  56. package/components/dateTime.cjs +1 -0
  57. package/components/dateTime.d.ts +23 -0
  58. package/components/dateTime.mjs +34 -0
  59. package/components/dialog.cjs +1 -1
  60. package/components/dialog.mjs +29 -29
  61. package/components/list/listItemParts.d.ts +9 -0
  62. package/components/list.cjs +1 -0
  63. package/components/list.d.ts +118 -0
  64. package/components/list.mjs +391 -0
  65. package/components/menu.cjs +1 -1
  66. package/components/menu.mjs +25 -25
  67. package/components/overlay.cjs +1 -1
  68. package/components/overlay.mjs +12 -12
  69. package/components/semantics.d.ts +29 -29
  70. package/components/slider.cjs +1 -1
  71. package/components/slider.mjs +1 -1
  72. package/components/sortableList.cjs +1 -0
  73. package/components/sortableList.d.ts +49 -0
  74. package/components/sortableList.mjs +384 -0
  75. package/components/swipeItem.cjs +1 -0
  76. package/components/swipeItem.d.ts +52 -0
  77. package/components/swipeItem.mjs +321 -0
  78. package/components/tabs.cjs +1 -1
  79. package/components/tabs.mjs +1 -1
  80. package/components/timeZoneSelect.cjs +1 -0
  81. package/components/timeZoneSelect.d.ts +52 -0
  82. package/components/timeZoneSelect.mjs +74 -0
  83. package/components/toaster.cjs +1 -1
  84. package/components/toaster.mjs +24 -24
  85. package/components/virtualList.cjs +1 -0
  86. package/components/virtualList.d.ts +32 -0
  87. package/components/virtualList.mjs +188 -0
  88. package/dataGridDateParts.cjs +1 -0
  89. package/dataGridDateParts.mjs +223 -0
  90. package/dataGridList.cjs +1 -0
  91. package/dataGridList.mjs +1314 -0
  92. package/dataGridListLayout.cjs +1 -0
  93. package/dataGridListLayout.mjs +49 -0
  94. package/date-environment.cjs +1 -0
  95. package/date-environment.mjs +29 -0
  96. package/date-input.cjs +1 -0
  97. package/date-input.mjs +346 -0
  98. package/date-math.cjs +1 -0
  99. package/date-math.mjs +317 -0
  100. package/date.cjs +1 -0
  101. package/date.d.ts +40 -0
  102. package/date.mjs +4 -0
  103. package/dates.cjs +1 -0
  104. package/dates.mjs +689 -0
  105. package/docs/components.md +10 -1
  106. package/icons/closeIcon.d.ts +2 -0
  107. package/icons/filterIcon.d.ts +2 -0
  108. package/layer.cjs +1 -1
  109. package/layer.mjs +1 -1
  110. package/mcp/src/data.d.ts +2 -0
  111. package/package.json +178 -22
  112. package/placement.cjs +1 -1
  113. package/placement.mjs +10 -10
  114. package/platform.cjs +1 -1
  115. package/platform.mjs +4 -1
  116. package/react/a11y/useControllableState.d.ts +2 -1
  117. package/react/boxComponent.d.ts +1 -1
  118. package/react/componentsContext.d.ts +4 -0
  119. package/react/componentsProvider.d.ts +10 -0
  120. package/react/date/dateChange.d.ts +18 -0
  121. package/react/date/dateEnvironment.d.ts +34 -0
  122. package/react/resolveStyles.d.ts +2 -1
  123. package/react/theme/theme.d.ts +6 -1
  124. package/react-shared.cjs +1 -1
  125. package/react-shared.mjs +6 -6
  126. package/registry/blocks/dashboard-shell/dashboard-shell.d.ts +3 -1
  127. package/registry/designs/store/address-form.d.ts +11 -0
  128. package/registry/designs/store/cart-items.d.ts +10 -0
  129. package/registry/designs/store/cart-page.d.ts +4 -0
  130. package/registry/designs/store/checkout-page.d.ts +7 -0
  131. package/registry/designs/store/credit-card-form.d.ts +10 -0
  132. package/registry/designs/store/form-field.d.ts +19 -0
  133. package/registry/designs/store/order-summary.d.ts +18 -0
  134. package/registry/designs/store/product-art.d.ts +26 -0
  135. package/registry/designs/store/product-card.d.ts +11 -0
  136. package/registry/designs/store/product-gallery.d.ts +11 -0
  137. package/registry/designs/store/product-grid.d.ts +10 -0
  138. package/registry/designs/store/product-page.d.ts +5 -0
  139. package/registry/designs/store/quantity-stepper.d.ts +13 -0
  140. package/registry/designs/store/shipping-method.d.ts +14 -0
  141. package/registry/designs/store/store-data.d.ts +53 -0
  142. package/registry/designs/store/store-design.d.ts +63 -0
  143. package/registry/designs/store/store-shell.d.ts +12 -0
  144. package/registry/designs/store/storefront-page.d.ts +4 -0
  145. package/registry/designs/store/variant-picker.d.ts +15 -0
  146. package/rsc.cjs +1 -1
  147. package/rsc.d.ts +2 -0
  148. package/rsc.mjs +1 -1
  149. package/scrolling.cjs +1 -0
  150. package/scrolling.mjs +22 -0
  151. package/utils/date/calendar.d.ts +44 -0
  152. package/utils/date/calendarModel.d.ts +46 -0
  153. package/utils/date/dateTime.d.ts +144 -0
  154. package/utils/date/fieldModel.d.ts +74 -0
  155. package/utils/date/format.d.ts +39 -0
  156. package/utils/date/iso.d.ts +40 -0
  157. package/utils/date/locale.d.ts +17 -0
  158. package/utils/date/parse.d.ts +20 -0
  159. package/utils/date/settings.d.ts +26 -0
  160. package/utils/date/value.d.ts +43 -0
  161. package/utils/date/zoneOptions.d.ts +19 -0
  162. package/utils/date/zones.d.ts +32 -0
  163. package/utils/scroll/scrollUtils.d.ts +6 -0
  164. package/utils/sortable/sortableUtils.d.ts +25 -0
  165. package/utils/swipe/swipeUtils.d.ts +53 -0
  166. package/utils/virtual/measuredWindow.d.ts +28 -0
  167. package/utils/virtual/rowSearch.d.ts +11 -0
package/behavior.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { c as e, l as t, s as n, t as r, u as i } from "./platform.mjs";
1
+ import { c as e, d as t, l as n, t as r, u 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";
@@ -33,24 +33,24 @@ function g() {
33
33
  let e = m.filter((e) => !m.some((t) => t !== e && h(e, t)));
34
34
  return e[e.length - 1];
35
35
  }
36
- function _(e) {
37
- let { enabled: r = !0, onDismiss: i, inside: o, escapeKey: s = !0, outsidePointer: c = !0 } = e, l = d(o), u = f(i);
36
+ function _(t) {
37
+ let { enabled: n = !0, onDismiss: r, inside: o, escapeKey: s = !0, outsidePointer: c = !0 } = t, l = d(o), u = f(r);
38
38
  a(() => {
39
- if (!r) return;
40
- let e = { elements: () => (l.current ?? []).map((e) => n(e)).filter((e) => e !== null) };
41
- m.push(e);
42
- let i = new AbortController(), a = (e, t) => document.addEventListener(e, t, { signal: i.signal });
43
- return s && a("keydown", (t) => {
44
- t.key !== "Escape" || t.defaultPrevented || g() === e && u("escape", t);
39
+ if (!n) return;
40
+ let t = { elements: () => (l.current ?? []).map((t) => e(t)).filter((e) => e !== null) };
41
+ m.push(t);
42
+ let r = new AbortController(), a = (e, t) => document.addEventListener(e, t, { signal: r.signal });
43
+ return s && a("keydown", (e) => {
44
+ e.key !== "Escape" || e.defaultPrevented || g() === t && u("escape", e);
45
45
  }), c && a("pointerdown", (e) => {
46
- t(e, l.current ?? []) || u("outside-pointer", e);
46
+ i(e, l.current ?? []) || u("outside-pointer", e);
47
47
  }), () => {
48
- i.abort();
49
- let t = m.indexOf(e);
50
- t !== -1 && m.splice(t, 1);
48
+ r.abort();
49
+ let e = m.indexOf(t);
50
+ e !== -1 && m.splice(e, 1);
51
51
  };
52
52
  }, [
53
- r,
53
+ n,
54
54
  s,
55
55
  c,
56
56
  u,
@@ -63,18 +63,18 @@ function v() {
63
63
  let e = r()?.activeElement;
64
64
  return e && e !== document.body ? e : null;
65
65
  }
66
- function y(t = {}) {
67
- let { enabled: n = !0, returnTo: r, preventScroll: i } = t, [a, o] = u(null), [s, l] = u(!1);
68
- n !== s && (l(n), n && o(v()));
66
+ function y(e = {}) {
67
+ let { enabled: t = !0, returnTo: r, preventScroll: i } = e, [a, o] = u(null), [s, l] = u(!1);
68
+ t !== s && (l(t), t && o(v()));
69
69
  let d = f(() => {
70
- (e(r) ?? a)?.focus({ preventScroll: i });
70
+ (n(r) ?? a)?.focus({ preventScroll: i });
71
71
  });
72
72
  return c(() => {
73
- if (n) return () => {
73
+ if (t) return () => {
74
74
  let e = document.activeElement;
75
75
  (!e || e === document.body || !document.contains(e)) && d();
76
76
  };
77
- }, [n, d]), { returnFocus: d };
77
+ }, [t, d]), { returnFocus: d };
78
78
  }
79
79
  //#endregion
80
80
  //#region src/react/a11y/useRovingFocus.ts
@@ -98,18 +98,18 @@ function C(e, t, n) {
98
98
  return S(e === 1 ? -1 : t, e, t, !1, n);
99
99
  }
100
100
  function w(e) {
101
- let { count: t, columns: n, columnIndexOf: r, 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({
101
+ 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 } = e, [D, O] = p({
102
102
  value: g,
103
103
  defaultValue: _,
104
104
  onChange: v
105
- }), k = Math.min(D, t - 1), A = n !== void 0, j = s((e) => typeof n == "function" ? n(e) : n ?? 0, [n]), M = s((e, t) => {
105
+ }), 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) => {
106
106
  let n = j(e);
107
- if (!r) return x(t, n - 1);
107
+ if (!i) return x(t, n - 1);
108
108
  if (n <= 0) return -1;
109
- let i = 0;
110
- for (; i + 1 < n && r(e, i + 1) <= t;) i++;
111
- return i;
112
- }, [r, j]), [N, P] = u(c), F = A && k >= 0 ? M(k, N) : -1, I = l([]), L = l(/* @__PURE__ */ new Map()), R = l(/* @__PURE__ */ new Map()), z = l(/* @__PURE__ */ new Map()), B = l({
109
+ let r = 0;
110
+ for (; r + 1 < n && i(e, r + 1) <= t;) r++;
111
+ return r;
112
+ }, [i, j]), [N, P] = u(c), F = A && k >= 0 ? M(k, N) : -1, I = l([]), L = l(/* @__PURE__ */ new Map()), R = l(/* @__PURE__ */ new Map()), z = l(/* @__PURE__ */ new Map()), B = l({
113
113
  query: "",
114
114
  at: 0
115
115
  }), V = s((e) => {
@@ -123,8 +123,8 @@ function w(e) {
123
123
  ]), G = d({
124
124
  row: k,
125
125
  column: F
126
- }), K = d(N), q = d(f), J = d(j), Y = d(M), X = d(r), Z = s((e, n, r) => {
127
- let i = x(e, t - 1), a = Math.max(0, n), o = i < 0 ? -1 : Y.current(i, a), s = G.current;
126
+ }), K = d(N), q = d(f), J = d(j), Y = d(M), X = d(i), Z = s((e, t, r) => {
127
+ let i = x(e, n - 1), a = Math.max(0, t), o = i < 0 ? -1 : Y.current(i, a), s = G.current;
128
128
  return i === s.row && o === s.column ? s : (O(i, r), P(a), q.current?.({
129
129
  row: i,
130
130
  column: o
@@ -136,14 +136,14 @@ function w(e) {
136
136
  G,
137
137
  Y,
138
138
  q,
139
- t,
139
+ n,
140
140
  O
141
- ]), Q = s((e, n, r) => {
142
- let i = x(e, t - 1), a = i < 0 ? -1 : x(Math.max(0, n), J.current(i) - 1);
141
+ ]), Q = s((e, t, r) => {
142
+ let i = x(e, n - 1), a = i < 0 ? -1 : x(Math.max(0, t), J.current(i) - 1);
143
143
  return Z(i, a < 0 ? 0 : X.current?.(i, a) ?? a, r);
144
144
  }, [
145
145
  X,
146
- t,
146
+ n,
147
147
  Z,
148
148
  J
149
149
  ]), ee = s((e, t) => {
@@ -172,7 +172,7 @@ function w(e) {
172
172
  T,
173
173
  O
174
174
  ]), $ = s((e) => {
175
- let { row: n, column: r } = G.current, o = (t, n) => {
175
+ let { row: r, column: i } = G.current, o = (t, n) => {
176
176
  e.preventDefault();
177
177
  let r = Q(t, n, {
178
178
  reason: "keyboard",
@@ -186,20 +186,20 @@ function w(e) {
186
186
  event: e
187
187
  });
188
188
  T && U(n.row, n.column);
189
- }, c = 2 ** 53 - 1, l = () => i(e.currentTarget) ? -1 : 1;
189
+ }, c = 2 ** 53 - 1, l = () => t(e.currentTarget) ? -1 : 1;
190
190
  switch (e.key) {
191
- case "ArrowRight": return o(n, r + l());
192
- case "ArrowLeft": return o(n, r - l());
193
- case "ArrowDown": return s(n + 1);
194
- case "ArrowUp": return s(n - 1);
195
- case "Home": return e.ctrlKey || e.metaKey ? o(0, 0) : o(n, 0);
196
- case "End": return e.ctrlKey || e.metaKey ? o(t - 1, c) : o(n, c);
197
- case "PageDown": return s(n + a);
198
- case "PageUp": return s(n - a);
191
+ case "ArrowRight": return o(r, i + l());
192
+ case "ArrowLeft": return o(r, i - l());
193
+ case "ArrowDown": return s(r + 1);
194
+ case "ArrowUp": return s(r - 1);
195
+ case "Home": return e.ctrlKey || e.metaKey ? o(0, 0) : o(r, 0);
196
+ case "End": return e.ctrlKey || e.metaKey ? o(n - 1, c) : o(r, c);
197
+ case "PageDown": return s(r + a);
198
+ case "PageUp": return s(r - a);
199
199
  }
200
200
  }, [
201
201
  G,
202
- t,
202
+ n,
203
203
  K,
204
204
  U,
205
205
  T,
@@ -218,31 +218,31 @@ function w(e) {
218
218
  $(e);
219
219
  return;
220
220
  }
221
- let n = m !== "horizontal", r = m !== "vertical", a = B.current, s = o.isOpen(a, e.timeStamp), c = (t, n) => {
221
+ let r = m !== "horizontal", i = m !== "vertical", a = B.current, s = o.isOpen(a, e.timeStamp), c = (t, n) => {
222
222
  t !== -1 && t !== k && (e.preventDefault(), O(t, {
223
223
  reason: n,
224
224
  event: e
225
225
  }), T && V(t));
226
226
  };
227
- if (r && (e.key === "ArrowRight" || e.key === "ArrowLeft")) {
228
- let n = e.key === "ArrowRight" !== i(e.currentTarget);
229
- c(S(k, n ? 1 : -1, t, h, y), "keyboard");
227
+ if (i && (e.key === "ArrowRight" || e.key === "ArrowLeft")) {
228
+ let r = e.key === "ArrowRight" !== t(e.currentTarget);
229
+ c(S(k, r ? 1 : -1, n, h, y), "keyboard");
230
230
  return;
231
231
  }
232
- if (e.key === "ArrowDown" && n) {
233
- c(S(k, 1, t, h, y), "keyboard");
232
+ if (e.key === "ArrowDown" && r) {
233
+ c(S(k, 1, n, h, y), "keyboard");
234
234
  return;
235
235
  }
236
- if (e.key === "ArrowUp" && n) {
237
- c(S(k, -1, t, h, y), "keyboard");
236
+ if (e.key === "ArrowUp" && r) {
237
+ c(S(k, -1, n, h, y), "keyboard");
238
238
  return;
239
239
  }
240
240
  if (e.key === "Home") {
241
- c(C(1, t, y), "keyboard");
241
+ c(C(1, n, y), "keyboard");
242
242
  return;
243
243
  }
244
244
  if (e.key === "End") {
245
- c(C(-1, t, y), "keyboard");
245
+ c(C(-1, n, y), "keyboard");
246
246
  return;
247
247
  }
248
248
  if (e.key === "Enter" || e.key === " " && !(s && w)) {
@@ -251,12 +251,12 @@ function w(e) {
251
251
  return;
252
252
  }
253
253
  if (w && o.isPrintable(e)) {
254
- let n = o.push(a, e.key, e.timeStamp);
255
- c(o.target(n, k, t, w, y), "typeahead");
254
+ let t = o.push(a, e.key, e.timeStamp);
255
+ c(o.target(t, k, n, w, y), "typeahead");
256
256
  }
257
257
  }, [
258
258
  k,
259
- t,
259
+ n,
260
260
  V,
261
261
  T,
262
262
  y,
package/box.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./rolldown-runtime.cjs"),t=require("./react-shared.cjs"),n=require("./client.cjs");let r=require("react");r=e.t(r,1);let i=require("@box-kite/core");function a({tag:e,tagProps:t,render:n}){let[i,a]=(0,r.useState)(!1);return r.default.createElement(e,{...t,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)},n({isHover:i}))}function o(e,i){let{tag:o=`div`,children:s}=e,{classNames:c,styleElements:l}=n.i(e,o===`svg`),u=t.d(e,c);i&&(u.ref=i);let d=typeof s==`function`?r.default.createElement(a,{tag:o,tagProps:u,render:s}):r.default.createElement(o,u,s);return l?r.default.createElement(r.default.Fragment,null,l,d):d}var s=t.f(o,`Box`);s.extend=i.BoxExtends.extend,s.components=i.BoxExtends.components,s.keyframes=i.BoxExtends.keyframes,s.spring=i.Springs.spring,s.Theme=n.n,s.useTheme=n.n.useTheme,s.getVariableValue=e=>(0,i.getDefaultEngine)().getVariableValue(e),s.configure=n.r.configure,s.viewTransition=i.startViewTransition;function c(e,r){return t.p(n.i(e,r?.svg===!0),e.className)}exports.default=s,exports.useBoxElement=o,exports.useClassNames=c,exports.useVisibility=n.a;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./rolldown-runtime.cjs"),t=require("./react-shared.cjs"),n=require("./client.cjs");let r=require("react");r=e.t(r,1);let i=require("@box-kite/core");function a({tag:e,tagProps:t,render:n}){let[i,a]=(0,r.useState)(!1);return r.default.createElement(e,{...t,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)},n({isHover:i}))}function o(e,i){let{tag:o=`div`,children:s}=e,{classNames:c,styleElements:l}=n.i(e,o===`svg`),u=t.d(e,c);i&&(u.ref=i);let d=typeof s==`function`?r.default.createElement(a,{tag:o,tagProps:u,render:s}):r.default.createElement(o,u,s);return l?r.default.createElement(r.default.Fragment,null,l,d):d}var s=t.f(o,`Box`);s.extend=i.BoxExtends.extend,s.components=i.BoxExtends.components,s.createComponents=i.BoxExtends.createComponents,s.Components=n.o,s.keyframes=i.BoxExtends.keyframes,s.spring=i.Springs.spring,s.Theme=n.n,s.useTheme=n.n.useTheme,s.getVariableValue=e=>(0,i.getDefaultEngine)().getVariableValue(e),s.configure=n.r.configure,s.viewTransition=i.startViewTransition;function c(e,r){return t.p(n.i(e,r?.svg===!0),e.className)}exports.default=s,exports.useBoxElement=o,exports.useClassNames=c,exports.useVisibility=n.a;
package/box.d.ts CHANGED
@@ -2,6 +2,7 @@ import { default as React, Ref, RefAttributes } from 'react';
2
2
  import { BoxExtends, Springs, startViewTransition } from '@box-kite/core';
3
3
  import { BoxClassNames } from './react/boxClassNames';
4
4
  import { BoxClassNameProps, BoxCoreProps } from './react/boxProps';
5
+ import { default as Components } from './react/componentsProvider';
5
6
  import { default as useVisibility } from './react/hooks/useVisibility';
6
7
  import { ExtractElementFromTag } from './react/reactTypes';
7
8
  import { default as Theme } from './react/theme/theme';
@@ -20,6 +21,10 @@ interface BoxType {
20
21
  <TTag extends keyof React.JSX.IntrinsicElements = 'div', TKey extends keyof ComponentsAndVariants = never>(props: BoxCoreProps<TTag, TKey> & RefAttributes<ExtractElementFromTag<TTag>>): React.ReactNode;
21
22
  extend: typeof BoxExtends.extend;
22
23
  components: typeof BoxExtends.components;
24
+ /** A design for one subtree, registered nowhere: hand it to `<Box.Components value>` or `<Box.Theme components>`. */
25
+ createComponents: typeof BoxExtends.createComponents;
26
+ /** Every Box below resolves its `component` against this registry instead of the app's `Box.components()`. */
27
+ Components: typeof Components;
23
28
  keyframes: typeof BoxExtends.keyframes;
24
29
  /** A spring of your own, sampled into `{ easing, duration }` — the two halves the timing and duration props take. */
25
30
  spring: typeof Springs.spring;
package/box.mjs CHANGED
@@ -1,30 +1,30 @@
1
1
  import { d as e, f as t, p as n } from "./react-shared.mjs";
2
- import { a as r, i, n as a, r as o } from "./client.mjs";
3
- import s, { useState as c } from "react";
4
- import { BoxExtends as l, Springs as u, getDefaultEngine as d, startViewTransition as f } from "@box-kite/core";
2
+ import { a as r, i, n as a, o, r as s } from "./client.mjs";
3
+ import c, { useState as l } from "react";
4
+ import { BoxExtends as u, Springs as d, getDefaultEngine as f, startViewTransition as p } from "@box-kite/core";
5
5
  //#region src/box.ts
6
- function p({ tag: e, tagProps: t, render: n }) {
7
- let [r, i] = c(!1);
8
- return s.createElement(e, {
6
+ function m({ tag: e, tagProps: t, render: n }) {
7
+ let [r, i] = l(!1);
8
+ return c.createElement(e, {
9
9
  ...t,
10
10
  onMouseEnter: () => i(!0),
11
11
  onMouseLeave: () => i(!1)
12
12
  }, n({ isHover: r }));
13
13
  }
14
- function m(t, n) {
15
- let { tag: r = "div", children: a } = t, { classNames: o, styleElements: c } = i(t, r === "svg"), l = e(t, o);
14
+ function h(t, n) {
15
+ let { tag: r = "div", children: a } = t, { classNames: o, styleElements: s } = i(t, r === "svg"), l = e(t, o);
16
16
  n && (l.ref = n);
17
- let u = typeof a == "function" ? s.createElement(p, {
17
+ let u = typeof a == "function" ? c.createElement(m, {
18
18
  tag: r,
19
19
  tagProps: l,
20
20
  render: a
21
- }) : s.createElement(r, l, a);
22
- return c ? s.createElement(s.Fragment, null, c, u) : u;
21
+ }) : c.createElement(r, l, a);
22
+ return s ? c.createElement(c.Fragment, null, s, u) : u;
23
23
  }
24
- var h = t(m, "Box");
25
- h.extend = l.extend, h.components = l.components, h.keyframes = l.keyframes, h.spring = u.spring, h.Theme = a, h.useTheme = a.useTheme, h.getVariableValue = (e) => d().getVariableValue(e), h.configure = o.configure, h.viewTransition = f;
26
- function g(e, t) {
24
+ var g = t(h, "Box");
25
+ g.extend = u.extend, g.components = u.components, g.createComponents = u.createComponents, g.Components = o, g.keyframes = u.keyframes, g.spring = d.spring, g.Theme = a, g.useTheme = a.useTheme, g.getVariableValue = (e) => f().getVariableValue(e), g.configure = s.configure, g.viewTransition = p;
26
+ function _(e, t) {
27
27
  return n(i(e, t?.svg === !0), e.className);
28
28
  }
29
29
  //#endregion
30
- export { h as default, m as useBoxElement, g as useClassNames, r as useVisibility };
30
+ export { g as default, h as useBoxElement, _ as useClassNames, r as useVisibility };