@zealakit/chrono-react 0.0.0-stage → 1.0.0-beta.1

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 (355) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +624 -2
  3. package/dist/calendar/components.d.ts +346 -0
  4. package/dist/calendar/components.js +245 -0
  5. package/dist/calendar/context.d.ts +636 -0
  6. package/dist/calendar/context.js +21 -0
  7. package/dist/calendar/index.d.ts +6 -0
  8. package/dist/calendar/index.js +6 -0
  9. package/dist/calendar/mini-calendar.d.ts +60 -0
  10. package/dist/calendar/mini-calendar.js +50 -0
  11. package/dist/calendar/options.d.ts +4 -0
  12. package/dist/calendar/options.js +98 -0
  13. package/dist/calendar/use-calendar.d.ts +340 -0
  14. package/dist/calendar/use-calendar.js +156 -0
  15. package/dist/calendar/use-mini-calendar.d.ts +302 -0
  16. package/dist/calendar/use-mini-calendar.js +56 -0
  17. package/dist/calendar/utilities.d.ts +9 -0
  18. package/dist/calendar/utilities.js +8 -0
  19. package/dist/date/bind-panel.d.ts +30 -0
  20. package/dist/date/bind-panel.js +125 -0
  21. package/dist/date/components.d.ts +197 -0
  22. package/dist/date/components.js +202 -0
  23. package/dist/date/context.d.ts +34 -0
  24. package/dist/date/context.js +19 -0
  25. package/dist/date/index.d.ts +4 -0
  26. package/dist/date/index.js +4 -0
  27. package/dist/date/options.d.ts +7 -0
  28. package/dist/date/options.js +91 -0
  29. package/dist/date/use-date-input.d.ts +43 -0
  30. package/dist/date/use-date-input.js +138 -0
  31. package/dist/date/use-date-panel.d.ts +81 -0
  32. package/dist/date/use-date-panel.js +21 -0
  33. package/dist/date/utilities.d.ts +4 -0
  34. package/dist/date/utilities.js +4 -0
  35. package/dist/datetime/components.d.ts +121 -0
  36. package/dist/datetime/components.js +169 -0
  37. package/dist/datetime/context.d.ts +8 -0
  38. package/dist/datetime/context.js +18 -0
  39. package/dist/datetime/index.d.ts +4 -0
  40. package/dist/datetime/index.js +4 -0
  41. package/dist/datetime/options.d.ts +5 -0
  42. package/dist/datetime/options.js +99 -0
  43. package/dist/datetime/use-datetime-input.d.ts +44 -0
  44. package/dist/datetime/use-datetime-input.js +145 -0
  45. package/dist/datetime/use-datetime-panel.d.ts +128 -0
  46. package/dist/datetime/use-datetime-panel.js +60 -0
  47. package/dist/datetime/utilities.d.ts +4 -0
  48. package/dist/datetime/utilities.js +4 -0
  49. package/dist/index.d.ts +4 -0
  50. package/dist/index.js +4 -0
  51. package/dist/shared/merge-props.d.ts +9 -0
  52. package/dist/shared/merge-props.js +33 -0
  53. package/dist/shared/modifiers.d.ts +7 -0
  54. package/dist/shared/modifiers.js +6 -0
  55. package/dist/shared/part.d.ts +10 -0
  56. package/dist/shared/part.js +9 -0
  57. package/dist/shared/slot.d.ts +12 -0
  58. package/dist/shared/slot.js +60 -0
  59. package/dist/shared/style-properties.d.ts +8 -0
  60. package/dist/shared/style-properties.js +13 -0
  61. package/dist/shared/to-react-props.d.ts +11 -0
  62. package/dist/shared/to-react-props.js +27 -0
  63. package/dist/time/bind-panel.d.ts +19 -0
  64. package/dist/time/bind-panel.js +97 -0
  65. package/dist/time/components.d.ts +183 -0
  66. package/dist/time/components.js +174 -0
  67. package/dist/time/context.d.ts +24 -0
  68. package/dist/time/context.js +19 -0
  69. package/dist/time/index.d.ts +4 -0
  70. package/dist/time/index.js +4 -0
  71. package/dist/time/options.d.ts +5 -0
  72. package/dist/time/options.js +85 -0
  73. package/dist/time/use-time-input.d.ts +43 -0
  74. package/dist/time/use-time-input.js +138 -0
  75. package/dist/time/use-time-panel.d.ts +37 -0
  76. package/dist/time/use-time-panel.js +18 -0
  77. package/dist/time/utilities.d.ts +4 -0
  78. package/dist/time/utilities.js +4 -0
  79. package/dist/vendor/core/calendar/availability.d.ts +39 -0
  80. package/dist/vendor/core/calendar/availability.js +74 -0
  81. package/dist/vendor/core/calendar/controllers/calendar-controller.d.ts +251 -0
  82. package/dist/vendor/core/calendar/controllers/calendar-controller.js +1448 -0
  83. package/dist/vendor/core/calendar/controllers/drag-engine.d.ts +99 -0
  84. package/dist/vendor/core/calendar/controllers/drag-engine.js +382 -0
  85. package/dist/vendor/core/calendar/controllers/mini-calendar-controller.d.ts +66 -0
  86. package/dist/vendor/core/calendar/controllers/mini-calendar-controller.js +170 -0
  87. package/dist/vendor/core/calendar/controllers/shared.d.ts +29 -0
  88. package/dist/vendor/core/calendar/controllers/shared.js +82 -0
  89. package/dist/vendor/core/calendar/events/agenda-layout.d.ts +21 -0
  90. package/dist/vendor/core/calendar/events/agenda-layout.js +71 -0
  91. package/dist/vendor/core/calendar/events/all-day-row.d.ts +22 -0
  92. package/dist/vendor/core/calendar/events/all-day-row.js +93 -0
  93. package/dist/vendor/core/calendar/events/background-layout.d.ts +66 -0
  94. package/dist/vendor/core/calendar/events/background-layout.js +107 -0
  95. package/dist/vendor/core/calendar/events/index.d.ts +17 -0
  96. package/dist/vendor/core/calendar/events/index.js +8 -0
  97. package/dist/vendor/core/calendar/events/month-layout.d.ts +13 -0
  98. package/dist/vendor/core/calendar/events/month-layout.js +156 -0
  99. package/dist/vendor/core/calendar/events/normalize.d.ts +33 -0
  100. package/dist/vendor/core/calendar/events/normalize.js +159 -0
  101. package/dist/vendor/core/calendar/events/now-indicator.d.ts +18 -0
  102. package/dist/vendor/core/calendar/events/now-indicator.js +19 -0
  103. package/dist/vendor/core/calendar/events/overflow.d.ts +36 -0
  104. package/dist/vendor/core/calendar/events/overflow.js +112 -0
  105. package/dist/vendor/core/calendar/events/sort.d.ts +21 -0
  106. package/dist/vendor/core/calendar/events/sort.js +35 -0
  107. package/dist/vendor/core/calendar/events/time-grid-layout.d.ts +22 -0
  108. package/dist/vendor/core/calendar/events/time-grid-layout.js +184 -0
  109. package/dist/vendor/core/calendar/events/types.d.ts +141 -0
  110. package/dist/vendor/core/calendar/events/types.js +1 -0
  111. package/dist/vendor/core/calendar/index.d.ts +70 -0
  112. package/dist/vendor/core/calendar/index.js +37 -0
  113. package/dist/vendor/core/calendar/interaction/auto-scroll.d.ts +19 -0
  114. package/dist/vendor/core/calendar/interaction/auto-scroll.js +64 -0
  115. package/dist/vendor/core/calendar/interaction/drag-geometry.d.ts +52 -0
  116. package/dist/vendor/core/calendar/interaction/drag-geometry.js +125 -0
  117. package/dist/vendor/core/calendar/interaction/drag-keyboard.d.ts +38 -0
  118. package/dist/vendor/core/calendar/interaction/drag-keyboard.js +56 -0
  119. package/dist/vendor/core/calendar/interaction/drag-pointer.d.ts +23 -0
  120. package/dist/vendor/core/calendar/interaction/drag-pointer.js +203 -0
  121. package/dist/vendor/core/calendar/interaction/event-focus.d.ts +28 -0
  122. package/dist/vendor/core/calendar/interaction/event-focus.js +44 -0
  123. package/dist/vendor/core/calendar/interaction/hit-test.d.ts +17 -0
  124. package/dist/vendor/core/calendar/interaction/hit-test.js +26 -0
  125. package/dist/vendor/core/calendar/interaction/pending.d.ts +17 -0
  126. package/dist/vendor/core/calendar/interaction/pending.js +17 -0
  127. package/dist/vendor/core/calendar/interaction/pointer.d.ts +21 -0
  128. package/dist/vendor/core/calendar/interaction/pointer.js +119 -0
  129. package/dist/vendor/core/calendar/interaction/selection.d.ts +29 -0
  130. package/dist/vendor/core/calendar/interaction/selection.js +47 -0
  131. package/dist/vendor/core/calendar/internal/equal.d.ts +3 -0
  132. package/dist/vendor/core/calendar/internal/equal.js +43 -0
  133. package/dist/vendor/core/calendar/navigation/navigate.d.ts +33 -0
  134. package/dist/vendor/core/calendar/navigation/navigate.js +83 -0
  135. package/dist/vendor/core/calendar/navigation/range.d.ts +15 -0
  136. package/dist/vendor/core/calendar/navigation/range.js +52 -0
  137. package/dist/vendor/core/calendar/navigation/title.d.ts +12 -0
  138. package/dist/vendor/core/calendar/navigation/title.js +39 -0
  139. package/dist/vendor/core/calendar/navigation/view-definition.d.ts +39 -0
  140. package/dist/vendor/core/calendar/navigation/view-definition.js +61 -0
  141. package/dist/vendor/core/calendar/navigation/zoom.d.ts +5 -0
  142. package/dist/vendor/core/calendar/navigation/zoom.js +11 -0
  143. package/dist/vendor/core/calendar/recurrence/apply.d.ts +50 -0
  144. package/dist/vendor/core/calendar/recurrence/apply.js +207 -0
  145. package/dist/vendor/core/calendar/recurrence/expand.d.ts +27 -0
  146. package/dist/vendor/core/calendar/recurrence/expand.js +302 -0
  147. package/dist/vendor/core/calendar/recurrence/pack.d.ts +3 -0
  148. package/dist/vendor/core/calendar/recurrence/pack.js +251 -0
  149. package/dist/vendor/core/calendar/recurrence/rrule-types.d.ts +30 -0
  150. package/dist/vendor/core/calendar/recurrence/rrule-types.js +8 -0
  151. package/dist/vendor/core/calendar/recurrence/rrule.d.ts +12 -0
  152. package/dist/vendor/core/calendar/recurrence/rrule.js +288 -0
  153. package/dist/vendor/core/calendar/recurrence/series.d.ts +25 -0
  154. package/dist/vendor/core/calendar/recurrence/series.js +165 -0
  155. package/dist/vendor/core/calendar/recurrence/types.d.ts +30 -0
  156. package/dist/vendor/core/calendar/recurrence/types.js +1 -0
  157. package/dist/vendor/core/calendar/resources/keys.d.ts +2 -0
  158. package/dist/vendor/core/calendar/resources/keys.js +2 -0
  159. package/dist/vendor/core/calendar/resources/resource-time-grid.d.ts +7 -0
  160. package/dist/vendor/core/calendar/resources/resource-time-grid.js +130 -0
  161. package/dist/vendor/core/calendar/resources/timeline-axis.d.ts +10 -0
  162. package/dist/vendor/core/calendar/resources/timeline-axis.js +98 -0
  163. package/dist/vendor/core/calendar/resources/timeline-layout.d.ts +7 -0
  164. package/dist/vendor/core/calendar/resources/timeline-layout.js +111 -0
  165. package/dist/vendor/core/calendar/resources/tree.d.ts +10 -0
  166. package/dist/vendor/core/calendar/resources/tree.js +86 -0
  167. package/dist/vendor/core/calendar/resources/types.d.ts +177 -0
  168. package/dist/vendor/core/calendar/resources/types.js +1 -0
  169. package/dist/vendor/core/calendar/resources/views.d.ts +7 -0
  170. package/dist/vendor/core/calendar/resources/views.js +45 -0
  171. package/dist/vendor/core/calendar/resources/windowing.d.ts +11 -0
  172. package/dist/vendor/core/calendar/resources/windowing.js +17 -0
  173. package/dist/vendor/core/calendar/views/day.d.ts +37 -0
  174. package/dist/vendor/core/calendar/views/day.js +39 -0
  175. package/dist/vendor/core/calendar/views/list-layout.d.ts +8 -0
  176. package/dist/vendor/core/calendar/views/list-layout.js +5 -0
  177. package/dist/vendor/core/calendar/views/mini-calendar.d.ts +23 -0
  178. package/dist/vendor/core/calendar/views/mini-calendar.js +31 -0
  179. package/dist/vendor/core/calendar/views/month-layout.d.ts +30 -0
  180. package/dist/vendor/core/calendar/views/month-layout.js +63 -0
  181. package/dist/vendor/core/calendar/views/time-grid-layout.d.ts +26 -0
  182. package/dist/vendor/core/calendar/views/time-grid-layout.js +30 -0
  183. package/dist/vendor/core/date/index.d.ts +9 -0
  184. package/dist/vendor/core/date/index.js +9 -0
  185. package/dist/vendor/core/date/input/date-input-controller.d.ts +97 -0
  186. package/dist/vendor/core/date/input/date-input-controller.js +478 -0
  187. package/dist/vendor/core/date/input/date-range-input-controller.d.ts +43 -0
  188. package/dist/vendor/core/date/input/date-range-input-controller.js +189 -0
  189. package/dist/vendor/core/date/input/parse.d.ts +22 -0
  190. package/dist/vendor/core/date/input/parse.js +84 -0
  191. package/dist/vendor/core/date/input/validity.d.ts +6 -0
  192. package/dist/vendor/core/date/input/validity.js +13 -0
  193. package/dist/vendor/core/date/panel/panel-controller.d.ts +176 -0
  194. package/dist/vendor/core/date/panel/panel-controller.js +726 -0
  195. package/dist/vendor/core/date/presets.d.ts +22 -0
  196. package/dist/vendor/core/date/presets.js +104 -0
  197. package/dist/vendor/core/date/selection/multiple.d.ts +7 -0
  198. package/dist/vendor/core/date/selection/multiple.js +32 -0
  199. package/dist/vendor/core/date/selection/range.d.ts +29 -0
  200. package/dist/vendor/core/date/selection/range.js +39 -0
  201. package/dist/vendor/core/date/types.d.ts +12 -0
  202. package/dist/vendor/core/date/types.js +1 -0
  203. package/dist/vendor/core/datetime/compose.d.ts +24 -0
  204. package/dist/vendor/core/datetime/compose.js +49 -0
  205. package/dist/vendor/core/datetime/constraints.d.ts +42 -0
  206. package/dist/vendor/core/datetime/constraints.js +56 -0
  207. package/dist/vendor/core/datetime/index.d.ts +9 -0
  208. package/dist/vendor/core/datetime/index.js +9 -0
  209. package/dist/vendor/core/datetime/input/datetime-input-controller.d.ts +96 -0
  210. package/dist/vendor/core/datetime/input/datetime-input-controller.js +395 -0
  211. package/dist/vendor/core/datetime/input/datetime-range-input-controller.d.ts +46 -0
  212. package/dist/vendor/core/datetime/input/datetime-range-input-controller.js +182 -0
  213. package/dist/vendor/core/datetime/input/parse.d.ts +20 -0
  214. package/dist/vendor/core/datetime/input/parse.js +59 -0
  215. package/dist/vendor/core/datetime/panel/controller.d.ts +64 -0
  216. package/dist/vendor/core/datetime/panel/controller.js +197 -0
  217. package/dist/vendor/core/datetime/panel/range-controller.d.ts +71 -0
  218. package/dist/vendor/core/datetime/panel/range-controller.js +217 -0
  219. package/dist/vendor/core/datetime/types.d.ts +12 -0
  220. package/dist/vendor/core/datetime/types.js +1 -0
  221. package/dist/vendor/core/datetime/zone/day-instants.d.ts +19 -0
  222. package/dist/vendor/core/datetime/zone/day-instants.js +54 -0
  223. package/dist/vendor/core/datetime/zone/resolve.d.ts +16 -0
  224. package/dist/vendor/core/datetime/zone/resolve.js +26 -0
  225. package/dist/vendor/core/foundation/a11y/announcer.d.ts +7 -0
  226. package/dist/vendor/core/foundation/a11y/announcer.js +36 -0
  227. package/dist/vendor/core/foundation/a11y/grid-navigation.d.ts +19 -0
  228. package/dist/vendor/core/foundation/a11y/grid-navigation.js +86 -0
  229. package/dist/vendor/core/foundation/a11y/index.d.ts +8 -0
  230. package/dist/vendor/core/foundation/a11y/index.js +5 -0
  231. package/dist/vendor/core/foundation/a11y/labels.d.ts +21 -0
  232. package/dist/vendor/core/foundation/a11y/labels.js +43 -0
  233. package/dist/vendor/core/foundation/a11y/messages.d.ts +80 -0
  234. package/dist/vendor/core/foundation/a11y/messages.js +74 -0
  235. package/dist/vendor/core/foundation/a11y/roving-focus.d.ts +18 -0
  236. package/dist/vendor/core/foundation/a11y/roving-focus.js +52 -0
  237. package/dist/vendor/core/foundation/constraints/availability-rules.d.ts +52 -0
  238. package/dist/vendor/core/foundation/constraints/availability-rules.js +66 -0
  239. package/dist/vendor/core/foundation/constraints/availability.d.ts +93 -0
  240. package/dist/vendor/core/foundation/constraints/availability.js +490 -0
  241. package/dist/vendor/core/foundation/constraints/date.d.ts +21 -0
  242. package/dist/vendor/core/foundation/constraints/date.js +41 -0
  243. package/dist/vendor/core/foundation/constraints/index.d.ts +9 -0
  244. package/dist/vendor/core/foundation/constraints/index.js +4 -0
  245. package/dist/vendor/core/foundation/constraints/range.d.ts +44 -0
  246. package/dist/vendor/core/foundation/constraints/range.js +70 -0
  247. package/dist/vendor/core/foundation/constraints/time.d.ts +30 -0
  248. package/dist/vendor/core/foundation/constraints/time.js +56 -0
  249. package/dist/vendor/core/foundation/grid/index.d.ts +8 -0
  250. package/dist/vendor/core/foundation/grid/index.js +4 -0
  251. package/dist/vendor/core/foundation/grid/month-grid.d.ts +33 -0
  252. package/dist/vendor/core/foundation/grid/month-grid.js +52 -0
  253. package/dist/vendor/core/foundation/grid/time-axis.d.ts +25 -0
  254. package/dist/vendor/core/foundation/grid/time-axis.js +32 -0
  255. package/dist/vendor/core/foundation/grid/weekday-headers.d.ts +17 -0
  256. package/dist/vendor/core/foundation/grid/weekday-headers.js +26 -0
  257. package/dist/vendor/core/foundation/grid/year-grid.d.ts +29 -0
  258. package/dist/vendor/core/foundation/grid/year-grid.js +40 -0
  259. package/dist/vendor/core/foundation/index.d.ts +8 -0
  260. package/dist/vendor/core/foundation/index.js +8 -0
  261. package/dist/vendor/core/foundation/input/form.d.ts +7 -0
  262. package/dist/vendor/core/foundation/input/form.js +10 -0
  263. package/dist/vendor/core/foundation/input/index.d.ts +6 -0
  264. package/dist/vendor/core/foundation/input/index.js +3 -0
  265. package/dist/vendor/core/foundation/input/segment-engine.d.ts +33 -0
  266. package/dist/vendor/core/foundation/input/segment-engine.js +49 -0
  267. package/dist/vendor/core/foundation/input/tokenize.d.ts +19 -0
  268. package/dist/vendor/core/foundation/input/tokenize.js +24 -0
  269. package/dist/vendor/core/foundation/locale/digits.d.ts +6 -0
  270. package/dist/vendor/core/foundation/locale/digits.js +35 -0
  271. package/dist/vendor/core/foundation/locale/direction.d.ts +1 -0
  272. package/dist/vendor/core/foundation/locale/direction.js +37 -0
  273. package/dist/vendor/core/foundation/locale/format.d.ts +31 -0
  274. package/dist/vendor/core/foundation/locale/format.js +79 -0
  275. package/dist/vendor/core/foundation/locale/hour-cycle.d.ts +12 -0
  276. package/dist/vendor/core/foundation/locale/hour-cycle.js +45 -0
  277. package/dist/vendor/core/foundation/locale/index.d.ts +10 -0
  278. package/dist/vendor/core/foundation/locale/index.js +8 -0
  279. package/dist/vendor/core/foundation/locale/names.d.ts +6 -0
  280. package/dist/vendor/core/foundation/locale/names.js +30 -0
  281. package/dist/vendor/core/foundation/locale/resolve.d.ts +7 -0
  282. package/dist/vendor/core/foundation/locale/resolve.js +29 -0
  283. package/dist/vendor/core/foundation/locale/week-info.d.ts +5 -0
  284. package/dist/vendor/core/foundation/locale/week-info.js +61 -0
  285. package/dist/vendor/core/foundation/locale/zone-label.d.ts +6 -0
  286. package/dist/vendor/core/foundation/locale/zone-label.js +24 -0
  287. package/dist/vendor/core/foundation/ranges/date-range.d.ts +18 -0
  288. package/dist/vendor/core/foundation/ranges/date-range.js +40 -0
  289. package/dist/vendor/core/foundation/ranges/index.d.ts +4 -0
  290. package/dist/vendor/core/foundation/ranges/index.js +2 -0
  291. package/dist/vendor/core/foundation/ranges/interval.d.ts +24 -0
  292. package/dist/vendor/core/foundation/ranges/interval.js +56 -0
  293. package/dist/vendor/core/foundation/store/attributes.d.ts +19 -0
  294. package/dist/vendor/core/foundation/store/attributes.js +43 -0
  295. package/dist/vendor/core/foundation/store/controllable.d.ts +19 -0
  296. package/dist/vendor/core/foundation/store/controllable.js +50 -0
  297. package/dist/vendor/core/foundation/store/env.d.ts +1 -0
  298. package/dist/vendor/core/foundation/store/env.js +3 -0
  299. package/dist/vendor/core/foundation/store/global-state.d.ts +1 -0
  300. package/dist/vendor/core/foundation/store/global-state.js +21 -0
  301. package/dist/vendor/core/foundation/store/ids.d.ts +2 -0
  302. package/dist/vendor/core/foundation/store/ids.js +7 -0
  303. package/dist/vendor/core/foundation/store/index.d.ts +11 -0
  304. package/dist/vendor/core/foundation/store/index.js +7 -0
  305. package/dist/vendor/core/foundation/store/store.d.ts +7 -0
  306. package/dist/vendor/core/foundation/store/store.js +25 -0
  307. package/dist/vendor/core/foundation/store/ticker.d.ts +11 -0
  308. package/dist/vendor/core/foundation/store/ticker.js +27 -0
  309. package/dist/vendor/core/foundation/values/clock.d.ts +4 -0
  310. package/dist/vendor/core/foundation/values/clock.js +21 -0
  311. package/dist/vendor/core/foundation/values/compare.d.ts +16 -0
  312. package/dist/vendor/core/foundation/values/compare.js +70 -0
  313. package/dist/vendor/core/foundation/values/convert.d.ts +31 -0
  314. package/dist/vendor/core/foundation/values/convert.js +112 -0
  315. package/dist/vendor/core/foundation/values/epoch-day.d.ts +15 -0
  316. package/dist/vendor/core/foundation/values/epoch-day.js +47 -0
  317. package/dist/vendor/core/foundation/values/index.d.ts +14 -0
  318. package/dist/vendor/core/foundation/values/index.js +10 -0
  319. package/dist/vendor/core/foundation/values/iso.d.ts +24 -0
  320. package/dist/vendor/core/foundation/values/iso.js +113 -0
  321. package/dist/vendor/core/foundation/values/plain-date-time.d.ts +8 -0
  322. package/dist/vendor/core/foundation/values/plain-date-time.js +25 -0
  323. package/dist/vendor/core/foundation/values/plain-date.d.ts +33 -0
  324. package/dist/vendor/core/foundation/values/plain-date.js +105 -0
  325. package/dist/vendor/core/foundation/values/plain-time.d.ts +15 -0
  326. package/dist/vendor/core/foundation/values/plain-time.js +45 -0
  327. package/dist/vendor/core/foundation/values/types.d.ts +37 -0
  328. package/dist/vendor/core/foundation/values/types.js +1 -0
  329. package/dist/vendor/core/foundation/values/week.d.ts +9 -0
  330. package/dist/vendor/core/foundation/values/week.js +31 -0
  331. package/dist/vendor/core/foundation/values/year-month.d.ts +10 -0
  332. package/dist/vendor/core/foundation/values/year-month.js +19 -0
  333. package/dist/vendor/core/foundation/values/zoned.d.ts +16 -0
  334. package/dist/vendor/core/foundation/values/zoned.js +155 -0
  335. package/dist/vendor/core/index.d.ts +5 -0
  336. package/dist/vendor/core/index.js +5 -0
  337. package/dist/vendor/core/time/index.d.ts +8 -0
  338. package/dist/vendor/core/time/index.js +8 -0
  339. package/dist/vendor/core/time/input/parse.d.ts +19 -0
  340. package/dist/vendor/core/time/input/parse.js +84 -0
  341. package/dist/vendor/core/time/input/time-input-controller.d.ts +102 -0
  342. package/dist/vendor/core/time/input/time-input-controller.js +562 -0
  343. package/dist/vendor/core/time/input/time-range-input-controller.d.ts +49 -0
  344. package/dist/vendor/core/time/input/time-range-input-controller.js +185 -0
  345. package/dist/vendor/core/time/input/validity.d.ts +7 -0
  346. package/dist/vendor/core/time/input/validity.js +16 -0
  347. package/dist/vendor/core/time/panel/time-panel-controller.d.ts +163 -0
  348. package/dist/vendor/core/time/panel/time-panel-controller.js +839 -0
  349. package/dist/vendor/core/time/selection/range.d.ts +25 -0
  350. package/dist/vendor/core/time/selection/range.js +35 -0
  351. package/dist/vendor/core/time/selection/slots.d.ts +46 -0
  352. package/dist/vendor/core/time/selection/slots.js +78 -0
  353. package/dist/vendor/core/time/types.d.ts +11 -0
  354. package/dist/vendor/core/time/types.js +1 -0
  355. package/package.json +90 -4
@@ -0,0 +1,346 @@
1
+ import type { AllDayRowSegment, ResourceColumn, ResourceGroupHeader, ResourcePieceLike, ResourceTimeGridLayout, TimelineLayout, TimelineHeaderCell, TimelineRow, TimelineSlot, CalendarDay, CalendarOptions, CalendarState } from "../vendor/core/calendar/index.js";
2
+ import type { TimeSlot, WeekdayHeader } from "../vendor/core/foundation/index.js";
3
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
4
+ import { type EventSegment } from "./use-calendar.js";
5
+ type PartProps<T extends keyof React.JSX.IntrinsicElements> = Omit<ComponentPropsWithoutRef<T>, "children"> & {
6
+ asChild?: boolean;
7
+ };
8
+ export type CalendarProps = Omit<PartProps<"div">, keyof CalendarOptions> & CalendarOptions & {
9
+ children?: ReactNode;
10
+ };
11
+ /** Creates the calendar. Props are the calendar options plus any `div` props. */
12
+ export declare const Calendar: import("react").ForwardRefExoticComponent<Omit<PartProps<"div">, keyof CalendarOptions> & CalendarOptions & {
13
+ children?: ReactNode;
14
+ } & import("react").RefAttributes<HTMLElement>>;
15
+ export type CalendarTitleProps = PartProps<"h2"> & {
16
+ children?: ReactNode | ((title: CalendarState["title"]) => ReactNode);
17
+ };
18
+ export declare const CalendarTitle: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref">, "children"> & {
19
+ asChild?: boolean;
20
+ } & {
21
+ children?: ReactNode | ((title: CalendarState["title"]) => ReactNode);
22
+ } & import("react").RefAttributes<HTMLHeadingElement>>;
23
+ type ButtonProps = PartProps<"button"> & {
24
+ children?: ReactNode;
25
+ };
26
+ export declare const CalendarPrevButton: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "children"> & {
27
+ asChild?: boolean;
28
+ } & {
29
+ children?: ReactNode;
30
+ } & import("react").RefAttributes<HTMLButtonElement>>;
31
+ export declare const CalendarNextButton: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "children"> & {
32
+ asChild?: boolean;
33
+ } & {
34
+ children?: ReactNode;
35
+ } & import("react").RefAttributes<HTMLButtonElement>>;
36
+ export declare const CalendarTodayButton: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "children"> & {
37
+ asChild?: boolean;
38
+ } & {
39
+ children?: ReactNode;
40
+ } & import("react").RefAttributes<HTMLButtonElement>>;
41
+ export type CalendarViewButtonProps = ButtonProps & {
42
+ view: string;
43
+ };
44
+ export declare const CalendarViewButton: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "children"> & {
45
+ asChild?: boolean;
46
+ } & {
47
+ children?: ReactNode;
48
+ } & {
49
+ view: string;
50
+ } & import("react").RefAttributes<HTMLButtonElement>>;
51
+ export type CalendarWeekdayHeaderProps = PartProps<"th"> & {
52
+ header: WeekdayHeader;
53
+ children?: ReactNode;
54
+ };
55
+ export declare const CalendarWeekdayHeader: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, "ref">, "children"> & {
56
+ asChild?: boolean;
57
+ } & {
58
+ header: WeekdayHeader;
59
+ children?: ReactNode;
60
+ } & import("react").RefAttributes<HTMLTableCellElement>>;
61
+ export type CalendarWeekNumberProps = PartProps<"th"> & {
62
+ weekNumber: number;
63
+ children?: ReactNode;
64
+ };
65
+ export declare const CalendarWeekNumber: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, "ref">, "children"> & {
66
+ asChild?: boolean;
67
+ } & {
68
+ weekNumber: number;
69
+ children?: ReactNode;
70
+ } & import("react").RefAttributes<HTMLTableCellElement>>;
71
+ export type CalendarCellProps = PartProps<"td"> & {
72
+ day: CalendarDay;
73
+ children?: ReactNode;
74
+ };
75
+ export declare const CalendarCell: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "ref">, "children"> & {
76
+ asChild?: boolean;
77
+ } & {
78
+ day: CalendarDay;
79
+ children?: ReactNode;
80
+ } & import("react").RefAttributes<HTMLTableCellElement>>;
81
+ export type CalendarMonthGridProps = PartProps<"table"> & {
82
+ /** Index of the month grid in a multi-month view. */
83
+ month?: number;
84
+ /** Content of each day cell. Defaults to the day number. */
85
+ children?: (day: CalendarDay) => ReactNode;
86
+ };
87
+ /** A month grid: weekday headers, optional week numbers and one cell per visible day. */
88
+ export declare const CalendarMonthGrid: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, "ref">, "children"> & {
89
+ asChild?: boolean;
90
+ } & {
91
+ /** Index of the month grid in a multi-month view. */
92
+ month?: number;
93
+ /** Content of each day cell. Defaults to the day number. */
94
+ children?: (day: CalendarDay) => ReactNode;
95
+ } & import("react").RefAttributes<HTMLTableElement>>;
96
+ export type CalendarTimeGridProps = PartProps<"div"> & {
97
+ children?: (grid: {
98
+ days: CalendarDay[];
99
+ slots: TimeSlot[];
100
+ }) => ReactNode;
101
+ };
102
+ export declare const CalendarTimeGrid: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
103
+ asChild?: boolean;
104
+ } & {
105
+ children?: (grid: {
106
+ days: CalendarDay[];
107
+ slots: TimeSlot[];
108
+ }) => ReactNode;
109
+ } & import("react").RefAttributes<HTMLDivElement>>;
110
+ export type CalendarTimeGridColumnHeaderProps = PartProps<"div"> & {
111
+ day: CalendarDay;
112
+ children?: ReactNode;
113
+ };
114
+ export declare const CalendarTimeGridColumnHeader: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
115
+ asChild?: boolean;
116
+ } & {
117
+ day: CalendarDay;
118
+ children?: ReactNode;
119
+ } & import("react").RefAttributes<HTMLDivElement>>;
120
+ export type CalendarTimeGridSlotProps = Omit<PartProps<"div">, "slot"> & {
121
+ slot: TimeSlot;
122
+ day: CalendarDay;
123
+ children?: ReactNode;
124
+ };
125
+ export declare const CalendarTimeGridSlot: import("react").ForwardRefExoticComponent<Omit<PartProps<"div">, "slot"> & {
126
+ slot: TimeSlot;
127
+ day: CalendarDay;
128
+ children?: ReactNode;
129
+ } & import("react").RefAttributes<HTMLDivElement>>;
130
+ export type CalendarAgendaProps = PartProps<"ul"> & {
131
+ children?: (days: CalendarDay[]) => ReactNode;
132
+ };
133
+ export declare const CalendarAgenda: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref">, "children"> & {
134
+ asChild?: boolean;
135
+ } & {
136
+ children?: (days: CalendarDay[]) => ReactNode;
137
+ } & import("react").RefAttributes<HTMLUListElement>>;
138
+ export type CalendarAgendaDayProps = PartProps<"li"> & {
139
+ day: CalendarDay;
140
+ children?: ReactNode;
141
+ };
142
+ export declare const CalendarAgendaDay: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref">, "children"> & {
143
+ asChild?: boolean;
144
+ } & {
145
+ day: CalendarDay;
146
+ children?: ReactNode;
147
+ } & import("react").RefAttributes<HTMLLIElement>>;
148
+ export type CalendarEventsProps = PartProps<"div"> & {
149
+ /** The cell whose events this list renders. */
150
+ day: CalendarDay;
151
+ /** Receives the segments hosted by `day`. */
152
+ children?: (segments: EventSegment[]) => ReactNode;
153
+ };
154
+ /** The event list of one cell (E11). Render `CalendarEvent`s from the segments. */
155
+ export declare const CalendarEvents: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
156
+ asChild?: boolean;
157
+ } & {
158
+ /** The cell whose events this list renders. */
159
+ day: CalendarDay;
160
+ /** Receives the segments hosted by `day`. */
161
+ children?: (segments: EventSegment[]) => ReactNode;
162
+ } & import("react").RefAttributes<HTMLElement>>;
163
+ export type CalendarEventProps = PartProps<"div"> & {
164
+ segment: EventSegment;
165
+ children?: ReactNode;
166
+ };
167
+ /** One event segment. `children` render the app's content (generic over `TEvent`). */
168
+ export declare const CalendarEvent: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
169
+ asChild?: boolean;
170
+ } & {
171
+ segment: EventSegment;
172
+ children?: ReactNode;
173
+ } & import("react").RefAttributes<HTMLElement>>;
174
+ export type CalendarEventResizeHandleProps = PartProps<"div"> & {
175
+ segment: EventSegment;
176
+ edge: "start" | "end";
177
+ children?: ReactNode;
178
+ };
179
+ /** A resize handle inside an event. Style and position it in your CSS; Chrono writes state only. */
180
+ export declare const CalendarEventResizeHandle: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
181
+ asChild?: boolean;
182
+ } & {
183
+ segment: EventSegment;
184
+ edge: "start" | "end";
185
+ children?: ReactNode;
186
+ } & import("react").RefAttributes<HTMLElement>>;
187
+ export type CalendarEventDragPreviewProps = PartProps<"div"> & {
188
+ /** The cell that hosts the preview pieces. */
189
+ day: CalendarDay;
190
+ /** Render the all-day row pieces of `day` instead of the grid or month pieces. */
191
+ allDay?: boolean;
192
+ /** Content of each preview piece. */
193
+ children?: ReactNode | ((piece: EventSegment) => ReactNode);
194
+ };
195
+ /** The drag preview of one cell: one element per preview piece, `aria-hidden`. */
196
+ export declare const CalendarEventDragPreview: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
197
+ asChild?: boolean;
198
+ } & {
199
+ /** The cell that hosts the preview pieces. */
200
+ day: CalendarDay;
201
+ /** Render the all-day row pieces of `day` instead of the grid or month pieces. */
202
+ allDay?: boolean;
203
+ /** Content of each preview piece. */
204
+ children?: ReactNode | ((piece: EventSegment) => ReactNode);
205
+ } & import("react").RefAttributes<HTMLElement>>;
206
+ type ResourcePartProps<K extends string, V> = PartProps<"div"> & {
207
+ children?: ReactNode;
208
+ } & {
209
+ [P in K]: V;
210
+ };
211
+ export type CalendarResourceHeaderProps = ResourcePartProps<"column", ResourceColumn>;
212
+ /** A resource time grid column header (a resource on a day). */
213
+ export declare const CalendarResourceHeader: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
214
+ asChild?: boolean;
215
+ } & {
216
+ children?: ReactNode;
217
+ } & {
218
+ column: ResourceColumn;
219
+ } & import("react").RefAttributes<HTMLElement>>;
220
+ export type CalendarResourceGroupHeaderProps = ResourcePartProps<"group", ResourceGroupHeader>;
221
+ /** A group header spanning the columns of the resources below it. */
222
+ export declare const CalendarResourceGroupHeader: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
223
+ asChild?: boolean;
224
+ } & {
225
+ children?: ReactNode;
226
+ } & {
227
+ group: ResourceGroupHeader;
228
+ } & import("react").RefAttributes<HTMLElement>>;
229
+ /** The timeline root: `grid`, or `treegrid` when resources are grouped. Renders only in a timeline view. */
230
+ export declare const CalendarTimeline: import("react").ForwardRefExoticComponent<Omit<PartProps<"div">, "children"> & {
231
+ asChild?: boolean;
232
+ children?: (layout: TimelineLayout) => ReactNode;
233
+ } & import("react").RefAttributes<HTMLElement>>;
234
+ /** The resource time grid root. Renders only in a resource day or week view. */
235
+ export declare const CalendarResourceGrid: import("react").ForwardRefExoticComponent<Omit<PartProps<"div">, "children"> & {
236
+ asChild?: boolean;
237
+ children?: (layout: ResourceTimeGridLayout) => ReactNode;
238
+ } & import("react").RefAttributes<HTMLElement>>;
239
+ export type CalendarTimelineHeaderCellProps = ResourcePartProps<"cell", TimelineHeaderCell>;
240
+ /** One cell of a timeline header row; `aria-colspan` is its slot span. */
241
+ export declare const CalendarTimelineHeaderCell: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
242
+ asChild?: boolean;
243
+ } & {
244
+ children?: ReactNode;
245
+ } & {
246
+ cell: TimelineHeaderCell;
247
+ } & import("react").RefAttributes<HTMLElement>>;
248
+ export type CalendarTimelineRowProps = ResourcePartProps<"row", TimelineRow>;
249
+ /** One resource or group row; carries `--chrono-row-lanes`. */
250
+ export declare const CalendarTimelineRow: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
251
+ asChild?: boolean;
252
+ } & {
253
+ children?: ReactNode;
254
+ } & {
255
+ row: TimelineRow;
256
+ } & import("react").RefAttributes<HTMLElement>>;
257
+ /** The row header; clicking a group header collapses or expands it. */
258
+ export declare const CalendarTimelineRowHeader: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
259
+ asChild?: boolean;
260
+ } & {
261
+ children?: ReactNode;
262
+ } & {
263
+ row: TimelineRow;
264
+ } & import("react").RefAttributes<HTMLElement>>;
265
+ export type CalendarTimelineCellProps = PartProps<"div"> & {
266
+ row: TimelineRow;
267
+ slot: TimelineSlot;
268
+ children?: ReactNode;
269
+ };
270
+ /** One slot of a row. */
271
+ export declare const CalendarTimelineCell: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
272
+ asChild?: boolean;
273
+ } & {
274
+ row: TimelineRow;
275
+ slot: TimelineSlot;
276
+ children?: ReactNode;
277
+ } & import("react").RefAttributes<HTMLElement>>;
278
+ export type CalendarResourceEventProps = PartProps<"div"> & {
279
+ /** A piece from `state.resources.pieces` (or `allDay`). */
280
+ piece: ResourcePieceLike<EventSegment["event"]>;
281
+ children?: ReactNode;
282
+ };
283
+ /** One event piece of a resource view, with positions as `--chrono-event-*` properties. */
284
+ export declare const CalendarResourceEvent: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
285
+ asChild?: boolean;
286
+ } & {
287
+ /** A piece from `state.resources.pieces` (or `allDay`). */
288
+ piece: ResourcePieceLike<EventSegment["event"]>;
289
+ children?: ReactNode;
290
+ } & import("react").RefAttributes<HTMLElement>>;
291
+ export type CalendarMoreButtonProps = PartProps<"button"> & {
292
+ day: CalendarDay;
293
+ children?: ReactNode;
294
+ };
295
+ /** The "+N more" control of an overflowing day (E22). Renders nothing without overflow. */
296
+ export declare const CalendarMoreButton: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "children"> & {
297
+ asChild?: boolean;
298
+ } & {
299
+ day: CalendarDay;
300
+ children?: ReactNode;
301
+ } & import("react").RefAttributes<HTMLButtonElement>>;
302
+ export type CalendarAllDayRowProps = PartProps<"div"> & {
303
+ children?: (row: {
304
+ days: CalendarDay[];
305
+ segments: AllDayRowSegment[];
306
+ }) => ReactNode;
307
+ };
308
+ /** The time-grid all-day row. Renders nothing outside time-grid views. */
309
+ export declare const CalendarAllDayRow: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
310
+ asChild?: boolean;
311
+ } & {
312
+ children?: (row: {
313
+ days: CalendarDay[];
314
+ segments: AllDayRowSegment[];
315
+ }) => ReactNode;
316
+ } & import("react").RefAttributes<HTMLElement>>;
317
+ /** The now-indicator line. Renders nothing when the indicator is out of view. */
318
+ export declare const CalendarNowIndicator: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
319
+ asChild?: boolean;
320
+ } & import("react").RefAttributes<HTMLElement>>;
321
+ export type CalendarSelectionPreviewProps = PartProps<"div"> & {
322
+ day: CalendarDay;
323
+ };
324
+ /** A selection preview piece for one covered day (rendered while selecting). */
325
+ export declare const CalendarSelectionPreview: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
326
+ asChild?: boolean;
327
+ } & {
328
+ day: CalendarDay;
329
+ } & import("react").RefAttributes<HTMLElement>>;
330
+ export type CalendarBackgroundPiece = import("../vendor/core/calendar/index.js").BackgroundPiece | import("../vendor/core/calendar/index.js").TimelineBackgroundPiece;
331
+ export type CalendarBackgroundProps = PartProps<"div"> & {
332
+ /** One entry from `state.backgrounds`. */
333
+ piece: CalendarBackgroundPiece;
334
+ /** The piece, so the app can print "Lunch" or "Holiday" (plan 11 V12). */
335
+ children?: ReactNode | ((piece: CalendarBackgroundPiece) => ReactNode);
336
+ };
337
+ /** One availability background piece (plan 11 V9). Render one per `state.backgrounds`. */
338
+ export declare const CalendarBackground: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
339
+ asChild?: boolean;
340
+ } & {
341
+ /** One entry from `state.backgrounds`. */
342
+ piece: CalendarBackgroundPiece;
343
+ /** The piece, so the app can print "Lunch" or "Holiday" (plan 11 V12). */
344
+ children?: ReactNode | ((piece: CalendarBackgroundPiece) => ReactNode);
345
+ } & import("react").RefAttributes<HTMLElement>>;
346
+ export {};
@@ -0,0 +1,245 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { forwardRef, useEffect, useRef, } from "react";
4
+ import { mergeProps } from "../shared/merge-props.js";
5
+ import { Part } from "../shared/part.js";
6
+ import { composeRefs } from "../shared/slot.js";
7
+ import { CalendarContext, useCalendarContext } from "./context.js";
8
+ import { splitCalendarProps } from "./options.js";
9
+ import { useCalendar } from "./use-calendar.js";
10
+ const withChrono = (consumer, chrono) => mergeProps(consumer, chrono);
11
+ /** Creates the calendar. Props are the calendar options plus any `div` props. */
12
+ export const Calendar = forwardRef(function Calendar({ children, asChild, ...props }, ref) {
13
+ const [options, rest] = splitCalendarProps(props);
14
+ const calendar = useCalendar({
15
+ ...options,
16
+ id: props.id,
17
+ });
18
+ const { ref: rootRef, ...rootProps } = calendar.getRootProps();
19
+ const { id: _id, ...elementProps } = rest;
20
+ return (_jsx(CalendarContext.Provider, { value: calendar, children: _jsx(Part, { as: "div", asChild: asChild, ref: composeRefs(ref, rootRef), ...withChrono(elementProps, rootProps), children: children }) }));
21
+ });
22
+ export const CalendarTitle = forwardRef(function CalendarTitle({ children, asChild, ...rest }, ref) {
23
+ const calendar = useCalendarContext("CalendarTitle");
24
+ const { title } = calendar.state;
25
+ return (_jsx(Part, { as: "h2", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getTitleProps()), children: typeof children === "function"
26
+ ? children(title)
27
+ : (children ?? title.text) }));
28
+ });
29
+ const NavButton = forwardRef(function NavButton({ kind, part, children, asChild, ...rest }, ref) {
30
+ const calendar = useCalendarContext(part);
31
+ const props = calendar.getNavProps(kind);
32
+ return (_jsx(Part, { as: "button", asChild: asChild, ref: ref, ...withChrono(rest, props), children: children ?? props["aria-label"] }));
33
+ });
34
+ export const CalendarPrevButton = forwardRef(function CalendarPrevButton(props, ref) {
35
+ return (_jsx(NavButton, { ref: ref, kind: "prev", part: "CalendarPrevButton", ...props }));
36
+ });
37
+ export const CalendarNextButton = forwardRef(function CalendarNextButton(props, ref) {
38
+ return (_jsx(NavButton, { ref: ref, kind: "next", part: "CalendarNextButton", ...props }));
39
+ });
40
+ export const CalendarTodayButton = forwardRef(function CalendarTodayButton(props, ref) {
41
+ return (_jsx(NavButton, { ref: ref, kind: "today", part: "CalendarTodayButton", ...props }));
42
+ });
43
+ export const CalendarViewButton = forwardRef(function CalendarViewButton({ view, children, asChild, ...rest }, ref) {
44
+ const calendar = useCalendarContext("CalendarViewButton");
45
+ return (_jsx(Part, { as: "button", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getViewButtonProps(view)), children: children ?? view }));
46
+ });
47
+ export const CalendarWeekdayHeader = forwardRef(function CalendarWeekdayHeader({ header, children, asChild, ...rest }, ref) {
48
+ const calendar = useCalendarContext("CalendarWeekdayHeader");
49
+ return (_jsx(Part, { as: "th", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getColumnHeaderProps(header)), children: children ?? header.short }));
50
+ });
51
+ export const CalendarWeekNumber = forwardRef(function CalendarWeekNumber({ weekNumber, children, asChild, ...rest }, ref) {
52
+ const calendar = useCalendarContext("CalendarWeekNumber");
53
+ return (_jsx(Part, { as: "th", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getWeekNumberProps(weekNumber)), children: children ?? weekNumber }));
54
+ });
55
+ export const CalendarCell = forwardRef(function CalendarCell({ day, children, asChild, ...rest }, ref) {
56
+ const calendar = useCalendarContext("CalendarCell");
57
+ return (_jsx(Part, { as: "td", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getCellProps(day)), children: children ?? day.date.day }));
58
+ });
59
+ /** A month grid: weekday headers, optional week numbers and one cell per visible day. */
60
+ export const CalendarMonthGrid = forwardRef(function CalendarMonthGrid({ month = 0, children, asChild, ...rest }, ref) {
61
+ const calendar = useCalendarContext("CalendarMonthGrid");
62
+ const tableRef = useRef(null);
63
+ const { layout } = calendar.state;
64
+ // `eventLimit: "auto"` measures the first cell and first event, then sets the
65
+ // limit (plan 05 §3.1). Browser-only, after mount; SSR / no ResizeObserver
66
+ // keeps the controller's fallback (3).
67
+ useEffect(() => {
68
+ if (month !== 0)
69
+ return;
70
+ const controller = calendar.controller;
71
+ if (controller.getEventLimit() !== "auto")
72
+ return;
73
+ const table = tableRef.current;
74
+ if (!table || typeof ResizeObserver === "undefined")
75
+ return;
76
+ const measure = () => {
77
+ const cell = table.querySelector('td[role="gridcell"]');
78
+ const event = table.querySelector("[data-chrono-event]");
79
+ if (!cell || !event)
80
+ return;
81
+ const cellHeight = cell.clientHeight;
82
+ const eventHeight = event.offsetHeight;
83
+ if (cellHeight > 0 && eventHeight > 0) {
84
+ controller.setEventLimit(Math.max(1, Math.floor(cellHeight / eventHeight)));
85
+ }
86
+ };
87
+ measure();
88
+ const observer = new ResizeObserver(measure);
89
+ observer.observe(table);
90
+ return () => observer.disconnect();
91
+ }, [calendar, month]);
92
+ if (layout.kind !== "month")
93
+ return null;
94
+ const model = layout.months[month];
95
+ if (!model)
96
+ return null;
97
+ return (_jsxs(Part, { as: "table", asChild: asChild, ref: composeRefs(ref, tableRef), ...withChrono(rest, calendar.getGridProps(month)), children: [_jsx("thead", { children: _jsxs("tr", { children: [layout.weekNumbers ? _jsx("td", {}) : null, layout.weekdays.map((header) => (_jsx(CalendarWeekdayHeader, { header: header }, header.dayOfWeek)))] }) }), _jsx("tbody", { children: model.weeks.map((week) => (_jsxs("tr", { children: [layout.weekNumbers ? (_jsx(CalendarWeekNumber, { weekNumber: week.weekNumber })) : null, week.days
98
+ .filter((day) => !day.hidden)
99
+ .map((day) => (_jsx(CalendarCell, { day: day, children: children ? children(day) : undefined }, day.key)))] }, week.days[0]?.key))) })] }));
100
+ });
101
+ export const CalendarTimeGrid = forwardRef(function CalendarTimeGrid({ children, asChild, ...rest }, ref) {
102
+ const calendar = useCalendarContext("CalendarTimeGrid");
103
+ const { layout } = calendar.state;
104
+ if (layout.kind !== "time-grid")
105
+ return null;
106
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getTimeGridProps()), children: children?.({ days: layout.days, slots: layout.slots }) }));
107
+ });
108
+ export const CalendarTimeGridColumnHeader = forwardRef(function CalendarTimeGridColumnHeader({ day, children, asChild, ...rest }, ref) {
109
+ const calendar = useCalendarContext("CalendarTimeGridColumnHeader");
110
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getColumnHeaderProps(day)), children: children ?? day.date.day }));
111
+ });
112
+ export const CalendarTimeGridSlot = forwardRef(function CalendarTimeGridSlot({ slot, day, children, asChild, ...rest }, ref) {
113
+ const calendar = useCalendarContext("CalendarTimeGridSlot");
114
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getSlotProps(slot, day)), children: children }));
115
+ });
116
+ export const CalendarAgenda = forwardRef(function CalendarAgenda({ children, asChild, ...rest }, ref) {
117
+ const calendar = useCalendarContext("CalendarAgenda");
118
+ const { layout } = calendar.state;
119
+ if (layout.kind !== "list")
120
+ return null;
121
+ return (_jsx(Part, { as: "ul", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getAgendaProps()), children: children?.(layout.days) }));
122
+ });
123
+ export const CalendarAgendaDay = forwardRef(function CalendarAgendaDay({ day, children, asChild, ...rest }, ref) {
124
+ const calendar = useCalendarContext("CalendarAgendaDay");
125
+ return (_jsx(Part, { as: "li", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getAgendaDayProps(day)), children: children ?? day.key }));
126
+ });
127
+ /** The event list of one cell (E11). Render `CalendarEvent`s from the segments. */
128
+ export const CalendarEvents = forwardRef(function CalendarEvents({ day, children, asChild, ...rest }, ref) {
129
+ const calendar = useCalendarContext("CalendarEvents");
130
+ const segments = calendar.controller.getCellEventSegments(day);
131
+ const interacting = calendar.state.focus.mode === "interaction" &&
132
+ calendar.state.focus.cellKey === day.key;
133
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, {
134
+ role: "group",
135
+ "aria-label": calendar.state.messages.events,
136
+ "data-interacting": interacting ? "" : undefined,
137
+ }), children: children ? children(segments) : null }));
138
+ });
139
+ /** One event segment. `children` render the app's content (generic over `TEvent`). */
140
+ export const CalendarEvent = forwardRef(function CalendarEvent({ segment, children, asChild, ...rest }, ref) {
141
+ const calendar = useCalendarContext("CalendarEvent");
142
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getEventProps(segment)), children: children }));
143
+ });
144
+ /** A resize handle inside an event. Style and position it in your CSS; Chrono writes state only. */
145
+ export const CalendarEventResizeHandle = forwardRef(function CalendarEventResizeHandle({ segment, edge, children, asChild, ...rest }, ref) {
146
+ const calendar = useCalendarContext("CalendarEventResizeHandle");
147
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getResizeHandleProps(segment, edge)), children: children }));
148
+ });
149
+ /** The drag preview of one cell: one element per preview piece, `aria-hidden`. */
150
+ export const CalendarEventDragPreview = forwardRef(function CalendarEventDragPreview({ day, allDay, children, asChild, ...rest }, ref) {
151
+ const calendar = useCalendarContext("CalendarEventDragPreview");
152
+ const pieces = calendar.getDragPreviewPieces(day, allDay);
153
+ return (_jsx(_Fragment, { children: pieces.map((piece) => (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getDragPreviewProps(piece)), children: typeof children === "function" ? children(piece) : children }, piece.key))) }));
154
+ });
155
+ /** A resource time grid column header (a resource on a day). */
156
+ export const CalendarResourceHeader = forwardRef(function CalendarResourceHeader({ column, children, asChild, ...rest }, ref) {
157
+ const calendar = useCalendarContext("CalendarResourceHeader");
158
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getResourceHeaderProps(column)), children: children ?? column.label }));
159
+ });
160
+ /** A group header spanning the columns of the resources below it. */
161
+ export const CalendarResourceGroupHeader = forwardRef(function CalendarResourceGroupHeader({ group, children, asChild, ...rest }, ref) {
162
+ const calendar = useCalendarContext("CalendarResourceGroupHeader");
163
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getResourceGroupHeaderProps(group)), children: children ?? group.label }));
164
+ });
165
+ /** The timeline root: `grid`, or `treegrid` when resources are grouped. Renders only in a timeline view. */
166
+ export const CalendarTimeline = forwardRef(function CalendarTimeline({ children, asChild, ...rest }, ref) {
167
+ const calendar = useCalendarContext("CalendarTimeline");
168
+ const layout = calendar.state.resources;
169
+ if (layout?.kind !== "timeline")
170
+ return null;
171
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getTimelineProps()), children: children?.(layout) }));
172
+ });
173
+ /** The resource time grid root. Renders only in a resource day or week view. */
174
+ export const CalendarResourceGrid = forwardRef(function CalendarResourceGrid({ children, asChild, ...rest }, ref) {
175
+ const calendar = useCalendarContext("CalendarResourceGrid");
176
+ const layout = calendar.state.resources;
177
+ if (layout?.kind !== "resource-time-grid")
178
+ return null;
179
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, { role: "grid" }), children: children?.(layout) }));
180
+ });
181
+ /** One cell of a timeline header row; `aria-colspan` is its slot span. */
182
+ export const CalendarTimelineHeaderCell = forwardRef(function CalendarTimelineHeaderCell({ cell, children, asChild, ...rest }, ref) {
183
+ const calendar = useCalendarContext("CalendarTimelineHeaderCell");
184
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getTimelineHeaderCellProps(cell)), children: children ?? cell.label }));
185
+ });
186
+ /** One resource or group row; carries `--chrono-row-lanes`. */
187
+ export const CalendarTimelineRow = forwardRef(function CalendarTimelineRow({ row, children, asChild, ...rest }, ref) {
188
+ const calendar = useCalendarContext("CalendarTimelineRow");
189
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getTimelineRowProps(row)), children: children }));
190
+ });
191
+ /** The row header; clicking a group header collapses or expands it. */
192
+ export const CalendarTimelineRowHeader = forwardRef(function CalendarTimelineRowHeader({ row, children, asChild, ...rest }, ref) {
193
+ const calendar = useCalendarContext("CalendarTimelineRowHeader");
194
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getTimelineRowHeaderProps(row)), children: children ?? row.label }));
195
+ });
196
+ /** One slot of a row. */
197
+ export const CalendarTimelineCell = forwardRef(function CalendarTimelineCell({ row, slot, children, asChild, ...rest }, ref) {
198
+ const calendar = useCalendarContext("CalendarTimelineCell");
199
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getTimelineCellProps(row, slot)), children: children }));
200
+ });
201
+ /** One event piece of a resource view, with positions as `--chrono-event-*` properties. */
202
+ export const CalendarResourceEvent = forwardRef(function CalendarResourceEvent({ piece, children, asChild, ...rest }, ref) {
203
+ const calendar = useCalendarContext("CalendarResourceEvent");
204
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getResourcePieceProps(piece)), children: children }));
205
+ });
206
+ /** The "+N more" control of an overflowing day (E22). Renders nothing without overflow. */
207
+ export const CalendarMoreButton = forwardRef(function CalendarMoreButton({ day, children, asChild, ...rest }, ref) {
208
+ const calendar = useCalendarContext("CalendarMoreButton");
209
+ const overflow = calendar.state.more.find((m) => m.dayKey === day.key);
210
+ if (!overflow) {
211
+ return null;
212
+ }
213
+ return (_jsx(Part, { as: "button", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getMoreProps(day)), children: children ?? `+${overflow.count} more` }));
214
+ });
215
+ /** The time-grid all-day row. Renders nothing outside time-grid views. */
216
+ export const CalendarAllDayRow = forwardRef(function CalendarAllDayRow({ children, asChild, ...rest }, ref) {
217
+ const calendar = useCalendarContext("CalendarAllDayRow");
218
+ const { layout, allDayRow } = calendar.state;
219
+ if (layout.kind !== "time-grid") {
220
+ return null;
221
+ }
222
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, {}), children: children?.({ days: layout.days, segments: allDayRow }) }));
223
+ });
224
+ /** The now-indicator line. Renders nothing when the indicator is out of view. */
225
+ export const CalendarNowIndicator = forwardRef(function CalendarNowIndicator({ asChild, ...rest }, ref) {
226
+ const calendar = useCalendarContext("CalendarNowIndicator");
227
+ if (!calendar.state.nowIndicator) {
228
+ return null;
229
+ }
230
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getNowIndicatorProps()) }));
231
+ });
232
+ /** A selection preview piece for one covered day (rendered while selecting). */
233
+ export const CalendarSelectionPreview = forwardRef(function CalendarSelectionPreview({ day, asChild, ...rest }, ref) {
234
+ const calendar = useCalendarContext("CalendarSelectionPreview");
235
+ const props = calendar.getSelectionPreviewProps(day);
236
+ if (Object.keys(props).length === 0) {
237
+ return null;
238
+ }
239
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, props) }));
240
+ });
241
+ /** One availability background piece (plan 11 V9). Render one per `state.backgrounds`. */
242
+ export const CalendarBackground = forwardRef(function CalendarBackground({ piece, asChild, children, ...rest }, ref) {
243
+ const calendar = useCalendarContext("CalendarBackground");
244
+ return (_jsx(Part, { as: "div", asChild: asChild, ref: ref, ...withChrono(rest, calendar.getBackgroundProps(piece)), children: typeof children === "function" ? children(piece) : children }));
245
+ });