react-day-picker 8.0.0-beta.33 → 8.0.0-beta.38

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 (318) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/{build → dist}/DayPicker.d.ts +93 -89
  3. package/dist/components/Button/Button.d.ts +7 -0
  4. package/{build → dist}/components/Button/index.d.ts +1 -1
  5. package/{build → dist}/components/Caption/Caption.d.ts +20 -18
  6. package/{build → dist}/components/Caption/index.d.ts +1 -1
  7. package/{build → dist}/components/CaptionLabel/CaptionLabel.d.ts +10 -8
  8. package/{build → dist}/components/CaptionLabel/index.d.ts +1 -1
  9. package/{build → dist}/components/Day/Day.d.ts +13 -13
  10. package/dist/components/Day/index.d.ts +1 -0
  11. package/{build → dist}/components/DayContent/DayContent.d.ts +15 -15
  12. package/{build → dist}/components/DayContent/index.d.ts +1 -1
  13. package/{build → dist}/components/Dropdown/Dropdown.d.ts +16 -16
  14. package/{build → dist}/components/Dropdown/index.d.ts +1 -1
  15. package/{build → dist}/components/Footer/Footer.d.ts +3 -3
  16. package/{build → dist}/components/Footer/index.d.ts +1 -1
  17. package/{build → dist}/components/Head/Head.d.ts +5 -5
  18. package/{build → dist}/components/Head/index.d.ts +1 -1
  19. package/{build → dist}/components/Head/utils/getWeekdays.d.ts +6 -6
  20. package/{build → dist}/components/Head/utils/index.d.ts +1 -1
  21. package/{build → dist}/components/IconDropdown/IconDropdown.d.ts +6 -6
  22. package/{build → dist}/components/IconDropdown/index.d.ts +1 -1
  23. package/{build → dist}/components/IconLeft/IconLeft.d.ts +6 -6
  24. package/{build → dist}/components/IconLeft/index.d.ts +1 -1
  25. package/{build → dist}/components/IconRight/IconRight.d.ts +6 -6
  26. package/{build → dist}/components/IconRight/index.d.ts +1 -1
  27. package/dist/components/Month/Month.d.ts +8 -0
  28. package/dist/components/Month/index.d.ts +1 -0
  29. package/{build → dist}/components/MonthsDropdown/MonthsDropdown.d.ts +10 -12
  30. package/{build → dist}/components/MonthsDropdown/index.d.ts +1 -1
  31. package/{build → dist}/components/Navigation/Navigation.d.ts +20 -20
  32. package/{build → dist}/components/Navigation/index.d.ts +1 -1
  33. package/dist/components/Root/Root.d.ts +3 -0
  34. package/{build → dist}/components/Root/index.d.ts +1 -1
  35. package/{build → dist}/components/Row/Row.d.ts +14 -16
  36. package/{build → dist}/components/Row/index.d.ts +1 -1
  37. package/{build → dist}/components/Table/Table.d.ts +10 -12
  38. package/{build → dist}/components/Table/index.d.ts +1 -1
  39. package/{build → dist}/components/Table/utils/getOutsideEndDays.d.ts +3 -3
  40. package/{build → dist}/components/Table/utils/getOutsideStartDays.d.ts +4 -4
  41. package/{build → dist}/components/Table/utils/getWeeks.d.ts +17 -17
  42. package/{build → dist}/components/WeekNumber/WeekNumber.d.ts +15 -15
  43. package/{build → dist}/components/WeekNumber/index.d.ts +1 -1
  44. package/{build → dist}/components/YearsDropdown/YearsDropdown.d.ts +16 -16
  45. package/{build → dist}/components/YearsDropdown/index.d.ts +1 -1
  46. package/dist/contexts/DayPicker/DayPickerContext.d.ts +45 -0
  47. package/{build → dist}/contexts/DayPicker/defaultClassNames.d.ts +5 -5
  48. package/dist/contexts/DayPicker/defaultContextValue.d.ts +6 -0
  49. package/{build → dist}/contexts/DayPicker/formatters/formatCaption.d.ts +7 -7
  50. package/{build → dist}/contexts/DayPicker/formatters/formatDay.d.ts +7 -7
  51. package/{build → dist}/contexts/DayPicker/formatters/formatMonthCaption.d.ts +7 -7
  52. package/{build → dist}/contexts/DayPicker/formatters/formatWeekNumber.d.ts +4 -4
  53. package/{build → dist}/contexts/DayPicker/formatters/formatWeekdayName.d.ts +7 -7
  54. package/{build → dist}/contexts/DayPicker/formatters/formatYearCaption.d.ts +6 -6
  55. package/{build → dist}/contexts/DayPicker/formatters/index.d.ts +6 -6
  56. package/dist/contexts/DayPicker/index.d.ts +2 -0
  57. package/{build → dist}/contexts/DayPicker/labels/index.d.ts +7 -7
  58. package/{build → dist}/contexts/DayPicker/labels/labelDay.d.ts +5 -5
  59. package/{build → dist}/contexts/DayPicker/labels/labelMonthDropdown.d.ts +4 -4
  60. package/{build → dist}/contexts/DayPicker/labels/labelNext.d.ts +5 -5
  61. package/{build → dist}/contexts/DayPicker/labels/labelPrevious.d.ts +5 -5
  62. package/{build → dist}/contexts/DayPicker/labels/labelWeekNumber.d.ts +5 -5
  63. package/{build → dist}/contexts/DayPicker/labels/labelWeekday.d.ts +5 -5
  64. package/{build → dist}/contexts/DayPicker/labels/labelYearDropdown.d.ts +4 -4
  65. package/{build → dist}/contexts/DayPicker/useDayPicker.d.ts +8 -8
  66. package/dist/contexts/DayPicker/utils/index.d.ts +1 -0
  67. package/{build → dist}/contexts/DayPicker/utils/parseFromToProps.d.ts +6 -9
  68. package/dist/contexts/Focus/FocusContext.d.ts +36 -0
  69. package/dist/contexts/Focus/index.d.ts +2 -0
  70. package/{build/contexts/Focus/useFocus.d.ts → dist/contexts/Focus/useFocusContext.d.ts} +3 -3
  71. package/dist/contexts/Focus/utils/getInitialFocusTarget.d.ts +3 -0
  72. package/dist/contexts/Modifiers/ModifiersContext.d.ts +9 -0
  73. package/dist/contexts/Modifiers/index.d.ts +2 -0
  74. package/dist/contexts/Modifiers/useModifiers.d.ts +6 -0
  75. package/dist/contexts/Modifiers/utils/getActiveModifiers.d.ts +7 -0
  76. package/dist/contexts/Modifiers/utils/getCustomModifiers.d.ts +3 -0
  77. package/dist/contexts/Modifiers/utils/getInternalModifiers.d.ts +6 -0
  78. package/{build/hooks/useModifiers → dist/contexts/Modifiers}/utils/isDateInRange.d.ts +3 -3
  79. package/{build/hooks/useModifiers → dist/contexts/Modifiers}/utils/isMatch.d.ts +3 -5
  80. package/dist/contexts/Modifiers/utils/matcherToArray.d.ts +3 -0
  81. package/{build → dist}/contexts/Navigation/NavigationContext.d.ts +28 -24
  82. package/{build → dist}/contexts/Navigation/index.d.ts +2 -2
  83. package/{build → dist}/contexts/Navigation/useNavigation.d.ts +3 -3
  84. package/{build → dist}/contexts/Navigation/useNavigationState.d.ts +7 -7
  85. package/{build → dist}/contexts/Navigation/utils/getDisplayMonths.d.ts +8 -8
  86. package/{build → dist}/contexts/Navigation/utils/getInitialMonth.d.ts +3 -3
  87. package/{build → dist}/contexts/Navigation/utils/getNextMonth.d.ts +18 -18
  88. package/{build → dist}/contexts/Navigation/utils/getPreviousMonth.d.ts +19 -19
  89. package/{build → dist}/contexts/RootProvider.d.ts +8 -8
  90. package/{build → dist}/contexts/SelectMultiple/SelectMultipleContext.d.ts +35 -32
  91. package/{build → dist}/contexts/SelectMultiple/index.d.ts +2 -2
  92. package/{build → dist}/contexts/SelectMultiple/useSelectMultiple.d.ts +3 -3
  93. package/{build → dist}/contexts/SelectRange/SelectRangeContext.d.ts +36 -32
  94. package/{build → dist}/contexts/SelectRange/index.d.ts +2 -2
  95. package/{build → dist}/contexts/SelectRange/useSelectRange.d.ts +3 -3
  96. package/{build → dist}/contexts/SelectRange/utils/addToRange.d.ts +8 -8
  97. package/{build → dist}/contexts/SelectSingle/SelectSingleContext.d.ts +30 -35
  98. package/{build → dist}/contexts/SelectSingle/index.d.ts +2 -2
  99. package/{build → dist}/contexts/SelectSingle/useSelectSingle.d.ts +3 -3
  100. package/dist/hooks/useActiveModifiers/index.d.ts +1 -0
  101. package/dist/hooks/useActiveModifiers/useActiveModifiers.d.ts +9 -0
  102. package/{build → dist}/hooks/useControlledValue/index.d.ts +1 -1
  103. package/{build → dist}/hooks/useControlledValue/useControlledValue.d.ts +12 -12
  104. package/dist/hooks/useDayEventHandlers/index.d.ts +1 -0
  105. package/dist/hooks/useDayEventHandlers/useDayEventHandlers.d.ts +28 -0
  106. package/dist/hooks/useDayRender/index.d.ts +1 -0
  107. package/dist/hooks/useDayRender/useDayRender.d.ts +39 -0
  108. package/dist/hooks/useDayRender/utils/getDayClassNames.d.ts +4 -0
  109. package/dist/hooks/useDayRender/utils/getDayStyle.d.ts +5 -0
  110. package/{build → dist}/hooks/useInput/index.d.ts +1 -1
  111. package/{build → dist}/hooks/useInput/useInput.d.ts +28 -28
  112. package/{build → dist}/hooks/useInput/utils/isValidDate.d.ts +2 -2
  113. package/dist/hooks/useSelectedDays/index.d.ts +1 -0
  114. package/dist/hooks/useSelectedDays/useSelectedDays.d.ts +8 -0
  115. package/dist/index.d.ts +35 -0
  116. package/dist/index.esm.js +2213 -0
  117. package/dist/index.esm.js.map +1 -0
  118. package/dist/{main.js → index.js} +2116 -1744
  119. package/dist/index.js.map +1 -0
  120. package/dist/react-day-picker.min.js +1 -0
  121. package/{style.css → dist/style.css} +21 -10
  122. package/{style.css.d.ts → dist/style.css.d.ts} +2 -2
  123. package/{build → dist}/types/DayPicker.d.ts +249 -228
  124. package/{build → dist}/types/DayPickerCustom.d.ts +9 -11
  125. package/{build → dist}/types/DayPickerMultiple.d.ts +16 -16
  126. package/{build → dist}/types/DayPickerRange.d.ts +17 -17
  127. package/{build → dist}/types/DayPickerSingle.d.ts +14 -14
  128. package/{build → dist}/types/EventHandlers.d.ts +51 -51
  129. package/{build → dist}/types/Formatters.d.ts +24 -24
  130. package/{build → dist}/types/Labels.d.ts +28 -28
  131. package/{build → dist}/types/Matchers.d.ts +34 -34
  132. package/dist/types/Modifiers.d.ts +51 -0
  133. package/{build → dist}/types/Styles.d.ts +82 -85
  134. package/package.json +42 -29
  135. package/build/DayPicker.js +0 -98
  136. package/build/DayPicker.js.map +0 -1
  137. package/build/_virtual/_tslib.js +0 -50
  138. package/build/_virtual/_tslib.js.map +0 -1
  139. package/build/components/Button/Button.d.ts +0 -7
  140. package/build/components/Button/Button.js +0 -23
  141. package/build/components/Button/Button.js.map +0 -1
  142. package/build/components/Caption/Caption.js +0 -57
  143. package/build/components/Caption/Caption.js.map +0 -1
  144. package/build/components/CaptionLabel/CaptionLabel.js +0 -11
  145. package/build/components/CaptionLabel/CaptionLabel.js.map +0 -1
  146. package/build/components/Day/Day.js +0 -24
  147. package/build/components/Day/Day.js.map +0 -1
  148. package/build/components/Day/hooks/index.d.ts +0 -1
  149. package/build/components/Day/hooks/useDay.d.ts +0 -58
  150. package/build/components/Day/hooks/useDay.js +0 -176
  151. package/build/components/Day/hooks/useDay.js.map +0 -1
  152. package/build/components/Day/hooks/useDayFocus.d.ts +0 -8
  153. package/build/components/Day/hooks/useDayFocus.js +0 -56
  154. package/build/components/Day/hooks/useDayFocus.js.map +0 -1
  155. package/build/components/Day/index.d.ts +0 -2
  156. package/build/components/DayContent/DayContent.js +0 -15
  157. package/build/components/DayContent/DayContent.js.map +0 -1
  158. package/build/components/Dropdown/Dropdown.js +0 -20
  159. package/build/components/Dropdown/Dropdown.js.map +0 -1
  160. package/build/components/Footer/Footer.js +0 -15
  161. package/build/components/Footer/Footer.js.map +0 -1
  162. package/build/components/Head/Head.js +0 -20
  163. package/build/components/Head/Head.js.map +0 -1
  164. package/build/components/Head/utils/getWeekdays.js +0 -18
  165. package/build/components/Head/utils/getWeekdays.js.map +0 -1
  166. package/build/components/IconDropdown/IconDropdown.js +0 -13
  167. package/build/components/IconDropdown/IconDropdown.js.map +0 -1
  168. package/build/components/IconLeft/IconLeft.js +0 -13
  169. package/build/components/IconLeft/IconLeft.js.map +0 -1
  170. package/build/components/IconRight/IconRight.js +0 -13
  171. package/build/components/IconRight/IconRight.js.map +0 -1
  172. package/build/components/MonthsDropdown/MonthsDropdown.js +0 -39
  173. package/build/components/MonthsDropdown/MonthsDropdown.js.map +0 -1
  174. package/build/components/Navigation/Navigation.js +0 -33
  175. package/build/components/Navigation/Navigation.js.map +0 -1
  176. package/build/components/Root/Root.d.ts +0 -6
  177. package/build/components/Root/Root.js +0 -49
  178. package/build/components/Root/Root.js.map +0 -1
  179. package/build/components/Row/Row.js +0 -22
  180. package/build/components/Row/Row.js.map +0 -1
  181. package/build/components/Table/Table.js +0 -18
  182. package/build/components/Table/Table.js.map +0 -1
  183. package/build/components/Table/utils/getOutsideEndDays.js +0 -15
  184. package/build/components/Table/utils/getOutsideEndDays.js.map +0 -1
  185. package/build/components/Table/utils/getOutsideStartDays.js +0 -15
  186. package/build/components/Table/utils/getOutsideStartDays.js.map +0 -1
  187. package/build/components/Table/utils/getWeeks.js +0 -50
  188. package/build/components/Table/utils/getWeeks.js.map +0 -1
  189. package/build/components/WeekNumber/WeekNumber.js +0 -24
  190. package/build/components/WeekNumber/WeekNumber.js.map +0 -1
  191. package/build/components/YearsDropdown/YearsDropdown.js +0 -28
  192. package/build/components/YearsDropdown/YearsDropdown.js.map +0 -1
  193. package/build/components/index.d.ts +0 -18
  194. package/build/contexts/DayPicker/DayPickerContext.d.ts +0 -31
  195. package/build/contexts/DayPicker/DayPickerContext.js +0 -14
  196. package/build/contexts/DayPicker/DayPickerContext.js.map +0 -1
  197. package/build/contexts/DayPicker/DayPickerProvider.d.ts +0 -12
  198. package/build/contexts/DayPicker/DayPickerProvider.js +0 -59
  199. package/build/contexts/DayPicker/DayPickerProvider.js.map +0 -1
  200. package/build/contexts/DayPicker/defaultClassNames.js +0 -42
  201. package/build/contexts/DayPicker/defaultClassNames.js.map +0 -1
  202. package/build/contexts/DayPicker/formatters/formatCaption.js +0 -11
  203. package/build/contexts/DayPicker/formatters/formatCaption.js.map +0 -1
  204. package/build/contexts/DayPicker/formatters/formatDay.js +0 -11
  205. package/build/contexts/DayPicker/formatters/formatDay.js.map +0 -1
  206. package/build/contexts/DayPicker/formatters/formatMonthCaption.js +0 -11
  207. package/build/contexts/DayPicker/formatters/formatMonthCaption.js.map +0 -1
  208. package/build/contexts/DayPicker/formatters/formatWeekNumber.js +0 -9
  209. package/build/contexts/DayPicker/formatters/formatWeekNumber.js.map +0 -1
  210. package/build/contexts/DayPicker/formatters/formatWeekdayName.js +0 -11
  211. package/build/contexts/DayPicker/formatters/formatWeekdayName.js.map +0 -1
  212. package/build/contexts/DayPicker/formatters/formatYearCaption.js +0 -11
  213. package/build/contexts/DayPicker/formatters/formatYearCaption.js.map +0 -1
  214. package/build/contexts/DayPicker/formatters/index.js +0 -7
  215. package/build/contexts/DayPicker/formatters/index.js.map +0 -1
  216. package/build/contexts/DayPicker/index.d.ts +0 -1
  217. package/build/contexts/DayPicker/labels/index.js +0 -8
  218. package/build/contexts/DayPicker/labels/index.js.map +0 -1
  219. package/build/contexts/DayPicker/labels/labelDay.js +0 -11
  220. package/build/contexts/DayPicker/labels/labelDay.js.map +0 -1
  221. package/build/contexts/DayPicker/labels/labelMonthDropdown.js +0 -9
  222. package/build/contexts/DayPicker/labels/labelMonthDropdown.js.map +0 -1
  223. package/build/contexts/DayPicker/labels/labelNext.js +0 -9
  224. package/build/contexts/DayPicker/labels/labelNext.js.map +0 -1
  225. package/build/contexts/DayPicker/labels/labelPrevious.js +0 -9
  226. package/build/contexts/DayPicker/labels/labelPrevious.js.map +0 -1
  227. package/build/contexts/DayPicker/labels/labelWeekNumber.js +0 -9
  228. package/build/contexts/DayPicker/labels/labelWeekNumber.js.map +0 -1
  229. package/build/contexts/DayPicker/labels/labelWeekday.js +0 -11
  230. package/build/contexts/DayPicker/labels/labelWeekday.js.map +0 -1
  231. package/build/contexts/DayPicker/labels/labelYearDropdown.js +0 -9
  232. package/build/contexts/DayPicker/labels/labelYearDropdown.js.map +0 -1
  233. package/build/contexts/DayPicker/useDayPicker.js +0 -19
  234. package/build/contexts/DayPicker/useDayPicker.js.map +0 -1
  235. package/build/contexts/DayPicker/utils/index.d.ts +0 -2
  236. package/build/contexts/DayPicker/utils/parseFromToProps.js +0 -29
  237. package/build/contexts/DayPicker/utils/parseFromToProps.js.map +0 -1
  238. package/build/contexts/DayPicker/utils/parseModifierProps.d.ts +0 -9
  239. package/build/contexts/DayPicker/utils/parseModifierProps.js +0 -54
  240. package/build/contexts/DayPicker/utils/parseModifierProps.js.map +0 -1
  241. package/build/contexts/Focus/FocusContext.d.ts +0 -30
  242. package/build/contexts/Focus/FocusContext.js +0 -71
  243. package/build/contexts/Focus/FocusContext.js.map +0 -1
  244. package/build/contexts/Focus/index.d.ts +0 -2
  245. package/build/contexts/Focus/useFocus.js +0 -14
  246. package/build/contexts/Focus/useFocus.js.map +0 -1
  247. package/build/contexts/Navigation/NavigationContext.js +0 -31
  248. package/build/contexts/Navigation/NavigationContext.js.map +0 -1
  249. package/build/contexts/Navigation/useNavigation.js +0 -14
  250. package/build/contexts/Navigation/useNavigation.js.map +0 -1
  251. package/build/contexts/Navigation/useNavigationState.js +0 -19
  252. package/build/contexts/Navigation/useNavigationState.js.map +0 -1
  253. package/build/contexts/Navigation/utils/getDisplayMonths.js +0 -23
  254. package/build/contexts/Navigation/utils/getDisplayMonths.js.map +0 -1
  255. package/build/contexts/Navigation/utils/getInitialMonth.js +0 -21
  256. package/build/contexts/Navigation/utils/getInitialMonth.js.map +0 -1
  257. package/build/contexts/Navigation/utils/getNextMonth.js +0 -32
  258. package/build/contexts/Navigation/utils/getNextMonth.js.map +0 -1
  259. package/build/contexts/Navigation/utils/getPreviousMonth.js +0 -33
  260. package/build/contexts/Navigation/utils/getPreviousMonth.js.map +0 -1
  261. package/build/contexts/RootProvider.js +0 -22
  262. package/build/contexts/RootProvider.js.map +0 -1
  263. package/build/contexts/SelectMultiple/SelectMultipleContext.js +0 -82
  264. package/build/contexts/SelectMultiple/SelectMultipleContext.js.map +0 -1
  265. package/build/contexts/SelectMultiple/useSelectMultiple.js +0 -14
  266. package/build/contexts/SelectMultiple/useSelectMultiple.js.map +0 -1
  267. package/build/contexts/SelectRange/SelectRangeContext.js +0 -123
  268. package/build/contexts/SelectRange/SelectRangeContext.js.map +0 -1
  269. package/build/contexts/SelectRange/useSelectRange.js +0 -14
  270. package/build/contexts/SelectRange/useSelectRange.js.map +0 -1
  271. package/build/contexts/SelectRange/utils/addToRange.js +0 -39
  272. package/build/contexts/SelectRange/utils/addToRange.js.map +0 -1
  273. package/build/contexts/SelectSingle/SelectSingleContext.js +0 -45
  274. package/build/contexts/SelectSingle/SelectSingleContext.js.map +0 -1
  275. package/build/contexts/SelectSingle/useSelectSingle.js +0 -14
  276. package/build/contexts/SelectSingle/useSelectSingle.js.map +0 -1
  277. package/build/contexts/index.d.ts +0 -7
  278. package/build/hooks/index.d.ts +0 -2
  279. package/build/hooks/useControlledValue/useControlledValue.js +0 -19
  280. package/build/hooks/useControlledValue/useControlledValue.js.map +0 -1
  281. package/build/hooks/useInput/useInput.js +0 -101
  282. package/build/hooks/useInput/useInput.js.map +0 -1
  283. package/build/hooks/useInput/utils/isValidDate.js +0 -7
  284. package/build/hooks/useInput/utils/isValidDate.js.map +0 -1
  285. package/build/hooks/useModifiers/index.d.ts +0 -1
  286. package/build/hooks/useModifiers/types/UseModifiers.d.ts +0 -10
  287. package/build/hooks/useModifiers/types/index.d.ts +0 -1
  288. package/build/hooks/useModifiers/useModifiers.d.ts +0 -3
  289. package/build/hooks/useModifiers/useModifiers.js +0 -65
  290. package/build/hooks/useModifiers/useModifiers.js.map +0 -1
  291. package/build/hooks/useModifiers/utils/getModifierStatus.d.ts +0 -7
  292. package/build/hooks/useModifiers/utils/getModifierStatus.js +0 -22
  293. package/build/hooks/useModifiers/utils/getModifierStatus.js.map +0 -1
  294. package/build/hooks/useModifiers/utils/isDateInRange.js +0 -25
  295. package/build/hooks/useModifiers/utils/isDateInRange.js.map +0 -1
  296. package/build/hooks/useModifiers/utils/isMatch.js +0 -52
  297. package/build/hooks/useModifiers/utils/isMatch.js.map +0 -1
  298. package/build/main.d.ts +0 -5
  299. package/build/main.js +0 -40
  300. package/build/main.js.map +0 -1
  301. package/build/test/PageObjects.d.ts +0 -40
  302. package/build/test/customRender.d.ts +0 -4
  303. package/build/test/customRenderHook.d.ts +0 -3
  304. package/build/test/index.d.ts +0 -3
  305. package/build/test/setup.d.ts +0 -2
  306. package/build/types/DayPickerCustom.js +0 -7
  307. package/build/types/DayPickerCustom.js.map +0 -1
  308. package/build/types/DayPickerMultiple.js +0 -7
  309. package/build/types/DayPickerMultiple.js.map +0 -1
  310. package/build/types/DayPickerRange.js +0 -7
  311. package/build/types/DayPickerRange.js.map +0 -1
  312. package/build/types/DayPickerSingle.js +0 -7
  313. package/build/types/DayPickerSingle.js.map +0 -1
  314. package/build/types/Matchers.js +0 -27
  315. package/build/types/Matchers.js.map +0 -1
  316. package/build/types/Modifiers.d.ts +0 -16
  317. package/build/types/index.d.ts +0 -11
  318. package/dist/main.js.map +0 -1
@@ -0,0 +1,3 @@
1
+ import { Matcher } from '../../../types/Matchers';
2
+ /** Normalize to array a matcher input. */
3
+ export declare function matcherToArray(matcher: Matcher | Matcher[] | undefined): Matcher[];
@@ -1,24 +1,28 @@
1
- import React from 'react';
2
- /** Represents the value of the [[NavigationContext]]. */
3
- export interface NavigationContextValue {
4
- /** The current month. Note that when `numberOfMonths > 1` represent the first month in the displayed months. */
5
- month: Date;
6
- /** The months to display, according to `numberOfMonths`. */
7
- displayMonths: Date[];
8
- /** Navigate to the specified month. */
9
- goToMonth: (month: Date) => void;
10
- /** The next month to display. `undefined` if no months left */
11
- nextMonth?: Date;
12
- /** The previous month to display. `undefined` if no months left */
13
- previousMonth?: Date;
14
- }
15
- /**
16
- * The Navigation context shares details about the months being navigated in DayPicker.
17
- *
18
- * Access this context from the [[useNavigation]] hook.
19
- */
20
- export declare const NavigationContext: React.Context<NavigationContextValue | undefined>;
21
- /** Provides the values for the [[NavigationContext]]. */
22
- export declare function NavigationProvider(props: {
23
- children?: React.ReactNode;
24
- }): JSX.Element;
1
+ import React, { ReactNode } from 'react';
2
+ /** Represents the value of the [[NavigationContext]]. */
3
+ export interface NavigationContextValue {
4
+ /** The current month. Note that when `numberOfMonths > 1` represent the first month in the displayed months. */
5
+ month: Date;
6
+ /** The months rendered by DayPicker. DayPicker can render one than one month via `numberOfMonths`. */
7
+ displayMonths: Date[];
8
+ /** Navigate to the specified month. */
9
+ goToMonth: (month: Date) => void;
10
+ /** Navigate to the specified date. */
11
+ goToDate: (date: Date, refDate?: Date) => void;
12
+ /** The next month to display. `undefined` if no months left */
13
+ nextMonth?: Date;
14
+ /** The previous month to display. `undefined` if no months left */
15
+ previousMonth?: Date;
16
+ /** Return true if the day is displayed in the calendar. */
17
+ isDateDisplayed: (day: Date) => boolean;
18
+ }
19
+ /**
20
+ * The Navigation context shares details about the months being navigated in DayPicker.
21
+ *
22
+ * Access this context from the [[useNavigation]] hook.
23
+ */
24
+ export declare const NavigationContext: React.Context<NavigationContextValue | undefined>;
25
+ /** Provides the values for the [[NavigationContext]]. */
26
+ export declare function NavigationProvider(props: {
27
+ children?: ReactNode;
28
+ }): JSX.Element;
@@ -1,2 +1,2 @@
1
- export * from './NavigationContext';
2
- export * from './useNavigation';
1
+ export * from './NavigationContext';
2
+ export * from './useNavigation';
@@ -1,3 +1,3 @@
1
- import { NavigationContextValue } from './NavigationContext';
2
- /** Hook to access the [[NavigationContext]]. */
3
- export declare function useNavigation(): NavigationContextValue;
1
+ import { NavigationContextValue } from './NavigationContext';
2
+ /** Hook to access the [[NavigationContext]]. */
3
+ export declare function useNavigation(): NavigationContextValue;
@@ -1,7 +1,7 @@
1
- /** Controls the navigation state. */
2
- export declare function useNavigationState(): [
3
- /** The month DayPicker is navigating at */
4
- month: Date,
5
- /** Go to the specified month. */
6
- goToMonth: (month: Date) => void
7
- ];
1
+ /** Controls the navigation state. */
2
+ export declare function useNavigationState(): [
3
+ /** The month DayPicker is navigating at */
4
+ month: Date,
5
+ /** Go to the specified month. */
6
+ goToMonth: (month: Date) => void
7
+ ];
@@ -1,8 +1,8 @@
1
- /**
2
- * Return the months to display in the component according to the number of
3
- * months and the from/to date.
4
- */
5
- export declare function getDisplayMonths(month: Date, { reverseMonths, numberOfMonths }: {
6
- reverseMonths?: boolean;
7
- numberOfMonths: number;
8
- }): Date[];
1
+ /**
2
+ * Return the months to display in the component according to the number of
3
+ * months and the from/to date.
4
+ */
5
+ export declare function getDisplayMonths(month: Date, { reverseMonths, numberOfMonths }: {
6
+ reverseMonths?: boolean;
7
+ numberOfMonths: number;
8
+ }): Date[];
@@ -1,3 +1,3 @@
1
- import { DayPickerContextValue } from '../../DayPicker/DayPickerContext';
2
- /** Return the initial month according to the given options. */
3
- export declare function getInitialMonth(context: Partial<DayPickerContextValue>): Date;
1
+ import { DayPickerContextValue } from '../../../contexts/DayPicker';
2
+ /** Return the initial month according to the given options. */
3
+ export declare function getInitialMonth(context: Partial<DayPickerContextValue>): Date;
@@ -1,18 +1,18 @@
1
- /**
2
- * Returns the next month the user can navigate to according to the given
3
- * options.
4
- *
5
- * Please note that the next month is not always the next calendar month:
6
- *
7
- * - if after the `toDate` range, is undefined;
8
- * - if the navigation is paged, is the number of months displayed ahead.
9
- *
10
- */
11
- export declare function getNextMonth(startingMonth: Date, options: {
12
- numberOfMonths?: number;
13
- fromDate?: Date;
14
- toDate?: Date;
15
- pagedNavigation?: boolean;
16
- today?: Date;
17
- disableNavigation?: boolean;
18
- }): Date | undefined;
1
+ /**
2
+ * Returns the next month the user can navigate to according to the given
3
+ * options.
4
+ *
5
+ * Please note that the next month is not always the next calendar month:
6
+ *
7
+ * - if after the `toDate` range, is undefined;
8
+ * - if the navigation is paged, is the number of months displayed ahead.
9
+ *
10
+ */
11
+ export declare function getNextMonth(startingMonth: Date, options: {
12
+ numberOfMonths?: number;
13
+ fromDate?: Date;
14
+ toDate?: Date;
15
+ pagedNavigation?: boolean;
16
+ today?: Date;
17
+ disableNavigation?: boolean;
18
+ }): Date | undefined;
@@ -1,19 +1,19 @@
1
- /**
2
- * Returns the next previous the user can navigate to, according to the given
3
- * options.
4
- *
5
- * Please note that the previous month is not always the previous calendar
6
- * month:
7
- *
8
- * - if before the `fromDate` date, is `undefined`;
9
- * - if the navigation is paged, is the number of months displayed before.
10
- *
11
- */
12
- export declare function getPreviousMonth(startingMonth: Date, options: {
13
- numberOfMonths?: number;
14
- fromDate?: Date;
15
- toDate?: Date;
16
- pagedNavigation?: boolean;
17
- today?: Date;
18
- disableNavigation?: boolean;
19
- }): Date | undefined;
1
+ /**
2
+ * Returns the next previous the user can navigate to, according to the given
3
+ * options.
4
+ *
5
+ * Please note that the previous month is not always the previous calendar
6
+ * month:
7
+ *
8
+ * - if before the `fromDate` date, is `undefined`;
9
+ * - if the navigation is paged, is the number of months displayed before.
10
+ *
11
+ */
12
+ export declare function getPreviousMonth(startingMonth: Date, options: {
13
+ numberOfMonths?: number;
14
+ fromDate?: Date;
15
+ toDate?: Date;
16
+ pagedNavigation?: boolean;
17
+ today?: Date;
18
+ disableNavigation?: boolean;
19
+ }): Date | undefined;
@@ -1,8 +1,8 @@
1
- import React from 'react';
2
- import { DayPickerProps } from '../types';
3
- /** The props of [[RootProvider]]. */
4
- export declare type RootContext = DayPickerProps & {
5
- children: React.ReactNode;
6
- };
7
- /** Provide the value for all the context providers. */
8
- export declare function RootProvider(props: RootContext): JSX.Element;
1
+ import React from 'react';
2
+ import { DayPickerProps } from '../types/DayPicker';
3
+ /** The props of [[RootProvider]]. */
4
+ export declare type RootContext = DayPickerProps & {
5
+ children: React.ReactNode;
6
+ };
7
+ /** Provide the value for all the context providers. */
8
+ export declare function RootProvider(props: RootContext): JSX.Element;
@@ -1,32 +1,35 @@
1
- import React from 'react';
2
- import { DayClickEventHandler, DayPickerMultipleProps, DayPickerProps, Modifiers } from '../../types';
3
- /** Represent the modifiers that are changed by the multiple selection. */
4
- export declare type SelectMultipleModifiers = Pick<Modifiers, 'selected' | 'disabled'>;
5
- /** Represents the value of a [[SelectMultipleContext]]. */
6
- export interface SelectMultipleContextValue {
7
- /** The days that have been selected. */
8
- selected: Date[] | undefined;
9
- /** The modifiers for the corresponding selection. */
10
- modifiers: SelectMultipleModifiers;
11
- /** Event handler to attach to the day button to enable the multiple select. */
12
- handleDayClick?: DayClickEventHandler;
13
- }
14
- /**
15
- * The SelectMultiple context shares details about the selected days when in
16
- * multiple selection mode.
17
- *
18
- * Access this context from the [[useSelectMultiple]] hook.
19
- */
20
- export declare const SelectMultipleContext: React.Context<SelectMultipleContextValue | undefined>;
21
- export declare type SelectMultipleProviderProps = {
22
- initialProps: DayPickerProps;
23
- children: React.ReactNode;
24
- };
25
- /** Provides the values for the [[SelectMultipleContext]]. */
26
- export declare function SelectMultipleProvider(props: SelectMultipleProviderProps): JSX.Element;
27
- declare type SelectMultipleProviderInternalProps = {
28
- initialProps: DayPickerMultipleProps;
29
- children: React.ReactNode;
30
- };
31
- export declare function SelectMultipleProviderInternal({ initialProps, children }: SelectMultipleProviderInternalProps): JSX.Element;
32
- export {};
1
+ import React, { ReactNode } from 'react';
2
+ import { DayPickerProps } from '../../types/DayPicker';
3
+ import { DayPickerMultipleProps } from '../../types/DayPickerMultiple';
4
+ import { DayClickEventHandler } from '../../types/EventHandlers';
5
+ import { InternalModifier, Modifiers } from '../../types/Modifiers';
6
+ /** Represent the modifiers that are changed by the multiple selection. */
7
+ export declare type SelectMultipleModifiers = Pick<Modifiers, InternalModifier.Disabled>;
8
+ /** Represents the value of a [[SelectMultipleContext]]. */
9
+ export interface SelectMultipleContextValue {
10
+ /** The days that have been selected. */
11
+ selected: Date[] | undefined;
12
+ /** The modifiers for the corresponding selection. */
13
+ modifiers: SelectMultipleModifiers;
14
+ /** Event handler to attach to the day button to enable the multiple select. */
15
+ onDayClick?: DayClickEventHandler;
16
+ }
17
+ /**
18
+ * The SelectMultiple context shares details about the selected days when in
19
+ * multiple selection mode.
20
+ *
21
+ * Access this context from the [[useSelectMultiple]] hook.
22
+ */
23
+ export declare const SelectMultipleContext: React.Context<SelectMultipleContextValue | undefined>;
24
+ export declare type SelectMultipleProviderProps = {
25
+ initialProps: DayPickerProps;
26
+ children: ReactNode;
27
+ };
28
+ /** Provides the values for the [[SelectMultipleContext]]. */
29
+ export declare function SelectMultipleProvider(props: SelectMultipleProviderProps): JSX.Element;
30
+ declare type SelectMultipleProviderInternalProps = {
31
+ initialProps: DayPickerMultipleProps;
32
+ children: ReactNode;
33
+ };
34
+ export declare function SelectMultipleProviderInternal({ initialProps, children }: SelectMultipleProviderInternalProps): JSX.Element;
35
+ export {};
@@ -1,2 +1,2 @@
1
- export * from './SelectMultipleContext';
2
- export * from './useSelectMultiple';
1
+ export * from './SelectMultipleContext';
2
+ export * from './useSelectMultiple';
@@ -1,3 +1,3 @@
1
- import { SelectMultipleContextValue } from './SelectMultipleContext';
2
- /** Hook to access the [[SelectMultipleContext]]. */
3
- export declare function useSelectMultiple(): SelectMultipleContextValue;
1
+ import { SelectMultipleContextValue } from './SelectMultipleContext';
2
+ /** Hook to access the [[SelectMultipleContext]]. */
3
+ export declare function useSelectMultiple(): SelectMultipleContextValue;
@@ -1,32 +1,36 @@
1
- import React from 'react';
2
- import { DateRange, DayClickEventHandler, DayPickerProps, DayPickerRangeProps, Modifiers } from '../../types';
3
- /** Represent the modifiers that are changed by the range selection. */
4
- export declare type SelectRangeModifiers = Pick<Modifiers, 'selected' | 'range_start' | 'range_end' | 'range_middle' | 'disabled'>;
5
- /** Represents the value of a [[SelectRangeContext]]. */
6
- export interface SelectRangeContextValue {
7
- /** The range of days that has been selected. */
8
- selected: DateRange | undefined;
9
- /** The modifiers for the corresponding selection. */
10
- modifiers: SelectRangeModifiers;
11
- /** Event handler to attach to the day button to enable the range select. */
12
- handleDayClick?: DayClickEventHandler;
13
- }
14
- /**
15
- * The SelectRange context shares details about the selected days when in
16
- * range selection mode.
17
- *
18
- * Access this context from the [[useSelectRange]] hook.
19
- */
20
- export declare const SelectRangeContext: React.Context<SelectRangeContextValue | undefined>;
21
- declare type SelectRangeProviderProps = {
22
- initialProps: DayPickerProps;
23
- children: React.ReactNode;
24
- };
25
- /** Provides the values for the [[SelectRangeProvider]]. */
26
- export declare function SelectRangeProvider(props: SelectRangeProviderProps): JSX.Element;
27
- declare type SelectRangeProviderInternalProps = {
28
- initialProps: DayPickerRangeProps;
29
- children: React.ReactNode;
30
- };
31
- export declare function SelectRangeProviderInternal({ initialProps, children }: SelectRangeProviderInternalProps): JSX.Element;
32
- export {};
1
+ import React, { ReactNode } from 'react';
2
+ import { DayPickerProps } from '../../types/DayPicker';
3
+ import { DayPickerRangeProps } from '../../types/DayPickerRange';
4
+ import { DayClickEventHandler } from '../../types/EventHandlers';
5
+ import { DateRange } from '../../types/Matchers';
6
+ import { InternalModifier, Modifiers } from '../../types/Modifiers';
7
+ /** Represent the modifiers that are changed by the range selection. */
8
+ export declare type SelectRangeModifiers = Pick<Modifiers, InternalModifier.Disabled | InternalModifier.RangeEnd | InternalModifier.RangeMiddle | InternalModifier.RangeStart>;
9
+ /** Represents the value of a [[SelectRangeContext]]. */
10
+ export interface SelectRangeContextValue {
11
+ /** The range of days that has been selected. */
12
+ selected: DateRange | undefined;
13
+ /** The modifiers for the corresponding selection. */
14
+ modifiers: SelectRangeModifiers;
15
+ /** Event handler to attach to the day button to enable the range select. */
16
+ onDayClick?: DayClickEventHandler;
17
+ }
18
+ /**
19
+ * The SelectRange context shares details about the selected days when in
20
+ * range selection mode.
21
+ *
22
+ * Access this context from the [[useSelectRange]] hook.
23
+ */
24
+ export declare const SelectRangeContext: React.Context<SelectRangeContextValue | undefined>;
25
+ declare type SelectRangeProviderProps = {
26
+ initialProps: DayPickerProps;
27
+ children: ReactNode;
28
+ };
29
+ /** Provides the values for the [[SelectRangeProvider]]. */
30
+ export declare function SelectRangeProvider(props: SelectRangeProviderProps): JSX.Element;
31
+ declare type SelectRangeProviderInternalProps = {
32
+ initialProps: DayPickerRangeProps;
33
+ children: ReactNode;
34
+ };
35
+ export declare function SelectRangeProviderInternal({ initialProps, children }: SelectRangeProviderInternalProps): JSX.Element;
36
+ export {};
@@ -1,2 +1,2 @@
1
- export * from './SelectRangeContext';
2
- export * from './useSelectRange';
1
+ export * from './SelectRangeContext';
2
+ export * from './useSelectRange';
@@ -1,3 +1,3 @@
1
- import { SelectRangeContextValue } from './SelectRangeContext';
2
- /** Hook to access the [[SelectRangeContext]]. */
3
- export declare function useSelectRange(): SelectRangeContextValue;
1
+ import { SelectRangeContextValue } from './SelectRangeContext';
2
+ /** Hook to access the [[SelectRangeContext]]. */
3
+ export declare function useSelectRange(): SelectRangeContextValue;
@@ -1,8 +1,8 @@
1
- import { DateRange } from '../../../types';
2
- /**
3
- * Add a day to an existing range.
4
- *
5
- * The returned range takes in account the `undefined` values and if the added
6
- * day is already present in the range.
7
- */
8
- export declare function addToRange(day: Date, range?: DateRange): DateRange | undefined;
1
+ import { DateRange } from '../../../types/Matchers';
2
+ /**
3
+ * Add a day to an existing range.
4
+ *
5
+ * The returned range takes in account the `undefined` values and if the added
6
+ * day is already present in the range.
7
+ */
8
+ export declare function addToRange(day: Date, range?: DateRange): DateRange | undefined;
@@ -1,35 +1,30 @@
1
- import React from 'react';
2
- import { DayPickerProps } from '../../types/DayPicker';
3
- import { DayPickerSingleProps } from '../../types/DayPickerSingle';
4
- import { DayClickEventHandler } from '../../types/EventHandlers';
5
- import { Modifiers } from '../../types/Modifiers';
6
- /** Represent the modifiers that are changed by the single selection. */
7
- export declare type SelectSingleModifiers = Pick<Modifiers, 'selected'>;
8
- /** Represents the value of a [[SelectSingleContext]]. */
9
- export interface SelectSingleContextValue {
10
- /** The day that has been selected. */
11
- selected: Date | undefined;
12
- /** The modifiers for the corresponding selection. */
13
- modifiers: SelectSingleModifiers;
14
- /** Event handler to attach to the day button to enable the single select. */
15
- handleDayClick?: DayClickEventHandler;
16
- }
17
- /**
18
- * The SelectSingle context shares details about the selected days when in
19
- * single selection mode.
20
- *
21
- * Access this context from the [[useSelectSingle]] hook.
22
- */
23
- export declare const SelectSingleContext: React.Context<SelectSingleContextValue | undefined>;
24
- declare type SelectSingleProviderProps = {
25
- initialProps: DayPickerProps;
26
- children: React.ReactNode;
27
- };
28
- /** Provides the values for the [[SelectSingleProvider]]. */
29
- export declare function SelectSingleProvider(props: SelectSingleProviderProps): JSX.Element;
30
- declare type SelectSingleProviderInternal = {
31
- initialProps: DayPickerSingleProps;
32
- children: React.ReactNode;
33
- };
34
- export declare function SelectSingleProviderInternal({ initialProps, children }: SelectSingleProviderInternal): JSX.Element;
35
- export {};
1
+ import React from 'react';
2
+ import { DayPickerProps } from '../../types/DayPicker';
3
+ import { DayPickerSingleProps } from '../../types/DayPickerSingle';
4
+ import { DayClickEventHandler } from '../../types/EventHandlers';
5
+ /** Represents the value of a [[SelectSingleContext]]. */
6
+ export interface SelectSingleContextValue {
7
+ /** The day that has been selected. */
8
+ selected: Date | undefined;
9
+ /** Event handler to attach to the day button to enable the single select. */
10
+ onDayClick?: DayClickEventHandler;
11
+ }
12
+ /**
13
+ * The SelectSingle context shares details about the selected days when in
14
+ * single selection mode.
15
+ *
16
+ * Access this context from the [[useSelectSingle]] hook.
17
+ */
18
+ export declare const SelectSingleContext: React.Context<SelectSingleContextValue | undefined>;
19
+ declare type SelectSingleProviderProps = {
20
+ initialProps: DayPickerProps;
21
+ children: React.ReactNode;
22
+ };
23
+ /** Provides the values for the [[SelectSingleProvider]]. */
24
+ export declare function SelectSingleProvider(props: SelectSingleProviderProps): JSX.Element;
25
+ declare type SelectSingleProviderInternal = {
26
+ initialProps: DayPickerSingleProps;
27
+ children: React.ReactNode;
28
+ };
29
+ export declare function SelectSingleProviderInternal({ initialProps, children }: SelectSingleProviderInternal): JSX.Element;
30
+ export {};
@@ -1,2 +1,2 @@
1
- export * from './SelectSingleContext';
2
- export * from './useSelectSingle';
1
+ export * from './SelectSingleContext';
2
+ export * from './useSelectSingle';
@@ -1,3 +1,3 @@
1
- import { SelectSingleContextValue } from './SelectSingleContext';
2
- /** Hook to access the [[SelectSingleContext]]. */
3
- export declare function useSelectSingle(): SelectSingleContextValue;
1
+ import { SelectSingleContextValue } from './SelectSingleContext';
2
+ /** Hook to access the [[SelectSingleContext]]. */
3
+ export declare function useSelectSingle(): SelectSingleContextValue;
@@ -0,0 +1 @@
1
+ export * from './useActiveModifiers';
@@ -0,0 +1,9 @@
1
+ import { ActiveModifiers } from '../../types/Modifiers';
2
+ /**
3
+ * Return the active modifiers for the specified day.
4
+ *
5
+ * @param day
6
+ * @param displayMonth The month where the date is displayed. If not the same as
7
+ * `date`, the day is an "outside day".
8
+ */
9
+ export declare function useActiveModifiers(day: Date, displayMonth?: Date): ActiveModifiers;
@@ -1 +1 @@
1
- export * from './useControlledValue';
1
+ export * from './useControlledValue';
@@ -1,12 +1,12 @@
1
- import React from 'react';
2
- export declare type DispatchStateAction<T> = React.Dispatch<React.SetStateAction<T>>;
3
- /**
4
- * Helper hook for using controlled/uncontrolled values from a component props.
5
- *
6
- * When the value is not controlled, pass `undefined` as `controlledValue` and
7
- * use the returned setter to update it.
8
- *
9
- * When the value is controlled, pass the controlled value as second
10
- * argument, which will be always returned as `value`.
11
- */
12
- export declare function useControlledValue<T>(defaultValue: T, controlledValue: T | undefined): [T, DispatchStateAction<T>];
1
+ import React from 'react';
2
+ export declare type DispatchStateAction<T> = React.Dispatch<React.SetStateAction<T>>;
3
+ /**
4
+ * Helper hook for using controlled/uncontrolled values from a component props.
5
+ *
6
+ * When the value is not controlled, pass `undefined` as `controlledValue` and
7
+ * use the returned setter to update it.
8
+ *
9
+ * When the value is controlled, pass the controlled value as second
10
+ * argument, which will be always returned as `value`.
11
+ */
12
+ export declare function useControlledValue<T>(defaultValue: T, controlledValue: T | undefined): [T, DispatchStateAction<T>];
@@ -0,0 +1 @@
1
+ export * from './useDayEventHandlers';
@@ -0,0 +1,28 @@
1
+ import { HTMLProps } from 'react';
2
+ import { ActiveModifiers } from '../../types/Modifiers';
3
+ export declare type EventName = 'onClick' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp' | 'onMouseEnter' | 'onMouseLeave' | 'onTouchCancel' | 'onTouchEnd' | 'onTouchMove' | 'onTouchStart';
4
+ export declare type DayEventName = 'onDayClick' | 'onDayFocus' | 'onDayBlur' | 'onDayKeyDown' | 'onDayKeyUp' | 'onDayMouseEnter' | 'onDayMouseLeave' | 'onDayTouchCancel' | 'onDayTouchEnd' | 'onDayTouchMove' | 'onDayTouchStart';
5
+ export declare type DayEventHandlers = Pick<HTMLProps<HTMLButtonElement>, EventName>;
6
+ /**
7
+ * This hook returns details about the content to render in the day cell.
8
+ *
9
+ *
10
+ * When a day cell is rendered in the table, DayPicker can either:
11
+ *
12
+ * - render nothing: when the day is outside the month or has matched the
13
+ * "hidden" modifier.
14
+ * - render a button. When a selection mode is set, DayPicker renders a button
15
+ * to allow the focus and the selection. In case of `custom` selection
16
+ * mode, DayPicker expects a `onDayClick` prop to render a button.
17
+ * - render a non-interactive element: when no selection mode is set, the day
18
+ * cell shouldn’t respond to any interaction. DayPicker should render a `div`
19
+ * or a `span`.
20
+ *
21
+ * ### Usage
22
+ *
23
+ * Use this hook to customize the behavior of the [[Day]] component. Create a
24
+ * new `Day` component using this hook and pass it to the `components` prop.
25
+ * The source of [[Day]] can be a good starting point.
26
+ *
27
+ */
28
+ export declare function useDayEventHandlers(date: Date, activeModifiers: ActiveModifiers): DayEventHandlers;
@@ -0,0 +1 @@
1
+ export * from './useDayRender';
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { ButtonProps } from '../../components/Button';
3
+ import { DayEventHandlers } from '../../hooks/useDayEventHandlers';
4
+ import { SelectedDays } from '../../hooks/useSelectedDays';
5
+ import { ActiveModifiers } from '../../types/Modifiers';
6
+ import { StyledComponent } from '../../types/Styles';
7
+ export declare type DayRender = {
8
+ /** Whether the day should be rendered a `button` instead of a `div` */
9
+ isButton: boolean;
10
+ /** Whether the day should be hidden. */
11
+ isHidden: boolean;
12
+ /** The modifiers active for the given day. */
13
+ activeModifiers: ActiveModifiers;
14
+ /** The props to apply to the button element (when `isButton` is true). */
15
+ buttonProps: StyledComponent & Pick<ButtonProps, 'disabled' | 'aria-pressed' | 'tabIndex'> & DayEventHandlers;
16
+ /** The props to apply to the div element (when `isButton` is false). */
17
+ divProps: StyledComponent;
18
+ selectedDays: SelectedDays;
19
+ };
20
+ /**
21
+ * Return props and data used to render the [[Day]] component.
22
+ *
23
+ * Use this hook when creating a component to replace the built-in `Day`
24
+ * component.
25
+ *
26
+ * Each Day in DayPicker should render one of the following, according to the return
27
+ * value:
28
+ *
29
+ * - an empty `React.Fragment`, to render if `isHidden` is true
30
+ * - a `button` element, when the day is interactive, e.g. is selectable
31
+ * - a `div` element, whe the day is not interactive
32
+ *
33
+ * @param day The date to render
34
+ * @param displayMonth The month where the date is displayed (if not the same as
35
+ * `date`, it means it is an "outside" day)
36
+ * @param buttonRef A ref to the button element that will be target of focus
37
+ * when rendered (if required).
38
+ */
39
+ export declare function useDayRender(day: Date, displayMonth: Date, buttonRef: React.RefObject<HTMLButtonElement>): DayRender;
@@ -0,0 +1,4 @@
1
+ import { DayPickerContextValue } from '../../../contexts/DayPicker';
2
+ import { ActiveModifiers } from '../../../types/Modifiers';
3
+ /** Return the class names for the Day element, according to the given active modifiers. */
4
+ export declare function getDayClassNames(dayPicker: Pick<DayPickerContextValue, 'modifiersClassNames' | 'classNames' | 'modifierPrefix'>, activeModifiers: ActiveModifiers): string[];
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { DayPickerContextValue } from '../../../contexts/DayPicker';
3
+ import { ActiveModifiers } from '../../../types/Modifiers';
4
+ /** Return the style for the Day element, according to the given active modifiers. */
5
+ export declare function getDayStyle(dayPicker: Pick<DayPickerContextValue, 'modifiersStyles' | 'styles'>, activeModifiers: ActiveModifiers): React.CSSProperties;
@@ -1 +1 @@
1
- export * from './useInput';
1
+ export * from './useInput';