@42-central/ui-react 0.17.0 → 0.18.0

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 (346) hide show
  1. package/README.md +36 -175
  2. package/dist/{chunk-FD6P6PLQ.js → chunk-5JHDSVEZ.js} +3 -3
  3. package/dist/{chunk-FD6P6PLQ.js.map → chunk-5JHDSVEZ.js.map} +1 -1
  4. package/dist/{chunk-QMW7D5GU.js → chunk-5OQLFX47.js} +4 -3
  5. package/dist/chunk-5OQLFX47.js.map +1 -0
  6. package/dist/{chunk-VZ2TPU4B.js → chunk-6GDMSENK.js} +3 -2
  7. package/dist/chunk-6GDMSENK.js.map +1 -0
  8. package/dist/{chunk-TNNH3FVQ.js → chunk-6OLTJYSX.js} +24 -8
  9. package/dist/chunk-6OLTJYSX.js.map +1 -0
  10. package/dist/{chunk-POKDSVQT.js → chunk-AE7QTLJ5.js} +5 -4
  11. package/dist/chunk-AE7QTLJ5.js.map +1 -0
  12. package/dist/{chunk-44OV3PNH.js → chunk-B2YJKRNQ.js} +3 -3
  13. package/dist/{chunk-44OV3PNH.js.map → chunk-B2YJKRNQ.js.map} +1 -1
  14. package/dist/{chunk-YIQI2CF3.js → chunk-CTSO6V72.js} +3 -2
  15. package/dist/chunk-CTSO6V72.js.map +1 -0
  16. package/dist/{chunk-ACE7FBWE.js → chunk-EBREIC3L.js} +5 -4
  17. package/dist/chunk-EBREIC3L.js.map +1 -0
  18. package/dist/{chunk-UNSAA7YG.js → chunk-FHG54IT5.js} +3 -2
  19. package/dist/chunk-FHG54IT5.js.map +1 -0
  20. package/dist/{chunk-3GYOIQW7.js → chunk-FZIHZT5R.js} +5 -5
  21. package/dist/{chunk-3GYOIQW7.js.map → chunk-FZIHZT5R.js.map} +1 -1
  22. package/dist/{chunk-2H46IXW4.js → chunk-HAQJQFE6.js} +28 -8
  23. package/dist/chunk-HAQJQFE6.js.map +1 -0
  24. package/dist/{chunk-IHYFYMHJ.js → chunk-HT5JAHR3.js} +6 -6
  25. package/dist/{chunk-IHYFYMHJ.js.map → chunk-HT5JAHR3.js.map} +1 -1
  26. package/dist/chunk-I4SQQIP5.js +12 -0
  27. package/dist/chunk-I4SQQIP5.js.map +1 -0
  28. package/dist/{chunk-J3PELDH3.js → chunk-JITF6I7N.js} +22 -6
  29. package/dist/chunk-JITF6I7N.js.map +1 -0
  30. package/dist/{chunk-IFWCCAQV.js → chunk-KHMFNH3X.js} +3 -2
  31. package/dist/chunk-KHMFNH3X.js.map +1 -0
  32. package/dist/{chunk-SIG4DMNZ.js → chunk-MI2WZRK3.js} +4 -4
  33. package/dist/{chunk-SIG4DMNZ.js.map → chunk-MI2WZRK3.js.map} +1 -1
  34. package/dist/{chunk-PJL4ZL5V.js → chunk-O23Y5ML4.js} +8 -8
  35. package/dist/{chunk-PJL4ZL5V.js.map → chunk-O23Y5ML4.js.map} +1 -1
  36. package/dist/{chunk-P7A3BCAC.js → chunk-OWG4BCQR.js} +3 -3
  37. package/dist/{chunk-P7A3BCAC.js.map → chunk-OWG4BCQR.js.map} +1 -1
  38. package/dist/{chunk-FUWSTUDM.js → chunk-PH354ECN.js} +4 -4
  39. package/dist/{chunk-FUWSTUDM.js.map → chunk-PH354ECN.js.map} +1 -1
  40. package/dist/{chunk-U5GW5EBR.js → chunk-RAUOFTUH.js} +12 -20
  41. package/dist/chunk-RAUOFTUH.js.map +1 -0
  42. package/dist/{chunk-2762HZYX.js → chunk-S2HWWR2H.js} +47 -25
  43. package/dist/chunk-S2HWWR2H.js.map +1 -0
  44. package/dist/{chunk-VLUKI3HL.js → chunk-S7N4LGLZ.js} +6 -13
  45. package/dist/chunk-S7N4LGLZ.js.map +1 -0
  46. package/dist/{chunk-TMMEJKLI.js → chunk-UHNRAI6V.js} +17 -4
  47. package/dist/chunk-UHNRAI6V.js.map +1 -0
  48. package/dist/{chunk-3NZXWCGF.js → chunk-WHKKN3ZK.js} +6 -6
  49. package/dist/{chunk-3NZXWCGF.js.map → chunk-WHKKN3ZK.js.map} +1 -1
  50. package/dist/{chunk-MOI7B3KH.js → chunk-WQN64ZHG.js} +5 -5
  51. package/dist/{chunk-MOI7B3KH.js.map → chunk-WQN64ZHG.js.map} +1 -1
  52. package/dist/chunk-WSIVRDRB.js +34 -0
  53. package/dist/chunk-WSIVRDRB.js.map +1 -0
  54. package/dist/{chunk-6SWK4XG5.js → chunk-YXE4B6X3.js} +2 -2
  55. package/dist/chunk-YXE4B6X3.js.map +1 -0
  56. package/dist/{chunk-NGAQITWP.js → chunk-Z2Z5EXVT.js} +10 -7
  57. package/dist/chunk-Z2Z5EXVT.js.map +1 -0
  58. package/dist/{chunk-IXKELBJA.js → chunk-ZDXQ64A7.js} +63 -44
  59. package/dist/chunk-ZDXQ64A7.js.map +1 -0
  60. package/dist/components/accordion/accordion-data.d.ts +3 -2
  61. package/dist/components/accordion/accordion-data.d.ts.map +1 -1
  62. package/dist/components/accordion/accordion.d.ts +2 -2
  63. package/dist/components/accordion/accordion.d.ts.map +1 -1
  64. package/dist/components/accordion/index.js +20 -8
  65. package/dist/components/accordion/index.js.map +1 -1
  66. package/dist/components/action-icon/action-icon.d.ts +3 -4
  67. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  68. package/dist/components/action-icon/index.js +2 -1
  69. package/dist/components/alert/alert.d.ts +18 -10
  70. package/dist/components/alert/alert.d.ts.map +1 -1
  71. package/dist/components/alert/index.js +17 -5
  72. package/dist/components/alert/index.js.map +1 -1
  73. package/dist/components/app-shell/app-shell.d.ts +3 -2
  74. package/dist/components/app-shell/app-shell.d.ts.map +1 -1
  75. package/dist/components/app-shell/index.js +4 -2
  76. package/dist/components/app-shell/index.js.map +1 -1
  77. package/dist/components/autocomplete/index.js +5 -4
  78. package/dist/components/autocomplete/index.js.map +1 -1
  79. package/dist/components/breadcrumb/breadcrumb.d.ts +3 -2
  80. package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
  81. package/dist/components/breadcrumb/index.js +11 -5
  82. package/dist/components/breadcrumb/index.js.map +1 -1
  83. package/dist/components/button/button.d.ts +4 -4
  84. package/dist/components/button/button.d.ts.map +1 -1
  85. package/dist/components/button/index.js +2 -1
  86. package/dist/components/button-multi-select/index.js +4 -3
  87. package/dist/components/button-multi-select/index.js.map +1 -1
  88. package/dist/components/button-select/index.js +4 -3
  89. package/dist/components/button-select/index.js.map +1 -1
  90. package/dist/components/calendar/calendar-body.d.ts.map +1 -1
  91. package/dist/components/calendar/index.js +3 -2
  92. package/dist/components/checkbox/index.js +2 -2
  93. package/dist/components/choice-card-group/index.js +1 -1
  94. package/dist/components/circular-progress/circular-progress.d.ts +3 -2
  95. package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
  96. package/dist/components/circular-progress/index.js +1 -0
  97. package/dist/components/circular-progress/index.js.map +1 -1
  98. package/dist/components/clipboard/clipboard.d.ts +1 -1
  99. package/dist/components/clipboard/clipboard.d.ts.map +1 -1
  100. package/dist/components/clipboard/index.js +9 -5
  101. package/dist/components/clipboard/index.js.map +1 -1
  102. package/dist/components/code-block/chrome.d.ts +4 -1
  103. package/dist/components/code-block/chrome.d.ts.map +1 -1
  104. package/dist/components/code-block/chrome.js +5 -4
  105. package/dist/components/code-block/code-block.d.ts +7 -1
  106. package/dist/components/code-block/code-block.d.ts.map +1 -1
  107. package/dist/components/code-block/index.d.ts +1 -1
  108. package/dist/components/code-block/index.js +12 -10
  109. package/dist/components/code-block/index.js.map +1 -1
  110. package/dist/components/code-block/notation.d.ts +5 -2
  111. package/dist/components/code-block/notation.d.ts.map +1 -1
  112. package/dist/components/code-block/static.d.ts +4 -1
  113. package/dist/components/code-block/static.d.ts.map +1 -1
  114. package/dist/components/code-block/static.js +5 -4
  115. package/dist/components/code-block/static.js.map +1 -1
  116. package/dist/components/collapse/collapse.d.ts +7 -3
  117. package/dist/components/collapse/collapse.d.ts.map +1 -1
  118. package/dist/components/collapse/index.js +2 -1
  119. package/dist/components/combobox/combobox.d.ts +11 -10
  120. package/dist/components/combobox/combobox.d.ts.map +1 -1
  121. package/dist/components/combobox/index.js +5 -4
  122. package/dist/components/combobox-list/index.js +6 -5
  123. package/dist/components/data-table/index.js +20 -19
  124. package/dist/components/data-table/index.js.map +1 -1
  125. package/dist/components/date-picker/index.js +12 -11
  126. package/dist/components/date-picker/index.js.map +1 -1
  127. package/dist/components/divider/divider.d.ts +3 -2
  128. package/dist/components/divider/divider.d.ts.map +1 -1
  129. package/dist/components/divider/index.js +1 -1
  130. package/dist/components/drawer/drawer.d.ts +6 -5
  131. package/dist/components/drawer/drawer.d.ts.map +1 -1
  132. package/dist/components/drawer/index.js +3 -2
  133. package/dist/components/field/field.d.ts +7 -4
  134. package/dist/components/field/field.d.ts.map +1 -1
  135. package/dist/components/field/index.js +1 -1
  136. package/dist/components/file-upload/index.js +3 -2
  137. package/dist/components/file-upload/index.js.map +1 -1
  138. package/dist/components/hover-card/index.js +1 -1
  139. package/dist/components/input/index.js +2 -2
  140. package/dist/components/input/input.d.ts +3 -2
  141. package/dist/components/input/input.d.ts.map +1 -1
  142. package/dist/components/menu/index.js +3 -2
  143. package/dist/components/menu/index.js.map +1 -1
  144. package/dist/components/menu/menu-data.d.ts +6 -1
  145. package/dist/components/menu/menu-data.d.ts.map +1 -1
  146. package/dist/components/menu/menu.d.ts +5 -5
  147. package/dist/components/menu/menu.d.ts.map +1 -1
  148. package/dist/components/modal/index.js +3 -2
  149. package/dist/components/modal/modal.d.ts +4 -3
  150. package/dist/components/modal/modal.d.ts.map +1 -1
  151. package/dist/components/multi-combobox-list/index.js +6 -5
  152. package/dist/components/multi-select/index.js +7 -6
  153. package/dist/components/multi-select/index.js.map +1 -1
  154. package/dist/components/nav-link/index.js +3 -2
  155. package/dist/components/nav-link/tanstack.js +3 -2
  156. package/dist/components/nav-link/tanstack.js.map +1 -1
  157. package/dist/components/notification/create-notifier.d.ts.map +1 -1
  158. package/dist/components/notification/index.js +8 -7
  159. package/dist/components/notification/index.js.map +1 -1
  160. package/dist/components/notification/notification.d.ts +7 -6
  161. package/dist/components/notification/notification.d.ts.map +1 -1
  162. package/dist/components/number-input/index.js +4 -4
  163. package/dist/components/overlays/index.js +5 -4
  164. package/dist/components/overlays/index.js.map +1 -1
  165. package/dist/components/password-input/index.js +2 -2
  166. package/dist/components/pill/index.js +2 -1
  167. package/dist/components/pill/pill.d.ts +4 -2
  168. package/dist/components/pill/pill.d.ts.map +1 -1
  169. package/dist/components/pills-input/index.js +5 -4
  170. package/dist/components/pills-input/pills-input.d.ts +3 -2
  171. package/dist/components/pills-input/pills-input.d.ts.map +1 -1
  172. package/dist/components/pin-input/index.js +2 -2
  173. package/dist/components/popover/index.js +1 -1
  174. package/dist/components/popover/popover.d.ts +3 -2
  175. package/dist/components/popover/popover.d.ts.map +1 -1
  176. package/dist/components/progress/index.js +1 -0
  177. package/dist/components/progress/index.js.map +1 -1
  178. package/dist/components/progress/progress.d.ts +3 -2
  179. package/dist/components/progress/progress.d.ts.map +1 -1
  180. package/dist/components/radio-group/index.js +1 -1
  181. package/dist/components/rating/index.js +2 -1
  182. package/dist/components/rating/index.js.map +1 -1
  183. package/dist/components/rating/rating.d.ts +3 -2
  184. package/dist/components/rating/rating.d.ts.map +1 -1
  185. package/dist/components/schedule/index.d.ts +4 -4
  186. package/dist/components/schedule/index.js +211 -110
  187. package/dist/components/schedule/index.js.map +1 -1
  188. package/dist/components/schedule/schedule-agenda-list.d.ts +6 -7
  189. package/dist/components/schedule/schedule-agenda-list.d.ts.map +1 -1
  190. package/dist/components/schedule/schedule-agenda-view.d.ts +19 -16
  191. package/dist/components/schedule/schedule-agenda-view.d.ts.map +1 -1
  192. package/dist/components/schedule/schedule-create-draft.d.ts +3 -2
  193. package/dist/components/schedule/schedule-create-draft.d.ts.map +1 -1
  194. package/dist/components/schedule/schedule-dates.d.ts.map +1 -1
  195. package/dist/components/schedule/schedule-days-view.d.ts +3 -2
  196. package/dist/components/schedule/schedule-days-view.d.ts.map +1 -1
  197. package/dist/components/schedule/schedule-drag-ghost.d.ts +12 -5
  198. package/dist/components/schedule/schedule-drag-ghost.d.ts.map +1 -1
  199. package/dist/components/schedule/schedule-event-chip.d.ts.map +1 -1
  200. package/dist/components/schedule/schedule-geometry.d.ts +16 -0
  201. package/dist/components/schedule/schedule-geometry.d.ts.map +1 -1
  202. package/dist/components/schedule/schedule-grid-gesture.d.ts +29 -6
  203. package/dist/components/schedule/schedule-grid-gesture.d.ts.map +1 -1
  204. package/dist/components/schedule/schedule-month-view.d.ts +3 -2
  205. package/dist/components/schedule/schedule-month-view.d.ts.map +1 -1
  206. package/dist/components/schedule/schedule-next-up.d.ts +4 -3
  207. package/dist/components/schedule/schedule-next-up.d.ts.map +1 -1
  208. package/dist/components/schedule/schedule-timed-grid.d.ts.map +1 -1
  209. package/dist/components/schedule/schedule-toolbar.d.ts +3 -3
  210. package/dist/components/schedule/schedule-toolbar.d.ts.map +1 -1
  211. package/dist/components/schedule/schedule-types.d.ts +9 -4
  212. package/dist/components/schedule/schedule-types.d.ts.map +1 -1
  213. package/dist/components/schedule/schedule-views.d.ts +2 -2
  214. package/dist/components/schedule/schedule-views.d.ts.map +1 -1
  215. package/dist/components/schedule/schedule-year-view.d.ts +3 -2
  216. package/dist/components/schedule/schedule-year-view.d.ts.map +1 -1
  217. package/dist/components/schedule/schedule.d.ts +9 -6
  218. package/dist/components/schedule/schedule.d.ts.map +1 -1
  219. package/dist/components/schedule/use-event-create.d.ts.map +1 -1
  220. package/dist/components/schedule/use-event-drag.d.ts.map +1 -1
  221. package/dist/components/schedule/use-event-resize.d.ts.map +1 -1
  222. package/dist/components/segment-group/index.js +2 -2
  223. package/dist/components/select/index.js +4 -4
  224. package/dist/components/slider/index.js +2 -1
  225. package/dist/components/slider/index.js.map +1 -1
  226. package/dist/components/slider/slider.d.ts +3 -2
  227. package/dist/components/slider/slider.d.ts.map +1 -1
  228. package/dist/components/switch/index.js +1 -1
  229. package/dist/components/tabs/index.js +1 -1
  230. package/dist/components/tabs/tabs-data.d.ts +3 -2
  231. package/dist/components/tabs/tabs-data.d.ts.map +1 -1
  232. package/dist/components/tags-input/index.js +6 -5
  233. package/dist/components/tags-input/index.js.map +1 -1
  234. package/dist/components/text-input/index.js +2 -2
  235. package/dist/components/textarea/index.js +2 -2
  236. package/dist/components/time-input/index.js +6 -6
  237. package/dist/components/timeline/index.js +8 -5
  238. package/dist/components/timeline/index.js.map +1 -1
  239. package/dist/components/timeline/timeline.d.ts +1 -1
  240. package/dist/components/timeline/timeline.d.ts.map +1 -1
  241. package/dist/components/tooltip/index.js +1 -1
  242. package/dist/components/tooltip/tooltip.d.ts +2 -1
  243. package/dist/components/tooltip/tooltip.d.ts.map +1 -1
  244. package/dist/components/tree-multi-select/index.js +6 -5
  245. package/dist/components/tree-multi-select/index.js.map +1 -1
  246. package/dist/components/tree-select/index.js +3 -3
  247. package/dist/lib/as-child.d.ts +104 -0
  248. package/dist/lib/as-child.d.ts.map +1 -0
  249. package/dist/theme.css +9 -3
  250. package/package.json +1 -1
  251. package/src/as-child.contract.test.tsx +809 -0
  252. package/src/components/accordion/accordion-data.tsx +8 -5
  253. package/src/components/accordion/accordion.test.tsx +40 -0
  254. package/src/components/accordion/accordion.tsx +23 -6
  255. package/src/components/action-icon/action-icon.tsx +9 -24
  256. package/src/components/alert/alert.test.tsx +25 -2
  257. package/src/components/alert/alert.tsx +39 -13
  258. package/src/components/app-shell/app-shell.tsx +3 -1
  259. package/src/components/breadcrumb/breadcrumb.test.tsx +30 -0
  260. package/src/components/breadcrumb/breadcrumb.tsx +21 -12
  261. package/src/components/button/button.tsx +21 -50
  262. package/src/components/calendar/calendar-body.tsx +8 -1
  263. package/src/components/circular-progress/circular-progress.tsx +4 -1
  264. package/src/components/clipboard/clipboard.test.tsx +18 -0
  265. package/src/components/clipboard/clipboard.tsx +8 -2
  266. package/src/components/code-block/chrome.tsx +60 -36
  267. package/src/components/code-block/code-block.test.tsx +27 -0
  268. package/src/components/code-block/code-block.tsx +13 -3
  269. package/src/components/code-block/notation.test.ts +8 -0
  270. package/src/components/code-block/notation.ts +6 -3
  271. package/src/components/code-block/static.tsx +8 -2
  272. package/src/components/collapse/collapse.tsx +33 -15
  273. package/src/components/combobox/combobox.test.tsx +38 -0
  274. package/src/components/combobox/combobox.tsx +24 -10
  275. package/src/components/divider/divider.tsx +3 -1
  276. package/src/components/drawer/drawer.tsx +37 -16
  277. package/src/components/field/field.tsx +7 -3
  278. package/src/components/input/input.tsx +3 -1
  279. package/src/components/menu/menu-data.tsx +8 -1
  280. package/src/components/menu/menu.test.tsx +52 -0
  281. package/src/components/menu/menu.tsx +83 -35
  282. package/src/components/modal/close-trigger.test.tsx +38 -0
  283. package/src/components/modal/modal.tsx +29 -13
  284. package/src/components/notification/create-notifier.tsx +6 -5
  285. package/src/components/notification/notification.test.tsx +15 -0
  286. package/src/components/notification/notification.tsx +8 -5
  287. package/src/components/pill/pill.tsx +29 -20
  288. package/src/components/pills-input/pills-input.tsx +3 -1
  289. package/src/components/popover/popover.tsx +3 -1
  290. package/src/components/progress/progress.tsx +4 -1
  291. package/src/components/rating/rating.tsx +27 -23
  292. package/src/components/schedule/index.ts +1 -1
  293. package/src/components/schedule/now-cursor-line.tsx +1 -1
  294. package/src/components/schedule/schedule-agenda-list.tsx +6 -7
  295. package/src/components/schedule/schedule-agenda-view.test.tsx +105 -28
  296. package/src/components/schedule/schedule-agenda-view.tsx +46 -31
  297. package/src/components/schedule/schedule-all-day-row.tsx +1 -1
  298. package/src/components/schedule/schedule-create-draft.tsx +14 -5
  299. package/src/components/schedule/schedule-dates.test.ts +37 -52
  300. package/src/components/schedule/schedule-dates.ts +25 -27
  301. package/src/components/schedule/schedule-days-view.tsx +9 -5
  302. package/src/components/schedule/schedule-drag-ghost.tsx +27 -12
  303. package/src/components/schedule/schedule-event-chip.tsx +9 -2
  304. package/src/components/schedule/schedule-event-list-popover-content.tsx +1 -1
  305. package/src/components/schedule/schedule-geometry.ts +21 -0
  306. package/src/components/schedule/schedule-grid-gesture.test.ts +83 -1
  307. package/src/components/schedule/schedule-grid-gesture.ts +67 -28
  308. package/src/components/schedule/schedule-month-view.tsx +10 -6
  309. package/src/components/schedule/schedule-next-up.tsx +11 -5
  310. package/src/components/schedule/schedule-timed-grid.tsx +41 -3
  311. package/src/components/schedule/schedule-toolbar.test.tsx +26 -0
  312. package/src/components/schedule/schedule-toolbar.tsx +35 -17
  313. package/src/components/schedule/schedule-types.ts +9 -4
  314. package/src/components/schedule/schedule-views.ts +4 -5
  315. package/src/components/schedule/schedule-year-view.tsx +10 -6
  316. package/src/components/schedule/schedule.test.tsx +198 -36
  317. package/src/components/schedule/schedule.tsx +28 -17
  318. package/src/components/schedule/use-event-create.ts +7 -6
  319. package/src/components/schedule/use-event-drag.ts +10 -4
  320. package/src/components/schedule/use-event-resize.ts +4 -2
  321. package/src/components/slider/slider.tsx +4 -0
  322. package/src/components/tabs/tabs-data.tsx +17 -14
  323. package/src/components/timeline/timeline.tsx +102 -95
  324. package/src/components/tooltip/tooltip.tsx +2 -1
  325. package/src/lib/as-child.test.tsx +70 -0
  326. package/src/lib/as-child.ts +119 -0
  327. package/src/theme.css +9 -3
  328. package/dist/chunk-2762HZYX.js.map +0 -1
  329. package/dist/chunk-2H46IXW4.js.map +0 -1
  330. package/dist/chunk-6SWK4XG5.js.map +0 -1
  331. package/dist/chunk-ACE7FBWE.js.map +0 -1
  332. package/dist/chunk-HWNPXAEN.js +0 -31
  333. package/dist/chunk-HWNPXAEN.js.map +0 -1
  334. package/dist/chunk-IFWCCAQV.js.map +0 -1
  335. package/dist/chunk-IXKELBJA.js.map +0 -1
  336. package/dist/chunk-J3PELDH3.js.map +0 -1
  337. package/dist/chunk-NGAQITWP.js.map +0 -1
  338. package/dist/chunk-POKDSVQT.js.map +0 -1
  339. package/dist/chunk-QMW7D5GU.js.map +0 -1
  340. package/dist/chunk-TMMEJKLI.js.map +0 -1
  341. package/dist/chunk-TNNH3FVQ.js.map +0 -1
  342. package/dist/chunk-U5GW5EBR.js.map +0 -1
  343. package/dist/chunk-UNSAA7YG.js.map +0 -1
  344. package/dist/chunk-VLUKI3HL.js.map +0 -1
  345. package/dist/chunk-VZ2TPU4B.js.map +0 -1
  346. package/dist/chunk-YIQI2CF3.js.map +0 -1
@@ -202,37 +202,31 @@ describe("getVisibleRange", () => {
202
202
  expect(end.toISOString()).toBe(day(2027, 0, 1).toISOString())
203
203
  })
204
204
 
205
- it("agenda view spans the strict calendar month", () => {
206
- const { start, end } = getVisibleRange("agenda", day(2026, 6, 15), opts)
207
- expect(start.toISOString()).toBe(day(2026, 6, 1).toISOString())
208
- expect(end.toISOString()).toBe(day(2026, 7, 1).toISOString())
205
+ it("agenda view starts at the anchor's own day and spans visibleDays", () => {
206
+ const { start, end } = getVisibleRange("agenda", day(2026, 6, 15, 14), opts)
207
+ expect(start.toISOString()).toBe(day(2026, 6, 15).toISOString())
208
+ expect(end.toISOString()).toBe(day(2026, 6, 22).toISOString())
209
209
  })
210
210
 
211
- /** The whole reason agenda can't reuse the month branch: the padded grid
212
- * would make `isEventInVisibleRange` claim an adjacent-month event is on
213
- * screen in a list that never renders one. */
214
- it("agenda view does not pad like the month grid", () => {
215
- const agenda = getVisibleRange("agenda", day(2026, 6, 15), opts)
216
- const month = getVisibleRange("month", day(2026, 6, 15), opts)
217
- expect(agenda.start.toISOString()).not.toBe(month.start.toISOString())
218
- expect(agenda.end.toISOString()).not.toBe(month.end.toISOString())
211
+ it("agenda view takes its span from visibleDays", () => {
212
+ const { start, end } = getVisibleRange("agenda", day(2026, 6, 15), { ...opts, visibleDays: 3 })
213
+ expect(start.toISOString()).toBe(day(2026, 6, 15).toISOString())
214
+ expect(end.toISOString()).toBe(day(2026, 6, 18).toISOString())
219
215
  })
220
216
 
221
- it("agenda view ignores startOfWeek and visibleDays", () => {
217
+ /** A list is read from its top, so the window never snaps back to a week
218
+ * start — whatever `startOfWeek` says, the anchor's day comes first. */
219
+ it("agenda view ignores startOfWeek", () => {
222
220
  const plain = getVisibleRange("agenda", day(2026, 6, 15), opts)
223
- const fiddled = getVisibleRange("agenda", day(2026, 6, 15), {
224
- ...opts,
225
- startOfWeek: "mon",
226
- visibleDays: 3,
227
- })
221
+ const fiddled = getVisibleRange("agenda", day(2026, 6, 15), { ...opts, startOfWeek: "mon" })
228
222
  expect(fiddled.start.toISOString()).toBe(plain.start.toISOString())
229
223
  expect(fiddled.end.toISOString()).toBe(plain.end.toISOString())
230
224
  })
231
225
 
232
- it("agenda view closes February on a leap year", () => {
233
- const { start, end } = getVisibleRange("agenda", day(2028, 1, 10), opts)
234
- expect(start.toISOString()).toBe(day(2028, 1, 1).toISOString())
235
- expect(end.toISOString()).toBe(day(2028, 2, 1).toISOString())
226
+ it("agenda view runs across a month end", () => {
227
+ const { start, end } = getVisibleRange("agenda", day(2028, 1, 27), opts)
228
+ expect(start.toISOString()).toBe(day(2028, 1, 27).toISOString())
229
+ expect(end.toISOString()).toBe(day(2028, 2, 5).toISOString())
236
230
  })
237
231
  })
238
232
 
@@ -251,27 +245,18 @@ describe("paginateDate", () => {
251
245
  expect(paginateDate("year", anchor, 1, { timeZone: TZ }).toISOString()).toBe(
252
246
  day(2027, 6, 15).toISOString(),
253
247
  )
254
- expect(paginateDate("agenda", anchor, 1, { timeZone: TZ }).toISOString()).toBe(
255
- day(2026, 7, 15).toISOString(),
248
+ expect(paginateDate("agenda", anchor, 1, { timeZone: TZ, visibleDays: 7 }).toISOString()).toBe(
249
+ day(2026, 6, 22).toISOString(),
256
250
  )
257
- expect(paginateDate("agenda", anchor, -1, { timeZone: TZ }).toISOString()).toBe(
258
- day(2026, 5, 15).toISOString(),
251
+ expect(paginateDate("agenda", anchor, -1, { timeZone: TZ, visibleDays: 7 }).toISOString()).toBe(
252
+ day(2026, 6, 8).toISOString(),
259
253
  )
260
254
  })
261
255
 
262
- /** Without the clamp a Jan 31 anchor would land on Mar 2/3, i.e. Next would
263
- * skip February entirely. `@internationalized/date` handles it; this pins
264
- * that we rely on it. */
265
- it("clamps an agenda step onto a shorter month", () => {
266
- expect(paginateDate("agenda", day(2026, 0, 31), 1, { timeZone: TZ }).toISOString()).toBe(
267
- day(2026, 1, 28).toISOString(),
268
- )
269
- })
270
-
271
- it("steps the agenda exactly as the month view does", () => {
256
+ it("steps the agenda exactly as the days view does", () => {
272
257
  const anchor = day(2026, 6, 15)
273
- expect(paginateDate("agenda", anchor, 1, { timeZone: TZ }).toISOString()).toBe(
274
- paginateDate("month", anchor, 1, { timeZone: TZ }).toISOString(),
258
+ expect(paginateDate("agenda", anchor, 1, { timeZone: TZ, visibleDays: 5 }).toISOString()).toBe(
259
+ paginateDate("days", anchor, 1, { timeZone: TZ, visibleDays: 5 }).toISOString(),
275
260
  )
276
261
  })
277
262
 
@@ -526,14 +511,14 @@ describe("formatScheduleTitle", () => {
526
511
  expect(formatScheduleTitle("days", anchor, { ...opts, visibleDays: 1 })).toBe("July 15, 2026")
527
512
  expect(formatScheduleTitle("month", anchor, opts)).toBe("July 2026")
528
513
  expect(formatScheduleTitle("year", anchor, opts)).toBe("2026")
529
- expect(formatScheduleTitle("agenda", anchor, opts)).toBe("July 2026")
530
514
  })
531
515
 
532
- it("titles the agenda exactly as the month view", () => {
516
+ /** Days would snap this Wednesday anchor back to Sunday the 12th; the
517
+ * agenda's title names the window it really lists, from the anchor on. */
518
+ it("titles the agenda with its own range, starting at the anchor", () => {
533
519
  const anchor = day(2026, 6, 15)
534
- expect(formatScheduleTitle("agenda", anchor, opts)).toBe(
535
- formatScheduleTitle("month", anchor, opts),
536
- )
520
+ expect(formatScheduleTitle("agenda", anchor, opts)).toBe("Jul 15 – 21, 2026")
521
+ expect(formatScheduleTitle("agenda", anchor, { ...opts, visibleDays: 1 })).toBe("July 15, 2026")
537
522
  })
538
523
 
539
524
  it("condenses a same-month 7-day range (the default visibleDays)", () => {
@@ -750,22 +735,22 @@ describe("isEventInVisibleRange", () => {
750
735
 
751
736
  describe("isEventInVisibleRange — agenda", () => {
752
737
  const opts = { timeZone: "UTC", locale: "en-US" } as const
753
- const anchor = new Date(Date.UTC(2026, 8, 15, 12)) // September 2026
738
+ const anchor = new Date(Date.UTC(2026, 8, 15, 12)) // Tue 15 Sep → window 15–21 Sep
754
739
  const at = (m: number, d: number, h = 0) => new Date(Date.UTC(2026, m, d, h))
755
740
  const inAgenda = (start: Date, end: Date) =>
756
741
  isEventInVisibleRange({ start, end }, "agenda", anchor, opts)
757
742
 
758
- it("sees an event inside the anchored month", () => {
759
- expect(inAgenda(at(8, 2, 9), at(8, 2, 10))).toBe(true)
760
- expect(inAgenda(at(8, 30, 9), at(8, 30, 10))).toBe(true)
743
+ it("sees an event inside the window, including earlier on the anchor's day", () => {
744
+ expect(inAgenda(at(8, 15, 9), at(8, 15, 10))).toBe(true)
745
+ expect(inAgenda(at(8, 21, 22), at(8, 21, 23))).toBe(true)
761
746
  })
762
747
 
763
- it("does not see an event in an adjacent month", () => {
764
- expect(inAgenda(at(7, 31, 9), at(7, 31, 10))).toBe(false)
765
- expect(inAgenda(at(9, 1, 9), at(9, 1, 10))).toBe(false)
748
+ it("does not see an event before the anchor's day or past the window", () => {
749
+ expect(inAgenda(at(8, 14, 9), at(8, 14, 10))).toBe(false)
750
+ expect(inAgenda(at(8, 22, 9), at(8, 22, 10))).toBe(false)
766
751
  })
767
752
 
768
- it("sees a multi-day event that only straddles the month start", () => {
769
- expect(inAgenda(at(7, 28), at(8, 2))).toBe(true)
753
+ it("sees a multi-day event that only straddles the window start", () => {
754
+ expect(inAgenda(at(8, 12), at(8, 16))).toBe(true)
770
755
  })
771
756
  })
@@ -10,6 +10,7 @@ import {
10
10
  } from "@internationalized/date"
11
11
  import { match } from "ts-pattern"
12
12
  import { calendarValueToDate, dateToCalendarValue } from "../../lib/date-value"
13
+ import { DEFAULT_LOCALE } from "../../lib/intl"
13
14
  import type { ScheduleSlotPredicate } from "../../lib/schedule-predicates"
14
15
  import type {
15
16
  FirstDayOfWeek,
@@ -157,23 +158,19 @@ export function getVisibleRange(view: ScheduleView, date: Date, options: RangeOp
157
158
  return { start, end }
158
159
  })
159
160
  .with("agenda", () => {
160
- // The **strict** calendar month, deliberately not `"month"`'s padded
161
- // six-week grid. Month pads because the adjacent-month days are real
162
- // cells on screen whose events have to be queried; the agenda has no
163
- // cells — it lists what the title claims, so padding would open a
164
- // September list with three late-August rows and double-list every
165
- // seam day across two consecutive months.
161
+ // A list window that **starts at the anchor itself** and runs
162
+ // `visibleDays` days — `"relative"` Days, never a calendar snap. A list
163
+ // is read top to bottom, so wherever it starts is what the reader sees
164
+ // first: snapping to the 1st of the month (the old window) buried today
165
+ // halfway down and left the Now button with nothing visible to do.
166
166
  //
167
- // The sharper reason it cannot reuse Month's range: `Root`'s reveal
168
- // asks `isEventInVisibleRange(event, currentView, ...)`, which is a
169
- // composition over this function. Under the padded range that answers
170
- // "yes, already visible" for an August 31st event the agenda does not
171
- // list, so `Root` declines to move the anchor and the selected event is
172
- // nowhere on screen. Strict bounds keep "is it in range" and "is it
173
- // rendered" the same predicate over the same range.
174
- const start = midnightOf(startOfMonth(value))
175
- const end = midnightOf(endOfMonth(value)).add({ days: 1 })
176
- return { start, end }
167
+ // Still unpadded, and still the one range both "is it in range" and "is
168
+ // it rendered" are asked against: `Root`'s reveal asks
169
+ // `isEventInVisibleRange(event, "agenda", ...)`, a composition over this
170
+ // function, and an event outside it moves the anchor onto that event's
171
+ // own day — so the reveal needs no agenda-specific code.
172
+ const start = midnightOf(value)
173
+ return { start, end: start.add({ days: visibleDays }) }
177
174
  })
178
175
  .exhaustive()
179
176
 
@@ -194,12 +191,12 @@ export function paginateDate(
194
191
  ): Date {
195
192
  const value = toZoned(date, options.timeZone)
196
193
  const duration = match(view)
197
- .with("days", () => ({ days: options.visibleDays ?? 7 }))
198
- // One pattern, not two branches: "the agenda is month-windowed" is stated
199
- // once, so the two can never drift into stepping differently.
194
+ // One pattern, not two branches: the agenda's window is a days-window
195
+ // that starts at the anchor, so it steps exactly as Days does.
196
+ .with("days", "agenda", () => ({ days: options.visibleDays ?? 7 }))
200
197
  // `@internationalized/date`'s `add({ months: 1 })` clamps Jan 31 to Feb
201
198
  // 28/29, so Prev/Next never skips a month.
202
- .with("month", "agenda", () => ({ months: 1 }))
199
+ .with("month", () => ({ months: 1 }))
203
200
  .with("year", () => ({ years: 1 }))
204
201
  .exhaustive()
205
202
  const next = direction === 1 ? value.add(duration) : value.subtract(duration)
@@ -601,17 +598,20 @@ export function formatScheduleTitle(
601
598
  visibleDays?: number
602
599
  },
603
600
  ): string {
604
- const { timeZone, locale, startOfWeek, visibleDays } = options
601
+ const { timeZone, locale = DEFAULT_LOCALE, startOfWeek, visibleDays } = options
605
602
  return (
606
603
  match(view)
607
- .with("days", () => {
604
+ // The agenda's window is a days-window (see `getVisibleRange`), so its
605
+ // title is the same range label — computed from its own range, which
606
+ // never snaps, rather than Days'.
607
+ .with("days", "agenda", (v) => {
608
608
  const days = visibleDays ?? 7
609
609
  if (days === 1) {
610
610
  return new Intl.DateTimeFormat(locale, { dateStyle: "long", timeZone }).format(date)
611
611
  }
612
- const range = getVisibleRange("days", date, {
612
+ const range = getVisibleRange(v, date, {
613
613
  timeZone,
614
- locale: locale ?? "en-US",
614
+ locale,
615
615
  startOfWeek,
616
616
  visibleDays: days,
617
617
  })
@@ -620,9 +620,7 @@ export function formatScheduleTitle(
620
620
  .formatRange(range.start, lastDay)
621
621
  .normalize("NFKC")
622
622
  })
623
- // Same merge, same reason, as `paginateDate` above: the agenda's title is
624
- // Month's by construction rather than by a copied format object.
625
- .with("month", "agenda", () =>
623
+ .with("month", () =>
626
624
  new Intl.DateTimeFormat(locale, { month: "long", year: "numeric", timeZone }).format(date),
627
625
  )
628
626
  .with("year", () =>
@@ -1,10 +1,11 @@
1
1
  "use client"
2
2
 
3
3
  import { ark, type HTMLArkProps } from "@ark-ui/react"
4
- import { getLocalTimeZone } from "@internationalized/date"
5
4
  import type { Ref } from "react"
6
5
  import { useRef } from "react"
6
+ import type { NoAsChild } from "../../lib/as-child"
7
7
  import { cn } from "../../lib/cn"
8
+ import { useLocale, useTimeZone } from "../../lib/intl"
8
9
  import { mergeRefs } from "../../lib/merge-refs"
9
10
  import { props } from "../../lib/props"
10
11
  import type { WithTestId } from "../../lib/test-id"
@@ -57,7 +58,7 @@ export type DaysViewBaseProps<P = unknown> = ScheduleSharedProps<P> &
57
58
  // two intersect into a handler that has to satisfy *both* signatures, so the
58
59
  // declaration compiles and every call site fails. The kit already uses this
59
60
  // treatment for other redefined natives.
60
- Omit<HTMLArkProps<"div">, "onSelect"> &
61
+ NoAsChild<Omit<HTMLArkProps<"div">, "onSelect">> &
61
62
  WithTestId & {
62
63
  /** How many day-columns to show at once. Default `7`. */
63
64
  visibleDays?: number
@@ -108,8 +109,8 @@ export function DaysViewBody<P = unknown>({
108
109
  withEventDetails = true,
109
110
  onDayClick,
110
111
  renderEventDetails,
111
- locale,
112
- timeZone = getLocalTimeZone(),
112
+ locale: localeProp,
113
+ timeZone: timeZoneProp,
113
114
  translations,
114
115
  classNames,
115
116
  className,
@@ -145,8 +146,11 @@ export function DaysViewBody<P = unknown>({
145
146
  gridRef,
146
147
  nowRef,
147
148
  testId,
149
+ asChild: _asChild,
148
150
  ...rest
149
151
  }: DaysViewBaseProps<P> & ScheduleSlotValues) {
152
+ const locale = useLocale(localeProp)
153
+ const timeZone = useTimeZone(timeZoneProp)
150
154
  const [anchorDate, setAnchorDate] = useUncontrolled<Date>({
151
155
  value: date,
152
156
  defaultValue: defaultDate,
@@ -164,7 +168,7 @@ export function DaysViewBody<P = unknown>({
164
168
  const t = resolveScheduleTranslations(translations)
165
169
  const range = getVisibleRange("days", anchorDate, {
166
170
  timeZone,
167
- locale: locale ?? "en-US",
171
+ locale,
168
172
  startOfWeek: align,
169
173
  visibleDays,
170
174
  })
@@ -1,11 +1,13 @@
1
1
  import { cn } from "../../lib/cn"
2
+ import { poolPieceInsets } from "./schedule-geometry"
2
3
 
3
4
  /**
4
5
  * The move-drag preview. Same shape and same geometry as
5
6
  * `schedule-create-draft.tsx` — a permanently-mounted, `aria-hidden`,
6
7
  * pointer-events-none leaf driven purely by imperative CSS-var writes, never a
7
- * `useState` re-render per `pointermove` — and, like it, **one per day
8
- * column**.
8
+ * `useState` re-render per `pointermove` — and, like it, pooled: one per
9
+ * rendered day, in a layer laid over the day columns (`piece-pool` in
10
+ * `schedule-timed-grid.tsx`), each placed on its day by `--sch-ghost-col`.
9
11
  *
10
12
  * It used to be a single element at the grid level, placed by writing
11
13
  * `gridColumn`, which needed no horizontal pixel math. That was elegant and it
@@ -13,11 +15,17 @@ import { cn } from "../../lib/cn"
13
15
  * days, and one box can only ever draw one of them. Its own comment admitted
14
16
  * as much ("the ghost shows the *first* day's piece"), so dragging an event up
15
17
  * through midnight drew the piece on the previous day and simply omitted the
16
- * piece under the pointer. Per-column leaves draw every piece, exactly the way
18
+ * piece under the pointer. One piece per day draws every piece, exactly the way
17
19
  * a committed multi-day event already renders.
18
20
  *
19
- * `--sch-ghost-top`/`--sch-ghost-height` are percentages of the day column's
20
- * own height, exactly like a chip's `--sch-base-top`/`--sch-base-height`, so
21
+ * Those pieces were then mounted *inside* each day column, which fixed the
22
+ * midnight case and broke a smaller one: a piece's identity was its column, so
23
+ * moving to another day faded one element out and the next one in, where a
24
+ * vertical move glided. Placed by a var, a piece keeps its element across the
25
+ * change and slides — see `paintPieces`' `anchor`.
26
+ *
27
+ * `--sch-ghost-top`/`--sch-ghost-height` are percentages of the timed row's
28
+ * height (the pool layer's, and every day column's), exactly like a chip's `--sch-base-top`/`--sch-base-height`, so
21
29
  * the ghost lines up with the hour grid without knowing the hour height.
22
30
  */
23
31
  export function ScheduleDragGhost({ className }: { className?: string }) {
@@ -33,7 +41,7 @@ export function ScheduleDragGhost({ className }: { className?: string }) {
33
41
  // while staying under the sticky gutter (30) — same band, and same
34
42
  // reasoning, as the create draft's own.
35
43
  className={cn(
36
- "group pointer-events-none absolute inset-x-0 z-26 hidden select-none rounded-sm",
44
+ "group pointer-events-none absolute z-26 hidden select-none rounded-sm",
37
45
  // The piece carrying the readout paints above its siblings — same
38
46
  // collision the create draft has, for the same reason: the label is
39
47
  // deliberately wider than its own column so a cross-day range is not
@@ -97,12 +105,15 @@ export function ScheduleDragGhost({ className }: { className?: string }) {
97
105
  * during a move (a move preserves duration) and is listed only so the
98
106
  * two previews stay one declaration apart.
99
107
  *
100
- * Only the vertical smooths. Moving to another day swaps to a different
101
- * element — one ghost piece per day column — so a CSS transition has
102
- * nothing to interpolate across that axis.
108
+ * `inset-inline-start` eases a move onto another day the same way. The
109
+ * piece stays one element across the change (`paintPieces` keys it by
110
+ * its offset from the pointer's column), so this slides it rather than
111
+ * fading one column's piece out and the next one's in. Longer than the
112
+ * vertical step because the distance is: a column is a hundred-odd
113
+ * pixels where a slot is a dozen.
103
114
  */
104
- "[transition:opacity_200ms_ease-in,scale_200ms_ease-in,display_200ms_ease-in_allow-discrete,top_45ms_ease-out,height_45ms_ease-out]",
105
- "data-active:[transition:opacity_200ms_ease-out,scale_200ms_ease-out,display_200ms_ease-out_allow-discrete,top_45ms_ease-out,height_45ms_ease-out]",
115
+ "[transition:opacity_200ms_ease-in,scale_200ms_ease-in,display_200ms_ease-in_allow-discrete,top_45ms_ease-out,height_45ms_ease-out,inset-inline-start_70ms_ease-out]",
116
+ "data-active:[transition:opacity_200ms_ease-out,scale_200ms_ease-out,display_200ms_ease-out_allow-discrete,top_45ms_ease-out,height_45ms_ease-out,inset-inline-start_70ms_ease-out]",
106
117
  "starting:data-active:opacity-0 starting:data-active:scale-105",
107
118
  // `!` and the full shorthand, not `transition-none`: the `data-active`
108
119
  // rule above is a class *and* an attribute selector, so a plain
@@ -119,7 +130,11 @@ export function ScheduleDragGhost({ className }: { className?: string }) {
119
130
  "data-continues-after:rounded-b-none data-continues-after:border-b-0",
120
131
  className,
121
132
  )}
122
- style={{ top: "var(--sch-ghost-top, 0%)", height: "var(--sch-ghost-height, 0%)" }}
133
+ style={{
134
+ top: "var(--sch-ghost-top, 0%)",
135
+ height: "var(--sch-ghost-height, 0%)",
136
+ ...poolPieceInsets("--sch-ghost-col"),
137
+ }}
123
138
  >
124
139
  {/* The live drop-time readout. Both products that ship drag-to-page pair
125
140
  * the gesture with one, and for the same reason: once the view can move
@@ -1,5 +1,6 @@
1
1
  "use client"
2
2
 
3
+ import { useLocaleContext } from "@ark-ui/react/locale"
3
4
  import { usePresence } from "@ark-ui/react/presence"
4
5
  import { cva } from "class-variance-authority"
5
6
  import { XIcon } from "lucide-react"
@@ -928,6 +929,11 @@ function InteractiveEventChip<P = unknown>({
928
929
  locale,
929
930
  })
930
931
 
932
+ // Left/Right are physical keys, but days run right-to-left under an RTL
933
+ // locale. The locale is where the kit takes direction from (see
934
+ // `useDirectionCheck`), which is also how zag mirrors arrow keys.
935
+ const { dir } = useLocaleContext()
936
+
931
937
  const handleBodyKeyDown = (e: ReactKeyboardEvent<HTMLDivElement>) => {
932
938
  if (!present) return
933
939
  if (e.key === "Enter" || e.key === " ") {
@@ -943,13 +949,14 @@ function InteractiveEventChip<P = unknown>({
943
949
  // scrolls it instead of moving anything.
944
950
  e.preventDefault()
945
951
  // Left/Right move by a whole day, with no modifier variants — the
946
- // keyboard counterpart of dragging sideways. Up/Down keep their existing
952
+ // keyboard counterpart of dragging sideways, so they follow the columns:
953
+ // under RTL, Left is the *next* day. Up/Down keep their existing
947
954
  // `slotDuration` step (Shift ×4). Both go through the same displacement
948
955
  // primitive as the pointer path, so "a move never changes duration" is one
949
956
  // rule rather than two implementations of it.
950
957
  const step = e.shiftKey ? slotDuration * 4 : slotDuration
951
958
  const delta = isHorizontal
952
- ? { days: e.key === "ArrowLeft" ? -1 : 1, minutes: 0 }
959
+ ? { days: (e.key === "ArrowLeft") === (dir === "rtl") ? 1 : -1, minutes: 0 }
953
960
  : { days: 0, minutes: e.key === "ArrowUp" ? -step : step }
954
961
  const next = { ...moveRange(event, delta, { timeZone, slotDuration }) }
955
962
  const result = checkRangeCommit(next, {
@@ -98,7 +98,7 @@ export function ScheduleEventListPopoverContent<P = unknown>({
98
98
  aria-label={translations.back}
99
99
  className="-ms-1 flex items-center gap-1 rounded-sm px-1 py-0.5 text-gray-light-500 text-xs hover:bg-black/5 dark:text-gray-dark-400 dark:hover:bg-white/8"
100
100
  >
101
- <ArrowLeftIcon className="size-3.5" />
101
+ <ArrowLeftIcon className="size-3.5 rtl:rotate-180" />
102
102
  {translations.back}
103
103
  </button>
104
104
  </Popover.Header>
@@ -193,6 +193,27 @@ export function columnInsets({ column, columnCount }: ScheduleLayoutResult): {
193
193
  }
194
194
  }
195
195
 
196
+ /** The horizontal box of one preview piece in the timed grid's `piece-pool`
197
+ * layer, which spans every day column at once. `columnVar` holds the day
198
+ * index the gesture painted the piece over; `--sch-pool-columns` is the
199
+ * number of rendered days, written on the layer.
200
+ *
201
+ * Logical (`insetInlineStart`), so a column index lands on the same day in
202
+ * RTL as the grid's own placement does, with no sign math.
203
+ *
204
+ * The `min(col, 1) * 1px` terms step past the hairline every day column after
205
+ * the first draws at its start edge (`border-s`), so a piece covers exactly
206
+ * the column's padding box: the box its chips are laid out in, and the box
207
+ * the piece used to fill when it was mounted inside the column. */
208
+ export function poolPieceInsets(columnVar: string): { insetInlineStart: string; width: string } {
209
+ const col = `var(${columnVar}, 0)`
210
+ const hairline = `min(${col}, 1) * 1px`
211
+ return {
212
+ insetInlineStart: `calc(${col} * 100% / var(--sch-pool-columns, 1) + ${hairline})`,
213
+ width: `calc(100% / var(--sch-pool-columns, 1) - ${hairline})`,
214
+ }
215
+ }
216
+
196
217
  /**
197
218
  * Resolves a px-per-minute rate by measuring the day-column's *real*
198
219
  * rendered height (`getBoundingClientRect()`), divided by the window's total
@@ -1,5 +1,14 @@
1
1
  import { afterEach, describe, expect, it, vi } from "vitest"
2
- import { type ColumnBox, liveColumns, measureColumns } from "./schedule-grid-gesture"
2
+ import {
3
+ type ColumnBox,
4
+ type EdgeState,
5
+ liveColumns,
6
+ MAX_SCROLL_PX_PER_FRAME,
7
+ measureColumns,
8
+ PAGINATE_DWELL_MS,
9
+ stopEdgeBehaviours,
10
+ tickEdges,
11
+ } from "./schedule-grid-gesture"
3
12
 
4
13
  /**
5
14
  * `measureColumns` decides whether a gesture has a horizontal axis at all, and
@@ -151,3 +160,76 @@ describe("the rejection is no longer silent", () => {
151
160
  expect(warn.mock.calls[0]?.[0]).toMatch(/could not measure the day columns/)
152
161
  })
153
162
  })
163
+
164
+ /**
165
+ * Under `dir="rtl"` a scroller's `scrollLeft` runs from `0` at its right edge
166
+ * down to `-(scrollWidth - clientWidth)`, and the *left* edge leads to later
167
+ * days. jsdom has neither layout nor scrolling, so the grid's box and its
168
+ * `scrollLeft` are stubbed: the browser's own clamp is exactly what this
169
+ * function's frozen extent replaces, so a plain read/write field is faithful.
170
+ */
171
+ describe("tickEdges", () => {
172
+ const edgeState = (scrollLeft: number): EdgeState => {
173
+ const el = document.createElement("div")
174
+ let left = scrollLeft
175
+ Object.defineProperty(el, "scrollLeft", { get: () => left, set: (v: number) => (left = v) })
176
+ vi.spyOn(el, "getBoundingClientRect").mockReturnValue({
177
+ left: 0,
178
+ right: 1000,
179
+ width: 1000,
180
+ top: 0,
181
+ bottom: 500,
182
+ height: 500,
183
+ } as DOMRect)
184
+ return {
185
+ grid: el,
186
+ // Hard against the left edge, mid-height: full horizontal pressure only.
187
+ clientX: 0,
188
+ clientY: 250,
189
+ scrollRaf: null,
190
+ paginateTimer: null,
191
+ paginateDirection: null,
192
+ paginationOffset: 0,
193
+ columns: [],
194
+ maxScrollLeft: 300,
195
+ maxScrollTop: 0,
196
+ }
197
+ }
198
+
199
+ afterEach(() => vi.useRealTimers())
200
+
201
+ it("scrolls into a negative rtl scrollLeft instead of pinning it to 0", () => {
202
+ const state = edgeState(-100)
203
+ tickEdges(state, { dir: "rtl", paint: () => {}, isLive: () => true })
204
+ stopEdgeBehaviours(state)
205
+
206
+ expect(state.grid.scrollLeft).toBe(-100 - MAX_SCROLL_PX_PER_FRAME)
207
+ })
208
+
209
+ it.each([
210
+ ["ltr", 0, -1],
211
+ ["rtl", -300, 1],
212
+ ] as const)(
213
+ "pages %s at the left edge once it can't scroll further",
214
+ (dir, scrollLeft, expected) => {
215
+ vi.useFakeTimers()
216
+ const state = edgeState(scrollLeft)
217
+ const onPaginate = vi.fn()
218
+ let live = true
219
+ tickEdges(state, {
220
+ dir,
221
+ paint: () => {},
222
+ isLive: () => live,
223
+ onPaginate: (direction) => {
224
+ live = false
225
+ onPaginate(direction)
226
+ },
227
+ })
228
+ vi.advanceTimersByTime(PAGINATE_DWELL_MS)
229
+ stopEdgeBehaviours(state)
230
+
231
+ expect(onPaginate).toHaveBeenCalledExactlyOnceWith(expected)
232
+ expect(state.grid.scrollLeft).toBe(scrollLeft)
233
+ },
234
+ )
235
+ })