@timmbr/ui 1.17.7 → 1.19.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 (228) hide show
  1. package/dist/components/Calendar/Calendar.d.ts +4 -0
  2. package/dist/components/Calendar/Calendar.d.ts.map +1 -0
  3. package/dist/components/Calendar/Calendar.helpers.d.ts +31 -0
  4. package/dist/components/Calendar/Calendar.helpers.d.ts.map +1 -0
  5. package/dist/components/Calendar/Calendar.helpers.js +153 -0
  6. package/dist/components/Calendar/Calendar.js +188 -0
  7. package/dist/components/Calendar/Calendar.styles.d.ts +7 -0
  8. package/dist/components/Calendar/Calendar.styles.d.ts.map +1 -0
  9. package/dist/components/Calendar/Calendar.styles.js +15 -0
  10. package/dist/components/Calendar/Calendar.types.d.ts +83 -0
  11. package/dist/components/Calendar/Calendar.types.d.ts.map +1 -0
  12. package/dist/components/Calendar/index.d.ts +5 -0
  13. package/dist/components/Calendar/index.d.ts.map +1 -0
  14. package/dist/components/Calendar/subcomponents/CalendarMonthYearPickers.d.ts +21 -0
  15. package/dist/components/Calendar/subcomponents/CalendarMonthYearPickers.d.ts.map +1 -0
  16. package/dist/components/Calendar/subcomponents/CalendarMonthYearPickers.js +185 -0
  17. package/dist/components/DataTable/DataTable.d.ts.map +1 -1
  18. package/dist/components/DataTable/DataTable.js +16 -4
  19. package/dist/components/DatePicker/DatePicker.d.ts +4 -0
  20. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -0
  21. package/dist/components/DatePicker/DatePicker.helpers.d.ts +8 -0
  22. package/dist/components/DatePicker/DatePicker.helpers.d.ts.map +1 -0
  23. package/dist/components/DatePicker/DatePicker.helpers.js +51 -0
  24. package/dist/components/DatePicker/DatePicker.js +236 -0
  25. package/dist/components/DatePicker/DatePicker.styles.d.ts +4 -0
  26. package/dist/components/DatePicker/DatePicker.styles.d.ts.map +1 -0
  27. package/dist/components/DatePicker/DatePicker.styles.js +15 -0
  28. package/dist/components/DatePicker/DatePicker.types.d.ts +67 -0
  29. package/dist/components/DatePicker/DatePicker.types.d.ts.map +1 -0
  30. package/dist/components/DatePicker/index.d.ts +5 -0
  31. package/dist/components/DatePicker/index.d.ts.map +1 -0
  32. package/dist/components/Rating/Rating.d.ts +1 -1
  33. package/dist/components/Rating/Rating.d.ts.map +1 -1
  34. package/dist/components/Rating/Rating.js +11 -2
  35. package/dist/components/Rating/Rating.types.d.ts +5 -0
  36. package/dist/components/Rating/Rating.types.d.ts.map +1 -1
  37. package/dist/components/RatingDistribution/RatingDistribution.d.ts +8 -0
  38. package/dist/components/RatingDistribution/RatingDistribution.d.ts.map +1 -0
  39. package/dist/components/RatingDistribution/RatingDistribution.js +70 -0
  40. package/dist/components/RatingDistribution/RatingDistribution.types.d.ts +21 -0
  41. package/dist/components/RatingDistribution/RatingDistribution.types.d.ts.map +1 -0
  42. package/dist/components/RatingDistribution/index.d.ts +3 -0
  43. package/dist/components/RatingDistribution/index.d.ts.map +1 -0
  44. package/dist/components/RatingInput/RatingInput.d.ts +8 -0
  45. package/dist/components/RatingInput/RatingInput.d.ts.map +1 -0
  46. package/dist/components/RatingInput/RatingInput.js +95 -0
  47. package/dist/components/RatingInput/RatingInput.styles.d.ts +6 -0
  48. package/dist/components/RatingInput/RatingInput.styles.d.ts.map +1 -0
  49. package/dist/components/RatingInput/RatingInput.styles.js +13 -0
  50. package/dist/components/RatingInput/RatingInput.types.d.ts +18 -0
  51. package/dist/components/RatingInput/RatingInput.types.d.ts.map +1 -0
  52. package/dist/components/RatingInput/index.d.ts +4 -0
  53. package/dist/components/RatingInput/index.d.ts.map +1 -0
  54. package/dist/components/RichTextEditor/RichTextEditor.d.ts +1 -1
  55. package/dist/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
  56. package/dist/components/RichTextEditor/RichTextEditor.js +2 -0
  57. package/dist/components/RichTextEditor/RichTextEditor.types.d.ts +2 -0
  58. package/dist/components/RichTextEditor/RichTextEditor.types.d.ts.map +1 -1
  59. package/dist/components/RichTextEditor/subcomponents/RteToolbar.d.ts +2 -1
  60. package/dist/components/RichTextEditor/subcomponents/RteToolbar.d.ts.map +1 -1
  61. package/dist/components/RichTextEditor/subcomponents/RteToolbar.js +60 -2
  62. package/dist/index.d.ts +4 -0
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +9 -0
  65. package/dist/node_modules/.pnpm/@date-fns_tz@1.5.0/node_modules/@date-fns/tz/date/index.js +83 -0
  66. package/dist/node_modules/.pnpm/@date-fns_tz@1.5.0/node_modules/@date-fns/tz/date/mini.js +450 -0
  67. package/dist/node_modules/.pnpm/@date-fns_tz@1.5.0/node_modules/@date-fns/tz/tzName/index.js +39 -0
  68. package/dist/node_modules/.pnpm/@date-fns_tz@1.5.0/node_modules/@date-fns/tz/tzOffset/index.js +56 -0
  69. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/addLeadingZeros.js +7 -0
  70. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/defaultOptions.js +7 -0
  71. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/formatters.js +775 -0
  72. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/lightFormatters.js +94 -0
  73. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/longFormatters.js +66 -0
  74. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +31 -0
  75. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/normalizeDates.js +11 -0
  76. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/normalizeInterval.js +8 -0
  77. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/protectedTokens.js +25 -0
  78. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/addDays.js +60 -0
  79. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/addMonths.js +75 -0
  80. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/addWeeks.js +33 -0
  81. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/addYears.js +33 -0
  82. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constants.js +46 -0
  83. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constructFrom.js +49 -0
  84. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInCalendarDays.js +62 -0
  85. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInCalendarMonths.js +42 -0
  86. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/eachMonthOfInterval.js +65 -0
  87. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/eachYearOfInterval.js +65 -0
  88. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/endOfISOWeek.js +35 -0
  89. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/endOfMonth.js +37 -0
  90. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/endOfWeek.js +53 -0
  91. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/endOfYear.js +37 -0
  92. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/format.js +423 -0
  93. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getDayOfYear.js +34 -0
  94. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getDaysInMonth.js +36 -0
  95. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISOWeek.js +40 -0
  96. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISOWeekYear.js +52 -0
  97. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getMonth.js +29 -0
  98. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getWeek.js +54 -0
  99. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getWeekYear.js +75 -0
  100. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getYear.js +29 -0
  101. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isAfter.js +25 -0
  102. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isBefore.js +25 -0
  103. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isDate.js +41 -0
  104. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isSameDay.js +46 -0
  105. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isSameMonth.js +43 -0
  106. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isSameYear.js +35 -0
  107. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isValid.js +39 -0
  108. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +10 -0
  109. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +64 -0
  110. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchFn.js +59 -0
  111. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +22 -0
  112. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +103 -0
  113. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js +41 -0
  114. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +13 -0
  115. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/localize.js +189 -0
  116. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/match.js +134 -0
  117. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US.js +28 -0
  118. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/max.js +49 -0
  119. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/min.js +49 -0
  120. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/setMonth.js +46 -0
  121. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/setYear.js +40 -0
  122. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfDay.js +35 -0
  123. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfISOWeek.js +35 -0
  124. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfISOWeekYear.js +42 -0
  125. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfMonth.js +37 -0
  126. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfWeek.js +53 -0
  127. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfWeekYear.js +64 -0
  128. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfYear.js +36 -0
  129. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/toDate.js +46 -0
  130. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/DayPicker.js +346 -0
  131. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/UI.js +122 -0
  132. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js +33 -0
  133. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js +14 -0
  134. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js +13 -0
  135. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/classes/DateLib.js +599 -0
  136. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js +13 -0
  137. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Chevron.js +18 -0
  138. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Day.js +18 -0
  139. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/DayButton.js +19 -0
  140. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Dropdown.js +23 -0
  141. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/DropdownNav.js +13 -0
  142. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Footer.js +13 -0
  143. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Month.js +15 -0
  144. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/MonthCaption.js +14 -0
  145. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/MonthGrid.js +13 -0
  146. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Months.js +13 -0
  147. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js +15 -0
  148. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Nav.js +31 -0
  149. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js +13 -0
  150. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Option.js +13 -0
  151. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js +13 -0
  152. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Root.js +14 -0
  153. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Select.js +13 -0
  154. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Week.js +14 -0
  155. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/WeekNumber.js +14 -0
  156. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js +13 -0
  157. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Weekday.js +13 -0
  158. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Weekdays.js +14 -0
  159. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Weeks.js +13 -0
  160. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js +15 -0
  161. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/custom-components.js +25 -0
  162. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +20 -0
  163. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/formatters/formatDay.js +19 -0
  164. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js +18 -0
  165. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js +21 -0
  166. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js +13 -0
  167. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js +19 -0
  168. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js +17 -0
  169. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/formatters/index.js +7 -0
  170. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js +73 -0
  171. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +95 -0
  172. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js +22 -0
  173. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +28 -0
  174. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js +33 -0
  175. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getComponents.js +20 -0
  176. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js +27 -0
  177. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getDates.js +59 -0
  178. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getDays.js +19 -0
  179. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js +33 -0
  180. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js +24 -0
  181. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js +46 -0
  182. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js +17 -0
  183. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +27 -0
  184. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getLabels.js +53 -0
  185. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js +33 -0
  186. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getMonths.js +69 -0
  187. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js +31 -0
  188. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js +40 -0
  189. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js +36 -0
  190. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js +37 -0
  191. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js +27 -0
  192. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js +26 -0
  193. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +14 -0
  194. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +36 -0
  195. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +27 -0
  196. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js +31 -0
  197. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/index.js +11 -0
  198. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js +27 -0
  199. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +20 -0
  200. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js +22 -0
  201. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +14 -0
  202. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelNav.js +13 -0
  203. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelNext.js +16 -0
  204. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +15 -0
  205. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +15 -0
  206. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +14 -0
  207. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js +18 -0
  208. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +14 -0
  209. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/locale/en-US.js +67 -0
  210. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/noonDateLib.js +163 -0
  211. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/selection/useMulti.js +57 -0
  212. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/selection/useRange.js +63 -0
  213. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/selection/useSingle.js +44 -0
  214. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/useAnimation.js +173 -0
  215. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/useCalendar.js +113 -0
  216. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/useDayPicker.js +25 -0
  217. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/useFocus.js +64 -0
  218. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/useSelection.js +31 -0
  219. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/addToRange.js +95 -0
  220. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js +61 -0
  221. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js +62 -0
  222. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js +30 -0
  223. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js +74 -0
  224. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js +35 -0
  225. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js +21 -0
  226. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/toTimeZone.js +16 -0
  227. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/typeguards.js +66 -0
  228. package/package.json +13 -11
@@ -0,0 +1,53 @@
1
+ import { getDefaultOptions } from './_lib/defaultOptions.js';
2
+ import { toDate } from './toDate.js';
3
+
4
+ /**
5
+ * The {@link startOfWeek} function options.
6
+ */
7
+
8
+ /**
9
+ * @name startOfWeek
10
+ * @category Week Helpers
11
+ * @summary Return the start of a week for the given date.
12
+ *
13
+ * @description
14
+ * Return the start of a week for the given date.
15
+ * The result will be in the local timezone.
16
+ *
17
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
18
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
19
+ *
20
+ * @param date - The original date
21
+ * @param options - An object with options
22
+ *
23
+ * @returns The start of a week
24
+ *
25
+ * @example
26
+ * // The start of a week for 2 September 2014 11:55:00:
27
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
28
+ * //=> Sun Aug 31 2014 00:00:00
29
+ *
30
+ * @example
31
+ * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
32
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
33
+ * //=> Mon Sep 01 2014 00:00:00
34
+ */
35
+ function startOfWeek(date, options) {
36
+ const defaultOptions = getDefaultOptions();
37
+ const weekStartsOn =
38
+ options?.weekStartsOn ??
39
+ options?.locale?.options?.weekStartsOn ??
40
+ defaultOptions.weekStartsOn ??
41
+ defaultOptions.locale?.options?.weekStartsOn ??
42
+ 0;
43
+
44
+ const _date = toDate(date, options?.in);
45
+ const day = _date.getDay();
46
+ const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
47
+
48
+ _date.setDate(_date.getDate() - diff);
49
+ _date.setHours(0, 0, 0, 0);
50
+ return _date;
51
+ }
52
+
53
+ export { startOfWeek };
@@ -0,0 +1,64 @@
1
+ import { getDefaultOptions } from './_lib/defaultOptions.js';
2
+ import { constructFrom } from './constructFrom.js';
3
+ import { getWeekYear } from './getWeekYear.js';
4
+ import { startOfWeek } from './startOfWeek.js';
5
+
6
+ /**
7
+ * The {@link startOfWeekYear} function options.
8
+ */
9
+
10
+ /**
11
+ * @name startOfWeekYear
12
+ * @category Week-Numbering Year Helpers
13
+ * @summary Return the start of a local week-numbering year for the given date.
14
+ *
15
+ * @description
16
+ * Return the start of a local week-numbering year.
17
+ * The exact calculation depends on the values of
18
+ * `options.weekStartsOn` (which is the index of the first day of the week)
19
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
20
+ * the first week of the week-numbering year)
21
+ *
22
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
23
+ *
24
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
25
+ * @typeParam ResultDate - The result `Date` type.
26
+ *
27
+ * @param date - The original date
28
+ * @param options - An object with options
29
+ *
30
+ * @returns The start of a week-numbering year
31
+ *
32
+ * @example
33
+ * // The start of an a week-numbering year for 2 July 2005 with default settings:
34
+ * const result = startOfWeekYear(new Date(2005, 6, 2))
35
+ * //=> Sun Dec 26 2004 00:00:00
36
+ *
37
+ * @example
38
+ * // The start of a week-numbering year for 2 July 2005
39
+ * // if Monday is the first day of week
40
+ * // and 4 January is always in the first week of the year:
41
+ * const result = startOfWeekYear(new Date(2005, 6, 2), {
42
+ * weekStartsOn: 1,
43
+ * firstWeekContainsDate: 4
44
+ * })
45
+ * //=> Mon Jan 03 2005 00:00:00
46
+ */
47
+ function startOfWeekYear(date, options) {
48
+ const defaultOptions = getDefaultOptions();
49
+ const firstWeekContainsDate =
50
+ options?.firstWeekContainsDate ??
51
+ options?.locale?.options?.firstWeekContainsDate ??
52
+ defaultOptions.firstWeekContainsDate ??
53
+ defaultOptions.locale?.options?.firstWeekContainsDate ??
54
+ 1;
55
+
56
+ const year = getWeekYear(date, options);
57
+ const firstWeek = constructFrom(options?.in || date, 0);
58
+ firstWeek.setFullYear(year, 0, firstWeekContainsDate);
59
+ firstWeek.setHours(0, 0, 0, 0);
60
+ const _date = startOfWeek(firstWeek, options);
61
+ return _date;
62
+ }
63
+
64
+ export { startOfWeekYear };
@@ -0,0 +1,36 @@
1
+ import { toDate } from './toDate.js';
2
+
3
+ /**
4
+ * The {@link startOfYear} function options.
5
+ */
6
+
7
+ /**
8
+ * @name startOfYear
9
+ * @category Year Helpers
10
+ * @summary Return the start of a year for the given date.
11
+ *
12
+ * @description
13
+ * Return the start of a year for the given date.
14
+ * The result will be in the local timezone.
15
+ *
16
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
17
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
18
+ *
19
+ * @param date - The original date
20
+ * @param options - The options
21
+ *
22
+ * @returns The start of a year
23
+ *
24
+ * @example
25
+ * // The start of a year for 2 September 2014 11:55:00:
26
+ * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
27
+ * //=> Wed Jan 01 2014 00:00:00
28
+ */
29
+ function startOfYear(date, options) {
30
+ const date_ = toDate(date, options?.in);
31
+ date_.setFullYear(date_.getFullYear(), 0, 1);
32
+ date_.setHours(0, 0, 0, 0);
33
+ return date_;
34
+ }
35
+
36
+ export { startOfYear };
@@ -0,0 +1,46 @@
1
+ import { constructFrom } from './constructFrom.js';
2
+
3
+ /**
4
+ * @name toDate
5
+ * @category Common Helpers
6
+ * @summary Convert the given argument to an instance of Date.
7
+ *
8
+ * @description
9
+ * Convert the given argument to an instance of Date.
10
+ *
11
+ * If the argument is an instance of Date, the function returns its clone.
12
+ *
13
+ * If the argument is a number, it is treated as a timestamp.
14
+ *
15
+ * If the argument is none of the above, the function returns Invalid Date.
16
+ *
17
+ * Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
18
+ * enabling to transfer extra properties from the reference date to the new date.
19
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
20
+ * that accept a time zone as a constructor argument.
21
+ *
22
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
23
+ *
24
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
25
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
26
+ *
27
+ * @param argument - The value to convert
28
+ *
29
+ * @returns The parsed date in the local time zone
30
+ *
31
+ * @example
32
+ * // Clone the date:
33
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
34
+ * //=> Tue Feb 11 2014 11:30:30
35
+ *
36
+ * @example
37
+ * // Convert the timestamp to date:
38
+ * const result = toDate(1392098430000)
39
+ * //=> Tue Feb 11 2014 11:30:30
40
+ */
41
+ function toDate(argument, context) {
42
+ // [TODO] Get rid of `toDate` or `constructFrom`?
43
+ return constructFrom(context || argument, argument);
44
+ }
45
+
46
+ export { toDate };
@@ -0,0 +1,346 @@
1
+ import React__default, { useMemo, useCallback, useRef } from 'react';
2
+ import { DateLib } from './classes/DateLib.js';
3
+ import { createGetModifiers } from './helpers/createGetModifiers.js';
4
+ import { getClassNamesForModifiers } from './helpers/getClassNamesForModifiers.js';
5
+ import { getComponents } from './helpers/getComponents.js';
6
+ import { getDataAttributes } from './helpers/getDataAttributes.js';
7
+ import { getDefaultClassNames } from './helpers/getDefaultClassNames.js';
8
+ import { getFormatters } from './helpers/getFormatters.js';
9
+ import { getLabels } from './helpers/getLabels.js';
10
+ import { getMonthOptions } from './helpers/getMonthOptions.js';
11
+ import { getStyleForModifiers } from './helpers/getStyleForModifiers.js';
12
+ import { getWeekdays } from './helpers/getWeekdays.js';
13
+ import { getYearOptions } from './helpers/getYearOptions.js';
14
+ import { createNoonOverrides } from './noonDateLib.js';
15
+ import { UI, DayFlag, SelectionState } from './UI.js';
16
+ import { useAnimation } from './useAnimation.js';
17
+ import { useCalendar } from './useCalendar.js';
18
+ import { dayPickerContext } from './useDayPicker.js';
19
+ import { useFocus } from './useFocus.js';
20
+ import { useSelection } from './useSelection.js';
21
+ import { convertMatchersToTimeZone } from './utils/convertMatchersToTimeZone.js';
22
+ import { rangeIncludesDate } from './utils/rangeIncludesDate.js';
23
+ import { toTimeZone } from './utils/toTimeZone.js';
24
+ import { isDateRange } from './utils/typeguards.js';
25
+ import { enUS } from './locale/en-US.js';
26
+
27
+ /**
28
+ * Renders the DayPicker calendar component.
29
+ *
30
+ * @param initialProps - The props for the DayPicker component.
31
+ * @returns The rendered DayPicker component.
32
+ * @group DayPicker
33
+ * @see https://daypicker.dev
34
+ */
35
+ function DayPicker(initialProps) {
36
+ let props = initialProps;
37
+ const timeZone = props.timeZone;
38
+ if (timeZone) {
39
+ props = {
40
+ ...initialProps,
41
+ timeZone,
42
+ };
43
+ if (props.today) {
44
+ props.today = toTimeZone(props.today, timeZone);
45
+ }
46
+ if (props.month) {
47
+ props.month = toTimeZone(props.month, timeZone);
48
+ }
49
+ if (props.defaultMonth) {
50
+ props.defaultMonth = toTimeZone(props.defaultMonth, timeZone);
51
+ }
52
+ if (props.startMonth) {
53
+ props.startMonth = toTimeZone(props.startMonth, timeZone);
54
+ }
55
+ if (props.endMonth) {
56
+ props.endMonth = toTimeZone(props.endMonth, timeZone);
57
+ }
58
+ if (props.mode === "single" && props.selected) {
59
+ props.selected = toTimeZone(props.selected, timeZone);
60
+ }
61
+ else if (props.mode === "multiple" && props.selected) {
62
+ props.selected = props.selected?.map((date) => toTimeZone(date, timeZone));
63
+ }
64
+ else if (props.mode === "range" && props.selected) {
65
+ props.selected = {
66
+ from: props.selected.from
67
+ ? toTimeZone(props.selected.from, timeZone)
68
+ : props.selected.from,
69
+ to: props.selected.to
70
+ ? toTimeZone(props.selected.to, timeZone)
71
+ : props.selected.to,
72
+ };
73
+ }
74
+ if (props.disabled !== undefined) {
75
+ props.disabled = convertMatchersToTimeZone(props.disabled, timeZone);
76
+ }
77
+ if (props.hidden !== undefined) {
78
+ props.hidden = convertMatchersToTimeZone(props.hidden, timeZone);
79
+ }
80
+ if (props.modifiers) {
81
+ const nextModifiers = {};
82
+ Object.keys(props.modifiers).forEach((key) => {
83
+ nextModifiers[key] = convertMatchersToTimeZone(props.modifiers?.[key], timeZone);
84
+ });
85
+ props.modifiers = nextModifiers;
86
+ }
87
+ }
88
+ const { components, formatters, labels, dateLib, locale, classNames } = useMemo(() => {
89
+ const locale = { ...enUS, ...props.locale };
90
+ const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
91
+ const noonOverrides = props.noonSafe && props.timeZone
92
+ ? createNoonOverrides(props.timeZone, {
93
+ weekStartsOn,
94
+ locale,
95
+ })
96
+ : undefined;
97
+ const overrides = props.dateLib && noonOverrides
98
+ ? { ...noonOverrides, ...props.dateLib }
99
+ : (props.dateLib ?? noonOverrides);
100
+ const dateLib = new DateLib({
101
+ locale,
102
+ weekStartsOn,
103
+ firstWeekContainsDate: props.firstWeekContainsDate,
104
+ useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
105
+ useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
106
+ timeZone: props.timeZone,
107
+ numerals: props.numerals,
108
+ }, overrides);
109
+ return {
110
+ dateLib,
111
+ components: getComponents(props.components),
112
+ formatters: getFormatters(props.formatters),
113
+ labels: getLabels(props.labels, dateLib.options),
114
+ locale,
115
+ classNames: { ...getDefaultClassNames(), ...props.classNames },
116
+ };
117
+ }, [
118
+ props.locale,
119
+ props.broadcastCalendar,
120
+ props.weekStartsOn,
121
+ props.firstWeekContainsDate,
122
+ props.useAdditionalWeekYearTokens,
123
+ props.useAdditionalDayOfYearTokens,
124
+ props.timeZone,
125
+ props.numerals,
126
+ props.dateLib,
127
+ props.noonSafe,
128
+ props.components,
129
+ props.formatters,
130
+ props.labels,
131
+ props.classNames,
132
+ ]);
133
+ if (!props.today) {
134
+ props = { ...props, today: dateLib.today() };
135
+ }
136
+ const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles, } = props;
137
+ const { formatCaption, formatDay, formatMonthDropdown, formatWeekNumber, formatWeekNumberHeader, formatWeekdayName, formatYearDropdown, } = formatters;
138
+ const calendar = useCalendar(props, dateLib);
139
+ const { days, months, navStart, navEnd, previousMonth, nextMonth, goToMonth, } = calendar;
140
+ const getModifiers = createGetModifiers(days, props, navStart, navEnd, dateLib);
141
+ const { isSelected, select, selected: selectedValue, } = useSelection(props, dateLib) ?? {};
142
+ const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected ?? (() => false), dateLib);
143
+ const { labelDayButton, labelGridcell, labelGrid, labelMonthDropdown, labelNav, labelPrevious, labelNext, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown, } = labels;
144
+ const weekdays = useMemo(() => getWeekdays(dateLib, props.ISOWeek, props.broadcastCalendar, props.today), [dateLib, props.ISOWeek, props.broadcastCalendar, props.today]);
145
+ const isInteractive = mode !== undefined || onDayClick !== undefined;
146
+ const handlePreviousClick = useCallback(() => {
147
+ if (!previousMonth)
148
+ return;
149
+ goToMonth(previousMonth);
150
+ onPrevClick?.(previousMonth);
151
+ }, [previousMonth, goToMonth, onPrevClick]);
152
+ const handleNextClick = useCallback(() => {
153
+ if (!nextMonth)
154
+ return;
155
+ goToMonth(nextMonth);
156
+ onNextClick?.(nextMonth);
157
+ }, [goToMonth, nextMonth, onNextClick]);
158
+ const handleDayClick = useCallback((day, m) => (e) => {
159
+ e.preventDefault();
160
+ e.stopPropagation();
161
+ setFocused(day);
162
+ if (m.disabled) {
163
+ return;
164
+ }
165
+ select?.(day.date, m, e);
166
+ onDayClick?.(day.date, m, e);
167
+ }, [select, onDayClick, setFocused]);
168
+ const handleDayFocus = useCallback((day, m) => (e) => {
169
+ setFocused(day);
170
+ onDayFocus?.(day.date, m, e);
171
+ }, [onDayFocus, setFocused]);
172
+ const handleDayBlur = useCallback((day, m) => (e) => {
173
+ blur();
174
+ onDayBlur?.(day.date, m, e);
175
+ }, [blur, onDayBlur]);
176
+ const handleDayKeyDown = useCallback((day, modifiers) => (e) => {
177
+ const keyMap = {
178
+ ArrowLeft: [
179
+ e.shiftKey ? "month" : "day",
180
+ props.dir === "rtl" ? "after" : "before",
181
+ ],
182
+ ArrowRight: [
183
+ e.shiftKey ? "month" : "day",
184
+ props.dir === "rtl" ? "before" : "after",
185
+ ],
186
+ ArrowDown: [e.shiftKey ? "year" : "week", "after"],
187
+ ArrowUp: [e.shiftKey ? "year" : "week", "before"],
188
+ PageUp: [e.shiftKey ? "year" : "month", "before"],
189
+ PageDown: [e.shiftKey ? "year" : "month", "after"],
190
+ Home: ["startOfWeek", "before"],
191
+ End: ["endOfWeek", "after"],
192
+ };
193
+ if (keyMap[e.key]) {
194
+ e.preventDefault();
195
+ e.stopPropagation();
196
+ const [moveBy, moveDir] = keyMap[e.key];
197
+ moveFocus(moveBy, moveDir);
198
+ }
199
+ onDayKeyDown?.(day.date, modifiers, e);
200
+ }, [moveFocus, onDayKeyDown, props.dir]);
201
+ const handleDayMouseEnter = useCallback((day, modifiers) => (e) => {
202
+ onDayMouseEnter?.(day.date, modifiers, e);
203
+ }, [onDayMouseEnter]);
204
+ const handleDayMouseLeave = useCallback((day, modifiers) => (e) => {
205
+ onDayMouseLeave?.(day.date, modifiers, e);
206
+ }, [onDayMouseLeave]);
207
+ const handleMonthChange = useCallback((date, monthOffset) => (e) => {
208
+ const selectedMonth = Number(e.target.value);
209
+ const month = dateLib.setMonth(dateLib.startOfMonth(date), selectedMonth);
210
+ goToMonth(dateLib.addMonths(month, -monthOffset));
211
+ }, [dateLib, goToMonth]);
212
+ const handleYearChange = useCallback((date, monthOffset) => (e) => {
213
+ const selectedYear = Number(e.target.value);
214
+ const month = dateLib.setYear(dateLib.startOfMonth(date), selectedYear);
215
+ goToMonth(dateLib.addMonths(month, -monthOffset));
216
+ }, [dateLib, goToMonth]);
217
+ const { className, style } = useMemo(() => ({
218
+ className: [classNames[UI.Root], props.className]
219
+ .filter(Boolean)
220
+ .join(" "),
221
+ style: { ...styles?.[UI.Root], ...props.style },
222
+ }), [classNames, props.className, props.style, styles]);
223
+ const dataAttributes = getDataAttributes(props);
224
+ const getDropdownStyle = (dropdown) => {
225
+ const dropdownStyle = styles?.[UI.Dropdown];
226
+ const specificDropdownStyle = styles?.[dropdown];
227
+ if (!dropdownStyle && !specificDropdownStyle) {
228
+ return undefined;
229
+ }
230
+ return {
231
+ ...dropdownStyle,
232
+ ...specificDropdownStyle,
233
+ };
234
+ };
235
+ const rootElRef = useRef(null);
236
+ useAnimation(rootElRef, Boolean(props.animate), {
237
+ classNames,
238
+ months,
239
+ focused,
240
+ dateLib,
241
+ });
242
+ const contextValue = {
243
+ dayPickerProps: props,
244
+ selected: selectedValue,
245
+ select: select,
246
+ isSelected,
247
+ months,
248
+ nextMonth,
249
+ previousMonth,
250
+ goToMonth,
251
+ getModifiers,
252
+ components,
253
+ classNames,
254
+ styles,
255
+ labels,
256
+ formatters,
257
+ };
258
+ return (React__default.createElement(dayPickerContext.Provider, { value: contextValue },
259
+ React__default.createElement(components.Root, { rootRef: props.animate ? rootElRef : undefined, className: className, style: style, dir: props.dir, id: props.id, lang: props.lang ?? locale.code, nonce: props.nonce, title: props.title, role: props.role, "aria-label": props["aria-label"], "aria-labelledby": props["aria-labelledby"], ...dataAttributes },
260
+ React__default.createElement(components.Months, { className: classNames[UI.Months], style: styles?.[UI.Months] },
261
+ !props.hideNavigation && !navLayout && (React__default.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : undefined, className: classNames[UI.Nav], style: styles?.[UI.Nav], "aria-label": labelNav(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth: previousMonth, nextMonth: nextMonth })),
262
+ months.map((calendarMonth, displayIndex) => {
263
+ const monthOffset = props.reverseMonths
264
+ ? months.length - 1 - displayIndex
265
+ : displayIndex;
266
+ return (React__default.createElement(components.Month, { "data-animated-month": props.animate ? "true" : undefined, className: classNames[UI.Month], style: styles?.[UI.Month],
267
+ // biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
268
+ key: displayIndex, displayIndex: displayIndex, calendarMonth: calendarMonth },
269
+ navLayout === "around" &&
270
+ !props.hideNavigation &&
271
+ displayIndex === 0 && (React__default.createElement(components.PreviousMonthButton, { type: "button", className: classNames[UI.PreviousMonthButton], style: styles?.[UI.PreviousMonthButton], tabIndex: previousMonth ? undefined : -1, "aria-disabled": previousMonth ? undefined : true, "aria-label": labelPrevious(previousMonth), onClick: handlePreviousClick, "data-animated-button": props.animate ? "true" : undefined },
272
+ React__default.createElement(components.Chevron, { disabled: previousMonth ? undefined : true, className: classNames[UI.Chevron], style: styles?.[UI.Chevron], orientation: props.dir === "rtl" ? "right" : "left" }))),
273
+ React__default.createElement(components.MonthCaption, { "data-animated-caption": props.animate ? "true" : undefined, className: classNames[UI.MonthCaption], style: styles?.[UI.MonthCaption], calendarMonth: calendarMonth, displayIndex: displayIndex }, captionLayout?.startsWith("dropdown") ? (React__default.createElement(components.DropdownNav, { className: classNames[UI.Dropdowns], style: styles?.[UI.Dropdowns] },
274
+ (() => {
275
+ const monthControl = captionLayout === "dropdown" ||
276
+ captionLayout === "dropdown-months" ? (React__default.createElement(components.MonthsDropdown, { key: "month", className: classNames[UI.MonthsDropdown], "aria-label": labelMonthDropdown(), disabled: Boolean(props.disableNavigation), onChange: handleMonthChange(calendarMonth.date, monthOffset), options: getMonthOptions(calendarMonth.date, navStart, navEnd, formatters, dateLib), style: getDropdownStyle(UI.MonthsDropdown), value: dateLib.getMonth(calendarMonth.date) })) : (React__default.createElement("span", { key: "month" }, formatMonthDropdown(calendarMonth.date, dateLib)));
277
+ const yearControl = captionLayout === "dropdown" ||
278
+ captionLayout === "dropdown-years" ? (React__default.createElement(components.YearsDropdown, { key: "year", className: classNames[UI.YearsDropdown], "aria-label": labelYearDropdown(dateLib.options), disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date, monthOffset), options: getYearOptions(navStart, navEnd, formatters, dateLib, Boolean(props.reverseYears)), style: getDropdownStyle(UI.YearsDropdown), value: dateLib.getYear(calendarMonth.date) })) : (React__default.createElement("span", { key: "year" }, formatYearDropdown(calendarMonth.date, dateLib)));
279
+ const controls = dateLib.getMonthYearOrder() === "year-first"
280
+ ? [yearControl, monthControl]
281
+ : [monthControl, yearControl];
282
+ return controls;
283
+ })(),
284
+ React__default.createElement("span", { role: "status", "aria-live": "polite", style: {
285
+ border: 0,
286
+ clip: "rect(0 0 0 0)",
287
+ height: "1px",
288
+ margin: "-1px",
289
+ overflow: "hidden",
290
+ padding: 0,
291
+ position: "absolute",
292
+ width: "1px",
293
+ whiteSpace: "nowrap",
294
+ wordWrap: "normal",
295
+ } }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (React__default.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], style: styles?.[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),
296
+ navLayout === "around" &&
297
+ !props.hideNavigation &&
298
+ displayIndex === numberOfMonths - 1 && (React__default.createElement(components.NextMonthButton, { type: "button", className: classNames[UI.NextMonthButton], style: styles?.[UI.NextMonthButton], tabIndex: nextMonth ? undefined : -1, "aria-disabled": nextMonth ? undefined : true, "aria-label": labelNext(nextMonth), onClick: handleNextClick, "data-animated-button": props.animate ? "true" : undefined },
299
+ React__default.createElement(components.Chevron, { disabled: nextMonth ? undefined : true, className: classNames[UI.Chevron], style: styles?.[UI.Chevron], orientation: props.dir === "rtl" ? "left" : "right" }))),
300
+ displayIndex === numberOfMonths - 1 &&
301
+ navLayout === "after" &&
302
+ !props.hideNavigation && (React__default.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : undefined, className: classNames[UI.Nav], style: styles?.[UI.Nav], "aria-label": labelNav(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth: previousMonth, nextMonth: nextMonth })),
303
+ React__default.createElement(components.MonthGrid, { role: "grid", "aria-multiselectable": mode === "multiple" || mode === "range", "aria-label": labelGrid(calendarMonth.date, dateLib.options, dateLib) ||
304
+ undefined, className: classNames[UI.MonthGrid], style: styles?.[UI.MonthGrid] },
305
+ !props.hideWeekdays && (React__default.createElement(components.Weekdays, { "data-animated-weekdays": props.animate ? "true" : undefined, className: classNames[UI.Weekdays], style: styles?.[UI.Weekdays] },
306
+ showWeekNumber && (React__default.createElement(components.WeekNumberHeader, { "aria-label": labelWeekNumberHeader(dateLib.options), className: classNames[UI.WeekNumberHeader], style: styles?.[UI.WeekNumberHeader], scope: "col" }, formatWeekNumberHeader())),
307
+ weekdays.map((weekday) => (React__default.createElement(components.Weekday, { "aria-label": labelWeekday(weekday, dateLib.options, dateLib), className: classNames[UI.Weekday], key: String(weekday), style: styles?.[UI.Weekday], scope: "col" }, formatWeekdayName(weekday, dateLib.options, dateLib)))))),
308
+ React__default.createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : undefined, className: classNames[UI.Weeks], style: styles?.[UI.Weeks] }, calendarMonth.weeks.map((week) => {
309
+ return (React__default.createElement(components.Week, { className: classNames[UI.Week], key: week.weekNumber, style: styles?.[UI.Week], week: week },
310
+ showWeekNumber && (React__default.createElement(components.WeekNumber, { week: week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber(week.weekNumber, {
311
+ locale,
312
+ }), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber(week.weekNumber, dateLib))),
313
+ week.days.map((day) => {
314
+ const { date } = day;
315
+ const modifiers = getModifiers(day);
316
+ modifiers[DayFlag.focused] =
317
+ !modifiers.hidden &&
318
+ Boolean(focused?.isEqualTo(day));
319
+ modifiers[SelectionState.selected] =
320
+ isSelected?.(date) || modifiers.selected;
321
+ if (isDateRange(selectedValue)) {
322
+ // add range modifiers
323
+ const { from, to } = selectedValue;
324
+ modifiers[SelectionState.range_start] = Boolean(from && to && dateLib.isSameDay(date, from));
325
+ modifiers[SelectionState.range_end] = Boolean(from && to && dateLib.isSameDay(date, to));
326
+ modifiers[SelectionState.range_middle] =
327
+ rangeIncludesDate(selectedValue, date, true, dateLib);
328
+ }
329
+ const style = getStyleForModifiers(modifiers, styles, props.modifiersStyles);
330
+ const className = getClassNamesForModifiers(modifiers, classNames, props.modifiersClassNames);
331
+ const ariaLabel = !isInteractive && !modifiers.hidden
332
+ ? labelGridcell(date, modifiers, dateLib.options, dateLib)
333
+ : undefined;
334
+ return (React__default.createElement(components.Day, { key: `${day.isoDate}_${day.displayMonthId}`, day: day, modifiers: modifiers, className: className.join(" "), style: style, role: "gridcell", "aria-selected": modifiers.selected || undefined, "aria-label": ariaLabel, "data-day": day.isoDate, "data-month": day.outside ? day.dateMonthId : undefined, "data-selected": modifiers.selected || undefined, "data-disabled": modifiers.disabled || undefined, "data-hidden": modifiers.hidden || undefined, "data-outside": day.outside || undefined, "data-focused": modifiers.focused || undefined, "data-today": modifiers.today || undefined }, !modifiers.hidden && isInteractive ? (React__default.createElement(components.DayButton, { className: classNames[UI.DayButton], style: styles?.[UI.DayButton], type: "button", day: day, modifiers: modifiers, disabled: (!modifiers.focused &&
335
+ modifiers.disabled) ||
336
+ undefined, "aria-disabled": (modifiers.focused &&
337
+ modifiers.disabled) ||
338
+ undefined, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay(date, dateLib.options, dateLib))) : (!modifiers.hidden &&
339
+ formatDay(day.date, dateLib.options, dateLib))));
340
+ })));
341
+ })))));
342
+ })),
343
+ props.footer && (React__default.createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)))));
344
+ }
345
+
346
+ export { DayPicker };