@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,189 @@
1
+ import { buildLocalizeFn } from '../../_lib/buildLocalizeFn.js';
2
+
3
+ const eraValues = {
4
+ narrow: ["B", "A"],
5
+ abbreviated: ["BC", "AD"],
6
+ wide: ["Before Christ", "Anno Domini"],
7
+ };
8
+
9
+ const quarterValues = {
10
+ narrow: ["1", "2", "3", "4"],
11
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
12
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"],
13
+ };
14
+
15
+ // Note: in English, the names of days of the week and months are capitalized.
16
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
17
+ // Generally, formatted dates should look like they are in the middle of a sentence,
18
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
19
+ const monthValues = {
20
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
21
+ abbreviated: [
22
+ "Jan",
23
+ "Feb",
24
+ "Mar",
25
+ "Apr",
26
+ "May",
27
+ "Jun",
28
+ "Jul",
29
+ "Aug",
30
+ "Sep",
31
+ "Oct",
32
+ "Nov",
33
+ "Dec",
34
+ ],
35
+
36
+ wide: [
37
+ "January",
38
+ "February",
39
+ "March",
40
+ "April",
41
+ "May",
42
+ "June",
43
+ "July",
44
+ "August",
45
+ "September",
46
+ "October",
47
+ "November",
48
+ "December",
49
+ ],
50
+ };
51
+
52
+ const dayValues = {
53
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
54
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
55
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
56
+ wide: [
57
+ "Sunday",
58
+ "Monday",
59
+ "Tuesday",
60
+ "Wednesday",
61
+ "Thursday",
62
+ "Friday",
63
+ "Saturday",
64
+ ],
65
+ };
66
+
67
+ const dayPeriodValues = {
68
+ narrow: {
69
+ am: "a",
70
+ pm: "p",
71
+ midnight: "mi",
72
+ noon: "n",
73
+ morning: "morning",
74
+ afternoon: "afternoon",
75
+ evening: "evening",
76
+ night: "night",
77
+ },
78
+ abbreviated: {
79
+ am: "AM",
80
+ pm: "PM",
81
+ midnight: "midnight",
82
+ noon: "noon",
83
+ morning: "morning",
84
+ afternoon: "afternoon",
85
+ evening: "evening",
86
+ night: "night",
87
+ },
88
+ wide: {
89
+ am: "a.m.",
90
+ pm: "p.m.",
91
+ midnight: "midnight",
92
+ noon: "noon",
93
+ morning: "morning",
94
+ afternoon: "afternoon",
95
+ evening: "evening",
96
+ night: "night",
97
+ },
98
+ };
99
+
100
+ const formattingDayPeriodValues = {
101
+ narrow: {
102
+ am: "a",
103
+ pm: "p",
104
+ midnight: "mi",
105
+ noon: "n",
106
+ morning: "in the morning",
107
+ afternoon: "in the afternoon",
108
+ evening: "in the evening",
109
+ night: "at night",
110
+ },
111
+ abbreviated: {
112
+ am: "AM",
113
+ pm: "PM",
114
+ midnight: "midnight",
115
+ noon: "noon",
116
+ morning: "in the morning",
117
+ afternoon: "in the afternoon",
118
+ evening: "in the evening",
119
+ night: "at night",
120
+ },
121
+ wide: {
122
+ am: "a.m.",
123
+ pm: "p.m.",
124
+ midnight: "midnight",
125
+ noon: "noon",
126
+ morning: "in the morning",
127
+ afternoon: "in the afternoon",
128
+ evening: "in the evening",
129
+ night: "at night",
130
+ },
131
+ };
132
+
133
+ const ordinalNumber = (dirtyNumber, _options) => {
134
+ const number = Number(dirtyNumber);
135
+
136
+ // If ordinal numbers depend on context, for example,
137
+ // if they are different for different grammatical genders,
138
+ // use `options.unit`.
139
+ //
140
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
141
+ // 'day', 'hour', 'minute', 'second'.
142
+
143
+ const rem100 = number % 100;
144
+ if (rem100 > 20 || rem100 < 10) {
145
+ switch (rem100 % 10) {
146
+ case 1:
147
+ return number + "st";
148
+ case 2:
149
+ return number + "nd";
150
+ case 3:
151
+ return number + "rd";
152
+ }
153
+ }
154
+ return number + "th";
155
+ };
156
+
157
+ const localize = {
158
+ ordinalNumber,
159
+
160
+ era: buildLocalizeFn({
161
+ values: eraValues,
162
+ defaultWidth: "wide",
163
+ }),
164
+
165
+ quarter: buildLocalizeFn({
166
+ values: quarterValues,
167
+ defaultWidth: "wide",
168
+ argumentCallback: (quarter) => quarter - 1,
169
+ }),
170
+
171
+ month: buildLocalizeFn({
172
+ values: monthValues,
173
+ defaultWidth: "wide",
174
+ }),
175
+
176
+ day: buildLocalizeFn({
177
+ values: dayValues,
178
+ defaultWidth: "wide",
179
+ }),
180
+
181
+ dayPeriod: buildLocalizeFn({
182
+ values: dayPeriodValues,
183
+ defaultWidth: "wide",
184
+ formattingValues: formattingDayPeriodValues,
185
+ defaultFormattingWidth: "wide",
186
+ }),
187
+ };
188
+
189
+ export { localize };
@@ -0,0 +1,134 @@
1
+ import { buildMatchFn } from '../../_lib/buildMatchFn.js';
2
+ import { buildMatchPatternFn } from '../../_lib/buildMatchPatternFn.js';
3
+
4
+ const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
5
+ const parseOrdinalNumberPattern = /\d+/i;
6
+
7
+ const matchEraPatterns = {
8
+ narrow: /^(b|a)/i,
9
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
10
+ wide: /^(before christ|before common era|anno domini|common era)/i,
11
+ };
12
+ const parseEraPatterns = {
13
+ any: [/^b/i, /^(a|c)/i],
14
+ };
15
+
16
+ const matchQuarterPatterns = {
17
+ narrow: /^[1234]/i,
18
+ abbreviated: /^q[1234]/i,
19
+ wide: /^[1234](th|st|nd|rd)? quarter/i,
20
+ };
21
+ const parseQuarterPatterns = {
22
+ any: [/1/i, /2/i, /3/i, /4/i],
23
+ };
24
+
25
+ const matchMonthPatterns = {
26
+ narrow: /^[jfmasond]/i,
27
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
28
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,
29
+ };
30
+ const parseMonthPatterns = {
31
+ narrow: [
32
+ /^j/i,
33
+ /^f/i,
34
+ /^m/i,
35
+ /^a/i,
36
+ /^m/i,
37
+ /^j/i,
38
+ /^j/i,
39
+ /^a/i,
40
+ /^s/i,
41
+ /^o/i,
42
+ /^n/i,
43
+ /^d/i,
44
+ ],
45
+
46
+ any: [
47
+ /^ja/i,
48
+ /^f/i,
49
+ /^mar/i,
50
+ /^ap/i,
51
+ /^may/i,
52
+ /^jun/i,
53
+ /^jul/i,
54
+ /^au/i,
55
+ /^s/i,
56
+ /^o/i,
57
+ /^n/i,
58
+ /^d/i,
59
+ ],
60
+ };
61
+
62
+ const matchDayPatterns = {
63
+ narrow: /^[smtwf]/i,
64
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
65
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
66
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,
67
+ };
68
+ const parseDayPatterns = {
69
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
70
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
71
+ };
72
+
73
+ const matchDayPeriodPatterns = {
74
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
75
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,
76
+ };
77
+ const parseDayPeriodPatterns = {
78
+ any: {
79
+ am: /^a/i,
80
+ pm: /^p/i,
81
+ midnight: /^mi/i,
82
+ noon: /^no/i,
83
+ morning: /morning/i,
84
+ afternoon: /afternoon/i,
85
+ evening: /evening/i,
86
+ night: /night/i,
87
+ },
88
+ };
89
+
90
+ const match = {
91
+ ordinalNumber: buildMatchPatternFn({
92
+ matchPattern: matchOrdinalNumberPattern,
93
+ parsePattern: parseOrdinalNumberPattern,
94
+ valueCallback: (value) => parseInt(value, 10),
95
+ }),
96
+
97
+ era: buildMatchFn({
98
+ matchPatterns: matchEraPatterns,
99
+ defaultMatchWidth: "wide",
100
+ parsePatterns: parseEraPatterns,
101
+ defaultParseWidth: "any",
102
+ }),
103
+
104
+ quarter: buildMatchFn({
105
+ matchPatterns: matchQuarterPatterns,
106
+ defaultMatchWidth: "wide",
107
+ parsePatterns: parseQuarterPatterns,
108
+ defaultParseWidth: "any",
109
+ valueCallback: (index) => index + 1,
110
+ }),
111
+
112
+ month: buildMatchFn({
113
+ matchPatterns: matchMonthPatterns,
114
+ defaultMatchWidth: "wide",
115
+ parsePatterns: parseMonthPatterns,
116
+ defaultParseWidth: "any",
117
+ }),
118
+
119
+ day: buildMatchFn({
120
+ matchPatterns: matchDayPatterns,
121
+ defaultMatchWidth: "wide",
122
+ parsePatterns: parseDayPatterns,
123
+ defaultParseWidth: "any",
124
+ }),
125
+
126
+ dayPeriod: buildMatchFn({
127
+ matchPatterns: matchDayPeriodPatterns,
128
+ defaultMatchWidth: "any",
129
+ parsePatterns: parseDayPeriodPatterns,
130
+ defaultParseWidth: "any",
131
+ }),
132
+ };
133
+
134
+ export { match };
@@ -0,0 +1,28 @@
1
+ import { formatDistance } from './en-US/_lib/formatDistance.js';
2
+ import { formatLong } from './en-US/_lib/formatLong.js';
3
+ import { formatRelative } from './en-US/_lib/formatRelative.js';
4
+ import { localize } from './en-US/_lib/localize.js';
5
+ import { match } from './en-US/_lib/match.js';
6
+
7
+ /**
8
+ * @category Locales
9
+ * @summary English locale (United States).
10
+ * @language English
11
+ * @iso-639-2 eng
12
+ * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
13
+ * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
14
+ */
15
+ const enUS = {
16
+ code: "en-US",
17
+ formatDistance: formatDistance,
18
+ formatLong: formatLong,
19
+ formatRelative: formatRelative,
20
+ localize: localize,
21
+ match: match,
22
+ options: {
23
+ weekStartsOn: 0 /* Sunday */,
24
+ firstWeekContainsDate: 1,
25
+ },
26
+ };
27
+
28
+ export { enUS };
@@ -0,0 +1,49 @@
1
+ import { constructFrom } from './constructFrom.js';
2
+ import { toDate } from './toDate.js';
3
+
4
+ /**
5
+ * The {@link max} function options.
6
+ */
7
+
8
+ /**
9
+ * @name max
10
+ * @category Common Helpers
11
+ * @summary Return the latest of the given dates.
12
+ *
13
+ * @description
14
+ * Return the latest of the given dates.
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 dates - The dates to compare
20
+ *
21
+ * @returns The latest of the dates
22
+ *
23
+ * @example
24
+ * // Which of these dates is the latest?
25
+ * const result = max([
26
+ * new Date(1989, 6, 10),
27
+ * new Date(1987, 1, 11),
28
+ * new Date(1995, 6, 2),
29
+ * new Date(1990, 0, 1)
30
+ * ])
31
+ * //=> Sun Jul 02 1995 00:00:00
32
+ */
33
+ function max(dates, options) {
34
+ let result;
35
+ let context = options?.in;
36
+
37
+ dates.forEach((date) => {
38
+ // Use the first date object as the context function
39
+ if (!context && typeof date === "object")
40
+ context = constructFrom.bind(null, date);
41
+
42
+ const date_ = toDate(date, context);
43
+ if (!result || result < date_ || isNaN(+date_)) result = date_;
44
+ });
45
+
46
+ return constructFrom(context, result || NaN);
47
+ }
48
+
49
+ export { max };
@@ -0,0 +1,49 @@
1
+ import { constructFrom } from './constructFrom.js';
2
+ import { toDate } from './toDate.js';
3
+
4
+ /**
5
+ * The {@link min} function options.
6
+ */
7
+
8
+ /**
9
+ * @name min
10
+ * @category Common Helpers
11
+ * @summary Returns the earliest of the given dates.
12
+ *
13
+ * @description
14
+ * Returns the earliest of the given dates.
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 dates - The dates to compare
20
+ *
21
+ * @returns The earliest of the dates
22
+ *
23
+ * @example
24
+ * // Which of these dates is the earliest?
25
+ * const result = min([
26
+ * new Date(1989, 6, 10),
27
+ * new Date(1987, 1, 11),
28
+ * new Date(1995, 6, 2),
29
+ * new Date(1990, 0, 1)
30
+ * ])
31
+ * //=> Wed Feb 11 1987 00:00:00
32
+ */
33
+ function min(dates, options) {
34
+ let result;
35
+ let context = options?.in;
36
+
37
+ dates.forEach((date) => {
38
+ // Use the first date object as the context function
39
+ if (!context && typeof date === "object")
40
+ context = constructFrom.bind(null, date);
41
+
42
+ const date_ = toDate(date, context);
43
+ if (!result || result > date_ || isNaN(+date_)) result = date_;
44
+ });
45
+
46
+ return constructFrom(context, result || NaN);
47
+ }
48
+
49
+ export { min };
@@ -0,0 +1,46 @@
1
+ import { constructFrom } from './constructFrom.js';
2
+ import { getDaysInMonth } from './getDaysInMonth.js';
3
+ import { toDate } from './toDate.js';
4
+
5
+ /**
6
+ * The {@link setMonth} function options.
7
+ */
8
+
9
+ /**
10
+ * @name setMonth
11
+ * @category Month Helpers
12
+ * @summary Set the month to the given date.
13
+ *
14
+ * @description
15
+ * Set the month to the given date.
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 date to be changed
21
+ * @param month - The month index to set (0-11)
22
+ * @param options - The options
23
+ *
24
+ * @returns The new date with the month set
25
+ *
26
+ * @example
27
+ * // Set February to 1 September 2014:
28
+ * const result = setMonth(new Date(2014, 8, 1), 1)
29
+ * //=> Sat Feb 01 2014 00:00:00
30
+ */
31
+ function setMonth(date, month, options) {
32
+ const _date = toDate(date, options?.in);
33
+ const year = _date.getFullYear();
34
+ const day = _date.getDate();
35
+
36
+ const midMonth = constructFrom(date, 0);
37
+ midMonth.setFullYear(year, month, 15);
38
+ midMonth.setHours(0, 0, 0, 0);
39
+ const daysInMonth = getDaysInMonth(midMonth);
40
+
41
+ // Set the earlier date, allows to wrap Jan 31 to Feb 28
42
+ _date.setMonth(month, Math.min(day, daysInMonth));
43
+ return _date;
44
+ }
45
+
46
+ export { setMonth };
@@ -0,0 +1,40 @@
1
+ import { constructFrom } from './constructFrom.js';
2
+ import { toDate } from './toDate.js';
3
+
4
+ /**
5
+ * The {@link setYear} function options.
6
+ */
7
+
8
+ /**
9
+ * @name setYear
10
+ * @category Year Helpers
11
+ * @summary Set the year to the given date.
12
+ *
13
+ * @description
14
+ * Set the year to the given date.
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 date to be changed
20
+ * @param year - The year of the new date
21
+ * @param options - An object with options.
22
+ *
23
+ * @returns The new date with the year set
24
+ *
25
+ * @example
26
+ * // Set year 2013 to 1 September 2014:
27
+ * const result = setYear(new Date(2014, 8, 1), 2013)
28
+ * //=> Sun Sep 01 2013 00:00:00
29
+ */
30
+ function setYear(date, year, options) {
31
+ const date_ = toDate(date, options?.in);
32
+
33
+ // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
34
+ if (isNaN(+date_)) return constructFrom(date, NaN);
35
+
36
+ date_.setFullYear(year);
37
+ return date_;
38
+ }
39
+
40
+ export { setYear };
@@ -0,0 +1,35 @@
1
+ import { toDate } from './toDate.js';
2
+
3
+ /**
4
+ * The {@link startOfDay} function options.
5
+ */
6
+
7
+ /**
8
+ * @name startOfDay
9
+ * @category Day Helpers
10
+ * @summary Return the start of a day for the given date.
11
+ *
12
+ * @description
13
+ * Return the start of a day 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 day
23
+ *
24
+ * @example
25
+ * // The start of a day for 2 September 2014 11:55:00:
26
+ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
27
+ * //=> Tue Sep 02 2014 00:00:00
28
+ */
29
+ function startOfDay(date, options) {
30
+ const _date = toDate(date, options?.in);
31
+ _date.setHours(0, 0, 0, 0);
32
+ return _date;
33
+ }
34
+
35
+ export { startOfDay };
@@ -0,0 +1,35 @@
1
+ import { startOfWeek } from './startOfWeek.js';
2
+
3
+ /**
4
+ * The {@link startOfISOWeek} function options.
5
+ */
6
+
7
+ /**
8
+ * @name startOfISOWeek
9
+ * @category ISO Week Helpers
10
+ * @summary Return the start of an ISO week for the given date.
11
+ *
12
+ * @description
13
+ * Return the start of an ISO week for the given date.
14
+ * The result will be in the local timezone.
15
+ *
16
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
17
+ *
18
+ * @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).
19
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
20
+ *
21
+ * @param date - The original date
22
+ * @param options - An object with options
23
+ *
24
+ * @returns The start of an ISO week
25
+ *
26
+ * @example
27
+ * // The start of an ISO week for 2 September 2014 11:55:00:
28
+ * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
29
+ * //=> Mon Sep 01 2014 00:00:00
30
+ */
31
+ function startOfISOWeek(date, options) {
32
+ return startOfWeek(date, { ...options, weekStartsOn: 1 });
33
+ }
34
+
35
+ export { startOfISOWeek };
@@ -0,0 +1,42 @@
1
+ import { constructFrom } from './constructFrom.js';
2
+ import { getISOWeekYear } from './getISOWeekYear.js';
3
+ import { startOfISOWeek } from './startOfISOWeek.js';
4
+
5
+ /**
6
+ * The {@link startOfISOWeekYear} function options.
7
+ */
8
+
9
+ /**
10
+ * @name startOfISOWeekYear
11
+ * @category ISO Week-Numbering Year Helpers
12
+ * @summary Return the start of an ISO week-numbering year for the given date.
13
+ *
14
+ * @description
15
+ * Return the start of an ISO week-numbering year,
16
+ * which always starts 3 days before the year's first Thursday.
17
+ * The result will be in the local timezone.
18
+ *
19
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
20
+ *
21
+ * @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).
22
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
23
+ *
24
+ * @param date - The original date
25
+ * @param options - An object with options
26
+ *
27
+ * @returns The start of an ISO week-numbering year
28
+ *
29
+ * @example
30
+ * // The start of an ISO week-numbering year for 2 July 2005:
31
+ * const result = startOfISOWeekYear(new Date(2005, 6, 2))
32
+ * //=> Mon Jan 03 2005 00:00:00
33
+ */
34
+ function startOfISOWeekYear(date, options) {
35
+ const year = getISOWeekYear(date, options);
36
+ const fourthOfJanuary = constructFrom(date, 0);
37
+ fourthOfJanuary.setFullYear(year, 0, 4);
38
+ fourthOfJanuary.setHours(0, 0, 0, 0);
39
+ return startOfISOWeek(fourthOfJanuary);
40
+ }
41
+
42
+ export { startOfISOWeekYear };
@@ -0,0 +1,37 @@
1
+ import { toDate } from './toDate.js';
2
+
3
+ /**
4
+ * The {@link startOfMonth} function options.
5
+ */
6
+
7
+ /**
8
+ * @name startOfMonth
9
+ * @category Month Helpers
10
+ * @summary Return the start of a month for the given date.
11
+ *
12
+ * @description
13
+ * Return the start of a month for the given date. The result will be in the local timezone.
14
+ *
15
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments.
16
+ * 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,
18
+ * 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 month
24
+ *
25
+ * @example
26
+ * // The start of a month for 2 September 2014 11:55:00:
27
+ * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
28
+ * //=> Mon Sep 01 2014 00:00:00
29
+ */
30
+ function startOfMonth(date, options) {
31
+ const _date = toDate(date, options?.in);
32
+ _date.setDate(1);
33
+ _date.setHours(0, 0, 0, 0);
34
+ return _date;
35
+ }
36
+
37
+ export { startOfMonth };