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

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 (363) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +625 -2
  3. package/dist/calendar/components.d.ts +346 -0
  4. package/dist/calendar/components.js +243 -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 +51 -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 +154 -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 +193 -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 +164 -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/defined-options.d.ts +18 -0
  52. package/dist/shared/defined-options.js +9 -0
  53. package/dist/shared/merge-props.d.ts +9 -0
  54. package/dist/shared/merge-props.js +31 -0
  55. package/dist/shared/modifiers.d.ts +7 -0
  56. package/dist/shared/modifiers.js +6 -0
  57. package/dist/shared/part.d.ts +10 -0
  58. package/dist/shared/part.js +9 -0
  59. package/dist/shared/slot.d.ts +12 -0
  60. package/dist/shared/slot.js +57 -0
  61. package/dist/shared/style-properties.d.ts +8 -0
  62. package/dist/shared/style-properties.js +13 -0
  63. package/dist/shared/to-react-props.d.ts +11 -0
  64. package/dist/shared/to-react-props.js +27 -0
  65. package/dist/time/bind-panel.d.ts +19 -0
  66. package/dist/time/bind-panel.js +97 -0
  67. package/dist/time/components.d.ts +183 -0
  68. package/dist/time/components.js +169 -0
  69. package/dist/time/context.d.ts +24 -0
  70. package/dist/time/context.js +19 -0
  71. package/dist/time/index.d.ts +4 -0
  72. package/dist/time/index.js +4 -0
  73. package/dist/time/options.d.ts +5 -0
  74. package/dist/time/options.js +85 -0
  75. package/dist/time/use-time-input.d.ts +43 -0
  76. package/dist/time/use-time-input.js +138 -0
  77. package/dist/time/use-time-panel.d.ts +37 -0
  78. package/dist/time/use-time-panel.js +18 -0
  79. package/dist/time/utilities.d.ts +4 -0
  80. package/dist/time/utilities.js +4 -0
  81. package/dist/vendor/core/calendar/availability.d.ts +39 -0
  82. package/dist/vendor/core/calendar/availability.js +73 -0
  83. package/dist/vendor/core/calendar/controllers/calendar-controller.d.ts +251 -0
  84. package/dist/vendor/core/calendar/controllers/calendar-controller.js +1396 -0
  85. package/dist/vendor/core/calendar/controllers/drag-engine.d.ts +99 -0
  86. package/dist/vendor/core/calendar/controllers/drag-engine.js +363 -0
  87. package/dist/vendor/core/calendar/controllers/mini-calendar-controller.d.ts +66 -0
  88. package/dist/vendor/core/calendar/controllers/mini-calendar-controller.js +171 -0
  89. package/dist/vendor/core/calendar/controllers/shared.d.ts +33 -0
  90. package/dist/vendor/core/calendar/controllers/shared.js +82 -0
  91. package/dist/vendor/core/calendar/events/agenda-layout.d.ts +21 -0
  92. package/dist/vendor/core/calendar/events/agenda-layout.js +72 -0
  93. package/dist/vendor/core/calendar/events/all-day-row.d.ts +22 -0
  94. package/dist/vendor/core/calendar/events/all-day-row.js +93 -0
  95. package/dist/vendor/core/calendar/events/background-layout.d.ts +66 -0
  96. package/dist/vendor/core/calendar/events/background-layout.js +106 -0
  97. package/dist/vendor/core/calendar/events/index.d.ts +17 -0
  98. package/dist/vendor/core/calendar/events/index.js +8 -0
  99. package/dist/vendor/core/calendar/events/month-layout.d.ts +13 -0
  100. package/dist/vendor/core/calendar/events/month-layout.js +157 -0
  101. package/dist/vendor/core/calendar/events/normalize.d.ts +33 -0
  102. package/dist/vendor/core/calendar/events/normalize.js +156 -0
  103. package/dist/vendor/core/calendar/events/now-indicator.d.ts +18 -0
  104. package/dist/vendor/core/calendar/events/now-indicator.js +19 -0
  105. package/dist/vendor/core/calendar/events/overflow.d.ts +36 -0
  106. package/dist/vendor/core/calendar/events/overflow.js +112 -0
  107. package/dist/vendor/core/calendar/events/sort.d.ts +21 -0
  108. package/dist/vendor/core/calendar/events/sort.js +35 -0
  109. package/dist/vendor/core/calendar/events/time-grid-layout.d.ts +22 -0
  110. package/dist/vendor/core/calendar/events/time-grid-layout.js +177 -0
  111. package/dist/vendor/core/calendar/events/types.d.ts +141 -0
  112. package/dist/vendor/core/calendar/events/types.js +1 -0
  113. package/dist/vendor/core/calendar/index.d.ts +70 -0
  114. package/dist/vendor/core/calendar/index.js +37 -0
  115. package/dist/vendor/core/calendar/interaction/auto-scroll.d.ts +11 -0
  116. package/dist/vendor/core/calendar/interaction/auto-scroll.js +37 -0
  117. package/dist/vendor/core/calendar/interaction/drag-geometry.d.ts +52 -0
  118. package/dist/vendor/core/calendar/interaction/drag-geometry.js +122 -0
  119. package/dist/vendor/core/calendar/interaction/drag-keyboard.d.ts +38 -0
  120. package/dist/vendor/core/calendar/interaction/drag-keyboard.js +53 -0
  121. package/dist/vendor/core/calendar/interaction/drag-pointer.d.ts +24 -0
  122. package/dist/vendor/core/calendar/interaction/drag-pointer.js +43 -0
  123. package/dist/vendor/core/calendar/interaction/event-focus.d.ts +28 -0
  124. package/dist/vendor/core/calendar/interaction/event-focus.js +44 -0
  125. package/dist/vendor/core/calendar/interaction/gesture-handle.d.ts +17 -0
  126. package/dist/vendor/core/calendar/interaction/gesture-handle.js +26 -0
  127. package/dist/vendor/core/calendar/interaction/hit-test.d.ts +17 -0
  128. package/dist/vendor/core/calendar/interaction/hit-test.js +26 -0
  129. package/dist/vendor/core/calendar/interaction/pending.d.ts +17 -0
  130. package/dist/vendor/core/calendar/interaction/pending.js +17 -0
  131. package/dist/vendor/core/calendar/interaction/pointer.d.ts +21 -0
  132. package/dist/vendor/core/calendar/interaction/pointer.js +169 -0
  133. package/dist/vendor/core/calendar/interaction/selection.d.ts +29 -0
  134. package/dist/vendor/core/calendar/interaction/selection.js +47 -0
  135. package/dist/vendor/core/calendar/internal/equal.d.ts +3 -0
  136. package/dist/vendor/core/calendar/internal/equal.js +43 -0
  137. package/dist/vendor/core/calendar/navigation/navigate.d.ts +33 -0
  138. package/dist/vendor/core/calendar/navigation/navigate.js +81 -0
  139. package/dist/vendor/core/calendar/navigation/range.d.ts +15 -0
  140. package/dist/vendor/core/calendar/navigation/range.js +52 -0
  141. package/dist/vendor/core/calendar/navigation/title.d.ts +12 -0
  142. package/dist/vendor/core/calendar/navigation/title.js +39 -0
  143. package/dist/vendor/core/calendar/navigation/view-definition.d.ts +39 -0
  144. package/dist/vendor/core/calendar/navigation/view-definition.js +62 -0
  145. package/dist/vendor/core/calendar/navigation/zoom.d.ts +5 -0
  146. package/dist/vendor/core/calendar/navigation/zoom.js +11 -0
  147. package/dist/vendor/core/calendar/recurrence/apply.d.ts +50 -0
  148. package/dist/vendor/core/calendar/recurrence/apply.js +206 -0
  149. package/dist/vendor/core/calendar/recurrence/expand.d.ts +27 -0
  150. package/dist/vendor/core/calendar/recurrence/expand.js +298 -0
  151. package/dist/vendor/core/calendar/recurrence/pack.d.ts +3 -0
  152. package/dist/vendor/core/calendar/recurrence/pack.js +248 -0
  153. package/dist/vendor/core/calendar/recurrence/rrule-types.d.ts +30 -0
  154. package/dist/vendor/core/calendar/recurrence/rrule-types.js +8 -0
  155. package/dist/vendor/core/calendar/recurrence/rrule.d.ts +12 -0
  156. package/dist/vendor/core/calendar/recurrence/rrule.js +278 -0
  157. package/dist/vendor/core/calendar/recurrence/series.d.ts +25 -0
  158. package/dist/vendor/core/calendar/recurrence/series.js +163 -0
  159. package/dist/vendor/core/calendar/recurrence/types.d.ts +30 -0
  160. package/dist/vendor/core/calendar/recurrence/types.js +1 -0
  161. package/dist/vendor/core/calendar/resources/keys.d.ts +2 -0
  162. package/dist/vendor/core/calendar/resources/keys.js +2 -0
  163. package/dist/vendor/core/calendar/resources/resource-time-grid.d.ts +7 -0
  164. package/dist/vendor/core/calendar/resources/resource-time-grid.js +129 -0
  165. package/dist/vendor/core/calendar/resources/timeline-axis.d.ts +10 -0
  166. package/dist/vendor/core/calendar/resources/timeline-axis.js +98 -0
  167. package/dist/vendor/core/calendar/resources/timeline-layout.d.ts +7 -0
  168. package/dist/vendor/core/calendar/resources/timeline-layout.js +109 -0
  169. package/dist/vendor/core/calendar/resources/tree.d.ts +10 -0
  170. package/dist/vendor/core/calendar/resources/tree.js +86 -0
  171. package/dist/vendor/core/calendar/resources/types.d.ts +177 -0
  172. package/dist/vendor/core/calendar/resources/types.js +1 -0
  173. package/dist/vendor/core/calendar/resources/views.d.ts +7 -0
  174. package/dist/vendor/core/calendar/resources/views.js +45 -0
  175. package/dist/vendor/core/calendar/resources/windowing.d.ts +11 -0
  176. package/dist/vendor/core/calendar/resources/windowing.js +17 -0
  177. package/dist/vendor/core/calendar/views/day.d.ts +37 -0
  178. package/dist/vendor/core/calendar/views/day.js +36 -0
  179. package/dist/vendor/core/calendar/views/list-layout.d.ts +8 -0
  180. package/dist/vendor/core/calendar/views/list-layout.js +5 -0
  181. package/dist/vendor/core/calendar/views/mini-calendar.d.ts +23 -0
  182. package/dist/vendor/core/calendar/views/mini-calendar.js +31 -0
  183. package/dist/vendor/core/calendar/views/month-layout.d.ts +30 -0
  184. package/dist/vendor/core/calendar/views/month-layout.js +63 -0
  185. package/dist/vendor/core/calendar/views/time-grid-layout.d.ts +26 -0
  186. package/dist/vendor/core/calendar/views/time-grid-layout.js +27 -0
  187. package/dist/vendor/core/date/index.d.ts +9 -0
  188. package/dist/vendor/core/date/index.js +9 -0
  189. package/dist/vendor/core/date/input/date-input-controller.d.ts +97 -0
  190. package/dist/vendor/core/date/input/date-input-controller.js +466 -0
  191. package/dist/vendor/core/date/input/date-range-input-controller.d.ts +43 -0
  192. package/dist/vendor/core/date/input/date-range-input-controller.js +186 -0
  193. package/dist/vendor/core/date/input/parse.d.ts +22 -0
  194. package/dist/vendor/core/date/input/parse.js +78 -0
  195. package/dist/vendor/core/date/input/validity.d.ts +6 -0
  196. package/dist/vendor/core/date/input/validity.js +13 -0
  197. package/dist/vendor/core/date/panel/panel-controller.d.ts +176 -0
  198. package/dist/vendor/core/date/panel/panel-controller.js +704 -0
  199. package/dist/vendor/core/date/presets.d.ts +22 -0
  200. package/dist/vendor/core/date/presets.js +103 -0
  201. package/dist/vendor/core/date/selection/multiple.d.ts +7 -0
  202. package/dist/vendor/core/date/selection/multiple.js +29 -0
  203. package/dist/vendor/core/date/selection/range.d.ts +29 -0
  204. package/dist/vendor/core/date/selection/range.js +35 -0
  205. package/dist/vendor/core/date/types.d.ts +12 -0
  206. package/dist/vendor/core/date/types.js +1 -0
  207. package/dist/vendor/core/datetime/compose.d.ts +24 -0
  208. package/dist/vendor/core/datetime/compose.js +49 -0
  209. package/dist/vendor/core/datetime/constraints.d.ts +42 -0
  210. package/dist/vendor/core/datetime/constraints.js +56 -0
  211. package/dist/vendor/core/datetime/index.d.ts +9 -0
  212. package/dist/vendor/core/datetime/index.js +9 -0
  213. package/dist/vendor/core/datetime/input/datetime-input-controller.d.ts +96 -0
  214. package/dist/vendor/core/datetime/input/datetime-input-controller.js +380 -0
  215. package/dist/vendor/core/datetime/input/datetime-range-input-controller.d.ts +46 -0
  216. package/dist/vendor/core/datetime/input/datetime-range-input-controller.js +171 -0
  217. package/dist/vendor/core/datetime/input/parse.d.ts +20 -0
  218. package/dist/vendor/core/datetime/input/parse.js +56 -0
  219. package/dist/vendor/core/datetime/panel/controller.d.ts +64 -0
  220. package/dist/vendor/core/datetime/panel/controller.js +191 -0
  221. package/dist/vendor/core/datetime/panel/range-controller.d.ts +71 -0
  222. package/dist/vendor/core/datetime/panel/range-controller.js +205 -0
  223. package/dist/vendor/core/datetime/types.d.ts +12 -0
  224. package/dist/vendor/core/datetime/types.js +1 -0
  225. package/dist/vendor/core/datetime/zone/day-instants.d.ts +19 -0
  226. package/dist/vendor/core/datetime/zone/day-instants.js +52 -0
  227. package/dist/vendor/core/datetime/zone/resolve.d.ts +16 -0
  228. package/dist/vendor/core/datetime/zone/resolve.js +24 -0
  229. package/dist/vendor/core/dom/auto-scroll.d.ts +37 -0
  230. package/dist/vendor/core/dom/auto-scroll.js +57 -0
  231. package/dist/vendor/core/dom/drag-session.d.ts +25 -0
  232. package/dist/vendor/core/dom/drag-session.js +257 -0
  233. package/dist/vendor/core/foundation/a11y/announcer.d.ts +12 -0
  234. package/dist/vendor/core/foundation/a11y/announcer.js +24 -0
  235. package/dist/vendor/core/foundation/a11y/grid-navigation.d.ts +19 -0
  236. package/dist/vendor/core/foundation/a11y/grid-navigation.js +76 -0
  237. package/dist/vendor/core/foundation/a11y/index.d.ts +8 -0
  238. package/dist/vendor/core/foundation/a11y/index.js +5 -0
  239. package/dist/vendor/core/foundation/a11y/labels.d.ts +21 -0
  240. package/dist/vendor/core/foundation/a11y/labels.js +43 -0
  241. package/dist/vendor/core/foundation/a11y/messages.d.ts +80 -0
  242. package/dist/vendor/core/foundation/a11y/messages.js +74 -0
  243. package/dist/vendor/core/foundation/a11y/roving-focus.d.ts +18 -0
  244. package/dist/vendor/core/foundation/a11y/roving-focus.js +73 -0
  245. package/dist/vendor/core/foundation/constraints/availability-rules.d.ts +52 -0
  246. package/dist/vendor/core/foundation/constraints/availability-rules.js +64 -0
  247. package/dist/vendor/core/foundation/constraints/availability.d.ts +93 -0
  248. package/dist/vendor/core/foundation/constraints/availability.js +480 -0
  249. package/dist/vendor/core/foundation/constraints/date.d.ts +21 -0
  250. package/dist/vendor/core/foundation/constraints/date.js +41 -0
  251. package/dist/vendor/core/foundation/constraints/index.d.ts +9 -0
  252. package/dist/vendor/core/foundation/constraints/index.js +4 -0
  253. package/dist/vendor/core/foundation/constraints/range.d.ts +44 -0
  254. package/dist/vendor/core/foundation/constraints/range.js +70 -0
  255. package/dist/vendor/core/foundation/constraints/time.d.ts +30 -0
  256. package/dist/vendor/core/foundation/constraints/time.js +56 -0
  257. package/dist/vendor/core/foundation/grid/index.d.ts +8 -0
  258. package/dist/vendor/core/foundation/grid/index.js +4 -0
  259. package/dist/vendor/core/foundation/grid/month-grid.d.ts +33 -0
  260. package/dist/vendor/core/foundation/grid/month-grid.js +52 -0
  261. package/dist/vendor/core/foundation/grid/time-axis.d.ts +25 -0
  262. package/dist/vendor/core/foundation/grid/time-axis.js +32 -0
  263. package/dist/vendor/core/foundation/grid/weekday-headers.d.ts +17 -0
  264. package/dist/vendor/core/foundation/grid/weekday-headers.js +26 -0
  265. package/dist/vendor/core/foundation/grid/year-grid.d.ts +29 -0
  266. package/dist/vendor/core/foundation/grid/year-grid.js +40 -0
  267. package/dist/vendor/core/foundation/index.d.ts +8 -0
  268. package/dist/vendor/core/foundation/index.js +8 -0
  269. package/dist/vendor/core/foundation/input/form.d.ts +7 -0
  270. package/dist/vendor/core/foundation/input/form.js +10 -0
  271. package/dist/vendor/core/foundation/input/index.d.ts +6 -0
  272. package/dist/vendor/core/foundation/input/index.js +3 -0
  273. package/dist/vendor/core/foundation/input/segment-engine.d.ts +33 -0
  274. package/dist/vendor/core/foundation/input/segment-engine.js +45 -0
  275. package/dist/vendor/core/foundation/input/tokenize.d.ts +19 -0
  276. package/dist/vendor/core/foundation/input/tokenize.js +24 -0
  277. package/dist/vendor/core/foundation/locale/digits.d.ts +6 -0
  278. package/dist/vendor/core/foundation/locale/digits.js +35 -0
  279. package/dist/vendor/core/foundation/locale/direction.d.ts +1 -0
  280. package/dist/vendor/core/foundation/locale/direction.js +25 -0
  281. package/dist/vendor/core/foundation/locale/format.d.ts +31 -0
  282. package/dist/vendor/core/foundation/locale/format.js +77 -0
  283. package/dist/vendor/core/foundation/locale/hour-cycle.d.ts +12 -0
  284. package/dist/vendor/core/foundation/locale/hour-cycle.js +41 -0
  285. package/dist/vendor/core/foundation/locale/index.d.ts +10 -0
  286. package/dist/vendor/core/foundation/locale/index.js +8 -0
  287. package/dist/vendor/core/foundation/locale/names.d.ts +6 -0
  288. package/dist/vendor/core/foundation/locale/names.js +30 -0
  289. package/dist/vendor/core/foundation/locale/resolve.d.ts +7 -0
  290. package/dist/vendor/core/foundation/locale/resolve.js +39 -0
  291. package/dist/vendor/core/foundation/locale/week-info.d.ts +5 -0
  292. package/dist/vendor/core/foundation/locale/week-info.js +60 -0
  293. package/dist/vendor/core/foundation/locale/zone-label.d.ts +6 -0
  294. package/dist/vendor/core/foundation/locale/zone-label.js +24 -0
  295. package/dist/vendor/core/foundation/ranges/date-range.d.ts +18 -0
  296. package/dist/vendor/core/foundation/ranges/date-range.js +40 -0
  297. package/dist/vendor/core/foundation/ranges/index.d.ts +4 -0
  298. package/dist/vendor/core/foundation/ranges/index.js +2 -0
  299. package/dist/vendor/core/foundation/ranges/interval.d.ts +24 -0
  300. package/dist/vendor/core/foundation/ranges/interval.js +54 -0
  301. package/dist/vendor/core/foundation/store/attributes.d.ts +19 -0
  302. package/dist/vendor/core/foundation/store/attributes.js +43 -0
  303. package/dist/vendor/core/foundation/store/controllable.d.ts +19 -0
  304. package/dist/vendor/core/foundation/store/controllable.js +50 -0
  305. package/dist/vendor/core/foundation/store/env.d.ts +1 -0
  306. package/dist/vendor/core/foundation/store/env.js +3 -0
  307. package/dist/vendor/core/foundation/store/ids.d.ts +9 -0
  308. package/dist/vendor/core/foundation/store/ids.js +12 -0
  309. package/dist/vendor/core/foundation/store/index.d.ts +11 -0
  310. package/dist/vendor/core/foundation/store/index.js +7 -0
  311. package/dist/vendor/core/foundation/store/store.d.ts +7 -0
  312. package/dist/vendor/core/foundation/store/store.js +25 -0
  313. package/dist/vendor/core/foundation/store/ticker.d.ts +11 -0
  314. package/dist/vendor/core/foundation/store/ticker.js +27 -0
  315. package/dist/vendor/core/foundation/store/with-optional.d.ts +15 -0
  316. package/dist/vendor/core/foundation/store/with-optional.js +3 -0
  317. package/dist/vendor/core/foundation/values/clock.d.ts +4 -0
  318. package/dist/vendor/core/foundation/values/clock.js +21 -0
  319. package/dist/vendor/core/foundation/values/compare.d.ts +16 -0
  320. package/dist/vendor/core/foundation/values/compare.js +70 -0
  321. package/dist/vendor/core/foundation/values/convert.d.ts +31 -0
  322. package/dist/vendor/core/foundation/values/convert.js +108 -0
  323. package/dist/vendor/core/foundation/values/epoch-day.d.ts +15 -0
  324. package/dist/vendor/core/foundation/values/epoch-day.js +43 -0
  325. package/dist/vendor/core/foundation/values/index.d.ts +14 -0
  326. package/dist/vendor/core/foundation/values/index.js +10 -0
  327. package/dist/vendor/core/foundation/values/iso.d.ts +24 -0
  328. package/dist/vendor/core/foundation/values/iso.js +111 -0
  329. package/dist/vendor/core/foundation/values/plain-date-time.d.ts +8 -0
  330. package/dist/vendor/core/foundation/values/plain-date-time.js +25 -0
  331. package/dist/vendor/core/foundation/values/plain-date.d.ts +33 -0
  332. package/dist/vendor/core/foundation/values/plain-date.js +105 -0
  333. package/dist/vendor/core/foundation/values/plain-time.d.ts +15 -0
  334. package/dist/vendor/core/foundation/values/plain-time.js +43 -0
  335. package/dist/vendor/core/foundation/values/types.d.ts +37 -0
  336. package/dist/vendor/core/foundation/values/types.js +1 -0
  337. package/dist/vendor/core/foundation/values/week.d.ts +9 -0
  338. package/dist/vendor/core/foundation/values/week.js +31 -0
  339. package/dist/vendor/core/foundation/values/year-month.d.ts +10 -0
  340. package/dist/vendor/core/foundation/values/year-month.js +19 -0
  341. package/dist/vendor/core/foundation/values/zoned.d.ts +16 -0
  342. package/dist/vendor/core/foundation/values/zoned.js +152 -0
  343. package/dist/vendor/core/index.d.ts +5 -0
  344. package/dist/vendor/core/index.js +5 -0
  345. package/dist/vendor/core/time/index.d.ts +8 -0
  346. package/dist/vendor/core/time/index.js +8 -0
  347. package/dist/vendor/core/time/input/parse.d.ts +19 -0
  348. package/dist/vendor/core/time/input/parse.js +82 -0
  349. package/dist/vendor/core/time/input/time-input-controller.d.ts +102 -0
  350. package/dist/vendor/core/time/input/time-input-controller.js +547 -0
  351. package/dist/vendor/core/time/input/time-range-input-controller.d.ts +49 -0
  352. package/dist/vendor/core/time/input/time-range-input-controller.js +178 -0
  353. package/dist/vendor/core/time/input/validity.d.ts +7 -0
  354. package/dist/vendor/core/time/input/validity.js +16 -0
  355. package/dist/vendor/core/time/panel/time-panel-controller.d.ts +163 -0
  356. package/dist/vendor/core/time/panel/time-panel-controller.js +809 -0
  357. package/dist/vendor/core/time/selection/range.d.ts +25 -0
  358. package/dist/vendor/core/time/selection/range.js +35 -0
  359. package/dist/vendor/core/time/selection/slots.d.ts +46 -0
  360. package/dist/vendor/core/time/selection/slots.js +76 -0
  361. package/dist/vendor/core/time/types.d.ts +11 -0
  362. package/dist/vendor/core/time/types.js +1 -0
  363. package/package.json +83 -4
@@ -0,0 +1,99 @@
1
+ import { type Attributes, type Messages, type PlainDate, type PlainDateTime, type ZonedDateTime } from "../../foundation/index.js";
2
+ import type { AllDayRowSegment, CalendarEventInput, CalendarEvents, NormalizedEvent } from "../events/types.js";
3
+ import { type EditValue } from "../interaction/drag-geometry.js";
4
+ import { type EditKind, type Shortcuts } from "../interaction/drag-keyboard.js";
5
+ import type { HitTarget } from "../interaction/hit-test.js";
6
+ import type { RecurrenceInfo } from "../recurrence/types.js";
7
+ import { type PendingChange } from "../interaction/pending.js";
8
+ import type { Modifiers } from "./shared.js";
9
+ export type ChangeValue = {
10
+ start: PlainDateTime | ZonedDateTime | PlainDate;
11
+ end: PlainDateTime | ZonedDateTime | PlainDate;
12
+ allDay: boolean;
13
+ };
14
+ /** The proposal a drop emits (plan 09 M2). Values use the types the event used; all-day ends are exclusive. */
15
+ export type EventChangeProposal<TEvent extends CalendarEventInput = CalendarEventInput> = {
16
+ kind: EditKind;
17
+ event: TEvent;
18
+ from: ChangeValue;
19
+ to: ChangeValue;
20
+ source: "pointer" | "keyboard";
21
+ /** The series occurrence this change belongs to (plan 12 RR8). */
22
+ recurrence?: RecurrenceInfo<TEvent>;
23
+ };
24
+ export type DragState<TEvent extends CalendarEventInput = CalendarEventInput> = {
25
+ kind: EditKind;
26
+ /** The segment key the drag started on. */
27
+ segmentKey: string;
28
+ /** The normalized event key. */
29
+ eventKey: string;
30
+ eventId: string | number;
31
+ source: "pointer" | "keyboard";
32
+ from: EditValue;
33
+ to: EditValue;
34
+ /** `false`: the target is not allowed, or `validateEventChange` said no. */
35
+ valid: boolean;
36
+ preview: {
37
+ events: CalendarEvents<TEvent>;
38
+ allDayRow: AllDayRowSegment<TEvent>[];
39
+ };
40
+ };
41
+ export type DragOptions<TEvent extends CalendarEventInput> = {
42
+ editable?: boolean;
43
+ isEventEditable?: (event: TEvent, kind: EditKind) => boolean;
44
+ snapDuration?: number;
45
+ allowAllDayConversion?: boolean;
46
+ defaultTimedDuration?: number;
47
+ onEventChange?: (proposal: EventChangeProposal<TEvent>) => void | boolean | Promise<boolean>;
48
+ validateEventChange?: (proposal: EventChangeProposal<TEvent>) => boolean;
49
+ pendingTimeout?: number;
50
+ keyboardShortcuts?: Partial<Shortcuts> | false;
51
+ getEventLabel?: (event: TEvent) => string;
52
+ announcer?: HTMLElement | false;
53
+ };
54
+ export type DragContext<TEvent extends CalendarEventInput> = {
55
+ options(): DragOptions<TEvent> & {
56
+ timeGrid?: {
57
+ step?: number;
58
+ };
59
+ };
60
+ layoutKind(): "month" | "time-grid" | "list";
61
+ timeZone(): string;
62
+ locale(): string | undefined;
63
+ messages(): Messages;
64
+ rtl(): boolean;
65
+ normalized(): NormalizedEvent<TEvent>[];
66
+ segmentEvent(segmentKey: string): TEvent | undefined;
67
+ /** The normalized occurrence a segment key belongs to (plan 12 RR7). */
68
+ segmentNormalized(segmentKey: string): NormalizedEvent<TEvent> | undefined;
69
+ buildPreview(event: NormalizedEvent<TEvent>): DragState<TEvent>["preview"];
70
+ refresh(): void;
71
+ };
72
+ /** Pointer and keyboard editing of events, and the accepted changes still pending (plan 09). */
73
+ export declare function createDragEngine<TEvent extends CalendarEventInput>(ctx: DragContext<TEvent>): {
74
+ readonly drag: DragState<TEvent> | null;
75
+ readonly pending: PendingChange[];
76
+ isEditing: () => boolean;
77
+ canEdit: (norm: NormalizedEvent<TEvent>, kind: EditKind) => boolean;
78
+ canEditSegment(segmentKey: string, kind: EditKind): boolean;
79
+ /** Start an edit. `hit` is where the pointer grabbed the event (pointer drags). */
80
+ start(kind: EditKind, segmentKey: string, source: "pointer" | "keyboard", hit?: HitTarget): boolean;
81
+ update(hit: HitTarget): void;
82
+ drop(): void;
83
+ cancel(): void;
84
+ /** Keyboard editing keys. Returns `true` when the key was consumed. */
85
+ handleKey(key: string, modifiers: Modifiers): boolean;
86
+ /** The edit a shortcut starts for the focused event, or `null`. */
87
+ shortcut(key: string, modifiers: Modifiers & {
88
+ alt?: boolean;
89
+ }): EditKind | null;
90
+ /** A pending change shows the event at its new position (plan 09 M3). */
91
+ override(norm: NormalizedEvent<TEvent>): NormalizedEvent<TEvent>;
92
+ pendingSignature: () => string;
93
+ /** `events` changed: resolve pending changes, cancel a drag whose event vanished (M14). */
94
+ onEventsChanged(incoming: readonly NormalizedEvent<TEvent>[]): void;
95
+ attributes(segmentKey: string): Attributes;
96
+ resizeHandle(segmentKey: string, edge: "start" | "end"): Attributes;
97
+ dispose(): void;
98
+ };
99
+ export type DragEngine<TEvent extends CalendarEventInput> = ReturnType<typeof createDragEngine<TEvent>>;
@@ -0,0 +1,363 @@
1
+ import { announce, formatDateTime, formatMessage, fromInstant, parseCellKey, plainDate, plainDateTime, toInstant, toZoned, } from "../../foundation/index.js";
2
+ import { grabOf, moveEvent, nudgeEvent, resizeEvent, toSeconds, } from "../interaction/drag-geometry.js";
3
+ import { DEFAULT_SHORTCUTS, editStep, matchShortcut, } from "../interaction/drag-keyboard.js";
4
+ import { unresolved } from "../interaction/pending.js";
5
+ import { withOptional } from "../../foundation/store/with-optional.js";
6
+ const isZonedInput = (value) => (typeof value === "object" && value !== null && "timeZone" in value) ||
7
+ (typeof value === "string" && /\[|Z$|[+-]\d{2}:?\d{2}$/.test(value));
8
+ /** Pointer and keyboard editing of events, and the accepted changes still pending (plan 09). */
9
+ export function createDragEngine(ctx) {
10
+ let drag = null;
11
+ let pending = [];
12
+ let grab = { dayOffset: 0, minuteOffset: 0 };
13
+ let lastAnnounce = 0;
14
+ let token = 0;
15
+ const timers = new Map();
16
+ const shortcuts = () => {
17
+ const configured = ctx.options().keyboardShortcuts;
18
+ return configured === false ? false : { ...DEFAULT_SHORTCUTS, ...configured };
19
+ };
20
+ const geometry = () => {
21
+ const options = ctx.options();
22
+ const slot = options.timeGrid?.step ?? 30;
23
+ return {
24
+ view: ctx.layoutKind() === "month" ? "month" : "time-grid",
25
+ snap: options.snapDuration ?? slot,
26
+ slot,
27
+ allowAllDayConversion: options.allowAllDayConversion ?? true,
28
+ defaultTimedDuration: options.defaultTimedDuration ?? 60,
29
+ };
30
+ };
31
+ const normalizedOf = (segmentKey) => ctx.segmentNormalized(segmentKey);
32
+ const canEdit = (norm, kind) => {
33
+ const options = ctx.options();
34
+ if (!options.editable || ctx.layoutKind() === "list")
35
+ return false;
36
+ const event = norm.event;
37
+ if (event.editable === false)
38
+ return false;
39
+ if (kind === "move" ? event.movable === false : event.resizable === false)
40
+ return false;
41
+ return options.isEventEditable ? options.isEventEditable(event, kind) : true;
42
+ };
43
+ const editValueOf = (norm) => ({
44
+ start: norm.start,
45
+ end: norm.end,
46
+ allDay: norm.allDay,
47
+ });
48
+ const toChange = (norm, value) => {
49
+ const date = (v) => plainDate(v.year, v.month, v.day);
50
+ if (value.allDay) {
51
+ return { start: date(value.start), end: date(value.end), allDay: true };
52
+ }
53
+ if (isZonedInput(norm.event.start)) {
54
+ const zone = ctx.timeZone();
55
+ return {
56
+ start: toZoned(value.start, zone),
57
+ end: toZoned(value.end, zone),
58
+ allDay: false,
59
+ };
60
+ }
61
+ return { start: value.start, end: value.end, allDay: false };
62
+ };
63
+ const proposalOf = (state, norm) => withOptional({
64
+ kind: state.kind,
65
+ event: norm.event,
66
+ from: toChange(norm, state.from),
67
+ to: toChange(norm, state.to),
68
+ source: state.source,
69
+ recurrence: norm.recurrence,
70
+ });
71
+ /** A zoned event keeps its real duration across DST (plan 09 §13.2); plain events keep wall time. */
72
+ const keepRealDuration = (norm, to) => {
73
+ if (to.allDay || !isZonedInput(norm.event.start))
74
+ return to;
75
+ const zone = ctx.timeZone();
76
+ const duration = toInstant(toZoned(norm.end, zone)) - toInstant(toZoned(norm.start, zone));
77
+ const start = toZoned(to.start, zone);
78
+ const end = fromInstant(toInstant(start) + duration, zone);
79
+ return { ...to, end: plainDateTime(end, end) };
80
+ };
81
+ const rangeText = (value) => {
82
+ const locale = ctx.locale();
83
+ const format = {
84
+ weekday: "long",
85
+ hour: "numeric",
86
+ minute: "2-digit",
87
+ };
88
+ return value.allDay
89
+ ? formatDateTime(value.start, locale, {
90
+ weekday: "long",
91
+ day: "numeric",
92
+ month: "long",
93
+ })
94
+ : `${formatDateTime(value.start, locale, format)} – ${formatDateTime(value.end, locale, { hour: "numeric", minute: "2-digit" })}`;
95
+ };
96
+ const say = (template, value, norm) => {
97
+ const label = norm ? (ctx.options().getEventLabel?.(norm.event) ?? String(norm.id)) : "";
98
+ announce(formatMessage(ctx.messages()[template], {
99
+ event: label,
100
+ range: rangeText(value),
101
+ }), ctx.options().announcer);
102
+ };
103
+ const build = (kind, segmentKey, norm, from, candidate, source) => {
104
+ const to = candidate ? (kind === "move" ? keepRealDuration(norm, candidate) : candidate) : from;
105
+ const partial = { kind, from, to, source };
106
+ const valid = candidate !== null &&
107
+ (ctx.options().validateEventChange?.(proposalOf(partial, norm)) ?? true);
108
+ const preview = ctx.buildPreview({
109
+ ...norm,
110
+ key: `${norm.key}:preview`,
111
+ start: to.start,
112
+ end: to.end,
113
+ allDay: to.allDay,
114
+ });
115
+ return {
116
+ ...partial,
117
+ segmentKey,
118
+ eventKey: norm.key,
119
+ eventId: norm.id,
120
+ valid,
121
+ preview,
122
+ };
123
+ };
124
+ const targetOf = (hit) => {
125
+ const { date, time } = parseCellKey(hit.cellKey);
126
+ return withOptional({ date, time, allDayRow: hit.allDay });
127
+ };
128
+ const removePending = (eventKey, expected) => {
129
+ const timer = timers.get(eventKey);
130
+ if (timer !== undefined) {
131
+ clearTimeout(timer);
132
+ timers.delete(eventKey);
133
+ }
134
+ const before = pending.length;
135
+ pending = pending.filter((change) => change.eventKey !== eventKey ||
136
+ (expected !== undefined && tokens.get(eventKey) !== expected));
137
+ if (pending.length !== before)
138
+ tokens.delete(eventKey);
139
+ ctx.refresh();
140
+ };
141
+ const tokens = new Map();
142
+ const commit = (state, norm) => {
143
+ const proposal = proposalOf(state, norm);
144
+ let result;
145
+ try {
146
+ result = ctx.options().onEventChange?.(proposal);
147
+ }
148
+ catch (error) {
149
+ console.error("[chrono] onEventChange threw; the change is rejected.", error);
150
+ say("changeCancelled", state.from);
151
+ return;
152
+ }
153
+ if (result === false) {
154
+ say("changeCancelled", state.from);
155
+ return;
156
+ }
157
+ const mine = ++token;
158
+ tokens.set(norm.key, mine);
159
+ pending = [
160
+ ...pending.filter((change) => change.eventKey !== norm.key),
161
+ { eventKey: norm.key, eventId: norm.id, to: state.to },
162
+ ];
163
+ const timer = timers.get(norm.key);
164
+ if (timer !== undefined)
165
+ clearTimeout(timer);
166
+ timers.set(norm.key, setTimeout(() => removePending(norm.key, mine), ctx.options().pendingTimeout ?? 10_000));
167
+ say(state.kind === "move" ? "movedTo" : "resizedTo", state.to);
168
+ if (result && typeof result.then === "function") {
169
+ result.then((ok) => {
170
+ if (ok === false)
171
+ removePending(norm.key, mine);
172
+ }, (error) => {
173
+ console.error("[chrono] onEventChange rejected; the change is dropped.", error);
174
+ removePending(norm.key, mine);
175
+ });
176
+ }
177
+ };
178
+ const engine = {
179
+ get drag() {
180
+ return drag;
181
+ },
182
+ get pending() {
183
+ return pending;
184
+ },
185
+ isEditing: () => drag !== null && drag.source === "keyboard",
186
+ canEdit,
187
+ canEditSegment(segmentKey, kind) {
188
+ const norm = normalizedOf(segmentKey);
189
+ return !!norm && canEdit(norm, kind);
190
+ },
191
+ /** Start an edit. `hit` is where the pointer grabbed the event (pointer drags). */
192
+ start(kind, segmentKey, source, hit) {
193
+ const norm = normalizedOf(segmentKey);
194
+ if (!norm || !canEdit(norm, kind) || drag)
195
+ return false;
196
+ const from = editValueOf(norm);
197
+ grab = hit ? grabOf(from, targetOf(hit)) : { dayOffset: 0, minuteOffset: 0 };
198
+ drag = build(kind, segmentKey, norm, from, from, source);
199
+ say(kind === "move" ? "moving" : "resizing", from, norm);
200
+ ctx.refresh();
201
+ return true;
202
+ },
203
+ update(hit) {
204
+ if (!drag)
205
+ return;
206
+ const norm = ctx.normalized().find((n) => n.key === drag?.eventKey);
207
+ if (!norm)
208
+ return;
209
+ const target = targetOf(hit);
210
+ const g = geometry();
211
+ const candidate = drag.kind === "move"
212
+ ? moveEvent(drag.from, grab, target, g)
213
+ : resizeEvent(drag.from, drag.kind === "resize-start" ? "start" : "end", target, g);
214
+ const next = build(drag.kind, drag.segmentKey, norm, drag.from, candidate, drag.source);
215
+ if (toSeconds(next.to.start) === toSeconds(drag.to.start) &&
216
+ toSeconds(next.to.end) === toSeconds(drag.to.end) &&
217
+ next.to.allDay === drag.to.allDay &&
218
+ next.valid === drag.valid) {
219
+ return;
220
+ }
221
+ drag = next;
222
+ const now = Date.now();
223
+ if (now - lastAnnounce >= 500) {
224
+ lastAnnounce = now;
225
+ say(drag.valid ? (drag.kind === "move" ? "moving" : "resizing") : "notAllowedHere", drag.to, norm);
226
+ }
227
+ ctx.refresh();
228
+ },
229
+ drop() {
230
+ const current = drag;
231
+ if (!current)
232
+ return;
233
+ const norm = ctx.normalized().find((n) => n.key === current.eventKey);
234
+ drag = null;
235
+ if (norm &&
236
+ current.valid &&
237
+ (toSeconds(current.to.start) !== toSeconds(current.from.start) ||
238
+ toSeconds(current.to.end) !== toSeconds(current.from.end) ||
239
+ current.to.allDay !== current.from.allDay)) {
240
+ commit(current, norm);
241
+ }
242
+ else if (norm && !current.valid) {
243
+ say("notAllowedHere", current.to);
244
+ }
245
+ ctx.refresh();
246
+ },
247
+ cancel() {
248
+ if (!drag)
249
+ return;
250
+ const from = drag.from;
251
+ drag = null;
252
+ say("changeCancelled", from);
253
+ ctx.refresh();
254
+ },
255
+ /** Keyboard editing keys. Returns `true` when the key was consumed. */
256
+ handleKey(key, modifiers) {
257
+ const current = drag;
258
+ if (!current)
259
+ return false;
260
+ if (key === "Tab")
261
+ return true; // focus cannot leave mid-edit
262
+ const step = editStep(current.kind, key, {
263
+ timeGrid: ctx.layoutKind() === "time-grid" && !current.to.allDay,
264
+ snap: geometry().snap,
265
+ rtl: ctx.rtl(),
266
+ });
267
+ void modifiers;
268
+ if (!step)
269
+ return false;
270
+ const norm = ctx.normalized().find((n) => n.key === current.eventKey);
271
+ if (!norm)
272
+ return false;
273
+ if (step.type === "cancel") {
274
+ engine.cancel();
275
+ return true;
276
+ }
277
+ if (step.type === "drop") {
278
+ if (!current.valid) {
279
+ say("notAllowedHere", current.to);
280
+ return true;
281
+ }
282
+ engine.drop();
283
+ return true;
284
+ }
285
+ const moved = nudgeEvent(current.to, current.kind, step, geometry());
286
+ drag = build(current.kind, current.segmentKey, norm, current.from, moved, "keyboard");
287
+ say(drag.valid ? (drag.kind === "move" ? "moving" : "resizing") : "notAllowedHere", drag.to, norm);
288
+ ctx.refresh();
289
+ return true;
290
+ },
291
+ /** The edit a shortcut starts for the focused event, or `null`. */
292
+ shortcut(key, modifiers) {
293
+ return matchShortcut(key, modifiers, shortcuts());
294
+ },
295
+ /** A pending change shows the event at its new position (plan 09 M3). */
296
+ override(norm) {
297
+ const change = pending.find((item) => item.eventKey === norm.key);
298
+ return change
299
+ ? {
300
+ ...norm,
301
+ start: change.to.start,
302
+ end: change.to.end,
303
+ allDay: change.to.allDay,
304
+ }
305
+ : norm;
306
+ },
307
+ pendingSignature: () => pending
308
+ .map((c) => `${c.eventKey}@${toSeconds(c.to.start)}-${toSeconds(c.to.end)}${c.to.allDay ? "d" : ""}`)
309
+ .join(","),
310
+ /** `events` changed: resolve pending changes, cancel a drag whose event vanished (M14). */
311
+ onEventsChanged(incoming) {
312
+ const remaining = unresolved(pending, incoming);
313
+ if (remaining.length !== pending.length) {
314
+ for (const change of pending) {
315
+ if (!remaining.includes(change)) {
316
+ const timer = timers.get(change.eventKey);
317
+ if (timer !== undefined)
318
+ clearTimeout(timer);
319
+ timers.delete(change.eventKey);
320
+ tokens.delete(change.eventKey);
321
+ }
322
+ }
323
+ pending = remaining;
324
+ }
325
+ if (drag && !incoming.some((n) => n.key === drag?.eventKey)) {
326
+ drag = null;
327
+ }
328
+ },
329
+ attributes(segmentKey) {
330
+ const norm = ctx.segmentNormalized(segmentKey);
331
+ const editable = !!norm && (canEdit(norm, "move") || canEdit(norm, "resize-end"));
332
+ const keys = shortcuts();
333
+ return {
334
+ "data-editable": editable,
335
+ "data-dragging": !!drag && !!norm && drag.eventKey === norm.key,
336
+ "data-pending": !!norm && pending.some((c) => c.eventKey === norm.key),
337
+ "aria-keyshortcuts": editable && keys
338
+ ? `${keys.move.toUpperCase()} ${keys.resizeEnd.toUpperCase()} Shift+${keys.resizeEnd.toUpperCase()}`
339
+ : undefined,
340
+ "aria-description": editable ? ctx.messages().editInstructions : undefined,
341
+ };
342
+ },
343
+ resizeHandle(segmentKey, edge) {
344
+ const norm = normalizedOf(segmentKey);
345
+ return {
346
+ "data-chrono-resize": edge,
347
+ // E25/E26: our own handle, and never a native drag source.
348
+ "data-zealakit-gesture-handle": "chrono",
349
+ draggable: "false",
350
+ "aria-hidden": "true",
351
+ "data-disabled": !norm || !canEdit(norm, edge === "start" ? "resize-start" : "resize-end"),
352
+ };
353
+ },
354
+ dispose() {
355
+ for (const timer of timers.values())
356
+ clearTimeout(timer);
357
+ timers.clear();
358
+ drag = null;
359
+ pending = [];
360
+ },
361
+ };
362
+ return engine;
363
+ }
@@ -0,0 +1,66 @@
1
+ import { type Attributes, type DateInput, type DateRange, type DayOfWeek, type Messages, type PlainDate, type WeekdayHeader } from "../../foundation/index.js";
2
+ import { type CalendarTitle } from "../navigation/title.js";
3
+ import { type CalendarDay } from "../views/day.js";
4
+ import type { MonthLayout } from "../views/month-layout.js";
5
+ import { type Modifiers } from "./shared.js";
6
+ export type MonthValue = {
7
+ year: number;
8
+ month: number;
9
+ };
10
+ export type MiniCalendarOptions = {
11
+ id?: string;
12
+ month?: MonthValue;
13
+ defaultMonth?: MonthValue;
14
+ onMonthChange?: (month: MonthValue) => void;
15
+ /** Follow the main calendar when its date leaves the Mini Calendar's month (C11). */
16
+ syncWith?: {
17
+ date: PlainDate;
18
+ visibleRange: DateRange;
19
+ };
20
+ /** For example "has events". */
21
+ isMarked?: (date: PlainDate) => boolean;
22
+ /** Called when a day is clicked or activated with Enter (F2). */
23
+ onNavigate?: (date: PlainDate) => void;
24
+ locale?: string;
25
+ weekStartsOn?: DayOfWeek;
26
+ timeZone?: string;
27
+ now?: number;
28
+ min?: DateInput;
29
+ max?: DateInput;
30
+ weekNumbers?: "iso" | "locale" | false;
31
+ messages?: Partial<Messages>;
32
+ selectedDate?: DateInput;
33
+ highlightedDates?: readonly DateInput[] | ((date: PlainDate) => boolean);
34
+ };
35
+ export type MiniCalendarState = {
36
+ id: string;
37
+ month: MonthValue;
38
+ title: CalendarTitle;
39
+ today: PlainDate;
40
+ focusedDate: PlainDate;
41
+ layout: MonthLayout;
42
+ canGoPrev: boolean;
43
+ canGoNext: boolean;
44
+ direction: "ltr" | "rtl";
45
+ locale?: string;
46
+ messages: Messages;
47
+ };
48
+ export type MiniCalendarController = {
49
+ getState(): MiniCalendarState;
50
+ subscribe(listener: (state: MiniCalendarState) => void): () => void;
51
+ setOptions(options: Partial<MiniCalendarOptions>): void;
52
+ prev(): void;
53
+ next(): void;
54
+ focusDate(date: PlainDate): void;
55
+ activateDate(date: PlainDate, source: "pointer" | "keyboard"): void;
56
+ handleKeyDown(key: string, modifiers: Modifiers): boolean;
57
+ getRootAttributes(): Attributes;
58
+ getTitleAttributes(): Attributes;
59
+ getNavAttributes(kind: "prev" | "next"): Attributes;
60
+ getGridAttributes(): Attributes;
61
+ getColumnHeaderAttributes(header: WeekdayHeader): Attributes;
62
+ getCellAttributes(day: CalendarDay): Attributes;
63
+ getWeekNumberAttributes(weekNumber: number): Attributes;
64
+ destroy(): void;
65
+ };
66
+ export declare function createMiniCalendarController(initial?: MiniCalendarOptions): MiniCalendarController;