react-day-picker 9.6.7 → 9.7.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 (623) hide show
  1. package/README.md +9 -1
  2. package/dist/cjs/DayPicker.d.ts +4 -2
  3. package/dist/cjs/DayPicker.js +59 -8
  4. package/dist/cjs/DayPicker.js.map +1 -1
  5. package/dist/cjs/UI.d.ts +11 -23
  6. package/dist/cjs/UI.js +6 -8
  7. package/dist/cjs/UI.js.map +1 -1
  8. package/dist/cjs/classes/CalendarDay.d.ts +17 -14
  9. package/dist/cjs/classes/CalendarDay.js +9 -6
  10. package/dist/cjs/classes/CalendarDay.js.map +1 -1
  11. package/dist/cjs/classes/CalendarMonth.d.ts +8 -3
  12. package/dist/cjs/classes/CalendarMonth.js +6 -1
  13. package/dist/cjs/classes/CalendarMonth.js.map +1 -1
  14. package/dist/cjs/classes/CalendarWeek.d.ts +6 -2
  15. package/dist/cjs/classes/CalendarWeek.js +5 -1
  16. package/dist/cjs/classes/CalendarWeek.js.map +1 -1
  17. package/dist/cjs/classes/DateLib.d.ts +53 -52
  18. package/dist/cjs/classes/DateLib.js +26 -22
  19. package/dist/cjs/classes/DateLib.js.map +1 -1
  20. package/dist/cjs/components/Day.d.ts +4 -4
  21. package/dist/cjs/components/Day.js +4 -4
  22. package/dist/cjs/components/DayButton.d.ts +2 -2
  23. package/dist/cjs/components/DayButton.js +1 -1
  24. package/dist/cjs/components/Dropdown.d.ts +4 -6
  25. package/dist/cjs/components/Dropdown.js +1 -1
  26. package/dist/cjs/components/Dropdown.js.map +1 -1
  27. package/dist/cjs/components/DropdownNav.d.ts +1 -1
  28. package/dist/cjs/components/DropdownNav.js +1 -1
  29. package/dist/cjs/components/Footer.d.ts +1 -1
  30. package/dist/cjs/components/Footer.js +1 -1
  31. package/dist/cjs/components/Month.d.ts +3 -3
  32. package/dist/cjs/components/Month.js +1 -1
  33. package/dist/cjs/components/MonthCaption.d.ts +3 -3
  34. package/dist/cjs/components/MonthCaption.js +1 -1
  35. package/dist/cjs/components/MonthGrid.d.ts +1 -1
  36. package/dist/cjs/components/MonthGrid.js +1 -1
  37. package/dist/cjs/components/Months.d.ts +1 -1
  38. package/dist/cjs/components/Months.js +1 -1
  39. package/dist/cjs/components/MonthsDropdown.d.ts +1 -1
  40. package/dist/cjs/components/MonthsDropdown.js +1 -1
  41. package/dist/cjs/components/Nav.d.ts +5 -1
  42. package/dist/cjs/components/Nav.js +1 -1
  43. package/dist/cjs/components/Nav.js.map +1 -1
  44. package/dist/cjs/components/NextMonthButton.d.ts +1 -1
  45. package/dist/cjs/components/NextMonthButton.js +1 -1
  46. package/dist/cjs/components/Option.d.ts +1 -1
  47. package/dist/cjs/components/Option.js +1 -1
  48. package/dist/cjs/components/PreviousMonthButton.d.ts +1 -1
  49. package/dist/cjs/components/PreviousMonthButton.js +1 -1
  50. package/dist/cjs/components/Root.d.ts +2 -2
  51. package/dist/cjs/components/Root.js +1 -1
  52. package/dist/cjs/components/Select.d.ts +1 -1
  53. package/dist/cjs/components/Select.js +1 -1
  54. package/dist/cjs/components/Week.d.ts +2 -1
  55. package/dist/cjs/components/Week.js +1 -1
  56. package/dist/cjs/components/Week.js.map +1 -1
  57. package/dist/cjs/components/WeekNumber.d.ts +2 -2
  58. package/dist/cjs/components/WeekNumber.js +1 -1
  59. package/dist/cjs/components/WeekNumberHeader.d.ts +1 -1
  60. package/dist/cjs/components/WeekNumberHeader.js +1 -1
  61. package/dist/cjs/components/Weekday.d.ts +1 -1
  62. package/dist/cjs/components/Weekday.js +1 -1
  63. package/dist/cjs/components/Weekdays.d.ts +1 -1
  64. package/dist/cjs/components/Weekdays.js +1 -1
  65. package/dist/cjs/components/Weeks.d.ts +1 -1
  66. package/dist/cjs/components/Weeks.js +1 -1
  67. package/dist/cjs/components/YearsDropdown.d.ts +1 -1
  68. package/dist/cjs/components/YearsDropdown.js +1 -1
  69. package/dist/cjs/formatters/formatCaption.d.ts +7 -2
  70. package/dist/cjs/formatters/formatCaption.js +7 -2
  71. package/dist/cjs/formatters/formatCaption.js.map +1 -1
  72. package/dist/cjs/formatters/formatDay.d.ts +7 -2
  73. package/dist/cjs/formatters/formatDay.js +7 -2
  74. package/dist/cjs/formatters/formatDay.js.map +1 -1
  75. package/dist/cjs/formatters/formatMonthDropdown.d.ts +6 -2
  76. package/dist/cjs/formatters/formatMonthDropdown.js +6 -2
  77. package/dist/cjs/formatters/formatMonthDropdown.js.map +1 -1
  78. package/dist/cjs/formatters/formatWeekNumber.d.ts +7 -3
  79. package/dist/cjs/formatters/formatWeekNumber.js +10 -5
  80. package/dist/cjs/formatters/formatWeekNumber.js.map +1 -1
  81. package/dist/cjs/formatters/formatWeekNumberHeader.d.ts +3 -2
  82. package/dist/cjs/formatters/formatWeekNumberHeader.js +3 -2
  83. package/dist/cjs/formatters/formatWeekNumberHeader.js.map +1 -1
  84. package/dist/cjs/formatters/formatWeekdayName.d.ts +7 -2
  85. package/dist/cjs/formatters/formatWeekdayName.js +7 -2
  86. package/dist/cjs/formatters/formatWeekdayName.js.map +1 -1
  87. package/dist/cjs/formatters/formatYearDropdown.d.ts +5 -1
  88. package/dist/cjs/formatters/formatYearDropdown.js +5 -1
  89. package/dist/cjs/formatters/formatYearDropdown.js.map +1 -1
  90. package/dist/cjs/helpers/calculateFocusTarget.d.ts +14 -0
  91. package/dist/cjs/helpers/calculateFocusTarget.js +24 -1
  92. package/dist/cjs/helpers/calculateFocusTarget.js.map +1 -1
  93. package/dist/cjs/helpers/createGetModifiers.d.ts +16 -0
  94. package/dist/cjs/{useGetModifiers.js → helpers/createGetModifiers.js} +13 -7
  95. package/dist/cjs/helpers/createGetModifiers.js.map +1 -0
  96. package/dist/cjs/helpers/endOfBroadcastWeek.d.ts +7 -1
  97. package/dist/cjs/helpers/endOfBroadcastWeek.js +7 -1
  98. package/dist/cjs/helpers/endOfBroadcastWeek.js.map +1 -1
  99. package/dist/cjs/helpers/getBroadcastWeeksInMonth.d.ts +8 -1
  100. package/dist/cjs/helpers/getBroadcastWeeksInMonth.js +8 -1
  101. package/dist/cjs/helpers/getBroadcastWeeksInMonth.js.map +1 -1
  102. package/dist/cjs/helpers/getClassNamesForModifiers.d.ts +12 -0
  103. package/dist/cjs/helpers/getClassNamesForModifiers.js +12 -0
  104. package/dist/cjs/helpers/getClassNamesForModifiers.js.map +1 -1
  105. package/dist/cjs/helpers/getComponents.d.ts +10 -0
  106. package/dist/cjs/helpers/getComponents.js +10 -0
  107. package/dist/cjs/helpers/getComponents.js.map +1 -1
  108. package/dist/cjs/helpers/getDataAttributes.d.ts +9 -1
  109. package/dist/cjs/helpers/getDataAttributes.js +11 -2
  110. package/dist/cjs/helpers/getDataAttributes.js.map +1 -1
  111. package/dist/cjs/helpers/getDates.d.ts +12 -1
  112. package/dist/cjs/helpers/getDates.js +13 -2
  113. package/dist/cjs/helpers/getDates.js.map +1 -1
  114. package/dist/cjs/helpers/getDays.d.ts +4 -0
  115. package/dist/cjs/helpers/getDays.js +4 -1
  116. package/dist/cjs/helpers/getDays.js.map +1 -1
  117. package/dist/cjs/helpers/getDefaultClassNames.d.ts +5 -1
  118. package/dist/cjs/helpers/getDefaultClassNames.js +5 -1
  119. package/dist/cjs/helpers/getDefaultClassNames.js.map +1 -1
  120. package/dist/cjs/helpers/getDisplayMonths.d.ts +10 -0
  121. package/dist/cjs/helpers/getDisplayMonths.js +10 -0
  122. package/dist/cjs/helpers/getDisplayMonths.js.map +1 -1
  123. package/dist/cjs/helpers/getFocusableDate.d.ts +16 -1
  124. package/dist/cjs/helpers/getFocusableDate.js +17 -2
  125. package/dist/cjs/helpers/getFocusableDate.js.map +1 -1
  126. package/dist/cjs/helpers/getFormatters.d.ts +7 -1
  127. package/dist/cjs/helpers/getFormatters.js +7 -1
  128. package/dist/cjs/helpers/getFormatters.js.map +1 -1
  129. package/dist/cjs/helpers/getInitialMonth.d.ts +11 -1
  130. package/dist/cjs/helpers/getInitialMonth.js +14 -7
  131. package/dist/cjs/helpers/getInitialMonth.js.map +1 -1
  132. package/dist/cjs/helpers/getLabels.d.ts +6 -1
  133. package/dist/cjs/helpers/getLabels.js +6 -1
  134. package/dist/cjs/helpers/getLabels.js.map +1 -1
  135. package/dist/cjs/helpers/getMonthOptions.d.ts +15 -1
  136. package/dist/cjs/helpers/getMonthOptions.js +15 -1
  137. package/dist/cjs/helpers/getMonthOptions.js.map +1 -1
  138. package/dist/cjs/helpers/getMonths.d.ts +15 -8
  139. package/dist/cjs/helpers/getMonths.js +16 -9
  140. package/dist/cjs/helpers/getMonths.js.map +1 -1
  141. package/dist/cjs/helpers/getNavMonth.d.ts +7 -1
  142. package/dist/cjs/helpers/getNavMonth.js +7 -1
  143. package/dist/cjs/helpers/getNavMonth.js.map +1 -1
  144. package/dist/cjs/helpers/getNextFocus.d.ts +18 -3
  145. package/dist/cjs/helpers/getNextFocus.js +19 -5
  146. package/dist/cjs/helpers/getNextFocus.js.map +1 -1
  147. package/dist/cjs/helpers/getNextMonth.d.ts +13 -5
  148. package/dist/cjs/helpers/getNextMonth.js +13 -6
  149. package/dist/cjs/helpers/getNextMonth.js.map +1 -1
  150. package/dist/cjs/helpers/getPreviousMonth.d.ts +13 -5
  151. package/dist/cjs/helpers/getPreviousMonth.js +13 -5
  152. package/dist/cjs/helpers/getPreviousMonth.js.map +1 -1
  153. package/dist/cjs/helpers/getStyleForModifiers.d.ts +11 -0
  154. package/dist/cjs/helpers/getStyleForModifiers.js +11 -0
  155. package/dist/cjs/helpers/getStyleForModifiers.js.map +1 -1
  156. package/dist/cjs/helpers/getWeekdays.d.ts +9 -9
  157. package/dist/cjs/helpers/getWeekdays.js +9 -9
  158. package/dist/cjs/helpers/getWeekdays.js.map +1 -1
  159. package/dist/cjs/helpers/getWeeks.d.ts +6 -1
  160. package/dist/cjs/helpers/getWeeks.js +6 -1
  161. package/dist/cjs/helpers/getWeeks.js.map +1 -1
  162. package/dist/cjs/helpers/getYearOptions.d.ts +13 -1
  163. package/dist/cjs/helpers/getYearOptions.js +13 -1
  164. package/dist/cjs/helpers/getYearOptions.js.map +1 -1
  165. package/dist/cjs/helpers/startOfBroadcastWeek.d.ts +8 -1
  166. package/dist/cjs/helpers/startOfBroadcastWeek.js +8 -1
  167. package/dist/cjs/helpers/startOfBroadcastWeek.js.map +1 -1
  168. package/dist/cjs/helpers/useControlledValue.d.ts +10 -6
  169. package/dist/cjs/helpers/useControlledValue.js +10 -6
  170. package/dist/cjs/helpers/useControlledValue.js.map +1 -1
  171. package/dist/cjs/labels/labelDayButton.d.ts +9 -6
  172. package/dist/cjs/labels/labelDayButton.js +9 -6
  173. package/dist/cjs/labels/labelDayButton.js.map +1 -1
  174. package/dist/cjs/labels/labelGrid.d.ts +7 -3
  175. package/dist/cjs/labels/labelGrid.js +7 -3
  176. package/dist/cjs/labels/labelGrid.js.map +1 -1
  177. package/dist/cjs/labels/labelGridcell.d.ts +7 -4
  178. package/dist/cjs/labels/labelGridcell.js +7 -4
  179. package/dist/cjs/labels/labelGridcell.js.map +1 -1
  180. package/dist/cjs/labels/labelMonthDropdown.d.ts +3 -1
  181. package/dist/cjs/labels/labelMonthDropdown.js +3 -1
  182. package/dist/cjs/labels/labelMonthDropdown.js.map +1 -1
  183. package/dist/cjs/labels/labelNav.d.ts +2 -1
  184. package/dist/cjs/labels/labelNav.js +2 -1
  185. package/dist/cjs/labels/labelNav.js.map +1 -1
  186. package/dist/cjs/labels/labelNext.d.ts +5 -4
  187. package/dist/cjs/labels/labelNext.js +5 -4
  188. package/dist/cjs/labels/labelNext.js.map +1 -1
  189. package/dist/cjs/labels/labelPrevious.d.ts +5 -4
  190. package/dist/cjs/labels/labelPrevious.js +5 -4
  191. package/dist/cjs/labels/labelPrevious.js.map +1 -1
  192. package/dist/cjs/labels/labelWeekNumber.d.ts +4 -1
  193. package/dist/cjs/labels/labelWeekNumber.js +4 -1
  194. package/dist/cjs/labels/labelWeekNumber.js.map +1 -1
  195. package/dist/cjs/labels/labelWeekNumberHeader.d.ts +3 -1
  196. package/dist/cjs/labels/labelWeekNumberHeader.js +3 -1
  197. package/dist/cjs/labels/labelWeekNumberHeader.js.map +1 -1
  198. package/dist/cjs/labels/labelWeekday.d.ts +5 -1
  199. package/dist/cjs/labels/labelWeekday.js +5 -1
  200. package/dist/cjs/labels/labelWeekday.js.map +1 -1
  201. package/dist/cjs/labels/labelYearDropdown.d.ts +3 -1
  202. package/dist/cjs/labels/labelYearDropdown.js +3 -1
  203. package/dist/cjs/labels/labelYearDropdown.js.map +1 -1
  204. package/dist/cjs/persian.d.ts +15 -2
  205. package/dist/cjs/persian.js +15 -2
  206. package/dist/cjs/persian.js.map +1 -1
  207. package/dist/cjs/selection/useMulti.d.ts +9 -0
  208. package/dist/cjs/selection/useMulti.js +9 -0
  209. package/dist/cjs/selection/useMulti.js.map +1 -1
  210. package/dist/cjs/selection/useRange.d.ts +9 -0
  211. package/dist/cjs/selection/useRange.js +9 -0
  212. package/dist/cjs/selection/useRange.js.map +1 -1
  213. package/dist/cjs/selection/useSingle.d.ts +9 -0
  214. package/dist/cjs/selection/useSingle.js +9 -0
  215. package/dist/cjs/selection/useSingle.js.map +1 -1
  216. package/dist/cjs/types/deprecated.d.ts +8 -8
  217. package/dist/cjs/types/deprecated.js +1 -1
  218. package/dist/cjs/types/props.d.ts +57 -13
  219. package/dist/cjs/types/selection.d.ts +25 -0
  220. package/dist/cjs/types/shared.d.ts +29 -78
  221. package/dist/cjs/useAnimation.d.ts +11 -1
  222. package/dist/cjs/useAnimation.js +11 -1
  223. package/dist/cjs/useAnimation.js.map +1 -1
  224. package/dist/cjs/useCalendar.d.ts +9 -1
  225. package/dist/cjs/useCalendar.js +9 -1
  226. package/dist/cjs/useCalendar.js.map +1 -1
  227. package/dist/cjs/useDayPicker.d.ts +4 -6
  228. package/dist/cjs/useDayPicker.js +4 -6
  229. package/dist/cjs/useDayPicker.js.map +1 -1
  230. package/dist/cjs/useFocus.d.ts +14 -1
  231. package/dist/cjs/useFocus.js +14 -1
  232. package/dist/cjs/useFocus.js.map +1 -1
  233. package/dist/cjs/useSelection.d.ts +10 -0
  234. package/dist/cjs/useSelection.js +10 -0
  235. package/dist/cjs/useSelection.js.map +1 -1
  236. package/dist/cjs/utc.d.ts +6 -0
  237. package/dist/cjs/utc.js +6 -0
  238. package/dist/cjs/utc.js.map +1 -1
  239. package/dist/cjs/utils/addToRange.d.ts +10 -11
  240. package/dist/cjs/utils/addToRange.js +10 -11
  241. package/dist/cjs/utils/addToRange.js.map +1 -1
  242. package/dist/cjs/utils/dateMatchModifiers.d.ts +5 -15
  243. package/dist/cjs/utils/dateMatchModifiers.js +5 -15
  244. package/dist/cjs/utils/dateMatchModifiers.js.map +1 -1
  245. package/dist/cjs/utils/rangeContainsDayOfWeek.d.ts +7 -9
  246. package/dist/cjs/utils/rangeContainsDayOfWeek.js +7 -9
  247. package/dist/cjs/utils/rangeContainsDayOfWeek.js.map +1 -1
  248. package/dist/cjs/utils/rangeContainsModifiers.d.ts +5 -14
  249. package/dist/cjs/utils/rangeContainsModifiers.js +5 -14
  250. package/dist/cjs/utils/rangeContainsModifiers.js.map +1 -1
  251. package/dist/cjs/utils/rangeIncludesDate.d.ts +7 -4
  252. package/dist/cjs/utils/rangeIncludesDate.js +7 -4
  253. package/dist/cjs/utils/rangeIncludesDate.js.map +1 -1
  254. package/dist/cjs/utils/rangeOverlaps.d.ts +5 -1
  255. package/dist/cjs/utils/rangeOverlaps.js +5 -1
  256. package/dist/cjs/utils/rangeOverlaps.js.map +1 -1
  257. package/dist/cjs/utils/typeguards.d.ts +19 -6
  258. package/dist/cjs/utils/typeguards.js +19 -6
  259. package/dist/cjs/utils/typeguards.js.map +1 -1
  260. package/dist/esm/DayPicker.d.ts +4 -2
  261. package/dist/esm/DayPicker.js +59 -8
  262. package/dist/esm/DayPicker.js.map +1 -1
  263. package/dist/esm/UI.d.ts +11 -23
  264. package/dist/esm/UI.js +6 -8
  265. package/dist/esm/UI.js.map +1 -1
  266. package/dist/esm/classes/CalendarDay.d.ts +17 -14
  267. package/dist/esm/classes/CalendarDay.js +9 -6
  268. package/dist/esm/classes/CalendarDay.js.map +1 -1
  269. package/dist/esm/classes/CalendarMonth.d.ts +8 -3
  270. package/dist/esm/classes/CalendarMonth.js +6 -1
  271. package/dist/esm/classes/CalendarMonth.js.map +1 -1
  272. package/dist/esm/classes/CalendarWeek.d.ts +6 -2
  273. package/dist/esm/classes/CalendarWeek.js +5 -1
  274. package/dist/esm/classes/CalendarWeek.js.map +1 -1
  275. package/dist/esm/classes/DateLib.d.ts +53 -52
  276. package/dist/esm/classes/DateLib.js +26 -22
  277. package/dist/esm/classes/DateLib.js.map +1 -1
  278. package/dist/esm/components/Day.d.ts +4 -4
  279. package/dist/esm/components/Day.js +4 -4
  280. package/dist/esm/components/DayButton.d.ts +2 -2
  281. package/dist/esm/components/DayButton.js +1 -1
  282. package/dist/esm/components/Dropdown.d.ts +4 -6
  283. package/dist/esm/components/Dropdown.js +1 -1
  284. package/dist/esm/components/Dropdown.js.map +1 -1
  285. package/dist/esm/components/DropdownNav.d.ts +1 -1
  286. package/dist/esm/components/DropdownNav.js +1 -1
  287. package/dist/esm/components/Footer.d.ts +1 -1
  288. package/dist/esm/components/Footer.js +1 -1
  289. package/dist/esm/components/Month.d.ts +3 -3
  290. package/dist/esm/components/Month.js +1 -1
  291. package/dist/esm/components/MonthCaption.d.ts +3 -3
  292. package/dist/esm/components/MonthCaption.js +1 -1
  293. package/dist/esm/components/MonthGrid.d.ts +1 -1
  294. package/dist/esm/components/MonthGrid.js +1 -1
  295. package/dist/esm/components/Months.d.ts +1 -1
  296. package/dist/esm/components/Months.js +1 -1
  297. package/dist/esm/components/MonthsDropdown.d.ts +1 -1
  298. package/dist/esm/components/MonthsDropdown.js +1 -1
  299. package/dist/esm/components/Nav.d.ts +5 -1
  300. package/dist/esm/components/Nav.js +1 -1
  301. package/dist/esm/components/Nav.js.map +1 -1
  302. package/dist/esm/components/NextMonthButton.d.ts +1 -1
  303. package/dist/esm/components/NextMonthButton.js +1 -1
  304. package/dist/esm/components/Option.d.ts +1 -1
  305. package/dist/esm/components/Option.js +1 -1
  306. package/dist/esm/components/PreviousMonthButton.d.ts +1 -1
  307. package/dist/esm/components/PreviousMonthButton.js +1 -1
  308. package/dist/esm/components/Root.d.ts +2 -2
  309. package/dist/esm/components/Root.js +1 -1
  310. package/dist/esm/components/Select.d.ts +1 -1
  311. package/dist/esm/components/Select.js +1 -1
  312. package/dist/esm/components/Week.d.ts +2 -1
  313. package/dist/esm/components/Week.js +1 -1
  314. package/dist/esm/components/Week.js.map +1 -1
  315. package/dist/esm/components/WeekNumber.d.ts +2 -2
  316. package/dist/esm/components/WeekNumber.js +1 -1
  317. package/dist/esm/components/WeekNumberHeader.d.ts +1 -1
  318. package/dist/esm/components/WeekNumberHeader.js +1 -1
  319. package/dist/esm/components/Weekday.d.ts +1 -1
  320. package/dist/esm/components/Weekday.js +1 -1
  321. package/dist/esm/components/Weekdays.d.ts +1 -1
  322. package/dist/esm/components/Weekdays.js +1 -1
  323. package/dist/esm/components/Weeks.d.ts +1 -1
  324. package/dist/esm/components/Weeks.js +1 -1
  325. package/dist/esm/components/YearsDropdown.d.ts +1 -1
  326. package/dist/esm/components/YearsDropdown.js +1 -1
  327. package/dist/esm/formatters/formatCaption.d.ts +7 -2
  328. package/dist/esm/formatters/formatCaption.js +7 -2
  329. package/dist/esm/formatters/formatCaption.js.map +1 -1
  330. package/dist/esm/formatters/formatDay.d.ts +7 -2
  331. package/dist/esm/formatters/formatDay.js +7 -2
  332. package/dist/esm/formatters/formatDay.js.map +1 -1
  333. package/dist/esm/formatters/formatMonthDropdown.d.ts +6 -2
  334. package/dist/esm/formatters/formatMonthDropdown.js +6 -2
  335. package/dist/esm/formatters/formatMonthDropdown.js.map +1 -1
  336. package/dist/esm/formatters/formatWeekNumber.d.ts +7 -3
  337. package/dist/esm/formatters/formatWeekNumber.js +10 -5
  338. package/dist/esm/formatters/formatWeekNumber.js.map +1 -1
  339. package/dist/esm/formatters/formatWeekNumberHeader.d.ts +3 -2
  340. package/dist/esm/formatters/formatWeekNumberHeader.js +3 -2
  341. package/dist/esm/formatters/formatWeekNumberHeader.js.map +1 -1
  342. package/dist/esm/formatters/formatWeekdayName.d.ts +7 -2
  343. package/dist/esm/formatters/formatWeekdayName.js +7 -2
  344. package/dist/esm/formatters/formatWeekdayName.js.map +1 -1
  345. package/dist/esm/formatters/formatYearDropdown.d.ts +5 -1
  346. package/dist/esm/formatters/formatYearDropdown.js +5 -1
  347. package/dist/esm/formatters/formatYearDropdown.js.map +1 -1
  348. package/dist/esm/helpers/calculateFocusTarget.d.ts +14 -0
  349. package/dist/esm/helpers/calculateFocusTarget.js +24 -1
  350. package/dist/esm/helpers/calculateFocusTarget.js.map +1 -1
  351. package/dist/esm/helpers/createGetModifiers.d.ts +16 -0
  352. package/dist/esm/{useGetModifiers.js → helpers/createGetModifiers.js} +12 -6
  353. package/dist/esm/helpers/createGetModifiers.js.map +1 -0
  354. package/dist/esm/helpers/endOfBroadcastWeek.d.ts +7 -1
  355. package/dist/esm/helpers/endOfBroadcastWeek.js +7 -1
  356. package/dist/esm/helpers/endOfBroadcastWeek.js.map +1 -1
  357. package/dist/esm/helpers/getBroadcastWeeksInMonth.d.ts +8 -1
  358. package/dist/esm/helpers/getBroadcastWeeksInMonth.js +8 -1
  359. package/dist/esm/helpers/getBroadcastWeeksInMonth.js.map +1 -1
  360. package/dist/esm/helpers/getClassNamesForModifiers.d.ts +12 -0
  361. package/dist/esm/helpers/getClassNamesForModifiers.js +12 -0
  362. package/dist/esm/helpers/getClassNamesForModifiers.js.map +1 -1
  363. package/dist/esm/helpers/getComponents.d.ts +10 -0
  364. package/dist/esm/helpers/getComponents.js +10 -0
  365. package/dist/esm/helpers/getComponents.js.map +1 -1
  366. package/dist/esm/helpers/getDataAttributes.d.ts +9 -1
  367. package/dist/esm/helpers/getDataAttributes.js +11 -2
  368. package/dist/esm/helpers/getDataAttributes.js.map +1 -1
  369. package/dist/esm/helpers/getDates.d.ts +12 -1
  370. package/dist/esm/helpers/getDates.js +13 -2
  371. package/dist/esm/helpers/getDates.js.map +1 -1
  372. package/dist/esm/helpers/getDays.d.ts +4 -0
  373. package/dist/esm/helpers/getDays.js +4 -1
  374. package/dist/esm/helpers/getDays.js.map +1 -1
  375. package/dist/esm/helpers/getDefaultClassNames.d.ts +5 -1
  376. package/dist/esm/helpers/getDefaultClassNames.js +5 -1
  377. package/dist/esm/helpers/getDefaultClassNames.js.map +1 -1
  378. package/dist/esm/helpers/getDisplayMonths.d.ts +10 -0
  379. package/dist/esm/helpers/getDisplayMonths.js +10 -0
  380. package/dist/esm/helpers/getDisplayMonths.js.map +1 -1
  381. package/dist/esm/helpers/getFocusableDate.d.ts +16 -1
  382. package/dist/esm/helpers/getFocusableDate.js +17 -2
  383. package/dist/esm/helpers/getFocusableDate.js.map +1 -1
  384. package/dist/esm/helpers/getFormatters.d.ts +7 -1
  385. package/dist/esm/helpers/getFormatters.js +7 -1
  386. package/dist/esm/helpers/getFormatters.js.map +1 -1
  387. package/dist/esm/helpers/getInitialMonth.d.ts +11 -1
  388. package/dist/esm/helpers/getInitialMonth.js +14 -7
  389. package/dist/esm/helpers/getInitialMonth.js.map +1 -1
  390. package/dist/esm/helpers/getLabels.d.ts +6 -1
  391. package/dist/esm/helpers/getLabels.js +6 -1
  392. package/dist/esm/helpers/getLabels.js.map +1 -1
  393. package/dist/esm/helpers/getMonthOptions.d.ts +15 -1
  394. package/dist/esm/helpers/getMonthOptions.js +15 -1
  395. package/dist/esm/helpers/getMonthOptions.js.map +1 -1
  396. package/dist/esm/helpers/getMonths.d.ts +15 -8
  397. package/dist/esm/helpers/getMonths.js +16 -9
  398. package/dist/esm/helpers/getMonths.js.map +1 -1
  399. package/dist/esm/helpers/getNavMonth.d.ts +7 -1
  400. package/dist/esm/helpers/getNavMonth.js +7 -1
  401. package/dist/esm/helpers/getNavMonth.js.map +1 -1
  402. package/dist/esm/helpers/getNextFocus.d.ts +18 -3
  403. package/dist/esm/helpers/getNextFocus.js +19 -5
  404. package/dist/esm/helpers/getNextFocus.js.map +1 -1
  405. package/dist/esm/helpers/getNextMonth.d.ts +13 -5
  406. package/dist/esm/helpers/getNextMonth.js +13 -6
  407. package/dist/esm/helpers/getNextMonth.js.map +1 -1
  408. package/dist/esm/helpers/getPreviousMonth.d.ts +13 -5
  409. package/dist/esm/helpers/getPreviousMonth.js +13 -5
  410. package/dist/esm/helpers/getPreviousMonth.js.map +1 -1
  411. package/dist/esm/helpers/getStyleForModifiers.d.ts +11 -0
  412. package/dist/esm/helpers/getStyleForModifiers.js +11 -0
  413. package/dist/esm/helpers/getStyleForModifiers.js.map +1 -1
  414. package/dist/esm/helpers/getWeekdays.d.ts +9 -9
  415. package/dist/esm/helpers/getWeekdays.js +9 -9
  416. package/dist/esm/helpers/getWeekdays.js.map +1 -1
  417. package/dist/esm/helpers/getWeeks.d.ts +6 -1
  418. package/dist/esm/helpers/getWeeks.js +6 -1
  419. package/dist/esm/helpers/getWeeks.js.map +1 -1
  420. package/dist/esm/helpers/getYearOptions.d.ts +13 -1
  421. package/dist/esm/helpers/getYearOptions.js +13 -1
  422. package/dist/esm/helpers/getYearOptions.js.map +1 -1
  423. package/dist/esm/helpers/startOfBroadcastWeek.d.ts +8 -1
  424. package/dist/esm/helpers/startOfBroadcastWeek.js +8 -1
  425. package/dist/esm/helpers/startOfBroadcastWeek.js.map +1 -1
  426. package/dist/esm/helpers/useControlledValue.d.ts +10 -6
  427. package/dist/esm/helpers/useControlledValue.js +10 -6
  428. package/dist/esm/helpers/useControlledValue.js.map +1 -1
  429. package/dist/esm/labels/labelDayButton.d.ts +9 -6
  430. package/dist/esm/labels/labelDayButton.js +9 -6
  431. package/dist/esm/labels/labelDayButton.js.map +1 -1
  432. package/dist/esm/labels/labelGrid.d.ts +7 -3
  433. package/dist/esm/labels/labelGrid.js +7 -3
  434. package/dist/esm/labels/labelGrid.js.map +1 -1
  435. package/dist/esm/labels/labelGridcell.d.ts +7 -4
  436. package/dist/esm/labels/labelGridcell.js +7 -4
  437. package/dist/esm/labels/labelGridcell.js.map +1 -1
  438. package/dist/esm/labels/labelMonthDropdown.d.ts +3 -1
  439. package/dist/esm/labels/labelMonthDropdown.js +3 -1
  440. package/dist/esm/labels/labelMonthDropdown.js.map +1 -1
  441. package/dist/esm/labels/labelNav.d.ts +2 -1
  442. package/dist/esm/labels/labelNav.js +2 -1
  443. package/dist/esm/labels/labelNav.js.map +1 -1
  444. package/dist/esm/labels/labelNext.d.ts +5 -4
  445. package/dist/esm/labels/labelNext.js +5 -4
  446. package/dist/esm/labels/labelNext.js.map +1 -1
  447. package/dist/esm/labels/labelPrevious.d.ts +5 -4
  448. package/dist/esm/labels/labelPrevious.js +5 -4
  449. package/dist/esm/labels/labelPrevious.js.map +1 -1
  450. package/dist/esm/labels/labelWeekNumber.d.ts +4 -1
  451. package/dist/esm/labels/labelWeekNumber.js +4 -1
  452. package/dist/esm/labels/labelWeekNumber.js.map +1 -1
  453. package/dist/esm/labels/labelWeekNumberHeader.d.ts +3 -1
  454. package/dist/esm/labels/labelWeekNumberHeader.js +3 -1
  455. package/dist/esm/labels/labelWeekNumberHeader.js.map +1 -1
  456. package/dist/esm/labels/labelWeekday.d.ts +5 -1
  457. package/dist/esm/labels/labelWeekday.js +5 -1
  458. package/dist/esm/labels/labelWeekday.js.map +1 -1
  459. package/dist/esm/labels/labelYearDropdown.d.ts +3 -1
  460. package/dist/esm/labels/labelYearDropdown.js +3 -1
  461. package/dist/esm/labels/labelYearDropdown.js.map +1 -1
  462. package/dist/esm/persian.d.ts +15 -2
  463. package/dist/esm/persian.js +15 -2
  464. package/dist/esm/persian.js.map +1 -1
  465. package/dist/esm/selection/useMulti.d.ts +9 -0
  466. package/dist/esm/selection/useMulti.js +9 -0
  467. package/dist/esm/selection/useMulti.js.map +1 -1
  468. package/dist/esm/selection/useRange.d.ts +9 -0
  469. package/dist/esm/selection/useRange.js +9 -0
  470. package/dist/esm/selection/useRange.js.map +1 -1
  471. package/dist/esm/selection/useSingle.d.ts +9 -0
  472. package/dist/esm/selection/useSingle.js +9 -0
  473. package/dist/esm/selection/useSingle.js.map +1 -1
  474. package/dist/esm/types/deprecated.d.ts +8 -8
  475. package/dist/esm/types/deprecated.js +1 -1
  476. package/dist/esm/types/props.d.ts +57 -13
  477. package/dist/esm/types/selection.d.ts +25 -0
  478. package/dist/esm/types/shared.d.ts +29 -78
  479. package/dist/esm/useAnimation.d.ts +11 -1
  480. package/dist/esm/useAnimation.js +11 -1
  481. package/dist/esm/useAnimation.js.map +1 -1
  482. package/dist/esm/useCalendar.d.ts +9 -1
  483. package/dist/esm/useCalendar.js +9 -1
  484. package/dist/esm/useCalendar.js.map +1 -1
  485. package/dist/esm/useDayPicker.d.ts +4 -6
  486. package/dist/esm/useDayPicker.js +4 -6
  487. package/dist/esm/useDayPicker.js.map +1 -1
  488. package/dist/esm/useFocus.d.ts +14 -1
  489. package/dist/esm/useFocus.js +14 -1
  490. package/dist/esm/useFocus.js.map +1 -1
  491. package/dist/esm/useSelection.d.ts +10 -0
  492. package/dist/esm/useSelection.js +10 -0
  493. package/dist/esm/useSelection.js.map +1 -1
  494. package/dist/esm/utc.d.ts +6 -0
  495. package/dist/esm/utc.js +6 -0
  496. package/dist/esm/utc.js.map +1 -1
  497. package/dist/esm/utils/addToRange.d.ts +10 -11
  498. package/dist/esm/utils/addToRange.js +10 -11
  499. package/dist/esm/utils/addToRange.js.map +1 -1
  500. package/dist/esm/utils/dateMatchModifiers.d.ts +5 -15
  501. package/dist/esm/utils/dateMatchModifiers.js +5 -15
  502. package/dist/esm/utils/dateMatchModifiers.js.map +1 -1
  503. package/dist/esm/utils/rangeContainsDayOfWeek.d.ts +7 -9
  504. package/dist/esm/utils/rangeContainsDayOfWeek.js +7 -9
  505. package/dist/esm/utils/rangeContainsDayOfWeek.js.map +1 -1
  506. package/dist/esm/utils/rangeContainsModifiers.d.ts +5 -14
  507. package/dist/esm/utils/rangeContainsModifiers.js +5 -14
  508. package/dist/esm/utils/rangeContainsModifiers.js.map +1 -1
  509. package/dist/esm/utils/rangeIncludesDate.d.ts +7 -4
  510. package/dist/esm/utils/rangeIncludesDate.js +7 -4
  511. package/dist/esm/utils/rangeIncludesDate.js.map +1 -1
  512. package/dist/esm/utils/rangeOverlaps.d.ts +5 -1
  513. package/dist/esm/utils/rangeOverlaps.js +5 -1
  514. package/dist/esm/utils/rangeOverlaps.js.map +1 -1
  515. package/dist/esm/utils/typeguards.d.ts +19 -6
  516. package/dist/esm/utils/typeguards.js +19 -6
  517. package/dist/esm/utils/typeguards.js.map +1 -1
  518. package/package.json +1 -1
  519. package/src/DayPicker.test.tsx +34 -0
  520. package/src/DayPicker.tsx +105 -6
  521. package/src/UI.ts +11 -23
  522. package/src/classes/CalendarDay.ts +17 -14
  523. package/src/classes/CalendarMonth.ts +8 -3
  524. package/src/classes/CalendarWeek.ts +8 -2
  525. package/src/classes/DateLib.ts +65 -76
  526. package/src/components/Day.tsx +4 -4
  527. package/src/components/DayButton.tsx +2 -2
  528. package/src/components/Dropdown.tsx +4 -6
  529. package/src/components/DropdownNav.tsx +1 -1
  530. package/src/components/Footer.tsx +1 -1
  531. package/src/components/Month.tsx +3 -3
  532. package/src/components/MonthCaption.tsx +3 -3
  533. package/src/components/MonthGrid.tsx +1 -1
  534. package/src/components/Months.tsx +1 -1
  535. package/src/components/MonthsDropdown.tsx +1 -1
  536. package/src/components/Nav.tsx +5 -1
  537. package/src/components/NextMonthButton.tsx +1 -1
  538. package/src/components/Option.tsx +1 -1
  539. package/src/components/PreviousMonthButton.tsx +1 -1
  540. package/src/components/Root.tsx +2 -2
  541. package/src/components/Select.tsx +1 -1
  542. package/src/components/Week.tsx +2 -1
  543. package/src/components/WeekNumber.tsx +2 -2
  544. package/src/components/WeekNumberHeader.tsx +1 -1
  545. package/src/components/Weekday.tsx +1 -1
  546. package/src/components/Weekdays.tsx +1 -1
  547. package/src/components/Weeks.tsx +1 -1
  548. package/src/components/YearsDropdown.tsx +1 -1
  549. package/src/formatters/formatCaption.ts +7 -2
  550. package/src/formatters/formatDay.ts +7 -2
  551. package/src/formatters/formatMonthDropdown.ts +6 -2
  552. package/src/formatters/formatWeekNumber.test.ts +11 -0
  553. package/src/formatters/formatWeekNumber.ts +11 -5
  554. package/src/formatters/formatWeekNumberHeader.ts +3 -2
  555. package/src/formatters/formatWeekdayName.ts +7 -2
  556. package/src/formatters/formatYearDropdown.ts +5 -1
  557. package/src/helpers/calculateFocusTarget.ts +25 -2
  558. package/src/{useGetModifiers.test.tsx → helpers/createGetModifiers.test.ts} +7 -8
  559. package/src/{useGetModifiers.tsx → helpers/createGetModifiers.ts} +13 -7
  560. package/src/helpers/endOfBroadcastWeek.ts +7 -1
  561. package/src/helpers/getBroadcastWeeksInMonth.ts +8 -1
  562. package/src/helpers/getClassNamesForModifiers.ts +13 -1
  563. package/src/helpers/getComponents.ts +10 -0
  564. package/src/helpers/getDataAttributes.tsx +11 -2
  565. package/src/helpers/getDates.ts +13 -2
  566. package/src/helpers/getDays.ts +4 -1
  567. package/src/helpers/getDefaultClassNames.ts +5 -1
  568. package/src/helpers/getDisplayMonths.ts +11 -1
  569. package/src/helpers/getFocusableDate.ts +17 -2
  570. package/src/helpers/getFormatters.ts +7 -1
  571. package/src/helpers/getInitialMonth.ts +14 -9
  572. package/src/helpers/getLabels.ts +6 -1
  573. package/src/helpers/getMonthOptions.ts +15 -1
  574. package/src/helpers/getMonths.ts +16 -5
  575. package/src/helpers/getNavMonth.ts +7 -1
  576. package/src/helpers/getNextFocus.tsx +18 -2
  577. package/src/helpers/getNextMonth.ts +13 -6
  578. package/src/helpers/getPreviousMonth.ts +13 -5
  579. package/src/helpers/getStyleForModifiers.ts +12 -1
  580. package/src/helpers/getWeekdays.ts +8 -5
  581. package/src/helpers/getWeeks.ts +6 -1
  582. package/src/helpers/getYearOptions.ts +13 -1
  583. package/src/helpers/startOfBroadcastWeek.ts +8 -1
  584. package/src/helpers/useControlledValue.ts +10 -6
  585. package/src/labels/labelDayButton.ts +8 -4
  586. package/src/labels/labelGrid.ts +7 -3
  587. package/src/labels/labelGridcell.ts +6 -2
  588. package/src/labels/labelMonthDropdown.ts +3 -1
  589. package/src/labels/labelNav.ts +2 -1
  590. package/src/labels/labelNext.ts +5 -5
  591. package/src/labels/labelPrevious.ts +5 -5
  592. package/src/labels/labelWeekNumber.ts +4 -1
  593. package/src/labels/labelWeekNumberHeader.ts +3 -1
  594. package/src/labels/labelWeekday.ts +5 -1
  595. package/src/labels/labelYearDropdown.ts +3 -1
  596. package/src/persian.tsx +15 -2
  597. package/src/selection/useMulti.tsx +9 -0
  598. package/src/selection/useRange.tsx +9 -0
  599. package/src/selection/useSingle.tsx +9 -0
  600. package/src/style.css +29 -0
  601. package/src/style.module.css +29 -0
  602. package/src/types/deprecated.ts +8 -8
  603. package/src/types/props.ts +58 -13
  604. package/src/types/selection.ts +25 -0
  605. package/src/types/shared.ts +29 -78
  606. package/src/useAnimation.ts +11 -1
  607. package/src/useCalendar.ts +9 -1
  608. package/src/useDayPicker.ts +4 -6
  609. package/src/useFocus.ts +14 -1
  610. package/src/useSelection.ts +10 -0
  611. package/src/utc.tsx +6 -0
  612. package/src/utils/addToRange.ts +9 -7
  613. package/src/utils/dateMatchModifiers.ts +5 -15
  614. package/src/utils/rangeContainsDayOfWeek.ts +7 -9
  615. package/src/utils/rangeContainsModifiers.ts +5 -14
  616. package/src/utils/rangeIncludesDate.ts +6 -2
  617. package/src/utils/rangeOverlaps.ts +5 -1
  618. package/src/utils/typeguards.ts +19 -6
  619. package/dist/cjs/useGetModifiers.d.ts +0 -10
  620. package/dist/cjs/useGetModifiers.js.map +0 -1
  621. package/dist/esm/useGetModifiers.d.ts +0 -10
  622. package/dist/esm/useGetModifiers.js.map +0 -1
  623. /package/src/helpers/{getPossibleFocusDate.test.ts → getFocusableDate.test.ts} +0 -0
@@ -1,12 +1,13 @@
1
1
  import React, { type HTMLAttributes } from "react";
2
2
  import type { CalendarWeek } from "../classes/index.js";
3
3
  /**
4
- * Render a row in the calendar, with the days and the week number.
4
+ * Render a table row representing a week in the calendar.
5
5
  *
6
6
  * @group Components
7
7
  * @see https://daypicker.dev/guides/custom-components
8
8
  */
9
9
  export declare function Week(props: {
10
+ /** The week to render. */
10
11
  week: CalendarWeek;
11
12
  } & HTMLAttributes<HTMLTableRowElement>): React.JSX.Element;
12
13
  export type WeekProps = Parameters<typeof Week>[0];
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  /**
3
- * Render a row in the calendar, with the days and the week number.
3
+ * Render a table row representing a week in the calendar.
4
4
  *
5
5
  * @group Components
6
6
  * @see https://daypicker.dev/guides/custom-components
@@ -1 +1 @@
1
- {"version":3,"file":"Week.js","sourceRoot":"","sources":["../../../src/components/Week.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD;;;;;GAKG;AACH,MAAM,UAAU,IAAI,CAClB,KAEuC;IAEvC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC;IACnC,OAAO,+BAAQ,OAAO,GAAI,CAAC;AAC7B,CAAC"}
1
+ {"version":3,"file":"Week.js","sourceRoot":"","sources":["../../../src/components/Week.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD;;;;;GAKG;AACH,MAAM,UAAU,IAAI,CAClB,KAGuC;IAEvC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC;IACnC,OAAO,+BAAQ,OAAO,GAAI,CAAC;AAC7B,CAAC"}
@@ -1,13 +1,13 @@
1
1
  import React, { type ThHTMLAttributes } from "react";
2
2
  import type { CalendarWeek } from "../classes/index.js";
3
3
  /**
4
- * Render the cell with the number of the week.
4
+ * Render a table cell displaying the number of the week.
5
5
  *
6
6
  * @group Components
7
7
  * @see https://daypicker.dev/guides/custom-components
8
8
  */
9
9
  export declare function WeekNumber(props: {
10
- /** The week to render. */
10
+ /** The week to display. */
11
11
  week: CalendarWeek;
12
12
  } & ThHTMLAttributes<HTMLTableCellElement>): React.JSX.Element;
13
13
  export type WeekNumberProps = Parameters<typeof WeekNumber>[0];
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  /**
3
- * Render the cell with the number of the week.
3
+ * Render a table cell displaying the number of the week.
4
4
  *
5
5
  * @group Components
6
6
  * @see https://daypicker.dev/guides/custom-components
@@ -1,6 +1,6 @@
1
1
  import React, { type ThHTMLAttributes } from "react";
2
2
  /**
3
- * Render the column header for the week numbers.
3
+ * Render the header cell for the week numbers column.
4
4
  *
5
5
  * @group Components
6
6
  * @see https://daypicker.dev/guides/custom-components
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  /**
3
- * Render the column header for the week numbers.
3
+ * Render the header cell for the week numbers column.
4
4
  *
5
5
  * @group Components
6
6
  * @see https://daypicker.dev/guides/custom-components
@@ -1,6 +1,6 @@
1
1
  import React, { type ThHTMLAttributes } from "react";
2
2
  /**
3
- * Render the column header with the weekday name (e.g. "Mo", "Tu", etc.).
3
+ * Render a table header cell with the name of a weekday (e.g., "Mo", "Tu").
4
4
  *
5
5
  * @group Components
6
6
  * @see https://daypicker.dev/guides/custom-components
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  /**
3
- * Render the column header with the weekday name (e.g. "Mo", "Tu", etc.).
3
+ * Render a table header cell with the name of a weekday (e.g., "Mo", "Tu").
4
4
  *
5
5
  * @group Components
6
6
  * @see https://daypicker.dev/guides/custom-components
@@ -1,6 +1,6 @@
1
1
  import React, { type HTMLAttributes } from "react";
2
2
  /**
3
- * Render the row with the weekday names.
3
+ * Render the table row containing the weekday names.
4
4
  *
5
5
  * @group Components
6
6
  * @see https://daypicker.dev/guides/custom-components
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  /**
3
- * Render the row with the weekday names.
3
+ * Render the table row containing the weekday names.
4
4
  *
5
5
  * @group Components
6
6
  * @see https://daypicker.dev/guides/custom-components
@@ -1,6 +1,6 @@
1
1
  import React, { type HTMLAttributes } from "react";
2
2
  /**
3
- * Render the weeks in the month grid.
3
+ * Render the container for the weeks in the month grid.
4
4
  *
5
5
  * @group Components
6
6
  * @see https://daypicker.dev/guides/custom-components
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  /**
3
- * Render the weeks in the month grid.
3
+ * Render the container for the weeks in the month grid.
4
4
  *
5
5
  * @group Components
6
6
  * @see https://daypicker.dev/guides/custom-components
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { DropdownProps } from "./Dropdown.js";
3
3
  /**
4
- * Render the dropdown to navigate between years.
4
+ * Render a dropdown to navigate between years in the calendar.
5
5
  *
6
6
  * @group Components
7
7
  * @see https://daypicker.dev/guides/custom-components
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { useDayPicker } from "../useDayPicker.js";
3
3
  /**
4
- * Render the dropdown to navigate between years.
4
+ * Render a dropdown to navigate between years in the calendar.
5
5
  *
6
6
  * @group Components
7
7
  * @see https://daypicker.dev/guides/custom-components
@@ -1,8 +1,13 @@
1
1
  import { DateLib, type DateLibOptions } from "../classes/DateLib.js";
2
2
  /**
3
- * Format the caption of the month.
3
+ * Formats the caption of the month.
4
4
  *
5
- * @defaultValue `LLLL y` (e.g. "November 2022")
5
+ * @defaultValue `LLLL y` (e.g., "November 2022").
6
+ * @param month The date representing the month.
7
+ * @param options Configuration options for the date library.
8
+ * @param dateLib The date library to use for formatting. If not provided, a new
9
+ * instance is created.
10
+ * @returns The formatted caption as a string.
6
11
  * @group Formatters
7
12
  * @see https://daypicker.dev/docs/translation#custom-formatters
8
13
  */
@@ -1,8 +1,13 @@
1
1
  import { DateLib } from "../classes/DateLib.js";
2
2
  /**
3
- * Format the caption of the month.
3
+ * Formats the caption of the month.
4
4
  *
5
- * @defaultValue `LLLL y` (e.g. "November 2022")
5
+ * @defaultValue `LLLL y` (e.g., "November 2022").
6
+ * @param month The date representing the month.
7
+ * @param options Configuration options for the date library.
8
+ * @param dateLib The date library to use for formatting. If not provided, a new
9
+ * instance is created.
10
+ * @returns The formatted caption as a string.
6
11
  * @group Formatters
7
12
  * @see https://daypicker.dev/docs/translation#custom-formatters
8
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"formatCaption.js","sourceRoot":"","sources":["../../../src/formatters/formatCaption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuB,MAAM,uBAAuB,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAW,EACX,OAAwB,EACxB,OAAiB;IAEjB,OAAO,CAAC,OAAO,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACnE,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC"}
1
+ {"version":3,"file":"formatCaption.js","sourceRoot":"","sources":["../../../src/formatters/formatCaption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuB,MAAM,uBAAuB,CAAC;AAErE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAW,EACX,OAAwB,EACxB,OAAiB;IAEjB,OAAO,CAAC,OAAO,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACnE,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC"}
@@ -1,8 +1,13 @@
1
1
  import { DateLib, type DateLibOptions } from "../classes/DateLib.js";
2
2
  /**
3
- * Format the day date shown in the day cell.
3
+ * Formats the day date shown in the day cell.
4
4
  *
5
- * @defaultValue `d` (e.g. "1")
5
+ * @defaultValue `d` (e.g., "1").
6
+ * @param date The date to format.
7
+ * @param options Configuration options for the date library.
8
+ * @param dateLib The date library to use for formatting. If not provided, a new
9
+ * instance is created.
10
+ * @returns The formatted day as a string.
6
11
  * @group Formatters
7
12
  * @see https://daypicker.dev/docs/translation#custom-formatters
8
13
  */
@@ -1,8 +1,13 @@
1
1
  import { DateLib } from "../classes/DateLib.js";
2
2
  /**
3
- * Format the day date shown in the day cell.
3
+ * Formats the day date shown in the day cell.
4
4
  *
5
- * @defaultValue `d` (e.g. "1")
5
+ * @defaultValue `d` (e.g., "1").
6
+ * @param date The date to format.
7
+ * @param options Configuration options for the date library.
8
+ * @param dateLib The date library to use for formatting. If not provided, a new
9
+ * instance is created.
10
+ * @returns The formatted day as a string.
6
11
  * @group Formatters
7
12
  * @see https://daypicker.dev/docs/translation#custom-formatters
8
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"formatDay.js","sourceRoot":"","sources":["../../../src/formatters/formatDay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuB,MAAM,uBAAuB,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CACvB,IAAU,EACV,OAAwB,EACxB,OAAiB;IAEjB,OAAO,CAAC,OAAO,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC7D,CAAC"}
1
+ {"version":3,"file":"formatDay.js","sourceRoot":"","sources":["../../../src/formatters/formatDay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuB,MAAM,uBAAuB,CAAC;AAErE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,SAAS,CACvB,IAAU,EACV,OAAwB,EACxB,OAAiB;IAEjB,OAAO,CAAC,OAAO,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC7D,CAAC"}
@@ -1,8 +1,12 @@
1
1
  import { type DateLib } from "../classes/DateLib.js";
2
2
  /**
3
- * Format the month number for the dropdown option label.
3
+ * Formats the month for the dropdown option label.
4
4
  *
5
- * @defaultValue The localized month name
5
+ * @defaultValue The localized full month name.
6
+ * @param month The date representing the month.
7
+ * @param dateLib The date library to use for formatting. Defaults to
8
+ * `defaultDateLib`.
9
+ * @returns The formatted month name as a string.
6
10
  * @group Formatters
7
11
  * @see https://daypicker.dev/docs/translation#custom-formatters
8
12
  */
@@ -1,8 +1,12 @@
1
1
  import { defaultDateLib } from "../classes/DateLib.js";
2
2
  /**
3
- * Format the month number for the dropdown option label.
3
+ * Formats the month for the dropdown option label.
4
4
  *
5
- * @defaultValue The localized month name
5
+ * @defaultValue The localized full month name.
6
+ * @param month The date representing the month.
7
+ * @param dateLib The date library to use for formatting. Defaults to
8
+ * `defaultDateLib`.
9
+ * @returns The formatted month name as a string.
6
10
  * @group Formatters
7
11
  * @see https://daypicker.dev/docs/translation#custom-formatters
8
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"formatMonthDropdown.js","sourceRoot":"","sources":["../../../src/formatters/formatMonthDropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAW,EACX,UAAmB,cAAc;IAEjC,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACvC,CAAC"}
1
+ {"version":3,"file":"formatMonthDropdown.js","sourceRoot":"","sources":["../../../src/formatters/formatMonthDropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAErE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAW,EACX,UAAmB,cAAc;IAEjC,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACvC,CAAC"}
@@ -1,8 +1,12 @@
1
1
  /**
2
- * Format the week number.
2
+ * Formats the week number.
3
3
  *
4
- * @defaultValue `weekNumber.toLocaleString()` with a leading zero for single-digit numbers
4
+ * @defaultValue The week number as a string, with a leading zero for single-digit numbers.
5
+ * @param weekNumber The week number to format.
6
+ * @param dateLib The date library to use for formatting. Defaults to
7
+ * `defaultDateLib`.
8
+ * @returns The formatted week number as a string.
5
9
  * @group Formatters
6
10
  * @see https://daypicker.dev/docs/translation#custom-formatters
7
11
  */
8
- export declare function formatWeekNumber(weekNumber: number): string;
12
+ export declare function formatWeekNumber(weekNumber: number, dateLib?: import("../classes/DateLib.js").DateLib): string;
@@ -1,14 +1,19 @@
1
+ import { defaultDateLib } from "../classes/DateLib.js";
1
2
  /**
2
- * Format the week number.
3
+ * Formats the week number.
3
4
  *
4
- * @defaultValue `weekNumber.toLocaleString()` with a leading zero for single-digit numbers
5
+ * @defaultValue The week number as a string, with a leading zero for single-digit numbers.
6
+ * @param weekNumber The week number to format.
7
+ * @param dateLib The date library to use for formatting. Defaults to
8
+ * `defaultDateLib`.
9
+ * @returns The formatted week number as a string.
5
10
  * @group Formatters
6
11
  * @see https://daypicker.dev/docs/translation#custom-formatters
7
12
  */
8
- export function formatWeekNumber(weekNumber) {
13
+ export function formatWeekNumber(weekNumber, dateLib = defaultDateLib) {
9
14
  if (weekNumber < 10) {
10
- return `0${weekNumber.toLocaleString()}`;
15
+ return dateLib.formatNumber(`0${weekNumber.toLocaleString()}`);
11
16
  }
12
- return `${weekNumber.toLocaleString()}`;
17
+ return dateLib.formatNumber(`${weekNumber.toLocaleString()}`);
13
18
  }
14
19
  //# sourceMappingURL=formatWeekNumber.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatWeekNumber.js","sourceRoot":"","sources":["../../../src/formatters/formatWeekNumber.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAAkB;IACjD,IAAI,UAAU,GAAG,EAAE,EAAE,CAAC;QACpB,OAAO,IAAI,UAAU,CAAC,cAAc,EAAE,EAAE,CAAC;IAC3C,CAAC;IACD,OAAO,GAAG,UAAU,CAAC,cAAc,EAAE,EAAE,CAAC;AAC1C,CAAC"}
1
+ {"version":3,"file":"formatWeekNumber.js","sourceRoot":"","sources":["../../../src/formatters/formatWeekNumber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAAkB,EAAE,OAAO,GAAG,cAAc;IAC3E,IAAI,UAAU,GAAG,EAAE,EAAE,CAAC;QACpB,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,UAAU,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,OAAO,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;AAChE,CAAC"}
@@ -1,7 +1,8 @@
1
1
  /**
2
- * Format the week number header.
2
+ * Formats the header for the week number column.
3
3
  *
4
- * @defaultValue `""`
4
+ * @defaultValue An empty string `""`.
5
+ * @returns The formatted week number header as a string.
5
6
  * @group Formatters
6
7
  * @see https://daypicker.dev/docs/translation#custom-formatters
7
8
  */
@@ -1,7 +1,8 @@
1
1
  /**
2
- * Format the week number header.
2
+ * Formats the header for the week number column.
3
3
  *
4
- * @defaultValue `""`
4
+ * @defaultValue An empty string `""`.
5
+ * @returns The formatted week number header as a string.
5
6
  * @group Formatters
6
7
  * @see https://daypicker.dev/docs/translation#custom-formatters
7
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"formatWeekNumberHeader.js","sourceRoot":"","sources":["../../../src/formatters/formatWeekNumberHeader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,EAAE,CAAC;AACZ,CAAC"}
1
+ {"version":3,"file":"formatWeekNumberHeader.js","sourceRoot":"","sources":["../../../src/formatters/formatWeekNumberHeader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -1,8 +1,13 @@
1
1
  import { DateLib, type DateLibOptions } from "../classes/DateLib.js";
2
2
  /**
3
- * Format the weekday name to be displayed in the weekdays header.
3
+ * Formats the name of a weekday to be displayed in the weekdays header.
4
4
  *
5
- * @defaultValue `cccccc` (e.g. "Mo" for Monday)
5
+ * @defaultValue `cccccc` (e.g., "Mo" for Monday).
6
+ * @param weekday The date representing the weekday.
7
+ * @param options Configuration options for the date library.
8
+ * @param dateLib The date library to use for formatting. If not provided, a new
9
+ * instance is created.
10
+ * @returns The formatted weekday name as a string.
6
11
  * @group Formatters
7
12
  * @see https://daypicker.dev/docs/translation#custom-formatters
8
13
  */
@@ -1,8 +1,13 @@
1
1
  import { DateLib } from "../classes/DateLib.js";
2
2
  /**
3
- * Format the weekday name to be displayed in the weekdays header.
3
+ * Formats the name of a weekday to be displayed in the weekdays header.
4
4
  *
5
- * @defaultValue `cccccc` (e.g. "Mo" for Monday)
5
+ * @defaultValue `cccccc` (e.g., "Mo" for Monday).
6
+ * @param weekday The date representing the weekday.
7
+ * @param options Configuration options for the date library.
8
+ * @param dateLib The date library to use for formatting. If not provided, a new
9
+ * instance is created.
10
+ * @returns The formatted weekday name as a string.
6
11
  * @group Formatters
7
12
  * @see https://daypicker.dev/docs/translation#custom-formatters
8
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"formatWeekdayName.js","sourceRoot":"","sources":["../../../src/formatters/formatWeekdayName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuB,MAAM,uBAAuB,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAAa,EACb,OAAwB,EACxB,OAAiB;IAEjB,OAAO,CAAC,OAAO,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACrE,CAAC"}
1
+ {"version":3,"file":"formatWeekdayName.js","sourceRoot":"","sources":["../../../src/formatters/formatWeekdayName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuB,MAAM,uBAAuB,CAAC;AAErE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAAa,EACb,OAAwB,EACxB,OAAiB;IAEjB,OAAO,CAAC,OAAO,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACrE,CAAC"}
@@ -1,7 +1,11 @@
1
1
  import { type DateLib } from "../classes/DateLib.js";
2
2
  /**
3
- * Format the years for the dropdown option label.
3
+ * Formats the year for the dropdown option label.
4
4
  *
5
+ * @param year The year to format.
6
+ * @param dateLib The date library to use for formatting. Defaults to
7
+ * `defaultDateLib`.
8
+ * @returns The formatted year as a string.
5
9
  * @group Formatters
6
10
  * @see https://daypicker.dev/docs/translation#custom-formatters
7
11
  */
@@ -1,7 +1,11 @@
1
1
  import { defaultDateLib } from "../classes/DateLib.js";
2
2
  /**
3
- * Format the years for the dropdown option label.
3
+ * Formats the year for the dropdown option label.
4
4
  *
5
+ * @param year The year to format.
6
+ * @param dateLib The date library to use for formatting. Defaults to
7
+ * `defaultDateLib`.
8
+ * @returns The formatted year as a string.
5
9
  * @group Formatters
6
10
  * @see https://daypicker.dev/docs/translation#custom-formatters
7
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"formatYearDropdown.js","sourceRoot":"","sources":["../../../src/formatters/formatYearDropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAErE;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAU,EACV,UAAmB,cAAc;IAEjC,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,kBAAkB,CAAC"}
1
+ {"version":3,"file":"formatYearDropdown.js","sourceRoot":"","sources":["../../../src/formatters/formatYearDropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAErE;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAU,EACV,UAAmB,cAAc;IAEjC,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,kBAAkB,CAAC"}
@@ -1,3 +1,17 @@
1
1
  import type { CalendarDay } from "../classes/index.js";
2
2
  import type { Modifiers } from "../types/index.js";
3
+ /**
4
+ * Calculates the focus target day based on priority.
5
+ *
6
+ * This function determines the day that should receive focus in the calendar,
7
+ * prioritizing days with specific modifiers (e.g., "focused", "today") or
8
+ * selection states.
9
+ *
10
+ * @param days The array of `CalendarDay` objects to evaluate.
11
+ * @param getModifiers A function to retrieve the modifiers for a given day.
12
+ * @param isSelected A function to determine if a day is selected.
13
+ * @param lastFocused The last focused day, if any.
14
+ * @returns The `CalendarDay` that should receive focus, or `undefined` if no
15
+ * focusable day is found.
16
+ */
3
17
  export declare function calculateFocusTarget(days: CalendarDay[], getModifiers: (day: CalendarDay) => Modifiers, isSelected: (date: Date) => boolean, lastFocused: CalendarDay | undefined): CalendarDay | undefined;
@@ -6,11 +6,34 @@ var FocusTargetPriority;
6
6
  FocusTargetPriority[FocusTargetPriority["LastFocused"] = 2] = "LastFocused";
7
7
  FocusTargetPriority[FocusTargetPriority["FocusedModifier"] = 3] = "FocusedModifier";
8
8
  })(FocusTargetPriority || (FocusTargetPriority = {}));
9
+ /**
10
+ * Determines if a day is focusable based on its modifiers.
11
+ *
12
+ * A day is considered focusable if it is not disabled, hidden, or outside the
13
+ * displayed month.
14
+ *
15
+ * @param modifiers The modifiers applied to the day.
16
+ * @returns `true` if the day is focusable, otherwise `false`.
17
+ */
9
18
  function isFocusableDay(modifiers) {
10
19
  return (!modifiers[DayFlag.disabled] &&
11
20
  !modifiers[DayFlag.hidden] &&
12
21
  !modifiers[DayFlag.outside]);
13
22
  }
23
+ /**
24
+ * Calculates the focus target day based on priority.
25
+ *
26
+ * This function determines the day that should receive focus in the calendar,
27
+ * prioritizing days with specific modifiers (e.g., "focused", "today") or
28
+ * selection states.
29
+ *
30
+ * @param days The array of `CalendarDay` objects to evaluate.
31
+ * @param getModifiers A function to retrieve the modifiers for a given day.
32
+ * @param isSelected A function to determine if a day is selected.
33
+ * @param lastFocused The last focused day, if any.
34
+ * @returns The `CalendarDay` that should receive focus, or `undefined` if no
35
+ * focusable day is found.
36
+ */
14
37
  export function calculateFocusTarget(days, getModifiers, isSelected, lastFocused) {
15
38
  let focusTarget;
16
39
  let foundFocusTargetPriority = -1;
@@ -40,7 +63,7 @@ export function calculateFocusTarget(days, getModifiers, isSelected, lastFocused
40
63
  }
41
64
  }
42
65
  if (!focusTarget) {
43
- // return the first day that is focusable
66
+ // Return the first day that is focusable
44
67
  focusTarget = days.find((day) => isFocusableDay(getModifiers(day)));
45
68
  }
46
69
  return focusTarget;
@@ -1 +1 @@
1
- {"version":3,"file":"calculateFocusTarget.js","sourceRoot":"","sources":["../../../src/helpers/calculateFocusTarget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAInC,IAAK,mBAKJ;AALD,WAAK,mBAAmB;IACtB,+DAAS,CAAA;IACT,qEAAQ,CAAA;IACR,2EAAW,CAAA;IACX,mFAAe,CAAA;AACjB,CAAC,EALI,mBAAmB,KAAnB,mBAAmB,QAKvB;AAED,SAAS,cAAc,CAAC,SAAoB;IAC1C,OAAO,CACL,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC;QAC5B,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC;QAC1B,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAC5B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,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CAAC;gBACD,WAAW,GAAG,GAAG,CAAC;gBAClB,wBAAwB,GAAG,mBAAmB,CAAC,WAAW,CAAC;YAC7D,CAAC;iBAAM,IACL,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC;gBACpB,wBAAwB,GAAG,mBAAmB,CAAC,QAAQ,EACvD,CAAC;gBACD,WAAW,GAAG,GAAG,CAAC;gBAClB,wBAAwB,GAAG,mBAAmB,CAAC,QAAQ,CAAC;YAC1D,CAAC;iBAAM,IACL,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;gBACxB,wBAAwB,GAAG,mBAAmB,CAAC,KAAK,EACpD,CAAC;gBACD,WAAW,GAAG,GAAG,CAAC;gBAClB,wBAAwB,GAAG,mBAAmB,CAAC,KAAK,CAAC;YACvD,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,yCAAyC;QACzC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { CalendarDay, DateLib } from "../classes/index.js";
2
+ import type { DayPickerProps, Modifiers } from "../types/index.js";
3
+ /**
4
+ * Creates a function to retrieve the modifiers for a given day.
5
+ *
6
+ * This function calculates both internal and custom modifiers for each day
7
+ * based on the provided calendar days and DayPicker props.
8
+ *
9
+ * @private
10
+ * @param days The array of `CalendarDay` objects to process.
11
+ * @param props The DayPicker props, including modifiers and configuration
12
+ * options.
13
+ * @param dateLib The date library to use for date manipulation.
14
+ * @returns A function that retrieves the modifiers for a given `CalendarDay`.
15
+ */
16
+ export declare function createGetModifiers(days: CalendarDay[], props: DayPickerProps, dateLib: DateLib): (day: CalendarDay) => Modifiers;
@@ -1,13 +1,19 @@
1
- import { DayFlag } from "./UI.js";
2
- import { dateMatchModifiers } from "./utils/dateMatchModifiers.js";
1
+ import { DayFlag } from "../UI.js";
2
+ import { dateMatchModifiers } from "../utils/dateMatchModifiers.js";
3
3
  /**
4
- * Return a function to get the modifiers for a given day.
4
+ * Creates a function to retrieve the modifiers for a given day.
5
5
  *
6
- * NOTE: this is not an hook, but a factory for `getModifiers`.
6
+ * This function calculates both internal and custom modifiers for each day
7
+ * based on the provided calendar days and DayPicker props.
7
8
  *
8
9
  * @private
10
+ * @param days The array of `CalendarDay` objects to process.
11
+ * @param props The DayPicker props, including modifiers and configuration
12
+ * options.
13
+ * @param dateLib The date library to use for date manipulation.
14
+ * @returns A function that retrieves the modifiers for a given `CalendarDay`.
9
15
  */
10
- export function useGetModifiers(days, props, dateLib) {
16
+ export function createGetModifiers(days, props, dateLib) {
11
17
  const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today } = props;
12
18
  const { isSameDay, isSameMonth, startOfMonth, isBefore, endOfMonth, isAfter } = dateLib;
13
19
  const startMonth = props.startMonth && startOfMonth(props.startMonth);
@@ -84,4 +90,4 @@ export function useGetModifiers(days, props, dateLib) {
84
90
  };
85
91
  };
86
92
  }
87
- //# sourceMappingURL=useGetModifiers.js.map
93
+ //# sourceMappingURL=createGetModifiers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGetModifiers.js","sourceRoot":"","sources":["../../../src/helpers/createGetModifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAmB,EACnB,KAAqB,EACrB,OAAgB;IAEhB,MAAM,EACJ,QAAQ,EACR,MAAM,EACN,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,KAAK,EACN,GAAG,KAAK,CAAC;IAEV,MAAM,EACJ,SAAS,EACT,WAAW,EACX,YAAY,EACZ,QAAQ,EACR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AAM,QAAQ,GAA6B;YACzC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK;YACxB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,KAAK;YACzB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK;YACvB,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK;YACxB,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK;SACvB,CAAC;QACF,MAAM,eAAe,GAAc,EAAE,CAAC;QAEtC,uCAAuC;QACvC,KAAK,MAAM,IAAI,IAAI,oBAAoB,EAAE,CAAC;YACxC,MAAM,IAAI,GAAG,oBAAoB,CAAC,IAAe,CAAC,CAAC;YACnD,QAAQ,CAAC,IAAe,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;QAC1D,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,kBAAkB,EAAE,CAAC;YACtC,eAAe,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;QAC1E,CAAC;QAED,OAAO;YACL,GAAG,QAAQ;YACX,yDAAyD;YACzD,GAAG,eAAe;SACnB,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
@@ -1,7 +1,13 @@
1
1
  import type { DateLib } from "../classes/index.js";
2
2
  /**
3
- * Return the end date of the week in the broadcast calendar.
3
+ * Returns the end date of the week in the broadcast calendar.
4
+ *
5
+ * The broadcast week ends on the last day of the last broadcast week for the
6
+ * given date.
4
7
  *
5
8
  * @since 9.4.0
9
+ * @param date The date for which to calculate the end of the broadcast week.
10
+ * @param dateLib The date library to use for date manipulation.
11
+ * @returns The end date of the broadcast week.
6
12
  */
7
13
  export declare function endOfBroadcastWeek(date: Date, dateLib: DateLib): Date;
@@ -1,9 +1,15 @@
1
1
  import { getBroadcastWeeksInMonth } from "./getBroadcastWeeksInMonth.js";
2
2
  import { startOfBroadcastWeek } from "./startOfBroadcastWeek.js";
3
3
  /**
4
- * Return the end date of the week in the broadcast calendar.
4
+ * Returns the end date of the week in the broadcast calendar.
5
+ *
6
+ * The broadcast week ends on the last day of the last broadcast week for the
7
+ * given date.
5
8
  *
6
9
  * @since 9.4.0
10
+ * @param date The date for which to calculate the end of the broadcast week.
11
+ * @param dateLib The date library to use for date manipulation.
12
+ * @returns The end date of the broadcast week.
7
13
  */
8
14
  export function endOfBroadcastWeek(date, dateLib) {
9
15
  const startDate = startOfBroadcastWeek(date, dateLib);
@@ -1 +1 @@
1
- {"version":3,"file":"endOfBroadcastWeek.js","sourceRoot":"","sources":["../../../src/helpers/endOfBroadcastWeek.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAU,EAAE,OAAgB;IAC7D,MAAM,SAAS,GAAG,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACtD,MAAM,aAAa,GAAG,wBAAwB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,aAAa,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAClE,OAAO,OAAO,CAAC;AACjB,CAAC"}
1
+ {"version":3,"file":"endOfBroadcastWeek.js","sourceRoot":"","sources":["../../../src/helpers/endOfBroadcastWeek.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAU,EAAE,OAAgB;IAC7D,MAAM,SAAS,GAAG,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACtD,MAAM,aAAa,GAAG,wBAAwB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,aAAa,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAClE,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,7 +1,14 @@
1
1
  import { DateLib } from "../classes/index.js";
2
2
  /**
3
- * Return the number of weeks to display in the broadcast calendar.
3
+ * Returns the number of weeks to display in the broadcast calendar for a given
4
+ * month.
5
+ *
6
+ * The broadcast calendar may have either 4 or 5 weeks in a month, depending on
7
+ * the start and end dates of the broadcast weeks.
4
8
  *
5
9
  * @since 9.4.0
10
+ * @param month The month for which to calculate the number of weeks.
11
+ * @param dateLib The date library to use for date manipulation.
12
+ * @returns The number of weeks in the broadcast calendar (4 or 5).
6
13
  */
7
14
  export declare function getBroadcastWeeksInMonth(month: Date, dateLib: DateLib): 4 | 5;