@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/motion.mjs CHANGED
@@ -38,29 +38,39 @@ var a;
38
38
  var o = a;
39
39
  //#endregion
40
40
  //#region src/react/animation/usePresence.ts
41
- function s(a) {
42
- let { present: s } = a, [c, l] = i(s ? "open" : "closed"), u = r(null), d = t((e) => {
43
- u.current = e;
44
- }, []), f = s ? "open" : c === "closed" ? "closed" : "leaving";
45
- return f !== c && l(f), e(() => {
46
- if (f !== "leaving") return;
47
- let e = u.current, t = e ? o.activeDuration(getComputedStyle(e)) : 0;
48
- if (t <= 0) {
49
- l("closed");
50
- return;
51
- }
52
- let n = setTimeout(() => l("closed"), t + o.SETTLE_FRAME);
53
- return () => clearTimeout(n);
54
- }, [f]), n(() => {
55
- let e = f === "open" ? "open" : "closed";
41
+ function s(e) {
42
+ let i = r(null), a = t((e) => {
43
+ i.current = e;
44
+ }, []), o = t(() => i.current, []), s = c(e.present, o);
45
+ return n(() => {
46
+ let e = s === "open" ? "open" : "closed";
56
47
  return {
57
- mounted: f !== "closed",
58
- present: f === "open",
48
+ mounted: s !== "closed",
49
+ present: s === "open",
59
50
  state: e,
60
- ref: d,
51
+ ref: a,
61
52
  props: { "data-state": e }
62
53
  };
63
- }, [f, d]);
54
+ }, [s, a]);
55
+ }
56
+ function c(t, n) {
57
+ let [r, a] = i(t ? "open" : "closed"), s = t ? "open" : r === "closed" ? "closed" : "leaving";
58
+ return s !== r && a(s), e(() => {
59
+ if (s !== "leaving") return;
60
+ let e = n(), t = e ? o.activeDuration(getComputedStyle(e)) : 0;
61
+ if (t <= 0) {
62
+ a("closed");
63
+ return;
64
+ }
65
+ let r = setTimeout(() => a("closed"), t + o.SETTLE_FRAME);
66
+ return () => clearTimeout(r);
67
+ }, [s, n]), s;
68
+ }
69
+ //#endregion
70
+ //#region src/react/animation/useHeldContent.ts
71
+ function l(e, n, r) {
72
+ let a = c(n, t(() => r, [r])), [o, s] = i(e);
73
+ return n && o !== e && s(e), a === "leaving" ? o : e;
64
74
  }
65
75
  //#endregion
66
- export { o as n, s as t };
76
+ export { o as i, c as n, s as r, l as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box-kite/react",
3
- "version": "2.2.16",
3
+ "version": "2.2.18",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "pages/**"
@@ -132,7 +132,7 @@
132
132
  "./interactionListening.mjs"
133
133
  ],
134
134
  "gzip": true,
135
- "limit": "41.15 kB"
135
+ "limit": "43.33 kB"
136
136
  },
137
137
  {
138
138
  "name": "Box in a Server Component (react-server entry)",
@@ -145,7 +145,7 @@
145
145
  "./interactionListening.mjs"
146
146
  ],
147
147
  "gzip": true,
148
- "limit": "38.55 kB"
148
+ "limit": "40.72 kB"
149
149
  },
150
150
  {
151
151
  "name": "Behavior primitives (a11y entry)",
@@ -158,7 +158,7 @@
158
158
  "./interactionListening.mjs"
159
159
  ],
160
160
  "gzip": true,
161
- "limit": "3.26 kB"
161
+ "limit": "5.26 kB"
162
162
  },
163
163
  {
164
164
  "name": "Anchor positioning (anchor entry)",
@@ -171,7 +171,7 @@
171
171
  "./interactionListening.mjs"
172
172
  ],
173
173
  "gzip": true,
174
- "limit": "2.27 kB"
174
+ "limit": "4.27 kB"
175
175
  },
176
176
  {
177
177
  "name": "Component catalog (catalog entry)",
@@ -184,7 +184,7 @@
184
184
  "./interactionListening.mjs"
185
185
  ],
186
186
  "gzip": true,
187
- "limit": "62.32 kB"
187
+ "limit": "64.50 kB"
188
188
  },
189
189
  {
190
190
  "name": "Spec renderer (spec entry)",
@@ -197,7 +197,7 @@
197
197
  "./interactionListening.mjs"
198
198
  ],
199
199
  "gzip": true,
200
- "limit": "4.75 kB"
200
+ "limit": "6.75 kB"
201
201
  },
202
202
  {
203
203
  "name": "Ecosystem interop (interop entry)",
@@ -210,7 +210,7 @@
210
210
  "./interactionListening.mjs"
211
211
  ],
212
212
  "gzip": true,
213
- "limit": "4 KB"
213
+ "limit": "6.00 kB"
214
214
  },
215
215
  {
216
216
  "name": "Analytics (analytics entry, no React)",
@@ -223,7 +223,7 @@
223
223
  "./interactionListening.mjs"
224
224
  ],
225
225
  "gzip": true,
226
- "limit": "1.94 kB"
226
+ "limit": "3.94 kB"
227
227
  },
228
228
  {
229
229
  "name": "Dates, times and zones (date entry, no React)",
@@ -236,13 +236,13 @@
236
236
  "./interactionListening.mjs"
237
237
  ],
238
238
  "gzip": true,
239
- "limit": "7.59 KB"
239
+ "limit": "9.59 kB"
240
240
  },
241
241
  {
242
242
  "name": "Core engine (@box-kite/core, no React)",
243
243
  "path": "dist-core/core.mjs",
244
244
  "gzip": true,
245
- "limit": "39.77 kB",
245
+ "limit": "41.95 kB",
246
246
  "ignore": [
247
247
  "./diagnostics-*",
248
248
  "./themeReveal-*",
@@ -260,7 +260,7 @@
260
260
  "./interactionListening.mjs"
261
261
  ],
262
262
  "gzip": true,
263
- "limit": "43.47 kB"
263
+ "limit": "46.14 kB"
264
264
  },
265
265
  {
266
266
  "name": "Popover",
@@ -273,7 +273,7 @@
273
273
  "./interactionListening.mjs"
274
274
  ],
275
275
  "gzip": true,
276
- "limit": "45.00 kB"
276
+ "limit": "47.67 kB"
277
277
  },
278
278
  {
279
279
  "name": "Menu",
@@ -286,7 +286,7 @@
286
286
  "./interactionListening.mjs"
287
287
  ],
288
288
  "gzip": true,
289
- "limit": "47.35 kB"
289
+ "limit": "49.98 kB"
290
290
  },
291
291
  {
292
292
  "name": "Accordion",
@@ -299,7 +299,7 @@
299
299
  "./interactionListening.mjs"
300
300
  ],
301
301
  "gzip": true,
302
- "limit": "42.75 kB"
302
+ "limit": "44.92 kB"
303
303
  },
304
304
  {
305
305
  "name": "Agent",
@@ -312,7 +312,7 @@
312
312
  "./interactionListening.mjs"
313
313
  ],
314
314
  "gzip": true,
315
- "limit": "43.45 kB"
315
+ "limit": "45.62 kB"
316
316
  },
317
317
  {
318
318
  "name": "Markdown",
@@ -325,7 +325,7 @@
325
325
  "./interactionListening.mjs"
326
326
  ],
327
327
  "gzip": true,
328
- "limit": "41.75 kB"
328
+ "limit": "43.93 kB"
329
329
  },
330
330
  {
331
331
  "name": "List",
@@ -338,7 +338,7 @@
338
338
  "./interactionListening.mjs"
339
339
  ],
340
340
  "gzip": true,
341
- "limit": "43.09 kB"
341
+ "limit": "45.25 kB"
342
342
  },
343
343
  {
344
344
  "name": "SwipeItem",
@@ -351,7 +351,7 @@
351
351
  "./interactionListening.mjs"
352
352
  ],
353
353
  "gzip": true,
354
- "limit": "46.38 kB"
354
+ "limit": "48.54 kB"
355
355
  },
356
356
  {
357
357
  "name": "SortableList",
@@ -364,7 +364,7 @@
364
364
  "./interactionListening.mjs"
365
365
  ],
366
366
  "gzip": true,
367
- "limit": "46.72 kB"
367
+ "limit": "48.86 kB"
368
368
  },
369
369
  {
370
370
  "name": "VirtualList",
@@ -377,7 +377,7 @@
377
377
  "./interactionListening.mjs"
378
378
  ],
379
379
  "gzip": true,
380
- "limit": "45.28 kB"
380
+ "limit": "47.49 kB"
381
381
  },
382
382
  {
383
383
  "name": "Skeleton",
@@ -390,7 +390,7 @@
390
390
  "./interactionListening.mjs"
391
391
  ],
392
392
  "gzip": true,
393
- "limit": "41.07 kB"
393
+ "limit": "43.24 kB"
394
394
  },
395
395
  {
396
396
  "name": "Tabs",
@@ -403,7 +403,7 @@
403
403
  "./interactionListening.mjs"
404
404
  ],
405
405
  "gzip": true,
406
- "limit": "43.95 kB"
406
+ "limit": "46.11 kB"
407
407
  },
408
408
  {
409
409
  "name": "Slider",
@@ -416,7 +416,7 @@
416
416
  "./interactionListening.mjs"
417
417
  ],
418
418
  "gzip": true,
419
- "limit": "43.09 kB"
419
+ "limit": "45.24 kB"
420
420
  },
421
421
  {
422
422
  "name": "Progress",
@@ -429,7 +429,7 @@
429
429
  "./interactionListening.mjs"
430
430
  ],
431
431
  "gzip": true,
432
- "limit": "41.03 kB"
432
+ "limit": "43.20 kB"
433
433
  },
434
434
  {
435
435
  "name": "Toaster",
@@ -442,7 +442,7 @@
442
442
  "./interactionListening.mjs"
443
443
  ],
444
444
  "gzip": true,
445
- "limit": "44.72 kB"
445
+ "limit": "46.91 kB"
446
446
  },
447
447
  {
448
448
  "name": "DateField",
@@ -455,7 +455,7 @@
455
455
  "./interactionListening.mjs"
456
456
  ],
457
457
  "gzip": true,
458
- "limit": "49.93 kB"
458
+ "limit": "52.11 kB"
459
459
  },
460
460
  {
461
461
  "name": "Calendar",
@@ -468,7 +468,7 @@
468
468
  "./interactionListening.mjs"
469
469
  ],
470
470
  "gzip": true,
471
- "limit": "49.39 kB"
471
+ "limit": "51.53 kB"
472
472
  },
473
473
  {
474
474
  "name": "DatePicker",
@@ -481,7 +481,7 @@
481
481
  "./interactionListening.mjs"
482
482
  ],
483
483
  "gzip": true,
484
- "limit": "63.06 kB"
484
+ "limit": "65.70 kB"
485
485
  },
486
486
  {
487
487
  "name": "DateTime",
@@ -494,7 +494,7 @@
494
494
  "./interactionListening.mjs"
495
495
  ],
496
496
  "gzip": true,
497
- "limit": "44.61 kB"
497
+ "limit": "46.78 kB"
498
498
  },
499
499
  {
500
500
  "name": "TimeZoneSelect",
@@ -507,7 +507,7 @@
507
507
  "./interactionListening.mjs"
508
508
  ],
509
509
  "gzip": true,
510
- "limit": "52.48 kB"
510
+ "limit": "54.68 kB"
511
511
  },
512
512
  {
513
513
  "name": "Combobox",
@@ -520,7 +520,7 @@
520
520
  "./interactionListening.mjs"
521
521
  ],
522
522
  "gzip": true,
523
- "limit": "50.46 kB"
523
+ "limit": "52.66 kB"
524
524
  },
525
525
  {
526
526
  "name": "Dashboard",
@@ -533,7 +533,7 @@
533
533
  "./interactionListening.mjs"
534
534
  ],
535
535
  "gzip": true,
536
- "limit": "47.03 kB"
536
+ "limit": "49.20 kB"
537
537
  },
538
538
  {
539
539
  "name": "DataGrid",
@@ -548,7 +548,7 @@
548
548
  "../dataGridDateParts.mjs"
549
549
  ],
550
550
  "gzip": true,
551
- "limit": "97.66 kB"
551
+ "limit": "99.89 kB"
552
552
  },
553
553
  {
554
554
  "name": "Interaction delivery, the chunk the first Box.onInteraction fetches",
@@ -558,7 +558,7 @@
558
558
  "react-dom"
559
559
  ],
560
560
  "gzip": true,
561
- "limit": "1.44 kB"
561
+ "limit": "3.44 kB"
562
562
  },
563
563
  {
564
564
  "name": "DataGrid export, the chunk fetched on the first press",
@@ -571,7 +571,7 @@
571
571
  "./interactionListening.mjs"
572
572
  ],
573
573
  "gzip": true,
574
- "limit": "3.86 kB"
574
+ "limit": "5.86 kB"
575
575
  },
576
576
  {
577
577
  "name": "DataGrid list layout, the chunk a narrow grid fetches on top of the grid",
@@ -586,7 +586,7 @@
586
586
  "./components/*"
587
587
  ],
588
588
  "gzip": true,
589
- "limit": "7.89 kB"
589
+ "limit": "9.89 kB"
590
590
  },
591
591
  {
592
592
  "name": "DataGrid dates, the chunk a grid with a date column fetches on top of the grid",
@@ -601,7 +601,7 @@
601
601
  "./components/*"
602
602
  ],
603
603
  "gzip": true,
604
- "limit": "7.56 kB"
604
+ "limit": "9.56 kB"
605
605
  },
606
606
  {
607
607
  "name": "Full library (Box + ssg + every component)",
@@ -614,7 +614,7 @@
614
614
  "./interactionListening.mjs"
615
615
  ],
616
616
  "gzip": true,
617
- "limit": "167.55 kB"
617
+ "limit": "169.84 kB"
618
618
  }
619
619
  ],
620
620
  "repository": {
@@ -654,7 +654,7 @@
654
654
  "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
655
655
  },
656
656
  "dependencies": {
657
- "@box-kite/core": "2.2.16",
657
+ "@box-kite/core": "2.2.18",
658
658
  "csstype": "^3.2.3",
659
659
  "use-sync-external-store": "^1.6.0"
660
660
  },
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.f(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.f(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.m(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.m(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.m(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.g(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 { f as e, m as t } from "./platform.mjs";
1
+ import { g as e, m 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
- var e=globalThis[Symbol.for(`box-kite.componentAttribute`)]??={on:!1,warnings:!0},t=()=>e.on,n=()=>e.warnings;function r(t){e.on=t}function i(t){e.warnings=t}function a(e){return e?`current`in e?e.current:e:null}function o(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function s(e){let t=a(e);return t instanceof HTMLElement?t:null}function c(e,t){let n=typeof e.composedPath==`function`?e.composedPath():[];return t.some(t=>{let r=a(t);return r?n.includes(r)||e.target instanceof Node&&r.contains(e.target):!1})}function l(e){let t=a(e),n=t?.ownerDocument?.defaultView;return!!t&&!!n&&n.getComputedStyle(t).direction===`rtl`}function u(e){let t=a(e)?.ownerDocument?.defaultView?.getSelection();t&&!t.isCollapsed&&t.removeAllRanges()}function d(){return typeof window<`u`&&window.document!==void 0}function f(){try{return process.env.NODE_ENV!==`production`}catch{return!1}}function p(){return typeof document<`u`}function m(){return p()?document:null}function h(){return m()?.documentElement??null}function g(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`}function _(){return typeof HTMLDialogElement<`u`&&`closedBy`in HTMLDialogElement.prototype}function v(e){return typeof window>`u`||typeof window.matchMedia!=`function`?null:window.matchMedia(e)}Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return n}});
1
+ var e=globalThis[Symbol.for(`box-kite.componentAttribute`)]??={on:!1,warnings:!0},t=()=>e.on,n=()=>e.warnings;function r(t){e.on=t}function i(t){e.warnings=t}function a(e){return e?`current`in e?e.current:e:null}function o(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function s(e){let t=a(e);return t instanceof HTMLElement?t:null}function c(e,t){let n=typeof e.composedPath==`function`?e.composedPath():[];return t.some(t=>{let r=a(t);return r?n.includes(r)||e.target instanceof Node&&r.contains(e.target):!1})}function l(e){let t=a(e),n=t?.ownerDocument?.defaultView;return!!t&&!!n&&n.getComputedStyle(t).direction===`rtl`}function u(e){let t=a(e)?.ownerDocument?.defaultView?.getSelection();t&&!t.isCollapsed&&t.removeAllRanges()}var d=`box-kite:modal`;function f(e,t){e.ownerDocument.dispatchEvent(new CustomEvent(d,{detail:{dialog:e,open:t}}))}function p(){return typeof window<`u`&&window.document!==void 0}function m(){try{return process.env.NODE_ENV!==`production`}catch{return!1}}function h(){return typeof document<`u`}function g(){return h()?document:null}function _(){return g()?.documentElement??null}function v(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`}function y(){return typeof HTMLDialogElement<`u`&&`closedBy`in HTMLDialogElement.prototype}function b(e){return typeof window>`u`||typeof window.matchMedia!=`function`?null:window.matchMedia(e)}Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return r}});
package/platform.mjs CHANGED
@@ -36,35 +36,42 @@ function u(e) {
36
36
  let t = a(e)?.ownerDocument?.defaultView?.getSelection();
37
37
  t && !t.isCollapsed && t.removeAllRanges();
38
38
  }
39
+ var d = "box-kite:modal";
40
+ function f(e, t) {
41
+ e.ownerDocument.dispatchEvent(new CustomEvent(d, { detail: {
42
+ dialog: e,
43
+ open: t
44
+ } }));
45
+ }
39
46
  //#endregion
40
47
  //#region src/utils/environment/environmentUtils.ts
41
- function d() {
48
+ function p() {
42
49
  return typeof window < "u" && window.document !== void 0;
43
50
  }
44
- function f() {
51
+ function m() {
45
52
  try {
46
53
  return process.env.NODE_ENV !== "production";
47
54
  } catch {
48
55
  return !1;
49
56
  }
50
57
  }
51
- function p() {
58
+ function h() {
52
59
  return typeof document < "u";
53
60
  }
54
- function m() {
55
- return p() ? document : null;
61
+ function g() {
62
+ return h() ? document : null;
56
63
  }
57
- function h() {
58
- return m()?.documentElement ?? null;
64
+ function _() {
65
+ return g()?.documentElement ?? null;
59
66
  }
60
- function g() {
67
+ function v() {
61
68
  return typeof HTMLElement < "u" && typeof HTMLElement.prototype.showPopover == "function";
62
69
  }
63
- function _() {
70
+ function y() {
64
71
  return typeof HTMLDialogElement < "u" && "closedBy" in HTMLDialogElement.prototype;
65
72
  }
66
- function v(e) {
73
+ function b(e) {
67
74
  return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(e);
68
75
  }
69
76
  //#endregion
70
- export { r as _, f as a, g as c, a as d, s as f, i as g, t as h, d as i, o as l, l as m, h as n, v as o, c as p, p as r, _ as s, m as t, u, n as v };
77
+ export { t as _, m as a, n as b, v as c, o as d, u as f, l as g, c as h, p as i, d as l, s as m, _ as n, b as o, a as p, h as r, y as s, g as t, f as u, i as v, r as y };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * A layer that is always rendered (a `<dialog>`, a popover) keeps the content it last showed open until its
3
+ * own exit transition has run. Without it `{open && <Form />}` empties the panel in the closing commit, and
4
+ * the exit animates a blank box (bug #314).
5
+ */
6
+ export default function useHeldContent<T>(content: T, open: boolean, element: HTMLElement | null): T;
@@ -1,6 +1,8 @@
1
1
  import { RefCallback } from 'react';
2
2
  /** The Radix / Base UI attribute value, so a `[data-state]` selector written for either works here too. */
3
3
  export type PresenceState = 'open' | 'closed';
4
+ /** Where the subtree is in its own lifetime. `leaving` is the whole of the exit; `closed` is gone. */
5
+ export type ExitPhase = 'open' | 'leaving' | 'closed';
4
6
  export interface PresenceOptions {
5
7
  /** Whether the subtree should be there. The exit starts the moment this goes false. */
6
8
  present: boolean;
@@ -30,3 +32,5 @@ export interface Presence {
30
32
  * the real CSS: a zero duration (nothing declared, or `prefers-reduced-motion`) unmounts in the same commit.
31
33
  */
32
34
  export default function usePresence(options: PresenceOptions): Presence;
35
+ /** The phase machine behind `usePresence`, for any element whose exit is its own CSS. `readNode` is called as the exit starts. */
36
+ export declare function useExitPhase(present: boolean, readNode: () => HTMLElement | null): ExitPhase;
package/react-shared.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./rolldown-runtime.cjs"),t=require("./platform.cjs");let n=require("react");n=e.t(n,1);let r=require("@box-kite/core");function i({classNames:e,styleElements:t},n){return{className:(0,r.classNames)(e,n).join(` `),styles:t}}var a=parseInt(n.default.version,10)>=19;function o(e,t){let r=a?({ref:t,...n})=>e(n,t??null):(0,n.forwardRef)(e),i=(0,n.memo)(r);return r.displayName=t,i.displayName=t,i}var s={selected:`aria-selected`},c;(function(e){function t(e,t,n){e!==void 0&&e!=null&&(n[s[t]??t]=Array.isArray(e)?e[0]:e)}e.assignBooleanProp=t})(c||={});var l=c;function u(e,n){let i=e,{props:a,className:o,disabled:s,required:c,checked:u,selected:d}=i,f={...a,className:(0,r.classNames)(n,o).join(` `)};return typeof i.component==`string`&&t.h()&&(f[`data-bk`]??=i.component),l.assignBooleanProp(s,`disabled`,f),l.assignBooleanProp(c,`required`,f),l.assignBooleanProp(u,`checked`,f),l.assignBooleanProp(d,`selected`,f),`style`in i&&(f.style=i.style),`id`in i&&(f.id=i.id),f}var d=parseInt(n.default.version,10)>=19,f=!1,p=new WeakMap,m=new WeakMap;function h(e){let t=p.get(e);if(!t){let{href:r,css:i,precedence:a}=e;t=n.default.createElement(`style`,{key:r,href:r,precedence:a,dangerouslySetInnerHTML:{__html:i}}),p.set(e,t)}return t}function g(e){if(!e?.length)return;!d&&!f&&(f=!0,console.warn(`[box-kite] Box.configure({ sink: 'element' }) needs React 19 to hoist and dedupe its <style> elements; React ${n.default.version} will render them inline. Use the default sink instead.`));let t=m.get(e);return t||(t=e.map(h),m.set(e,t)),t}function _(e,t,n){let{classNames:i,signature:a,styleElements:o}=(0,r.getDefaultEngine)().resolveClassNames(e,t,n);return{classNames:i,signature:a,styleElements:g(o)}}var v=`__boxAttributesInProps`;function y(e){return e[v]=!0,e}function b(e){return typeof e==`function`||typeof e==`object`&&e?e[v]===!0:!1}var x=[`role`,`aria-label`,`aria-labelledby`,`aria-hidden`];function S(e,t){if(e!==void 0)return{role:`img`,"aria-label":e};if(!(t&&x.some(e=>e in t)))return{"aria-hidden":!0}}var C;(function(e){function t(e){return e.charAt(0).toUpperCase()+e.slice(1)}e.capitalize=t})(C||={});var w=C,T;(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})(T||={});var E=T,D=[`sky-500`,`emerald-500`,`amber-500`,`violet-500`,`rose-500`,`cyan-500`],O=[`sky-400`,`emerald-400`,`amber-400`,`violet-400`,`rose-400`,`cyan-400`];function k(e){return e.reduce((e,t,n)=>(e[`chart-${n+1}`]=t,e),{})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return g}});
1
+ const e=require("./rolldown-runtime.cjs"),t=require("./platform.cjs");let n=require("react");n=e.t(n,1);let r=require("@box-kite/core");function i({classNames:e,styleElements:t},n){return{className:(0,r.classNames)(e,n).join(` `),styles:t}}var a=parseInt(n.default.version,10)>=19;function o(e,t){let r=a?({ref:t,...n})=>e(n,t??null):(0,n.forwardRef)(e),i=(0,n.memo)(r);return r.displayName=t,i.displayName=t,i}var s={selected:`aria-selected`},c;(function(e){function t(e,t,n){e!==void 0&&e!=null&&(n[s[t]??t]=Array.isArray(e)?e[0]:e)}e.assignBooleanProp=t})(c||={});var l=c;function u(e,n){let i=e,{props:a,className:o,disabled:s,required:c,checked:u,selected:d}=i,f={...a,className:(0,r.classNames)(n,o).join(` `)};return typeof i.component==`string`&&t._()&&(f[`data-bk`]??=i.component),l.assignBooleanProp(s,`disabled`,f),l.assignBooleanProp(c,`required`,f),l.assignBooleanProp(u,`checked`,f),l.assignBooleanProp(d,`selected`,f),`style`in i&&(f.style=i.style),`id`in i&&(f.id=i.id),f}var d=parseInt(n.default.version,10)>=19,f=!1,p=new WeakMap,m=new WeakMap;function h(e){let t=p.get(e);if(!t){let{href:r,css:i,precedence:a}=e;t=n.default.createElement(`style`,{key:r,href:r,precedence:a,dangerouslySetInnerHTML:{__html:i}}),p.set(e,t)}return t}function g(e){if(!e?.length)return;!d&&!f&&(f=!0,console.warn(`[box-kite] Box.configure({ sink: 'element' }) needs React 19 to hoist and dedupe its <style> elements; React ${n.default.version} will render them inline. Use the default sink instead.`));let t=m.get(e);return t||(t=e.map(h),m.set(e,t)),t}function _(e,t,n){let{classNames:i,signature:a,styleElements:o}=(0,r.getDefaultEngine)().resolveClassNames(e,t,n);return{classNames:i,signature:a,styleElements:g(o)}}var v=`__boxAttributesInProps`;function y(e){return e[v]=!0,e}function b(e){return typeof e==`function`||typeof e==`object`&&e?e[v]===!0:!1}var x=[`role`,`aria-label`,`aria-labelledby`,`aria-hidden`];function S(e,t){if(e!==void 0)return{role:`img`,"aria-label":e};if(!(t&&x.some(e=>e in t)))return{"aria-hidden":!0}}var C;(function(e){function t(e){return e.charAt(0).toUpperCase()+e.slice(1)}e.capitalize=t})(C||={});var w=C,T;(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})(T||={});var E=T,D=[`sky-500`,`emerald-500`,`amber-500`,`violet-500`,`rose-500`,`cyan-500`],O=[`sky-400`,`emerald-400`,`amber-400`,`violet-400`,`rose-400`,`cyan-400`];function k(e){return e.reduce((e,t,n)=>(e[`chart-${n+1}`]=t,e),{})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return g}});
package/react-shared.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { h as e } from "./platform.mjs";
1
+ import { _ as e } from "./platform.mjs";
2
2
  import t, { forwardRef as n, memo as r } from "react";
3
3
  import { classNames as i, getDefaultEngine as a } from "@box-kite/core";
4
4
  //#region src/react/boxClassNames.ts
package/scrolling.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./platform.cjs");function t(e,t,n=e.length){let r=0,i=n-1;if(i<=0)return 0;for(;r<i;){let n=r+i+1>>>1;e[n]<=t?r=n:i=n-1}return r}function n(t){let n=e.d(t),r=n?.ownerDocument?.defaultView;if(!n||!r)return null;let i=n.ownerDocument.scrollingElement??n.ownerDocument.documentElement;for(let e=n.parentElement;e&&e!==i&&e!==n.ownerDocument.body;e=e.parentElement)if(/auto|scroll|overlay/.test(r.getComputedStyle(e).overflowY)&&e.scrollHeight>e.clientHeight)return e;return null}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
1
+ const e=require("./platform.cjs");function t(e,t,n=e.length){let r=0,i=n-1;if(i<=0)return 0;for(;r<i;){let n=r+i+1>>>1;e[n]<=t?r=n:i=n-1}return r}function n(t){let n=e.p(t),r=n?.ownerDocument?.defaultView;if(!n||!r)return null;let i=n.ownerDocument.scrollingElement??n.ownerDocument.documentElement;for(let e=n.parentElement;e&&e!==i&&e!==n.ownerDocument.body;e=e.parentElement)if(/auto|scroll|overlay/.test(r.getComputedStyle(e).overflowY)&&e.scrollHeight>e.clientHeight)return e;return null}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
package/scrolling.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { d as e } from "./platform.mjs";
1
+ import { p as e } from "./platform.mjs";
2
2
  //#region src/utils/virtual/rowSearch.ts
3
3
  function t(e, t, n = e.length) {
4
4
  let r = 0, i = n - 1;
@@ -36,3 +36,10 @@ export declare function isRtl(value: ElementLike): boolean;
36
36
  * which the browser repairs to the nearest boundary and then paints over whatever is rendered inside it.
37
37
  */
38
38
  export declare function clearSelection(element: ElementLike): void;
39
+ /** What a `<Dialog>` dispatches on its document when it opens or closes as a modal, since everything outside one is inert. */
40
+ export declare const MODAL_EVENT = "box-kite:modal";
41
+ export type ModalEventDetail = {
42
+ dialog: HTMLElement;
43
+ open: boolean;
44
+ };
45
+ export declare function announceModal(dialog: HTMLElement, open: boolean): void;