@coopdigital/react 0.49.1 → 0.51.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 (299) hide show
  1. package/dist/components/Button/Button.js +2 -2
  2. package/dist/components/Button/index.js +5 -0
  3. package/dist/components/Card/Card.js +4 -4
  4. package/dist/components/Checkbox/Checkbox.d.ts +7 -1
  5. package/dist/components/Checkbox/Checkbox.js +4 -0
  6. package/dist/components/DatePicker/DatePicker.d.ts +61 -0
  7. package/dist/components/DatePicker/DatePicker.js +135 -0
  8. package/dist/components/DatePicker/datepicker-utils.d.ts +68 -0
  9. package/dist/components/DatePicker/datepicker-utils.js +215 -0
  10. package/dist/components/DatePicker/index.d.ts +4 -0
  11. package/dist/components/Field/Field.js +29 -26
  12. package/dist/components/Field/index.js +6 -0
  13. package/dist/components/Pill/Pill.js +2 -2
  14. package/dist/components/Popover/Popover.d.ts +74 -0
  15. package/dist/components/Popover/Popover.js +75 -0
  16. package/dist/components/Popover/index.d.ts +4 -0
  17. package/dist/components/Popover/index.js +5 -0
  18. package/dist/components/Radio/Radio.d.ts +7 -1
  19. package/dist/components/Radio/Radio.js +4 -0
  20. package/dist/components/Searchbox/Searchbox.js +4 -3
  21. package/dist/components/Select/Select.d.ts +3 -0
  22. package/dist/components/Select/Select.js +4 -1
  23. package/dist/components/Signpost/Signpost.js +2 -2
  24. package/dist/components/Tag/Tag.js +2 -2
  25. package/dist/components/TextInput/TextInput.d.ts +6 -1
  26. package/dist/components/TextInput/TextInput.js +3 -0
  27. package/dist/components/Textarea/Textarea.d.ts +8 -5
  28. package/dist/components/Textarea/Textarea.js +5 -4
  29. package/dist/hooks/useSlots.js +3 -3
  30. package/dist/index.d.ts +2 -0
  31. package/dist/index.js +2 -0
  32. package/dist/node_modules/@date-fns/tz/date/index.js +83 -0
  33. package/dist/node_modules/@date-fns/tz/date/mini.js +235 -0
  34. package/dist/node_modules/@date-fns/tz/tzName/index.js +39 -0
  35. package/dist/node_modules/@date-fns/tz/tzOffset/index.js +44 -0
  36. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +814 -0
  37. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +751 -0
  38. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +350 -0
  39. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +161 -0
  40. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +137 -0
  41. package/dist/node_modules/@radix-ui/primitive/dist/index.js +11 -0
  42. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +25 -0
  43. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +39 -0
  44. package/dist/node_modules/@radix-ui/react-context/dist/index.js +63 -0
  45. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +213 -0
  46. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +31 -0
  47. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +209 -0
  48. package/dist/node_modules/@radix-ui/react-id/dist/index.js +15 -0
  49. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +303 -0
  50. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +285 -0
  51. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +19 -0
  52. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +132 -0
  53. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +43 -0
  54. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +89 -0
  55. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +12 -0
  56. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +70 -0
  57. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +18 -0
  58. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
  59. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +40 -0
  60. package/dist/node_modules/aria-hidden/dist/es2015/index.js +137 -0
  61. package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +7 -0
  62. package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
  63. package/dist/node_modules/date-fns/_lib/format/formatters.js +775 -0
  64. package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +94 -0
  65. package/dist/node_modules/date-fns/_lib/format/longFormatters.js +66 -0
  66. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +31 -0
  67. package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
  68. package/dist/node_modules/date-fns/_lib/normalizeInterval.js +8 -0
  69. package/dist/node_modules/date-fns/_lib/protectedTokens.js +25 -0
  70. package/dist/node_modules/date-fns/addDays.js +41 -0
  71. package/dist/node_modules/date-fns/addMonths.js +75 -0
  72. package/dist/node_modules/date-fns/addWeeks.js +33 -0
  73. package/dist/node_modules/date-fns/addYears.js +33 -0
  74. package/dist/node_modules/date-fns/constants.js +67 -0
  75. package/dist/node_modules/date-fns/constructFrom.js +49 -0
  76. package/dist/node_modules/date-fns/differenceInCalendarDays.js +62 -0
  77. package/dist/node_modules/date-fns/differenceInCalendarMonths.js +42 -0
  78. package/dist/node_modules/date-fns/eachMonthOfInterval.js +65 -0
  79. package/dist/node_modules/date-fns/eachYearOfInterval.js +65 -0
  80. package/dist/node_modules/date-fns/endOfISOWeek.js +35 -0
  81. package/dist/node_modules/date-fns/endOfMonth.js +37 -0
  82. package/dist/node_modules/date-fns/endOfWeek.js +53 -0
  83. package/dist/node_modules/date-fns/endOfYear.js +37 -0
  84. package/dist/node_modules/date-fns/format.js +423 -0
  85. package/dist/node_modules/date-fns/getDayOfYear.js +34 -0
  86. package/dist/node_modules/date-fns/getDaysInMonth.js +36 -0
  87. package/dist/node_modules/date-fns/getDefaultOptions.js +31 -0
  88. package/dist/node_modules/date-fns/getISODay.js +33 -0
  89. package/dist/node_modules/date-fns/getISOWeek.js +40 -0
  90. package/dist/node_modules/date-fns/getISOWeekYear.js +52 -0
  91. package/dist/node_modules/date-fns/getMonth.js +29 -0
  92. package/dist/node_modules/date-fns/getWeek.js +54 -0
  93. package/dist/node_modules/date-fns/getWeekYear.js +75 -0
  94. package/dist/node_modules/date-fns/getYear.js +29 -0
  95. package/dist/node_modules/date-fns/isAfter.js +25 -0
  96. package/dist/node_modules/date-fns/isBefore.js +25 -0
  97. package/dist/node_modules/date-fns/isDate.js +41 -0
  98. package/dist/node_modules/date-fns/isSameDay.js +46 -0
  99. package/dist/node_modules/date-fns/isSameMonth.js +43 -0
  100. package/dist/node_modules/date-fns/isSameYear.js +35 -0
  101. package/dist/node_modules/date-fns/isValid.js +39 -0
  102. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +10 -0
  103. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +64 -0
  104. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +59 -0
  105. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +22 -0
  106. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +103 -0
  107. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +41 -0
  108. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +13 -0
  109. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +189 -0
  110. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +134 -0
  111. package/dist/node_modules/date-fns/locale/en-US.js +28 -0
  112. package/dist/node_modules/date-fns/max.js +49 -0
  113. package/dist/node_modules/date-fns/min.js +49 -0
  114. package/dist/node_modules/date-fns/parse/_lib/Parser.js +27 -0
  115. package/dist/node_modules/date-fns/parse/_lib/Setter.js +59 -0
  116. package/dist/node_modules/date-fns/parse/_lib/constants.js +33 -0
  117. package/dist/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js +55 -0
  118. package/dist/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js +55 -0
  119. package/dist/node_modules/date-fns/parse/_lib/parsers/DateParser.js +59 -0
  120. package/dist/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js +57 -0
  121. package/dist/node_modules/date-fns/parse/_lib/parsers/DayParser.js +64 -0
  122. package/dist/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js +56 -0
  123. package/dist/node_modules/date-fns/parse/_lib/parsers/EraParser.js +41 -0
  124. package/dist/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js +24 -0
  125. package/dist/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js +21 -0
  126. package/dist/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js +36 -0
  127. package/dist/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js +31 -0
  128. package/dist/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js +32 -0
  129. package/dist/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js +38 -0
  130. package/dist/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js +118 -0
  131. package/dist/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js +47 -0
  132. package/dist/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js +47 -0
  133. package/dist/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js +48 -0
  134. package/dist/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js +44 -0
  135. package/dist/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js +96 -0
  136. package/dist/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js +47 -0
  137. package/dist/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js +76 -0
  138. package/dist/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js +31 -0
  139. package/dist/node_modules/date-fns/parse/_lib/parsers/MonthParser.js +86 -0
  140. package/dist/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js +83 -0
  141. package/dist/node_modules/date-fns/parse/_lib/parsers/SecondParser.js +31 -0
  142. package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js +97 -0
  143. package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js +86 -0
  144. package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js +83 -0
  145. package/dist/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js +19 -0
  146. package/dist/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js +19 -0
  147. package/dist/node_modules/date-fns/parse/_lib/parsers/YearParser.js +62 -0
  148. package/dist/node_modules/date-fns/parse/_lib/parsers.js +110 -0
  149. package/dist/node_modules/date-fns/parse/_lib/utils.js +135 -0
  150. package/dist/node_modules/date-fns/parse.js +497 -0
  151. package/dist/node_modules/date-fns/setDay.js +59 -0
  152. package/dist/node_modules/date-fns/setISODay.js +40 -0
  153. package/dist/node_modules/date-fns/setISOWeek.js +39 -0
  154. package/dist/node_modules/date-fns/setMonth.js +46 -0
  155. package/dist/node_modules/date-fns/setWeek.js +53 -0
  156. package/dist/node_modules/date-fns/setYear.js +40 -0
  157. package/dist/node_modules/date-fns/startOfDay.js +35 -0
  158. package/dist/node_modules/date-fns/startOfISOWeek.js +35 -0
  159. package/dist/node_modules/date-fns/startOfISOWeekYear.js +42 -0
  160. package/dist/node_modules/date-fns/startOfMonth.js +37 -0
  161. package/dist/node_modules/date-fns/startOfWeek.js +53 -0
  162. package/dist/node_modules/date-fns/startOfWeekYear.js +64 -0
  163. package/dist/node_modules/date-fns/startOfYear.js +36 -0
  164. package/dist/node_modules/date-fns/toDate.js +46 -0
  165. package/dist/node_modules/date-fns/transpose.js +52 -0
  166. package/dist/node_modules/get-nonce/dist/es2015/index.js +8 -0
  167. package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +320 -0
  168. package/dist/node_modules/react-day-picker/dist/esm/UI.js +122 -0
  169. package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js +33 -0
  170. package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js +14 -0
  171. package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js +13 -0
  172. package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +604 -0
  173. package/dist/node_modules/react-day-picker/dist/esm/components/Button.js +13 -0
  174. package/dist/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js +13 -0
  175. package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js +20 -0
  176. package/dist/node_modules/react-day-picker/dist/esm/components/Day.js +18 -0
  177. package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js +19 -0
  178. package/dist/node_modules/react-day-picker/dist/esm/components/Dropdown.js +21 -0
  179. package/dist/node_modules/react-day-picker/dist/esm/components/DropdownNav.js +13 -0
  180. package/dist/node_modules/react-day-picker/dist/esm/components/Footer.js +13 -0
  181. package/dist/node_modules/react-day-picker/dist/esm/components/Month.js +15 -0
  182. package/dist/node_modules/react-day-picker/dist/esm/components/MonthCaption.js +14 -0
  183. package/dist/node_modules/react-day-picker/dist/esm/components/MonthGrid.js +13 -0
  184. package/dist/node_modules/react-day-picker/dist/esm/components/Months.js +13 -0
  185. package/dist/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js +15 -0
  186. package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js +31 -0
  187. package/dist/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js +15 -0
  188. package/dist/node_modules/react-day-picker/dist/esm/components/Option.js +13 -0
  189. package/dist/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js +15 -0
  190. package/dist/node_modules/react-day-picker/dist/esm/components/Root.js +14 -0
  191. package/dist/node_modules/react-day-picker/dist/esm/components/Select.js +13 -0
  192. package/dist/node_modules/react-day-picker/dist/esm/components/Week.js +14 -0
  193. package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumber.js +14 -0
  194. package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js +13 -0
  195. package/dist/node_modules/react-day-picker/dist/esm/components/Weekday.js +13 -0
  196. package/dist/node_modules/react-day-picker/dist/esm/components/Weekdays.js +14 -0
  197. package/dist/node_modules/react-day-picker/dist/esm/components/Weeks.js +13 -0
  198. package/dist/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js +15 -0
  199. package/dist/node_modules/react-day-picker/dist/esm/components/custom-components.js +26 -0
  200. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +26 -0
  201. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatDay.js +19 -0
  202. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js +18 -0
  203. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js +21 -0
  204. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js +13 -0
  205. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js +19 -0
  206. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js +23 -0
  207. package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js +7 -0
  208. package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js +73 -0
  209. package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +95 -0
  210. package/dist/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js +22 -0
  211. package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +28 -0
  212. package/dist/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js +33 -0
  213. package/dist/node_modules/react-day-picker/dist/esm/helpers/getComponents.js +20 -0
  214. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js +27 -0
  215. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js +59 -0
  216. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js +19 -0
  217. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js +33 -0
  218. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js +24 -0
  219. package/dist/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js +46 -0
  220. package/dist/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js +24 -0
  221. package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +27 -0
  222. package/dist/node_modules/react-day-picker/dist/esm/helpers/getLabels.js +53 -0
  223. package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js +33 -0
  224. package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js +69 -0
  225. package/dist/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js +51 -0
  226. package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js +40 -0
  227. package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js +36 -0
  228. package/dist/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js +37 -0
  229. package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js +27 -0
  230. package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js +26 -0
  231. package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +14 -0
  232. package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +36 -0
  233. package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +27 -0
  234. package/dist/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js +31 -0
  235. package/dist/node_modules/react-day-picker/dist/esm/labels/index.js +11 -0
  236. package/dist/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js +32 -0
  237. package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +25 -0
  238. package/dist/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js +22 -0
  239. package/dist/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +14 -0
  240. package/dist/node_modules/react-day-picker/dist/esm/labels/labelNav.js +13 -0
  241. package/dist/node_modules/react-day-picker/dist/esm/labels/labelNext.js +16 -0
  242. package/dist/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +15 -0
  243. package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +15 -0
  244. package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +14 -0
  245. package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js +18 -0
  246. package/dist/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +14 -0
  247. package/dist/node_modules/react-day-picker/dist/esm/locale/en-US.js +67 -0
  248. package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js +57 -0
  249. package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js +45 -0
  250. package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js +44 -0
  251. package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js +174 -0
  252. package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +113 -0
  253. package/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js +25 -0
  254. package/dist/node_modules/react-day-picker/dist/esm/useFocus.js +56 -0
  255. package/dist/node_modules/react-day-picker/dist/esm/useSelection.js +31 -0
  256. package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js +95 -0
  257. package/dist/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js +57 -0
  258. package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js +62 -0
  259. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js +30 -0
  260. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js +74 -0
  261. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js +35 -0
  262. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js +21 -0
  263. package/dist/node_modules/react-day-picker/dist/esm/utils/toTimeZone.js +16 -0
  264. package/dist/node_modules/react-day-picker/dist/esm/utils/typeguards.js +66 -0
  265. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +9 -0
  266. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +167 -0
  267. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +38 -0
  268. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +21 -0
  269. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +110 -0
  270. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
  271. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
  272. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +56 -0
  273. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +10 -0
  274. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +31 -0
  275. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +19 -0
  276. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +25 -0
  277. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +51 -0
  278. package/dist/node_modules/tslib/tslib.es6.js +56 -0
  279. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +24 -0
  280. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +48 -0
  281. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +42 -0
  282. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +21 -0
  283. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +77 -0
  284. package/dist/types/index.d.ts +10 -0
  285. package/package.json +11 -7
  286. package/src/components/Checkbox/Checkbox.tsx +6 -1
  287. package/src/components/DatePicker/DatePicker.tsx +372 -0
  288. package/src/components/DatePicker/datepicker-utils.ts +269 -0
  289. package/src/components/DatePicker/index.ts +5 -0
  290. package/src/components/Field/Field.tsx +30 -28
  291. package/src/components/Popover/Popover.tsx +198 -0
  292. package/src/components/Popover/index.ts +5 -0
  293. package/src/components/Radio/Radio.tsx +6 -1
  294. package/src/components/Searchbox/Searchbox.tsx +4 -1
  295. package/src/components/Select/Select.tsx +7 -2
  296. package/src/components/TextInput/TextInput.tsx +5 -1
  297. package/src/components/Textarea/Textarea.tsx +9 -13
  298. package/src/index.ts +2 -0
  299. package/src/types/index.ts +15 -0
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Returns the start and end months for calendar navigation.
3
+ *
4
+ * @param props The DayPicker props, including navigation and layout options.
5
+ * @param dateLib The date library to use for date manipulation.
6
+ * @returns A tuple containing the start and end months for navigation.
7
+ */
8
+ function getNavMonths(props, dateLib) {
9
+ let { startMonth, endMonth } = props;
10
+ const { startOfYear, startOfDay, startOfMonth, endOfMonth, addYears, endOfYear, newDate, today, } = dateLib;
11
+ // Handle deprecated code
12
+ const { fromYear, toYear, fromMonth, toMonth } = props;
13
+ if (!startMonth && fromMonth) {
14
+ startMonth = fromMonth;
15
+ }
16
+ if (!startMonth && fromYear) {
17
+ startMonth = dateLib.newDate(fromYear, 0, 1);
18
+ }
19
+ if (!endMonth && toMonth) {
20
+ endMonth = toMonth;
21
+ }
22
+ if (!endMonth && toYear) {
23
+ endMonth = newDate(toYear, 11, 31);
24
+ }
25
+ const hasYearDropdown = props.captionLayout === "dropdown" ||
26
+ props.captionLayout === "dropdown-years";
27
+ if (startMonth) {
28
+ startMonth = startOfMonth(startMonth);
29
+ }
30
+ else if (fromYear) {
31
+ startMonth = newDate(fromYear, 0, 1);
32
+ }
33
+ else if (!startMonth && hasYearDropdown) {
34
+ startMonth = startOfYear(addYears(props.today ?? today(), -100));
35
+ }
36
+ if (endMonth) {
37
+ endMonth = endOfMonth(endMonth);
38
+ }
39
+ else if (toYear) {
40
+ endMonth = newDate(toYear, 11, 31);
41
+ }
42
+ else if (!endMonth && hasYearDropdown) {
43
+ endMonth = endOfYear(props.today ?? today());
44
+ }
45
+ return [
46
+ startMonth ? startOfDay(startMonth) : startMonth,
47
+ endMonth ? startOfDay(endMonth) : endMonth,
48
+ ];
49
+ }
50
+
51
+ export { getNavMonths };
@@ -0,0 +1,40 @@
1
+ import { dateMatchModifiers } from '../utils/dateMatchModifiers.js';
2
+ import { getFocusableDate } from './getFocusableDate.js';
3
+ import { CalendarDay } from '../classes/CalendarDay.js';
4
+
5
+ /**
6
+ * Determines the next focusable day in the calendar.
7
+ *
8
+ * This function recursively calculates the next focusable day based on the
9
+ * movement direction and modifiers applied to the days.
10
+ *
11
+ * @param moveBy The unit of movement (e.g., "day", "week").
12
+ * @param moveDir The direction of movement ("before" or "after").
13
+ * @param refDay The currently focused day.
14
+ * @param calendarStartMonth The earliest month the user can navigate to.
15
+ * @param calendarEndMonth The latest month the user can navigate to.
16
+ * @param props The DayPicker props, including modifiers and configuration
17
+ * options.
18
+ * @param dateLib The date library to use for date manipulation.
19
+ * @param attempt The current recursion attempt (used to limit recursion depth).
20
+ * @returns The next focusable day, or `undefined` if no focusable day is found.
21
+ */
22
+ function getNextFocus(moveBy, moveDir, refDay, calendarStartMonth, calendarEndMonth, props, dateLib, attempt = 0) {
23
+ if (attempt > 365) {
24
+ // Limit the recursion to 365 attempts
25
+ return undefined;
26
+ }
27
+ const focusableDate = getFocusableDate(moveBy, moveDir, refDay.date, calendarStartMonth, calendarEndMonth, props, dateLib);
28
+ const isDisabled = Boolean(props.disabled &&
29
+ dateMatchModifiers(focusableDate, props.disabled, dateLib));
30
+ const isHidden = Boolean(props.hidden && dateMatchModifiers(focusableDate, props.hidden, dateLib));
31
+ const targetMonth = focusableDate;
32
+ const focusDay = new CalendarDay(focusableDate, targetMonth, dateLib);
33
+ if (!isDisabled && !isHidden) {
34
+ return focusDay;
35
+ }
36
+ // Recursively attempt to find the next focusable date
37
+ return getNextFocus(moveBy, moveDir, focusDay, calendarStartMonth, calendarEndMonth, props, dateLib, attempt + 1);
38
+ }
39
+
40
+ export { getNextFocus };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Returns the next month the user can navigate to, based on the given options.
3
+ *
4
+ * The next month is not always the next calendar month:
5
+ *
6
+ * - If it is after the `calendarEndMonth`, it returns `undefined`.
7
+ * - If paged navigation is enabled, it skips forward by the number of displayed
8
+ * months.
9
+ *
10
+ * @param firstDisplayedMonth The first month currently displayed in the
11
+ * calendar.
12
+ * @param calendarEndMonth The latest month the user can navigate to.
13
+ * @param options Navigation options, including `numberOfMonths` and
14
+ * `pagedNavigation`.
15
+ * @param dateLib The date library to use for date manipulation.
16
+ * @returns The next month, or `undefined` if navigation is not possible.
17
+ */
18
+ function getNextMonth(firstDisplayedMonth, calendarEndMonth, options, dateLib) {
19
+ if (options.disableNavigation) {
20
+ return undefined;
21
+ }
22
+ const { pagedNavigation, numberOfMonths = 1 } = options;
23
+ const { startOfMonth, addMonths, differenceInCalendarMonths } = dateLib;
24
+ const offset = pagedNavigation ? numberOfMonths : 1;
25
+ const month = startOfMonth(firstDisplayedMonth);
26
+ if (!calendarEndMonth) {
27
+ return addMonths(month, offset);
28
+ }
29
+ const monthsDiff = differenceInCalendarMonths(calendarEndMonth, firstDisplayedMonth);
30
+ if (monthsDiff < numberOfMonths) {
31
+ return undefined;
32
+ }
33
+ return addMonths(month, offset);
34
+ }
35
+
36
+ export { getNextMonth };
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Returns the previous month the user can navigate to, based on the given
3
+ * options.
4
+ *
5
+ * The previous month is not always the previous calendar month:
6
+ *
7
+ * - If it is before the `calendarStartMonth`, it returns `undefined`.
8
+ * - If paged navigation is enabled, it skips back by the number of displayed
9
+ * months.
10
+ *
11
+ * @param firstDisplayedMonth The first month currently displayed in the
12
+ * calendar.
13
+ * @param calendarStartMonth The earliest month the user can navigate to.
14
+ * @param options Navigation options, including `numberOfMonths` and
15
+ * `pagedNavigation`.
16
+ * @param dateLib The date library to use for date manipulation.
17
+ * @returns The previous month, or `undefined` if navigation is not possible.
18
+ */
19
+ function getPreviousMonth(firstDisplayedMonth, calendarStartMonth, options, dateLib) {
20
+ if (options.disableNavigation) {
21
+ return undefined;
22
+ }
23
+ const { pagedNavigation, numberOfMonths } = options;
24
+ const { startOfMonth, addMonths, differenceInCalendarMonths } = dateLib;
25
+ const offset = pagedNavigation ? (numberOfMonths ?? 1) : 1;
26
+ const month = startOfMonth(firstDisplayedMonth);
27
+ if (!calendarStartMonth) {
28
+ return addMonths(month, -offset);
29
+ }
30
+ const monthsDiff = differenceInCalendarMonths(month, calendarStartMonth);
31
+ if (monthsDiff <= 0) {
32
+ return undefined;
33
+ }
34
+ return addMonths(month, -offset);
35
+ }
36
+
37
+ export { getPreviousMonth };
@@ -0,0 +1,27 @@
1
+ import { UI } from '../UI.js';
2
+
3
+ /**
4
+ * Returns the computed style for a day based on its modifiers.
5
+ *
6
+ * This function merges the base styles for the day with any styles associated
7
+ * with active modifiers.
8
+ *
9
+ * @param dayModifiers The modifiers applied to the day.
10
+ * @param styles The base styles for the calendar elements.
11
+ * @param modifiersStyles The styles associated with specific modifiers.
12
+ * @returns The computed style for the day.
13
+ */
14
+ function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
15
+ let style = { ...styles?.[UI.Day] };
16
+ Object.entries(dayModifiers)
17
+ .filter(([, active]) => active === true)
18
+ .forEach(([modifier]) => {
19
+ style = {
20
+ ...style,
21
+ ...modifiersStyles?.[modifier],
22
+ };
23
+ });
24
+ return style;
25
+ }
26
+
27
+ export { getStyleForModifiers };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Generates a series of 7 days, starting from the beginning of the week, to use
3
+ * for formatting weekday names (e.g., Monday, Tuesday, etc.).
4
+ *
5
+ * @param dateLib The date library to use for date manipulation.
6
+ * @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
7
+ * @param broadcastCalendar Whether to use the broadcast calendar (weeks start
8
+ * on Monday, but may include adjustments for broadcast-specific rules).
9
+ * @returns An array of 7 dates representing the weekdays.
10
+ */
11
+ function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
12
+ const referenceToday = today ?? dateLib.today();
13
+ const start = broadcastCalendar
14
+ ? dateLib.startOfBroadcastWeek(referenceToday, dateLib)
15
+ : ISOWeek
16
+ ? dateLib.startOfISOWeek(referenceToday)
17
+ : dateLib.startOfWeek(referenceToday);
18
+ const days = [];
19
+ for (let i = 0; i < 7; i++) {
20
+ const day = dateLib.addDays(start, i);
21
+ days.push(day);
22
+ }
23
+ return days;
24
+ }
25
+
26
+ export { getWeekdays };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Returns an array of calendar weeks from an array of calendar months.
3
+ *
4
+ * @param months The array of calendar months.
5
+ * @returns An array of calendar weeks.
6
+ */
7
+ function getWeeks(months) {
8
+ const initialWeeks = [];
9
+ return months.reduce((weeks, month) => {
10
+ return weeks.concat(month.weeks.slice());
11
+ }, initialWeeks.slice());
12
+ }
13
+
14
+ export { getWeeks };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Returns the years to display in the dropdown.
3
+ *
4
+ * This function generates a list of years between the navigation start and end
5
+ * dates, formatted using the provided formatter.
6
+ *
7
+ * @param navStart The start date for navigation.
8
+ * @param navEnd The end date for navigation.
9
+ * @param formatters The formatters to use for formatting the year labels.
10
+ * @param dateLib The date library to use for date manipulation.
11
+ * @param reverse If true, reverses the order of the years (descending).
12
+ * @returns An array of dropdown options representing the years, or `undefined`
13
+ * if `navStart` or `navEnd` is not provided.
14
+ */
15
+ function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
16
+ if (!navStart)
17
+ return undefined;
18
+ if (!navEnd)
19
+ return undefined;
20
+ const { startOfYear, endOfYear, eachYearOfInterval, getYear } = dateLib;
21
+ const firstNavYear = startOfYear(navStart);
22
+ const lastNavYear = endOfYear(navEnd);
23
+ const years = eachYearOfInterval({ start: firstNavYear, end: lastNavYear });
24
+ if (reverse)
25
+ years.reverse();
26
+ return years.map((year) => {
27
+ const label = formatters.formatYearDropdown(year, dateLib);
28
+ return {
29
+ value: getYear(year),
30
+ label,
31
+ disabled: false,
32
+ };
33
+ });
34
+ }
35
+
36
+ export { getYearOptions };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Returns the start date of the week in the broadcast calendar.
3
+ *
4
+ * The broadcast week starts on Monday. If the first day of the month is not a
5
+ * Monday, this function calculates the previous Monday as the start of the
6
+ * broadcast week.
7
+ *
8
+ * @since 9.4.0
9
+ * @param date The date for which to calculate the start of the broadcast week.
10
+ * @param dateLib The date library to use for date manipulation.
11
+ * @returns The start date of the broadcast week.
12
+ */
13
+ function startOfBroadcastWeek(date, dateLib) {
14
+ const firstOfMonth = dateLib.startOfMonth(date);
15
+ const dayOfWeek = firstOfMonth.getDay();
16
+ if (dayOfWeek === 1) {
17
+ return firstOfMonth;
18
+ }
19
+ else if (dayOfWeek === 0) {
20
+ return dateLib.addDays(firstOfMonth, -1 * 6);
21
+ }
22
+ else {
23
+ return dateLib.addDays(firstOfMonth, -1 * (dayOfWeek - 1));
24
+ }
25
+ }
26
+
27
+ export { startOfBroadcastWeek };
@@ -0,0 +1,31 @@
1
+ import { useState } from 'react';
2
+
3
+ /**
4
+ * A custom hook for managing both controlled and uncontrolled component states.
5
+ *
6
+ * This hook allows a component to support both controlled and uncontrolled
7
+ * states by determining whether the `controlledValue` is provided. If it is
8
+ * undefined, the hook falls back to using the internal state.
9
+ *
10
+ * @example
11
+ * // Uncontrolled usage
12
+ * const [value, setValue] = useControlledValue(0, undefined);
13
+ *
14
+ * // Controlled usage
15
+ * const [value, setValue] = useControlledValue(0, props.value);
16
+ *
17
+ * @template T - The type of the value.
18
+ * @param defaultValue The initial value for the uncontrolled state.
19
+ * @param controlledValue The value for the controlled state. If undefined, the
20
+ * component will use the uncontrolled state.
21
+ * @returns A tuple where the first element is the current value (either
22
+ * controlled or uncontrolled) and the second element is a setter function to
23
+ * update the value.
24
+ */
25
+ function useControlledValue(defaultValue, controlledValue) {
26
+ const [uncontrolledValue, setValue] = useState(defaultValue);
27
+ const value = controlledValue === undefined ? uncontrolledValue : controlledValue;
28
+ return [value, setValue];
29
+ }
30
+
31
+ export { useControlledValue };
@@ -0,0 +1,11 @@
1
+ export { labelDay, labelDayButton } from './labelDayButton.js';
2
+ export { labelCaption, labelGrid } from './labelGrid.js';
3
+ export { labelGridcell } from './labelGridcell.js';
4
+ export { labelMonthDropdown } from './labelMonthDropdown.js';
5
+ export { labelNav } from './labelNav.js';
6
+ export { labelNext } from './labelNext.js';
7
+ export { labelPrevious } from './labelPrevious.js';
8
+ export { labelWeekday } from './labelWeekday.js';
9
+ export { labelWeekNumber } from './labelWeekNumber.js';
10
+ export { labelWeekNumberHeader } from './labelWeekNumberHeader.js';
11
+ export { labelYearDropdown } from './labelYearDropdown.js';
@@ -0,0 +1,32 @@
1
+ import { DateLib } from '../classes/DateLib.js';
2
+
3
+ /**
4
+ * Generates the ARIA label for a day button.
5
+ *
6
+ * Use the `modifiers` argument to provide additional context for the label,
7
+ * such as indicating if the day is "today" or "selected."
8
+ *
9
+ * @defaultValue The formatted date.
10
+ * @param date - The date to format.
11
+ * @param modifiers - The modifiers providing context for the day.
12
+ * @param options - Optional configuration for the date formatting library.
13
+ * @param dateLib - An optional instance of the date formatting library.
14
+ * @returns The ARIA label for the day button.
15
+ * @group Labels
16
+ * @see https://daypicker.dev/docs/translation#aria-labels
17
+ */
18
+ function labelDayButton(date, modifiers, options, dateLib) {
19
+ let label = (dateLib ?? new DateLib(options)).format(date, "PPPP");
20
+ if (modifiers.today)
21
+ label = `Today, ${label}`;
22
+ if (modifiers.selected)
23
+ label = `${label}, selected`;
24
+ return label;
25
+ }
26
+ /**
27
+ * @ignore
28
+ * @deprecated Use `labelDayButton` instead.
29
+ */
30
+ const labelDay = labelDayButton;
31
+
32
+ export { labelDay, labelDayButton };
@@ -0,0 +1,25 @@
1
+ import { DateLib } from '../classes/DateLib.js';
2
+
3
+ /**
4
+ * Generates the ARIA label for the month grid, which is announced when entering
5
+ * the grid.
6
+ *
7
+ * @defaultValue Locale-specific month/year order (e.g., "November 2022").
8
+ * @param date - The date representing the month.
9
+ * @param options - Optional configuration for the date formatting library.
10
+ * @param dateLib - An optional instance of the date formatting library.
11
+ * @returns The ARIA label for the month grid.
12
+ * @group Labels
13
+ * @see https://daypicker.dev/docs/translation#aria-labels
14
+ */
15
+ function labelGrid(date, options, dateLib) {
16
+ const lib = dateLib ?? new DateLib(options);
17
+ return lib.formatMonthYear(date);
18
+ }
19
+ /**
20
+ * @ignore
21
+ * @deprecated Use {@link labelGrid} instead.
22
+ */
23
+ const labelCaption = labelGrid;
24
+
25
+ export { labelCaption, labelGrid };
@@ -0,0 +1,22 @@
1
+ import { DateLib } from '../classes/DateLib.js';
2
+
3
+ /**
4
+ * Generates the label for a day grid cell when the calendar is not interactive.
5
+ *
6
+ * @param date - The date to format.
7
+ * @param modifiers - Optional modifiers providing context for the day.
8
+ * @param options - Optional configuration for the date formatting library.
9
+ * @param dateLib - An optional instance of the date formatting library.
10
+ * @returns The label for the day grid cell.
11
+ * @group Labels
12
+ * @see https://daypicker.dev/docs/translation#aria-labels
13
+ */
14
+ function labelGridcell(date, modifiers, options, dateLib) {
15
+ let label = (dateLib ?? new DateLib(options)).format(date, "PPPP");
16
+ if (modifiers?.today) {
17
+ label = `Today, ${label}`;
18
+ }
19
+ return label;
20
+ }
21
+
22
+ export { labelGridcell };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Generates the ARIA label for the months dropdown.
3
+ *
4
+ * @defaultValue `"Choose the Month"`
5
+ * @param options - Optional configuration for the date formatting library.
6
+ * @returns The ARIA label for the months dropdown.
7
+ * @group Labels
8
+ * @see https://daypicker.dev/docs/translation#aria-labels
9
+ */
10
+ function labelMonthDropdown(_options) {
11
+ return "Choose the Month";
12
+ }
13
+
14
+ export { labelMonthDropdown };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Generates the ARIA label for the navigation toolbar.
3
+ *
4
+ * @defaultValue `""`
5
+ * @returns The ARIA label for the navigation toolbar.
6
+ * @group Labels
7
+ * @see https://daypicker.dev/docs/translation#aria-labels
8
+ */
9
+ function labelNav() {
10
+ return "";
11
+ }
12
+
13
+ export { labelNav };
@@ -0,0 +1,16 @@
1
+ const defaultLabel = "Go to the Next Month";
2
+ /**
3
+ * Generates the ARIA label for the "next month" button.
4
+ *
5
+ * @defaultValue `"Go to the Next Month"`
6
+ * @param month - The date representing the next month, or `undefined` if there
7
+ * is no next month.
8
+ * @returns The ARIA label for the "next month" button.
9
+ * @group Labels
10
+ * @see https://daypicker.dev/docs/translation#aria-labels
11
+ */
12
+ function labelNext(_month, _options) {
13
+ return defaultLabel;
14
+ }
15
+
16
+ export { labelNext };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Generates the ARIA label for the "previous month" button.
3
+ *
4
+ * @defaultValue `"Go to the Previous Month"`
5
+ * @param month - The date representing the previous month, or `undefined` if
6
+ * there is no previous month.
7
+ * @returns The ARIA label for the "previous month" button.
8
+ * @group Labels
9
+ * @see https://daypicker.dev/docs/translation#aria-labels
10
+ */
11
+ function labelPrevious(_month) {
12
+ return "Go to the Previous Month";
13
+ }
14
+
15
+ export { labelPrevious };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Generates the ARIA label for the week number cell (the first cell in a row).
3
+ *
4
+ * @defaultValue `Week ${weekNumber}`
5
+ * @param weekNumber - The number of the week.
6
+ * @param options - Optional configuration for the date formatting library.
7
+ * @returns The ARIA label for the week number cell.
8
+ * @group Labels
9
+ * @see https://daypicker.dev/docs/translation#aria-labels
10
+ */
11
+ function labelWeekNumber(weekNumber, _options) {
12
+ return `Week ${weekNumber}`;
13
+ }
14
+
15
+ export { labelWeekNumber };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Generates the ARIA label for the week number header element.
3
+ *
4
+ * @defaultValue `"Week Number"`
5
+ * @param options - Optional configuration for the date formatting library.
6
+ * @returns The ARIA label for the week number header.
7
+ * @group Labels
8
+ * @see https://daypicker.dev/docs/translation#aria-labels
9
+ */
10
+ function labelWeekNumberHeader(_options) {
11
+ return "Week Number";
12
+ }
13
+
14
+ export { labelWeekNumberHeader };
@@ -0,0 +1,18 @@
1
+ import { DateLib } from '../classes/DateLib.js';
2
+
3
+ /**
4
+ * Generates the ARIA label for a weekday column header.
5
+ *
6
+ * @defaultValue `"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"`
7
+ * @param date - The date representing the weekday.
8
+ * @param options - Optional configuration for the date formatting library.
9
+ * @param dateLib - An optional instance of the date formatting library.
10
+ * @returns The ARIA label for the weekday column header.
11
+ * @group Labels
12
+ * @see https://daypicker.dev/docs/translation#aria-labels
13
+ */
14
+ function labelWeekday(date, options, dateLib) {
15
+ return (dateLib ?? new DateLib(options)).format(date, "cccc");
16
+ }
17
+
18
+ export { labelWeekday };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Generates the ARIA label for the years dropdown.
3
+ *
4
+ * @defaultValue `"Choose the Year"`
5
+ * @param options - Optional configuration for the date formatting library.
6
+ * @returns The ARIA label for the years dropdown.
7
+ * @group Labels
8
+ * @see https://daypicker.dev/docs/translation#aria-labels
9
+ */
10
+ function labelYearDropdown(_options) {
11
+ return "Choose the Year";
12
+ }
13
+
14
+ export { labelYearDropdown };
@@ -0,0 +1,67 @@
1
+ import { enUS as enUS$1 } from '../../../../date-fns/locale/en-US.js';
2
+ import { formatDate as format } from '../../../../date-fns/format.js';
3
+
4
+ /** English (United States) locale extended with DayPicker-specific translations. */
5
+ const enUS = {
6
+ ...enUS$1,
7
+ labels: {
8
+ labelDayButton: (date, modifiers, options, dateLib) => {
9
+ let formatDate;
10
+ if (dateLib && typeof dateLib.format === "function") {
11
+ formatDate = dateLib.format.bind(dateLib);
12
+ }
13
+ else {
14
+ formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
15
+ }
16
+ let label = formatDate(date, "PPPP");
17
+ if (modifiers.today)
18
+ label = `Today, ${label}`;
19
+ if (modifiers.selected)
20
+ label = `${label}, selected`;
21
+ return label;
22
+ },
23
+ labelMonthDropdown: "Choose the Month",
24
+ labelNext: "Go to the Next Month",
25
+ labelPrevious: "Go to the Previous Month",
26
+ labelWeekNumber: (weekNumber) => `Week ${weekNumber}`,
27
+ labelYearDropdown: "Choose the Year",
28
+ labelGrid: (date, options, dateLib) => {
29
+ let formatDate;
30
+ if (dateLib && typeof dateLib.format === "function") {
31
+ formatDate = dateLib.format.bind(dateLib);
32
+ }
33
+ else {
34
+ formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
35
+ }
36
+ return formatDate(date, "LLLL yyyy");
37
+ },
38
+ labelGridcell: (date, modifiers, options, dateLib) => {
39
+ let formatDate;
40
+ if (dateLib && typeof dateLib.format === "function") {
41
+ formatDate = dateLib.format.bind(dateLib);
42
+ }
43
+ else {
44
+ formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
45
+ }
46
+ let label = formatDate(date, "PPPP");
47
+ if (modifiers?.today) {
48
+ label = `Today, ${label}`;
49
+ }
50
+ return label;
51
+ },
52
+ labelNav: "Navigation bar",
53
+ labelWeekNumberHeader: "Week Number",
54
+ labelWeekday: (date, options, dateLib) => {
55
+ let formatDate;
56
+ if (dateLib && typeof dateLib.format === "function") {
57
+ formatDate = dateLib.format.bind(dateLib);
58
+ }
59
+ else {
60
+ formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
61
+ }
62
+ return formatDate(date, "cccc");
63
+ },
64
+ },
65
+ };
66
+
67
+ export { enUS };