react-native-agenda-kit 0.1.0

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 (403) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +364 -0
  3. package/lib/commonjs/agenda/AgendaBackdrop.js +68 -0
  4. package/lib/commonjs/agenda/AgendaBackdrop.js.map +1 -0
  5. package/lib/commonjs/agenda/AgendaList.js +354 -0
  6. package/lib/commonjs/agenda/AgendaList.js.map +1 -0
  7. package/lib/commonjs/agenda/AgendaSlot.js +88 -0
  8. package/lib/commonjs/agenda/AgendaSlot.js.map +1 -0
  9. package/lib/commonjs/agenda/AgendaWindow.js +171 -0
  10. package/lib/commonjs/agenda/AgendaWindow.js.map +1 -0
  11. package/lib/commonjs/agenda/StickyHeaderOverlay.js +125 -0
  12. package/lib/commonjs/agenda/StickyHeaderOverlay.js.map +1 -0
  13. package/lib/commonjs/agenda/buildAgendaLayout.js +100 -0
  14. package/lib/commonjs/agenda/buildAgendaLayout.js.map +1 -0
  15. package/lib/commonjs/agenda/constants.js +29 -0
  16. package/lib/commonjs/agenda/constants.js.map +1 -0
  17. package/lib/commonjs/agenda/heights.js +49 -0
  18. package/lib/commonjs/agenda/heights.js.map +1 -0
  19. package/lib/commonjs/agenda/useAgendaScrollSync.js +204 -0
  20. package/lib/commonjs/agenda/useAgendaScrollSync.js.map +1 -0
  21. package/lib/commonjs/core/ArrowGlyph.js +65 -0
  22. package/lib/commonjs/core/ArrowGlyph.js.map +1 -0
  23. package/lib/commonjs/core/CalendarContext.js +32 -0
  24. package/lib/commonjs/core/CalendarContext.js.map +1 -0
  25. package/lib/commonjs/core/CalendarProvider.js +141 -0
  26. package/lib/commonjs/core/CalendarProvider.js.map +1 -0
  27. package/lib/commonjs/core/CalendarStore.js +70 -0
  28. package/lib/commonjs/core/CalendarStore.js.map +1 -0
  29. package/lib/commonjs/core/KitText.js +23 -0
  30. package/lib/commonjs/core/KitText.js.map +1 -0
  31. package/lib/commonjs/core/TodayButton.js +136 -0
  32. package/lib/commonjs/core/TodayButton.js.map +1 -0
  33. package/lib/commonjs/core/civil.js +101 -0
  34. package/lib/commonjs/core/civil.js.map +1 -0
  35. package/lib/commonjs/core/dateKey.js +56 -0
  36. package/lib/commonjs/core/dateKey.js.map +1 -0
  37. package/lib/commonjs/core/motion.js +56 -0
  38. package/lib/commonjs/core/motion.js.map +1 -0
  39. package/lib/commonjs/core/worklets.js +44 -0
  40. package/lib/commonjs/core/worklets.js.map +1 -0
  41. package/lib/commonjs/expandable/DayCell.js +120 -0
  42. package/lib/commonjs/expandable/DayCell.js.map +1 -0
  43. package/lib/commonjs/expandable/ExpandableCalendar.js +280 -0
  44. package/lib/commonjs/expandable/ExpandableCalendar.js.map +1 -0
  45. package/lib/commonjs/expandable/Knob.js +72 -0
  46. package/lib/commonjs/expandable/Knob.js.map +1 -0
  47. package/lib/commonjs/expandable/MonthPager.js +180 -0
  48. package/lib/commonjs/expandable/MonthPager.js.map +1 -0
  49. package/lib/commonjs/expandable/WeekStrip.js +451 -0
  50. package/lib/commonjs/expandable/WeekStrip.js.map +1 -0
  51. package/lib/commonjs/expandable/calendarCells.js +152 -0
  52. package/lib/commonjs/expandable/calendarCells.js.map +1 -0
  53. package/lib/commonjs/expandable/geometry.js +62 -0
  54. package/lib/commonjs/expandable/geometry.js.map +1 -0
  55. package/lib/commonjs/expandable/useExpandGesture.js +124 -0
  56. package/lib/commonjs/expandable/useExpandGesture.js.map +1 -0
  57. package/lib/commonjs/expandable/useHorizontalPager.js +97 -0
  58. package/lib/commonjs/expandable/useHorizontalPager.js.map +1 -0
  59. package/lib/commonjs/index.js +167 -0
  60. package/lib/commonjs/index.js.map +1 -0
  61. package/lib/commonjs/package.json +1 -0
  62. package/lib/commonjs/theme/ThemeProvider.js +73 -0
  63. package/lib/commonjs/theme/ThemeProvider.js.map +1 -0
  64. package/lib/commonjs/theme/index.js +75 -0
  65. package/lib/commonjs/theme/index.js.map +1 -0
  66. package/lib/commonjs/theme/theme.js +79 -0
  67. package/lib/commonjs/theme/theme.js.map +1 -0
  68. package/lib/commonjs/theme/tokens.js +54 -0
  69. package/lib/commonjs/theme/tokens.js.map +1 -0
  70. package/lib/commonjs/timeline/DayColumn.js +95 -0
  71. package/lib/commonjs/timeline/DayColumn.js.map +1 -0
  72. package/lib/commonjs/timeline/DayPager.js +250 -0
  73. package/lib/commonjs/timeline/DayPager.js.map +1 -0
  74. package/lib/commonjs/timeline/EventBlock.js +91 -0
  75. package/lib/commonjs/timeline/EventBlock.js.map +1 -0
  76. package/lib/commonjs/timeline/GridLines.js +47 -0
  77. package/lib/commonjs/timeline/GridLines.js.map +1 -0
  78. package/lib/commonjs/timeline/HourGrid.js +96 -0
  79. package/lib/commonjs/timeline/HourGrid.js.map +1 -0
  80. package/lib/commonjs/timeline/NowIndicator.js +132 -0
  81. package/lib/commonjs/timeline/NowIndicator.js.map +1 -0
  82. package/lib/commonjs/timeline/TimelineDay.js +126 -0
  83. package/lib/commonjs/timeline/TimelineDay.js.map +1 -0
  84. package/lib/commonjs/timeline/packEvents.js +102 -0
  85. package/lib/commonjs/timeline/packEvents.js.map +1 -0
  86. package/lib/commonjs/timeline/timelineGeometry.js +27 -0
  87. package/lib/commonjs/timeline/timelineGeometry.js.map +1 -0
  88. package/lib/commonjs/timeline/timelineMath.js +82 -0
  89. package/lib/commonjs/timeline/timelineMath.js.map +1 -0
  90. package/lib/commonjs/types.js +71 -0
  91. package/lib/commonjs/types.js.map +1 -0
  92. package/lib/module/agenda/AgendaBackdrop.js +63 -0
  93. package/lib/module/agenda/AgendaBackdrop.js.map +1 -0
  94. package/lib/module/agenda/AgendaList.js +349 -0
  95. package/lib/module/agenda/AgendaList.js.map +1 -0
  96. package/lib/module/agenda/AgendaSlot.js +84 -0
  97. package/lib/module/agenda/AgendaSlot.js.map +1 -0
  98. package/lib/module/agenda/AgendaWindow.js +167 -0
  99. package/lib/module/agenda/AgendaWindow.js.map +1 -0
  100. package/lib/module/agenda/StickyHeaderOverlay.js +120 -0
  101. package/lib/module/agenda/StickyHeaderOverlay.js.map +1 -0
  102. package/lib/module/agenda/buildAgendaLayout.js +95 -0
  103. package/lib/module/agenda/buildAgendaLayout.js.map +1 -0
  104. package/lib/module/agenda/constants.js +25 -0
  105. package/lib/module/agenda/constants.js.map +1 -0
  106. package/lib/module/agenda/heights.js +42 -0
  107. package/lib/module/agenda/heights.js.map +1 -0
  108. package/lib/module/agenda/useAgendaScrollSync.js +200 -0
  109. package/lib/module/agenda/useAgendaScrollSync.js.map +1 -0
  110. package/lib/module/core/ArrowGlyph.js +60 -0
  111. package/lib/module/core/ArrowGlyph.js.map +1 -0
  112. package/lib/module/core/CalendarContext.js +26 -0
  113. package/lib/module/core/CalendarContext.js.map +1 -0
  114. package/lib/module/core/CalendarProvider.js +136 -0
  115. package/lib/module/core/CalendarProvider.js.map +1 -0
  116. package/lib/module/core/CalendarStore.js +66 -0
  117. package/lib/module/core/CalendarStore.js.map +1 -0
  118. package/lib/module/core/KitText.js +19 -0
  119. package/lib/module/core/KitText.js.map +1 -0
  120. package/lib/module/core/TodayButton.js +133 -0
  121. package/lib/module/core/TodayButton.js.map +1 -0
  122. package/lib/module/core/civil.js +88 -0
  123. package/lib/module/core/civil.js.map +1 -0
  124. package/lib/module/core/dateKey.js +47 -0
  125. package/lib/module/core/dateKey.js.map +1 -0
  126. package/lib/module/core/motion.js +49 -0
  127. package/lib/module/core/motion.js.map +1 -0
  128. package/lib/module/core/worklets.js +38 -0
  129. package/lib/module/core/worklets.js.map +1 -0
  130. package/lib/module/expandable/DayCell.js +116 -0
  131. package/lib/module/expandable/DayCell.js.map +1 -0
  132. package/lib/module/expandable/ExpandableCalendar.js +275 -0
  133. package/lib/module/expandable/ExpandableCalendar.js.map +1 -0
  134. package/lib/module/expandable/Knob.js +67 -0
  135. package/lib/module/expandable/Knob.js.map +1 -0
  136. package/lib/module/expandable/MonthPager.js +175 -0
  137. package/lib/module/expandable/MonthPager.js.map +1 -0
  138. package/lib/module/expandable/WeekStrip.js +446 -0
  139. package/lib/module/expandable/WeekStrip.js.map +1 -0
  140. package/lib/module/expandable/calendarCells.js +142 -0
  141. package/lib/module/expandable/calendarCells.js.map +1 -0
  142. package/lib/module/expandable/geometry.js +58 -0
  143. package/lib/module/expandable/geometry.js.map +1 -0
  144. package/lib/module/expandable/useExpandGesture.js +118 -0
  145. package/lib/module/expandable/useExpandGesture.js.map +1 -0
  146. package/lib/module/expandable/useHorizontalPager.js +92 -0
  147. package/lib/module/expandable/useHorizontalPager.js.map +1 -0
  148. package/lib/module/index.js +35 -0
  149. package/lib/module/index.js.map +1 -0
  150. package/lib/module/package.json +1 -0
  151. package/lib/module/theme/ThemeProvider.js +65 -0
  152. package/lib/module/theme/ThemeProvider.js.map +1 -0
  153. package/lib/module/theme/index.js +6 -0
  154. package/lib/module/theme/index.js.map +1 -0
  155. package/lib/module/theme/theme.js +74 -0
  156. package/lib/module/theme/theme.js.map +1 -0
  157. package/lib/module/theme/tokens.js +50 -0
  158. package/lib/module/theme/tokens.js.map +1 -0
  159. package/lib/module/timeline/DayColumn.js +91 -0
  160. package/lib/module/timeline/DayColumn.js.map +1 -0
  161. package/lib/module/timeline/DayPager.js +245 -0
  162. package/lib/module/timeline/DayPager.js.map +1 -0
  163. package/lib/module/timeline/EventBlock.js +87 -0
  164. package/lib/module/timeline/EventBlock.js.map +1 -0
  165. package/lib/module/timeline/GridLines.js +43 -0
  166. package/lib/module/timeline/GridLines.js.map +1 -0
  167. package/lib/module/timeline/HourGrid.js +94 -0
  168. package/lib/module/timeline/HourGrid.js.map +1 -0
  169. package/lib/module/timeline/NowIndicator.js +126 -0
  170. package/lib/module/timeline/NowIndicator.js.map +1 -0
  171. package/lib/module/timeline/TimelineDay.js +122 -0
  172. package/lib/module/timeline/TimelineDay.js.map +1 -0
  173. package/lib/module/timeline/packEvents.js +97 -0
  174. package/lib/module/timeline/packEvents.js.map +1 -0
  175. package/lib/module/timeline/timelineGeometry.js +22 -0
  176. package/lib/module/timeline/timelineGeometry.js.map +1 -0
  177. package/lib/module/timeline/timelineMath.js +75 -0
  178. package/lib/module/timeline/timelineMath.js.map +1 -0
  179. package/lib/module/types.js +67 -0
  180. package/lib/module/types.js.map +1 -0
  181. package/lib/typescript/commonjs/agenda/AgendaBackdrop.d.ts +20 -0
  182. package/lib/typescript/commonjs/agenda/AgendaBackdrop.d.ts.map +1 -0
  183. package/lib/typescript/commonjs/agenda/AgendaList.d.ts +12 -0
  184. package/lib/typescript/commonjs/agenda/AgendaList.d.ts.map +1 -0
  185. package/lib/typescript/commonjs/agenda/AgendaSlot.d.ts +45 -0
  186. package/lib/typescript/commonjs/agenda/AgendaSlot.d.ts.map +1 -0
  187. package/lib/typescript/commonjs/agenda/AgendaWindow.d.ts +49 -0
  188. package/lib/typescript/commonjs/agenda/AgendaWindow.d.ts.map +1 -0
  189. package/lib/typescript/commonjs/agenda/StickyHeaderOverlay.d.ts +39 -0
  190. package/lib/typescript/commonjs/agenda/StickyHeaderOverlay.d.ts.map +1 -0
  191. package/lib/typescript/commonjs/agenda/buildAgendaLayout.d.ts +57 -0
  192. package/lib/typescript/commonjs/agenda/buildAgendaLayout.d.ts.map +1 -0
  193. package/lib/typescript/commonjs/agenda/constants.d.ts +19 -0
  194. package/lib/typescript/commonjs/agenda/constants.d.ts.map +1 -0
  195. package/lib/typescript/commonjs/agenda/heights.d.ts +20 -0
  196. package/lib/typescript/commonjs/agenda/heights.d.ts.map +1 -0
  197. package/lib/typescript/commonjs/agenda/useAgendaScrollSync.d.ts +44 -0
  198. package/lib/typescript/commonjs/agenda/useAgendaScrollSync.d.ts.map +1 -0
  199. package/lib/typescript/commonjs/core/ArrowGlyph.d.ts +14 -0
  200. package/lib/typescript/commonjs/core/ArrowGlyph.d.ts.map +1 -0
  201. package/lib/typescript/commonjs/core/CalendarContext.d.ts +35 -0
  202. package/lib/typescript/commonjs/core/CalendarContext.d.ts.map +1 -0
  203. package/lib/typescript/commonjs/core/CalendarProvider.d.ts +41 -0
  204. package/lib/typescript/commonjs/core/CalendarProvider.d.ts.map +1 -0
  205. package/lib/typescript/commonjs/core/CalendarStore.d.ts +28 -0
  206. package/lib/typescript/commonjs/core/CalendarStore.d.ts.map +1 -0
  207. package/lib/typescript/commonjs/core/KitText.d.ts +10 -0
  208. package/lib/typescript/commonjs/core/KitText.d.ts.map +1 -0
  209. package/lib/typescript/commonjs/core/TodayButton.d.ts +18 -0
  210. package/lib/typescript/commonjs/core/TodayButton.d.ts.map +1 -0
  211. package/lib/typescript/commonjs/core/civil.d.ts +26 -0
  212. package/lib/typescript/commonjs/core/civil.d.ts.map +1 -0
  213. package/lib/typescript/commonjs/core/dateKey.d.ts +21 -0
  214. package/lib/typescript/commonjs/core/dateKey.d.ts.map +1 -0
  215. package/lib/typescript/commonjs/core/motion.d.ts +18 -0
  216. package/lib/typescript/commonjs/core/motion.d.ts.map +1 -0
  217. package/lib/typescript/commonjs/core/worklets.d.ts +12 -0
  218. package/lib/typescript/commonjs/core/worklets.d.ts.map +1 -0
  219. package/lib/typescript/commonjs/expandable/DayCell.d.ts +22 -0
  220. package/lib/typescript/commonjs/expandable/DayCell.d.ts.map +1 -0
  221. package/lib/typescript/commonjs/expandable/ExpandableCalendar.d.ts +40 -0
  222. package/lib/typescript/commonjs/expandable/ExpandableCalendar.d.ts.map +1 -0
  223. package/lib/typescript/commonjs/expandable/Knob.d.ts +19 -0
  224. package/lib/typescript/commonjs/expandable/Knob.d.ts.map +1 -0
  225. package/lib/typescript/commonjs/expandable/MonthPager.d.ts +35 -0
  226. package/lib/typescript/commonjs/expandable/MonthPager.d.ts.map +1 -0
  227. package/lib/typescript/commonjs/expandable/WeekStrip.d.ts +34 -0
  228. package/lib/typescript/commonjs/expandable/WeekStrip.d.ts.map +1 -0
  229. package/lib/typescript/commonjs/expandable/calendarCells.d.ts +52 -0
  230. package/lib/typescript/commonjs/expandable/calendarCells.d.ts.map +1 -0
  231. package/lib/typescript/commonjs/expandable/geometry.d.ts +43 -0
  232. package/lib/typescript/commonjs/expandable/geometry.d.ts.map +1 -0
  233. package/lib/typescript/commonjs/expandable/useExpandGesture.d.ts +35 -0
  234. package/lib/typescript/commonjs/expandable/useExpandGesture.d.ts.map +1 -0
  235. package/lib/typescript/commonjs/expandable/useHorizontalPager.d.ts +35 -0
  236. package/lib/typescript/commonjs/expandable/useHorizontalPager.d.ts.map +1 -0
  237. package/lib/typescript/commonjs/index.d.ts +26 -0
  238. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  239. package/lib/typescript/commonjs/package.json +1 -0
  240. package/lib/typescript/commonjs/theme/ThemeProvider.d.ts +27 -0
  241. package/lib/typescript/commonjs/theme/ThemeProvider.d.ts.map +1 -0
  242. package/lib/typescript/commonjs/theme/index.d.ts +4 -0
  243. package/lib/typescript/commonjs/theme/index.d.ts.map +1 -0
  244. package/lib/typescript/commonjs/theme/theme.d.ts +62 -0
  245. package/lib/typescript/commonjs/theme/theme.d.ts.map +1 -0
  246. package/lib/typescript/commonjs/theme/tokens.d.ts +46 -0
  247. package/lib/typescript/commonjs/theme/tokens.d.ts.map +1 -0
  248. package/lib/typescript/commonjs/timeline/DayColumn.d.ts +32 -0
  249. package/lib/typescript/commonjs/timeline/DayColumn.d.ts.map +1 -0
  250. package/lib/typescript/commonjs/timeline/DayPager.d.ts +32 -0
  251. package/lib/typescript/commonjs/timeline/DayPager.d.ts.map +1 -0
  252. package/lib/typescript/commonjs/timeline/EventBlock.d.ts +17 -0
  253. package/lib/typescript/commonjs/timeline/EventBlock.d.ts.map +1 -0
  254. package/lib/typescript/commonjs/timeline/GridLines.d.ts +5 -0
  255. package/lib/typescript/commonjs/timeline/GridLines.d.ts.map +1 -0
  256. package/lib/typescript/commonjs/timeline/HourGrid.d.ts +12 -0
  257. package/lib/typescript/commonjs/timeline/HourGrid.d.ts.map +1 -0
  258. package/lib/typescript/commonjs/timeline/NowIndicator.d.ts +28 -0
  259. package/lib/typescript/commonjs/timeline/NowIndicator.d.ts.map +1 -0
  260. package/lib/typescript/commonjs/timeline/TimelineDay.d.ts +14 -0
  261. package/lib/typescript/commonjs/timeline/TimelineDay.d.ts.map +1 -0
  262. package/lib/typescript/commonjs/timeline/packEvents.d.ts +25 -0
  263. package/lib/typescript/commonjs/timeline/packEvents.d.ts.map +1 -0
  264. package/lib/typescript/commonjs/timeline/timelineGeometry.d.ts +14 -0
  265. package/lib/typescript/commonjs/timeline/timelineGeometry.d.ts.map +1 -0
  266. package/lib/typescript/commonjs/timeline/timelineMath.d.ts +32 -0
  267. package/lib/typescript/commonjs/timeline/timelineMath.d.ts.map +1 -0
  268. package/lib/typescript/commonjs/types.d.ts +237 -0
  269. package/lib/typescript/commonjs/types.d.ts.map +1 -0
  270. package/lib/typescript/module/agenda/AgendaBackdrop.d.ts +20 -0
  271. package/lib/typescript/module/agenda/AgendaBackdrop.d.ts.map +1 -0
  272. package/lib/typescript/module/agenda/AgendaList.d.ts +12 -0
  273. package/lib/typescript/module/agenda/AgendaList.d.ts.map +1 -0
  274. package/lib/typescript/module/agenda/AgendaSlot.d.ts +45 -0
  275. package/lib/typescript/module/agenda/AgendaSlot.d.ts.map +1 -0
  276. package/lib/typescript/module/agenda/AgendaWindow.d.ts +49 -0
  277. package/lib/typescript/module/agenda/AgendaWindow.d.ts.map +1 -0
  278. package/lib/typescript/module/agenda/StickyHeaderOverlay.d.ts +39 -0
  279. package/lib/typescript/module/agenda/StickyHeaderOverlay.d.ts.map +1 -0
  280. package/lib/typescript/module/agenda/buildAgendaLayout.d.ts +57 -0
  281. package/lib/typescript/module/agenda/buildAgendaLayout.d.ts.map +1 -0
  282. package/lib/typescript/module/agenda/constants.d.ts +19 -0
  283. package/lib/typescript/module/agenda/constants.d.ts.map +1 -0
  284. package/lib/typescript/module/agenda/heights.d.ts +20 -0
  285. package/lib/typescript/module/agenda/heights.d.ts.map +1 -0
  286. package/lib/typescript/module/agenda/useAgendaScrollSync.d.ts +44 -0
  287. package/lib/typescript/module/agenda/useAgendaScrollSync.d.ts.map +1 -0
  288. package/lib/typescript/module/core/ArrowGlyph.d.ts +14 -0
  289. package/lib/typescript/module/core/ArrowGlyph.d.ts.map +1 -0
  290. package/lib/typescript/module/core/CalendarContext.d.ts +35 -0
  291. package/lib/typescript/module/core/CalendarContext.d.ts.map +1 -0
  292. package/lib/typescript/module/core/CalendarProvider.d.ts +41 -0
  293. package/lib/typescript/module/core/CalendarProvider.d.ts.map +1 -0
  294. package/lib/typescript/module/core/CalendarStore.d.ts +28 -0
  295. package/lib/typescript/module/core/CalendarStore.d.ts.map +1 -0
  296. package/lib/typescript/module/core/KitText.d.ts +10 -0
  297. package/lib/typescript/module/core/KitText.d.ts.map +1 -0
  298. package/lib/typescript/module/core/TodayButton.d.ts +18 -0
  299. package/lib/typescript/module/core/TodayButton.d.ts.map +1 -0
  300. package/lib/typescript/module/core/civil.d.ts +26 -0
  301. package/lib/typescript/module/core/civil.d.ts.map +1 -0
  302. package/lib/typescript/module/core/dateKey.d.ts +21 -0
  303. package/lib/typescript/module/core/dateKey.d.ts.map +1 -0
  304. package/lib/typescript/module/core/motion.d.ts +18 -0
  305. package/lib/typescript/module/core/motion.d.ts.map +1 -0
  306. package/lib/typescript/module/core/worklets.d.ts +12 -0
  307. package/lib/typescript/module/core/worklets.d.ts.map +1 -0
  308. package/lib/typescript/module/expandable/DayCell.d.ts +22 -0
  309. package/lib/typescript/module/expandable/DayCell.d.ts.map +1 -0
  310. package/lib/typescript/module/expandable/ExpandableCalendar.d.ts +40 -0
  311. package/lib/typescript/module/expandable/ExpandableCalendar.d.ts.map +1 -0
  312. package/lib/typescript/module/expandable/Knob.d.ts +19 -0
  313. package/lib/typescript/module/expandable/Knob.d.ts.map +1 -0
  314. package/lib/typescript/module/expandable/MonthPager.d.ts +35 -0
  315. package/lib/typescript/module/expandable/MonthPager.d.ts.map +1 -0
  316. package/lib/typescript/module/expandable/WeekStrip.d.ts +34 -0
  317. package/lib/typescript/module/expandable/WeekStrip.d.ts.map +1 -0
  318. package/lib/typescript/module/expandable/calendarCells.d.ts +52 -0
  319. package/lib/typescript/module/expandable/calendarCells.d.ts.map +1 -0
  320. package/lib/typescript/module/expandable/geometry.d.ts +43 -0
  321. package/lib/typescript/module/expandable/geometry.d.ts.map +1 -0
  322. package/lib/typescript/module/expandable/useExpandGesture.d.ts +35 -0
  323. package/lib/typescript/module/expandable/useExpandGesture.d.ts.map +1 -0
  324. package/lib/typescript/module/expandable/useHorizontalPager.d.ts +35 -0
  325. package/lib/typescript/module/expandable/useHorizontalPager.d.ts.map +1 -0
  326. package/lib/typescript/module/index.d.ts +26 -0
  327. package/lib/typescript/module/index.d.ts.map +1 -0
  328. package/lib/typescript/module/package.json +1 -0
  329. package/lib/typescript/module/theme/ThemeProvider.d.ts +27 -0
  330. package/lib/typescript/module/theme/ThemeProvider.d.ts.map +1 -0
  331. package/lib/typescript/module/theme/index.d.ts +4 -0
  332. package/lib/typescript/module/theme/index.d.ts.map +1 -0
  333. package/lib/typescript/module/theme/theme.d.ts +62 -0
  334. package/lib/typescript/module/theme/theme.d.ts.map +1 -0
  335. package/lib/typescript/module/theme/tokens.d.ts +46 -0
  336. package/lib/typescript/module/theme/tokens.d.ts.map +1 -0
  337. package/lib/typescript/module/timeline/DayColumn.d.ts +32 -0
  338. package/lib/typescript/module/timeline/DayColumn.d.ts.map +1 -0
  339. package/lib/typescript/module/timeline/DayPager.d.ts +32 -0
  340. package/lib/typescript/module/timeline/DayPager.d.ts.map +1 -0
  341. package/lib/typescript/module/timeline/EventBlock.d.ts +17 -0
  342. package/lib/typescript/module/timeline/EventBlock.d.ts.map +1 -0
  343. package/lib/typescript/module/timeline/GridLines.d.ts +5 -0
  344. package/lib/typescript/module/timeline/GridLines.d.ts.map +1 -0
  345. package/lib/typescript/module/timeline/HourGrid.d.ts +12 -0
  346. package/lib/typescript/module/timeline/HourGrid.d.ts.map +1 -0
  347. package/lib/typescript/module/timeline/NowIndicator.d.ts +28 -0
  348. package/lib/typescript/module/timeline/NowIndicator.d.ts.map +1 -0
  349. package/lib/typescript/module/timeline/TimelineDay.d.ts +14 -0
  350. package/lib/typescript/module/timeline/TimelineDay.d.ts.map +1 -0
  351. package/lib/typescript/module/timeline/packEvents.d.ts +25 -0
  352. package/lib/typescript/module/timeline/packEvents.d.ts.map +1 -0
  353. package/lib/typescript/module/timeline/timelineGeometry.d.ts +14 -0
  354. package/lib/typescript/module/timeline/timelineGeometry.d.ts.map +1 -0
  355. package/lib/typescript/module/timeline/timelineMath.d.ts +32 -0
  356. package/lib/typescript/module/timeline/timelineMath.d.ts.map +1 -0
  357. package/lib/typescript/module/types.d.ts +237 -0
  358. package/lib/typescript/module/types.d.ts.map +1 -0
  359. package/package.json +105 -0
  360. package/src/agenda/AgendaBackdrop.tsx +55 -0
  361. package/src/agenda/AgendaList.tsx +370 -0
  362. package/src/agenda/AgendaSlot.tsx +88 -0
  363. package/src/agenda/AgendaWindow.tsx +183 -0
  364. package/src/agenda/StickyHeaderOverlay.tsx +126 -0
  365. package/src/agenda/buildAgendaLayout.ts +110 -0
  366. package/src/agenda/constants.ts +22 -0
  367. package/src/agenda/heights.ts +44 -0
  368. package/src/agenda/useAgendaScrollSync.ts +251 -0
  369. package/src/core/ArrowGlyph.tsx +53 -0
  370. package/src/core/CalendarContext.ts +47 -0
  371. package/src/core/CalendarProvider.tsx +165 -0
  372. package/src/core/CalendarStore.ts +64 -0
  373. package/src/core/KitText.tsx +10 -0
  374. package/src/core/TodayButton.tsx +121 -0
  375. package/src/core/civil.ts +92 -0
  376. package/src/core/dateKey.ts +52 -0
  377. package/src/core/motion.ts +51 -0
  378. package/src/core/worklets.ts +37 -0
  379. package/src/expandable/DayCell.tsx +97 -0
  380. package/src/expandable/ExpandableCalendar.tsx +278 -0
  381. package/src/expandable/Knob.tsx +67 -0
  382. package/src/expandable/MonthPager.tsx +208 -0
  383. package/src/expandable/WeekStrip.tsx +439 -0
  384. package/src/expandable/calendarCells.ts +155 -0
  385. package/src/expandable/geometry.ts +51 -0
  386. package/src/expandable/useExpandGesture.ts +147 -0
  387. package/src/expandable/useHorizontalPager.ts +116 -0
  388. package/src/index.ts +62 -0
  389. package/src/theme/ThemeProvider.tsx +85 -0
  390. package/src/theme/index.ts +18 -0
  391. package/src/theme/theme.ts +110 -0
  392. package/src/theme/tokens.ts +50 -0
  393. package/src/timeline/DayColumn.tsx +84 -0
  394. package/src/timeline/DayPager.tsx +295 -0
  395. package/src/timeline/EventBlock.tsx +76 -0
  396. package/src/timeline/GridLines.tsx +36 -0
  397. package/src/timeline/HourGrid.tsx +90 -0
  398. package/src/timeline/NowIndicator.tsx +123 -0
  399. package/src/timeline/TimelineDay.tsx +112 -0
  400. package/src/timeline/packEvents.ts +118 -0
  401. package/src/timeline/timelineGeometry.ts +23 -0
  402. package/src/timeline/timelineMath.ts +86 -0
  403. package/src/types.ts +252 -0
@@ -0,0 +1,112 @@
1
+ /**
2
+ * The day view: ONE vertical ScrollView holding the time gutter and the day pager, so every day
3
+ * shares the vertical offset by construction. The start offset is a mount-time `contentOffset`;
4
+ * the caller mounts this conditionally, so every open recomputes it.
5
+ *
6
+ * The width is seeded from the window so the FIRST commit already holds the day columns (waiting
7
+ * for `onLayout` painted an empty grid first); `onLayout` corrects it when not full-width.
8
+ *
9
+ * `timelineProps.availableHours` replaces the library's inverted `unavailableHours` and also takes
10
+ * a per-date map, so a neighbouring day's bands are right mid-swipe.
11
+ */
12
+
13
+ import { useKitTheme } from '../theme';
14
+ import { useKitStyles, type KitStyleArgs } from '../theme';
15
+ import { useCallback, useState } from 'react';
16
+ import { Dimensions, ScrollView, StyleSheet, View, type LayoutChangeEvent } from 'react-native';
17
+ import { useCalendarContext } from '../core/CalendarContext';
18
+ import { dayIndexOf } from '../core/dateKey';
19
+ import type { DateString, TimelineEvent, TimelineListProps } from '../types';
20
+ import { DayPager } from './DayPager';
21
+ import { HourGrid } from './HourGrid';
22
+ import { CONTENT_BOTTOM_PAD, GUTTER, HOUR_HEIGHT, gridHeight } from './timelineGeometry';
23
+ import { initialScrollY, minutesOf } from './timelineMath';
24
+
25
+ export const TimelineList = <E extends TimelineEvent>({
26
+ events,
27
+ timelineProps = {},
28
+ showNowIndicator = false,
29
+ scrollToNow,
30
+ scrollToFirst,
31
+ initialTime,
32
+ }: TimelineListProps<E>) => {
33
+ const { colors } = useKitTheme();
34
+ const styles = useKitStyles(makeStyles);
35
+ const {
36
+ renderEvent,
37
+ onEventPress,
38
+ format24h = true,
39
+ overlapEventsSpacing = 0,
40
+ rightEdgeSpacing = 0,
41
+ availableHours,
42
+ availableHoursColor = colors.accentSubtle,
43
+ hourHeight = HOUR_HEIGHT,
44
+ } = timelineProps;
45
+
46
+ const { range, dateRef } = useCalendarContext();
47
+ const [width, setWidth] = useState(() => Dimensions.get('window').width);
48
+
49
+ const [contentOffset] = useState(() => {
50
+ const ymd = dateRef.current;
51
+ const dayEvents = events[ymd];
52
+ let firstEventTop: number | undefined;
53
+ if (dayEvents?.length) {
54
+ let earliest = Infinity;
55
+ for (const e of dayEvents) earliest = Math.min(earliest, minutesOf(e.start));
56
+ firstEventTop = (earliest / 60) * hourHeight;
57
+ }
58
+ const y = initialScrollY({
59
+ isToday: dayIndexOf(range, ymd) === range.todayIndex,
60
+ scrollToNow,
61
+ scrollToFirst,
62
+ initialTime,
63
+ firstEventTop,
64
+ hourHeight,
65
+ });
66
+ return { x: 0, y };
67
+ });
68
+
69
+ const availableHoursFor = useCallback(
70
+ (ymd: DateString) => (Array.isArray(availableHours) ? availableHours : availableHours?.[ymd]),
71
+ [availableHours],
72
+ );
73
+
74
+ const onLayout = useCallback((e: LayoutChangeEvent) => {
75
+ const w = e.nativeEvent.layout.width;
76
+ setWidth((prev) => (Math.abs(prev - w) < 0.5 ? prev : w));
77
+ }, []);
78
+
79
+ const colW = Math.max(0, width - GUTTER);
80
+ const dayHeight = gridHeight(hourHeight);
81
+
82
+ return (
83
+ <View style={styles.root} onLayout={onLayout}>
84
+ <ScrollView contentOffset={contentOffset} showsVerticalScrollIndicator={false} nestedScrollEnabled>
85
+ <View style={{ height: dayHeight + CONTENT_BOTTOM_PAD }}>
86
+ <HourGrid hourHeight={hourHeight} format24h={format24h} />
87
+ {colW > 0 ? (
88
+ <DayPager
89
+ left={GUTTER}
90
+ width={colW}
91
+ height={dayHeight}
92
+ events={events}
93
+ availableHoursFor={availableHoursFor}
94
+ bandColor={availableHoursColor}
95
+ hourHeight={hourHeight}
96
+ overlapEventsSpacing={overlapEventsSpacing}
97
+ rightEdgeSpacing={rightEdgeSpacing}
98
+ renderEvent={renderEvent}
99
+ onEventPress={onEventPress}
100
+ showNowIndicator={showNowIndicator}
101
+ />
102
+ ) : null}
103
+ </View>
104
+ </ScrollView>
105
+ </View>
106
+ );
107
+ };
108
+
109
+ const makeStyles = ({ colors }: KitStyleArgs) =>
110
+ StyleSheet.create({
111
+ root: { flex: 1, backgroundColor: colors.surface },
112
+ });
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Overlap packing for one day column — `react-native-calendars`' `Packer.js`, in minutes, so
3
+ * blocks land where react-native-calendars put them. Sort by start then end; a new overlap group starts
4
+ * at or after the latest end seen; first-fit into columns; each event gets `1/n` of the width,
5
+ * widened across later columns it does not collide with.
6
+ *
7
+ * Deliberate edge differences: a missing `end` is start + 60; an `end` at or before `start` is
8
+ * start + 15 (the library drew a negative height); collisions use an end of at least start + 15,
9
+ * so two zero-length events at one minute get their own columns.
10
+ *
11
+ * Invariant the span pass relies on: a column's events are sorted and pairwise disjoint, so the
12
+ * last event placed in a column is the only one that can still overlap a later-starting event.
13
+ * `lib/overlap-detection.ts` cannot execute (gap-6) — do not swap it in.
14
+ */
15
+
16
+ import type { PackedTimelineEvent, TimelineEvent } from '../types';
17
+ import { DAY_MINUTES, minutesOf } from './timelineMath';
18
+
19
+ const SHORT_EVENT_MINUTES = 15;
20
+
21
+ type Item<E> = {
22
+ ev: E;
23
+ index: number;
24
+ start: number;
25
+ end: number;
26
+ /** End used for collision tests: never less than start + 15. */
27
+ collEnd: number;
28
+ /** Columns this event may cover, capped at `n − column` when its group flushes. */
29
+ span: number;
30
+ };
31
+
32
+ type PackOptions = {
33
+ /** Width of the day column, px. */
34
+ colW: number;
35
+ hourHeight: number;
36
+ overlapEventsSpacing?: number;
37
+ rightEdgeSpacing?: number;
38
+ };
39
+
40
+ export const packEvents = <E extends TimelineEvent>(
41
+ events: E[] | undefined,
42
+ { colW, hourHeight, overlapEventsSpacing = 0, rightEdgeSpacing = 0 }: PackOptions,
43
+ ): PackedTimelineEvent<E>[] => {
44
+ if (!events?.length || colW <= 0) return [];
45
+
46
+ const items: Item<E>[] = events.map((ev, index) => {
47
+ const start = Math.min(Math.max(minutesOf(ev.start), 0), DAY_MINUTES);
48
+ let end = ev.end ? minutesOf(ev.end) : start + 60;
49
+ if (end <= start) end = start + SHORT_EVENT_MINUTES;
50
+ end = Math.min(end, DAY_MINUTES);
51
+ const collEnd = Math.max(end, start + SHORT_EVENT_MINUTES);
52
+ return { ev, index, start, end, collEnd, span: Infinity };
53
+ });
54
+
55
+ items.sort((a, b) => a.start - b.start || a.end - b.end || a.index - b.index);
56
+
57
+ const packed: PackedTimelineEvent<E>[] = [];
58
+ const totalW = colW - rightEdgeSpacing;
59
+
60
+ let columns: Item<E>[][] = [];
61
+ /** `collEnd` of each column's last event: the whole collision test against that column. */
62
+ const lastEnd: number[] = [];
63
+ let groupEnd = -1;
64
+
65
+ const flush = () => {
66
+ const n = columns.length;
67
+ for (let c = 0; c < n; c += 1) {
68
+ for (const item of columns[c]) {
69
+ const span = Math.min(item.span, n - c);
70
+ let width = (totalW * span) / n;
71
+ if (c + span <= n - 1) width -= overlapEventsSpacing;
72
+ packed.push({
73
+ ...item.ev,
74
+ index: item.index,
75
+ left: (c / n) * totalW,
76
+ width,
77
+ top: (item.start / 60) * hourHeight,
78
+ height: ((item.end - item.start) / 60) * hourHeight,
79
+ });
80
+ }
81
+ }
82
+ columns = [];
83
+ lastEnd.length = 0;
84
+ };
85
+
86
+ for (const item of items) {
87
+ if (columns.length && item.start >= groupEnd) {
88
+ flush();
89
+ groupEnd = -1;
90
+ }
91
+
92
+ const cols = lastEnd.length;
93
+ let col = 0;
94
+ while (col < cols && lastEnd[col] > item.start) col += 1;
95
+
96
+ // Every column left of `col` ends after this item starts: its last event stops spanning here.
97
+ for (let i = 0; i < col; i += 1) {
98
+ const last = columns[i][columns[i].length - 1];
99
+ if (last.span > col - i) last.span = col - i;
100
+ }
101
+ // The nearest column to the right still busy at this item's start caps its own span.
102
+ for (let k = col + 1; k < cols; k += 1) {
103
+ if (lastEnd[k] > item.start) {
104
+ item.span = k - col;
105
+ break;
106
+ }
107
+ }
108
+
109
+ if (col === cols) columns.push([item]);
110
+ else columns[col].push(item);
111
+ lastEnd[col] = item.collEnd;
112
+ if (columns.length === 1 && columns[0].length === 1) groupEnd = item.collEnd;
113
+ else if (item.collEnd > groupEnd) groupEnd = item.collEnd;
114
+ }
115
+ if (columns.length) flush();
116
+
117
+ return packed;
118
+ };
@@ -0,0 +1,23 @@
1
+ // Timeline geometry, numbers only. Transcribed from `react-native-calendars` (`Packer.js`,
2
+ // `TimelineHours.js`, `timeline/style.js`); GUTTER is the provider's `timelineLeftInset` default.
3
+
4
+ /** px per hour. The live event card's layout branches (<25 / <50 / <70) assume it. */
5
+ export const HOUR_HEIGHT = 100;
6
+
7
+ export const GUTTER = 72;
8
+
9
+ /** Hour lines start this far inside the gutter (`timelineLeftInset - 16`). */
10
+ export const LINE_GUTTER_OVERHANG = 16;
11
+
12
+ /** Labels sit 6 px above their line, centred in the 56 px label box. */
13
+ export const LABEL_OFFSET_Y = -6;
14
+ export const LABEL_PADDING_LEFT = 12;
15
+
16
+ /** `contentStyle.height: calendarHeight + 10`. */
17
+ export const CONTENT_BOTTOM_PAD = 10;
18
+
19
+ export const EVENT_MIN_HEIGHT = 25;
20
+
21
+ export const NOW_KNOB = 7;
22
+
23
+ export const gridHeight = (hourHeight: number): number => 24 * hourHeight;
@@ -0,0 +1,86 @@
1
+ /** Pure time ↔ pixel arithmetic for the timeline, in minutes of the day — never a `Date`. */
2
+
3
+ import type { AvailableHours } from '../types';
4
+
5
+ export const DAY_MINUTES = 24 * 60;
6
+
7
+ const digitAt = (s: string, i: number): number => {
8
+ const d = s.charCodeAt(i) - 48;
9
+ return d >= 0 && d <= 9 ? d : -1;
10
+ };
11
+
12
+ /** Minute of the day from `'YYYY-MM-DD HH:mm:ss'` (HH at 11–12, mm at 14–15); 0 when unreadable. */
13
+ export const minutesOf = (dateTime: string | undefined): number => {
14
+ if (!dateTime || dateTime.length < 16) return 0;
15
+ const h1 = digitAt(dateTime, 11);
16
+ const h2 = digitAt(dateTime, 12);
17
+ const m1 = digitAt(dateTime, 14);
18
+ const m2 = digitAt(dateTime, 15);
19
+ if (h1 < 0 || h2 < 0 || m1 < 0 || m2 < 0) return 0;
20
+ return (h1 * 10 + h2) * 60 + m1 * 10 + m2;
21
+ };
22
+
23
+ /** `{ hour, minutes }` or `'H:mm'` → minute of the day. */
24
+ const initialTimeMinutes = (
25
+ t: { hour: number; minutes: number } | string | undefined,
26
+ ): number | undefined => {
27
+ if (t == null) return undefined;
28
+ if (typeof t === 'string') {
29
+ const [h, m] = t.split(':').map(Number);
30
+ return Number.isFinite(h) ? h * 60 + (Number.isFinite(m) ? m : 0) : undefined;
31
+ }
32
+ return t.hour * 60 + (t.minutes || 0);
33
+ };
34
+
35
+ /**
36
+ * Library precedence (`timeline-list`): today → `scrollToNow` only; other days → `scrollToFirst`
37
+ * (when the day has events) over `initialTime`. One hour above the target, as `Timeline.js` does.
38
+ */
39
+ export const initialScrollY = ({
40
+ isToday,
41
+ scrollToNow,
42
+ scrollToFirst,
43
+ initialTime,
44
+ firstEventTop,
45
+ hourHeight,
46
+ now = new Date(),
47
+ }: {
48
+ isToday: boolean;
49
+ scrollToNow?: boolean;
50
+ scrollToFirst?: boolean;
51
+ initialTime?: { hour: number; minutes: number } | string;
52
+ /** Top of the earliest packed event on the day, or undefined when empty. */
53
+ firstEventTop?: number;
54
+ hourHeight: number;
55
+ now?: Date;
56
+ }): number => {
57
+ let pos = 0;
58
+ if (isToday) {
59
+ if (scrollToNow) pos = ((now.getHours() * 60 + now.getMinutes()) / 60) * hourHeight;
60
+ } else if (scrollToFirst && firstEventTop !== undefined) {
61
+ pos = firstEventTop;
62
+ } else {
63
+ const m = initialTimeMinutes(initialTime);
64
+ if (m !== undefined) pos = (m / 60) * hourHeight;
65
+ }
66
+ return pos ? Math.max(0, pos - hourHeight) : 0;
67
+ };
68
+
69
+ export type Band = { top: number; height: number };
70
+
71
+ /**
72
+ * Availability windows → pixel bands. Invalid windows are dropped silently: they are backend
73
+ * data, and the library's `console.error` raised a red box in debug builds.
74
+ */
75
+ export const buildBands = (windows: AvailableHours | undefined, hourHeight: number): Band[] => {
76
+ if (!windows?.length) return [];
77
+ const out: Band[] = [];
78
+ for (const w of windows) {
79
+ if (!(w.start >= 0 && w.start < 25 && w.end >= 0 && w.end < 25)) continue;
80
+ if (w.start >= w.end) continue;
81
+ const e = Math.min(w.end, 24);
82
+ if (e <= w.start) continue;
83
+ out.push({ top: w.start * hourHeight, height: (e - w.start) * hourHeight });
84
+ }
85
+ return out;
86
+ };
package/src/types.ts ADDED
@@ -0,0 +1,252 @@
1
+ /**
2
+ * react-native-agenda-kit — the public type surface.
3
+ *
4
+ * The kit is a PURE UI LIBRARY: it fetches nothing, knows no app type, and
5
+ * reads only design tokens. Everything domain-shaped (an appointment, a
6
+ * booking status, a locale) arrives as a caller-supplied render prop or a
7
+ * primitive. That boundary is what makes the three surfaces reusable and what
8
+ * keeps the CONSUMER's screen the only place that knows what a row *means*.
9
+ *
10
+ * Names deliberately match `react-native-calendars`' public API
11
+ * (`CalendarProvider`, `ExpandableCalendar`, `AgendaList`, `TimelineList`,
12
+ * `UpdateSources`) so a migrating screen's JSX is a copy, not a rewrite.
13
+ */
14
+
15
+ import type { ReactElement, ReactNode } from 'react';
16
+ import type { StyleProp, ViewStyle } from 'react-native';
17
+
18
+ /** 'YYYY-MM-DD', local calendar day. The only date string the kit accepts. */
19
+ export type DateString = string;
20
+
21
+ /**
22
+ * Why a date changed. The strings are byte-identical to the library's
23
+ * `commons.js` UpdateSources so the screen's `handleDateChanged` switch is a
24
+ * verbatim copy.
25
+ */
26
+ export const UpdateSources = {
27
+ CALENDAR_INIT: 'calendarInit',
28
+ TODAY_PRESS: 'todayPress',
29
+ LIST_DRAG: 'listDrag',
30
+ DAY_PRESS: 'dayPress',
31
+ PAGE_SCROLL: 'pageScroll',
32
+ WEEK_SCROLL: 'weekScroll',
33
+ PROP_UPDATE: 'propUpdate',
34
+ } as const;
35
+
36
+ export type UpdateSource = (typeof UpdateSources)[keyof typeof UpdateSources];
37
+
38
+ /**
39
+ * Which surface *produced* a programmatic move. The originating scroller
40
+ * ignores its own origin, which is the whole echo-proofing story: no latches,
41
+ * no 500 ms timers, no `changedItems` bookkeeping.
42
+ */
43
+ export type MoveOrigin = 'agenda' | 'timeline' | 'week' | 'month' | 'external';
44
+
45
+ /** One programmatic move. `seq` makes every move distinct even when `idx` repeats. */
46
+ export type CalendarMove = {
47
+ seq: number;
48
+ idx: number;
49
+ origin: MoveOrigin;
50
+ animated: boolean;
51
+ };
52
+
53
+ /**
54
+ * The one index space. Every surface addresses a day by its integer offset
55
+ * from `start`: agenda section index, week page `floor(i/7)`, month page,
56
+ * timeline column. Worklets never touch strings.
57
+ *
58
+ * `start` is a Monday (the skeleton pads to whole weeks) and `days` is a
59
+ * multiple of 7, so `floor(dayIndex / 7)` is always a whole page.
60
+ */
61
+ export type CalendarRange = {
62
+ /** 'YYYY-MM-DD' of index 0 — a padded week start. */
63
+ start: DateString;
64
+ /** Epoch day of `start` (see `core/civil.ts`): `dayIndexOf` is one subtraction. */
65
+ startEpochDay: number;
66
+ /** 'YYYY-MM-DD' of every index, built once: `ymdAt` is one array read. */
67
+ ymdByIndex: readonly DateString[];
68
+ /** Total day count (e.g. 126 or 133 for a 4-month window). */
69
+ days: number;
70
+ /** Selectable bounds, inclusive, as indices into the same space. */
71
+ minIndex: number;
72
+ maxIndex: number;
73
+ /** 1 = Monday. Matches the library's `firstDay`. */
74
+ firstDay: number;
75
+ /** Index of today, or -1 when today is outside the range. */
76
+ todayIndex: number;
77
+ };
78
+
79
+ /* ── Agenda ────────────────────────────────────────────────────────────── */
80
+
81
+ /**
82
+ * A day's worth of rows. `title` is the 'YYYY-MM-DD' key — the library's
83
+ * SectionList convention, kept so `renderSectionHeader` stays a copy.
84
+ */
85
+ export type AgendaSection<T> = {
86
+ title: DateString;
87
+ data: T[];
88
+ };
89
+
90
+ export type AgendaListRef = {
91
+ scrollToDate: (date: DateString, animated?: boolean) => void;
92
+ scrollToSection: (title: DateString, animated?: boolean) => void;
93
+ scrollToOffset: (params: { offset: number; animated?: boolean }) => void;
94
+ };
95
+
96
+ export type AgendaListProps<T> = {
97
+ sections: AgendaSection<T>[];
98
+ renderItem: (info: { item: T; index: number; section: AgendaSection<T> }) => ReactElement | null;
99
+ renderSectionHeader: (title: DateString) => ReactElement | null;
100
+
101
+ /**
102
+ * Declared row heights in px, keyed by `getItemType`. Never measured: a wrong
103
+ * number clips inside its slot instead of shifting the list (DEV warns per type).
104
+ */
105
+ itemHeightByType: Record<string, number>;
106
+ /** Height of a section header slot. Default 32. */
107
+ sectionHeaderHeight?: number;
108
+
109
+ /** Defaults to `item.itemCustomHeightType`, else 'Regular'. */
110
+ getItemType?: (item: T) => string;
111
+ /** Defaults to `item.id`. */
112
+ keyExtractor?: (item: T, index: number) => string;
113
+
114
+ /** Real sticky headers (a fixed overlay), unlike the library's. */
115
+ stickySectionHeadersEnabled?: boolean;
116
+ /** Real `RefreshControl`. Arms at the top of the window only (platform). */
117
+ refreshing?: boolean;
118
+ onRefresh?: () => void;
119
+
120
+ /**
121
+ * Skeleton tiles drawn BEHIND the list, moving with it. With a backdrop, rows
122
+ * entering the window during a fast fling are deferred and the backdrop shows
123
+ * through their slots — so a fling that outruns the JS thread never shows bare
124
+ * ground. Without one, every row renders real.
125
+ */
126
+ backdrop?: { tileHeight: number; renderTile: () => ReactElement };
127
+ /** Painted under every drawn row, so the backdrop shows only where no row is drawn. */
128
+ rowGroundColor?: string;
129
+
130
+ decelerationRate?: number | 'fast' | 'normal';
131
+ ref?: React.Ref<AgendaListRef>;
132
+
133
+ /** Gesture hooks: drag begin and settle. Each costs a UI→JS hop per gesture — pass them only when needed. */
134
+ onDragBegin?: () => void;
135
+ onSettle?: () => void;
136
+
137
+ /* Accepted and ignored — typed so JSX copied from the react-native-calendars screen compiles. */
138
+ titleHeight?: number;
139
+ sectionStyle?: StyleProp<ViewStyle>;
140
+ dayFormatter?: (date: string) => string;
141
+ markToday?: boolean;
142
+ updateCellsBatchingPeriod?: number;
143
+ onScrollToIndexFailed?: (info: unknown) => void;
144
+ infiniteListProps?: Record<string, unknown>;
145
+ };
146
+
147
+ /* ── Expandable calendar ───────────────────────────────────────────────── */
148
+
149
+ export type MarkedDates = Record<
150
+ DateString,
151
+ { marked?: boolean; dotColor?: string; selected?: boolean; disabled?: boolean }
152
+ >;
153
+
154
+ export type CalendarPosition = 'closed' | 'open';
155
+
156
+ export type ExpandableCalendarRef = {
157
+ /** Returns the position it moved TO. `true` = open. */
158
+ toggleCalendarPosition: () => boolean;
159
+ };
160
+
161
+ export type ExpandableCalendarProps = ExpandableCalendarCompatProps & {
162
+ initialPosition?: CalendarPosition;
163
+ onCalendarToggled?: (isOpen: boolean) => void;
164
+ style?: StyleProp<ViewStyle>;
165
+ closeOnDayPress?: boolean;
166
+ /** Collapse an open calendar when a list under it starts a drag. Default true; ignored under a screen reader. */
167
+ closeOnListScroll?: boolean;
168
+ markedDates?: MarkedDates;
169
+ disablePan?: boolean;
170
+ openThreshold?: number;
171
+ closeThreshold?: number;
172
+ /** Screen-reader label for the drag knob. Caller-supplied: the kit ships no strings. */
173
+ knobAccessibilityLabel?: string;
174
+ /** The spoken name of a grid day; called only while a screen reader runs, once per day of the range. */
175
+ dayAccessibilityLabel?: (date: DateString) => string;
176
+ /** Twelve short month names, January first, drawn over each 1st in the week strip. None drawn when absent. */
177
+ monthShortLabels?: readonly string[];
178
+ /** Rendered inside the body the calendar pushes down — the agenda or the timeline. */
179
+ children?: ReactNode;
180
+ ref?: React.Ref<ExpandableCalendarRef>;
181
+ };
182
+
183
+ /** Accepted and never read — typed so JSX copied from `react-native-calendars` compiles unchanged. */
184
+ export type ExpandableCalendarCompatProps = {
185
+ firstDay?: number;
186
+ /** No header band is rendered; the callers pass `() => null`. */
187
+ renderHeader?: (date?: DateString) => ReactNode;
188
+ headerStyle?: StyleProp<ViewStyle>;
189
+ minDate?: DateString;
190
+ maxDate?: DateString;
191
+ pastScrollRange?: number;
192
+ futureScrollRange?: number;
193
+ hideArrows?: boolean;
194
+ allowShadow?: boolean;
195
+ /** No day-names row is rendered; the callers pass `hideDayNames`. */
196
+ hideDayNames?: boolean;
197
+ dayNames?: string[];
198
+ theme?: unknown;
199
+ onVisibleMonthsChange?: (months: unknown[]) => void;
200
+ };
201
+
202
+ /* ── Timeline ──────────────────────────────────────────────────────────── */
203
+
204
+ /** `start` / `end` are 'YYYY-MM-DD HH:mm:ss' — the library's wire format. */
205
+ export type TimelineEvent = {
206
+ id: string;
207
+ start: string;
208
+ end?: string;
209
+ title?: string;
210
+ summary?: string;
211
+ color?: string;
212
+ };
213
+
214
+ export type PackedTimelineEvent<E extends TimelineEvent = TimelineEvent> = E & {
215
+ /** Packer output, in px relative to the column. */
216
+ index: number;
217
+ top: number;
218
+ left: number;
219
+ width: number;
220
+ height: number;
221
+ };
222
+
223
+ /** An inclusive window of *available* time. The kit never takes the inverse. */
224
+ export type AvailableHours = { start: number; end: number }[];
225
+
226
+ export type TimelineInnerProps<E extends TimelineEvent = TimelineEvent> = {
227
+ renderEvent?: (event: PackedTimelineEvent<E>) => ReactElement | null;
228
+ /** Receives the PACKED event, as the library's does (`Timeline.js` passes `packedEvents[i][j]`). */
229
+ onEventPress?: (event: PackedTimelineEvent<E>) => void;
230
+ format24h?: boolean;
231
+ overlapEventsSpacing?: number;
232
+ rightEdgeSpacing?: number;
233
+ /**
234
+ * AVAILABLE windows, per date. The library takes `unavailableHours`; the
235
+ * consumer usually computes availability directly, so the kit takes the
236
+ * un-inverted form. This is the one deliberate rename.
237
+ */
238
+ availableHours?: Record<DateString, AvailableHours> | AvailableHours;
239
+ availableHoursColor?: string;
240
+ hourHeight?: number;
241
+ };
242
+
243
+ export type TimelineListProps<E extends TimelineEvent = TimelineEvent> = {
244
+ /** Keyed by 'YYYY-MM-DD'. Neighbours must be present or a swipe shows a blank day. */
245
+ events: Record<DateString, E[]>;
246
+ timelineProps?: TimelineInnerProps<E>;
247
+ showNowIndicator?: boolean;
248
+ scrollToNow?: boolean;
249
+ scrollToFirst?: boolean;
250
+ /** 'HH:mm' or `{ hour, minutes }`. Lowest precedence. */
251
+ initialTime?: { hour: number; minutes: number } | string;
252
+ };