@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,37 @@
1
+ /**
2
+ * Candidate A.4 `auto-scroll` — private `src/dom/` module (D35, plan 08-2 Step 4).
3
+ *
4
+ * Edge auto-scroll maths for any pointer drag: speed by distance, the nearest
5
+ * scrollable ancestor, and the per-frame scroll deltas. **Stateless**: it owns
6
+ * no loop, no listener and no timer — the drag session that owns the single
7
+ * frame loop applies `autoScrollStep` in it (NP9). The calendar layer passes
8
+ * the container it already resolved; datagrid will be the 2nd consumer
9
+ * (plan 10).
10
+ *
11
+ * No Chrono types and no DOM access at import time.
12
+ */
13
+ /** Schedule one frame (rAF, or a 16 ms timer where rAF is unavailable). */
14
+ export declare const scheduleFrame: (callback: () => void) => number;
15
+ /** Cancel a frame scheduled by {@link scheduleFrame}. */
16
+ export declare const cancelFrame: (handle: number) => void;
17
+ /** `speed(d) = d >= 40 ? 0 : round(20 · (1 − d / 40))` pixels per frame. */
18
+ export declare function autoScrollSpeed(distance: number): number;
19
+ /** The nearest scrollable ancestor of `element`, or `null`. */
20
+ export declare function scrollParent(element: Element | null): HTMLElement | null;
21
+ export type ScrollDelta = {
22
+ x: number;
23
+ y: number;
24
+ };
25
+ /**
26
+ * The scroll deltas for this pointer position, read from the container's rect.
27
+ * The caller writes them (`scrollLeft`/`scrollTop`) in its own frame loop.
28
+ */
29
+ export declare function autoScrollStep(container: HTMLElement | null, point: {
30
+ x: number;
31
+ y: number;
32
+ }): ScrollDelta;
33
+ /** Scroll `container` one step toward `point`; the caller owns the frame loop. */
34
+ export declare function applyAutoScroll(container: HTMLElement, point: {
35
+ x: number;
36
+ y: number;
37
+ }): void;
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Candidate A.4 `auto-scroll` — private `src/dom/` module (D35, plan 08-2 Step 4).
3
+ *
4
+ * Edge auto-scroll maths for any pointer drag: speed by distance, the nearest
5
+ * scrollable ancestor, and the per-frame scroll deltas. **Stateless**: it owns
6
+ * no loop, no listener and no timer — the drag session that owns the single
7
+ * frame loop applies `autoScrollStep` in it (NP9). The calendar layer passes
8
+ * the container it already resolved; datagrid will be the 2nd consumer
9
+ * (plan 10).
10
+ *
11
+ * No Chrono types and no DOM access at import time.
12
+ */
13
+ const hasFrames = typeof requestAnimationFrame === "function";
14
+ /** Schedule one frame (rAF, or a 16 ms timer where rAF is unavailable). */
15
+ export const scheduleFrame = (callback) => hasFrames ? requestAnimationFrame(callback) : setTimeout(callback, 16);
16
+ /** Cancel a frame scheduled by {@link scheduleFrame}. */
17
+ export const cancelFrame = (handle) => hasFrames
18
+ ? cancelAnimationFrame(handle)
19
+ : clearTimeout(handle);
20
+ /** `speed(d) = d >= 40 ? 0 : round(20 · (1 − d / 40))` pixels per frame. */
21
+ export function autoScrollSpeed(distance) {
22
+ const d = Math.max(0, distance);
23
+ return d >= 40 ? 0 : Math.round(20 * (1 - d / 40));
24
+ }
25
+ /** The nearest scrollable ancestor of `element`, or `null`. */
26
+ export function scrollParent(element) {
27
+ let node = element?.parentElement ?? null;
28
+ while (node) {
29
+ const style = getComputedStyle(node);
30
+ if (/(auto|scroll)/.test(`${style.overflowY} ${style.overflowX}`)) {
31
+ return node;
32
+ }
33
+ node = node.parentElement;
34
+ }
35
+ return null;
36
+ }
37
+ /**
38
+ * The scroll deltas for this pointer position, read from the container's rect.
39
+ * The caller writes them (`scrollLeft`/`scrollTop`) in its own frame loop.
40
+ */
41
+ export function autoScrollStep(container, point) {
42
+ if (!container) {
43
+ return { x: 0, y: 0 };
44
+ }
45
+ const rect = container.getBoundingClientRect();
46
+ const y = autoScrollSpeed(point.y - rect.top) * -1 + autoScrollSpeed(rect.bottom - point.y);
47
+ const x = autoScrollSpeed(point.x - rect.left) * -1 + autoScrollSpeed(rect.right - point.x);
48
+ return { x, y };
49
+ }
50
+ /** Scroll `container` one step toward `point`; the caller owns the frame loop. */
51
+ export function applyAutoScroll(container, point) {
52
+ const delta = autoScrollStep(container, point);
53
+ if (delta.x !== 0 || delta.y !== 0) {
54
+ container.scrollLeft += delta.x;
55
+ container.scrollTop += delta.y;
56
+ }
57
+ }
@@ -0,0 +1,25 @@
1
+ /** A pointer position in client coordinates. */
2
+ export type DragPoint = {
3
+ x: number;
4
+ y: number;
5
+ };
6
+ export type DragSessionOptions<TPress, THit = TPress> = {
7
+ root: HTMLElement;
8
+ /** Free-form gesture kind, e.g. `"chrono-calendar-drag"`. */
9
+ gestureKind: string;
10
+ /** Candidate for a press; return `null` to ignore it (not draggable). */
11
+ press: (event: PointerEvent) => TPress | null;
12
+ /** Whether a pointer position hits a drag target (used by begin and move). */
13
+ hitTest: (point: DragPoint) => THit | null;
14
+ /** Start the drag; return `false` to refuse it (the claim is released). */
15
+ begin: (pressed: TPress, hit: THit | null, point: DragPoint) => boolean;
16
+ update: (hit: THit) => void;
17
+ drop: () => void;
18
+ cancel: () => void;
19
+ /** Scroll container for auto-scroll; `false` turns it off. */
20
+ scroll?: (() => HTMLElement | null | false) | undefined;
21
+ };
22
+ export type DragSession = {
23
+ destroy(): void;
24
+ };
25
+ export declare function createDragSession<TPress, THit = TPress>(options: DragSessionOptions<TPress, THit>): DragSession;
@@ -0,0 +1,257 @@
1
+ /**
2
+ * Candidate A.4 `drag-session` — private `src/dom/` module (D35, plan 08-2 Step 4).
3
+ *
4
+ * The generic pointer-drag mechanics: primary button only, a pixel threshold for
5
+ * mouse, a long press for touch, pointer capture **after** the engine gesture
6
+ * claim (E23), the engine gesture claim itself (§13.2), a temporary engine layer
7
+ * so Escape cancels the drag before any popover below it (§4, Step 3), one frame
8
+ * loop shared by move and edge auto-scroll (NP9), click suppression after a
9
+ * drag, the engine cursor/user-select interaction lock (§13.7), and idempotent
10
+ * cleanup.
11
+ *
12
+ * Calendar rules (what a drag means, snapping, proposals) stay in
13
+ * `calendar/interaction/drag-pointer.ts`; datagrid is the 2nd consumer
14
+ * (plan 10). No Chrono types are imported here: the calendar passes callbacks.
15
+ *
16
+ * The app or component must set `touch-action: none` on the drag handle before
17
+ * `pointerdown`: pointer events only report a touch drag while the browser does
18
+ * not scroll, so the component owns that CSS expectation. As a fallback,
19
+ * `touchmove` is prevented while a touch drag runs. No styles are injected.
20
+ */
21
+ import { createLayer } from "@zealakit/ui-engine";
22
+ import { acquireInteractionLock, claimGesture, } from "@zealakit/ui-engine/internal";
23
+ import { applyAutoScroll, cancelFrame, scheduleFrame, scrollParent } from "./auto-scroll.js";
24
+ /** Mouse movement that starts a drag. */
25
+ const THRESHOLD = 4;
26
+ /** Touch movement that turns a pending long press into a scroll. */
27
+ const TOUCH_SLOP = 8;
28
+ /** Touch long-press delay. */
29
+ const LONG_PRESS_MS = 400;
30
+ export function createDragSession(options) {
31
+ const { root, gestureKind, press, hitTest, begin: beginDrag, update, drop, cancel, scroll, } = options;
32
+ let pressed = null;
33
+ let dragging = false;
34
+ let longPress;
35
+ let pendingFrame = 0;
36
+ let lastPoint;
37
+ let pendingMove;
38
+ let claim = null;
39
+ let layer = null;
40
+ let lock = null;
41
+ let swallowClick = false;
42
+ const finish = () => {
43
+ clearTimeout(longPress);
44
+ longPress = undefined;
45
+ cancelFrame(pendingFrame);
46
+ pendingFrame = 0;
47
+ listen(false);
48
+ if (pressed) {
49
+ try {
50
+ pressed.element.releasePointerCapture?.(pressed.id);
51
+ }
52
+ catch {
53
+ // The pointer may already be gone.
54
+ }
55
+ }
56
+ lock?.release();
57
+ lock = null;
58
+ layer?.release();
59
+ layer = null;
60
+ claim?.release();
61
+ claim = null;
62
+ pressed = null;
63
+ dragging = false;
64
+ lastPoint = undefined;
65
+ };
66
+ const frameTick = () => {
67
+ pendingFrame = 0;
68
+ if (!dragging) {
69
+ return;
70
+ }
71
+ if (pendingMove) {
72
+ const hit = hitTest(pendingMove);
73
+ pendingMove = undefined;
74
+ if (hit) {
75
+ update(hit);
76
+ }
77
+ }
78
+ // No auto-scroll until the pointer has moved: a long press near an edge waits.
79
+ if (lastPoint) {
80
+ const configured = scroll?.();
81
+ const node = configured === false ? null : (configured ?? scrollParent(root));
82
+ if (node) {
83
+ applyAutoScroll(node, lastPoint);
84
+ }
85
+ }
86
+ pendingFrame = scheduleFrame(frameTick);
87
+ };
88
+ const abort = () => {
89
+ cancel();
90
+ finish();
91
+ };
92
+ const begin = () => {
93
+ if (!pressed || dragging) {
94
+ return false;
95
+ }
96
+ // §13.2: the first claimant wins; a null claim means another part of the
97
+ // page owns the gesture, so we neither capture nor start.
98
+ claim = claimGesture({
99
+ element: root,
100
+ kind: gestureKind,
101
+ pointerId: pressed.id,
102
+ cancel: abort,
103
+ });
104
+ if (!claim) {
105
+ return false;
106
+ }
107
+ // E23: capture only after the claim is ours.
108
+ try {
109
+ pressed.element.setPointerCapture?.(pressed.id);
110
+ }
111
+ catch {
112
+ // setPointerCapture throws for inactive pointers.
113
+ }
114
+ const point = { x: pressed.x, y: pressed.y };
115
+ const hit = hitTest(point);
116
+ if (!beginDrag(pressed.target, hit, point)) {
117
+ return false; // every caller then calls `finish()`, which releases the claim
118
+ }
119
+ dragging = true;
120
+ // §4 recipe: a drag is a temporary layer. Escape cancels the drag before
121
+ // any popover under it closes; outside presses never end a drag (E6).
122
+ layer = createLayer({
123
+ element: root,
124
+ dismiss: { escapeKey: true, outsidePress: false },
125
+ onDismiss: abort,
126
+ });
127
+ listen(true);
128
+ // §13.7: owned by the claim, so cancelling or pruning it unlocks the page.
129
+ lock = acquireInteractionLock({ gestureId: claim.id });
130
+ // NP9: the single loop drives both the drag updates and auto-scroll.
131
+ pendingFrame = scheduleFrame(frameTick);
132
+ return true;
133
+ };
134
+ // A root removed without `destroy()` never gets its own `pointerup`.
135
+ function onLostPointer(event) {
136
+ if (!root.isConnected) {
137
+ onCancel(event);
138
+ }
139
+ }
140
+ function onTouchMove(event) {
141
+ event.preventDefault();
142
+ }
143
+ /** E26: a native drag cannot run inside a pointer session. */
144
+ function onDragStart(event) {
145
+ event.preventDefault();
146
+ abort();
147
+ }
148
+ /** The listeners that exist only while a drag runs. */
149
+ function listen(on) {
150
+ const method = on ? "addEventListener" : "removeEventListener";
151
+ root[method]("dragstart", onDragStart);
152
+ window[method]("blur", abort);
153
+ window[method]("pointerup", onLostPointer);
154
+ window[method]("pointercancel", onLostPointer);
155
+ if (pressed?.touch) {
156
+ document[method]("touchmove", onTouchMove, { passive: false });
157
+ }
158
+ }
159
+ const onDown = (event) => {
160
+ if (event.button !== 0 || pressed) {
161
+ return;
162
+ }
163
+ const target = press(event);
164
+ if (target === null) {
165
+ return;
166
+ }
167
+ pressed = {
168
+ target,
169
+ x: event.clientX,
170
+ y: event.clientY,
171
+ id: event.pointerId,
172
+ touch: event.pointerType === "touch",
173
+ element: event.target,
174
+ };
175
+ if (pressed.touch) {
176
+ longPress = setTimeout(() => {
177
+ longPress = undefined;
178
+ if (!begin()) {
179
+ finish();
180
+ }
181
+ }, LONG_PRESS_MS);
182
+ }
183
+ };
184
+ const onMove = (event) => {
185
+ if (!pressed || event.pointerId !== pressed.id) {
186
+ return;
187
+ }
188
+ if (!dragging) {
189
+ const slop = pressed.touch ? TOUCH_SLOP : THRESHOLD;
190
+ const far = Math.abs(event.clientX - pressed.x) > slop || Math.abs(event.clientY - pressed.y) > slop;
191
+ if (pressed.touch) {
192
+ if (far && longPress !== undefined) {
193
+ finish(); // the finger scrolled: no drag
194
+ }
195
+ return;
196
+ }
197
+ if (!far) {
198
+ return;
199
+ }
200
+ if (!begin()) {
201
+ finish();
202
+ return;
203
+ }
204
+ }
205
+ // NP9: pointermove only stores the latest event; the frame loop applies it.
206
+ lastPoint = { x: event.clientX, y: event.clientY };
207
+ pendingMove = lastPoint;
208
+ if (pendingFrame === 0) {
209
+ pendingFrame = scheduleFrame(frameTick);
210
+ }
211
+ };
212
+ const onUp = (event) => {
213
+ if (!pressed || event.pointerId !== pressed.id) {
214
+ return;
215
+ }
216
+ if (dragging) {
217
+ swallowClick = true;
218
+ drop();
219
+ }
220
+ finish();
221
+ };
222
+ const onCancel = (event) => {
223
+ if (!pressed || event.pointerId !== pressed.id) {
224
+ return;
225
+ }
226
+ if (dragging) {
227
+ cancel();
228
+ }
229
+ finish();
230
+ };
231
+ /** The click after a real drag must not select or activate the target. */
232
+ const onClick = (event) => {
233
+ if (swallowClick) {
234
+ swallowClick = false;
235
+ event.stopPropagation();
236
+ event.preventDefault();
237
+ }
238
+ };
239
+ root.addEventListener("pointerdown", onDown);
240
+ root.addEventListener("pointermove", onMove);
241
+ root.addEventListener("pointerup", onUp);
242
+ root.addEventListener("pointercancel", onCancel);
243
+ root.addEventListener("click", onClick, true);
244
+ return {
245
+ destroy() {
246
+ if (dragging) {
247
+ cancel();
248
+ }
249
+ finish();
250
+ root.removeEventListener("pointerdown", onDown);
251
+ root.removeEventListener("pointermove", onMove);
252
+ root.removeEventListener("pointerup", onUp);
253
+ root.removeEventListener("pointercancel", onCancel);
254
+ root.removeEventListener("click", onClick, true);
255
+ },
256
+ };
257
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Announce `message` through a polite live region.
3
+ *
4
+ * Without an element, the engine owns the page-wide live region (created
5
+ * lazily, shared by every engine copy, cleared after 7 s). Passing an app
6
+ * element keeps Chrono's old escape hatch and writes to that element directly;
7
+ * `false` disables announcements. A no-op outside the browser.
8
+ *
9
+ * @param message Text to announce.
10
+ * @param element Optional app-owned live region, or `false` to disable.
11
+ */
12
+ export declare function announce(message: string, element?: HTMLElement | false): void;
@@ -0,0 +1,24 @@
1
+ import { announce as engineAnnounce } from "@zealakit/ui-engine";
2
+ import { isBrowser } from "../store/env.js";
3
+ /**
4
+ * Announce `message` through a polite live region.
5
+ *
6
+ * Without an element, the engine owns the page-wide live region (created
7
+ * lazily, shared by every engine copy, cleared after 7 s). Passing an app
8
+ * element keeps Chrono's old escape hatch and writes to that element directly;
9
+ * `false` disables announcements. A no-op outside the browser.
10
+ *
11
+ * @param message Text to announce.
12
+ * @param element Optional app-owned live region, or `false` to disable.
13
+ */
14
+ export function announce(message, element) {
15
+ if (element === false || !isBrowser()) {
16
+ return;
17
+ }
18
+ if (element !== undefined) {
19
+ element.textContent = "";
20
+ element.textContent = message;
21
+ return;
22
+ }
23
+ engineAnnounce(message);
24
+ }
@@ -0,0 +1,19 @@
1
+ import type { DayOfWeek, PlainDate } from "../values/types.js";
2
+ export type GridNavKey = "ArrowLeft" | "ArrowRight" | "ArrowUp" | "ArrowDown" | "Home" | "End" | "PageUp" | "PageDown";
3
+ export type GridNavContext = {
4
+ weekStartsOn: DayOfWeek;
5
+ direction: "ltr" | "rtl";
6
+ min?: PlainDate | undefined;
7
+ max?: PlainDate | undefined;
8
+ level: "day" | "month" | "year";
9
+ /** Cells per row of the month and year grids (default 4). */
10
+ columns?: number;
11
+ };
12
+ /**
13
+ * Pure key to next-focus mapping for a date grid. It never touches the DOM.
14
+ * Disabled dates are not skipped: they stay focusable (APG, D14). Results are
15
+ * clamped to `min` and `max`.
16
+ */
17
+ export declare function nextFocusedDate(current: PlainDate, key: GridNavKey, modifiers: {
18
+ shift: boolean;
19
+ }, ctx: GridNavContext): PlainDate;
@@ -0,0 +1,76 @@
1
+ import { addDays, addMonths, addYears, endOfWeek, plainDate, startOfWeek, } from "../values/plain-date.js";
2
+ import { compare } from "../values/compare.js";
3
+ function clamp(date, ctx) {
4
+ if (ctx.min && compare(date, ctx.min) < 0) {
5
+ return ctx.min;
6
+ }
7
+ if (ctx.max && compare(date, ctx.max) > 0) {
8
+ return ctx.max;
9
+ }
10
+ return date;
11
+ }
12
+ /** `addDays` and friends throw outside years 1-9999; pin to the bounds instead. */
13
+ function safely(move, towardsEnd) {
14
+ try {
15
+ return move();
16
+ }
17
+ catch {
18
+ return towardsEnd ? plainDate(9999, 12, 31) : plainDate(1, 1, 1);
19
+ }
20
+ }
21
+ /**
22
+ * Pure key to next-focus mapping for a date grid. It never touches the DOM.
23
+ * Disabled dates are not skipped: they stay focusable (APG, D14). Results are
24
+ * clamped to `min` and `max`.
25
+ */
26
+ export function nextFocusedDate(current, key, modifiers, ctx) {
27
+ const rtl = ctx.direction === "rtl";
28
+ const columns = ctx.columns ?? 4;
29
+ const horizontal = key === "ArrowLeft" ? (rtl ? 1 : -1) : key === "ArrowRight" ? (rtl ? -1 : 1) : 0;
30
+ const vertical = key === "ArrowUp" ? -1 : key === "ArrowDown" ? 1 : 0;
31
+ const page = key === "PageUp" ? -1 : key === "PageDown" ? 1 : 0;
32
+ const forward = horizontal > 0 || vertical > 0 || page > 0 || key === "End";
33
+ const move = () => {
34
+ if (ctx.level === "day") {
35
+ if (horizontal)
36
+ return addDays(current, horizontal);
37
+ if (vertical)
38
+ return addDays(current, vertical * 7);
39
+ if (key === "Home")
40
+ return startOfWeek(current, ctx.weekStartsOn);
41
+ if (key === "End")
42
+ return endOfWeek(current, ctx.weekStartsOn);
43
+ return modifiers.shift ? addYears(current, page) : addMonths(current, page);
44
+ }
45
+ if (ctx.level === "month") {
46
+ if (horizontal)
47
+ return addMonths(current, horizontal);
48
+ if (vertical)
49
+ return addMonths(current, vertical * columns);
50
+ if (key === "Home")
51
+ return plainDate(current.year, 1, current.day, {
52
+ overflow: "constrain",
53
+ });
54
+ if (key === "End")
55
+ return plainDate(current.year, 12, current.day, {
56
+ overflow: "constrain",
57
+ });
58
+ return addYears(current, modifiers.shift ? page * 10 : page);
59
+ }
60
+ if (horizontal)
61
+ return addYears(current, horizontal);
62
+ if (vertical)
63
+ return addYears(current, vertical * columns);
64
+ const decade = Math.floor(current.year / 10) * 10;
65
+ if (key === "Home")
66
+ return plainDate(Math.max(decade, 1), current.month, current.day, {
67
+ overflow: "constrain",
68
+ });
69
+ if (key === "End")
70
+ return plainDate(Math.min(decade + 9, 9999), current.month, current.day, {
71
+ overflow: "constrain",
72
+ });
73
+ return addYears(current, page * (modifiers.shift ? 100 : 10));
74
+ };
75
+ return clamp(safely(move, forward), ctx);
76
+ }
@@ -0,0 +1,8 @@
1
+ export { nextFocusedDate } from "./grid-navigation.js";
2
+ export type { GridNavContext, GridNavKey } from "./grid-navigation.js";
3
+ export { getDateLabel, getRangeLabel, getTimeLabel } from "./labels.js";
4
+ export type { LabelStatus } from "./labels.js";
5
+ export { defaultMessages, formatMessage, mergeMessages } from "./messages.js";
6
+ export { focusDateCell, focusPart, scrollOptionIntoView, syncRovingTabIndex, } from "./roving-focus.js";
7
+ export { announce } from "./announcer.js";
8
+ export type { Messages, TimeMessages } from "./messages.js";
@@ -0,0 +1,5 @@
1
+ export { nextFocusedDate } from "./grid-navigation.js";
2
+ export { getDateLabel, getRangeLabel, getTimeLabel } from "./labels.js";
3
+ export { defaultMessages, formatMessage, mergeMessages } from "./messages.js";
4
+ export { focusDateCell, focusPart, scrollOptionIntoView, syncRovingTabIndex, } from "./roving-focus.js";
5
+ export { announce } from "./announcer.js";
@@ -0,0 +1,21 @@
1
+ import type { DateRange } from "../ranges/date-range.js";
2
+ import type { PlainDate, PlainTime } from "../values/types.js";
3
+ import { type Messages } from "./messages.js";
4
+ export type LabelStatus = {
5
+ today?: boolean;
6
+ selected?: boolean;
7
+ unavailable?: boolean;
8
+ partiallyAvailable?: boolean;
9
+ disabled?: boolean;
10
+ /** Extra wording, e.g. a blocked rule's reason (plan 11 V12). */
11
+ reason?: string;
12
+ rangeStart?: boolean;
13
+ rangeEnd?: boolean;
14
+ inRange?: boolean;
15
+ };
16
+ /** For example "Tuesday, November 17, 2026, today, selected". */
17
+ export declare function getDateLabel(date: PlainDate, locale: string | undefined, status?: LabelStatus, messages?: Messages): string;
18
+ /** For example "3:30 PM, selected". */
19
+ export declare function getTimeLabel(time: PlainTime, locale: string | undefined, status?: LabelStatus, messages?: Messages): string;
20
+ /** For example "November 17 – 20, 2026". */
21
+ export declare function getRangeLabel(range: DateRange, locale: string | undefined): string;
@@ -0,0 +1,43 @@
1
+ import { formatDate, formatDateRange, formatTime } from "../locale/format.js";
2
+ import { defaultMessages } from "./messages.js";
3
+ const STATE_ORDER = [
4
+ "today",
5
+ "rangeStart",
6
+ "rangeEnd",
7
+ "inRange",
8
+ "selected",
9
+ "unavailable",
10
+ "partiallyAvailable",
11
+ "disabled",
12
+ ];
13
+ function words(status, messages) {
14
+ const words = STATE_ORDER.filter((key) => status[key]).map((key) => messages[key]);
15
+ return status.reason ? [...words, status.reason] : words;
16
+ }
17
+ /** For example "Tuesday, November 17, 2026, today, selected". */
18
+ export function getDateLabel(date, locale, status = {}, messages = defaultMessages) {
19
+ const text = formatDate(date, locale, {
20
+ weekday: "long",
21
+ year: "numeric",
22
+ month: "long",
23
+ day: "numeric",
24
+ });
25
+ return [text, ...words(status, messages)].join(", ");
26
+ }
27
+ /** For example "3:30 PM, selected". */
28
+ export function getTimeLabel(time, locale, status = {}, messages = defaultMessages) {
29
+ const text = formatTime(time, locale, {
30
+ hour: "numeric",
31
+ minute: "2-digit",
32
+ second: time.second === 0 ? undefined : "2-digit",
33
+ });
34
+ return [text, ...words(status, messages)].join(", ");
35
+ }
36
+ /** For example "November 17 – 20, 2026". */
37
+ export function getRangeLabel(range, locale) {
38
+ return formatDateRange(range, locale, {
39
+ year: "numeric",
40
+ month: "long",
41
+ day: "numeric",
42
+ });
43
+ }
@@ -0,0 +1,80 @@
1
+ /** Words for states that `Intl` has no names for (D13). Only English ships. */
2
+ export type Messages = {
3
+ today: string;
4
+ selected: string;
5
+ unavailable: string;
6
+ partiallyAvailable: string;
7
+ disabled: string;
8
+ rangeStart: string;
9
+ rangeEnd: string;
10
+ inRange: string;
11
+ /** Accessible names for calendar controls. */
12
+ previous: string;
13
+ next: string;
14
+ goToToday: string;
15
+ calendar: string;
16
+ /** `{number}` is replaced by the week number. */
17
+ weekNumber: string;
18
+ hasEvents: string;
19
+ /** Event-related (plan 05 §2.6). */
20
+ events: string;
21
+ /** `{count}` is replaced by the number of hidden events. */
22
+ moreEvents: string;
23
+ allDay: string;
24
+ /** `{count}` is replaced by the event count of a cell. */
25
+ cellEvents: string;
26
+ /** `{range}` is replaced by the selected range label. */
27
+ selectionCreated: string;
28
+ selectionCancelled: string;
29
+ eventSelected: string;
30
+ /** One of a recurring series (plan 12). */
31
+ recurring: string;
32
+ /** Editing events (plan 09). `{event}` and `{range}` are replaced. */
33
+ editInstructions: string;
34
+ moving: string;
35
+ resizing: string;
36
+ movedTo: string;
37
+ resizedTo: string;
38
+ changeCancelled: string;
39
+ notAllowedHere: string;
40
+ /** Date panels and inputs (plan 06). */
41
+ chooseMonth: string;
42
+ chooseYear: string;
43
+ clear: string;
44
+ startDate: string;
45
+ endDate: string;
46
+ /** `{count}` is replaced by the number of selected dates. */
47
+ selectedCount: string;
48
+ placeholderDay: string;
49
+ placeholderMonth: string;
50
+ placeholderYear: string;
51
+ day: string;
52
+ month: string;
53
+ year: string;
54
+ empty: string;
55
+ /** Time inputs and panels (plan 07). */
56
+ placeholderHour: string;
57
+ placeholderMinute: string;
58
+ placeholderSecond: string;
59
+ placeholderDayPeriod: string;
60
+ hour: string;
61
+ minute: string;
62
+ second: string;
63
+ dayPeriod: string;
64
+ startTime: string;
65
+ endTime: string;
66
+ time: string;
67
+ /** Date-time inputs and panels (plan 08). */
68
+ date: string;
69
+ /** The note for a wall time moved by a daylight-saving gap. */
70
+ adjustedTime: string;
71
+ timeZone: string;
72
+ startDateTime: string;
73
+ endDateTime: string;
74
+ };
75
+ /** The same flat type serves every domain. */
76
+ export type TimeMessages = Messages;
77
+ export declare const defaultMessages: Readonly<Messages>;
78
+ /** Replace `{name}` placeholders in a message template. */
79
+ export declare function formatMessage(template: string, values: Readonly<Record<string, string | number>>): string;
80
+ export declare function mergeMessages(defaults: Readonly<Messages>, overrides?: Partial<Messages>): Messages;