@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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zealakit
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,625 @@
1
- # Temporary Holding Version
1
+ # @zealakit/chrono-react
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [English](https://github.com/zealakit/chrono/blob/main/packages/react/README.md) | [Tiếng Việt](https://github.com/zealakit/chrono/blob/main/packages/react/README_VI.md) | [中文](https://github.com/zealakit/chrono/blob/main/packages/react/README_CN.md)
4
+
5
+ ![Zealakit Chrono cover](https://github.com/zealakit/chrono/blob/main/assets/images/chrono-cover.jpg?raw=true)
6
+
7
+ Headless Calendar components for React: month, week, work week, day, agenda, multi-month and custom views, navigation, and a Mini Calendar. You own visual styling.
8
+
9
+ Chrono ships no CSS and sets no visual styles. Parts render your own elements and classes; state is exposed as `data-*` and ARIA attributes, so your CSS owns every look.
10
+
11
+ Pre-1.0: the API may change between minor versions.
12
+
13
+ > **Note**
14
+ > Chrono is a focused, headless set of Calendar views and Date, Time and DateTime components. It ships no CSS and renders no styled markup, so you keep full control of the visuals. Release 0.8.0 adds recurring events as an opt-in pack. The new `/date` entry adds date inputs and panels; the `/time` entry adds time inputs and panels; the `/datetime` entry composes them.
15
+ >
16
+ > Chrono is not a full UI library or design system, and it ships no popup, overlay, or positioning code. Put its panels inside your own popup when you need one.
17
+
18
+ ## Install
19
+
20
+ ```bash
21
+ npm install @zealakit/chrono-react
22
+ ```
23
+
24
+ Peer dependencies: `react` `^18.0.0 || ^19.0.0`, `react-dom` `^18.0.0 || ^19.0.0`.
25
+
26
+ ## Calendar
27
+
28
+ ### Quick start
29
+
30
+ Create a calendar, then compose its parts. Every part is optional; render only what you need.
31
+
32
+ ```tsx
33
+ import {
34
+ Calendar,
35
+ CalendarMonthGrid,
36
+ CalendarNextButton,
37
+ CalendarPrevButton,
38
+ CalendarTitle,
39
+ } from "@zealakit/chrono-react";
40
+
41
+ export function Planner() {
42
+ return (
43
+ <Calendar locale="en-US" weekStartsOn={1}>
44
+ <CalendarPrevButton>Prev</CalendarPrevButton>
45
+ <CalendarTitle />
46
+ <CalendarNextButton>Next</CalendarNextButton>
47
+ <CalendarMonthGrid className="month" />
48
+ </Calendar>
49
+ );
50
+ }
51
+ ```
52
+
53
+ ### Import styles
54
+
55
+ Every domain is reachable from the root entry and from its own subpath. Both give the same bindings, so you can mix them freely.
56
+
57
+ ```ts
58
+ // Domain subpath
59
+ import { Calendar, CalendarMonthGrid } from "@zealakit/chrono-react/calendar";
60
+
61
+ // Root entry: re-exports every domain, same bindings
62
+ import { Calendar, getCalendarTitle } from "@zealakit/chrono-react";
63
+ ```
64
+
65
+ The root also re-exports the same utilities, so a Server Component or a server action can call them without loading any component code.
66
+
67
+ ### Parts
68
+
69
+ | Part | Renders | Purpose |
70
+ | --- | --- | --- |
71
+ | `Calendar` | `div` | Creates the calendar. Takes the options below. |
72
+ | `CalendarTitle` | `h2` | The title text. It is announced politely when it changes. |
73
+ | `CalendarPrevButton`, `CalendarNextButton`, `CalendarTodayButton` | `button` | Navigation. The previous and next buttons get `aria-disabled` at `min` and `max`. |
74
+ | `CalendarViewButton` | `button` | Switches to its `view`. `aria-pressed` marks the active one. |
75
+ | `CalendarMonthGrid` | `table` | Weekday headers, optional week numbers and one cell per day. `month` picks the grid of a multi-month view. |
76
+ | `CalendarWeekdayHeader`, `CalendarWeekNumber`, `CalendarCell` | `th`, `th`, `td` | The pieces of a month grid. Use them to build your own grid. |
77
+ | `CalendarTimeGrid` | `div` | Day columns and time slots, with no events yet. |
78
+ | `CalendarTimeGridColumnHeader` | `div` | The focusable day header of a time grid. |
79
+ | `CalendarTimeGridSlot` | `div` | One slot of one day. It is not focusable yet. |
80
+ | `CalendarAgenda`, `CalendarAgendaDay` | `ul`, `li` | The agenda list and its days. |
81
+ | `MiniCalendar` | `div` | A month calendar, optionally synced with the main one. |
82
+ | `MiniCalendarTitle`, `MiniCalendarPrevButton`, `MiniCalendarNextButton` | `h2`, `button`, `button` | Title and paging of the Mini Calendar. |
83
+ | `MiniCalendarGrid`, `MiniCalendarWeekdayHeader`, `MiniCalendarCell` | `table`, `th`, `td` | The Mini Calendar grid and its pieces. |
84
+
85
+ ### Calendar options
86
+
87
+ | Option | Type | Default | Description |
88
+ | --- | --- | --- | --- |
89
+ | `view` | `string` | — | Controlled view id: `month`, `week`, `workWeek`, `day`, `agenda`, `multiMonth` or a custom one. |
90
+ | `defaultView` | `string` | `"month"` | Initial view when uncontrolled. |
91
+ | `date` | `DateInput` | — | Controlled date the range is built around. |
92
+ | `defaultDate` | `DateInput` | today | Initial date when uncontrolled. |
93
+ | `onViewChange` | `(view) => void` | — | The view changed. |
94
+ | `onDateChange` | `(date) => void` | — | The date the range is built around changed. |
95
+ | `onVisibleRangeChange` | `(range, { view }) => void` | — | Fires once after mount and whenever the visible range changes. Load events for this range. |
96
+ | `onDateActivate` | `(date, { view, source }) => void` | — | A day was clicked or Enter was pressed. Calendar does nothing else; you decide what it means. |
97
+ | `views` | `Record<string, ViewDefinition>` | — | Custom views, merged over the built-ins. |
98
+ | `locale` | `string` | runtime locale | BCP 47 tag. Pass it for server rendering. |
99
+ | `weekStartsOn` | `1`–`7` | locale | First weekday, 1 = Monday. |
100
+ | `hiddenDays` | `DayOfWeek[]` | `[]` | Hide weekdays in every layout. |
101
+ | `timeZone` | `string` | runtime zone | IANA zone used to decide which day is today. |
102
+ | `now` | `number` | `Date.now()` | Epoch milliseconds used as now. Pass it for server rendering. |
103
+ | `min`, `max` | `DateInput` | — | Limit navigation. Days outside are marked `data-disabled`. |
104
+ | `timeGrid` | `{ start, end, step, workingHours }` | 30-minute slots | Time axis of the time grid. `step` is in minutes; `workingHours` is `{ start, end, days }`. |
105
+ | `weekNumbers` | `"iso" \| "locale" \| false` | `false` | Show week numbers in month grids. |
106
+ | `messages` | `Partial<Messages>` | English | Accessible names and state words. Only English ships; pass your own to translate. |
107
+ | `selectedDate` | `DateInput` | — | Marks a day `data-selected`. Calendar never changes it; you set it, for example from `onDateActivate`. |
108
+ | `highlightedDates` | `DateInput[] \| (date) => boolean` | — | Marks days `data-highlighted`. |
109
+
110
+ ### Views
111
+
112
+ A view is data: a layout, a length and an alignment. Add your own through `views`.
113
+
114
+ | View | Layout | Range |
115
+ | --- | --- | --- |
116
+ | `month` | month | One month with adjacent days, 6 rows. |
117
+ | `week` | time grid | One week. |
118
+ | `workWeek` | time grid | One week without the locale's weekend. |
119
+ | `day` | time grid | One day. |
120
+ | `agenda` | list | Seven days from the date. |
121
+ | `multiMonth` | month | Three months. |
122
+
123
+ ```tsx
124
+ <Calendar
125
+ views={{ threeDay: { layout: "time-grid", length: { days: 3 }, align: "day" } }}
126
+ defaultView="threeDay"
127
+ />
128
+ ```
129
+
130
+ ### Controlled usage
131
+
132
+ Leave `view` and `date` unset for uncontrolled use, or control them yourself. Calendar only reports changes and never persists anything.
133
+
134
+ ```tsx
135
+ const [view, setView] = useState("month");
136
+ const [date, setDate] = useState(toPlainDate("2026-11-17"));
137
+
138
+ <Calendar view={view} onViewChange={setView} date={date} onDateChange={setDate} />
139
+ ```
140
+
141
+ ### Mini Calendar
142
+
143
+ The Mini Calendar has its own month. Pass `syncWith` and it follows the main calendar when the main date leaves its month; the user can still page it independently.
144
+
145
+ ```tsx
146
+ <MiniCalendar
147
+ syncWith={range ? { date, visibleRange: range } : undefined}
148
+ isMarked={(day) => hasEvents(day)}
149
+ onNavigate={setDate}
150
+ >
151
+ <MiniCalendarPrevButton />
152
+ <MiniCalendarTitle />
153
+ <MiniCalendarNextButton />
154
+ <MiniCalendarGrid />
155
+ </MiniCalendar>
156
+ ```
157
+
158
+ `MiniCalendar` takes `month` / `defaultMonth` / `onMonthChange`, `syncWith` (`{ date, visibleRange }` of the main calendar), `isMarked` (`(date) => boolean`, for example days with events), `onNavigate` (`(date) => void`) and the shared `locale`, `weekStartsOn`, `timeZone`, `now`, `min`, `max`, `weekNumbers`, `messages`, `selectedDate` and `highlightedDates`.
159
+
160
+ ### Keyboard
161
+
162
+ | Key | Action |
163
+ | --- | --- |
164
+ | `←` `→` | Previous or next day. Swapped in right-to-left locales. |
165
+ | `↑` `↓` | Previous or next week in a month grid; previous or next day in the agenda. |
166
+ | `Home` `End` | Start or end of the week, or the first or last day of a time grid or agenda. |
167
+ | `PageUp` `PageDown` | Previous or next range (month, week, ...). In a month grid, `Shift` moves by a year. |
168
+ | `Enter` | Activates the focused day (`onDateActivate`). |
169
+
170
+ ### Server rendering
171
+
172
+ Pass `now` and `locale` (and `timeZone`) so the server and the client render the same markup. Without them Chrono reads the runtime clock and locale, which differ between server and browser.
173
+
174
+ ```tsx
175
+ <Calendar now={now} locale="en-US" timeZone="UTC" />
176
+ ```
177
+
178
+ ## React Server Components
179
+
180
+ Components and hooks are client components. The utilities (`getCalendarTitle`, `getRange`, `getVisibleRange`, `toPlainDate`, `toIsoString`, `isSameDay`) carry no directive, so Server Components and server actions can call them from either entry.
181
+
182
+ ```ts
183
+ // A Server Component: no "use client" needed for utilities.
184
+ import { getCalendarTitle, getRange } from "@zealakit/chrono-react/calendar";
185
+ ```
186
+
187
+ ## Events
188
+
189
+ Pass `events` and render each cell's segments with `CalendarEvents` and `CalendarEvent`; Chrono computes lanes, columns, overflow and continuation flags and you render the content. Pass `eventLimit="auto"` to measure the visible cell and listen to `onSelectRange` for drag-to-create.
190
+
191
+ ```tsx
192
+ <Calendar events={events} eventLimit="auto" onSelectRange={create}>
193
+ <CalendarMonthGrid>
194
+ {(day) => (
195
+ <CalendarEvents day={day}>
196
+ {(segments) =>
197
+ segments.map((segment) => (
198
+ <CalendarEvent key={segment.key} segment={segment} />
199
+ ))
200
+ }
201
+ </CalendarEvents>
202
+ )}
203
+ </CalendarMonthGrid>
204
+ </Calendar>
205
+ ```
206
+
207
+ | Part | Renders | Purpose |
208
+ | --- | --- | --- |
209
+ | `CalendarEvents` | `div` | The event list of one cell; its render prop receives that cell's segments. |
210
+ | `CalendarEvent` | `div` | One segment, with `segment.event` as your original object. |
211
+ | `CalendarMoreButton` | `button` | The "+N more" control; it fires `onMoreActivate`. |
212
+ | `CalendarAllDayRow` | `div` | The time-grid all-day row; its render prop receives `{ days, segments }`. |
213
+ | `CalendarNowIndicator` | `div` | The current-time line, rendered only when it is inside the axis. |
214
+ | `CalendarSelectionPreview` | `div` | One selection preview piece per covered day. |
215
+
216
+ Event positions are unitless numbers in `--chrono-event-*` custom properties, so your CSS owns the units and the layout method. `Enter` or `F2` enters a cell's events, `Space` selects, `Enter` activates and `Escape` returns to the day.
217
+
218
+ ### Recurring events
219
+
220
+ Recurring events are an **opt-in pack**: import `recurrence` and pass it as the `recurrence` option. Apps that do not import it keep the base size and see only each series' first occurrence.
221
+
222
+ ```tsx
223
+ import { Calendar, CalendarEvent, CalendarEvents, CalendarMonthGrid, recurrence } from "@zealakit/chrono-react";
224
+
225
+ <Calendar recurrence={recurrence} events={events}>
226
+ <CalendarMonthGrid>
227
+ {(day) => (
228
+ <CalendarEvents day={day}>
229
+ {(segments) =>
230
+ segments.map((segment) => (
231
+ <CalendarEvent key={segment.key} segment={segment} />
232
+ ))
233
+ }
234
+ </CalendarEvents>
235
+ )}
236
+ </CalendarMonthGrid>
237
+ </Calendar>
238
+ ```
239
+
240
+ Give a series an `rrule` (an RFC 5545 value or a parsed rule), and optionally `exdates` and `rdates`. Chrono supports `FREQ` DAILY, WEEKLY, MONTHLY and YEARLY with `INTERVAL`, `COUNT`, `UNTIL`, `BYDAY` (including ordinals such as `-1FR`), `BYMONTHDAY`, `BYMONTH` and `WKST`. Anything outside that subset falls back to the first occurrence and calls `onRecurrenceError(event, error)` once per series and error code.
241
+
242
+ - Occurrences keep the series' wall time in the display `timeZone`, so a 09:00 stand-up stays at 09:00 across DST.
243
+ - `COUNT` counts generated occurrences before `exdates`; `UNTIL` is inclusive. Invalid dates (31 February) are skipped.
244
+ - An override is an event with `recurringId` (the series id) and `recurrenceId` (the original occurrence start). It replaces that occurrence.
245
+ - `segment.recurrence` carries `{ recurringId, occurrenceStart, isOverride, series }`; occurrence keys are `${seriesId}:${occurrenceStart}`.
246
+ - Editing stays a proposal: `onEventChange` receives `change.recurrence` too. Ask the user whether to change this, this and following, or all occurrences, then call `applyRecurrenceChange` or `applyRecurrenceDelete` and persist the returned event(s) yourself. Chrono never writes `events`.
247
+ - `expandRecurrence`, `parseRRule` and `stringifyRRule` are plain functions, so the same rules can be expanded on the server.
248
+
249
+ ### Move and resize
250
+
251
+ Set `editable` to let people move and resize events. Chrono only **proposes** a change: `onEventChange(proposal)` receives `{ kind, event, from, to, source }` and your app decides. Return `false` (or a promise that resolves to `false`) to reject it; anything else accepts it, and the event stays in a `data-pending` state until your `events` contain the new times (or `pendingTimeout`, default 10 s, runs out). Chrono never changes `events` itself, persists, or syncs.
252
+
253
+ ```tsx
254
+ <Calendar
255
+ editable
256
+ events={events}
257
+ onEventChange={async (change) => (await save(change)).ok}
258
+ >
259
+ <CalendarMonthGrid>
260
+ {(day) => (
261
+ <>
262
+ <CalendarEvents day={day}>
263
+ {(segments) =>
264
+ segments.map((segment) => (
265
+ <CalendarEvent key={segment.key} segment={segment}>
266
+ <CalendarEventResizeHandle segment={segment} edge="end" />
267
+ </CalendarEvent>
268
+ ))
269
+ }
270
+ </CalendarEvents>
271
+ <CalendarEventDragPreview day={day} />
272
+ </>
273
+ )}
274
+ </CalendarMonthGrid>
275
+ </Calendar>
276
+ ```
277
+
278
+ | Option | Purpose |
279
+ | --- | --- |
280
+ | `editable`, `isEventEditable` | Turn editing on for the calendar or per event. An event can also set `editable`, `movable` or `resizable` to `false`. |
281
+ | `snapDuration`, `defaultTimedDuration` | Minutes to snap to (default: the slot duration) and the length of an all-day event dropped into the time grid (default 60). |
282
+ | `allowAllDayConversion` | Allow dragging between the all-day row and the time grid (default `true`). |
283
+ | `validateEventChange` | Return `false` to mark the target `data-invalid` and block the drop. |
284
+ | `autoScroll`, `scrollContainer` | Scroll the container while the pointer is near its edge. |
285
+ | `keyboardShortcuts` | `M` moves, `R` resizes the end, `Shift+R` the start; `false` turns them off. Arrows step, `Enter` drops, `Escape` cancels. |
286
+
287
+ `CalendarEventResizeHandle` renders a handle inside an event, and `CalendarEventDragPreview` renders one `aria-hidden` preview piece per covered cell while a drag runs. Chrono writes only `data-*` state and `--chrono-*` numbers: give events and handles `touch-action: none` in your CSS and style `[data-dragging]`, `[data-pending]` and `[data-invalid]` yourself. A drag needs a 4 px move (a touch needs a 400 ms hold), so a click still selects.
288
+
289
+ ### Resources
290
+
291
+ Resource views are an **opt-in view pack**: import `resourceViews` and pass it as `views`, so apps without resources do not ship the code. Pass `resources` (a flat list; `parentId` makes a tree) and give events a `resourceId` (one id, or an array to show an event in several resources). Chrono lays out the columns, rows and events; your app owns the resources, permissions and rules.
292
+
293
+ ```tsx
294
+ import { Calendar, CalendarTimeline, CalendarTimelineRow, CalendarTimelineRowHeader, CalendarResourceEvent, resourceViews } from "@zealakit/chrono-react/calendar";
295
+
296
+ <Calendar views={resourceViews} defaultView="timelineWeek" resources={rooms} events={bookings}>
297
+ <CalendarTimeline>
298
+ {(layout) =>
299
+ layout.rows.map((row) => (
300
+ <CalendarTimelineRow key={row.key} row={row}>
301
+ <CalendarTimelineRowHeader row={row} />
302
+ {layout.pieces
303
+ .filter((piece) => piece.rowKey === row.key)
304
+ .map((piece) => <CalendarResourceEvent key={piece.key} piece={piece} />)}
305
+ </CalendarTimelineRow>
306
+ ))
307
+ }
308
+ </CalendarTimeline>
309
+ </Calendar>
310
+ ```
311
+
312
+ | View | Layout |
313
+ | --- | --- |
314
+ | `resourceDay`, `resourceWeek` | Columns are days × resources (`resourceGrouping`: `"resource-first"` or `"date-first"`), each laid out like a normal time-grid day. |
315
+ | `timelineDay`, `timelineWeek`, `timelineMonth` | One row per resource on a horizontal axis. A definition sets `slot` (`{ minutes }`, `{ days }` or `{ weeks }`) and `headerRows` (for example `["day", "hour"]`). |
316
+
317
+ Parts: `CalendarResourceGrid`, `CalendarResourceHeader`, `CalendarResourceGroupHeader`, `CalendarTimeline`, `CalendarTimelineHeaderCell`, `CalendarTimelineRow`, `CalendarTimelineRowHeader`, `CalendarTimelineCell` and `CalendarResourceEvent`.
318
+
319
+ Events carry `--chrono-event-left` and `--chrono-event-width` (fractions of the axis) in a timeline, and each row carries `--chrono-row-lanes`, so your CSS owns the sizes. Grouped resources use the `treegrid` pattern (`aria-level`, `aria-expanded`); `collapsedResourceIds` (or `toggleResource`) collapses a group. `zoomLevels` lists view ids from finest to coarsest for `zoomIn()` and `zoomOut()`. `resourceWindow` and `slotWindow` (half-open) lay out only a window and expose the full counts, so an app virtualizer can drive them; Chrono ships no virtualizer. Events without a `resourceId` are not shown in resource views. Not yet: dragging between resources, per-resource working hours, `scrollToTime` and treegrid arrow-key navigation.
320
+
321
+ ## Date
322
+
323
+ Five independent, unstyled components: `DateInput`, `DatePanel`, `DateRangeInput`, `DateRangePanel` and `MultiDatePanel`. They work alone, together through a shared value, and inside any popup you choose. Chrono has no popup: opening, positioning and closing belong to your app.
324
+
325
+ ### Date quick start
326
+
327
+ Share one value between a typed field and a panel. Typing moves the panel; picking a day fills the field.
328
+
329
+ ```tsx
330
+ import { useState } from "react";
331
+ import { DateInput, DatePanel } from "@zealakit/chrono-react/date";
332
+ import type { DateValue } from "@zealakit/chrono-react/date";
333
+
334
+ export function Booking() {
335
+ const [value, setValue] = useState<DateValue>(null);
336
+ return (
337
+ <>
338
+ <DateInput value={value} onValueChange={setValue} name="check-in" />
339
+ <DatePanel value={value} onValueChange={setValue} />
340
+ </>
341
+ );
342
+ }
343
+ ```
344
+
345
+ ### Date parts
346
+
347
+ Every part is optional. A panel or input rendered without children draws a default layout; compose the parts for your own.
348
+
349
+ | Part | Default element | Notes |
350
+ | --- | --- | --- |
351
+ | `DateInput` | `div` | Group of segments, or a text field with `mode="text"` |
352
+ | `DateInputSegment, DateInputLiteral` | `span` | One part (spinbutton) and a separator |
353
+ | `DateInputTextField, DateInputClearButton` | `input, button` | Text mode field and clear |
354
+ | `DateRangeInput, DateRangeInputStart, DateRangeInputEnd` | `div` | Two fields in one group |
355
+ | `DatePanel, DateRangePanel, MultiDatePanel` | `div` | The three panel roots; range shows two months |
356
+ | `DatePanelTitle, DatePanelLevelButton` | `h2, button` | Title, and the title as a level switch |
357
+ | `DatePanelPrevButton, DatePanelNextButton, DatePanelTodayButton` | `button` | Paging and today |
358
+ | `DatePanelGrid, DatePanelWeekdayHeader, DatePanelWeekNumber, DatePanelCell` | `table, th, td` | The grid of the current level |
359
+
360
+ ### Change and commit
361
+
362
+ `onValueChange` fires on every change, including a partial range. `onValueCommit` fires when a choice is complete: a day is picked, a range has both ends, or a typed value is valid on blur or Enter. Close your popup on commit. A multi selection never commits by itself; call `commit()`.
363
+
364
+ ### Date keyboard
365
+
366
+ Arrow keys, Home/End and PageUp/PageDown move focus. Enter or Space picks (toggles in a multi panel; Shift+Enter adds the span from the last day). Ctrl or Cmd with ArrowUp goes up a level (day, month, year). Escape cancels a range draft and is otherwise left alone so your popup can close. In an input, digits type and advance, ArrowUp and ArrowDown step with wrap, Backspace clears a part and ArrowLeft and ArrowRight move between parts (swapped in right-to-left languages).
367
+
368
+ ### Forms and validity
369
+
370
+ Set `name` and the root renders a hidden input with the ISO value (`2026-11-17`). A range uses `name-start` and `name-end` (or `startName` and `endName`); a multi panel is not a field. A form reset restores `defaultValue`. Invalid input keeps what was typed and reports `validity` (`empty`, `incomplete`, `invalid-date`, `before-min`, `after-max`, `disabled`, `unavailable`, `valid`) as `aria-invalid` and `data-invalid`; the error text is yours.
371
+
372
+ ### Range presets
373
+
374
+ `getPresetRange(preset, { today, weekStartsOn, fiscalYearStartMonth })` returns the inclusive range of `today`, `yesterday`, `last7Days`, `last30Days`, `thisWeek`, `lastWeek`, `thisMonth`, `lastMonth`, `thisQuarter`, `lastQuarter`, `yearToDate`, `thisYear`, `lastYear` or a custom `{ unit, amount, align }`. `matchPreset` tells which preset equals the current value, for `aria-pressed` on your own buttons. Presets are pure helpers: the buttons are yours.
375
+
376
+ ### Popup recipes
377
+
378
+ Put a panel in any popup library: set `autoFocus` so focus moves into the panel (it is off by default so an inline panel never steals focus), close on `onValueCommit` and let the popup restore focus. The panel never stops Escape unless it just cancelled a range draft. The foundation type `DateInput` is exported by the adapters as `DateInputValue`, because `DateInput` is now a component.
379
+
380
+ ## Time
381
+
382
+ Four independent, unstyled components with no date and no time zone: `TimeInput`, `TimePanel`, `TimeRangeInput` and `TimeRangePanel`. They suit opening hours, working hours, daily schedules and appointment slots. Like the Date components they have no popup of their own.
383
+
384
+ ### Time quick start
385
+
386
+ Share one value between a segmented field and a panel. Typing moves the panel; picking an option fills the field.
387
+
388
+ ```tsx
389
+ import { useState } from "react";
390
+ import { TimeInput, TimePanel } from "@zealakit/chrono-react/time";
391
+ import type { TimeValue } from "@zealakit/chrono-react/time";
392
+
393
+ export function Opening() {
394
+ const [value, setValue] = useState<TimeValue>(null);
395
+ return (
396
+ <>
397
+ <TimeInput value={value} onValueChange={setValue} name="opens" />
398
+ <TimePanel value={value} onValueChange={setValue} step={{ minutes: 15 }} />
399
+ </>
400
+ );
401
+ }
402
+ ```
403
+
404
+ ### Time parts
405
+
406
+ Every part is optional. A panel rendered without children draws its default layout.
407
+
408
+ | Part | Default element | Notes |
409
+ | --- | --- | --- |
410
+ | `TimeInput` | `div` | Group of segments, or a text field with `mode="text"` |
411
+ | `TimeInputSegment, TimeInputLiteral` | `span` | One part (spinbutton) and a separator |
412
+ | `TimeInputTextField, TimeInputClearButton` | `input, button` | Text mode field and clear |
413
+ | `TimeRangeInput, TimeRangeInputStart, TimeRangeInputEnd` | `div` | Two fields in one group |
414
+ | `TimePanel, TimeRangePanel` | `div` | Both layouts; a range list is the default |
415
+ | `TimePanelColumn` | `div` | Columns layout: one listbox per part |
416
+ | `TimePanelList, TimePanelGroup, TimePanelGroupLabel` | `div` | List layout and its groups |
417
+ | `TimePanelOption` | `div` | One time or slot; custom content can read `slot.data` |
418
+ | `TimeRangePanelStart, TimeRangePanelEnd` | `div` | Columns layout of a range: one column set each |
419
+
420
+ ### Layouts and slots
421
+
422
+ `layout="columns"` shows one listbox per part (hour, minute, second, day period). `layout="list"` shows one listbox of times every `step`, or of slots with `slotDuration` or an explicit `slots` array (`{ start, end?, available?, data? }`). A slot's `data` is yours: read it from the option content. `groupBy` accepts `"hour"`, `"dayPeriod"` (labels from `Intl`) or your own function. `granularity` is `hour`, `minute` or `second`, `hourCycle` is `h12` or `h23` (default from the locale) and `step` sets the minute or second interval. Hours or options that are not allowed stay focusable but cannot be picked.
423
+
424
+ ### Overnight ranges
425
+
426
+ A time range is half-open `[start, end)`. With `allowOvernight`, an `end` before the `start` means the next day (`23:00` to `02:00`, `duration` 180 minutes, `crossesMidnight` true). `09:00` to `09:00` is always `end-before-start`. `minDuration` and `maxDuration` (minutes) mark the options that would break them with `data-range-blocked`. In a list, two picks make a range: with `slotDuration` the end is the end of the picked slot.
427
+
428
+ ### Time keyboard
429
+
430
+ A panel is one tab stop. In columns, left and right arrows change column, up and down arrows move inside it, Home and End jump to the ends, PageUp and PageDown move by 3 hours or 15 minutes, digits type ahead (`1` then `5` focuses 15) and Enter or Space picks. In a list, up and down arrows, Home, End, PageUp and PageDown move and digits type ahead. Escape only cancels a range draft. In an input, digits type and advance, ArrowUp and ArrowDown step by `step` with wrap, and typing `a` or `p` (the first letters of the localized labels) sets the day period.
431
+
432
+ ### Time forms and validity
433
+
434
+ Set `name` and the root renders a hidden input with `09:30` (`09:30:15` with `granularity="second"`); a range uses `name-start` and `name-end`. Typed values are never rewritten: one that is not on the `step` is kept and reported as `validity: "off-step"` (`snapTime` is there if you want to snap on blur). The other states are `empty`, `incomplete`, `before-min`, `after-max`, `disabled`, `unavailable`, `valid`, plus `end-before-start`, `too-short` and `too-long` for ranges. In text mode `9`, `930`, `9:30`, `9.30`, `9h30`, `21:30`, `9:30 pm` and `9 PM` all parse.
435
+
436
+ ### Time popup recipes
437
+
438
+ Put a panel in any popup library like a Date panel: set `autoFocus` inside the popup, close on `onValueCommit` (the last column of the end set for a range in columns) and let the popup restore focus. The foundation type `TimeInput` is exported by the adapters as `TimeInputValue`, because `TimeInput` is now a component. `BookingSlot` is the slot type (the foundation `TimeSlot` is the Calendar's time-axis slot).
439
+
440
+ ## DateTime
441
+
442
+ Four components that compose Date and Time: `DateTimeInput`, `DateTimePanel`, `DateTimeRangeInput` and `DateTimeRangePanel`. They reuse the Date and Time controllers and parts and add only what needs both: cross-part limits, time zones and daylight saving time. There is no popup and no time-zone picker; choosing a zone is your UI.
443
+
444
+ ### DateTime quick start
445
+
446
+ A field and a panel share one value. Time zones make the value a `ZonedDateTime`; without one it is a plain wall-clock `PlainDateTime`.
447
+
448
+ ```tsx
449
+ import { useState } from "react";
450
+ import { DateTimeInput, DateTimePanel } from "@zealakit/chrono-react/datetime";
451
+ import type { DateTimeValue } from "@zealakit/chrono-react/datetime";
452
+
453
+ export function Meeting() {
454
+ const [value, setValue] = useState<DateTimeValue>(null);
455
+ return (
456
+ <>
457
+ <DateTimeInput value={value} onValueChange={setValue} timeZone="Asia/Ho_Chi_Minh" valueTimeZone="UTC" name="at" />
458
+ <DateTimePanel value={value} onValueChange={setValue} timeZone="Asia/Ho_Chi_Minh" valueTimeZone="UTC" disablePast defaultTime="09:00" />
459
+ </>
460
+ );
461
+ }
462
+ ```
463
+
464
+ ### DateTime parts
465
+
466
+ The containers provide the Date and Time contexts; the grid, cells, columns and options inside are the parts you import from `/date` and `/time`. A bare `DateTimePanel` draws a default layout.
467
+
468
+ | Part | Default element | Notes |
469
+ | --- | --- | --- |
470
+ | `DateTimeInput` | `div` | One segment group, or a date field and a time field |
471
+ | `DateTimeInputSegment, DateTimeInputLiteral, DateTimeInputClearButton` | `span, span, button` | Any date or time part, and clear |
472
+ | `DateTimeInputDateField, DateTimeInputTimeField` | `input, input` | Text mode: the two fields |
473
+ | `DateTimeInputTimeZone` | `span` | The display zone as text |
474
+ | `DateTimeRangeInput, DateTimeRangeInputStart, DateTimeRangeInputEnd` | `div` | Two fields in one group |
475
+ | `DateTimePanel, DateTimePanelDate, DateTimePanelTime` | `div` | Container and the two contexts |
476
+ | `DateTimeRangePanel, DateTimeRangePanelDate` | `div` | Container and the date range context |
477
+ | `DateTimeRangePanelStartTime, DateTimeRangePanelEndTime` | `div` | The two time contexts of a range |
478
+
479
+ ### Time zones and daylight saving time
480
+
481
+ `timeZone` is the zone the user sees and edits. `valueTimeZone` (for example `"UTC"`) is the zone of the emitted value: the same instant, stored your way. `disambiguation` (`compatible`, `earlier`, `later`, `reject`) decides a wall time that falls in a daylight-saving gap or overlap. A time in a gap keeps the typed wall time on screen and sets `data-adjusted`; with `reject` the state is `nonexistent-time`. `getDayInstants` lists the real instants of a day (a repeated hour appears twice with its offset), and `resolveWall` shows how one wall time resolves.
482
+
483
+ ### Limits, default time and commit
484
+
485
+ `min` and `max` accept date-times: days outside them are disabled and, on the boundary day, the times before `min` or after `max`. `disablePast` makes `min` now in `timeZone` (`now` is injectable). `isTimeDisabled(time, date)` gets the chosen date. `defaultTime` fills the time when a date is picked first, so the value is complete at once. Picking a new date keeps the time; if it becomes disabled the value goes `null` and the option is marked. `onValueCommit` fires when the time part commits, never when a date is picked. A range commits when the end time commits; `minDuration` and `maxDuration` (minutes) disable end times that would break them.
486
+
487
+ ### DateTime forms and text mode
488
+
489
+ Set `name` and the root renders a hidden input: an ISO value with the offset for a zoned value (`2026-11-17T09:30:00+07:00`), otherwise `2026-11-17T09:30`. `formValue(value)` replaces it (for example to send UTC). A range uses `name-start` and `name-end`. In segmented mode the date and time parts are one tab stop; in text mode there are two labelled native fields, each parsed on its own, and pasting a full date-time such as `2026-11-17T09:30` or `17/11/2026 9:30` fills both.
490
+
491
+ ### Which component do I need?
492
+
493
+ Pick the smallest component that holds your value. `DateTimeInputValue` is the foundation type `DateTimeInput` (a component has that name now).
494
+
495
+ | I need | Use |
496
+ | --- | --- |
497
+ | A day | `DateInput`, `DatePanel` (`/date`) |
498
+ | A range of days or many days | `DateRangeInput`, `DateRangePanel`, `MultiDatePanel` (`/date`) |
499
+ | A time of day or a slot | `TimeInput`, `TimePanel` (`/time`) |
500
+ | Opening hours or a shift | `TimeRangeInput`, `TimeRangePanel` (`/time`) |
501
+ | A moment, with a time zone | `DateTimeInput`, `DateTimePanel` (`/datetime`) |
502
+ | A booking from a moment to a moment | `DateTimeRangeInput`, `DateTimeRangePanel` (`/datetime`) |
503
+ | Views of days with events | `Calendar`, `MiniCalendar` (`/calendar`) |
504
+
505
+ ## Availability
506
+
507
+ Describe availability once and pass it as `availability`; Chrono shades closed time in the calendar and blocks the same times in every picker. `blocked` wins over `open`, rules run in the spec's `timeZone`, and `leadTime`, `cutoffTime` and `bookingWindow` limit how soon and how far ahead a pick may land.
508
+
509
+ ```tsx
510
+ import { CalendarBackground, useCalendarState } from "@zealakit/chrono-react/calendar";
511
+
512
+ function Backgrounds() {
513
+ const { backgrounds } = useCalendarState();
514
+ return backgrounds.map((piece) => (
515
+ <CalendarBackground key={piece.key} piece={piece} />
516
+ ));
517
+ }
518
+
519
+ <Calendar availability={{ blocked: [{ type: "daily", start: "18:00", end: "08:00" }] }}>
520
+ <CalendarTimeGrid>{() => <Backgrounds />}</CalendarTimeGrid>
521
+ </Calendar>
522
+ ```
523
+
524
+ | Option | Where | Purpose |
525
+ | --- | --- | --- |
526
+ | `availability` | Calendar and every date, time and datetime part | A spec, a compiled model, or a function of the drag context. |
527
+ | `backgrounds` | Calendar | `"unavailable"` (default), `"available"`, `"both"` or `false`. |
528
+ | `availabilityBlocksInteraction` | Calendar | Default `true`; selections and moves over closed time are invalid. |
529
+ | `getResourceAvailability` | Calendar | Per-resource hours, for resource views. |
530
+ | `getAvailabilityLabel` | Calendar | The wording for a blocked rule (the first rule's `reason` by default). |
531
+
532
+ Chrono proposes; the app decides. Real availability (rooms, staff, stock) stays in your data layer. Month cells get `data-unavailable` and `data-partially-available`; background pieces are `aria-hidden` and carry `data-status`, `data-rule-id` and `--chrono-background-*` positions.
533
+
534
+ ## Messages
535
+
536
+ Every accessible name and state word is a message. Pass `messages` with any of these keys to override them (the other keys keep their English default). Values with `{name}` placeholders keep them.
537
+
538
+ | Key | Default |
539
+ | --- | --- |
540
+ | `today` | `today` |
541
+ | `selected` | `selected` |
542
+ | `unavailable` | `unavailable` |
543
+ | `partiallyAvailable` | `partially available` |
544
+ | `disabled` | `disabled` |
545
+ | `rangeStart` | `range start` |
546
+ | `rangeEnd` | `range end` |
547
+ | `inRange` | `in range` |
548
+ | `previous` | `Previous` |
549
+ | `next` | `Next` |
550
+ | `goToToday` | `Today` |
551
+ | `calendar` | `Calendar` |
552
+ | `weekNumber` | `Week {number}` |
553
+ | `hasEvents` | `has events` |
554
+ | `events` | `events` |
555
+ | `moreEvents` | `{count} more events` |
556
+ | `allDay` | `All day` |
557
+ | `cellEvents` | `{count} events` |
558
+ | `selectionCreated` | `Selected {range}` |
559
+ | `selectionCancelled` | `Selection cancelled` |
560
+ | `eventSelected` | `Event selected` |
561
+ | `recurring` | `recurring event` |
562
+ | `editInstructions` | `Press M to move, R to resize` |
563
+ | `moving` | `Moving {event}, {range}` |
564
+ | `resizing` | `Resizing {event}, {range}` |
565
+ | `movedTo` | `Moved to {range}` |
566
+ | `resizedTo` | `Resized to {range}` |
567
+ | `changeCancelled` | `Change cancelled` |
568
+ | `notAllowedHere` | `Not allowed here` |
569
+ | `chooseMonth` | `Choose month` |
570
+ | `chooseYear` | `Choose year` |
571
+ | `clear` | `Clear` |
572
+ | `startDate` | `Start date` |
573
+ | `endDate` | `End date` |
574
+ | `selectedCount` | `{count} dates selected` |
575
+ | `placeholderDay` | `dd` |
576
+ | `placeholderMonth` | `mm` |
577
+ | `placeholderYear` | `yyyy` |
578
+ | `day` | `Day` |
579
+ | `month` | `Month` |
580
+ | `year` | `Year` |
581
+ | `empty` | `Empty` |
582
+ | `placeholderHour` | `hh` |
583
+ | `placeholderMinute` | `mm` |
584
+ | `placeholderSecond` | `ss` |
585
+ | `placeholderDayPeriod` | `--` |
586
+ | `hour` | `Hour` |
587
+ | `minute` | `Minute` |
588
+ | `second` | `Second` |
589
+ | `dayPeriod` | `AM/PM` |
590
+ | `startTime` | `Start time` |
591
+ | `endTime` | `End time` |
592
+ | `time` | `Time` |
593
+ | `date` | `Date` |
594
+ | `adjustedTime` | `adjusted for daylight saving time` |
595
+ | `timeZone` | `Time zone` |
596
+ | `startDateTime` | `Start date and time` |
597
+ | `endDateTime` | `End date and time` |
598
+
599
+ ## Styling hooks
600
+
601
+ | Attribute | Where | Purpose |
602
+ | --- | --- | --- |
603
+ | `data-chrono-calendar` | root | Marks the calendar root. `data-view` and `data-layout` carry the active view and layout. |
604
+ | `data-today` | cells, headers | The day is today. `aria-current="date"` is set too. |
605
+ | `data-selected`, `data-highlighted` | cells, headers | Set from `selectedDate` and `highlightedDates`. |
606
+ | `data-outside-month`, `data-weekend`, `data-hidden` | cells | The day is outside the shown month, on a weekend, or hidden through `hiddenDays`. |
607
+ | `data-focused` | cells, headers | The roving-tabindex day. Style `:focus-visible` for the keyboard ring. |
608
+ | `data-disabled` | cells, nav buttons | Outside `min` and `max`, or navigation cannot go further. `aria-disabled` is set too. |
609
+ | `data-marked`, `data-in-range` | Mini Calendar cells | From `isMarked`, and inside the synced visible range. |
610
+ | `data-slot-start`, `data-working-hours` | time grid slots | The slot start time, and whether it is inside the working hours. |
611
+ | `data-chrono-key` | cells, headers | The ISO date of the cell. Useful for tests and delegated listeners. |
612
+
613
+ ## Compatibility
614
+
615
+ **Public API** (from 1.0) is every export of an adapter entry, component props and events, the documented `data-*` attributes and ARIA roles, every `--chrono-*` custom property, the documented keyboard behavior and the value types. Breaking changes only ship in major versions, and renaming or removing a `data-*` attribute or custom property counts as breaking. A deprecation is announced in a minor with a development warning and a README note, and removed in the next major at the earliest. Core internals, `src/shared/`, the file layout inside `dist` and the exact text of development warnings are not public.
616
+
617
+ **Supported environments:** the last two versions of Chrome, Edge, Firefox and Safari, plus current iOS Safari and Android Chrome. React 18 and 19, Vue 3.5 and later, Svelte 5.
618
+
619
+ ## Agent Skill
620
+
621
+ The [Chrono React skill](https://github.com/zealakit/chrono/blob/main/skills/chrono-react.md) covers integration steps for agents.
622
+
623
+ ## License
624
+
625
+ MIT © Zealakit