@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
@@ -0,0 +1,2 @@
1
+ import { SvgProps } from '../components/svg';
2
+ export default function CloseIcon(props: SvgProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SvgProps } from '../components/svg';
2
+ export default function FilterIcon(props: SvgProps): import("react").JSX.Element;
package/layer.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./platform.cjs"),t=require("./effects.cjs"),n=require("./behavior.cjs"),r=require("./identity.cjs");let i=require("react");var a=()=>()=>{},o=()=>!0;function s(){return(0,i.useSyncExternalStore)(a,e.a,o)}function c(a){let{haspopup:o,id:c,idPrefix:l,open:u,defaultOpen:d=!1,onOpenChange:f,onOpened:p,onClosing:m,inside:h}=a,g=r.t(l),_=c??g,[v,y]=n.i({value:u,defaultValue:d,onChange:f}),[b,x]=(0,i.useState)(null),[S,C]=(0,i.useState)(null),w=s(),[T,E]=(0,i.useState)(!1),[D,O]=(0,i.useState)(),k=(0,i.useRef)(`imperative`),A=(0,i.useRef)(!1),j=n.a(p),M=n.a(m),N=n.a(e=>{let t=e.newState===`open`,n=e.currentTarget;if(t&&u===!1){e.preventDefault(),setTimeout(()=>y(!0,{reason:`trigger`,event:e}));return}t||(A.current=n.contains(document.activeElement),M(A.current,b)),E(t);let r=t?`trigger`:k.current;k.current=`imperative`,y(t,{reason:r,event:e})}),P=n.a(e=>{let t=e.currentTarget;e.newState===`open`&&j(t)});t.n(()=>{if(!w||!S)return;let e=new AbortController;return S.addEventListener(`beforetoggle`,N,{signal:e.signal}),S.addEventListener(`toggle`,P,{signal:e.signal}),()=>e.abort()},[w,S,N,P]),t.n(()=>{!w||!e.a()||!S||v===T||(v?S.showPopover():S.hidePopover())},[v,T,S,w]),t.n(()=>{if(!w||!v)return;let t=new AbortController,n=(e,n)=>document.addEventListener(e,n,{signal:t.signal,capture:!0});return n(`keydown`,e=>{e.key===`Escape`&&(k.current=`escape`)}),n(`pointerdown`,t=>{let n=!!b&&e.l(t,[b]);k.current=n?`trigger`:`outside-pointer`}),()=>t.abort()},[w,v,b]),t.n(()=>{b&&(b.id||b.setAttribute(`id`,`${_}-trigger`),O(b.id))},[b,_]),t.n(()=>{if(!(!w||!b))return b.setAttribute(`popovertarget`,_),()=>b.removeAttribute(`popovertarget`)},[w,b,_]),t.n(()=>{w||!v||!S||j(S)},[w,v,S,j]),n.r({enabled:!w&&v,inside:[S,b,...h??[]],onDismiss:(e,t)=>y(!1,{reason:e,event:t})}),n.n({enabled:!w&&v,returnTo:b});let F=n.a(e=>{y(e=>!e,{reason:`trigger`,event:e})});return{platform:w,isOpen:v,setOpen:y,id:_,trigger:(0,i.useMemo)(()=>({ref:x,props:{"aria-expanded":v,"aria-haspopup":o,"aria-controls":v?_:void 0,...w?{}:{onClick:F}}}),[F,o,v,_,w]),triggerElement:b,triggerId:D,setPanel:C,panelElement:S}}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
1
+ const e=require("./platform.cjs"),t=require("./effects.cjs"),n=require("./behavior.cjs"),r=require("./identity.cjs");let i=require("react");var a=()=>()=>{},o=()=>!0;function s(){return(0,i.useSyncExternalStore)(a,e.o,o)}function c(a){let{haspopup:o,id:c,idPrefix:l,open:u,defaultOpen:d=!1,onOpenChange:f,onOpened:p,onClosing:m,inside:h}=a,g=r.t(l),_=c??g,[v,y]=n.i({value:u,defaultValue:d,onChange:f}),[b,x]=(0,i.useState)(null),[S,C]=(0,i.useState)(null),w=s(),[T,E]=(0,i.useState)(!1),[D,O]=(0,i.useState)(),k=(0,i.useRef)(`imperative`),A=(0,i.useRef)(!1),j=n.a(p),M=n.a(m),N=n.a(e=>{let t=e.newState===`open`,n=e.currentTarget;if(t&&u===!1){e.preventDefault(),setTimeout(()=>y(!0,{reason:`trigger`,event:e}));return}t||(A.current=n.contains(document.activeElement),M(A.current,b)),E(t);let r=t?`trigger`:k.current;k.current=`imperative`,y(t,{reason:r,event:e})}),P=n.a(e=>{let t=e.currentTarget;e.newState===`open`&&j(t)});t.n(()=>{if(!w||!S)return;let e=new AbortController;return S.addEventListener(`beforetoggle`,N,{signal:e.signal}),S.addEventListener(`toggle`,P,{signal:e.signal}),()=>e.abort()},[w,S,N,P]),t.n(()=>{!w||!e.o()||!S||v===T||(v?S.showPopover():S.hidePopover())},[v,T,S,w]),t.n(()=>{if(!w||!v)return;let t=new AbortController,n=(e,n)=>document.addEventListener(e,n,{signal:t.signal,capture:!0});return n(`keydown`,e=>{e.key===`Escape`&&(k.current=`escape`)}),n(`pointerdown`,t=>{let n=!!b&&e.u(t,[b]);k.current=n?`trigger`:`outside-pointer`}),()=>t.abort()},[w,v,b]),t.n(()=>{b&&(b.id||b.setAttribute(`id`,`${_}-trigger`),O(b.id))},[b,_]),t.n(()=>{if(!(!w||!b))return b.setAttribute(`popovertarget`,_),()=>b.removeAttribute(`popovertarget`)},[w,b,_]),t.n(()=>{w||!v||!S||j(S)},[w,v,S,j]),n.r({enabled:!w&&v,inside:[S,b,...h??[]],onDismiss:(e,t)=>y(!1,{reason:e,event:t})}),n.n({enabled:!w&&v,returnTo:b});let F=n.a(e=>{y(e=>!e,{reason:`trigger`,event:e})});return{platform:w,isOpen:v,setOpen:y,id:_,trigger:(0,i.useMemo)(()=>({ref:x,props:{"aria-expanded":v,"aria-haspopup":o,"aria-controls":v?_:void 0,...w?{}:{onClick:F}}}),[F,o,v,_,w]),triggerElement:b,triggerId:D,setPanel:C,panelElement:S}}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
package/layer.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, l as t } from "./platform.mjs";
1
+ import { o as e, u as t } from "./platform.mjs";
2
2
  import { n } from "./effects.mjs";
3
3
  import { a as r, i, n as a, r as o } from "./behavior.mjs";
4
4
  import { t as s } from "./identity.mjs";
package/mcp/src/data.d.ts CHANGED
@@ -75,6 +75,8 @@ export declare const rules: readonly RuleRecord[];
75
75
  export declare const priorFacts: readonly string[];
76
76
  export declare const blocks: readonly RegistryItem[];
77
77
  export declare const blockInstall: (name: string) => string;
78
+ /** The page a registry item is shown on — running in light and dark, with every file — if it has one. */
79
+ export declare const blockPage: (name: string) => string | undefined;
78
80
  /**
79
81
  * A fresh engine with readable class names, no DOM and no console: what `check_styles` judges a value with. One
80
82
  * per call rather than one for the process, so a caller's `vars` or `css` cannot leak into the next
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box-kite/react",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "pages/**"
@@ -44,6 +44,11 @@
44
44
  "import": "./interop.mjs",
45
45
  "require": "./interop.cjs"
46
46
  },
47
+ "./date": {
48
+ "types": "./date.d.ts",
49
+ "import": "./date.mjs",
50
+ "require": "./date.cjs"
51
+ },
47
52
  "./spec": {
48
53
  "types": "./spec.d.ts",
49
54
  "import": "./spec.mjs",
@@ -71,6 +76,7 @@
71
76
  "smoke:next-app": "npm --prefix examples/next-app run smoke",
72
77
  "build:pages": "vite build ./pages --config ./pages.vite.config.ts --outDir ../dist-pages --mode production && npm run prerender:pages",
73
78
  "prerender:pages": "node scripts/prerender-pages.mjs",
79
+ "snapshot:templates": "node scripts/snapshot-templates.mjs",
74
80
  "preview": "vite preview ./pages --config ./pages.vite.config.ts --outDir ../dist-pages",
75
81
  "build": "npm run build:core && vite build",
76
82
  "build:core": "vite build --config vite.core.config.ts && node scripts/postbuild-core.mjs",
@@ -116,7 +122,7 @@
116
122
  "./themeReveal-*"
117
123
  ],
118
124
  "gzip": true,
119
- "limit": "37.64 KB"
125
+ "limit": "39.45 KB"
120
126
  },
121
127
  {
122
128
  "name": "Box in a Server Component (react-server entry)",
@@ -128,7 +134,7 @@
128
134
  "./themeReveal-*"
129
135
  ],
130
136
  "gzip": true,
131
- "limit": "35.73 KB"
137
+ "limit": "37.47 KB"
132
138
  },
133
139
  {
134
140
  "name": "Behavior primitives (a11y entry)",
@@ -164,7 +170,7 @@
164
170
  "./themeReveal-*"
165
171
  ],
166
172
  "gzip": true,
167
- "limit": "55.68 KB"
173
+ "limit": "61.11 KB"
168
174
  },
169
175
  {
170
176
  "name": "Spec renderer (spec entry)",
@@ -190,11 +196,23 @@
190
196
  "gzip": true,
191
197
  "limit": "4 KB"
192
198
  },
199
+ {
200
+ "name": "Dates, times and zones (date entry, no React)",
201
+ "path": "dist/date.mjs",
202
+ "ignore": [
203
+ "react",
204
+ "react-dom",
205
+ "./diagnostics-*",
206
+ "./themeReveal-*"
207
+ ],
208
+ "gzip": true,
209
+ "limit": "7.59 KB"
210
+ },
193
211
  {
194
212
  "name": "Core engine (@box-kite/core, no React)",
195
213
  "path": "dist-core/core.mjs",
196
214
  "gzip": true,
197
- "limit": "36.95 KB",
215
+ "limit": "38.68 KB",
198
216
  "ignore": [
199
217
  "./diagnostics-*",
200
218
  "./themeReveal-*"
@@ -210,7 +228,7 @@
210
228
  "./themeReveal-*"
211
229
  ],
212
230
  "gzip": true,
213
- "limit": "39.70 KB"
231
+ "limit": "41.54 KB"
214
232
  },
215
233
  {
216
234
  "name": "Popover",
@@ -222,7 +240,7 @@
222
240
  "./themeReveal-*"
223
241
  ],
224
242
  "gzip": true,
225
- "limit": "41.24 KB"
243
+ "limit": "43.07 KB"
226
244
  },
227
245
  {
228
246
  "name": "Menu",
@@ -234,7 +252,7 @@
234
252
  "./themeReveal-*"
235
253
  ],
236
254
  "gzip": true,
237
- "limit": "43.48 KB"
255
+ "limit": "45.31 KB"
238
256
  },
239
257
  {
240
258
  "name": "Accordion",
@@ -246,7 +264,7 @@
246
264
  "./themeReveal-*"
247
265
  ],
248
266
  "gzip": true,
249
- "limit": "38.97 KB"
267
+ "limit": "40.78 KB"
250
268
  },
251
269
  {
252
270
  "name": "Agent",
@@ -258,7 +276,7 @@
258
276
  "./themeReveal-*"
259
277
  ],
260
278
  "gzip": true,
261
- "limit": "39.72 KB"
279
+ "limit": "41.56 KB"
262
280
  },
263
281
  {
264
282
  "name": "Markdown",
@@ -270,7 +288,55 @@
270
288
  "./themeReveal-*"
271
289
  ],
272
290
  "gzip": true,
273
- "limit": "38.21 KB"
291
+ "limit": "40.04 KB"
292
+ },
293
+ {
294
+ "name": "List",
295
+ "path": "dist/components/list.mjs",
296
+ "ignore": [
297
+ "react",
298
+ "react-dom",
299
+ "./diagnostics-*",
300
+ "./themeReveal-*"
301
+ ],
302
+ "gzip": true,
303
+ "limit": "41.36 KB"
304
+ },
305
+ {
306
+ "name": "SwipeItem",
307
+ "path": "dist/components/swipeItem.mjs",
308
+ "ignore": [
309
+ "react",
310
+ "react-dom",
311
+ "./diagnostics-*",
312
+ "./themeReveal-*"
313
+ ],
314
+ "gzip": true,
315
+ "limit": "44.44 KB"
316
+ },
317
+ {
318
+ "name": "SortableList",
319
+ "path": "dist/components/sortableList.mjs",
320
+ "ignore": [
321
+ "react",
322
+ "react-dom",
323
+ "./diagnostics-*",
324
+ "./themeReveal-*"
325
+ ],
326
+ "gzip": true,
327
+ "limit": "44.72 KB"
328
+ },
329
+ {
330
+ "name": "VirtualList",
331
+ "path": "dist/components/virtualList.mjs",
332
+ "ignore": [
333
+ "react",
334
+ "react-dom",
335
+ "./diagnostics-*",
336
+ "./themeReveal-*"
337
+ ],
338
+ "gzip": true,
339
+ "limit": "43.53 KB"
274
340
  },
275
341
  {
276
342
  "name": "Skeleton",
@@ -282,7 +348,7 @@
282
348
  "./themeReveal-*"
283
349
  ],
284
350
  "gzip": true,
285
- "limit": "37.54 KB"
351
+ "limit": "39.39 KB"
286
352
  },
287
353
  {
288
354
  "name": "Tabs",
@@ -294,7 +360,7 @@
294
360
  "./themeReveal-*"
295
361
  ],
296
362
  "gzip": true,
297
- "limit": "40.14 KB"
363
+ "limit": "41.99 KB"
298
364
  },
299
365
  {
300
366
  "name": "Slider",
@@ -306,7 +372,7 @@
306
372
  "./themeReveal-*"
307
373
  ],
308
374
  "gzip": true,
309
- "limit": "39.32 KB"
375
+ "limit": "41.16 KB"
310
376
  },
311
377
  {
312
378
  "name": "Progress",
@@ -318,7 +384,7 @@
318
384
  "./themeReveal-*"
319
385
  ],
320
386
  "gzip": true,
321
- "limit": "37.52 KB"
387
+ "limit": "39.34 KB"
322
388
  },
323
389
  {
324
390
  "name": "Toaster",
@@ -330,7 +396,67 @@
330
396
  "./themeReveal-*"
331
397
  ],
332
398
  "gzip": true,
333
- "limit": "40.92 KB"
399
+ "limit": "42.77 KB"
400
+ },
401
+ {
402
+ "name": "DateField",
403
+ "path": "dist/components/dateField.mjs",
404
+ "ignore": [
405
+ "react",
406
+ "react-dom",
407
+ "./diagnostics-*",
408
+ "./themeReveal-*"
409
+ ],
410
+ "gzip": true,
411
+ "limit": "47.97 KB"
412
+ },
413
+ {
414
+ "name": "Calendar",
415
+ "path": "dist/components/calendar.mjs",
416
+ "ignore": [
417
+ "react",
418
+ "react-dom",
419
+ "./diagnostics-*",
420
+ "./themeReveal-*"
421
+ ],
422
+ "gzip": true,
423
+ "limit": "47.39 KB"
424
+ },
425
+ {
426
+ "name": "DatePicker",
427
+ "path": "dist/components/datePicker.mjs",
428
+ "ignore": [
429
+ "react",
430
+ "react-dom",
431
+ "./diagnostics-*",
432
+ "./themeReveal-*"
433
+ ],
434
+ "gzip": true,
435
+ "limit": "60.07 KB"
436
+ },
437
+ {
438
+ "name": "DateTime",
439
+ "path": "dist/components/dateTime.mjs",
440
+ "ignore": [
441
+ "react",
442
+ "react-dom",
443
+ "./diagnostics-*",
444
+ "./themeReveal-*"
445
+ ],
446
+ "gzip": true,
447
+ "limit": "42.9 KB"
448
+ },
449
+ {
450
+ "name": "TimeZoneSelect",
451
+ "path": "dist/components/timeZoneSelect.mjs",
452
+ "ignore": [
453
+ "react",
454
+ "react-dom",
455
+ "./diagnostics-*",
456
+ "./themeReveal-*"
457
+ ],
458
+ "gzip": true,
459
+ "limit": "50.51 KB"
334
460
  },
335
461
  {
336
462
  "name": "Combobox",
@@ -342,7 +468,7 @@
342
468
  "./themeReveal-*"
343
469
  ],
344
470
  "gzip": true,
345
- "limit": "46.75 KB"
471
+ "limit": "48.58 KB"
346
472
  },
347
473
  {
348
474
  "name": "Dashboard",
@@ -354,7 +480,7 @@
354
480
  "./themeReveal-*"
355
481
  ],
356
482
  "gzip": true,
357
- "limit": "43.14 KB"
483
+ "limit": "45.01 KB"
358
484
  },
359
485
  {
360
486
  "name": "DataGrid",
@@ -363,10 +489,12 @@
363
489
  "react",
364
490
  "react-dom",
365
491
  "./diagnostics-*",
366
- "./themeReveal-*"
492
+ "./themeReveal-*",
493
+ "../dataGridList.mjs",
494
+ "../dataGridDateParts.mjs"
367
495
  ],
368
496
  "gzip": true,
369
- "limit": "89.87 KB"
497
+ "limit": "94.65 KB"
370
498
  },
371
499
  {
372
500
  "name": "DataGrid export, the chunk fetched on the first press",
@@ -380,6 +508,34 @@
380
508
  "gzip": true,
381
509
  "limit": "3.8 KB"
382
510
  },
511
+ {
512
+ "name": "DataGrid list layout, the chunk a narrow grid fetches on top of the grid",
513
+ "path": "dist/dataGridList.mjs",
514
+ "ignore": [
515
+ "react",
516
+ "react-dom",
517
+ "./diagnostics-*",
518
+ "./themeReveal-*",
519
+ "./box.mjs",
520
+ "./components/*"
521
+ ],
522
+ "gzip": true,
523
+ "limit": "7.83 KB"
524
+ },
525
+ {
526
+ "name": "DataGrid dates, the chunk a grid with a date column fetches on top of the grid",
527
+ "path": "dist/dataGridDateParts.mjs",
528
+ "ignore": [
529
+ "react",
530
+ "react-dom",
531
+ "./diagnostics-*",
532
+ "./themeReveal-*",
533
+ "./box.mjs",
534
+ "./components/*"
535
+ ],
536
+ "gzip": true,
537
+ "limit": "7.49 KB"
538
+ },
383
539
  {
384
540
  "name": "Full library (Box + ssg + every component)",
385
541
  "path": "dev/size-full.mjs",
@@ -390,7 +546,7 @@
390
546
  "./themeReveal-*"
391
547
  ],
392
548
  "gzip": true,
393
- "limit": "120.60 KB"
549
+ "limit": "162.25 KB"
394
550
  }
395
551
  ],
396
552
  "repository": {
@@ -430,7 +586,7 @@
430
586
  "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
431
587
  },
432
588
  "dependencies": {
433
- "@box-kite/core": "2.2.4",
589
+ "@box-kite/core": "2.2.6",
434
590
  "csstype": "^3.2.3",
435
591
  "use-sync-external-store": "^1.6.0"
436
592
  },
package/placement.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./platform.cjs"),t=require("./effects.cjs"),n=require("./identity.cjs");let r=require("react");var i={top:`bottom`,bottom:`top`,start:`end`,end:`start`};function a(e){return e===`top`||e===`bottom`}function o(e,t){let n=a(e),r=n?e===`top`?`block-start`:`block-end`:e===`start`?`inline-start`:`inline-end`,i=t===`center`?`span-all`:`span-${n?`inline`:`block`}-${t===`start`?`end`:`start`}`;return n?`${r} ${i}`:`${i} ${r}`}function s(e){let[t,n]=e.trim().split(` `);return n===void 0?t===`block-start`?`top`:t===`block-end`?`bottom`:t===`inline-start`?`start`:t===`inline-end`?`end`:null:t===`start`?`top`:t===`end`?`bottom`:n===`start`?`start`:n===`end`?`end`:null}function c(e){return a(e)?`flip-block, flip-inline, flip-block flip-inline`:`flip-inline, flip-block, flip-inline flip-block`}function l(e,t,n,r){let i=u(t,r);return i===`top`?e.top-n.top:i===`bottom`?n.top+n.height-(e.top+e.height):i===`left`?e.left-n.left:n.left+n.width-(e.left+e.width)}function u(e,t){return e===`top`||e===`bottom`?e:e===`start`===t?`right`:`left`}function d(e,t,n,r){return Math.max(n,Math.min(e,n+r-t))}function f(e,t,n,r){let{align:o,offset:s,flip:c,rtl:f}=r,p=(a(r.side)?t.height:t.width)+s,m=c&&l(e,r.side,n,f)<p&&l(e,i[r.side],n,f)>=p?i[r.side]:r.side,h=u(m,f),g={top:e.top-t.height-s,bottom:e.top+e.height+s,left:e.left-t.width-s,right:e.left+e.width+s}[h],_=a(m),v=_?e.left:e.top,y=_?e.width:e.height,b=_?t.width:t.height,x=o===`center`?v+y/2-b/2:o===`start`===(_&&f)?v+y-b:v,S=_?d(x,t.width,n.left,n.width):d(x,t.height,n.top,n.height);return _?{top:g,left:S,side:m}:{top:S,left:g,side:m}}var p=4,m=16,h={top:`mb`,bottom:`mt`,start:`me`,end:`ms`};function g(){return typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`anchor-name: --a`)}function _(){let e=typeof document>`u`?null:document.documentElement,t=e?parseFloat(getComputedStyle(e).fontSize):NaN;return Number.isFinite(t)&&t>0?t:m}function v(e){let{top:t,left:n,width:r,height:i}=e.getBoundingClientRect();return{top:t,left:n,width:r,height:i}}function y(e,t){return e!==null&&e.top===t.top&&e.left===t.left&&e.side===t.side&&e.anchorWidth===t.anchorWidth}function b(i={}){let{side:a=`bottom`,align:l=`center`,offset:u=0,flip:d=!0,matchWidth:m=!1,name:b,anchor:x,trackSide:S=!1}=i,C=n.t(`anchor`),w=`--${(b??C).replace(/^--/,``)}`,[T,E]=(0,r.useState)(!0),[D,O]=(0,r.useState)(null),[k,A]=(0,r.useState)(null),[j,M]=(0,r.useState)(null),[N,P]=(0,r.useState)(null);t.n(()=>{g()||E(!1)},[]),t.n(()=>{let t=e.c(x);if(t)return t.style.setProperty(`anchor-name`,w),()=>{t.style.removeProperty(`anchor-name`)}},[x,w]),t.n(()=>{!T||!S||!k||P(s(getComputedStyle(k).getPropertyValue(`position-area`)))},[T,S,k,a,l,d]),t.n(()=>{let t=e.c(x)??D;if(T||!t||!k)return;let n=()=>{let n=v(t),r=v(k),i={top:0,left:0,width:window.innerWidth,height:window.innerHeight},o=m?Math.max(r.width,n.width):r.width,s={...f(n,{...r,width:o},i,{side:a,align:l,offset:u/p*_(),flip:d,rtl:e.u(t)}),anchorWidth:n.width};M(e=>y(e,s)?e:s)};n();let r=new AbortController;return document.addEventListener(`scroll`,n,{signal:r.signal,capture:!0,passive:!0}),window.addEventListener(`resize`,n,{signal:r.signal,passive:!0}),()=>r.abort()},[T,x,D,k,a,l,u,d,m]);let F=(0,r.useCallback)(e=>O(e),[]),I=(0,r.useCallback)(e=>A(e),[]),L={ref:T?void 0:F,style:{anchorName:w}};return T?{css:T,side:N??a,anchorProps:L,layerProps:{...S?{ref:I}:{},position:`fixed`,positionArea:o(a,l),...d?{positionTryFallbacks:c(a)}:{},...m?{minWidth:`anchor-size(width)`}:{},...u?{[h[a]]:u}:{},style:{positionAnchor:w}}}:{css:T,side:j?.side??a,anchorProps:L,layerProps:{ref:I,position:`fixed`,style:j?{top:`${j.top}px`,left:`${j.left}px`,...m?{minWidth:`${j.anchorWidth}px`}:{}}:{top:0,left:0,visibility:`hidden`}}}}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return b}});
1
+ const e=require("./platform.cjs"),t=require("./effects.cjs"),n=require("./identity.cjs");let r=require("react");var i={top:`bottom`,bottom:`top`,start:`end`,end:`start`};function a(e){return e===`top`||e===`bottom`}function o(e,t){let n=a(e),r=n?e===`top`?`block-start`:`block-end`:e===`start`?`inline-start`:`inline-end`,i=t===`center`?`span-all`:`span-${n?`inline`:`block`}-${t===`start`?`end`:`start`}`;return n?`${r} ${i}`:`${i} ${r}`}function s(e){let[t,n]=e.trim().split(` `);return n===void 0?t===`block-start`?`top`:t===`block-end`?`bottom`:t===`inline-start`?`start`:t===`inline-end`?`end`:null:t===`start`?`top`:t===`end`?`bottom`:n===`start`?`start`:n===`end`?`end`:null}function c(e){return a(e)?`flip-block, flip-inline, flip-block flip-inline`:`flip-inline, flip-block, flip-inline flip-block`}function l(e,t,n,r){let i=u(t,r);return i===`top`?e.top-n.top:i===`bottom`?n.top+n.height-(e.top+e.height):i===`left`?e.left-n.left:n.left+n.width-(e.left+e.width)}function u(e,t){return e===`top`||e===`bottom`?e:e===`start`===t?`right`:`left`}function d(e,t,n,r){return Math.max(n,Math.min(e,n+r-t))}function f(e,t,n,r){let{align:o,offset:s,flip:c,rtl:f}=r,p=(a(r.side)?t.height:t.width)+s,m=c&&l(e,r.side,n,f)<p&&l(e,i[r.side],n,f)>=p?i[r.side]:r.side,h=u(m,f),g={top:e.top-t.height-s,bottom:e.top+e.height+s,left:e.left-t.width-s,right:e.left+e.width+s}[h],_=a(m),v=_?e.left:e.top,y=_?e.width:e.height,b=_?t.width:t.height,x=o===`center`?v+y/2-b/2:o===`start`===(_&&f)?v+y-b:v,S=_?d(x,t.width,n.left,n.width):d(x,t.height,n.top,n.height);return _?{top:g,left:S,side:m}:{top:S,left:g,side:m}}var p=4,m=16,h={top:`mb`,bottom:`mt`,start:`me`,end:`ms`};function g(){return typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`anchor-name: --a`)}function _(){let e=typeof document>`u`?null:document.documentElement,t=e?parseFloat(getComputedStyle(e).fontSize):NaN;return Number.isFinite(t)&&t>0?t:m}function v(e){let{top:t,left:n,width:r,height:i}=e.getBoundingClientRect();return{top:t,left:n,width:r,height:i}}function y(e,t){return e!==null&&e.top===t.top&&e.left===t.left&&e.side===t.side&&e.anchorWidth===t.anchorWidth}function b(i={}){let{side:a=`bottom`,align:l=`center`,offset:u=0,flip:d=!0,matchWidth:m=!1,name:b,anchor:x,trackSide:S=!1}=i,C=n.t(`anchor`),w=`--${(b??C).replace(/^--/,``)}`,[T,E]=(0,r.useState)(!0),[D,O]=(0,r.useState)(null),[k,A]=(0,r.useState)(null),[j,M]=(0,r.useState)(null),[N,P]=(0,r.useState)(null);t.n(()=>{g()||E(!1)},[]),t.n(()=>{let t=e.l(x);if(t)return t.style.setProperty(`anchor-name`,w),()=>{t.style.removeProperty(`anchor-name`)}},[x,w]),t.n(()=>{!T||!S||!k||P(s(getComputedStyle(k).getPropertyValue(`position-area`)))},[T,S,k,a,l,d]),t.n(()=>{let t=e.l(x)??D;if(T||!t||!k)return;let n=()=>{let n=v(t),r=v(k),i={top:0,left:0,width:window.innerWidth,height:window.innerHeight},o=m?Math.max(r.width,n.width):r.width,s={...f(n,{...r,width:o},i,{side:a,align:l,offset:u/p*_(),flip:d,rtl:e.d(t)}),anchorWidth:n.width};M(e=>y(e,s)?e:s)};n();let r=new AbortController;return document.addEventListener(`scroll`,n,{signal:r.signal,capture:!0,passive:!0}),window.addEventListener(`resize`,n,{signal:r.signal,passive:!0}),()=>r.abort()},[T,x,D,k,a,l,u,d,m]);let F=(0,r.useCallback)(e=>O(e),[]),I=(0,r.useCallback)(e=>A(e),[]),L={ref:T?void 0:F,style:{anchorName:w}};return T?{css:T,side:N??a,anchorProps:L,layerProps:{...S?{ref:I}:{},position:`fixed`,positionArea:o(a,l),...d?{positionTryFallbacks:c(a)}:{},...m?{minWidth:`anchor-size(width)`}:{},...u?{[h[a]]:u}:{},style:{positionAnchor:w}}}:{css:T,side:j?.side??a,anchorProps:L,layerProps:{ref:I,position:`fixed`,style:j?{top:`${j.top}px`,left:`${j.left}px`,...m?{minWidth:`${j.anchorWidth}px`}:{}}:{top:0,left:0,visibility:`hidden`}}}}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return b}});
package/placement.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { c as e, u as t } from "./platform.mjs";
1
+ import { d as e, l as t } from "./platform.mjs";
2
2
  import { n } from "./effects.mjs";
3
3
  import { t as r } from "./identity.mjs";
4
4
  import { useCallback as i, useState as a } from "react";
@@ -82,9 +82,9 @@ function S(o = {}) {
82
82
  n(() => {
83
83
  v() || O(!1);
84
84
  }, []), n(() => {
85
- let t = e(C);
86
- if (t) return t.style.setProperty("anchor-name", E), () => {
87
- t.style.removeProperty("anchor-name");
85
+ let e = t(C);
86
+ if (e) return e.style.setProperty("anchor-name", E), () => {
87
+ e.style.removeProperty("anchor-name");
88
88
  };
89
89
  }, [C, E]), n(() => {
90
90
  !D || !w || !j || I(l(getComputedStyle(j).getPropertyValue("position-area")));
@@ -96,16 +96,16 @@ function S(o = {}) {
96
96
  d,
97
97
  p
98
98
  ]), n(() => {
99
- let n = e(C) ?? k;
99
+ let n = t(C) ?? k;
100
100
  if (D || !n || !j) return;
101
101
  let r = () => {
102
- let e = b(n), r = b(j), i = {
102
+ let t = b(n), r = b(j), i = {
103
103
  top: 0,
104
104
  left: 0,
105
105
  width: window.innerWidth,
106
106
  height: window.innerHeight
107
- }, a = g ? Math.max(r.width, e.width) : r.width, o = {
108
- ...m(e, {
107
+ }, a = g ? Math.max(r.width, t.width) : r.width, o = {
108
+ ...m(t, {
109
109
  ...r,
110
110
  width: a
111
111
  }, i, {
@@ -113,9 +113,9 @@ function S(o = {}) {
113
113
  align: d,
114
114
  offset: f / h * y(),
115
115
  flip: p,
116
- rtl: t(n)
116
+ rtl: e(n)
117
117
  }),
118
- anchorWidth: e.width
118
+ anchorWidth: t.width
119
119
  };
120
120
  P((e) => x(e, o) ? e : o);
121
121
  };
package/platform.cjs CHANGED
@@ -1 +1 @@
1
- function e(e){return e?`current`in e?e.current:e:null}function t(t){let n=e(t);return n instanceof HTMLElement?n:null}function n(t,n){let r=typeof t.composedPath==`function`?t.composedPath():[];return n.some(n=>{let i=e(n);return i?r.includes(i)||t.target instanceof Node&&i.contains(t.target):!1})}function r(t){let n=e(t),r=n?.ownerDocument?.defaultView;return!!n&&!!r&&r.getComputedStyle(n).direction===`rtl`}function i(t){let n=e(t)?.ownerDocument?.defaultView?.getSelection();n&&!n.isCollapsed&&n.removeAllRanges()}function a(){return typeof window<`u`&&window.document!==void 0}function o(){return typeof document<`u`}function s(){return o()?document:null}function c(){return s()?.documentElement??null}function l(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`}function u(){return typeof HTMLDialogElement<`u`&&`closedBy`in HTMLDialogElement.prototype}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return r}});
1
+ function e(e){return e?`current`in e?e.current:e:null}function t(t){let n=e(t);return n instanceof HTMLElement?n:null}function n(t,n){let r=typeof t.composedPath==`function`?t.composedPath():[];return n.some(n=>{let i=e(n);return i?r.includes(i)||t.target instanceof Node&&i.contains(t.target):!1})}function r(t){let n=e(t),r=n?.ownerDocument?.defaultView;return!!n&&!!r&&r.getComputedStyle(n).direction===`rtl`}function i(t){let n=e(t)?.ownerDocument?.defaultView?.getSelection();n&&!n.isCollapsed&&n.removeAllRanges()}function a(){return typeof window<`u`&&window.document!==void 0}function o(){return typeof document<`u`}function s(){return o()?document:null}function c(){return s()?.documentElement??null}function l(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`}function u(){return typeof HTMLDialogElement<`u`&&`closedBy`in HTMLDialogElement.prototype}function d(e){return typeof window>`u`||typeof window.matchMedia!=`function`?null:window.matchMedia(e)}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return n}});
package/platform.mjs CHANGED
@@ -41,5 +41,8 @@ function l() {
41
41
  function u() {
42
42
  return typeof HTMLDialogElement < "u" && "closedBy" in HTMLDialogElement.prototype;
43
43
  }
44
+ function d(e) {
45
+ return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(e);
46
+ }
44
47
  //#endregion
45
- export { l as a, t as c, u as i, n as l, c as n, i as o, a as r, e as s, s as t, r as u };
48
+ export { u as a, e as c, r as d, d as i, t as l, c as n, l as o, a as r, i as s, s as t, n as u };
@@ -8,7 +8,8 @@ export interface ChangeDetails<TReason extends string = string> {
8
8
  /** The DOM or React event behind the change, when there was one. */
9
9
  event?: Event | React.SyntheticEvent;
10
10
  }
11
- export type ChangeHandler<T, TReason extends string = string> = (value: T, details: ChangeDetails<TReason>) => void;
11
+ /** `TDetails` is for a change that says more than its reason — which item moved, and from where. */
12
+ export type ChangeHandler<T, TReason extends string = string, TDetails extends ChangeDetails<TReason> = ChangeDetails<TReason>> = (value: T, details: TDetails) => void;
12
13
  export interface ControllableStateOptions<T, TReason extends string = string> {
13
14
  /** Present (not `undefined`) means the consumer owns the value: state here is ignored. */
14
15
  value?: T;
@@ -4,7 +4,7 @@ type Render = (props: any, ref: any) => React.ReactNode;
4
4
  * A component that is a Box: memoized, which skips a leaf whose props are all primitives, and one fiber on
5
5
  * React 19. React 18 needs a `forwardRef` under the `memo`, which makes it two.
6
6
  */
7
- export default function boxComponent(render: Render, displayName: string): React.MemoExoticComponent<((props: {
7
+ export default function boxComponent(render: Render, displayName: string): React.MemoExoticComponent<(({ ref, ...props }: {
8
8
  ref?: Ref<unknown>;
9
9
  }) => React.ReactNode) | React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>>;
10
10
  export {};
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { ComponentsRegistry } from '@box-kite/core';
3
+ declare const ComponentsContext: React.Context<ComponentsRegistry<import('../core/extends/boxComponents').Components> | undefined>;
4
+ export default ComponentsContext;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ import { ComponentsRegistry } from '@box-kite/core';
3
+ interface ComponentsProps {
4
+ /** A registry from `Box.createComponents()`. Create it at module scope, or memoise it: its identity is the context value. */
5
+ value: ComponentsRegistry | undefined;
6
+ children: React.ReactNode;
7
+ }
8
+ /** Every Box below resolves its `component` against `value` instead of the app's `Box.components()`. Renders no element. */
9
+ export default function Components({ value, children }: ComponentsProps): React.JSX.Element;
10
+ export {};
@@ -0,0 +1,18 @@
1
+ import { DateReadings } from '../../utils/date/dateTime';
2
+ import { ChangeDetails } from '../a11y/useControllableState';
3
+ /**
4
+ * Why a date value changed: digits or arrows in a field, a paste, a day picked in a calendar or a time in a
5
+ * list, a preset, the clear button, or a form reset.
6
+ */
7
+ export type DateChangeReason = 'keyboard' | 'paste' | 'select' | 'preset' | 'clear' | 'reset';
8
+ /**
9
+ * What a date control hands its `onValueChange` beside the string: the reason, plus every reading of the
10
+ * value an app is likely to want — `utc`, the reader's `local` wall clock, a `Date`, the epoch.
11
+ *
12
+ * ```tsx
13
+ * <DateField type="datetime" onValueChange={(value, { utc, local }) => save(utc)} />
14
+ * ```
15
+ */
16
+ export type DateChangeDetails<TReason extends string = DateChangeReason> = ChangeDetails<TReason> & DateReadings;
17
+ /** A date control's change handler: the canonical string (or `null`) and the readings. */
18
+ export type DateChangeHandler<TValue = string | null, TReason extends string = DateChangeReason> = (value: TValue, details: DateChangeDetails<TReason>) => void;
@@ -0,0 +1,34 @@
1
+ import { ZoneInput } from '../../utils/date/zones';
2
+ /** What a subtree knows about its reader: the language and the zone. */
3
+ export interface DateEnvironmentValue {
4
+ /** A BCP 47 tag. */
5
+ locale?: string;
6
+ /** The reader's zone — what `'local'` means inside. */
7
+ timeZone?: string;
8
+ }
9
+ export interface DateProviderProps extends DateEnvironmentValue {
10
+ children?: React.ReactNode;
11
+ }
12
+ /**
13
+ * Says who the reader is for every date component inside: their language and their zone. On a server that
14
+ * read the zone off a cookie (`readZoneCookie`), this is what makes the first paint already right — the
15
+ * server and the browser render the same text, and nothing changes after hydration.
16
+ */
17
+ export declare function DateProvider({ locale, timeZone, children }: DateProviderProps): import("react").JSX.Element;
18
+ export interface DateEnvironment {
19
+ locale: string;
20
+ /** The zone resolved to a name: `UTC`, an IANA zone or a fixed offset. */
21
+ zone: string;
22
+ /** The reader's own zone, which is what `'local'` resolved to. */
23
+ readerZone: string;
24
+ }
25
+ /**
26
+ * The locale and zone a date component renders in. A prop wins, then a `DateProvider`, then
27
+ * `configureDates()`, then the browser. **A server and a hydrating browser both use the fallback** — `UTC` and
28
+ * `en-US` unless something above configured them — because neither can know the other's runtime, and two
29
+ * renders that disagree are a hydration error. The render after hydration switches to the reader's own.
30
+ */
31
+ export declare function useDateEnvironment(props?: {
32
+ locale?: string;
33
+ zone?: ZoneInput;
34
+ }): DateEnvironment;
@@ -1,4 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { ComponentsRegistry } from '@box-kite/core';
2
3
  import { BoxStyleProps } from '@box-kite/core/types';
3
4
  export interface ResolvedBoxStyles {
4
5
  classNames: string[];
@@ -13,6 +14,6 @@ export interface ResolvedBoxStyles {
13
14
  * what those classes need comes back as elements to render, so there is nothing to flush. Its own module
14
15
  * for that reason: the RSC entry must reach this without pulling in `useStyles` and its flush effect.
15
16
  */
16
- export default function resolveStyles(props: BoxStyleProps<any>, isSvg: boolean): ResolvedBoxStyles & {
17
+ export default function resolveStyles(props: BoxStyleProps<any>, isSvg: boolean, components?: ComponentsRegistry): ResolvedBoxStyles & {
17
18
  signature: string | null;
18
19
  };
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ThemeTransition } from '@box-kite/core';
2
+ import { ComponentsRegistry, ThemeTransition } from '@box-kite/core';
3
3
  import { BoxStyleProps } from '@box-kite/core/types';
4
4
  interface ThemeProps {
5
5
  children: React.ReactNode;
@@ -24,6 +24,11 @@ interface ThemeProps {
24
24
  * update inside the callback. Reduced motion skips the transition and keeps the theme change.
25
25
  */
26
26
  viewTransition?: boolean | ThemeTransition;
27
+ /**
28
+ * A design for this subtree from `Box.createComponents()` — `<Box.Components value>` inside the theme,
29
+ * since one wrapper holding a design in both light and dark is what a themed section usually is.
30
+ */
31
+ components?: ComponentsRegistry;
27
32
  }
28
33
  /**
29
34
  * The React binding for the theme system. Everything that actually touches the platform — reading
package/react-shared.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./rolldown-runtime.cjs");let t=require("react");t=e.t(t,1);let n=require("@box-kite/core");function r({classNames:e,styleElements:t},r){return{className:(0,n.classNames)(e,r).join(` `),styles:t}}var i=parseInt(t.default.version,10)>=19;function a(e,n){let r=i?t=>e(t,t.ref??null):(0,t.forwardRef)(e),a=(0,t.memo)(r);return r.displayName=n,a.displayName=n,a}var o={selected:`aria-selected`},s;(function(e){function t(e,t,n){e!==void 0&&e!=null&&(n[o[t]??t]=Array.isArray(e)?e[0]:e)}e.assignBooleanProp=t})(s||={});var c=s;function l(e,t){let r=e,{props:i,className:a,disabled:o,required:s,checked:l,selected:u}=r,d={...i,className:(0,n.classNames)(t,a).join(` `)};return c.assignBooleanProp(o,`disabled`,d),c.assignBooleanProp(s,`required`,d),c.assignBooleanProp(l,`checked`,d),c.assignBooleanProp(u,`selected`,d),`style`in r&&(d.style=r.style),`id`in r&&(d.id=r.id),d}var u=parseInt(t.default.version,10)>=19,d=!1,f=new WeakMap,p=new WeakMap;function m(e){let n=f.get(e);if(!n){let{href:r,css:i,precedence:a}=e;n=t.default.createElement(`style`,{key:r,href:r,precedence:a,dangerouslySetInnerHTML:{__html:i}}),f.set(e,n)}return n}function h(e){if(!e?.length)return;!u&&!d&&(d=!0,console.warn(`[box-kite] Box.configure({ sink: 'element' }) needs React 19 to hoist and dedupe its <style> elements; React ${t.default.version} will render them inline. Use the default sink instead.`));let n=p.get(e);return n||(n=e.map(m),p.set(e,n)),n}function g(e,t){let{classNames:r,signature:i,styleElements:a}=(0,n.getDefaultEngine)().resolveClassNames(e,t);return{classNames:r,signature:i,styleElements:h(a)}}var _=`__boxAttributesInProps`;function v(e){return e[_]=!0,e}function y(e){return typeof e==`function`||typeof e==`object`&&e?e[_]===!0:!1}var b=[`role`,`aria-label`,`aria-labelledby`,`aria-hidden`];function x(e,t){if(e!==void 0)return{role:`img`,"aria-label":e};if(!(t&&b.some(e=>e in t)))return{"aria-hidden":!0}}var S;(function(e){function t(e){return e.charAt(0).toUpperCase()+e.slice(1)}e.capitalize=t})(S||={});var C=S,w;(function(e){function t(e,t,n){let r={...e},i=r.props||{};return t.forEach(e=>{e in r&&(i[e]=r[e],delete r[e])}),n&&Object.entries(n).forEach(([e,t])=>{i[e]=t}),r.props=i,r}e.buildProps=t;function n(e){return!!e&&typeof e==`object`}e.isObject=n;function r(e,t){return e in t}e.isKeyOf=r})(w||={});var T=w,E=[`sky-500`,`emerald-500`,`amber-500`,`violet-500`,`rose-500`,`cyan-500`],D=[`sky-400`,`emerald-400`,`amber-400`,`violet-400`,`rose-400`,`cyan-400`];function O(e){return e.reduce((e,t,n)=>(e[`chart-${n+1}`]=t,e),{})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return h}});
1
+ const e=require("./rolldown-runtime.cjs");let t=require("react");t=e.t(t,1);let n=require("@box-kite/core");function r({classNames:e,styleElements:t},r){return{className:(0,n.classNames)(e,r).join(` `),styles:t}}var i=parseInt(t.default.version,10)>=19;function a(e,n){let r=i?({ref:t,...n})=>e(n,t??null):(0,t.forwardRef)(e),a=(0,t.memo)(r);return r.displayName=n,a.displayName=n,a}var o={selected:`aria-selected`},s;(function(e){function t(e,t,n){e!==void 0&&e!=null&&(n[o[t]??t]=Array.isArray(e)?e[0]:e)}e.assignBooleanProp=t})(s||={});var c=s;function l(e,t){let r=e,{props:i,className:a,disabled:o,required:s,checked:l,selected:u}=r,d={...i,className:(0,n.classNames)(t,a).join(` `)};return c.assignBooleanProp(o,`disabled`,d),c.assignBooleanProp(s,`required`,d),c.assignBooleanProp(l,`checked`,d),c.assignBooleanProp(u,`selected`,d),`style`in r&&(d.style=r.style),`id`in r&&(d.id=r.id),d}var u=parseInt(t.default.version,10)>=19,d=!1,f=new WeakMap,p=new WeakMap;function m(e){let n=f.get(e);if(!n){let{href:r,css:i,precedence:a}=e;n=t.default.createElement(`style`,{key:r,href:r,precedence:a,dangerouslySetInnerHTML:{__html:i}}),f.set(e,n)}return n}function h(e){if(!e?.length)return;!u&&!d&&(d=!0,console.warn(`[box-kite] Box.configure({ sink: 'element' }) needs React 19 to hoist and dedupe its <style> elements; React ${t.default.version} will render them inline. Use the default sink instead.`));let n=p.get(e);return n||(n=e.map(m),p.set(e,n)),n}function g(e,t,r){let{classNames:i,signature:a,styleElements:o}=(0,n.getDefaultEngine)().resolveClassNames(e,t,r);return{classNames:i,signature:a,styleElements:h(o)}}var _=`__boxAttributesInProps`;function v(e){return e[_]=!0,e}function y(e){return typeof e==`function`||typeof e==`object`&&e?e[_]===!0:!1}var b=[`role`,`aria-label`,`aria-labelledby`,`aria-hidden`];function x(e,t){if(e!==void 0)return{role:`img`,"aria-label":e};if(!(t&&b.some(e=>e in t)))return{"aria-hidden":!0}}var S;(function(e){function t(e){return e.charAt(0).toUpperCase()+e.slice(1)}e.capitalize=t})(S||={});var C=S,w;(function(e){function t(e,t,n){let r={...e},i=r.props||{};return t.forEach(e=>{e in r&&(i[e]=r[e],delete r[e])}),n&&Object.entries(n).forEach(([e,t])=>{i[e]=t}),r.props=i,r}e.buildProps=t;function n(e){return!!e&&typeof e==`object`}e.isObject=n;function r(e,t){return e in t}e.isKeyOf=r})(w||={});var T=w,E=[`sky-500`,`emerald-500`,`amber-500`,`violet-500`,`rose-500`,`cyan-500`],D=[`sky-400`,`emerald-400`,`amber-400`,`violet-400`,`rose-400`,`cyan-400`];function O(e){return e.reduce((e,t,n)=>(e[`chart-${n+1}`]=t,e),{})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return h}});