@kumix/ui 0.3.12 → 0.3.13

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 (530) hide show
  1. package/README.md +1 -1
  2. package/dist/components/agents/agent-activity/activity-row.js +2 -2
  3. package/dist/components/agents/agent-activity/activity-row.js.map +1 -1
  4. package/dist/components/agents/agent-activity/index.js +2 -2
  5. package/dist/components/agents/agent-activity/index.js.map +1 -1
  6. package/dist/components/agents/agent-code.d.ts.map +1 -1
  7. package/dist/components/agents/agent-code.js +2 -2
  8. package/dist/components/agents/agent-code.js.map +1 -1
  9. package/dist/components/agents/agent-disclosure.js +1 -1
  10. package/dist/components/agents/agent-disclosure.js.map +1 -1
  11. package/dist/components/agents/ai-sidebar.js +2 -2
  12. package/dist/components/agents/ai-sidebar.js.map +1 -1
  13. package/dist/components/agents/approval-card/index.js +2 -2
  14. package/dist/components/agents/approval-card/index.js.map +1 -1
  15. package/dist/components/agents/chat-app.js +1 -1
  16. package/dist/components/agents/chat-app.js.map +1 -1
  17. package/dist/components/agents/citations.js +2 -2
  18. package/dist/components/agents/citations.js.map +1 -1
  19. package/dist/components/agents/code-block.js +2 -2
  20. package/dist/components/agents/code-block.js.map +1 -1
  21. package/dist/components/agents/file-diff.js +2 -2
  22. package/dist/components/agents/file-diff.js.map +1 -1
  23. package/dist/components/agents/image-generation.js +2 -2
  24. package/dist/components/agents/image-generation.js.map +1 -1
  25. package/dist/components/agents/loading-states/agent-progress.js +1 -1
  26. package/dist/components/agents/loading-states/agent-progress.js.map +1 -1
  27. package/dist/components/agents/loading-states/reasoning-text.js +1 -1
  28. package/dist/components/agents/loading-states/reasoning-text.js.map +1 -1
  29. package/dist/components/agents/loading-states/thinking-shimmer.js +1 -1
  30. package/dist/components/agents/loading-states/thinking-shimmer.js.map +1 -1
  31. package/dist/components/agents/message-bubble.js +2 -2
  32. package/dist/components/agents/message-bubble.js.map +1 -1
  33. package/dist/components/agents/message-scroller.js +1 -1
  34. package/dist/components/agents/message-scroller.js.map +1 -1
  35. package/dist/components/agents/message.js +1 -1
  36. package/dist/components/agents/message.js.map +1 -1
  37. package/dist/components/agents/prompt-input.js +2 -2
  38. package/dist/components/agents/prompt-input.js.map +1 -1
  39. package/dist/components/agents/streaming-response.js +2 -2
  40. package/dist/components/agents/streaming-response.js.map +1 -1
  41. package/dist/components/agents/todo-list.js +2 -2
  42. package/dist/components/agents/todo-list.js.map +1 -1
  43. package/dist/components/agents/tool-approval.js +2 -2
  44. package/dist/components/agents/tool-approval.js.map +1 -1
  45. package/dist/components/agents/tool-result.js +2 -2
  46. package/dist/components/agents/tool-result.js.map +1 -1
  47. package/dist/components/custom/confirm-dialog.js +1 -1
  48. package/dist/components/motion/action-swap.js +1 -1
  49. package/dist/components/motion/action-swap.js.map +1 -1
  50. package/dist/components/motion/adaptive-stepper.js +2 -2
  51. package/dist/components/motion/adaptive-stepper.js.map +1 -1
  52. package/dist/components/motion/animated-badge.js +2 -2
  53. package/dist/components/motion/animated-badge.js.map +1 -1
  54. package/dist/components/motion/animated-number.js +1 -1
  55. package/dist/components/motion/animated-number.js.map +1 -1
  56. package/dist/components/motion/animated-sidebar.js +2 -2
  57. package/dist/components/motion/animated-sidebar.js.map +1 -1
  58. package/dist/components/motion/animated-toast-stack.js +2 -2
  59. package/dist/components/motion/animated-toast-stack.js.map +1 -1
  60. package/dist/components/motion/attachment-upload.js +2 -2
  61. package/dist/components/motion/attachment-upload.js.map +1 -1
  62. package/dist/components/motion/availability-scheduler/copy-menu.js +1 -1
  63. package/dist/components/motion/availability-scheduler/day-row.js +2 -2
  64. package/dist/components/motion/availability-scheduler/icon-button.js +1 -1
  65. package/dist/components/motion/availability-scheduler/icon-button.js.map +1 -1
  66. package/dist/components/motion/availability-scheduler/index.js +2 -2
  67. package/dist/components/motion/availability-scheduler/index.js.map +1 -1
  68. package/dist/components/motion/bloom-menu.js +2 -2
  69. package/dist/components/motion/bloom-menu.js.map +1 -1
  70. package/dist/components/motion/bottom-sheet.js +1 -1
  71. package/dist/components/motion/bottom-sheet.js.map +1 -1
  72. package/dist/components/motion/bounce-sidebar.d.ts.map +1 -1
  73. package/dist/components/motion/bounce-sidebar.js +1 -1
  74. package/dist/components/motion/bounce-sidebar.js.map +1 -1
  75. package/dist/components/motion/bouncy-accordion.js +2 -2
  76. package/dist/components/motion/bouncy-accordion.js.map +1 -1
  77. package/dist/components/motion/button/base.js +1 -1
  78. package/dist/components/motion/button/base.js.map +1 -1
  79. package/dist/components/motion/button/metallic.js +1 -1
  80. package/dist/components/motion/button/metallic.js.map +1 -1
  81. package/dist/components/motion/button/stateful.js +1 -1
  82. package/dist/components/motion/card-folder.d.ts +30 -0
  83. package/dist/components/motion/card-folder.d.ts.map +1 -0
  84. package/dist/components/motion/card-folder.js +254 -0
  85. package/dist/components/motion/card-folder.js.map +1 -0
  86. package/dist/components/motion/center-morph-modal.js +2 -2
  87. package/dist/components/motion/center-morph-modal.js.map +1 -1
  88. package/dist/components/motion/checkbox.js +1 -1
  89. package/dist/components/motion/checkbox.js.map +1 -1
  90. package/dist/components/motion/chromatic-text-reveal.js +1 -1
  91. package/dist/components/motion/chromatic-text-reveal.js.map +1 -1
  92. package/dist/components/motion/combobox/content.js +1 -1
  93. package/dist/components/motion/combobox/content.js.map +1 -1
  94. package/dist/components/motion/combobox/context.js +1 -1
  95. package/dist/components/motion/combobox/context.js.map +1 -1
  96. package/dist/components/motion/combobox/list.js +2 -2
  97. package/dist/components/motion/combobox/list.js.map +1 -1
  98. package/dist/components/motion/combobox/trigger.js +2 -2
  99. package/dist/components/motion/combobox/trigger.js.map +1 -1
  100. package/dist/components/motion/command-palette.js +2 -2
  101. package/dist/components/motion/command-palette.js.map +1 -1
  102. package/dist/components/motion/context-menu.js +2 -2
  103. package/dist/components/motion/context-menu.js.map +1 -1
  104. package/dist/components/motion/cylinder-carousel.js +1 -1
  105. package/dist/components/motion/cylinder-carousel.js.map +1 -1
  106. package/dist/components/motion/digit-swap.d.ts +23 -0
  107. package/dist/components/motion/digit-swap.d.ts.map +1 -0
  108. package/dist/components/motion/digit-swap.js +77 -0
  109. package/dist/components/motion/digit-swap.js.map +1 -0
  110. package/dist/components/motion/dock.js +1 -1
  111. package/dist/components/motion/dock.js.map +1 -1
  112. package/dist/components/motion/drawer.js +1 -1
  113. package/dist/components/motion/drawer.js.map +1 -1
  114. package/dist/components/motion/dynamic-island.js +1 -1
  115. package/dist/components/motion/dynamic-island.js.map +1 -1
  116. package/dist/components/motion/expandable-action-bar.js +1 -1
  117. package/dist/components/motion/expandable-action-bar.js.map +1 -1
  118. package/dist/components/motion/expandable-control.d.ts.map +1 -1
  119. package/dist/components/motion/expandable-control.js +1 -1
  120. package/dist/components/motion/expandable-control.js.map +1 -1
  121. package/dist/components/motion/expandable-tabs.js +1 -1
  122. package/dist/components/motion/expandable-tabs.js.map +1 -1
  123. package/dist/components/motion/expanding-arrow-button.js +1 -1
  124. package/dist/components/motion/expanding-arrow-button.js.map +1 -1
  125. package/dist/components/motion/feedback-widget.js +2 -2
  126. package/dist/components/motion/feedback-widget.js.map +1 -1
  127. package/dist/components/motion/file-tree.js +2 -2
  128. package/dist/components/motion/file-tree.js.map +1 -1
  129. package/dist/components/motion/file-upload.js +2 -2
  130. package/dist/components/motion/file-upload.js.map +1 -1
  131. package/dist/components/motion/hold-action-button.js +1 -1
  132. package/dist/components/motion/hold-action-button.js.map +1 -1
  133. package/dist/components/motion/infinite-masonry.js +2 -2
  134. package/dist/components/motion/infinite-masonry.js.map +1 -1
  135. package/dist/components/motion/input.d.ts.map +1 -1
  136. package/dist/components/motion/input.js +1 -1
  137. package/dist/components/motion/input.js.map +1 -1
  138. package/dist/components/motion/liquid.js +1 -1
  139. package/dist/components/motion/liquid.js.map +1 -1
  140. package/dist/components/motion/loader.js +1 -1
  141. package/dist/components/motion/loader.js.map +1 -1
  142. package/dist/components/motion/magnetic.js +1 -1
  143. package/dist/components/motion/magnetic.js.map +1 -1
  144. package/dist/components/motion/marquee.d.ts.map +1 -1
  145. package/dist/components/motion/marquee.js +1 -1
  146. package/dist/components/motion/marquee.js.map +1 -1
  147. package/dist/components/motion/morphing-modal.js +1 -1
  148. package/dist/components/motion/morphing-modal.js.map +1 -1
  149. package/dist/components/motion/morphing-search.js +2 -2
  150. package/dist/components/motion/morphing-search.js.map +1 -1
  151. package/dist/components/motion/morphing-tabs.js +2 -2
  152. package/dist/components/motion/morphing-tabs.js.map +1 -1
  153. package/dist/components/motion/multi-select/content.js +1 -1
  154. package/dist/components/motion/multi-select/content.js.map +1 -1
  155. package/dist/components/motion/multi-select/context.js +1 -1
  156. package/dist/components/motion/multi-select/context.js.map +1 -1
  157. package/dist/components/motion/multi-select/list.js +2 -2
  158. package/dist/components/motion/multi-select/list.js.map +1 -1
  159. package/dist/components/motion/multi-select/trigger.js +2 -2
  160. package/dist/components/motion/multi-select/trigger.js.map +1 -1
  161. package/dist/components/motion/not-found/magnetic.d.ts.map +1 -1
  162. package/dist/components/motion/not-found/magnetic.js +1 -1
  163. package/dist/components/motion/not-found/magnetic.js.map +1 -1
  164. package/dist/components/motion/not-found/shared.js +1 -1
  165. package/dist/components/motion/not-found/shared.js.map +1 -1
  166. package/dist/components/motion/not-found/spotlight.js +1 -1
  167. package/dist/components/motion/not-found/spotlight.js.map +1 -1
  168. package/dist/components/motion/notification-stack.js +2 -2
  169. package/dist/components/motion/notification-stack.js.map +1 -1
  170. package/dist/components/motion/number-ticker.js +1 -1
  171. package/dist/components/motion/number-ticker.js.map +1 -1
  172. package/dist/components/motion/otp-input.js +1 -1
  173. package/dist/components/motion/otp-input.js.map +1 -1
  174. package/dist/components/motion/overflow-actions.js +2 -2
  175. package/dist/components/motion/overflow-actions.js.map +1 -1
  176. package/dist/components/motion/parallax.d.ts.map +1 -1
  177. package/dist/components/motion/parallax.js +1 -1
  178. package/dist/components/motion/parallax.js.map +1 -1
  179. package/dist/components/motion/popover-morph.js +1 -1
  180. package/dist/components/motion/popover-morph.js.map +1 -1
  181. package/dist/components/motion/popover.js +1 -1
  182. package/dist/components/motion/popover.js.map +1 -1
  183. package/dist/components/motion/preview-rail.js +1 -1
  184. package/dist/components/motion/preview-rail.js.map +1 -1
  185. package/dist/components/motion/project-folder.js +2 -2
  186. package/dist/components/motion/project-folder.js.map +1 -1
  187. package/dist/components/motion/pull-to-refresh.js +1 -1
  188. package/dist/components/motion/pull-to-refresh.js.map +1 -1
  189. package/dist/components/motion/radio.js +1 -1
  190. package/dist/components/motion/radio.js.map +1 -1
  191. package/dist/components/motion/range-slider-bubble.js +1 -1
  192. package/dist/components/motion/range-slider-bubble.js.map +1 -1
  193. package/dist/components/motion/range-slider-fluid.js +1 -1
  194. package/dist/components/motion/range-slider-fluid.js.map +1 -1
  195. package/dist/components/motion/range-slider-ruler.js +1 -1
  196. package/dist/components/motion/range-slider-ruler.js.map +1 -1
  197. package/dist/components/motion/range-slider-wave.js +1 -1
  198. package/dist/components/motion/range-slider-wave.js.map +1 -1
  199. package/dist/components/motion/range-slider.js +1 -1
  200. package/dist/components/motion/range-slider.js.map +1 -1
  201. package/dist/components/motion/scroll-progress.js +1 -1
  202. package/dist/components/motion/scroll-progress.js.map +1 -1
  203. package/dist/components/motion/scroll-reveal.js +1 -1
  204. package/dist/components/motion/scroll-reveal.js.map +1 -1
  205. package/dist/components/motion/scroll-to.js +1 -1
  206. package/dist/components/motion/scroll-to.js.map +1 -1
  207. package/dist/components/motion/select-morph.d.ts.map +1 -1
  208. package/dist/components/motion/select-morph.js +2 -2
  209. package/dist/components/motion/select-morph.js.map +1 -1
  210. package/dist/components/motion/select.js +2 -2
  211. package/dist/components/motion/select.js.map +1 -1
  212. package/dist/components/motion/shader-background.d.ts.map +1 -1
  213. package/dist/components/motion/shader-background.js +1 -1
  214. package/dist/components/motion/shader-background.js.map +1 -1
  215. package/dist/components/motion/shared-layout-bg.js +1 -1
  216. package/dist/components/motion/shared-layout-bg.js.map +1 -1
  217. package/dist/components/motion/signup-form.js +2 -2
  218. package/dist/components/motion/signup-form.js.map +1 -1
  219. package/dist/components/motion/slide-action-button.js +1 -1
  220. package/dist/components/motion/slide-action-button.js.map +1 -1
  221. package/dist/components/motion/swipeable-list.js +1 -1
  222. package/dist/components/motion/swipeable-list.js.map +1 -1
  223. package/dist/components/motion/switch.d.ts.map +1 -1
  224. package/dist/components/motion/switch.js +1 -1
  225. package/dist/components/motion/switch.js.map +1 -1
  226. package/dist/components/motion/table/index.js +1 -1
  227. package/dist/components/motion/table/index.js.map +1 -1
  228. package/dist/components/motion/table/row-handle.js +1 -1
  229. package/dist/components/motion/table/skeleton-rows.d.ts.map +1 -1
  230. package/dist/components/motion/table/skeleton-rows.js +1 -1
  231. package/dist/components/motion/table/skeleton-rows.js.map +1 -1
  232. package/dist/components/motion/table/table-header.js +2 -2
  233. package/dist/components/motion/table/table-header.js.map +1 -1
  234. package/dist/components/motion/table/table-menu.js +1 -1
  235. package/dist/components/motion/table/table-menu.js.map +1 -1
  236. package/dist/components/motion/tabs.js +1 -1
  237. package/dist/components/motion/tabs.js.map +1 -1
  238. package/dist/components/motion/text-reveal.js +1 -1
  239. package/dist/components/motion/text-reveal.js.map +1 -1
  240. package/dist/components/motion/text-scramble.d.ts.map +1 -1
  241. package/dist/components/motion/text-scramble.js +1 -1
  242. package/dist/components/motion/text-scramble.js.map +1 -1
  243. package/dist/components/motion/text-shimmer.js +1 -1
  244. package/dist/components/motion/text-shimmer.js.map +1 -1
  245. package/dist/components/motion/theme-toggle.js +2 -2
  246. package/dist/components/motion/theme-toggle.js.map +1 -1
  247. package/dist/components/motion/tilt-card.js +1 -1
  248. package/dist/components/motion/tilt-card.js.map +1 -1
  249. package/dist/components/motion/tooltip.js +1 -1
  250. package/dist/components/motion/tooltip.js.map +1 -1
  251. package/dist/components/motion/wheel-picker.js +1 -1
  252. package/dist/components/motion/wheel-picker.js.map +1 -1
  253. package/dist/components/reui/alert.d.ts +1 -1
  254. package/dist/components/reui/alert.d.ts.map +1 -1
  255. package/dist/components/reui/alert.js +2 -2
  256. package/dist/components/reui/alert.js.map +1 -1
  257. package/dist/components/reui/autocomplete.d.ts +1 -1
  258. package/dist/components/reui/autocomplete.js +2 -2
  259. package/dist/components/reui/autocomplete.js.map +1 -1
  260. package/dist/components/reui/badge.d.ts +2 -2
  261. package/dist/components/reui/badge.d.ts.map +1 -1
  262. package/dist/components/reui/badge.js +1 -1
  263. package/dist/components/reui/badge.js.map +1 -1
  264. package/dist/components/reui/cascader/cascader-columns.js +2 -2
  265. package/dist/components/reui/cascader/cascader-columns.js.map +1 -1
  266. package/dist/components/reui/cascader/cascader-footer.js +2 -2
  267. package/dist/components/reui/cascader/cascader-footer.js.map +1 -1
  268. package/dist/components/reui/cascader/cascader-item.js +2 -2
  269. package/dist/components/reui/cascader/cascader-item.js.map +1 -1
  270. package/dist/components/reui/cascader/cascader-nav.js +2 -2
  271. package/dist/components/reui/cascader/cascader-nav.js.map +1 -1
  272. package/dist/components/reui/cascader/cascader.js +2 -2
  273. package/dist/components/reui/cascader/cascader.js.map +1 -1
  274. package/dist/components/reui/code-block/code-block.js +1 -1
  275. package/dist/components/reui/code-block/code-block.js.map +1 -1
  276. package/dist/components/reui/data-grid/data-grid-cell-selection.js +1 -1
  277. package/dist/components/reui/data-grid/data-grid-cell-selection.js.map +1 -1
  278. package/dist/components/reui/data-grid/data-grid-column-filter.js +2 -2
  279. package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -1
  280. package/dist/components/reui/data-grid/data-grid-column-header.js +2 -2
  281. package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
  282. package/dist/components/reui/data-grid/data-grid-pagination.js +2 -2
  283. package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
  284. package/dist/components/reui/data-grid/data-grid-scroll-area.js +1 -1
  285. package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -1
  286. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +2 -2
  287. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
  288. package/dist/components/reui/data-grid/data-grid-table-dnd.js +1 -1
  289. package/dist/components/reui/data-grid/data-grid-table-virtual.js +1 -1
  290. package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
  291. package/dist/components/reui/data-grid/data-grid-table.js +2 -2
  292. package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
  293. package/dist/components/reui/data-grid/data-grid.js +1 -1
  294. package/dist/components/reui/data-grid/data-grid.js.map +1 -1
  295. package/dist/components/reui/date-selector.js +2 -2
  296. package/dist/components/reui/date-selector.js.map +1 -1
  297. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +2 -2
  298. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -1
  299. package/dist/components/reui/event-calendar/event-calendar-content.js +1 -1
  300. package/dist/components/reui/event-calendar/event-calendar-content.js.map +1 -1
  301. package/dist/components/reui/event-calendar/event-calendar-event.js +2 -2
  302. package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
  303. package/dist/components/reui/event-calendar/event-calendar-month-view.js +2 -2
  304. package/dist/components/reui/event-calendar/event-calendar-month-view.js.map +1 -1
  305. package/dist/components/reui/event-calendar/event-calendar-nav.js +2 -2
  306. package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -1
  307. package/dist/components/reui/event-calendar/event-calendar-resource-view.js +1 -1
  308. package/dist/components/reui/event-calendar/event-calendar-resource-view.js.map +1 -1
  309. package/dist/components/reui/event-calendar/event-calendar-time-grid.js +1 -1
  310. package/dist/components/reui/event-calendar/event-calendar-time-grid.js.map +1 -1
  311. package/dist/components/reui/event-calendar/event-calendar.js +1 -1
  312. package/dist/components/reui/event-calendar/event-calendar.js.map +1 -1
  313. package/dist/components/reui/filters/filters-advanced.js +2 -2
  314. package/dist/components/reui/filters/filters-advanced.js.map +1 -1
  315. package/dist/components/reui/filters/filters-builder.js +3 -3
  316. package/dist/components/reui/filters/filters-builder.js.map +1 -1
  317. package/dist/components/reui/filters/filters-chip.js +2 -2
  318. package/dist/components/reui/filters/filters-chip.js.map +1 -1
  319. package/dist/components/reui/filters/filters-editors.js +3 -3
  320. package/dist/components/reui/filters/filters-editors.js.map +1 -1
  321. package/dist/components/reui/filters/filters.js +2 -2
  322. package/dist/components/reui/filters/filters.js.map +1 -1
  323. package/dist/components/reui/frame.d.ts +2 -2
  324. package/dist/components/reui/frame.d.ts.map +1 -1
  325. package/dist/components/reui/frame.js +2 -2
  326. package/dist/components/reui/frame.js.map +1 -1
  327. package/dist/components/reui/gantt/gantt-bar.js +2 -2
  328. package/dist/components/reui/gantt/gantt-bar.js.map +1 -1
  329. package/dist/components/reui/gantt/gantt-nav.js +2 -2
  330. package/dist/components/reui/gantt/gantt-nav.js.map +1 -1
  331. package/dist/components/reui/gantt/gantt-view.js +2 -2
  332. package/dist/components/reui/gantt/gantt-view.js.map +1 -1
  333. package/dist/components/reui/gantt/gantt.js +1 -1
  334. package/dist/components/reui/gantt/gantt.js.map +1 -1
  335. package/dist/components/reui/icon-stack.js +1 -1
  336. package/dist/components/reui/icon-stack.js.map +1 -1
  337. package/dist/components/reui/icon-tile.d.ts +2 -2
  338. package/dist/components/reui/icon-tile.d.ts.map +1 -1
  339. package/dist/components/reui/icon-tile.js +1 -1
  340. package/dist/components/reui/icon-tile.js.map +1 -1
  341. package/dist/components/reui/kanban.d.ts.map +1 -1
  342. package/dist/components/reui/kanban.js +1 -1
  343. package/dist/components/reui/kanban.js.map +1 -1
  344. package/dist/components/reui/number-field.d.ts +3 -3
  345. package/dist/components/reui/number-field.js +2 -2
  346. package/dist/components/reui/number-field.js.map +1 -1
  347. package/dist/components/reui/phone-input.js +2 -2
  348. package/dist/components/reui/phone-input.js.map +1 -1
  349. package/dist/components/reui/rating.d.ts +1 -1
  350. package/dist/components/reui/rating.d.ts.map +1 -1
  351. package/dist/components/reui/rating.js +2 -2
  352. package/dist/components/reui/rating.js.map +1 -1
  353. package/dist/components/reui/sortable.d.ts.map +1 -1
  354. package/dist/components/reui/sortable.js +1 -1
  355. package/dist/components/reui/sortable.js.map +1 -1
  356. package/dist/components/reui/stepper.d.ts.map +1 -1
  357. package/dist/components/reui/stepper.js +1 -1
  358. package/dist/components/reui/stepper.js.map +1 -1
  359. package/dist/components/reui/timeline.d.ts.map +1 -1
  360. package/dist/components/reui/timeline.js +1 -1
  361. package/dist/components/reui/timeline.js.map +1 -1
  362. package/dist/components/reui/tree.d.ts.map +1 -1
  363. package/dist/components/reui/tree.js +2 -2
  364. package/dist/components/reui/tree.js.map +1 -1
  365. package/dist/components/ui/accordion.d.ts.map +1 -1
  366. package/dist/components/ui/accordion.js +2 -2
  367. package/dist/components/ui/accordion.js.map +1 -1
  368. package/dist/components/ui/alert-dialog.js +2 -2
  369. package/dist/components/ui/alert-dialog.js.map +1 -1
  370. package/dist/components/ui/alert.d.ts.map +1 -1
  371. package/dist/components/ui/alert.js +2 -2
  372. package/dist/components/ui/alert.js.map +1 -1
  373. package/dist/components/ui/aspect-ratio.js +1 -1
  374. package/dist/components/ui/aspect-ratio.js.map +1 -1
  375. package/dist/components/ui/attachment.d.ts +1 -1
  376. package/dist/components/ui/attachment.js +2 -2
  377. package/dist/components/ui/attachment.js.map +1 -1
  378. package/dist/components/ui/avatar.d.ts.map +1 -1
  379. package/dist/components/ui/avatar.js +1 -1
  380. package/dist/components/ui/avatar.js.map +1 -1
  381. package/dist/components/ui/badge.d.ts +1 -1
  382. package/dist/components/ui/badge.d.ts.map +1 -1
  383. package/dist/components/ui/badge.js +1 -1
  384. package/dist/components/ui/badge.js.map +1 -1
  385. package/dist/components/ui/breadcrumb.d.ts.map +1 -1
  386. package/dist/components/ui/breadcrumb.js +2 -2
  387. package/dist/components/ui/breadcrumb.js.map +1 -1
  388. package/dist/components/ui/bubble.d.ts +1 -1
  389. package/dist/components/ui/bubble.d.ts.map +1 -1
  390. package/dist/components/ui/bubble.js +2 -2
  391. package/dist/components/ui/bubble.js.map +1 -1
  392. package/dist/components/ui/button-group.js +2 -2
  393. package/dist/components/ui/button-group.js.map +1 -1
  394. package/dist/components/ui/button.d.ts +2 -2
  395. package/dist/components/ui/button.d.ts.map +1 -1
  396. package/dist/components/ui/button.js +2 -2
  397. package/dist/components/ui/button.js.map +1 -1
  398. package/dist/components/ui/calendar.js +2 -2
  399. package/dist/components/ui/calendar.js.map +1 -1
  400. package/dist/components/ui/card.d.ts.map +1 -1
  401. package/dist/components/ui/card.js +1 -1
  402. package/dist/components/ui/card.js.map +1 -1
  403. package/dist/components/ui/carousel.js +2 -2
  404. package/dist/components/ui/carousel.js.map +1 -1
  405. package/dist/components/ui/chart.d.ts.map +1 -1
  406. package/dist/components/ui/chart.js +1 -1
  407. package/dist/components/ui/chart.js.map +1 -1
  408. package/dist/components/ui/checkbox.d.ts.map +1 -1
  409. package/dist/components/ui/checkbox.js +3 -3
  410. package/dist/components/ui/checkbox.js.map +1 -1
  411. package/dist/components/ui/combobox.js +2 -2
  412. package/dist/components/ui/combobox.js.map +1 -1
  413. package/dist/components/ui/command.js +2 -2
  414. package/dist/components/ui/command.js.map +1 -1
  415. package/dist/components/ui/context-menu.d.ts.map +1 -1
  416. package/dist/components/ui/context-menu.js +2 -2
  417. package/dist/components/ui/context-menu.js.map +1 -1
  418. package/dist/components/ui/dialog.js +2 -2
  419. package/dist/components/ui/dialog.js.map +1 -1
  420. package/dist/components/ui/drawer.d.ts.map +1 -1
  421. package/dist/components/ui/drawer.js +1 -1
  422. package/dist/components/ui/drawer.js.map +1 -1
  423. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  424. package/dist/components/ui/dropdown-menu.js +2 -2
  425. package/dist/components/ui/dropdown-menu.js.map +1 -1
  426. package/dist/components/ui/empty.d.ts.map +1 -1
  427. package/dist/components/ui/empty.js +2 -2
  428. package/dist/components/ui/empty.js.map +1 -1
  429. package/dist/components/ui/field.js +3 -3
  430. package/dist/components/ui/field.js.map +1 -1
  431. package/dist/components/ui/hover-card.d.ts.map +1 -1
  432. package/dist/components/ui/hover-card.js +1 -1
  433. package/dist/components/ui/hover-card.js.map +1 -1
  434. package/dist/components/ui/input-group.d.ts +1 -1
  435. package/dist/components/ui/input-group.js +2 -2
  436. package/dist/components/ui/input-group.js.map +1 -1
  437. package/dist/components/ui/input-otp.d.ts.map +1 -1
  438. package/dist/components/ui/input-otp.js +2 -2
  439. package/dist/components/ui/input-otp.js.map +1 -1
  440. package/dist/components/ui/input.d.ts.map +1 -1
  441. package/dist/components/ui/input.js +1 -1
  442. package/dist/components/ui/input.js.map +1 -1
  443. package/dist/components/ui/item.d.ts +1 -1
  444. package/dist/components/ui/item.js +2 -2
  445. package/dist/components/ui/item.js.map +1 -1
  446. package/dist/components/ui/kbd.js +1 -1
  447. package/dist/components/ui/kbd.js.map +1 -1
  448. package/dist/components/ui/label.d.ts.map +1 -1
  449. package/dist/components/ui/label.js +1 -1
  450. package/dist/components/ui/label.js.map +1 -1
  451. package/dist/components/ui/marker.d.ts.map +1 -1
  452. package/dist/components/ui/marker.js +2 -2
  453. package/dist/components/ui/marker.js.map +1 -1
  454. package/dist/components/ui/menubar.js +2 -2
  455. package/dist/components/ui/menubar.js.map +1 -1
  456. package/dist/components/ui/message-scroller.js +2 -2
  457. package/dist/components/ui/message-scroller.js.map +1 -1
  458. package/dist/components/ui/message.d.ts.map +1 -1
  459. package/dist/components/ui/message.js +1 -1
  460. package/dist/components/ui/message.js.map +1 -1
  461. package/dist/components/ui/native-select.d.ts.map +1 -1
  462. package/dist/components/ui/native-select.js +2 -2
  463. package/dist/components/ui/native-select.js.map +1 -1
  464. package/dist/components/ui/navigation-menu.d.ts.map +1 -1
  465. package/dist/components/ui/navigation-menu.js +2 -2
  466. package/dist/components/ui/navigation-menu.js.map +1 -1
  467. package/dist/components/ui/pagination.js +2 -2
  468. package/dist/components/ui/pagination.js.map +1 -1
  469. package/dist/components/ui/popover.d.ts.map +1 -1
  470. package/dist/components/ui/popover.js +1 -1
  471. package/dist/components/ui/popover.js.map +1 -1
  472. package/dist/components/ui/progress.d.ts.map +1 -1
  473. package/dist/components/ui/progress.js +1 -1
  474. package/dist/components/ui/progress.js.map +1 -1
  475. package/dist/components/ui/questionnaire.js +4 -4
  476. package/dist/components/ui/questionnaire.js.map +1 -1
  477. package/dist/components/ui/radio-group.d.ts.map +1 -1
  478. package/dist/components/ui/radio-group.js +2 -2
  479. package/dist/components/ui/radio-group.js.map +1 -1
  480. package/dist/components/ui/resizable.d.ts.map +1 -1
  481. package/dist/components/ui/resizable.js +1 -1
  482. package/dist/components/ui/resizable.js.map +1 -1
  483. package/dist/components/ui/scroll-area.d.ts.map +1 -1
  484. package/dist/components/ui/scroll-area.js +1 -1
  485. package/dist/components/ui/scroll-area.js.map +1 -1
  486. package/dist/components/ui/select.d.ts.map +1 -1
  487. package/dist/components/ui/select.js +2 -2
  488. package/dist/components/ui/select.js.map +1 -1
  489. package/dist/components/ui/separator.d.ts.map +1 -1
  490. package/dist/components/ui/separator.js +1 -1
  491. package/dist/components/ui/separator.js.map +1 -1
  492. package/dist/components/ui/sheet.js +2 -2
  493. package/dist/components/ui/sheet.js.map +1 -1
  494. package/dist/components/ui/sidebar.d.ts +1 -1
  495. package/dist/components/ui/sidebar.js +2 -2
  496. package/dist/components/ui/sidebar.js.map +1 -1
  497. package/dist/components/ui/skeleton.js +1 -1
  498. package/dist/components/ui/skeleton.js.map +1 -1
  499. package/dist/components/ui/slider.d.ts.map +1 -1
  500. package/dist/components/ui/slider.js +1 -1
  501. package/dist/components/ui/slider.js.map +1 -1
  502. package/dist/components/ui/spinner.d.ts.map +1 -1
  503. package/dist/components/ui/spinner.js +2 -2
  504. package/dist/components/ui/spinner.js.map +1 -1
  505. package/dist/components/ui/switch.d.ts.map +1 -1
  506. package/dist/components/ui/switch.js +2 -2
  507. package/dist/components/ui/switch.js.map +1 -1
  508. package/dist/components/ui/table.d.ts.map +1 -1
  509. package/dist/components/ui/table.js +1 -1
  510. package/dist/components/ui/table.js.map +1 -1
  511. package/dist/components/ui/tabs.d.ts.map +1 -1
  512. package/dist/components/ui/tabs.js +2 -2
  513. package/dist/components/ui/tabs.js.map +1 -1
  514. package/dist/components/ui/textarea.d.ts.map +1 -1
  515. package/dist/components/ui/textarea.js +1 -1
  516. package/dist/components/ui/textarea.js.map +1 -1
  517. package/dist/components/ui/toast.js +3 -3
  518. package/dist/components/ui/toast.js.map +1 -1
  519. package/dist/components/ui/toggle-group.js +1 -1
  520. package/dist/components/ui/toggle-group.js.map +1 -1
  521. package/dist/components/ui/toggle.d.ts +1 -1
  522. package/dist/components/ui/toggle.d.ts.map +1 -1
  523. package/dist/components/ui/toggle.js +2 -2
  524. package/dist/components/ui/toggle.js.map +1 -1
  525. package/dist/components/ui/tooltip.d.ts.map +1 -1
  526. package/dist/components/ui/tooltip.js +1 -1
  527. package/dist/components/ui/tooltip.js.map +1 -1
  528. package/dist/{copy-menu-TIKvPaAZ.js → copy-menu-C5GaT4Z-.js} +2 -2
  529. package/dist/{copy-menu-TIKvPaAZ.js.map → copy-menu-C5GaT4Z-.js.map} +1 -1
  530. package/package.json +5 -3
@@ -1 +1 @@
1
- {"version":3,"file":"event-calendar-agenda-view.js","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-agenda-view.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMemo } from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { addDays, format } from \"date-fns\";\nimport { CalendarIcon } from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { ScrollArea } from \"../../ui/scroll-area\";\nimport { IconStack } from \"../icon-stack\";\nimport {\n EventCalendarViewContext,\n useEventCalendar,\n useEventCalendarSelector,\n useEventCalendarSettings,\n useEventCalendarViewConfig,\n} from \"./event-calendar\";\nimport { EventCalendarEvent } from \"./event-calendar-event\";\nimport { getDayKey, getRangeKey, toZoned, zonedStartOfDay } from \"./event-calendar-lib\";\nimport type { EventCalendarDateRange, EventCalendarSegment } from \"./event-calendar-types\";\n\n// The agenda window length is the agendaDayCount SETTING (the store derives\n// visibleRange from it); a per-view prop here would silently disagree.\ntype EventCalendarAgendaViewProps = useRender.ComponentProps<\"div\">;\n\nfunction EventCalendarAgendaView({ className, render, ...props }: EventCalendarAgendaViewProps) {\n const instance = useEventCalendar();\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const visibleRange = useEventCalendarSelector<unknown, EventCalendarDateRange>(\n (state) => state.visibleRange,\n {\n isEqual: (a, b) => getRangeKey(a) === getRangeKey(b),\n },\n );\n // Subscribe to event changes via the day-bucket content of the whole range\n useEventCalendarSelector((state) => state.events);\n\n const days = useMemo(() => {\n const result: Date[] = [];\n let cursor = zonedStartOfDay(visibleRange.start, settings.timeZone);\n while (cursor < visibleRange.end) {\n result.push(cursor);\n cursor = zonedStartOfDay(addDays(toZoned(cursor, settings.timeZone), 1), settings.timeZone);\n }\n return result;\n }, [visibleRange, settings.timeZone]);\n\n const index = instance.internals.getIndex();\n const groups = days\n .map((day) => ({\n day,\n bucket: index.byDay.get(getDayKey(day, settings.timeZone)),\n }))\n .filter((group) => {\n const total = (group.bucket?.allDay.length ?? 0) + (group.bucket?.timed.length ?? 0);\n return total > 0;\n });\n\n const isToday = (day: Date) =>\n getDayKey(day, settings.timeZone) === getDayKey(new Date(), settings.timeZone);\n\n const native = viewConfig.scrollbars === \"native\";\n\n const body = (\n <>\n {groups.length === 0 ? (\n <div\n data-slot=\"event-calendar-no-events\"\n className={cn(\n \"flex min-h-72 flex-col items-center justify-center gap-4 py-16\",\n viewConfig.classNames?.noEvents,\n )}\n >\n {viewConfig.renderNoEvents?.() ?? (\n <>\n <IconStack>\n <CalendarIcon className=\"size-5\" aria-hidden=\"true\" />\n </IconStack>\n <span className=\"text-muted-foreground text-sm\">{settings.i18n.labels.noEvents}</span>\n </>\n )}\n </div>\n ) : (\n // Drop the very last row's bottom border so it does not double up with\n // the calendar container's own bottom border. Targets the last day\n // group's last child (its last agenda item); per-item `border-b` is\n // kept everywhere else, including each day's internal rows.\n <div className=\"flex flex-col [&>*:last-child>*:last-child]:border-b-0\">\n {groups.map(({ day, bucket }) => {\n const items = [...(bucket?.allDay ?? []), ...(bucket?.timed ?? [])];\n const zoned = toZoned(day, settings.timeZone);\n const weekday = format(zoned, \"EEEE\", { locale: settings.locale });\n const dayDate = format(zoned, \"MMMM d, yyyy\", {\n locale: settings.locale,\n });\n return (\n <div\n key={day.getTime()}\n data-slot=\"event-calendar-agenda-day\"\n data-today={isToday(day) || undefined}\n // A named group per day so a screen reader can step day by day\n // (and hear how full one is) instead of arrowing every row.\n role=\"group\"\n aria-label={`${weekday}, ${dayDate}, ${settings.i18n.labels.events(items.length)}`}\n >\n {/* Group header: weekday (leading) + full date (trailing) */}\n <div\n data-slot=\"event-calendar-agenda-day-header\"\n // The day bar is the agenda's only structure, so give it a\n // heading level: the H key and the rotor can jump between\n // days, which is the whole point of a long agenda.\n role=\"heading\"\n aria-level={3}\n className={cn(\n \"sticky top-0 z-10 flex items-baseline justify-between gap-4 border-b bg-muted/60 px-4 py-2\",\n // The custom ScrollArea's overlay scrollbar (w-2.5 = 10px)\n // is painted UNDER this sticky, z-10, opaque header, so the\n // thumb vanishes behind the day bar at the top of the view.\n // Inset the header by the scrollbar lane so its background\n // stops before the scrollbar instead of covering it. Native\n // scrollbars already sit outside the content box, so this\n // only applies to the custom-scrollbar path.\n !native && \"me-2.5\",\n viewConfig.classNames?.agendaDayHeader,\n )}\n >\n <span\n className={cn(\"font-semibold text-foreground\", isToday(day) && \"text-primary\")}\n >\n {weekday}\n </span>\n <span className=\"font-medium text-muted-foreground tabular-nums\">{dayDate}</span>\n </div>\n {items.map((segment) => (\n <EventCalendarAgendaItem key={segment.occurrence.key} segment={segment} />\n ))}\n </div>\n );\n })}\n </div>\n )}\n </>\n );\n\n const defaultProps = {\n \"data-slot\": \"event-calendar-agenda-view\",\n \"data-view\": \"agenda\",\n // Unlike the grid views the agenda has no row/column semantics to carry a\n // name, so label the region with the day range it covers - through\n // formatDayRange, so a consumer override reaches it.\n role: \"group\",\n \"aria-label\": settings.i18n.functions.formatDayRange(visibleRange, {\n locale: settings.locale,\n }),\n className: cn(\n \"flex min-h-0 flex-1 flex-col overflow-hidden border-t\",\n viewConfig.classNames?.agendaView,\n className,\n ),\n children: native ? (\n <div\n data-slot=\"scroll-area-viewport\"\n data-ec-native-scroll=\"\"\n className=\"h-full overflow-y-auto\"\n >\n {body}\n </div>\n ) : (\n <ScrollArea className=\"h-full\">{body}</ScrollArea>\n ),\n };\n\n return (\n <EventCalendarViewContext.Provider value={{ view: \"agenda\" }}>\n {useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n })}\n </EventCalendarViewContext.Provider>\n );\n}\n\n/**\n * One agenda row: a full-width, selectable table row - time column, color dot,\n * and title (all replaceable via renderAgendaEvent). Clicking selects the\n * event (drag/resize stay off in the agenda).\n */\nfunction EventCalendarAgendaItem({ segment }: { segment: EventCalendarSegment }) {\n const viewConfig = useEventCalendarViewConfig();\n return (\n <EventCalendarEvent\n segment={segment}\n className={cn(\n // read-only list: hover only, no selected/focused styling on click\n \"gap-3 rounded-none border-b px-4 py-2.5 transition-colors hover:bg-accent/40\",\n viewConfig.classNames?.agendaItem,\n )}\n />\n );\n}\n\nexport type { EventCalendarAgendaViewProps };\nexport { EventCalendarAgendaView };\n"],"mappings":";;;;;;;;;;;;;;AA0BA,SAAS,wBAAwB,EAAE,WAAW,QAAQ,GAAG,SAAuC;CAC9F,MAAM,WAAW,iBAAiB;CAClC,MAAM,WAAW,yBAAyB;CAC1C,MAAM,aAAa,2BAA2B;CAC9C,MAAM,eAAe,0BAClB,UAAU,MAAM,cACjB,EACE,UAAU,GAAG,MAAM,YAAY,CAAC,MAAM,YAAY,CAAC,EACrD,CACF;CAEA,0BAA0B,UAAU,MAAM,MAAM;CAEhD,MAAM,OAAO,cAAc;EACzB,MAAM,SAAiB,CAAC;EACxB,IAAI,SAAS,gBAAgB,aAAa,OAAO,SAAS,QAAQ;EAClE,OAAO,SAAS,aAA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AAa,2BAA2B;CAC9C,OACE,oBAAC,oBAAD;EACW;EACT,WAAW,GAET,gFACA,WAAW,YAAY,UACzB;CACD,CAAA;AAEL"}
1
+ {"version":3,"file":"event-calendar-agenda-view.js","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-agenda-view.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMemo } from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cn } from \"cn\";\nimport { addDays, format } from \"date-fns\";\nimport { CalendarIcon } from \"lucide-react\";\n\nimport { ScrollArea } from \"../../ui/scroll-area\";\nimport { IconStack } from \"../icon-stack\";\nimport {\n EventCalendarViewContext,\n useEventCalendar,\n useEventCalendarSelector,\n useEventCalendarSettings,\n useEventCalendarViewConfig,\n} from \"./event-calendar\";\nimport { EventCalendarEvent } from \"./event-calendar-event\";\nimport { getDayKey, getRangeKey, toZoned, zonedStartOfDay } from \"./event-calendar-lib\";\nimport type { EventCalendarDateRange, EventCalendarSegment } from \"./event-calendar-types\";\n\n// The agenda window length is the agendaDayCount SETTING (the store derives\n// visibleRange from it); a per-view prop here would silently disagree.\ntype EventCalendarAgendaViewProps = useRender.ComponentProps<\"div\">;\n\nfunction EventCalendarAgendaView({ className, render, ...props }: EventCalendarAgendaViewProps) {\n const instance = useEventCalendar();\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const visibleRange = useEventCalendarSelector<unknown, EventCalendarDateRange>(\n (state) => state.visibleRange,\n {\n isEqual: (a, b) => getRangeKey(a) === getRangeKey(b),\n },\n );\n // Subscribe to event changes via the day-bucket content of the whole range\n useEventCalendarSelector((state) => state.events);\n\n const days = useMemo(() => {\n const result: Date[] = [];\n let cursor = zonedStartOfDay(visibleRange.start, settings.timeZone);\n while (cursor < visibleRange.end) {\n result.push(cursor);\n cursor = zonedStartOfDay(addDays(toZoned(cursor, settings.timeZone), 1), settings.timeZone);\n }\n return result;\n }, [visibleRange, settings.timeZone]);\n\n const index = instance.internals.getIndex();\n const groups = days\n .map((day) => ({\n day,\n bucket: index.byDay.get(getDayKey(day, settings.timeZone)),\n }))\n .filter((group) => {\n const total = (group.bucket?.allDay.length ?? 0) + (group.bucket?.timed.length ?? 0);\n return total > 0;\n });\n\n const isToday = (day: Date) =>\n getDayKey(day, settings.timeZone) === getDayKey(new Date(), settings.timeZone);\n\n const native = viewConfig.scrollbars === \"native\";\n\n const body = (\n <>\n {groups.length === 0 ? (\n <div\n data-slot=\"event-calendar-no-events\"\n className={cn(\n \"flex min-h-72 flex-col items-center justify-center gap-4 py-16\",\n viewConfig.classNames?.noEvents,\n )}\n >\n {viewConfig.renderNoEvents?.() ?? (\n <>\n <IconStack>\n <CalendarIcon className=\"size-5\" aria-hidden=\"true\" />\n </IconStack>\n <span className=\"text-muted-foreground text-sm\">{settings.i18n.labels.noEvents}</span>\n </>\n )}\n </div>\n ) : (\n // Drop the very last row's bottom border so it does not double up with\n // the calendar container's own bottom border. Targets the last day\n // group's last child (its last agenda item); per-item `border-b` is\n // kept everywhere else, including each day's internal rows.\n <div className=\"flex flex-col [&>*:last-child>*:last-child]:border-b-0\">\n {groups.map(({ day, bucket }) => {\n const items = [...(bucket?.allDay ?? []), ...(bucket?.timed ?? [])];\n const zoned = toZoned(day, settings.timeZone);\n const weekday = format(zoned, \"EEEE\", { locale: settings.locale });\n const dayDate = format(zoned, \"MMMM d, yyyy\", {\n locale: settings.locale,\n });\n return (\n <div\n key={day.getTime()}\n data-slot=\"event-calendar-agenda-day\"\n data-today={isToday(day) || undefined}\n // A named group per day so a screen reader can step day by day\n // (and hear how full one is) instead of arrowing every row.\n role=\"group\"\n aria-label={`${weekday}, ${dayDate}, ${settings.i18n.labels.events(items.length)}`}\n >\n {/* Group header: weekday (leading) + full date (trailing) */}\n <div\n data-slot=\"event-calendar-agenda-day-header\"\n // The day bar is the agenda's only structure, so give it a\n // heading level: the H key and the rotor can jump between\n // days, which is the whole point of a long agenda.\n role=\"heading\"\n aria-level={3}\n className={cn(\n \"sticky top-0 z-10 flex items-baseline justify-between gap-4 border-b bg-muted/60 px-4 py-2\",\n // The custom ScrollArea's overlay scrollbar (w-2.5 = 10px)\n // is painted UNDER this sticky, z-10, opaque header, so the\n // thumb vanishes behind the day bar at the top of the view.\n // Inset the header by the scrollbar lane so its background\n // stops before the scrollbar instead of covering it. Native\n // scrollbars already sit outside the content box, so this\n // only applies to the custom-scrollbar path.\n !native && \"me-2.5\",\n viewConfig.classNames?.agendaDayHeader,\n )}\n >\n <span\n className={cn(\"font-semibold text-foreground\", isToday(day) && \"text-primary\")}\n >\n {weekday}\n </span>\n <span className=\"font-medium text-muted-foreground tabular-nums\">{dayDate}</span>\n </div>\n {items.map((segment) => (\n <EventCalendarAgendaItem key={segment.occurrence.key} segment={segment} />\n ))}\n </div>\n );\n })}\n </div>\n )}\n </>\n );\n\n const defaultProps = {\n \"data-slot\": \"event-calendar-agenda-view\",\n \"data-view\": \"agenda\",\n // Unlike the grid views the agenda has no row/column semantics to carry a\n // name, so label the region with the day range it covers - through\n // formatDayRange, so a consumer override reaches it.\n role: \"group\",\n \"aria-label\": settings.i18n.functions.formatDayRange(visibleRange, {\n locale: settings.locale,\n }),\n className: cn(\n \"flex min-h-0 flex-1 flex-col overflow-hidden border-t\",\n viewConfig.classNames?.agendaView,\n className,\n ),\n children: native ? (\n <div\n data-slot=\"scroll-area-viewport\"\n data-ec-native-scroll=\"\"\n className=\"h-full overflow-y-auto\"\n >\n {body}\n </div>\n ) : (\n <ScrollArea className=\"h-full\">{body}</ScrollArea>\n ),\n };\n\n return (\n <EventCalendarViewContext.Provider value={{ view: \"agenda\" }}>\n {useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n })}\n </EventCalendarViewContext.Provider>\n );\n}\n\n/**\n * One agenda row: a full-width, selectable table row - time column, color dot,\n * and title (all replaceable via renderAgendaEvent). Clicking selects the\n * event (drag/resize stay off in the agenda).\n */\nfunction EventCalendarAgendaItem({ segment }: { segment: EventCalendarSegment }) {\n const viewConfig = useEventCalendarViewConfig();\n return (\n <EventCalendarEvent\n segment={segment}\n className={cn(\n // read-only list: hover only, no selected/focused styling on click\n \"gap-3 rounded-none border-b px-4 py-2.5 transition-colors hover:bg-accent/40\",\n viewConfig.classNames?.agendaItem,\n )}\n />\n );\n}\n\nexport type { EventCalendarAgendaViewProps };\nexport { EventCalendarAgendaView };\n"],"mappings":";;;;;;;;;;;;;;AA0BA,SAAS,wBAAwB,EAAE,WAAW,QAAQ,GAAG,SAAuC;CAC9F,MAAM,WAAW,iBAAiB;CAClC,MAAM,WAAW,yBAAyB;CAC1C,MAAM,aAAa,2BAA2B;CAC9C,MAAM,eAAe,0BAClB,UAAU,MAAM,cACjB,EACE,UAAU,GAAG,MAAM,YAAY,CAAC,MAAM,YAAY,CAAC,EACrD,CACF;CAEA,0BAA0B,UAAU,MAAM,MAAM;CAEhD,MAAM,OAAO,cAAc;EACzB,MAAM,SAAiB,CAAC;EACxB,IAAI,SAAS,gBAAgB,aAAa,OAAO,SAAS,QAAQ;EAClE,OAAO,SAAS,aAAa,KAAK;GAChC,OAAO,KAAK,MAAM;GAClB,SAAS,gBAAgB,QAAQ,QAAQ,QAAQ,SAAS,QAAQ,GAAG,CAAC,GAAG,SAAS,QAAQ;EAC5F;EACA,OAAO;CACT,GAAG,CAAC,cAAc,SAAS,QAAQ,CAAC;CAEpC,MAAM,QAAQ,SAAS,UAAU,SAAS;CAC1C,MAAM,SAAS,KACZ,KAAK,SAAS;EACb;EACA,QAAQ,MAAM,MAAM,IAAI,UAAU,KAAK,SAAS,QAAQ,CAAC;CAC3D,EAAE,CAAC,CACF,QAAQ,UAAU;EAEjB,QADe,MAAM,QAAQ,OAAO,UAAU,MAAM,MAAM,QAAQ,MAAM,UAAU,KACnE;CACjB,CAAC;CAEH,MAAM,WAAW,QACf,UAAU,KAAK,SAAS,QAAQ,MAAM,0BAAU,IAAI,KAAK,GAAG,SAAS,Q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AA,GAAA,MAAM,KAAK,YACV,oBAAC,yBAAD,EAA+D,QAAU,GAA3C,QAAQ,WAAW,GAAwB,CAC1E,CACE;GAvCE,GAAA,IAAI,QAAQ,CAuCd;EAET,CAAC;CACE,CAAA,EAEP,CAAA;CAGJ,MAAM,eAAe;EACnB,aAAa;EACb,aAAa;EAIb,MAAM;EACN,cAAc,SAAS,KAAK,UAAU,eAAe,cAAc,EACjE,QAAQ,SAAS,OACnB,CAAC;EACD,WAAW,GACT,yDACA,WAAW,YAAY,YACvB,SACF;EACA,UAAU,SACR,oBAAC,OAAD;GACE,aAAU;GACV,yBAAsB;GACtB,WAAU;GAET,UAAA;EACE,CAAA,IAEL,oBAAC,YAAD;GAAY,WAAU;GAAU,UAAA;EAAiB,CAAA;CAErD;CAEA,OACE,oBAAC,yBAAyB,UAA1B;EAAmC,OAAO,EAAE,MAAM,SAAS;EACxD,UAAA,UAAU;GACT,gBAAgB;GAChB;GACA,OAAO,WAAkB,cAAc,KAAK;EAC9C,CAAC;CACgC,CAAA;AAEvC;;;;;;AAOA,SAAS,wBAAwB,EAAE,WAA8C;CAC/E,MAAM,aAAa,2BAA2B;CAC9C,OACE,oBAAC,oBAAD;EACW;EACT,WAAW,GAET,gFACA,WAAW,YAAY,UACzB;CACD,CAAA;AAEL"}
@@ -4,7 +4,7 @@ import { EventCalendarAgendaView } from "./event-calendar-agenda-view.js";
4
4
  import { EventCalendarMonthView } from "./event-calendar-month-view.js";
5
5
  import { EventCalendarDayView, EventCalendarDaysView, EventCalendarWeekView } from "./event-calendar-time-grid.js";
6
6
  import { EventCalendarResourceView } from "./event-calendar-resource-view.js";
7
- import { cn } from "@kumix/utils";
7
+ import { cn } from "cn";
8
8
  import { jsx } from "react/jsx-runtime";
9
9
  import { mergeProps } from "@base-ui/react/merge-props";
10
10
  import { useRender } from "@base-ui/react/use-render";
@@ -1 +1 @@
1
- {"version":3,"file":"event-calendar-content.js","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-content.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentType, ReactNode } from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\n\nimport { cn } from \"@kumix/utils\";\nimport { useEventCalendarSelector, useEventCalendarViewConfig } from \"./event-calendar\";\nimport { EventCalendarAgendaView } from \"./event-calendar-agenda-view\";\nimport { EventCalendarMonthView } from \"./event-calendar-month-view\";\nimport { EventCalendarResourceView } from \"./event-calendar-resource-view\";\nimport {\n EventCalendarDaysView,\n EventCalendarDayView,\n EventCalendarWeekView,\n} from \"./event-calendar-time-grid\";\nimport type { CalendarView } from \"./event-calendar-types\";\n\nconst DEFAULT_VIEW_COMPONENTS: Record<CalendarView, ComponentType> = {\n month: EventCalendarMonthView,\n week: EventCalendarWeekView,\n day: EventCalendarDayView,\n days: EventCalendarDaysView,\n agenda: EventCalendarAgendaView,\n resource: EventCalendarResourceView,\n};\n\ninterface EventCalendarContentProps extends Omit<useRender.ComponentProps<\"div\">, \"children\"> {\n /** Swap individual view implementations. */\n components?: Partial<Record<CalendarView, ComponentType>>;\n /** Replaces the switchboard entirely; read useEventCalendarView() inside. */\n children?: ReactNode;\n}\n\nfunction EventCalendarContent({\n className,\n render,\n components,\n children,\n ...props\n}: EventCalendarContentProps) {\n const viewConfig = useEventCalendarViewConfig();\n const view = useEventCalendarSelector((state) => state.view);\n const loading = useEventCalendarSelector((state) => state.loading);\n\n const resolved = {\n ...DEFAULT_VIEW_COMPONENTS,\n ...viewConfig.components,\n ...components,\n };\n // A spread copies keys that hold `undefined`, so `components={{ month: isPro\n // ? ProMonth : undefined }}` would erase the default and render <undefined />.\n const ActiveView = resolved[view] ?? DEFAULT_VIEW_COMPONENTS[view];\n\n const defaultProps = {\n \"data-slot\": \"event-calendar-content\",\n \"data-view\": view,\n \"data-loading\": loading || undefined,\n className: cn(\n \"relative flex min-h-0 min-w-0 flex-1 flex-col\",\n \"data-loading:pointer-events-none data-loading:opacity-60\",\n viewConfig.classNames?.content,\n className,\n ),\n children: children ?? <ActiveView />,\n };\n\n return useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n });\n}\n\nexport type { EventCalendarContentProps };\nexport { DEFAULT_VIEW_COMPONENTS, EventCalendarContent };\n"],"mappings":";;;;;;;;;;;AAkBA,MAAM,0BAA+D;CACnE,OAAO;CACP,MAAM;CACN,KAAK;CACL,MAAM;CACN,QAAQ;CACR,UAAU;AACZ;AASA,SAAS,qBAAqB,EAC5B,WACA,QACA,YACA,UACA,GAAG,SACyB;CAC5B,MAAM,aAAa,2BAA2B;CAC9C,MAAM,OAAO,0BAA0B,UAAU,MAAM,IAAI;CAC3D,MAAM,UAAU,0BAA0B,UAAU,MAAM,OAAO;CASjE,MAAM,aAAa;EANjB,GAAG;EACH,GAAG,WAAW;EACd,GAAG;CAIqB,EAAE,SAAS,wBAAwB;CAE7D,MAAM,eAAe;EACnB,aAAa;EACb,aAAa;EACb,gBAAgB,WAAW,KAAA;EAC3B,WAAW,GACT,iDACA,4DACA,WAAW,YAAY,SACvB,SACF;EACA,UAAU,YAAY,oBAAC,YAAD,CAAa,CAAA;CACrC;CAEA,OAAO,UAAU;EACf,gBAAgB;EAChB;EACA,OAAO,WAAkB,cAAc,KAAK;CAC9C,CAAC;AACH"}
1
+ {"version":3,"file":"event-calendar-content.js","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-content.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentType, ReactNode } from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cn } from \"cn\";\n\nimport { useEventCalendarSelector, useEventCalendarViewConfig } from \"./event-calendar\";\nimport { EventCalendarAgendaView } from \"./event-calendar-agenda-view\";\nimport { EventCalendarMonthView } from \"./event-calendar-month-view\";\nimport { EventCalendarResourceView } from \"./event-calendar-resource-view\";\nimport {\n EventCalendarDaysView,\n EventCalendarDayView,\n EventCalendarWeekView,\n} from \"./event-calendar-time-grid\";\nimport type { CalendarView } from \"./event-calendar-types\";\n\nconst DEFAULT_VIEW_COMPONENTS: Record<CalendarView, ComponentType> = {\n month: EventCalendarMonthView,\n week: EventCalendarWeekView,\n day: EventCalendarDayView,\n days: EventCalendarDaysView,\n agenda: EventCalendarAgendaView,\n resource: EventCalendarResourceView,\n};\n\ninterface EventCalendarContentProps extends Omit<useRender.ComponentProps<\"div\">, \"children\"> {\n /** Swap individual view implementations. */\n components?: Partial<Record<CalendarView, ComponentType>>;\n /** Replaces the switchboard entirely; read useEventCalendarView() inside. */\n children?: ReactNode;\n}\n\nfunction EventCalendarContent({\n className,\n render,\n components,\n children,\n ...props\n}: EventCalendarContentProps) {\n const viewConfig = useEventCalendarViewConfig();\n const view = useEventCalendarSelector((state) => state.view);\n const loading = useEventCalendarSelector((state) => state.loading);\n\n const resolved = {\n ...DEFAULT_VIEW_COMPONENTS,\n ...viewConfig.components,\n ...components,\n };\n // A spread copies keys that hold `undefined`, so `components={{ month: isPro\n // ? ProMonth : undefined }}` would erase the default and render <undefined />.\n const ActiveView = resolved[view] ?? DEFAULT_VIEW_COMPONENTS[view];\n\n const defaultProps = {\n \"data-slot\": \"event-calendar-content\",\n \"data-view\": view,\n \"data-loading\": loading || undefined,\n className: cn(\n \"relative flex min-h-0 min-w-0 flex-1 flex-col\",\n \"data-loading:pointer-events-none data-loading:opacity-60\",\n viewConfig.classNames?.content,\n className,\n ),\n children: children ?? <ActiveView />,\n };\n\n return useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n });\n}\n\nexport type { EventCalendarContentProps };\nexport { DEFAULT_VIEW_COMPONENTS, EventCalendarContent };\n"],"mappings":";;;;;;;;;;;AAkBA,MAAM,0BAA+D;CACnE,OAAO;CACP,MAAM;CACN,KAAK;CACL,MAAM;CACN,QAAQ;CACR,UAAU;AACZ;AASA,SAAS,qBAAqB,EAC5B,WACA,QACA,YACA,UACA,GAAG,SACyB;CAC5B,MAAM,aAAa,2BAA2B;CAC9C,MAAM,OAAO,0BAA0B,UAAU,MAAM,IAAI;CAC3D,MAAM,UAAU,0BAA0B,UAAU,MAAM,OAAO;CASjE,MAAM,aAAa;EANjB,GAAG;EACH,GAAG,WAAW;EACd,GAAG;CAIqB,EAAE,SAAS,wBAAwB;CAE7D,MAAM,eAAe;EACnB,aAAa;EACb,aAAa;EACb,gBAAgB,WAAW,KAAA;EAC3B,WAAW,GACT,iDACA,4DACA,WAAW,YAAY,SACvB,SACF;EACA,UAAU,YAAY,oBAAC,YAAD,CAAa,CAAA;CACrC;CAEA,OAAO,UAAU;EACf,gBAAgB;EAChB;EACA,OAAO,WAAkB,cAAc,KAAK;CAC9C,CAAC;AACH"}
@@ -4,9 +4,9 @@ import { spansMultipleDays, toZoned, zonedStartOfDay } from "./event-calendar-li
4
4
  import { useEventCalendar, useEventCalendarSelector, useEventCalendarViewConfig, useEventCalendarViewContext } from "./event-calendar.js";
5
5
  import { markChipPress, useEventCalendarGestures, wasRecentDrag } from "./event-calendar-dnd.js";
6
6
  import { createContext, useContext, useMemo } from "react";
7
- import { cn } from "@kumix/utils";
8
- import { RepeatIcon } from "lucide-react";
7
+ import { cn } from "cn";
9
8
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
+ import { RepeatIcon } from "lucide-react";
10
10
  import { mergeProps } from "@base-ui/react/merge-props";
11
11
  import { useRender } from "@base-ui/react/use-render";
12
12
  import { addDays, format } from "date-fns";
@@ -1 +1 @@
1
- {"version":3,"file":"event-calendar-event.js","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-event.tsx"],"sourcesContent":["\"use client\";\n\nimport { type CSSProperties, createContext, type ReactNode, useContext, useMemo } from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { addDays, format } from \"date-fns\";\nimport { RepeatIcon } from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"../../ui/tooltip\";\nimport {\n useEventCalendar,\n useEventCalendarSelector,\n useEventCalendarViewConfig,\n useEventCalendarViewContext,\n} from \"./event-calendar\";\nimport { markChipPress, useEventCalendarGestures, wasRecentDrag } from \"./event-calendar-dnd\";\nimport { spansMultipleDays, toZoned, zonedStartOfDay } from \"./event-calendar-lib\";\nimport type { EventCalendarOccurrence, EventCalendarSegment } from \"./event-calendar-types\";\n\n/** Event color presets; each stays legible on light and dark surfaces. */\nconst EVENT_CALENDAR_COLORS: Array<{ name: string; value: string }> = [\n { name: \"Blue\", value: \"var(--color-blue-500)\" },\n { name: \"Emerald\", value: \"var(--color-emerald-500)\" },\n { name: \"Violet\", value: \"var(--color-violet-500)\" },\n { name: \"Rose\", value: \"var(--color-rose-500)\" },\n { name: \"Amber\", value: \"var(--color-amber-500)\" },\n { name: \"Cyan\", value: \"var(--color-cyan-500)\" },\n { name: \"Orange\", value: \"var(--color-orange-500)\" },\n { name: \"Pink\", value: \"var(--color-pink-500)\" },\n { name: \"Teal\", value: \"var(--color-teal-500)\" },\n { name: \"Indigo\", value: \"var(--color-indigo-500)\" },\n];\n\n/**\n * Drag-ghost surfaces, shared verbatim by every view. A move CARRIES the\n * event: the dnd engine attaches a full clone to the cursor\n * (data-slot=event-calendar-drag-carry), so this in-grid ghost is only the\n * dashed placeholder for the snapped drop slot. A resize STRETCHES instead:\n * the chip itself at the proposed extent, dashed rather than solid.\n */\nconst EVENT_CALENDAR_GHOST = {\n move: \"rounded-sm border border-dashed border-(--ec-event-color)/50 bg-(--ec-event-color)/8\",\n resize: \"rounded-sm border border-dashed border-(--ec-event-color)/70 overflow-hidden\",\n invalid: \"border-destructive/70 bg-destructive/10\",\n invalidResize: \"border-destructive/70\",\n /** Applied to the clone inside an invalid resize ghost. */\n invalidContent: \"opacity-60\",\n} as const;\n\n/**\n * Fade-out truncation for stacked timed blocks, where squeezed cascade\n * columns clip titles into a mash of glyphs; a right-edge mask fade reads\n * cleaner than an ellipsis at those widths. Masked ONLY below a 10rem\n * container: mask-image forces text off subpixel antialiasing, so masking\n * wide chips makes the whole grid read bolder and shimmer while resizing.\n * Wide chips keep the plain ellipsis. Exported for consumer renderEvent.\n */\nconst EVENT_CALENDAR_FADE_TRUNCATE =\n \"w-full truncate @max-[10rem]:text-clip @max-[10rem]:[mask-image:linear-gradient(to_right,#000_calc(100%-0.75rem),transparent)] @max-[10rem]:rtl:[mask-image:linear-gradient(to_left,#000_calc(100%-0.75rem),transparent)]\";\n\n/**\n * The drag-to-create selection, shared by every view: a dashed primary\n * outline over a faint wash with the range printed inside. `box` is the timed\n * grid's single minute-positioned rectangle; `segment` is one day-cell slice\n * of a multi-cell draft, with side borders and rounding only on the run's two\n * ends so it reads as one dashed box rather than a row of them.\n */\nconst EVENT_CALENDAR_SLOT_DRAFT = {\n box: \"rounded-sm border border-dashed border-primary/40 bg-primary/5\",\n segment: \"border-y border-dashed border-primary/40\",\n segmentStart: \"rounded-s-sm border-s\",\n segmentEnd: \"rounded-e-sm border-e\",\n /**\n * The wash for segmented views, on the CELL not the dashed overlay: the\n * overlay stacks above the chips, so tinting it would wash them instead.\n */\n surface: \"bg-primary/5\",\n /**\n * The range readout. `leading-none` is load-bearing: the shortest timed\n * draft is one snap interval tall (16px at the default 15-minute snap and\n * 4rem hour height), and looser leading renders ~18px, clipped by the\n * draft's own overflow-hidden.\n */\n label: \"text-primary truncate px-1 py-0.5 text-[0.6875rem] leading-none font-medium\",\n} as const;\n\ninterface EventCalendarChipContextValue<TData = unknown> {\n occurrence: EventCalendarOccurrence<TData>;\n segment: EventCalendarSegment<TData>;\n isDragging: boolean;\n isSelected: boolean;\n}\n\nconst EventCalendarChipContext =\n // biome-ignore lint/suspicious/noExplicitAny: <>\n createContext<EventCalendarChipContextValue<any> | null>(null);\n\n/** The chip's subject; usable inside renderEvent content and chip children. */\nfunction useEventCalendarEventChip<TData = unknown>(): EventCalendarChipContextValue<TData> {\n const ctx = useContext(EventCalendarChipContext);\n if (!ctx) {\n throw new Error(\"useEventCalendarEventChip must be used within <EventCalendarEvent>\");\n }\n return ctx as EventCalendarChipContextValue<TData>;\n}\n\ninterface EventCalendarEventProps<TData = unknown>\n extends Omit<useRender.ComponentProps<\"button\">, \"children\"> {\n segment: EventCalendarSegment<TData>;\n /** Replaces the default chip CONTENT; the wrapper stays calendar-owned. */\n children?: ReactNode;\n /**\n * Static drag clone: the chip as-is but inert - no gestures, resize\n * handles, selection/drag state, focus or pointer events.\n */\n preview?: boolean;\n}\n\n/**\n * The one interactive event element in every view. The wrapper owns a11y,\n * data attributes, selection and drag/resize wiring; content comes from\n * children, else renderEvent, else the built-in default.\n */\nfunction EventCalendarEvent<TData = unknown>({\n segment,\n className,\n render,\n children,\n preview = false,\n ...props\n}: EventCalendarEventProps<TData>) {\n const instance = useEventCalendar<TData>();\n const viewConfig = useEventCalendarViewConfig<TData>();\n const { view } = useEventCalendarViewContext();\n const gestures = useEventCalendarGestures<TData>();\n const { settings } = instance;\n const occurrence = segment.occurrence;\n const event = occurrence.event;\n\n const isSelectedRaw = useEventCalendarSelector<TData, boolean>(\n (state) => state.selection.eventKeys.includes(occurrence.key),\n { calendar: instance },\n );\n const isDraggingRaw = useEventCalendarSelector<TData, boolean>(\n (state) => state.drag?.occurrence.key === occurrence.key,\n { calendar: instance },\n );\n // reactive, unlike gestures.canResize: api.setInteractions({ resize })\n // must add/remove the handles without waiting for an unrelated re-render\n const resizeOn = useEventCalendarSelector<TData, boolean>((state) => state.interactions.resize, {\n calendar: instance,\n });\n // A preview clone must never inherit the source's selected/dragging state\n // (the drag key matches, which would dim the clone itself).\n const isSelected = preview ? false : isSelectedRaw;\n const isDragging = preview ? false : isDraggingRaw;\n\n const isBar = occurrence.allDay || spansMultipleDays(occurrence, settings.timeZone);\n const inTimeGrid = view === \"week\" || view === \"day\" || view === \"days\" || view === \"resource\";\n const interactive = view !== \"agenda\" && !preview;\n const timedBlock = inTimeGrid && !isBar;\n const horizontalBar = isBar && !inTimeGrid;\n // >= compactEventMinutes renders the stacked (title over time) layout, where\n // squeezed cascade columns fade-truncate instead of clipping into neighbors\n const stackedBlock =\n timedBlock && (segment.endMin ?? 0) - (segment.startMin ?? 0) >= viewConfig.compactEventMinutes;\n\n const defaultContent = (\n <>\n {/* leading dot for single-row chips (month cells, all-day bars); a\n time-grid block takes its color from the tinted surface instead, and\n in its stacked layout a dot would sit alone on the first line */}\n {!timedBlock && (\n <span\n aria-hidden\n data-slot=\"event-calendar-event-dot\"\n // -me-0.5 tightens only the dot-to-title gap; the chip keeps gap-1.5\n className=\"-me-0.5 size-1.5 shrink-0 rounded-full bg-(--ec-event-color)\"\n />\n )}\n {occurrence.isRecurring && (\n <RepeatIcon className=\"size-2.5 shrink-0 opacity-70\" aria-hidden=\"true\" />\n )}\n <span className={cn(\"font-medium\", stackedBlock ? EVENT_CALENDAR_FADE_TRUNCATE : \"truncate\")}>\n {event.title}\n </span>\n {/* month cells are narrow: a compact never-shrinking start time keeps\n the title readable; grids show the full range */}\n {!occurrence.allDay &&\n segment.isStart &&\n (view === \"month\" ? (\n <span className=\"shrink-0 text-muted-foreground\">\n {format(toZoned(occurrence.start, settings.timeZone), settings.i18n.formats.eventTime, {\n locale: settings.locale,\n })}\n </span>\n ) : (\n <span\n className={cn(\n \"@[8rem]:inline hidden text-muted-foreground\",\n stackedBlock ? EVENT_CALENDAR_FADE_TRUNCATE : \"truncate\",\n )}\n >\n {settings.i18n.functions.formatEventTime(\n toZoned(occurrence.start, settings.timeZone),\n toZoned(occurrence.end, settings.timeZone),\n occurrence.allDay,\n { locale: settings.locale },\n )}\n </span>\n ))}\n </>\n );\n\n // Per-day time text for a multi-day event: \"From 9:00 AM\", \"All day\",\n // \"Until 5:00 PM\". Boundaries come from the occurrence vs segment.day, never\n // the packing flags - lane merging rewrites those on shared segments.\n const agendaTimeText = (() => {\n if (view !== \"agenda\") return \"\";\n if (occurrence.allDay) return settings.i18n.labels.allDay;\n const dayStart = zonedStartOfDay(segment.day, settings.timeZone);\n const dayEnd = addDays(toZoned(dayStart, settings.timeZone), 1);\n const startsBefore = occurrence.start < dayStart;\n const endsAfter = occurrence.end > dayEnd;\n if (startsBefore && endsAfter) return settings.i18n.labels.allDay;\n if (endsAfter) {\n return settings.i18n.labels.timeFrom(\n format(toZoned(occurrence.start, settings.timeZone), settings.i18n.formats.eventTime, {\n locale: settings.locale,\n }),\n );\n }\n if (startsBefore) {\n return settings.i18n.labels.timeUntil(\n format(toZoned(occurrence.end, settings.timeZone), settings.i18n.formats.eventTime, {\n locale: settings.locale,\n }),\n );\n }\n return settings.i18n.functions.formatEventTime(\n toZoned(occurrence.start, settings.timeZone),\n toZoned(occurrence.end, settings.timeZone),\n false,\n { locale: settings.locale },\n );\n })();\n\n // Agenda default row: time column, color-dot badge, plain title\n const agendaDefaultContent = (\n <>\n <span className=\"w-40 shrink-0 truncate text-muted-foreground tabular-nums\">\n {agendaTimeText}\n </span>\n <span\n aria-hidden\n data-slot=\"event-calendar-agenda-dot\"\n className=\"size-2 shrink-0 rounded-full bg-(--ec-event-color)\"\n />\n <span className=\"truncate text-sm\">{event.title}</span>\n {occurrence.isRecurring && (\n <RepeatIcon className=\"size-2.5 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n )}\n </>\n );\n\n // Memoized so a drag - which re-renders the lane on every pointer move -\n // never re-invokes the consumer's renderEvent per frame: a referentially\n // stable element lets React skip the custom subtree instead of flickering it.\n // The render fns are deps, so an inline arrow from the consumer defeats it.\n const customContent = useMemo(() => {\n const renderProps = { occurrence, segment, view, isDragging, isSelected };\n return view === \"agenda\"\n ? viewConfig.renderAgendaEvent?.(renderProps)\n : viewConfig.renderEvent?.(renderProps);\n }, [\n occurrence,\n segment,\n view,\n isDragging,\n isSelected,\n viewConfig.renderAgendaEvent,\n viewConfig.renderEvent,\n ]);\n const content =\n children ?? customContent ?? (view === \"agenda\" ? agendaDefaultContent : defaultContent);\n\n const timeLabel = settings.i18n.functions.formatEventTime(\n toZoned(occurrence.start, settings.timeZone),\n toZoned(occurrence.end, settings.timeZone),\n occurrence.allDay,\n { locale: settings.locale },\n );\n // native hover tooltip text; a formatter returning undefined drops the title\n const label = settings.i18n.functions.formatEventLabel\n ? settings.i18n.functions.formatEventLabel(event.title, timeLabel)\n : `${event.title}, ${timeLabel}`;\n\n // Optional styled tooltip (viewConfig.eventTooltip, default off). It replaces\n // the native title so the two never stack, and a preview never gets one. A\n // falsy renderEventTooltip result (including the false/\"\" of `cond && <node>`)\n // falls back to the label; an empty label leaves no content and skips it.\n const tooltipOpts = typeof viewConfig.eventTooltip === \"object\" ? viewConfig.eventTooltip : null;\n const tooltipContent =\n !preview && viewConfig.eventTooltip\n ? viewConfig.renderEventTooltip?.({\n occurrence,\n segment,\n view,\n label,\n }) || label\n : null;\n const tooltipOn = Boolean(tooltipContent);\n\n const showResize = interactive && resizeOn && !event.readOnly && event.resizable !== false;\n // Hover grip pill (mirrors the gantt bars) marking the resize direction.\n // Shown on compact sub-compactEventMinutes blocks too: the 1.5rem chip\n // min-height leaves edge room without colliding with the centered title.\n const grip = (\n <span\n aria-hidden\n data-slot=\"event-calendar-resize-grip\"\n className={cn(\n \"rounded-full bg-foreground/40\",\n timedBlock ? \"h-0.5 w-2.5\" : \"h-2.5 w-0.5\",\n viewConfig.classNames?.resizeGrip,\n )}\n />\n );\n const resizeHandles = showResize && (\n <>\n {timedBlock && segment.isStart && (\n <span\n data-slot=\"event-calendar-resize-handle\"\n data-edge=\"start\"\n className={cn(\n \"absolute inset-x-1 top-0 flex h-1.5 cursor-ns-resize items-center justify-center opacity-0 transition-opacity duration-150 group-hover/ec-event:opacity-100\",\n viewConfig.classNames?.resizeHandle,\n )}\n onPointerDown={(e) => gestures.beginResize(e, segment, \"start\")}\n >\n {grip}\n </span>\n )}\n {timedBlock && segment.isEnd && (\n <span\n data-slot=\"event-calendar-resize-handle\"\n data-edge=\"end\"\n className={cn(\n \"absolute inset-x-1 bottom-0 flex h-1.5 cursor-ns-resize items-center justify-center opacity-0 transition-opacity duration-150 group-hover/ec-event:opacity-100\",\n viewConfig.classNames?.resizeHandle,\n )}\n onPointerDown={(e) => gestures.beginResize(e, segment, \"end\")}\n >\n {grip}\n </span>\n )}\n {(horizontalBar || (isBar && inTimeGrid)) && segment.isStart && (\n <span\n data-slot=\"event-calendar-resize-handle\"\n data-edge=\"start\"\n className={cn(\n \"absolute inset-y-0 start-0 flex w-2 cursor-ew-resize items-center justify-center opacity-0 transition-opacity duration-150 group-hover/ec-event:opacity-100\",\n viewConfig.classNames?.resizeHandle,\n )}\n onPointerDown={(e) => gestures.beginResize(e, segment, \"start\")}\n >\n {grip}\n </span>\n )}\n {(horizontalBar || (isBar && inTimeGrid)) && segment.isEnd && (\n <span\n data-slot=\"event-calendar-resize-handle\"\n data-edge=\"end\"\n className={cn(\n \"absolute inset-y-0 end-0 flex w-2 cursor-ew-resize items-center justify-center opacity-0 transition-opacity duration-150 group-hover/ec-event:opacity-100\",\n viewConfig.classNames?.resizeHandle,\n )}\n onPointerDown={(e) => gestures.beginResize(e, segment, \"end\")}\n >\n {grip}\n </span>\n )}\n </>\n );\n\n const defaultProps = {\n type: \"button\" as const,\n \"data-slot\": \"event-calendar-event\",\n \"data-view\": view,\n \"data-all-day\": occurrence.allDay || undefined,\n \"data-recurring\": occurrence.isRecurring || undefined,\n \"data-selected\": isSelected || undefined,\n \"data-dragging\": isDragging || undefined,\n \"data-preview\": preview || undefined,\n \"data-past\": occurrence.end.getTime() < Date.now() || undefined,\n title: preview || tooltipOn ? undefined : label,\n \"aria-label\":\n settings.i18n.functions.formatEventAriaLabel?.(\n event.title,\n timeLabel,\n segment.continuesBefore || segment.continuesAfter,\n ) ??\n `${event.title}, ${timeLabel}${\n segment.continuesBefore || segment.continuesAfter\n ? `, ${settings.i18n.labels.continues}`\n : \"\"\n }`,\n // A background tint alone conveys selection, so the chip is a real toggle\n // wherever it is interactive (agenda rows never select, previews are inert).\n \"aria-pressed\": interactive ? isSelected : undefined,\n \"aria-hidden\": preview || undefined,\n tabIndex: preview ? -1 : undefined,\n style: {\n \"--ec-event-color\": event.color ?? \"var(--color-primary)\",\n } as CSSProperties,\n onPointerDown: (e: React.PointerEvent) => {\n e.stopPropagation();\n // suppress the trailing slot-create click when this press yields no drag\n markChipPress();\n if (interactive) gestures.beginMove(e, segment);\n },\n onClick: (e: React.MouseEvent) => {\n e.stopPropagation();\n if (wasRecentDrag()) return;\n // consumer first: e.preventDefault() opts out of built-in selection\n settings.onEventClick?.(occurrence, e);\n // the agenda is a read-only list: a click never selects/focuses a row\n if (e.defaultPrevented || view === \"agenda\") return;\n instance.api.selectEvent(occurrence.key);\n },\n onDoubleClick: (e: React.MouseEvent) => {\n e.stopPropagation();\n settings.onEventDoubleClick?.(occurrence, e);\n },\n className: cn(\n \"group/ec-event relative flex w-full min-w-0 cursor-pointer touch-none select-none items-center overflow-hidden text-start text-foreground\",\n \"outline-none focus-visible:ring-2 focus-visible:ring-ring/50\",\n preview && \"pointer-events-none\",\n view === \"agenda\"\n ? // plain list row: color lives in the dot badge, not a tinted pill;\n // hover AND selection surfaces are owned by the agenda row wrapper\n \"gap-3 rounded-md text-sm\"\n : cn(\n // @container removes intrinsic sizing; only grid chips are containers\n // py-1: room above/below inline badges (attendee pill etc.)\n \"@container gap-1.5 rounded-sm px-1.5 py-1 leading-normal\",\n // soft tint + inset ring, not an accent border: legible on both themes\n \"bg-(--ec-event-color)/15 hover:bg-(--ec-event-color)/25\",\n // a flat tint reads darker on a dark surface, so lift it there\n \"dark:bg-(--ec-event-color)/20 dark:hover:bg-(--ec-event-color)/30\",\n \"inset-ring inset-ring-(--ec-event-color)/15\",\n \"transition-[background-color,box-shadow] duration-150\",\n \"data-dragging:opacity-40\",\n \"data-selected:inset-ring-(--ec-event-color)/40 data-selected:bg-(--ec-event-color)/30\",\n segment.continuesBefore && \"rounded-s-none\",\n segment.continuesAfter && \"rounded-e-none\",\n ),\n viewConfig.classNames?.event,\n className,\n ),\n children: (\n <>\n {content}\n {resizeHandles}\n </>\n ),\n };\n\n const chip = useRender({\n defaultTagName: \"button\",\n render,\n props: mergeProps<\"button\">(defaultProps, props),\n });\n\n return (\n <EventCalendarChipContext.Provider value={{ occurrence, segment, isDragging, isSelected }}>\n {tooltipOn ? (\n <TooltipProvider delay={tooltipOpts?.delay ?? 600}>\n <Tooltip>\n <TooltipTrigger render={chip} />\n <TooltipContent\n side={tooltipOpts?.side ?? \"top\"}\n className={viewConfig.classNames?.eventTooltip}\n >\n {tooltipContent}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n ) : (\n chip\n )}\n </EventCalendarChipContext.Provider>\n );\n}\n\nexport type { EventCalendarChipContextValue, EventCalendarEventProps };\nexport {\n EVENT_CALENDAR_COLORS,\n EVENT_CALENDAR_FADE_TRUNCATE,\n EVENT_CALENDAR_GHOST,\n EVENT_CALENDAR_SLOT_DRAFT,\n EventCalendarEvent,\n useEventCalendarEventChip,\n};\n"],"mappings":";;;;;;;;;;;;;;AAqBA,MAAM,wBAAgE;CACpE;EAAE,MAAM;EAAQ,OAAO;CAAwB;CAC/C;EAAE,MAAM;EAAW,OAAO;CAA2B;CACrD;EAAE,MAAM;EAAU,OAAO;CAA0B;CACnD;EAAE,MAAM;EAAQ,OAAO;CAAwB;CAC/C;EAAE,MAAM;EAAS,OAAO;CAAyB;CACjD;EAAE,MAAM;EAAQ,OAAO;CAAwB;CAC/C;EAAE,MAAM;EAAU,OAAO;CAA0B;CACnD;EAAE,MAAM;EAAQ,OAAO;CAAwB;CAC/C;EAAE,MAAM;EAAQ,OAAO;CAAwB;CAC/C;EAAE,MAAM;EAAU,OAAO;CAA0B;AACrD;;;;;;;;AASA,MAAM,uBAAuB;CAC3B,MAAM;CACN,QAAQ;CACR,SAAS;CACT,eAAe;;CAEf,gBAAgB;AAClB;;;;;;;;;AAUA,MAAM,+BACJ;;;;;;;;AASF,MAAM,4BAA4B;CAChC,KAAK;CACL,SAAS;CACT,cAAc;CACd,YAAY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D,EAAgB,QAAQ,KAAO,CAAA,GAC/B,oBAAC,gBAAD;IACE,MAAM,aAAa,QAAQ;IAC3B,WAAW,WAAW,YAAY;IAEjC,UAAA;GACa,CAAA,CACT,EAAA,CAAA;EACM,CAAA,IAEjB;CAE+B,CAAA;AAEvC"}
1
+ {"version":3,"file":"event-calendar-event.js","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-event.tsx"],"sourcesContent":["\"use client\";\n\nimport { type CSSProperties, createContext, type ReactNode, useContext, useMemo } from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cn } from \"cn\";\nimport { addDays, format } from \"date-fns\";\nimport { RepeatIcon } from \"lucide-react\";\n\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"../../ui/tooltip\";\nimport {\n useEventCalendar,\n useEventCalendarSelector,\n useEventCalendarViewConfig,\n useEventCalendarViewContext,\n} from \"./event-calendar\";\nimport { markChipPress, useEventCalendarGestures, wasRecentDrag } from \"./event-calendar-dnd\";\nimport { spansMultipleDays, toZoned, zonedStartOfDay } from \"./event-calendar-lib\";\nimport type { EventCalendarOccurrence, EventCalendarSegment } from \"./event-calendar-types\";\n\n/** Event color presets; each stays legible on light and dark surfaces. */\nconst EVENT_CALENDAR_COLORS: Array<{ name: string; value: string }> = [\n { name: \"Blue\", value: \"var(--color-blue-500)\" },\n { name: \"Emerald\", value: \"var(--color-emerald-500)\" },\n { name: \"Violet\", value: \"var(--color-violet-500)\" },\n { name: \"Rose\", value: \"var(--color-rose-500)\" },\n { name: \"Amber\", value: \"var(--color-amber-500)\" },\n { name: \"Cyan\", value: \"var(--color-cyan-500)\" },\n { name: \"Orange\", value: \"var(--color-orange-500)\" },\n { name: \"Pink\", value: \"var(--color-pink-500)\" },\n { name: \"Teal\", value: \"var(--color-teal-500)\" },\n { name: \"Indigo\", value: \"var(--color-indigo-500)\" },\n];\n\n/**\n * Drag-ghost surfaces, shared verbatim by every view. A move CARRIES the\n * event: the dnd engine attaches a full clone to the cursor\n * (data-slot=event-calendar-drag-carry), so this in-grid ghost is only the\n * dashed placeholder for the snapped drop slot. A resize STRETCHES instead:\n * the chip itself at the proposed extent, dashed rather than solid.\n */\nconst EVENT_CALENDAR_GHOST = {\n move: \"rounded-sm border border-dashed border-(--ec-event-color)/50 bg-(--ec-event-color)/8\",\n resize: \"rounded-sm border border-dashed border-(--ec-event-color)/70 overflow-hidden\",\n invalid: \"border-destructive/70 bg-destructive/10\",\n invalidResize: \"border-destructive/70\",\n /** Applied to the clone inside an invalid resize ghost. */\n invalidContent: \"opacity-60\",\n} as const;\n\n/**\n * Fade-out truncation for stacked timed blocks, where squeezed cascade\n * columns clip titles into a mash of glyphs; a right-edge mask fade reads\n * cleaner than an ellipsis at those widths. Masked ONLY below a 10rem\n * container: mask-image forces text off subpixel antialiasing, so masking\n * wide chips makes the whole grid read bolder and shimmer while resizing.\n * Wide chips keep the plain ellipsis. Exported for consumer renderEvent.\n */\nconst EVENT_CALENDAR_FADE_TRUNCATE =\n \"w-full truncate @max-[10rem]:text-clip @max-[10rem]:[mask-image:linear-gradient(to_right,#000_calc(100%-0.75rem),transparent)] @max-[10rem]:rtl:[mask-image:linear-gradient(to_left,#000_calc(100%-0.75rem),transparent)]\";\n\n/**\n * The drag-to-create selection, shared by every view: a dashed primary\n * outline over a faint wash with the range printed inside. `box` is the timed\n * grid's single minute-positioned rectangle; `segment` is one day-cell slice\n * of a multi-cell draft, with side borders and rounding only on the run's two\n * ends so it reads as one dashed box rather than a row of them.\n */\nconst EVENT_CALENDAR_SLOT_DRAFT = {\n box: \"rounded-sm border border-dashed border-primary/40 bg-primary/5\",\n segment: \"border-y border-dashed border-primary/40\",\n segmentStart: \"rounded-s-sm border-s\",\n segmentEnd: \"rounded-e-sm border-e\",\n /**\n * The wash for segmented views, on the CELL not the dashed overlay: the\n * overlay stacks above the chips, so tinting it would wash them instead.\n */\n surface: \"bg-primary/5\",\n /**\n * The range readout. `leading-none` is load-bearing: the shortest timed\n * draft is one snap interval tall (16px at the default 15-minute snap and\n * 4rem hour height), and looser leading renders ~18px, clipped by the\n * draft's own overflow-hidden.\n */\n label: \"text-primary truncate px-1 py-0.5 text-[0.6875rem] leading-none font-medium\",\n} as const;\n\ninterface EventCalendarChipContextValue<TData = unknown> {\n occurrence: EventCalendarOccurrence<TData>;\n segment: EventCalendarSegment<TData>;\n isDragging: boolean;\n isSelected: boolean;\n}\n\nconst EventCalendarChipContext =\n // biome-ignore lint/suspicious/noExplicitAny: <>\n createContext<EventCalendarChipContextValue<any> | null>(null);\n\n/** The chip's subject; usable inside renderEvent content and chip children. */\nfunction useEventCalendarEventChip<TData = unknown>(): EventCalendarChipContextValue<TData> {\n const ctx = useContext(EventCalendarChipContext);\n if (!ctx) {\n throw new Error(\"useEventCalendarEventChip must be used within <EventCalendarEvent>\");\n }\n return ctx as EventCalendarChipContextValue<TData>;\n}\n\ninterface EventCalendarEventProps<TData = unknown>\n extends Omit<useRender.ComponentProps<\"button\">, \"children\"> {\n segment: EventCalendarSegment<TData>;\n /** Replaces the default chip CONTENT; the wrapper stays calendar-owned. */\n children?: ReactNode;\n /**\n * Static drag clone: the chip as-is but inert - no gestures, resize\n * handles, selection/drag state, focus or pointer events.\n */\n preview?: boolean;\n}\n\n/**\n * The one interactive event element in every view. The wrapper owns a11y,\n * data attributes, selection and drag/resize wiring; content comes from\n * children, else renderEvent, else the built-in default.\n */\nfunction EventCalendarEvent<TData = unknown>({\n segment,\n className,\n render,\n children,\n preview = false,\n ...props\n}: EventCalendarEventProps<TData>) {\n const instance = useEventCalendar<TData>();\n const viewConfig = useEventCalendarViewConfig<TData>();\n const { view } = useEventCalendarViewContext();\n const gestures = useEventCalendarGestures<TData>();\n const { settings } = instance;\n const occurrence = segment.occurrence;\n const event = occurrence.event;\n\n const isSelectedRaw = useEventCalendarSelector<TData, boolean>(\n (state) => state.selection.eventKeys.includes(occurrence.key),\n { calendar: instance },\n );\n const isDraggingRaw = useEventCalendarSelector<TData, boolean>(\n (state) => state.drag?.occurrence.key === occurrence.key,\n { calendar: instance },\n );\n // reactive, unlike gestures.canResize: api.setInteractions({ resize })\n // must add/remove the handles without waiting for an unrelated re-render\n const resizeOn = useEventCalendarSelector<TData, boolean>((state) => state.interactions.resize, {\n calendar: instance,\n });\n // A preview clone must never inherit the source's selected/dragging state\n // (the drag key matches, which would dim the clone itself).\n const isSelected = preview ? false : isSelectedRaw;\n const isDragging = preview ? false : isDraggingRaw;\n\n const isBar = occurrence.allDay || spansMultipleDays(occurrence, settings.timeZone);\n const inTimeGrid = view === \"week\" || view === \"day\" || view === \"days\" || view === \"resource\";\n const interactive = view !== \"agenda\" && !preview;\n const timedBlock = inTimeGrid && !isBar;\n const horizontalBar = isBar && !inTimeGrid;\n // >= compactEventMinutes renders the stacked (title over time) layout, where\n // squeezed cascade columns fade-truncate instead of clipping into neighbors\n const stackedBlock =\n timedBlock && (segment.endMin ?? 0) - (segment.startMin ?? 0) >= viewConfig.compactEventMinutes;\n\n const defaultContent = (\n <>\n {/* leading dot for single-row chips (month cells, all-day bars); a\n time-grid block takes its color from the tinted surface instead, and\n in its stacked layout a dot would sit alone on the first line */}\n {!timedBlock && (\n <span\n aria-hidden\n data-slot=\"event-calendar-event-dot\"\n // -me-0.5 tightens only the dot-to-title gap; the chip keeps gap-1.5\n className=\"-me-0.5 size-1.5 shrink-0 rounded-full bg-(--ec-event-color)\"\n />\n )}\n {occurrence.isRecurring && (\n <RepeatIcon className=\"size-2.5 shrink-0 opacity-70\" aria-hidden=\"true\" />\n )}\n <span className={cn(\"font-medium\", stackedBlock ? EVENT_CALENDAR_FADE_TRUNCATE : \"truncate\")}>\n {event.title}\n </span>\n {/* month cells are narrow: a compact never-shrinking start time keeps\n the title readable; grids show the full range */}\n {!occurrence.allDay &&\n segment.isStart &&\n (view === \"month\" ? (\n <span className=\"shrink-0 text-muted-foreground\">\n {format(toZoned(occurrence.start, settings.timeZone), settings.i18n.formats.eventTime, {\n locale: settings.locale,\n })}\n </span>\n ) : (\n <span\n className={cn(\n \"@[8rem]:inline hidden text-muted-foreground\",\n stackedBlock ? EVENT_CALENDAR_FADE_TRUNCATE : \"truncate\",\n )}\n >\n {settings.i18n.functions.formatEventTime(\n toZoned(occurrence.start, settings.timeZone),\n toZoned(occurrence.end, settings.timeZone),\n occurrence.allDay,\n { locale: settings.locale },\n )}\n </span>\n ))}\n </>\n );\n\n // Per-day time text for a multi-day event: \"From 9:00 AM\", \"All day\",\n // \"Until 5:00 PM\". Boundaries come from the occurrence vs segment.day, never\n // the packing flags - lane merging rewrites those on shared segments.\n const agendaTimeText = (() => {\n if (view !== \"agenda\") return \"\";\n if (occurrence.allDay) return settings.i18n.labels.allDay;\n const dayStart = zonedStartOfDay(segment.day, settings.timeZone);\n const dayEnd = addDays(toZoned(dayStart, settings.timeZone), 1);\n const startsBefore = occurrence.start < dayStart;\n const endsAfter = occurrence.end > dayEnd;\n if (startsBefore && endsAfter) return settings.i18n.labels.allDay;\n if (endsAfter) {\n return settings.i18n.labels.timeFrom(\n format(toZoned(occurrence.start, settings.timeZone), settings.i18n.formats.eventTime, {\n locale: settings.locale,\n }),\n );\n }\n if (startsBefore) {\n return settings.i18n.labels.timeUntil(\n format(toZoned(occurrence.end, settings.timeZone), settings.i18n.formats.eventTime, {\n locale: settings.locale,\n }),\n );\n }\n return settings.i18n.functions.formatEventTime(\n toZoned(occurrence.start, settings.timeZone),\n toZoned(occurrence.end, settings.timeZone),\n false,\n { locale: settings.locale },\n );\n })();\n\n // Agenda default row: time column, color-dot badge, plain title\n const agendaDefaultContent = (\n <>\n <span className=\"w-40 shrink-0 truncate text-muted-foreground tabular-nums\">\n {agendaTimeText}\n </span>\n <span\n aria-hidden\n data-slot=\"event-calendar-agenda-dot\"\n className=\"size-2 shrink-0 rounded-full bg-(--ec-event-color)\"\n />\n <span className=\"truncate text-sm\">{event.title}</span>\n {occurrence.isRecurring && (\n <RepeatIcon className=\"size-2.5 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n )}\n </>\n );\n\n // Memoized so a drag - which re-renders the lane on every pointer move -\n // never re-invokes the consumer's renderEvent per frame: a referentially\n // stable element lets React skip the custom subtree instead of flickering it.\n // The render fns are deps, so an inline arrow from the consumer defeats it.\n const customContent = useMemo(() => {\n const renderProps = { occurrence, segment, view, isDragging, isSelected };\n return view === \"agenda\"\n ? viewConfig.renderAgendaEvent?.(renderProps)\n : viewConfig.renderEvent?.(renderProps);\n }, [\n occurrence,\n segment,\n view,\n isDragging,\n isSelected,\n viewConfig.renderAgendaEvent,\n viewConfig.renderEvent,\n ]);\n const content =\n children ?? customContent ?? (view === \"agenda\" ? agendaDefaultContent : defaultContent);\n\n const timeLabel = settings.i18n.functions.formatEventTime(\n toZoned(occurrence.start, settings.timeZone),\n toZoned(occurrence.end, settings.timeZone),\n occurrence.allDay,\n { locale: settings.locale },\n );\n // native hover tooltip text; a formatter returning undefined drops the title\n const label = settings.i18n.functions.formatEventLabel\n ? settings.i18n.functions.formatEventLabel(event.title, timeLabel)\n : `${event.title}, ${timeLabel}`;\n\n // Optional styled tooltip (viewConfig.eventTooltip, default off). It replaces\n // the native title so the two never stack, and a preview never gets one. A\n // falsy renderEventTooltip result (including the false/\"\" of `cond && <node>`)\n // falls back to the label; an empty label leaves no content and skips it.\n const tooltipOpts = typeof viewConfig.eventTooltip === \"object\" ? viewConfig.eventTooltip : null;\n const tooltipContent =\n !preview && viewConfig.eventTooltip\n ? viewConfig.renderEventTooltip?.({\n occurrence,\n segment,\n view,\n label,\n }) || label\n : null;\n const tooltipOn = Boolean(tooltipContent);\n\n const showResize = interactive && resizeOn && !event.readOnly && event.resizable !== false;\n // Hover grip pill (mirrors the gantt bars) marking the resize direction.\n // Shown on compact sub-compactEventMinutes blocks too: the 1.5rem chip\n // min-height leaves edge room without colliding with the centered title.\n const grip = (\n <span\n aria-hidden\n data-slot=\"event-calendar-resize-grip\"\n className={cn(\n \"rounded-full bg-foreground/40\",\n timedBlock ? \"h-0.5 w-2.5\" : \"h-2.5 w-0.5\",\n viewConfig.classNames?.resizeGrip,\n )}\n />\n );\n const resizeHandles = showResize && (\n <>\n {timedBlock && segment.isStart && (\n <span\n data-slot=\"event-calendar-resize-handle\"\n data-edge=\"start\"\n className={cn(\n \"absolute inset-x-1 top-0 flex h-1.5 cursor-ns-resize items-center justify-center opacity-0 transition-opacity duration-150 group-hover/ec-event:opacity-100\",\n viewConfig.classNames?.resizeHandle,\n )}\n onPointerDown={(e) => gestures.beginResize(e, segment, \"start\")}\n >\n {grip}\n </span>\n )}\n {timedBlock && segment.isEnd && (\n <span\n data-slot=\"event-calendar-resize-handle\"\n data-edge=\"end\"\n className={cn(\n \"absolute inset-x-1 bottom-0 flex h-1.5 cursor-ns-resize items-center justify-center opacity-0 transition-opacity duration-150 group-hover/ec-event:opacity-100\",\n viewConfig.classNames?.resizeHandle,\n )}\n onPointerDown={(e) => gestures.beginResize(e, segment, \"end\")}\n >\n {grip}\n </span>\n )}\n {(horizontalBar || (isBar && inTimeGrid)) && segment.isStart && (\n <span\n data-slot=\"event-calendar-resize-handle\"\n data-edge=\"start\"\n className={cn(\n \"absolute inset-y-0 start-0 flex w-2 cursor-ew-resize items-center justify-center opacity-0 transition-opacity duration-150 group-hover/ec-event:opacity-100\",\n viewConfig.classNames?.resizeHandle,\n )}\n onPointerDown={(e) => gestures.beginResize(e, segment, \"start\")}\n >\n {grip}\n </span>\n )}\n {(horizontalBar || (isBar && inTimeGrid)) && segment.isEnd && (\n <span\n data-slot=\"event-calendar-resize-handle\"\n data-edge=\"end\"\n className={cn(\n \"absolute inset-y-0 end-0 flex w-2 cursor-ew-resize items-center justify-center opacity-0 transition-opacity duration-150 group-hover/ec-event:opacity-100\",\n viewConfig.classNames?.resizeHandle,\n )}\n onPointerDown={(e) => gestures.beginResize(e, segment, \"end\")}\n >\n {grip}\n </span>\n )}\n </>\n );\n\n const defaultProps = {\n type: \"button\" as const,\n \"data-slot\": \"event-calendar-event\",\n \"data-view\": view,\n \"data-all-day\": occurrence.allDay || undefined,\n \"data-recurring\": occurrence.isRecurring || undefined,\n \"data-selected\": isSelected || undefined,\n \"data-dragging\": isDragging || undefined,\n \"data-preview\": preview || undefined,\n \"data-past\": occurrence.end.getTime() < Date.now() || undefined,\n title: preview || tooltipOn ? undefined : label,\n \"aria-label\":\n settings.i18n.functions.formatEventAriaLabel?.(\n event.title,\n timeLabel,\n segment.continuesBefore || segment.continuesAfter,\n ) ??\n `${event.title}, ${timeLabel}${\n segment.continuesBefore || segment.continuesAfter\n ? `, ${settings.i18n.labels.continues}`\n : \"\"\n }`,\n // A background tint alone conveys selection, so the chip is a real toggle\n // wherever it is interactive (agenda rows never select, previews are inert).\n \"aria-pressed\": interactive ? isSelected : undefined,\n \"aria-hidden\": preview || undefined,\n tabIndex: preview ? -1 : undefined,\n style: {\n \"--ec-event-color\": event.color ?? \"var(--color-primary)\",\n } as CSSProperties,\n onPointerDown: (e: React.PointerEvent) => {\n e.stopPropagation();\n // suppress the trailing slot-create click when this press yields no drag\n markChipPress();\n if (interactive) gestures.beginMove(e, segment);\n },\n onClick: (e: React.MouseEvent) => {\n e.stopPropagation();\n if (wasRecentDrag()) return;\n // consumer first: e.preventDefault() opts out of built-in selection\n settings.onEventClick?.(occurrence, e);\n // the agenda is a read-only list: a click never selects/focuses a row\n if (e.defaultPrevented || view === \"agenda\") return;\n instance.api.selectEvent(occurrence.key);\n },\n onDoubleClick: (e: React.MouseEvent) => {\n e.stopPropagation();\n settings.onEventDoubleClick?.(occurrence, e);\n },\n className: cn(\n \"group/ec-event relative flex w-full min-w-0 cursor-pointer touch-none select-none items-center overflow-hidden text-start text-foreground\",\n \"outline-none focus-visible:ring-2 focus-visible:ring-ring/50\",\n preview && \"pointer-events-none\",\n view === \"agenda\"\n ? // plain list row: color lives in the dot badge, not a tinted pill;\n // hover AND selection surfaces are owned by the agenda row wrapper\n \"gap-3 rounded-md text-sm\"\n : cn(\n // @container removes intrinsic sizing; only grid chips are containers\n // py-1: room above/below inline badges (attendee pill etc.)\n \"@container gap-1.5 rounded-sm px-1.5 py-1 leading-normal\",\n // soft tint + inset ring, not an accent border: legible on both themes\n \"bg-(--ec-event-color)/15 hover:bg-(--ec-event-color)/25\",\n // a flat tint reads darker on a dark surface, so lift it there\n \"dark:bg-(--ec-event-color)/20 dark:hover:bg-(--ec-event-color)/30\",\n \"inset-ring inset-ring-(--ec-event-color)/15\",\n \"transition-[background-color,box-shadow] duration-150\",\n \"data-dragging:opacity-40\",\n \"data-selected:inset-ring-(--ec-event-color)/40 data-selected:bg-(--ec-event-color)/30\",\n segment.continuesBefore && \"rounded-s-none\",\n segment.continuesAfter && \"rounded-e-none\",\n ),\n viewConfig.classNames?.event,\n className,\n ),\n children: (\n <>\n {content}\n {resizeHandles}\n </>\n ),\n };\n\n const chip = useRender({\n defaultTagName: \"button\",\n render,\n props: mergeProps<\"button\">(defaultProps, props),\n });\n\n return (\n <EventCalendarChipContext.Provider value={{ occurrence, segment, isDragging, isSelected }}>\n {tooltipOn ? (\n <TooltipProvider delay={tooltipOpts?.delay ?? 600}>\n <Tooltip>\n <TooltipTrigger render={chip} />\n <TooltipContent\n side={tooltipOpts?.side ?? \"top\"}\n className={viewConfig.classNames?.eventTooltip}\n >\n {tooltipContent}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n ) : (\n chip\n )}\n </EventCalendarChipContext.Provider>\n );\n}\n\nexport type { EventCalendarChipContextValue, EventCalendarEventProps };\nexport {\n EVENT_CALENDAR_COLORS,\n EVENT_CALENDAR_FADE_TRUNCATE,\n EVENT_CALENDAR_GHOST,\n EVENT_CALENDAR_SLOT_DRAFT,\n EventCalendarEvent,\n useEventCalendarEventChip,\n};\n"],"mappings":";;;;;;;;;;;;;;AAqBA,MAAM,wBAAgE;CACpE;EAAE,MAAM;EAAQ,OAAO;CAAwB;CAC/C;EAAE,MAAM;EAAW,OAAO;CAA2B;CACrD;EAAE,MAAM;EAAU,OAAO;CAA0B;CACnD;EAA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4DAEA,2DAEA,qEACA,+CACA,yDACA,4BACA,yFACA,QAAQ,mBAAmB,kBAC3B,QAAQ,kBAAkB,gBAC5B,GACJ,WAAW,YAAY,OACvB,SACF;EACA,UACE,qBAAA,YAAA,EAAA,UAAA,CACG,SACA,aACD,EAAA,CAAA;CAEN;CAEA,MAAM,OAAO,UAAU;EACrB,gBAAgB;EAChB;EACA,OAAO,WAAqB,cAAc,KAAK;CACjD,CAAC;CAED,OACE,oBAAC,yBAAyB,UAA1B;EAAmC,OAAO;GAAE;GAAY;GAAS;GAAY;EAAW;EACrF,UAAA,YACC,oBAAC,iBAAD;GAAiB,OAAO,aAAa,SAAS;GAC5C,UAAA,qBAAC,SAAD,EAAA,UAAA,CACE,oBAAC,gBAAD,EAAgB,QAAQ,KAAO,CAAA,GAC/B,oBAAC,gBAAD;IACE,MAAM,aAAa,QAAQ;IAC3B,WAAW,WAAW,YAAY;IAEjC,UAAA;GACa,CAAA,CACT,EAAA,CAAA;EACM,CAAA,IAEjB;CAE+B,CAAA;AAEvC"}
@@ -6,9 +6,9 @@ import { EventCalendarViewContext, useEventCalendar, useEventCalendarDay, useEve
6
6
  import { useEventCalendarGestures, wasRecentChipPress, wasRecentDrag } from "./event-calendar-dnd.js";
7
7
  import { EVENT_CALENDAR_GHOST, EVENT_CALENDAR_SLOT_DRAFT, EventCalendarEvent } from "./event-calendar-event.js";
8
8
  import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
9
- import { cn } from "@kumix/utils";
10
- import { PlusIcon } from "lucide-react";
9
+ import { cn } from "cn";
11
10
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
+ import { PlusIcon } from "lucide-react";
12
12
  import { mergeProps } from "@base-ui/react/merge-props";
13
13
  import { useRender } from "@base-ui/react/use-render";
14
14
  import { addDays, format, getWeek } from "date-fns";
@@ -1 +1 @@
1
- {"version":3,"file":"event-calendar-month-view.js","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-month-view.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type CSSProperties,\n type Ref,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { addDays, format, getWeek } from \"date-fns\";\nimport { PlusIcon } from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../../ui/popover\";\nimport { ScrollArea } from \"../../ui/scroll-area\";\nimport {\n EventCalendarViewContext,\n useEventCalendar,\n useEventCalendarDay,\n useEventCalendarSelector,\n useEventCalendarSettings,\n useEventCalendarViewConfig,\n useEventCalendarViewSettings,\n useEventCalendarWeek,\n} from \"./event-calendar\";\nimport { useEventCalendarGestures, wasRecentChipPress, wasRecentDrag } from \"./event-calendar-dnd\";\nimport {\n EVENT_CALENDAR_GHOST,\n EVENT_CALENDAR_SLOT_DRAFT,\n EventCalendarEvent,\n} from \"./event-calendar-event\";\nimport {\n getDayKey,\n getRangeKey,\n resolveOffDay,\n toZoned,\n zonedStartOfDay,\n} from \"./event-calendar-lib\";\nimport type {\n EventCalendarDateRange,\n EventCalendarDragState,\n EventCalendarEventId,\n EventCalendarSegment,\n} from \"./event-calendar-types\";\n\n// Layout-effect on the client (measure before paint, no flash), plain effect on\n// the server (never runs there) to avoid the SSR useLayoutEffect warning.\nconst useIsoLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// An occurrence key encodes the start instant and is also the chip's React key,\n// so committing a move re-keys the chip: React remounts it and the browser\n// drops focus to <body>. The chip that owns focus is recorded here so the cell\n// rendering its replacement can hand focus back. Module scope because the drop\n// can land in a different cell than the one the chip left, and only one element\n// holds focus at a time anyway.\nlet focusedChip: {\n node: HTMLElement;\n eventId: EventCalendarEventId;\n recurrenceIndex?: number;\n} | null = null;\n\n/** Give focus back to the recorded chip's replacement, if `root` renders it. */\nfunction restoreChipFocus(root: HTMLElement | null, segments: EventCalendarSegment[]) {\n const pending = focusedChip;\n // Only a chip removed WHILE focused needs help: a node still in the tree, or\n // a focus that has already moved on by itself, is left alone.\n if (!root || !pending || pending.node.isConnected) return;\n const active = document.activeElement;\n if (active && active !== document.body) return;\n const index = segments.findIndex(\n (segment) =>\n segment.occurrence.eventId === pending.eventId &&\n segment.occurrence.recurrenceIndex === pending.recurrenceIndex,\n );\n if (index < 0) return;\n const chip = root.querySelectorAll<HTMLElement>(\"[data-slot=event-calendar-event]\")[index];\n if (!chip) return;\n // cleared first: focus() re-records through the new chip's own onFocus\n focusedChip = null;\n chip.focus();\n}\n\ninterface EventCalendarMonthViewProps extends useRender.ComponentProps<\"div\"> {\n maxEventsPerCell?: number | \"auto\";\n}\n\nfunction EventCalendarMonthView({\n className,\n render,\n maxEventsPerCell,\n ...props\n}: EventCalendarMonthViewProps) {\n const instance = useEventCalendar();\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const visibleRange = useEventCalendarSelector<unknown, EventCalendarDateRange>(\n (state) => state.visibleRange,\n {\n isEqual: (a, b) => getRangeKey(a) === getRangeKey(b),\n },\n );\n const anchorDate = useEventCalendarSelector((state) => state.date);\n\n const { effective } = useEventCalendarViewSettings();\n const weeks = useMemo(() => {\n const days: Date[] = [];\n let cursor = zonedStartOfDay(visibleRange.start, settings.timeZone);\n while (cursor < visibleRange.end) {\n days.push(cursor);\n cursor = zonedStartOfDay(addDays(toZoned(cursor, settings.timeZone), 1), settings.timeZone);\n }\n const rows: Date[][] = [];\n for (let i = 0; i < days.length; i += 7) rows.push(days.slice(i, i + 7));\n if (effective.weekends) return rows;\n return rows.map((row) =>\n row.filter((day) => !settings.weekendDays.includes(toZoned(day, settings.timeZone).getDay())),\n );\n }, [visibleRange, settings.timeZone, settings.weekendDays, effective.weekends]);\n\n const headerDays = weeks[0] ?? [];\n const title = settings.i18n.functions.formatTitle(\"month\", {\n date: toZoned(anchorDate, settings.timeZone),\n activeRange: instance.api.getActiveRange(),\n visibleRange,\n locale: settings.locale,\n });\n\n const gridTemplateColumns = `${effective.weekNumbers ? \"var(--ec-week-number-w, 2.75rem) \" : \"\"}repeat(${headerDays.length}, minmax(0, 1fr))`;\n const cap = maxEventsPerCell ?? viewConfig.maxEventsPerCell;\n const contained = viewConfig.scrollMode !== \"page\";\n\n // \"auto\" fits as many event rows as the cell height allows and rolls the rest\n // into \"+N more\". Only the contained mode gives a cell a bounded height to\n // measure; page mode grows to fit, so \"auto\" there keeps the fixed fallback.\n const autoFit = cap === \"auto\" && contained;\n // slotProbe resolves the event-row height (--ec-month-bar-h) to px, honoring\n // the current font size and any consumer override; contentProbe is the first\n // cell's flex-1 content area, whose height is the event space per cell.\n const slotProbeRef = useRef<HTMLDivElement | null>(null);\n const contentProbeRef = useRef<HTMLDivElement | null>(null);\n const [autoCap, setAutoCap] = useState<number | null>(null);\n const measureCap = useCallback(() => {\n const content = contentProbeRef.current;\n const slot = slotProbeRef.current;\n if (!content || !slot) return;\n const laneH = slot.getBoundingClientRect().height;\n if (laneH <= 0) return;\n const cs = getComputedStyle(content);\n const inner = content.clientHeight - (parseFloat(cs.paddingTop) || 0);\n const gap = parseFloat(cs.rowGap) || 0;\n // N rows occupy N*laneH - gap (the last row has no trailing gap)\n setAutoCap(Math.max(1, Math.floor((inner + gap) / laneH)));\n }, []);\n useIsoLayoutEffect(() => {\n if (!autoFit) {\n setAutoCap(null);\n return;\n }\n const content = contentProbeRef.current;\n if (!content || typeof ResizeObserver === \"undefined\") return;\n measureCap();\n const observer = new ResizeObserver(measureCap);\n observer.observe(content);\n return () => observer.disconnect();\n // re-observe the first cell after a re-layout (row count or month change)\n }, [autoFit, measureCap, weeks.length, anchorDate]);\n const resolvedCap = cap === \"auto\" ? (autoFit ? (autoCap ?? 3) : 3) : cap;\n\n const defaultProps = {\n \"data-slot\": \"event-calendar-month-view\",\n \"data-view\": \"month\",\n role: \"grid\",\n \"aria-label\": title,\n className: cn(\n \"flex flex-col border-t\",\n contained && \"min-h-0 flex-1 overflow-hidden\",\n viewConfig.classNames?.monthView,\n className,\n ),\n children: (\n <>\n <div\n role=\"row\"\n data-slot=\"event-calendar-month-header\"\n // @container scopes the narrow-label breakpoint to the header row\n className={cn(\"@container grid border-b\", viewConfig.classNames?.monthHeader)}\n style={{ gridTemplateColumns }}\n >\n {effective.weekNumbers && (\n <div\n role=\"columnheader\"\n aria-hidden\n className={cn(\"border-e px-2 py-1.5\", viewConfig.classNames?.weekNumber)}\n />\n )}\n {headerDays.map((day) => (\n <div\n key={day.getTime()}\n role=\"columnheader\"\n className={cn(\n \"truncate px-2 py-1.5 font-medium text-muted-foreground\",\n viewConfig.classNames?.monthDayHeader,\n )}\n >\n {viewConfig.renderDayHeader?.({\n day,\n view: \"month\",\n isToday:\n getDayKey(day, settings.timeZone) === getDayKey(new Date(), settings.timeZone),\n }) ?? (\n <>\n <span className=\"@max-[36rem]:hidden\">\n {format(toZoned(day, settings.timeZone), settings.i18n.formats.monthDayHeader, {\n locale: settings.locale,\n })}\n </span>\n <span className=\"@max-[36rem]:inline hidden\">\n {format(\n toZoned(day, settings.timeZone),\n settings.i18n.formats.monthDayHeaderNarrow,\n { locale: settings.locale },\n )}\n </span>\n </>\n )}\n </div>\n ))}\n </div>\n <div\n data-slot=\"event-calendar-month-body\"\n className={cn(\"grid\", contained && \"min-h-0 flex-1\", viewConfig.classNames?.monthBody)}\n style={{\n gridTemplateRows: contained\n ? `repeat(${weeks.length}, minmax(0, 1fr))`\n : `repeat(${weeks.length}, minmax(var(--ec-month-row-min-h, 8rem), auto))`,\n }}\n >\n {weeks.map((week, rowIndex) => (\n <EventCalendarMonthWeek\n key={rowIndex}\n week={week}\n gridTemplateColumns={gridTemplateColumns}\n showWeekNumber={effective.weekNumbers}\n cap={resolvedCap}\n autoFit={autoFit}\n contentRef={rowIndex === 0 ? contentProbeRef : undefined}\n />\n ))}\n </div>\n {autoFit && (\n <div\n ref={slotProbeRef}\n aria-hidden\n className=\"pointer-events-none invisible absolute h-(--ec-month-bar-h,1.75rem) w-0\"\n />\n )}\n </>\n ),\n };\n\n return (\n <EventCalendarViewContext.Provider value={{ view: \"month\" }}>\n {useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n })}\n </EventCalendarViewContext.Provider>\n );\n}\n\n/**\n * One month week row. Multi-day / all-day events render as CONTINUOUS bars in\n * an overlay grid that spans day columns (colStart -> colSpan) and stacks by\n * lane; single-day timed events render inside each cell below the reserved bar\n * lanes. This is what makes a cross-day event read as one whole block instead\n * of a chip repeated per cell.\n */\nfunction EventCalendarMonthWeek({\n week,\n gridTemplateColumns,\n showWeekNumber,\n cap,\n autoFit,\n contentRef,\n}: {\n week: Date[];\n gridTemplateColumns: string;\n showWeekNumber: boolean;\n cap: number;\n autoFit: boolean;\n /** Set on the first week only: forwarded to its first cell's content area so\n * the view can measure the per-cell event height for \"auto\". */\n contentRef?: Ref<HTMLDivElement>;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const { bars, rowStart } = useEventCalendarWeek(week[0]);\n const colOffset = showWeekNumber ? 1 : 0;\n const dayMs = 86400000;\n const rowStartMs = zonedStartOfDay(rowStart ?? week[0], settings.timeZone).getTime();\n // Day offsets from the TRUE row start (0-6) for each visible column, so a\n // weekends-hidden month still places bars on the right days.\n const offsets = week.map((d) =>\n Math.round((zonedStartOfDay(d, settings.timeZone).getTime() - rowStartMs) / dayMs),\n );\n /** Clamp a day-offset span onto the visible columns; null = fully hidden. */\n const gridPos = (colStart: number, colSpan: number) => {\n let start = -1;\n let end = -1;\n for (let o = colStart; o < colStart + colSpan; o++) {\n const col = offsets.indexOf(o);\n if (col === -1) continue;\n if (start === -1) start = col;\n end = col;\n }\n return start === -1 ? null : { col: start, span: end - start + 1 };\n };\n // bars fit within the cap; deeper lanes fall into each day's \"+N more\"\n const visibleBars = bars.filter((b) => (b.lane ?? 0) < cap);\n const covers = (b: EventCalendarSegment, dayOffset: number) =>\n (b.colStart ?? 0) <= dayOffset && dayOffset < (b.colStart ?? 0) + (b.colSpan ?? 1);\n // Occurrence keys of the bars hidden in each column (lane >= cap). Threaded to\n // the cell so its \"+N more\" popover can list the hidden bars WITHOUT re-listing\n // the visible ones (day buckets carry no lane, so the week row - which owns bar\n // laning - is the only place that knows which bars are hidden).\n const hiddenBarKeysByCol = week.map(\n (_, col) =>\n new Set(\n bars\n .filter((b) => (b.lane ?? 0) >= cap && covers(b, offsets[col]))\n .map((b) => b.occurrence.key),\n ),\n );\n\n // Live move/resize ghost at the PROPOSED day span. Standardized treatment\n // (EVENT_CALENDAR_GHOST): move = the event carried as a full clone, resize =\n // the same clone with a dashed boundary; invalid adds destructive marking\n // while the engine shows the not-allowed cursor + validation hint.\n const dragGhost = useEventCalendarSelector<\n unknown,\n | (Pick<\n EventCalendarDragState,\n \"kind\" | \"valid\" | \"occurrence\" | \"proposedStart\" | \"proposedEnd\" | \"proposedAllDay\"\n > & {\n colStart: number;\n colSpan: number;\n isStart: boolean;\n isEnd: boolean;\n color?: string;\n })\n | null\n >(\n (state) => {\n const drag = state.drag;\n if (!drag) return null;\n const rowEndMs = rowStartMs + 7 * dayMs;\n const startDayMs = zonedStartOfDay(drag.proposedStart, settings.timeZone).getTime();\n // exclusive end -> the last covered day\n const lastDayMs = zonedStartOfDay(\n new Date(drag.proposedEnd.getTime() - 1),\n settings.timeZone,\n ).getTime();\n if (startDayMs >= rowEndMs || lastDayMs < rowStartMs) return null;\n const startCol = Math.max(0, Math.round((startDayMs - rowStartMs) / dayMs));\n const endCol = Math.min(6, Math.round((lastDayMs - rowStartMs) / dayMs));\n if (endCol < startCol) return null;\n return {\n kind: drag.kind,\n valid: drag.valid,\n occurrence: drag.occurrence,\n proposedStart: drag.proposedStart,\n proposedEnd: drag.proposedEnd,\n proposedAllDay: drag.proposedAllDay,\n colStart: startCol,\n colSpan: endCol - startCol + 1,\n isStart: startDayMs >= rowStartMs,\n isEnd: lastDayMs < rowEndMs,\n color: drag.occurrence.event.color,\n };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.colStart === b.colStart &&\n a.colSpan === b.colSpan &&\n a.valid === b.valid &&\n a.kind === b.kind &&\n a.proposedAllDay === b.proposedAllDay &&\n a.proposedStart.getTime() === b.proposedStart.getTime() &&\n a.proposedEnd.getTime() === b.proposedEnd.getTime()),\n },\n );\n const ghostPos = dragGhost ? gridPos(dragGhost.colStart, dragGhost.colSpan) : null;\n const ghostLane = dragGhost\n ? (bars.find((b) => b.occurrence.key === dragGhost.occurrence.key)?.lane ?? 0)\n : 0;\n // A single-day timed MOVE is indicated INLINE in the target cell (a\n // placeholder at the time-sorted position, rendered by EventCalendarMonthCell)\n // rather than as a bar in this overlay, so only bar drags and every resize\n // render the overlay ghost. Bars = all-day or multi-day (span > 1 day).\n const ghostIsBar =\n !!dragGhost &&\n (dragGhost.kind !== \"move\" ||\n dragGhost.proposedAllDay ||\n dragGhost.proposedEnd.getTime() - dragGhost.proposedStart.getTime() > dayMs);\n\n return (\n <div\n role=\"row\"\n data-slot=\"event-calendar-month-row\"\n className={cn(\n \"relative grid min-h-0 border-b last:border-b-0\",\n viewConfig.classNames?.monthRow,\n )}\n style={{ gridTemplateColumns }}\n >\n {showWeekNumber && (\n <div\n role=\"rowheader\"\n data-slot=\"event-calendar-week-number\"\n className={cn(\n \"border-e px-2 pt-1 text-muted-foreground tabular-nums\",\n viewConfig.classNames?.weekNumber,\n )}\n >\n {settings.i18n.labels.week(\n getWeek(toZoned(week[0], settings.timeZone), {\n // locale supplies firstWeekContainsDate, so a de/ISO calendar\n // numbers the year-boundary weeks its own way instead of falling\n // back to US numbering; weekStartsOn stays explicit so the number\n // keeps matching the rendered grid\n locale: settings.locale,\n weekStartsOn: settings.weekStartsOn,\n }),\n )}\n </div>\n )}\n {week.map((day, col) => (\n <EventCalendarMonthCell\n key={day.getTime()}\n day={day}\n cap={cap}\n // Reserve lane space only for bars that pass through THIS cell, so a\n // short multi-day event does not push down timed events in unrelated\n // cells of the same row. Reserve down to the deepest covering bar\n // lane so timed events always sit below every bar in their own cell.\n reservedLanes={visibleBars.reduce(\n (max, b) => (covers(b, offsets[col]) ? Math.max(max, (b.lane ?? 0) + 1) : max),\n 0,\n )}\n hiddenBarKeys={hiddenBarKeysByCol[col]}\n isLast={col === week.length - 1}\n autoFit={autoFit}\n contentRef={col === 0 ? contentRef : undefined}\n />\n ))}\n {/* Continuous bar overlay: one element per bar, placed by grid-column so\n a cross-day span is a single unbroken block. pointer-events pass\n through the gaps to the cells below. NOT aria-hidden - these are the\n real interactive bars. */}\n {(visibleBars.length > 0 || (dragGhost && ghostPos && ghostIsBar)) && (\n <div\n data-slot=\"event-calendar-month-bar-overlay\"\n className={cn(\n \"pointer-events-none absolute inset-x-0 top-0 z-10 grid pt-1.5\",\n viewConfig.classNames?.monthBarOverlay,\n )}\n style={{\n gridTemplateColumns,\n gridAutoRows: \"var(--ec-month-bar-h, 1.75rem)\",\n }}\n >\n {visibleBars.map((bar) => {\n const pos = gridPos(bar.colStart ?? 0, bar.colSpan ?? 1);\n if (!pos) return null;\n return (\n <div\n key={bar.occurrence.key}\n className={cn(\"pointer-events-auto min-w-0 px-1\", viewConfig.classNames?.monthBar)}\n style={{\n gridColumn: `${colOffset + pos.col + 1} / span ${pos.span}`,\n gridRow: (bar.lane ?? 0) + 1,\n }}\n >\n {/* lane height minus the 2px inter-lane gap */}\n <EventCalendarEvent\n segment={bar}\n className=\"h-[calc(var(--ec-month-bar-h,1.75rem)-0.125rem)]\"\n />\n </div>\n );\n })}\n {dragGhost && ghostPos && ghostIsBar && (\n <div\n aria-hidden\n className={cn(\"min-w-0 px-1\", viewConfig.classNames?.monthBar)}\n style={{\n gridColumn: `${colOffset + ghostPos.col + 1} / span ${ghostPos.span}`,\n gridRow: ghostLane + 1,\n }}\n >\n <div\n data-slot=\"event-calendar-drag-ghost\"\n data-kind={dragGhost.kind}\n data-drop-invalid={!dragGhost.valid || undefined}\n className={cn(\n \"h-[calc(var(--ec-month-bar-h,1.75rem)-0.125rem)]\",\n dragGhost.kind === \"move\"\n ? // faint drop placeholder only: the cursor-attached\n // carry clone owns the visual during moves\n cn(\n EVENT_CALENDAR_GHOST.move,\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalid,\n )\n : cn(\n EVENT_CALENDAR_GHOST.resize,\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidResize,\n ),\n viewConfig.classNames?.dragGhost,\n )}\n style={\n {\n \"--ec-event-color\": dragGhost.color ?? \"var(--color-primary)\",\n } as CSSProperties\n }\n >\n {dragGhost.kind !== \"move\" && (\n <EventCalendarEvent\n preview\n segment={{\n occurrence: {\n ...dragGhost.occurrence,\n start: dragGhost.proposedStart,\n end: dragGhost.proposedEnd,\n },\n day: week[ghostPos.col] ?? week[0],\n isStart: dragGhost.isStart,\n isEnd: dragGhost.isEnd,\n continuesBefore: !dragGhost.isStart,\n continuesAfter: !dragGhost.isEnd,\n }}\n className={cn(\n \"inset-ring-0 h-full\",\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidContent,\n )}\n />\n )}\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n\nfunction EventCalendarMonthCell({\n day,\n cap,\n reservedLanes,\n hiddenBarKeys,\n isLast,\n autoFit,\n contentRef,\n}: {\n day: Date;\n cap: number;\n reservedLanes: number;\n /** Occurrence keys of the bars hidden in THIS column (lane >= cap), from the\n * week row. Lets the cell list hidden bars in its overflow popover without\n * re-listing the bars already visible in the row overlay. */\n hiddenBarKeys: Set<string>;\n /** Last column in the row - drops the right border so the grid's outer edge\n * is owned by the container, not a doubled cell border. Passed explicitly\n * because the bar overlay renders after the cells, so `:last-child` is\n * unreliable on rows that have bars. */\n isLast: boolean;\n /** When true, the \"+N more\" chip is treated as taking a row so the visible\n * chips + indicator always fit the measured cell height. */\n autoFit: boolean;\n /** Set on the first cell only: measured to derive the \"auto\" cap. */\n contentRef?: Ref<HTMLDivElement>;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const gestures = useEventCalendarGestures();\n const { segments, isToday, isOutside } = useEventCalendarDay(day);\n\n const dayStart = zonedStartOfDay(day, settings.timeZone);\n const dayEnd = addDays(toZoned(dayStart, settings.timeZone), 1);\n const { effective } = useEventCalendarViewSettings();\n const isOff = resolveOffDay(\n day,\n settings.timeZone,\n effective.offDays\n ? typeof viewConfig.offDays === \"object\"\n ? viewConfig.offDays\n : true\n : false,\n settings.weekendDays,\n );\n const offClassName =\n (typeof viewConfig.offDays === \"object\" && viewConfig.offDays.className) || \"bg-muted/25\";\n\n const isDropTarget = useEventCalendarSelector<unknown, \"valid\" | \"invalid\" | null>((state) => {\n const drag = state.drag;\n if (!drag) return null;\n const covered = drag.proposedStart < dayEnd && drag.proposedEnd > dayStart;\n if (!covered) return null;\n return drag.valid ? \"valid\" : \"invalid\";\n });\n // Hide hover affordances mid-gesture: the only intent is the drop target.\n // Gated on the one thing that reads it: a plain global boolean flips for all\n // 42 cells the moment a gesture starts and again when it ends, which is pure\n // waste in the default configuration where no add button renders.\n const isInteracting = useEventCalendarSelector<unknown, boolean>((state) =>\n viewConfig.showDayAddButton ? state.drag !== null || state.slotDraft !== null : false,\n );\n const inDraft = useEventCalendarSelector<unknown, { isStart: boolean; isEnd: boolean } | null>(\n (state) => {\n const draft = state.slotDraft;\n if (!draft?.allDay) return null;\n if (draft.start >= dayEnd || draft.end <= dayStart) return null;\n return {\n isStart: draft.start >= dayStart,\n isEnd: draft.end <= dayEnd,\n };\n },\n {\n isEqual: (a, b) =>\n a === b || (a !== null && b !== null && a.isStart === b.isStart && a.isEnd === b.isEnd),\n },\n );\n\n // Month drag-create selects whole DAYS, so the readout is a date range rather\n // than a time range. Held separately from `inDraft` above, which only knows\n // whether this cell is an edge of the selection, not what the selection is.\n const draftRange = useEventCalendarSelector<unknown, { start: Date; end: Date } | null>(\n (state) => {\n const draft = state.slotDraft;\n if (!draft?.allDay) return null;\n return { start: draft.start, end: draft.end };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.start.getTime() === b.start.getTime() &&\n a.end.getTime() === b.end.getTime()),\n },\n );\n // A single-day timed MOVE landing on THIS day: expose the proposed\n // minute-of-day (+ color/validity) so the cell can render a drop placeholder\n // at the correct time-sorted position, instead of the overlay marking a bar\n // over the first chip. Skipped for bars (they keep the overlay ghost) and for\n // a no-op move back onto the event's own day (the dimmed source already marks\n // the spot).\n const inlineDrop = useEventCalendarSelector<\n unknown,\n { min: number; valid: boolean; color?: string } | null\n >(\n (state) => {\n const drag = state.drag;\n if (drag?.kind !== \"move\" || drag.proposedAllDay) return null;\n if (drag.proposedEnd.getTime() - drag.proposedStart.getTime() > 86400000) return null;\n const dropDayMs = zonedStartOfDay(drag.proposedStart, settings.timeZone).getTime();\n if (dropDayMs !== dayStart.getTime()) return null;\n if (\n zonedStartOfDay(drag.occurrence.start, settings.timeZone).getTime() === dayStart.getTime()\n )\n return null;\n return {\n min: (drag.proposedStart.getTime() - dropDayMs) / 60000,\n valid: drag.valid,\n color: drag.occurrence.event.color,\n };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null && b !== null && a.min === b.min && a.valid === b.valid && a.color === b.color),\n },\n );\n\n // Bars (allDay/multi-day) are drawn by the week-row overlay; the cell renders\n // only single-day timed events, below the reserved bar lanes.\n const extraHidden = hiddenBarKeys.size;\n const hiddenBarSegs = segments.allDay.filter((s) => hiddenBarKeys.has(s.occurrence.key));\n const m = segments.timed.length;\n const timedSlots = Math.max(0, cap - reservedLanes);\n\n // Static (at-rest) split: what the cell shows with no drag, and - crucially -\n // what the \"+N more\" popover lists. The popover carries ONLY the hidden events\n // (hidden bars + timed past the cap), never the chips already visible in the\n // cell, so it never duplicates them. autoFit gives up one timed row to the\n // \"+N more\" indicator so the visible chips fit the clipped cell height.\n const staticOverflow = extraHidden > 0 || m > timedSlots;\n const staticShown = autoFit && staticOverflow ? Math.max(0, timedSlots - 1) : timedSlots;\n const overflowSegments = [...hiddenBarSegs, ...segments.timed.slice(staticShown)];\n\n // Live split: while a timed chip is dragged onto this day, render the day\n // exactly as it will look AFTER the drop. The dragged chip is a phantom in the\n // time-sorted order and is shown as the placeholder - inline where it lands,\n // or ON the \"+N more\" indicator when it lands in the overflow bucket (so the\n // user sees the drop will push it into \"more\"). The \"+N more\" count always\n // reflects the post-drop hidden total.\n let visibleTimed: EventCalendarSegment[];\n let overflowCount: number;\n let placeholderIndex: number;\n let placeholderAtMore: boolean;\n if (!inlineDrop) {\n visibleTimed = segments.timed.slice(0, staticShown);\n overflowCount = overflowSegments.length;\n placeholderIndex = -1;\n placeholderAtMore = false;\n } else {\n // rank of the dragged chip in the resulting time-sorted list (chips are\n // time-ordered, so this is the count starting at or before its time)\n const insertRank = segments.timed.filter((s) => (s.startMin ?? 0) <= inlineDrop.min).length;\n const dropOverflow = extraHidden > 0 || m + 1 > timedSlots;\n // rows for timed items INCLUDING the phantom, before the \"+N more\" row\n const vis = !dropOverflow ? m + 1 : autoFit ? Math.max(0, timedSlots - 1) : timedSlots;\n placeholderAtMore = insertRank >= vis;\n visibleTimed = placeholderAtMore\n ? segments.timed.slice(0, vis)\n : segments.timed.slice(0, Math.max(0, vis - 1));\n placeholderIndex = placeholderAtMore ? -1 : insertRank;\n overflowCount = extraHidden + (m - visibleTimed.length) + (placeholderAtMore ? 1 : 0);\n }\n\n // No dep array: the replacement for a chip that lost focus to a commit can\n // appear on any re-render of any cell, and a cell with nothing to restore\n // bails after two comparisons.\n const rootRef = useRef<HTMLDivElement | null>(null);\n useIsoLayoutEffect(() => {\n restoreChipFocus(rootRef.current, visibleTimed);\n });\n\n // Faint dashed drop placeholder, tinted to the dragged event's color, echoing\n // the move ghost (EVENT_CALENDAR_GHOST.move); one chip-height tall so chips\n // shift by exactly one row when it is inserted.\n const dropPlaceholder = inlineDrop ? (\n <div\n key=\"ec-drop-placeholder\"\n aria-hidden\n data-slot=\"event-calendar-drop-placeholder\"\n data-drop-invalid={!inlineDrop.valid || undefined}\n className={cn(\n \"shrink-0 rounded-sm border border-dashed\",\n inlineDrop.valid\n ? \"border-(--ec-event-color)/50 bg-(--ec-event-color)/8\"\n : \"border-destructive/70 bg-destructive/10\",\n viewConfig.classNames?.dragGhost,\n )}\n style={\n {\n \"--ec-event-color\": inlineDrop.color ?? \"var(--color-primary)\",\n height: \"calc(var(--ec-month-bar-h, 1.75rem) - 0.125rem)\",\n } as CSSProperties\n }\n />\n ) : null;\n\n const defaultContent = (\n <>\n <div\n ref={contentRef}\n className={cn(\n // gap-0.5 pairs with the 0.125rem subtraction in the lane spacer\n // below; changing the gap requires renderMonthCell\n // px-1 matches the all-day bar wrapper inset so single-day chips and\n // multi-day bars line up on the same left/right edge in a cell\n \"flex min-h-0 flex-1 flex-col gap-0.5 overflow-hidden px-1 pt-1.5\",\n viewConfig.classNames?.monthCellContent,\n )}\n >\n {reservedLanes > 0 && (\n <div\n aria-hidden\n className=\"shrink-0\"\n style={{\n // lane height already carries the 2px inter-lane gap; subtract\n // it so spacer + the column's own gap-0.5 = the SAME 2px rhythm\n // between the last bar and the first timed chip\n height: `calc(${reservedLanes} * var(--ec-month-bar-h, 1.75rem) - 0.125rem)`,\n }}\n />\n )}\n {visibleTimed.flatMap((segment, i) => {\n const chip = (\n <EventCalendarEvent\n key={segment.occurrence.key}\n segment={segment}\n // Remember the chip holding focus so a commit that re-keys it can\n // hand focus back to the remounted one (see restoreChipFocus)\n onFocus={(e) => {\n focusedChip = {\n node: e.currentTarget,\n eventId: segment.occurrence.eventId,\n recurrenceIndex: segment.occurrence.recurrenceIndex,\n };\n }}\n // A chip still in the tree lost focus on its own, so there is\n // nothing to restore; only a blur from the remount is kept.\n onBlur={(e) => {\n if (e.currentTarget.isConnected) focusedChip = null;\n }}\n // Hold a fixed height like the all-day lane above; without this\n // the chip flex-shrinks to whatever room the cell has left, so\n // cells with a reserved bar lane or a second chip render shorter\n // chips.\n className=\"shrink-0\"\n />\n );\n return i === placeholderIndex ? [dropPlaceholder, chip] : [chip];\n })}\n {placeholderIndex >= 0 && placeholderIndex >= visibleTimed.length && dropPlaceholder}\n {overflowCount > 0 && (\n <EventCalendarMoreIndicator\n day={day}\n count={overflowCount}\n segments={overflowSegments}\n dropInto={\n placeholderAtMore && inlineDrop\n ? { color: inlineDrop.color, valid: inlineDrop.valid }\n : undefined\n }\n />\n )}\n </div>\n {/* Day number + add affordance, bottom-right (Notion-style) */}\n <div\n className={cn(\n \"flex items-center justify-end gap-1 px-2 pb-1.5\",\n viewConfig.classNames?.monthCellFooter,\n )}\n >\n {viewConfig.showDayAddButton && !isInteracting && (\n <button\n type=\"button\"\n data-slot=\"event-calendar-day-add\"\n aria-label={settings.i18n.labels.addEvent}\n // a different icon/markup is a renderMonthCell job\n className={cn(\n \"flex size-5 cursor-pointer items-center justify-center rounded-sm bg-primary text-primary-foreground opacity-0 transition-opacity focus-visible:opacity-100 group-hover/ec-cell:opacity-100\",\n viewConfig.classNames?.dayAddButton,\n )}\n onClick={(e) => {\n e.stopPropagation();\n settings.onSlotClick?.({ date: day, allDay: true, view: \"month\" }, e);\n }}\n >\n <PlusIcon className=\"size-3.5\" aria-hidden=\"true\" />\n </button>\n )}\n <span\n data-slot=\"event-calendar-month-day-number\"\n className={cn(\n \"flex size-5 items-center justify-center rounded-full\",\n isOutside && \"text-muted-foreground\",\n // the filled circle already marks today; keep the number the same\n // weight/size as the other days so it does not read as larger\n // Same font-size as every other day; a lighter weight cancels the\n // way white digits on the filled circle read bolder/larger than the\n // dark-on-light numbers around them.\n isToday && \"bg-primary font-light text-primary-foreground\",\n viewConfig.classNames?.monthDayNumber,\n )}\n >\n {format(toZoned(day, settings.timeZone), settings.i18n.formats.monthCellDay, {\n locale: settings.locale,\n })}\n </span>\n </div>\n </>\n );\n\n const content =\n viewConfig.renderMonthCell?.({\n day,\n segments,\n isToday,\n isOutside,\n overflowCount,\n defaultContent,\n }) ?? defaultContent;\n\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: pointer/gesture surface; keyboard via toolbar\n <div\n ref={rootRef}\n role=\"gridcell\"\n data-slot=\"event-calendar-month-cell\"\n data-today={isToday || undefined}\n data-outside={isOutside || undefined}\n data-weekend={\n settings.weekendDays.includes(toZoned(day, settings.timeZone).getDay()) || undefined\n }\n data-ec-day={dayStart.getTime()}\n data-drop-target={isDropTarget ?? undefined}\n data-off={isOff || undefined}\n data-draft={inDraft ? \"\" : undefined}\n aria-label={format(\n toZoned(day, settings.timeZone),\n settings.i18n.formats.monthCellAriaLabel,\n { locale: settings.locale },\n )}\n className={cn(\n \"group/ec-cell relative flex min-h-0 min-w-0 flex-col overflow-hidden\",\n !isLast && \"border-e\",\n isOutside && !settings.showOutsideDays && \"invisible\",\n isOff && offClassName,\n isToday &&\n cn(\"relative border-b-2 border-b-primary/40 bg-primary/3\", viewConfig.todayClassName),\n viewConfig.dayClassName?.(day),\n // No drop-target bg fill on move/resize - the dragged bar + not-allowed\n // cursor carry the feedback; a cell-wide color wash is too distracting.\n // data-drop-target stays as an opt-in styling hook.\n inDraft && EVENT_CALENDAR_SLOT_DRAFT.surface,\n viewConfig.classNames?.monthCell,\n )}\n onPointerDown={(e) => {\n const target = e.target as HTMLElement;\n if (target.closest(\"[data-slot=event-calendar-event]\")) return;\n if (target.closest(\"[data-slot=event-calendar-more]\")) return;\n gestures.beginCreate(e, day, true);\n }}\n onClick={(e) => {\n if (wasRecentDrag() || wasRecentChipPress()) return;\n settings.onSlotClick?.({ date: day, allDay: true, view: \"month\" }, e);\n }}\n >\n {inDraft && (\n <span\n aria-hidden\n data-slot=\"event-calendar-slot-draft\"\n className={cn(\n \"pointer-events-none absolute inset-0 z-10\",\n EVENT_CALENDAR_SLOT_DRAFT.segment,\n inDraft.isStart && EVENT_CALENDAR_SLOT_DRAFT.segmentStart,\n inDraft.isEnd && EVENT_CALENDAR_SLOT_DRAFT.segmentEnd,\n viewConfig.classNames?.slotDraft,\n )}\n >\n {/* Date-range readout, the month-view counterpart of the time-grid\n one. Rendered only on the FIRST cell of the selection, otherwise\n a three-day drag would repeat the same label three times. Pinned\n to the bottom because the day number owns the top of the cell,\n and given its own surface so it stays legible over event chips. */}\n {inDraft.isStart && draftRange && (\n <span className={cn(\"absolute inset-x-1 bottom-1\", EVENT_CALENDAR_SLOT_DRAFT.label)}>\n {settings.i18n.functions.formatDayRange(\n {\n start: toZoned(draftRange.start, settings.timeZone),\n end: toZoned(draftRange.end, settings.timeZone),\n },\n { locale: settings.locale },\n )}\n </span>\n )}\n </span>\n )}\n {content}\n </div>\n );\n}\n\ninterface EventCalendarMoreIndicatorProps {\n day: Date;\n count: number;\n /** The OVERFLOW (hidden) segments for this day - bars first, then timed. The\n * popover lists only these, never the chips already visible in the cell. */\n segments: EventCalendarSegment[];\n /** Set while a timed chip is dragged and will land in THIS overflow bucket:\n * the indicator itself becomes the drop placeholder (dashed, event-tinted) so\n * it reads as \"the chip joins the +N more list\". */\n dropInto?: { color?: string; valid: boolean };\n}\n\n/**\n * \"+N more\" trigger opening a popover with the day's full event list.\n * onMoreClick returning false suppresses the built-in popover.\n */\nfunction EventCalendarMoreIndicator({\n day,\n count,\n segments,\n dropInto,\n}: EventCalendarMoreIndicatorProps) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const [open, setOpen] = useState(false);\n const headerId = useId();\n\n // Grabbing a chip from this list starts a drag; close the popover so it does\n // not sit over the drop target while the event is carried to another day.\n const isDragging = useEventCalendarSelector<unknown, boolean>((state) => state.drag !== null);\n useEffect(() => {\n if (isDragging) setOpen(false);\n }, [isDragging]);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n data-slot=\"event-calendar-more\"\n data-drop-into={dropInto ? \"\" : undefined}\n data-drop-invalid={dropInto && !dropInto.valid ? \"\" : undefined}\n className={cn(\n \"cursor-pointer truncate rounded-sm px-1.5 text-start text-muted-foreground hover:text-foreground\",\n // While a dragged chip will land in this overflow bucket, the \"+N more\"\n // link itself becomes the drop placeholder: dashed, event-tinted, one\n // chip tall, so the drop target is unmistakable.\n dropInto &&\n cn(\n \"flex shrink-0 items-center border border-dashed\",\n dropInto.valid\n ? \"border-(--ec-event-color)/50 bg-(--ec-event-color)/8 text-foreground\"\n : \"border-destructive/70 bg-destructive/10 text-destructive\",\n ),\n viewConfig.classNames?.moreIndicator,\n )}\n style={\n dropInto\n ? ({\n \"--ec-event-color\": dropInto.color ?? \"var(--color-primary)\",\n height: \"calc(var(--ec-month-bar-h, 1.75rem) - 0.125rem)\",\n } as CSSProperties)\n : undefined\n }\n onClick={(e: React.MouseEvent) => {\n e.stopPropagation();\n const verdict = settings.onMoreClick?.(\n day,\n segments.map((segment) => segment.occurrence),\n e,\n );\n if (verdict === false) {\n e.preventDefault();\n setOpen(false);\n }\n }}\n >\n {viewConfig.renderMoreIndicator?.({ day, count, segments }) ??\n settings.i18n.labels.more(count)}\n </PopoverTrigger>\n <PopoverContent\n data-slot=\"event-calendar-more-popover\"\n align={viewConfig.morePopoverAlign}\n // The popover is a dialog, so it needs a name. The built-in body already\n // renders the day header this list belongs to, so point at that; a\n // consumer body has no header to point at and gets the same formatted\n // day as a label instead.\n aria-labelledby={viewConfig.renderMoreContent ? undefined : headerId}\n aria-label={\n viewConfig.renderMoreContent\n ? format(toZoned(day, settings.timeZone), settings.i18n.formats.moreDayHeader, {\n locale: settings.locale,\n })\n : undefined\n }\n // PopoverContent is unlayered (flex-col gap-4 p-4); override with !.\n // text-xs re-establishes the calendar's base type here because this\n // content is portaled out of the root subtree and cannot inherit it.\n className={cn(\"w-64 gap-1! p-2! text-xs\", viewConfig.classNames?.morePopover)}\n onClick={(e: React.MouseEvent) => e.stopPropagation()}\n >\n {viewConfig.renderMoreContent ? (\n viewConfig.renderMoreContent({\n day,\n segments,\n close: () => setOpen(false),\n })\n ) : (\n <EventCalendarMoreDefaultContent day={day} segments={segments} headerId={headerId} />\n )}\n </PopoverContent>\n </Popover>\n );\n}\n\n/** Built-in \"+N more\" popover body: day header + the day's chips. */\nfunction EventCalendarMoreDefaultContent({\n day,\n segments,\n headerId,\n}: {\n day: Date;\n segments: EventCalendarSegment[];\n /** Names the popover dialog: the header IS the list's accessible name. */\n headerId?: string;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n return (\n <>\n <div\n id={headerId}\n className={cn(\n \"px-1 py-1 font-medium text-muted-foreground text-xs\",\n viewConfig.classNames?.morePopoverHeader,\n )}\n >\n {format(toZoned(day, settings.timeZone), settings.i18n.formats.moreDayHeader, {\n locale: settings.locale,\n })}\n </div>\n {/* The scroll region breaks out of the popover's right padding (-me-2)\n so the scrollbar sits flush in the gutter; the list then pads itself\n back (ps-1 aligns with the header, pe-4 clears the ~10px bar with a\n gap) and adds py-1 so the first/last focus ring is not clipped by\n the overflow. Layout is identical with or without a scrollbar. */}\n {viewConfig.scrollbars === \"native\" ? (\n <div\n data-ec-native-scroll=\"\"\n className=\"-me-2 max-h-(--ec-more-max-height,16rem) min-h-0 overflow-y-auto\"\n >\n <div className=\"flex flex-col gap-1 py-1 ps-1 pe-4\">\n {segments.map((segment) => (\n <EventCalendarEvent\n key={segment.occurrence.key}\n segment={segment}\n className=\"py-0.5\"\n />\n ))}\n </div>\n </div>\n ) : (\n <ScrollArea className=\"-me-2 min-h-0 **:data-[slot=scroll-area-viewport]:max-h-(--ec-more-max-height,16rem)\">\n <div className=\"flex flex-col gap-1 py-1 ps-1 pe-4\">\n {segments.map((segment) => (\n <EventCalendarEvent\n key={segment.occurrence.key}\n segment={segment}\n className=\"py-0.5\"\n />\n ))}\n </div>\n </ScrollArea>\n )}\n </>\n );\n}\n\nexport type { EventCalendarMonthViewProps, EventCalendarMoreIndicatorProps };\nexport { EventCalendarMonthView, EventCalendarMoreIndicator };\n"],"mappings":";;;;;;;;;;;;;;;AAqDA,MAAM,qBAAqB,OAAO,WAAW,cAAc,kBAAkB;AAQ7E,IAAI,cAIO;;AAGX,SAAS,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AC3E,QAAQ,SAAS,OACnB,CAAC,IACD,KAAA;GAKN,WAAW,GAAG,4BAA4B,WAAW,YAAY,WAAW;GAC5E,UAAU,MAAwB,EAAE,gBAAgB;GAEnD,UAAA,WAAW,oBACV,WAAW,kBAAkB;IAC3B;IACA;IACA,aAAa,QAAQ,KAAK;GAC5B,CAAC,IAED,oBAAC,iCAAD;IAAsC;IAAe;IAAoB;GAAW,CAAA;EAExE,CAAA,CACT;;AAEb;;AAGA,SAAS,gCAAgC,EACvC,KACA,UACA,YAMC;CACD,MAAM,WAAW,yBAAyB;CAC1C,MAAM,aAAa,2BAA2B;CAC9C,OACE,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,OAAD;EACE,IAAI;EACJ,WAAW,GACT,uDACA,WAAW,YAAY,iBACzB;EAEC,UAAA,OAAO,QAAQ,KAAK,SAAS,QAAQ,GAAG,SAAS,KAAK,QAAQ,eAAe,EAC5E,QAAQ,SAAS,OACnB,CAAC;CACE,CAAA,GAMJ,WAAW,eAAe,WACzB,oBAAC,OAAD;EACE,yBAAsB;EACtB,WAAU;EAEV,UAAA,oBAAC,OAAD;GAAK,WAAU;GACZ,UAAA,SAAS,KAAK,YACb,oBAAC,oBAAD;IAEW;IACT,WAAU;GACX,GAHM,QAAQ,WAAW,GAGzB,CACF;EACE,CAAA;CACF,CAAA,IAEL,oBAAC,YAAD;EAAY,WAAU;EACpB,UAAA,oBAAC,OAAD;GAAK,WAAU;GACZ,UAAA,SAAS,KAAK,YACb,oBAAC,oBAAD;IAEW;IACT,WAAU;GACX,GAHM,QAAQ,WAAW,GAGzB,CACF;EACE,CAAA;CACK,CAAA,CAEd,EAAA,CAAA;AAEN"}
1
+ {"version":3,"file":"event-calendar-month-view.js","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-month-view.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type CSSProperties,\n type Ref,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cn } from \"cn\";\nimport { addDays, format, getWeek } from \"date-fns\";\nimport { PlusIcon } from \"lucide-react\";\n\nimport { Popover, PopoverContent, PopoverTrigger } from \"../../ui/popover\";\nimport { ScrollArea } from \"../../ui/scroll-area\";\nimport {\n EventCalendarViewContext,\n useEventCalendar,\n useEventCalendarDay,\n useEventCalendarSelector,\n useEventCalendarSettings,\n useEventCalendarViewConfig,\n useEventCalendarViewSettings,\n useEventCalendarWeek,\n} from \"./event-calendar\";\nimport { useEventCalendarGestures, wasRecentChipPress, wasRecentDrag } from \"./event-calendar-dnd\";\nimport {\n EVENT_CALENDAR_GHOST,\n EVENT_CALENDAR_SLOT_DRAFT,\n EventCalendarEvent,\n} from \"./event-calendar-event\";\nimport {\n getDayKey,\n getRangeKey,\n resolveOffDay,\n toZoned,\n zonedStartOfDay,\n} from \"./event-calendar-lib\";\nimport type {\n EventCalendarDateRange,\n EventCalendarDragState,\n EventCalendarEventId,\n EventCalendarSegment,\n} from \"./event-calendar-types\";\n\n// Layout-effect on the client (measure before paint, no flash), plain effect on\n// the server (never runs there) to avoid the SSR useLayoutEffect warning.\nconst useIsoLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// An occurrence key encodes the start instant and is also the chip's React key,\n// so committing a move re-keys the chip: React remounts it and the browser\n// drops focus to <body>. The chip that owns focus is recorded here so the cell\n// rendering its replacement can hand focus back. Module scope because the drop\n// can land in a different cell than the one the chip left, and only one element\n// holds focus at a time anyway.\nlet focusedChip: {\n node: HTMLElement;\n eventId: EventCalendarEventId;\n recurrenceIndex?: number;\n} | null = null;\n\n/** Give focus back to the recorded chip's replacement, if `root` renders it. */\nfunction restoreChipFocus(root: HTMLElement | null, segments: EventCalendarSegment[]) {\n const pending = focusedChip;\n // Only a chip removed WHILE focused needs help: a node still in the tree, or\n // a focus that has already moved on by itself, is left alone.\n if (!root || !pending || pending.node.isConnected) return;\n const active = document.activeElement;\n if (active && active !== document.body) return;\n const index = segments.findIndex(\n (segment) =>\n segment.occurrence.eventId === pending.eventId &&\n segment.occurrence.recurrenceIndex === pending.recurrenceIndex,\n );\n if (index < 0) return;\n const chip = root.querySelectorAll<HTMLElement>(\"[data-slot=event-calendar-event]\")[index];\n if (!chip) return;\n // cleared first: focus() re-records through the new chip's own onFocus\n focusedChip = null;\n chip.focus();\n}\n\ninterface EventCalendarMonthViewProps extends useRender.ComponentProps<\"div\"> {\n maxEventsPerCell?: number | \"auto\";\n}\n\nfunction EventCalendarMonthView({\n className,\n render,\n maxEventsPerCell,\n ...props\n}: EventCalendarMonthViewProps) {\n const instance = useEventCalendar();\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const visibleRange = useEventCalendarSelector<unknown, EventCalendarDateRange>(\n (state) => state.visibleRange,\n {\n isEqual: (a, b) => getRangeKey(a) === getRangeKey(b),\n },\n );\n const anchorDate = useEventCalendarSelector((state) => state.date);\n\n const { effective } = useEventCalendarViewSettings();\n const weeks = useMemo(() => {\n const days: Date[] = [];\n let cursor = zonedStartOfDay(visibleRange.start, settings.timeZone);\n while (cursor < visibleRange.end) {\n days.push(cursor);\n cursor = zonedStartOfDay(addDays(toZoned(cursor, settings.timeZone), 1), settings.timeZone);\n }\n const rows: Date[][] = [];\n for (let i = 0; i < days.length; i += 7) rows.push(days.slice(i, i + 7));\n if (effective.weekends) return rows;\n return rows.map((row) =>\n row.filter((day) => !settings.weekendDays.includes(toZoned(day, settings.timeZone).getDay())),\n );\n }, [visibleRange, settings.timeZone, settings.weekendDays, effective.weekends]);\n\n const headerDays = weeks[0] ?? [];\n const title = settings.i18n.functions.formatTitle(\"month\", {\n date: toZoned(anchorDate, settings.timeZone),\n activeRange: instance.api.getActiveRange(),\n visibleRange,\n locale: settings.locale,\n });\n\n const gridTemplateColumns = `${effective.weekNumbers ? \"var(--ec-week-number-w, 2.75rem) \" : \"\"}repeat(${headerDays.length}, minmax(0, 1fr))`;\n const cap = maxEventsPerCell ?? viewConfig.maxEventsPerCell;\n const contained = viewConfig.scrollMode !== \"page\";\n\n // \"auto\" fits as many event rows as the cell height allows and rolls the rest\n // into \"+N more\". Only the contained mode gives a cell a bounded height to\n // measure; page mode grows to fit, so \"auto\" there keeps the fixed fallback.\n const autoFit = cap === \"auto\" && contained;\n // slotProbe resolves the event-row height (--ec-month-bar-h) to px, honoring\n // the current font size and any consumer override; contentProbe is the first\n // cell's flex-1 content area, whose height is the event space per cell.\n const slotProbeRef = useRef<HTMLDivElement | null>(null);\n const contentProbeRef = useRef<HTMLDivElement | null>(null);\n const [autoCap, setAutoCap] = useState<number | null>(null);\n const measureCap = useCallback(() => {\n const content = contentProbeRef.current;\n const slot = slotProbeRef.current;\n if (!content || !slot) return;\n const laneH = slot.getBoundingClientRect().height;\n if (laneH <= 0) return;\n const cs = getComputedStyle(content);\n const inner = content.clientHeight - (parseFloat(cs.paddingTop) || 0);\n const gap = parseFloat(cs.rowGap) || 0;\n // N rows occupy N*laneH - gap (the last row has no trailing gap)\n setAutoCap(Math.max(1, Math.floor((inner + gap) / laneH)));\n }, []);\n useIsoLayoutEffect(() => {\n if (!autoFit) {\n setAutoCap(null);\n return;\n }\n const content = contentProbeRef.current;\n if (!content || typeof ResizeObserver === \"undefined\") return;\n measureCap();\n const observer = new ResizeObserver(measureCap);\n observer.observe(content);\n return () => observer.disconnect();\n // re-observe the first cell after a re-layout (row count or month change)\n }, [autoFit, measureCap, weeks.length, anchorDate]);\n const resolvedCap = cap === \"auto\" ? (autoFit ? (autoCap ?? 3) : 3) : cap;\n\n const defaultProps = {\n \"data-slot\": \"event-calendar-month-view\",\n \"data-view\": \"month\",\n role: \"grid\",\n \"aria-label\": title,\n className: cn(\n \"flex flex-col border-t\",\n contained && \"min-h-0 flex-1 overflow-hidden\",\n viewConfig.classNames?.monthView,\n className,\n ),\n children: (\n <>\n <div\n role=\"row\"\n data-slot=\"event-calendar-month-header\"\n // @container scopes the narrow-label breakpoint to the header row\n className={cn(\"@container grid border-b\", viewConfig.classNames?.monthHeader)}\n style={{ gridTemplateColumns }}\n >\n {effective.weekNumbers && (\n <div\n role=\"columnheader\"\n aria-hidden\n className={cn(\"border-e px-2 py-1.5\", viewConfig.classNames?.weekNumber)}\n />\n )}\n {headerDays.map((day) => (\n <div\n key={day.getTime()}\n role=\"columnheader\"\n className={cn(\n \"truncate px-2 py-1.5 font-medium text-muted-foreground\",\n viewConfig.classNames?.monthDayHeader,\n )}\n >\n {viewConfig.renderDayHeader?.({\n day,\n view: \"month\",\n isToday:\n getDayKey(day, settings.timeZone) === getDayKey(new Date(), settings.timeZone),\n }) ?? (\n <>\n <span className=\"@max-[36rem]:hidden\">\n {format(toZoned(day, settings.timeZone), settings.i18n.formats.monthDayHeader, {\n locale: settings.locale,\n })}\n </span>\n <span className=\"@max-[36rem]:inline hidden\">\n {format(\n toZoned(day, settings.timeZone),\n settings.i18n.formats.monthDayHeaderNarrow,\n { locale: settings.locale },\n )}\n </span>\n </>\n )}\n </div>\n ))}\n </div>\n <div\n data-slot=\"event-calendar-month-body\"\n className={cn(\"grid\", contained && \"min-h-0 flex-1\", viewConfig.classNames?.monthBody)}\n style={{\n gridTemplateRows: contained\n ? `repeat(${weeks.length}, minmax(0, 1fr))`\n : `repeat(${weeks.length}, minmax(var(--ec-month-row-min-h, 8rem), auto))`,\n }}\n >\n {weeks.map((week, rowIndex) => (\n <EventCalendarMonthWeek\n key={rowIndex}\n week={week}\n gridTemplateColumns={gridTemplateColumns}\n showWeekNumber={effective.weekNumbers}\n cap={resolvedCap}\n autoFit={autoFit}\n contentRef={rowIndex === 0 ? contentProbeRef : undefined}\n />\n ))}\n </div>\n {autoFit && (\n <div\n ref={slotProbeRef}\n aria-hidden\n className=\"pointer-events-none invisible absolute h-(--ec-month-bar-h,1.75rem) w-0\"\n />\n )}\n </>\n ),\n };\n\n return (\n <EventCalendarViewContext.Provider value={{ view: \"month\" }}>\n {useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n })}\n </EventCalendarViewContext.Provider>\n );\n}\n\n/**\n * One month week row. Multi-day / all-day events render as CONTINUOUS bars in\n * an overlay grid that spans day columns (colStart -> colSpan) and stacks by\n * lane; single-day timed events render inside each cell below the reserved bar\n * lanes. This is what makes a cross-day event read as one whole block instead\n * of a chip repeated per cell.\n */\nfunction EventCalendarMonthWeek({\n week,\n gridTemplateColumns,\n showWeekNumber,\n cap,\n autoFit,\n contentRef,\n}: {\n week: Date[];\n gridTemplateColumns: string;\n showWeekNumber: boolean;\n cap: number;\n autoFit: boolean;\n /** Set on the first week only: forwarded to its first cell's content area so\n * the view can measure the per-cell event height for \"auto\". */\n contentRef?: Ref<HTMLDivElement>;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const { bars, rowStart } = useEventCalendarWeek(week[0]);\n const colOffset = showWeekNumber ? 1 : 0;\n const dayMs = 86400000;\n const rowStartMs = zonedStartOfDay(rowStart ?? week[0], settings.timeZone).getTime();\n // Day offsets from the TRUE row start (0-6) for each visible column, so a\n // weekends-hidden month still places bars on the right days.\n const offsets = week.map((d) =>\n Math.round((zonedStartOfDay(d, settings.timeZone).getTime() - rowStartMs) / dayMs),\n );\n /** Clamp a day-offset span onto the visible columns; null = fully hidden. */\n const gridPos = (colStart: number, colSpan: number) => {\n let start = -1;\n let end = -1;\n for (let o = colStart; o < colStart + colSpan; o++) {\n const col = offsets.indexOf(o);\n if (col === -1) continue;\n if (start === -1) start = col;\n end = col;\n }\n return start === -1 ? null : { col: start, span: end - start + 1 };\n };\n // bars fit within the cap; deeper lanes fall into each day's \"+N more\"\n const visibleBars = bars.filter((b) => (b.lane ?? 0) < cap);\n const covers = (b: EventCalendarSegment, dayOffset: number) =>\n (b.colStart ?? 0) <= dayOffset && dayOffset < (b.colStart ?? 0) + (b.colSpan ?? 1);\n // Occurrence keys of the bars hidden in each column (lane >= cap). Threaded to\n // the cell so its \"+N more\" popover can list the hidden bars WITHOUT re-listing\n // the visible ones (day buckets carry no lane, so the week row - which owns bar\n // laning - is the only place that knows which bars are hidden).\n const hiddenBarKeysByCol = week.map(\n (_, col) =>\n new Set(\n bars\n .filter((b) => (b.lane ?? 0) >= cap && covers(b, offsets[col]))\n .map((b) => b.occurrence.key),\n ),\n );\n\n // Live move/resize ghost at the PROPOSED day span. Standardized treatment\n // (EVENT_CALENDAR_GHOST): move = the event carried as a full clone, resize =\n // the same clone with a dashed boundary; invalid adds destructive marking\n // while the engine shows the not-allowed cursor + validation hint.\n const dragGhost = useEventCalendarSelector<\n unknown,\n | (Pick<\n EventCalendarDragState,\n \"kind\" | \"valid\" | \"occurrence\" | \"proposedStart\" | \"proposedEnd\" | \"proposedAllDay\"\n > & {\n colStart: number;\n colSpan: number;\n isStart: boolean;\n isEnd: boolean;\n color?: string;\n })\n | null\n >(\n (state) => {\n const drag = state.drag;\n if (!drag) return null;\n const rowEndMs = rowStartMs + 7 * dayMs;\n const startDayMs = zonedStartOfDay(drag.proposedStart, settings.timeZone).getTime();\n // exclusive end -> the last covered day\n const lastDayMs = zonedStartOfDay(\n new Date(drag.proposedEnd.getTime() - 1),\n settings.timeZone,\n ).getTime();\n if (startDayMs >= rowEndMs || lastDayMs < rowStartMs) return null;\n const startCol = Math.max(0, Math.round((startDayMs - rowStartMs) / dayMs));\n const endCol = Math.min(6, Math.round((lastDayMs - rowStartMs) / dayMs));\n if (endCol < startCol) return null;\n return {\n kind: drag.kind,\n valid: drag.valid,\n occurrence: drag.occurrence,\n proposedStart: drag.proposedStart,\n proposedEnd: drag.proposedEnd,\n proposedAllDay: drag.proposedAllDay,\n colStart: startCol,\n colSpan: endCol - startCol + 1,\n isStart: startDayMs >= rowStartMs,\n isEnd: lastDayMs < rowEndMs,\n color: drag.occurrence.event.color,\n };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.colStart === b.colStart &&\n a.colSpan === b.colSpan &&\n a.valid === b.valid &&\n a.kind === b.kind &&\n a.proposedAllDay === b.proposedAllDay &&\n a.proposedStart.getTime() === b.proposedStart.getTime() &&\n a.proposedEnd.getTime() === b.proposedEnd.getTime()),\n },\n );\n const ghostPos = dragGhost ? gridPos(dragGhost.colStart, dragGhost.colSpan) : null;\n const ghostLane = dragGhost\n ? (bars.find((b) => b.occurrence.key === dragGhost.occurrence.key)?.lane ?? 0)\n : 0;\n // A single-day timed MOVE is indicated INLINE in the target cell (a\n // placeholder at the time-sorted position, rendered by EventCalendarMonthCell)\n // rather than as a bar in this overlay, so only bar drags and every resize\n // render the overlay ghost. Bars = all-day or multi-day (span > 1 day).\n const ghostIsBar =\n !!dragGhost &&\n (dragGhost.kind !== \"move\" ||\n dragGhost.proposedAllDay ||\n dragGhost.proposedEnd.getTime() - dragGhost.proposedStart.getTime() > dayMs);\n\n return (\n <div\n role=\"row\"\n data-slot=\"event-calendar-month-row\"\n className={cn(\n \"relative grid min-h-0 border-b last:border-b-0\",\n viewConfig.classNames?.monthRow,\n )}\n style={{ gridTemplateColumns }}\n >\n {showWeekNumber && (\n <div\n role=\"rowheader\"\n data-slot=\"event-calendar-week-number\"\n className={cn(\n \"border-e px-2 pt-1 text-muted-foreground tabular-nums\",\n viewConfig.classNames?.weekNumber,\n )}\n >\n {settings.i18n.labels.week(\n getWeek(toZoned(week[0], settings.timeZone), {\n // locale supplies firstWeekContainsDate, so a de/ISO calendar\n // numbers the year-boundary weeks its own way instead of falling\n // back to US numbering; weekStartsOn stays explicit so the number\n // keeps matching the rendered grid\n locale: settings.locale,\n weekStartsOn: settings.weekStartsOn,\n }),\n )}\n </div>\n )}\n {week.map((day, col) => (\n <EventCalendarMonthCell\n key={day.getTime()}\n day={day}\n cap={cap}\n // Reserve lane space only for bars that pass through THIS cell, so a\n // short multi-day event does not push down timed events in unrelated\n // cells of the same row. Reserve down to the deepest covering bar\n // lane so timed events always sit below every bar in their own cell.\n reservedLanes={visibleBars.reduce(\n (max, b) => (covers(b, offsets[col]) ? Math.max(max, (b.lane ?? 0) + 1) : max),\n 0,\n )}\n hiddenBarKeys={hiddenBarKeysByCol[col]}\n isLast={col === week.length - 1}\n autoFit={autoFit}\n contentRef={col === 0 ? contentRef : undefined}\n />\n ))}\n {/* Continuous bar overlay: one element per bar, placed by grid-column so\n a cross-day span is a single unbroken block. pointer-events pass\n through the gaps to the cells below. NOT aria-hidden - these are the\n real interactive bars. */}\n {(visibleBars.length > 0 || (dragGhost && ghostPos && ghostIsBar)) && (\n <div\n data-slot=\"event-calendar-month-bar-overlay\"\n className={cn(\n \"pointer-events-none absolute inset-x-0 top-0 z-10 grid pt-1.5\",\n viewConfig.classNames?.monthBarOverlay,\n )}\n style={{\n gridTemplateColumns,\n gridAutoRows: \"var(--ec-month-bar-h, 1.75rem)\",\n }}\n >\n {visibleBars.map((bar) => {\n const pos = gridPos(bar.colStart ?? 0, bar.colSpan ?? 1);\n if (!pos) return null;\n return (\n <div\n key={bar.occurrence.key}\n className={cn(\"pointer-events-auto min-w-0 px-1\", viewConfig.classNames?.monthBar)}\n style={{\n gridColumn: `${colOffset + pos.col + 1} / span ${pos.span}`,\n gridRow: (bar.lane ?? 0) + 1,\n }}\n >\n {/* lane height minus the 2px inter-lane gap */}\n <EventCalendarEvent\n segment={bar}\n className=\"h-[calc(var(--ec-month-bar-h,1.75rem)-0.125rem)]\"\n />\n </div>\n );\n })}\n {dragGhost && ghostPos && ghostIsBar && (\n <div\n aria-hidden\n className={cn(\"min-w-0 px-1\", viewConfig.classNames?.monthBar)}\n style={{\n gridColumn: `${colOffset + ghostPos.col + 1} / span ${ghostPos.span}`,\n gridRow: ghostLane + 1,\n }}\n >\n <div\n data-slot=\"event-calendar-drag-ghost\"\n data-kind={dragGhost.kind}\n data-drop-invalid={!dragGhost.valid || undefined}\n className={cn(\n \"h-[calc(var(--ec-month-bar-h,1.75rem)-0.125rem)]\",\n dragGhost.kind === \"move\"\n ? // faint drop placeholder only: the cursor-attached\n // carry clone owns the visual during moves\n cn(\n EVENT_CALENDAR_GHOST.move,\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalid,\n )\n : cn(\n EVENT_CALENDAR_GHOST.resize,\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidResize,\n ),\n viewConfig.classNames?.dragGhost,\n )}\n style={\n {\n \"--ec-event-color\": dragGhost.color ?? \"var(--color-primary)\",\n } as CSSProperties\n }\n >\n {dragGhost.kind !== \"move\" && (\n <EventCalendarEvent\n preview\n segment={{\n occurrence: {\n ...dragGhost.occurrence,\n start: dragGhost.proposedStart,\n end: dragGhost.proposedEnd,\n },\n day: week[ghostPos.col] ?? week[0],\n isStart: dragGhost.isStart,\n isEnd: dragGhost.isEnd,\n continuesBefore: !dragGhost.isStart,\n continuesAfter: !dragGhost.isEnd,\n }}\n className={cn(\n \"inset-ring-0 h-full\",\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidContent,\n )}\n />\n )}\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n\nfunction EventCalendarMonthCell({\n day,\n cap,\n reservedLanes,\n hiddenBarKeys,\n isLast,\n autoFit,\n contentRef,\n}: {\n day: Date;\n cap: number;\n reservedLanes: number;\n /** Occurrence keys of the bars hidden in THIS column (lane >= cap), from the\n * week row. Lets the cell list hidden bars in its overflow popover without\n * re-listing the bars already visible in the row overlay. */\n hiddenBarKeys: Set<string>;\n /** Last column in the row - drops the right border so the grid's outer edge\n * is owned by the container, not a doubled cell border. Passed explicitly\n * because the bar overlay renders after the cells, so `:last-child` is\n * unreliable on rows that have bars. */\n isLast: boolean;\n /** When true, the \"+N more\" chip is treated as taking a row so the visible\n * chips + indicator always fit the measured cell height. */\n autoFit: boolean;\n /** Set on the first cell only: measured to derive the \"auto\" cap. */\n contentRef?: Ref<HTMLDivElement>;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const gestures = useEventCalendarGestures();\n const { segments, isToday, isOutside } = useEventCalendarDay(day);\n\n const dayStart = zonedStartOfDay(day, settings.timeZone);\n const dayEnd = addDays(toZoned(dayStart, settings.timeZone), 1);\n const { effective } = useEventCalendarViewSettings();\n const isOff = resolveOffDay(\n day,\n settings.timeZone,\n effective.offDays\n ? typeof viewConfig.offDays === \"object\"\n ? viewConfig.offDays\n : true\n : false,\n settings.weekendDays,\n );\n const offClassName =\n (typeof viewConfig.offDays === \"object\" && viewConfig.offDays.className) || \"bg-muted/25\";\n\n const isDropTarget = useEventCalendarSelector<unknown, \"valid\" | \"invalid\" | null>((state) => {\n const drag = state.drag;\n if (!drag) return null;\n const covered = drag.proposedStart < dayEnd && drag.proposedEnd > dayStart;\n if (!covered) return null;\n return drag.valid ? \"valid\" : \"invalid\";\n });\n // Hide hover affordances mid-gesture: the only intent is the drop target.\n // Gated on the one thing that reads it: a plain global boolean flips for all\n // 42 cells the moment a gesture starts and again when it ends, which is pure\n // waste in the default configuration where no add button renders.\n const isInteracting = useEventCalendarSelector<unknown, boolean>((state) =>\n viewConfig.showDayAddButton ? state.drag !== null || state.slotDraft !== null : false,\n );\n const inDraft = useEventCalendarSelector<unknown, { isStart: boolean; isEnd: boolean } | null>(\n (state) => {\n const draft = state.slotDraft;\n if (!draft?.allDay) return null;\n if (draft.start >= dayEnd || draft.end <= dayStart) return null;\n return {\n isStart: draft.start >= dayStart,\n isEnd: draft.end <= dayEnd,\n };\n },\n {\n isEqual: (a, b) =>\n a === b || (a !== null && b !== null && a.isStart === b.isStart && a.isEnd === b.isEnd),\n },\n );\n\n // Month drag-create selects whole DAYS, so the readout is a date range rather\n // than a time range. Held separately from `inDraft` above, which only knows\n // whether this cell is an edge of the selection, not what the selection is.\n const draftRange = useEventCalendarSelector<unknown, { start: Date; end: Date } | null>(\n (state) => {\n const draft = state.slotDraft;\n if (!draft?.allDay) return null;\n return { start: draft.start, end: draft.end };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.start.getTime() === b.start.getTime() &&\n a.end.getTime() === b.end.getTime()),\n },\n );\n // A single-day timed MOVE landing on THIS day: expose the proposed\n // minute-of-day (+ color/validity) so the cell can render a drop placeholder\n // at the correct time-sorted position, instead of the overlay marking a bar\n // over the first chip. Skipped for bars (they keep the overlay ghost) and for\n // a no-op move back onto the event's own day (the dimmed source already marks\n // the spot).\n const inlineDrop = useEventCalendarSelector<\n unknown,\n { min: number; valid: boolean; color?: string } | null\n >(\n (state) => {\n const drag = state.drag;\n if (drag?.kind !== \"move\" || drag.proposedAllDay) return null;\n if (drag.proposedEnd.getTime() - drag.proposedStart.getTime() > 86400000) return null;\n const dropDayMs = zonedStartOfDay(drag.proposedStart, settings.timeZone).getTime();\n if (dropDayMs !== dayStart.getTime()) return null;\n if (\n zonedStartOfDay(drag.occurrence.start, settings.timeZone).getTime() === dayStart.getTime()\n )\n return null;\n return {\n min: (drag.proposedStart.getTime() - dropDayMs) / 60000,\n valid: drag.valid,\n color: drag.occurrence.event.color,\n };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null && b !== null && a.min === b.min && a.valid === b.valid && a.color === b.color),\n },\n );\n\n // Bars (allDay/multi-day) are drawn by the week-row overlay; the cell renders\n // only single-day timed events, below the reserved bar lanes.\n const extraHidden = hiddenBarKeys.size;\n const hiddenBarSegs = segments.allDay.filter((s) => hiddenBarKeys.has(s.occurrence.key));\n const m = segments.timed.length;\n const timedSlots = Math.max(0, cap - reservedLanes);\n\n // Static (at-rest) split: what the cell shows with no drag, and - crucially -\n // what the \"+N more\" popover lists. The popover carries ONLY the hidden events\n // (hidden bars + timed past the cap), never the chips already visible in the\n // cell, so it never duplicates them. autoFit gives up one timed row to the\n // \"+N more\" indicator so the visible chips fit the clipped cell height.\n const staticOverflow = extraHidden > 0 || m > timedSlots;\n const staticShown = autoFit && staticOverflow ? Math.max(0, timedSlots - 1) : timedSlots;\n const overflowSegments = [...hiddenBarSegs, ...segments.timed.slice(staticShown)];\n\n // Live split: while a timed chip is dragged onto this day, render the day\n // exactly as it will look AFTER the drop. The dragged chip is a phantom in the\n // time-sorted order and is shown as the placeholder - inline where it lands,\n // or ON the \"+N more\" indicator when it lands in the overflow bucket (so the\n // user sees the drop will push it into \"more\"). The \"+N more\" count always\n // reflects the post-drop hidden total.\n let visibleTimed: EventCalendarSegment[];\n let overflowCount: number;\n let placeholderIndex: number;\n let placeholderAtMore: boolean;\n if (!inlineDrop) {\n visibleTimed = segments.timed.slice(0, staticShown);\n overflowCount = overflowSegments.length;\n placeholderIndex = -1;\n placeholderAtMore = false;\n } else {\n // rank of the dragged chip in the resulting time-sorted list (chips are\n // time-ordered, so this is the count starting at or before its time)\n const insertRank = segments.timed.filter((s) => (s.startMin ?? 0) <= inlineDrop.min).length;\n const dropOverflow = extraHidden > 0 || m + 1 > timedSlots;\n // rows for timed items INCLUDING the phantom, before the \"+N more\" row\n const vis = !dropOverflow ? m + 1 : autoFit ? Math.max(0, timedSlots - 1) : timedSlots;\n placeholderAtMore = insertRank >= vis;\n visibleTimed = placeholderAtMore\n ? segments.timed.slice(0, vis)\n : segments.timed.slice(0, Math.max(0, vis - 1));\n placeholderIndex = placeholderAtMore ? -1 : insertRank;\n overflowCount = extraHidden + (m - visibleTimed.length) + (placeholderAtMore ? 1 : 0);\n }\n\n // No dep array: the replacement for a chip that lost focus to a commit can\n // appear on any re-render of any cell, and a cell with nothing to restore\n // bails after two comparisons.\n const rootRef = useRef<HTMLDivElement | null>(null);\n useIsoLayoutEffect(() => {\n restoreChipFocus(rootRef.current, visibleTimed);\n });\n\n // Faint dashed drop placeholder, tinted to the dragged event's color, echoing\n // the move ghost (EVENT_CALENDAR_GHOST.move); one chip-height tall so chips\n // shift by exactly one row when it is inserted.\n const dropPlaceholder = inlineDrop ? (\n <div\n key=\"ec-drop-placeholder\"\n aria-hidden\n data-slot=\"event-calendar-drop-placeholder\"\n data-drop-invalid={!inlineDrop.valid || undefined}\n className={cn(\n \"shrink-0 rounded-sm border border-dashed\",\n inlineDrop.valid\n ? \"border-(--ec-event-color)/50 bg-(--ec-event-color)/8\"\n : \"border-destructive/70 bg-destructive/10\",\n viewConfig.classNames?.dragGhost,\n )}\n style={\n {\n \"--ec-event-color\": inlineDrop.color ?? \"var(--color-primary)\",\n height: \"calc(var(--ec-month-bar-h, 1.75rem) - 0.125rem)\",\n } as CSSProperties\n }\n />\n ) : null;\n\n const defaultContent = (\n <>\n <div\n ref={contentRef}\n className={cn(\n // gap-0.5 pairs with the 0.125rem subtraction in the lane spacer\n // below; changing the gap requires renderMonthCell\n // px-1 matches the all-day bar wrapper inset so single-day chips and\n // multi-day bars line up on the same left/right edge in a cell\n \"flex min-h-0 flex-1 flex-col gap-0.5 overflow-hidden px-1 pt-1.5\",\n viewConfig.classNames?.monthCellContent,\n )}\n >\n {reservedLanes > 0 && (\n <div\n aria-hidden\n className=\"shrink-0\"\n style={{\n // lane height already carries the 2px inter-lane gap; subtract\n // it so spacer + the column's own gap-0.5 = the SAME 2px rhythm\n // between the last bar and the first timed chip\n height: `calc(${reservedLanes} * var(--ec-month-bar-h, 1.75rem) - 0.125rem)`,\n }}\n />\n )}\n {visibleTimed.flatMap((segment, i) => {\n const chip = (\n <EventCalendarEvent\n key={segment.occurrence.key}\n segment={segment}\n // Remember the chip holding focus so a commit that re-keys it can\n // hand focus back to the remounted one (see restoreChipFocus)\n onFocus={(e) => {\n focusedChip = {\n node: e.currentTarget,\n eventId: segment.occurrence.eventId,\n recurrenceIndex: segment.occurrence.recurrenceIndex,\n };\n }}\n // A chip still in the tree lost focus on its own, so there is\n // nothing to restore; only a blur from the remount is kept.\n onBlur={(e) => {\n if (e.currentTarget.isConnected) focusedChip = null;\n }}\n // Hold a fixed height like the all-day lane above; without this\n // the chip flex-shrinks to whatever room the cell has left, so\n // cells with a reserved bar lane or a second chip render shorter\n // chips.\n className=\"shrink-0\"\n />\n );\n return i === placeholderIndex ? [dropPlaceholder, chip] : [chip];\n })}\n {placeholderIndex >= 0 && placeholderIndex >= visibleTimed.length && dropPlaceholder}\n {overflowCount > 0 && (\n <EventCalendarMoreIndicator\n day={day}\n count={overflowCount}\n segments={overflowSegments}\n dropInto={\n placeholderAtMore && inlineDrop\n ? { color: inlineDrop.color, valid: inlineDrop.valid }\n : undefined\n }\n />\n )}\n </div>\n {/* Day number + add affordance, bottom-right (Notion-style) */}\n <div\n className={cn(\n \"flex items-center justify-end gap-1 px-2 pb-1.5\",\n viewConfig.classNames?.monthCellFooter,\n )}\n >\n {viewConfig.showDayAddButton && !isInteracting && (\n <button\n type=\"button\"\n data-slot=\"event-calendar-day-add\"\n aria-label={settings.i18n.labels.addEvent}\n // a different icon/markup is a renderMonthCell job\n className={cn(\n \"flex size-5 cursor-pointer items-center justify-center rounded-sm bg-primary text-primary-foreground opacity-0 transition-opacity focus-visible:opacity-100 group-hover/ec-cell:opacity-100\",\n viewConfig.classNames?.dayAddButton,\n )}\n onClick={(e) => {\n e.stopPropagation();\n settings.onSlotClick?.({ date: day, allDay: true, view: \"month\" }, e);\n }}\n >\n <PlusIcon className=\"size-3.5\" aria-hidden=\"true\" />\n </button>\n )}\n <span\n data-slot=\"event-calendar-month-day-number\"\n className={cn(\n \"flex size-5 items-center justify-center rounded-full\",\n isOutside && \"text-muted-foreground\",\n // the filled circle already marks today; keep the number the same\n // weight/size as the other days so it does not read as larger\n // Same font-size as every other day; a lighter weight cancels the\n // way white digits on the filled circle read bolder/larger than the\n // dark-on-light numbers around them.\n isToday && \"bg-primary font-light text-primary-foreground\",\n viewConfig.classNames?.monthDayNumber,\n )}\n >\n {format(toZoned(day, settings.timeZone), settings.i18n.formats.monthCellDay, {\n locale: settings.locale,\n })}\n </span>\n </div>\n </>\n );\n\n const content =\n viewConfig.renderMonthCell?.({\n day,\n segments,\n isToday,\n isOutside,\n overflowCount,\n defaultContent,\n }) ?? defaultContent;\n\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: pointer/gesture surface; keyboard via toolbar\n <div\n ref={rootRef}\n role=\"gridcell\"\n data-slot=\"event-calendar-month-cell\"\n data-today={isToday || undefined}\n data-outside={isOutside || undefined}\n data-weekend={\n settings.weekendDays.includes(toZoned(day, settings.timeZone).getDay()) || undefined\n }\n data-ec-day={dayStart.getTime()}\n data-drop-target={isDropTarget ?? undefined}\n data-off={isOff || undefined}\n data-draft={inDraft ? \"\" : undefined}\n aria-label={format(\n toZoned(day, settings.timeZone),\n settings.i18n.formats.monthCellAriaLabel,\n { locale: settings.locale },\n )}\n className={cn(\n \"group/ec-cell relative flex min-h-0 min-w-0 flex-col overflow-hidden\",\n !isLast && \"border-e\",\n isOutside && !settings.showOutsideDays && \"invisible\",\n isOff && offClassName,\n isToday &&\n cn(\"relative border-b-2 border-b-primary/40 bg-primary/3\", viewConfig.todayClassName),\n viewConfig.dayClassName?.(day),\n // No drop-target bg fill on move/resize - the dragged bar + not-allowed\n // cursor carry the feedback; a cell-wide color wash is too distracting.\n // data-drop-target stays as an opt-in styling hook.\n inDraft && EVENT_CALENDAR_SLOT_DRAFT.surface,\n viewConfig.classNames?.monthCell,\n )}\n onPointerDown={(e) => {\n const target = e.target as HTMLElement;\n if (target.closest(\"[data-slot=event-calendar-event]\")) return;\n if (target.closest(\"[data-slot=event-calendar-more]\")) return;\n gestures.beginCreate(e, day, true);\n }}\n onClick={(e) => {\n if (wasRecentDrag() || wasRecentChipPress()) return;\n settings.onSlotClick?.({ date: day, allDay: true, view: \"month\" }, e);\n }}\n >\n {inDraft && (\n <span\n aria-hidden\n data-slot=\"event-calendar-slot-draft\"\n className={cn(\n \"pointer-events-none absolute inset-0 z-10\",\n EVENT_CALENDAR_SLOT_DRAFT.segment,\n inDraft.isStart && EVENT_CALENDAR_SLOT_DRAFT.segmentStart,\n inDraft.isEnd && EVENT_CALENDAR_SLOT_DRAFT.segmentEnd,\n viewConfig.classNames?.slotDraft,\n )}\n >\n {/* Date-range readout, the month-view counterpart of the time-grid\n one. Rendered only on the FIRST cell of the selection, otherwise\n a three-day drag would repeat the same label three times. Pinned\n to the bottom because the day number owns the top of the cell,\n and given its own surface so it stays legible over event chips. */}\n {inDraft.isStart && draftRange && (\n <span className={cn(\"absolute inset-x-1 bottom-1\", EVENT_CALENDAR_SLOT_DRAFT.label)}>\n {settings.i18n.functions.formatDayRange(\n {\n start: toZoned(draftRange.start, settings.timeZone),\n end: toZoned(draftRange.end, settings.timeZone),\n },\n { locale: settings.locale },\n )}\n </span>\n )}\n </span>\n )}\n {content}\n </div>\n );\n}\n\ninterface EventCalendarMoreIndicatorProps {\n day: Date;\n count: number;\n /** The OVERFLOW (hidden) segments for this day - bars first, then timed. The\n * popover lists only these, never the chips already visible in the cell. */\n segments: EventCalendarSegment[];\n /** Set while a timed chip is dragged and will land in THIS overflow bucket:\n * the indicator itself becomes the drop placeholder (dashed, event-tinted) so\n * it reads as \"the chip joins the +N more list\". */\n dropInto?: { color?: string; valid: boolean };\n}\n\n/**\n * \"+N more\" trigger opening a popover with the day's full event list.\n * onMoreClick returning false suppresses the built-in popover.\n */\nfunction EventCalendarMoreIndicator({\n day,\n count,\n segments,\n dropInto,\n}: EventCalendarMoreIndicatorProps) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const [open, setOpen] = useState(false);\n const headerId = useId();\n\n // Grabbing a chip from this list starts a drag; close the popover so it does\n // not sit over the drop target while the event is carried to another day.\n const isDragging = useEventCalendarSelector<unknown, boolean>((state) => state.drag !== null);\n useEffect(() => {\n if (isDragging) setOpen(false);\n }, [isDragging]);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n data-slot=\"event-calendar-more\"\n data-drop-into={dropInto ? \"\" : undefined}\n data-drop-invalid={dropInto && !dropInto.valid ? \"\" : undefined}\n className={cn(\n \"cursor-pointer truncate rounded-sm px-1.5 text-start text-muted-foreground hover:text-foreground\",\n // While a dragged chip will land in this overflow bucket, the \"+N more\"\n // link itself becomes the drop placeholder: dashed, event-tinted, one\n // chip tall, so the drop target is unmistakable.\n dropInto &&\n cn(\n \"flex shrink-0 items-center border border-dashed\",\n dropInto.valid\n ? \"border-(--ec-event-color)/50 bg-(--ec-event-color)/8 text-foreground\"\n : \"border-destructive/70 bg-destructive/10 text-destructive\",\n ),\n viewConfig.classNames?.moreIndicator,\n )}\n style={\n dropInto\n ? ({\n \"--ec-event-color\": dropInto.color ?? \"var(--color-primary)\",\n height: \"calc(var(--ec-month-bar-h, 1.75rem) - 0.125rem)\",\n } as CSSProperties)\n : undefined\n }\n onClick={(e: React.MouseEvent) => {\n e.stopPropagation();\n const verdict = settings.onMoreClick?.(\n day,\n segments.map((segment) => segment.occurrence),\n e,\n );\n if (verdict === false) {\n e.preventDefault();\n setOpen(false);\n }\n }}\n >\n {viewConfig.renderMoreIndicator?.({ day, count, segments }) ??\n settings.i18n.labels.more(count)}\n </PopoverTrigger>\n <PopoverContent\n data-slot=\"event-calendar-more-popover\"\n align={viewConfig.morePopoverAlign}\n // The popover is a dialog, so it needs a name. The built-in body already\n // renders the day header this list belongs to, so point at that; a\n // consumer body has no header to point at and gets the same formatted\n // day as a label instead.\n aria-labelledby={viewConfig.renderMoreContent ? undefined : headerId}\n aria-label={\n viewConfig.renderMoreContent\n ? format(toZoned(day, settings.timeZone), settings.i18n.formats.moreDayHeader, {\n locale: settings.locale,\n })\n : undefined\n }\n // PopoverContent is unlayered (flex-col gap-4 p-4); override with !.\n // text-xs re-establishes the calendar's base type here because this\n // content is portaled out of the root subtree and cannot inherit it.\n className={cn(\"w-64 gap-1! p-2! text-xs\", viewConfig.classNames?.morePopover)}\n onClick={(e: React.MouseEvent) => e.stopPropagation()}\n >\n {viewConfig.renderMoreContent ? (\n viewConfig.renderMoreContent({\n day,\n segments,\n close: () => setOpen(false),\n })\n ) : (\n <EventCalendarMoreDefaultContent day={day} segments={segments} headerId={headerId} />\n )}\n </PopoverContent>\n </Popover>\n );\n}\n\n/** Built-in \"+N more\" popover body: day header + the day's chips. */\nfunction EventCalendarMoreDefaultContent({\n day,\n segments,\n headerId,\n}: {\n day: Date;\n segments: EventCalendarSegment[];\n /** Names the popover dialog: the header IS the list's accessible name. */\n headerId?: string;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n return (\n <>\n <div\n id={headerId}\n className={cn(\n \"px-1 py-1 font-medium text-muted-foreground text-xs\",\n viewConfig.classNames?.morePopoverHeader,\n )}\n >\n {format(toZoned(day, settings.timeZone), settings.i18n.formats.moreDayHeader, {\n locale: settings.locale,\n })}\n </div>\n {/* The scroll region breaks out of the popover's right padding (-me-2)\n so the scrollbar sits flush in the gutter; the list then pads itself\n back (ps-1 aligns with the header, pe-4 clears the ~10px bar with a\n gap) and adds py-1 so the first/last focus ring is not clipped by\n the overflow. Layout is identical with or without a scrollbar. */}\n {viewConfig.scrollbars === \"native\" ? (\n <div\n data-ec-native-scroll=\"\"\n className=\"-me-2 max-h-(--ec-more-max-height,16rem) min-h-0 overflow-y-auto\"\n >\n <div className=\"flex flex-col gap-1 py-1 ps-1 pe-4\">\n {segments.map((segment) => (\n <EventCalendarEvent\n key={segment.occurrence.key}\n segment={segment}\n className=\"py-0.5\"\n />\n ))}\n </div>\n </div>\n ) : (\n <ScrollArea className=\"-me-2 min-h-0 **:data-[slot=scroll-area-viewport]:max-h-(--ec-more-max-height,16rem)\">\n <div className=\"flex flex-col gap-1 py-1 ps-1 pe-4\">\n {segments.map((segment) => (\n <EventCalendarEvent\n key={segment.occurrence.key}\n segment={segment}\n className=\"py-0.5\"\n />\n ))}\n </div>\n </ScrollArea>\n )}\n </>\n );\n}\n\nexport type { EventCalendarMonthViewProps, EventCalendarMoreIndicatorProps };\nexport { EventCalendarMonthView, EventCalendarMoreIndicator };\n"],"mappings":";;;;;;;;;;;;;;;AAqDA,MAAM,qBAAqB,OAAO,WAAW,cAAc,kBAAkB;AAQ7E,IAAI,cAIO;;AAGX,SAAS,iBAAiB,MAA0B,UAAkC;CACpF,MAAM,UAAU;CAGhB,IAAI,CAAC,QAAQ,CAAC,WAAW,QAAQ,KAAK,aAAa;CACnD,MAAM,SAAS,SAAS;CACxB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,UAAA,WAAW,oBACV,WAAW,kBAAkB;IAC3B;IACA;IACA,aAAa,QAAQ,KAAK;GAC5B,CAAC,IAED,oBAAC,iCAAD;IAAsC;IAAe;IAAoB;GAAW,CAAA;EAExE,CAAA,CACT;;AAEb;;AAGA,SAAS,gCAAgC,EACvC,KACA,UACA,YAMC;CACD,MAAM,WAAW,yBAAyB;CAC1C,MAAM,aAAa,2BAA2B;CAC9C,OACE,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,OAAD;EACE,IAAI;EACJ,WAAW,GACT,uDACA,WAAW,YAAY,iBACzB;EAEC,UAAA,OAAO,QAAQ,KAAK,SAAS,QAAQ,GAAG,SAAS,KAAK,QAAQ,eAAe,EAC5E,QAAQ,SAAS,OACnB,CAAC;CACE,CAAA,GAMJ,WAAW,eAAe,WACzB,oBAAC,OAAD;EACE,yBAAsB;EACtB,WAAU;EAEV,UAAA,oBAAC,OAAD;GAAK,WAAU;GACZ,UAAA,SAAS,KAAK,YACb,oBAAC,oBAAD;IAEW;IACT,WAAU;GACX,GAHM,QAAQ,WAAW,GAGzB,CACF;EACE,CAAA;CACF,CAAA,IAEL,oBAAC,YAAD;EAAY,WAAU;EACpB,UAAA,oBAAC,OAAD;GAAK,WAAU;GACZ,UAAA,SAAS,KAAK,YACb,oBAAC,oBAAD;IAEW;IACT,WAAU;GACX,GAHM,QAAQ,WAAW,GAGzB,CACF;EACE,CAAA;CACK,CAAA,CAEd,EAAA,CAAA;AAEN"}
@@ -7,9 +7,9 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../
7
7
  import { toZoned } from "./event-calendar-lib.js";
8
8
  import { useEventCalendarNavigation, useEventCalendarSettings, useEventCalendarView, useEventCalendarViewConfig } from "./event-calendar.js";
9
9
  import { useState } from "react";
10
- import { cn } from "@kumix/utils";
11
- import { CalendarIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
10
+ import { cn } from "cn";
12
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
+ import { CalendarIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
13
13
  import { mergeProps } from "@base-ui/react/merge-props";
14
14
  import { useRender } from "@base-ui/react/use-render";
15
15
  import { addDays, format } from "date-fns";