@jobber/components 6.123.0 → 6.123.2

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 (231) hide show
  1. package/dist/AtlantisThemeContext-cjs.js +1 -1
  2. package/dist/AtlantisThemeContext-es.js +9 -9
  3. package/dist/Autocomplete/Autocomplete.types.d.ts +33 -0
  4. package/dist/Autocomplete/index.cjs +5 -5
  5. package/dist/Autocomplete/index.mjs +8 -8
  6. package/dist/Autocomplete/useAutocomplete.d.ts +2 -57
  7. package/dist/Body-cjs.js +1 -1
  8. package/dist/Body-es.js +2 -2
  9. package/dist/BottomSheet-cjs.js +42 -12
  10. package/dist/BottomSheet-es.js +43 -13
  11. package/dist/Box-cjs.js +2 -2
  12. package/dist/Box-es.js +2 -2
  13. package/dist/Button/index.mjs +1 -1
  14. package/dist/Button-es.js +1 -1
  15. package/dist/Card-cjs.js +1 -1
  16. package/dist/Card-es.js +1 -1
  17. package/dist/Checkbox/index.cjs +1 -1
  18. package/dist/Checkbox/index.mjs +1 -1
  19. package/dist/Chip/index.mjs +1 -1
  20. package/dist/Chip-cjs.js +2 -2
  21. package/dist/Chip-es.js +2 -2
  22. package/dist/ChipDismissible-es.js +1 -1
  23. package/dist/Chips/InternalChipDismissible/hooks/index.mjs +1 -1
  24. package/dist/Combobox-cjs.js +1 -1
  25. package/dist/Combobox-es.js +1 -1
  26. package/dist/ComboboxAction-cjs.js +1 -1
  27. package/dist/ComboboxAction-es.js +1 -1
  28. package/dist/ComboboxContent-cjs.js +1 -1
  29. package/dist/ComboboxContent-es.js +2 -2
  30. package/dist/ComboboxContentHeader-cjs.js +1 -1
  31. package/dist/ComboboxContentHeader-es.js +1 -1
  32. package/dist/ComboboxContentList-es.js +1 -1
  33. package/dist/ComboboxContentSearch-cjs.js +1 -1
  34. package/dist/ComboboxContentSearch-es.js +1 -1
  35. package/dist/ComboboxLoadMore-cjs.js +1 -1
  36. package/dist/ComboboxLoadMore-es.js +1 -1
  37. package/dist/ComboboxOption-cjs.js +1 -1
  38. package/dist/ComboboxOption-es.js +1 -1
  39. package/dist/Container-cjs.js +1 -1
  40. package/dist/Container-es.js +1 -1
  41. package/dist/Content-cjs.js +1 -1
  42. package/dist/Content-es.js +1 -1
  43. package/dist/ContentBlock-cjs.js +1 -1
  44. package/dist/ContentBlock-es.js +1 -1
  45. package/dist/Countdown-cjs.js +7 -3
  46. package/dist/Countdown-es.js +8 -4
  47. package/dist/Cover-cjs.js +1 -1
  48. package/dist/Cover-es.js +1 -1
  49. package/dist/DataList-es.js +3 -3
  50. package/dist/DataList.const-cjs.js +0 -1
  51. package/dist/DataList.const-es.js +1 -2
  52. package/dist/DataList.module-cjs.js +1 -1
  53. package/dist/DataList.module-es.js +1 -1
  54. package/dist/DataList.utils-es.js +6 -6
  55. package/dist/DataListAction-cjs.js +1 -1
  56. package/dist/DataListAction-es.js +1 -1
  57. package/dist/DataListActionsMenu-cjs.js +1 -1
  58. package/dist/DataListActionsMenu-es.js +2 -2
  59. package/dist/DataListBulkActions-cjs.js +1 -1
  60. package/dist/DataListBulkActions-es.js +1 -1
  61. package/dist/DataListContext-cjs.js +6 -5
  62. package/dist/DataListContext-es.js +6 -5
  63. package/dist/DataListEmptyState-cjs.js +1 -1
  64. package/dist/DataListEmptyState-es.js +1 -1
  65. package/dist/DataListHeaderTile-cjs.js +2 -2
  66. package/dist/DataListHeaderTile-es.js +2 -2
  67. package/dist/DataListItemActions-cjs.js +1 -1
  68. package/dist/DataListItemActions-es.js +2 -2
  69. package/dist/DataListLayoutActions-cjs.js +1 -1
  70. package/dist/DataListLayoutActions-es.js +2 -2
  71. package/dist/DataListLoadMore-cjs.js +1 -1
  72. package/dist/DataListLoadMore-es.js +1 -1
  73. package/dist/DataListLoadingState-cjs.js +1 -1
  74. package/dist/DataListLoadingState-es.js +2 -2
  75. package/dist/DataListOverflowFade-cjs.js +1 -1
  76. package/dist/DataListOverflowFade-es.js +1 -1
  77. package/dist/DataListSearch-cjs.js +1 -1
  78. package/dist/DataListSearch-es.js +1 -1
  79. package/dist/DataListSortingOptions-cjs.js +1 -1
  80. package/dist/DataListSortingOptions-es.js +1 -1
  81. package/dist/DataListStickyHeader-cjs.js +1 -1
  82. package/dist/DataListStickyHeader-es.js +1 -1
  83. package/dist/DataListTags-cjs.js +1 -1
  84. package/dist/DataListTags-es.js +1 -1
  85. package/dist/DataListTotalCount-cjs.js +1 -1
  86. package/dist/DataListTotalCount-es.js +2 -2
  87. package/dist/DataTable/index.mjs +1 -1
  88. package/dist/DataTable-cjs.js +3 -3
  89. package/dist/DataTable-es.js +5 -5
  90. package/dist/DataTableTable-cjs.js +2 -2
  91. package/dist/DataTableTable-es.js +3 -3
  92. package/dist/DatePicker-cjs.js +266 -81
  93. package/dist/DatePicker-es.js +268 -83
  94. package/dist/DayOfMonthSelect-cjs.js +5 -5
  95. package/dist/DayOfMonthSelect-es.js +6 -6
  96. package/dist/DescriptionList-cjs.js +1 -1
  97. package/dist/DescriptionList-es.js +1 -1
  98. package/dist/Disclosure-cjs.js +1 -1
  99. package/dist/Disclosure-es.js +1 -1
  100. package/dist/Divider-cjs.js +1 -1
  101. package/dist/Divider-es.js +1 -1
  102. package/dist/DrawerGrid-cjs.js +2 -2
  103. package/dist/DrawerGrid-es.js +2 -2
  104. package/dist/DrawerRoot-cjs.js +10 -48
  105. package/dist/DrawerRoot-es.js +12 -50
  106. package/dist/FeatureSwitch-cjs.js +1 -1
  107. package/dist/FeatureSwitch-es.js +1 -1
  108. package/dist/FormField/index.mjs +1 -1
  109. package/dist/FormField-cjs.js +1 -1
  110. package/dist/FormField-es.js +2 -2
  111. package/dist/FormatEmail-cjs.js +1 -1
  112. package/dist/FormatEmail-es.js +1 -1
  113. package/dist/FormatFile-cjs.js +1 -6
  114. package/dist/FormatFile-es.js +1 -6
  115. package/dist/Frame-cjs.js +1 -1
  116. package/dist/Frame-es.js +1 -1
  117. package/dist/Glimmer/index.mjs +1 -1
  118. package/dist/Glimmer-cjs.js +1 -1
  119. package/dist/Glimmer-es.js +2 -2
  120. package/dist/Grid-cjs.js +1 -1
  121. package/dist/Grid-es.js +1 -1
  122. package/dist/GridCell-cjs.js +1 -1
  123. package/dist/GridCell-es.js +1 -1
  124. package/dist/InputAvatar-cjs.js +1 -1
  125. package/dist/InputAvatar-es.js +1 -1
  126. package/dist/InputDate/index.mjs +1 -1
  127. package/dist/InputEmail/index.mjs +1 -1
  128. package/dist/InputFile-cjs.js +8 -3
  129. package/dist/InputFile-es.js +8 -3
  130. package/dist/InputNumber/index.cjs +181 -69
  131. package/dist/InputNumber/index.mjs +184 -72
  132. package/dist/InputPassword-es.js +1 -1
  133. package/dist/InputPhoneNumber/index.cjs +1 -1
  134. package/dist/InputPhoneNumber/index.mjs +2 -2
  135. package/dist/InputText/InputText.d.ts +2 -70
  136. package/dist/InputText/index.mjs +1 -1
  137. package/dist/InputTime/index.cjs +0 -1
  138. package/dist/InputTime/index.mjs +1 -2
  139. package/dist/InputValidation-cjs.js +1 -1
  140. package/dist/InputValidation-es.js +1 -1
  141. package/dist/InternalChipDismissible-cjs.js +1 -1
  142. package/dist/InternalChipDismissible-es.js +2 -2
  143. package/dist/LightBox-cjs.js +1 -1
  144. package/dist/LightBox-es.js +1 -1
  145. package/dist/Link-cjs.js +1 -1
  146. package/dist/Link-es.js +1 -1
  147. package/dist/List-cjs.js +3 -3
  148. package/dist/List-es.js +7 -7
  149. package/dist/Markdown-cjs.js +604 -961
  150. package/dist/Markdown-es.js +610 -967
  151. package/dist/Menu/Menu.d.ts +1 -1
  152. package/dist/Menu-cjs.js +859 -629
  153. package/dist/Menu-es.js +855 -625
  154. package/dist/Modal/index.cjs +2 -2
  155. package/dist/Modal/index.mjs +2 -2
  156. package/dist/Modal/useModal.d.ts +9 -29
  157. package/dist/MultiSelect-cjs.js +2 -2
  158. package/dist/MultiSelect-es.js +2 -2
  159. package/dist/OverlaySeparator-cjs.js +1 -1
  160. package/dist/OverlaySeparator-es.js +1 -1
  161. package/dist/Popover-cjs.js +1 -1
  162. package/dist/Popover-es.js +2 -2
  163. package/dist/ProgressBar-cjs.js +1 -1
  164. package/dist/ProgressBar-es.js +1 -1
  165. package/dist/RadioGroup-cjs.js +1 -1
  166. package/dist/RadioGroup-es.js +1 -1
  167. package/dist/RecurringSelect/components/index.mjs +1 -1
  168. package/dist/RecurringSelect/index.cjs +1 -0
  169. package/dist/RecurringSelect/index.mjs +1 -0
  170. package/dist/RecurringSelect-cjs.js +1 -1
  171. package/dist/RecurringSelect-es.js +2 -2
  172. package/dist/SegmentedControl-cjs.js +1 -1
  173. package/dist/SegmentedControl-es.js +2 -2
  174. package/dist/Select/index.cjs +1 -1
  175. package/dist/Select/index.mjs +2 -2
  176. package/dist/SideDrawer-cjs.js +1 -1
  177. package/dist/SideDrawer-es.js +1 -1
  178. package/dist/Spinner-cjs.js +1 -1
  179. package/dist/Spinner-es.js +1 -1
  180. package/dist/StatusIndicator-cjs.js +1 -1
  181. package/dist/StatusIndicator-es.js +1 -1
  182. package/dist/Switch-cjs.js +1 -1
  183. package/dist/Switch-es.js +1 -1
  184. package/dist/Table/index.mjs +1 -1
  185. package/dist/Tabs/index.mjs +1 -1
  186. package/dist/Tabs-cjs.js +1 -1
  187. package/dist/Tabs-es.js +6 -6
  188. package/dist/Text-cjs2.js +365 -175
  189. package/dist/Text-es2.js +361 -175
  190. package/dist/Thumbnail-cjs.js +1 -1
  191. package/dist/Thumbnail-es.js +2 -2
  192. package/dist/Tiles-cjs.js +1 -1
  193. package/dist/Tiles-es.js +1 -1
  194. package/dist/Tooltip-cjs.js +1 -1
  195. package/dist/Tooltip-es.js +2 -2
  196. package/dist/Typography-cjs.js +3 -3
  197. package/dist/Typography-es.js +3 -3
  198. package/dist/_baseEach-cjs.js +1 -1
  199. package/dist/_baseEach-es.js +7 -7
  200. package/dist/_baseFlatten-es.js +1 -1
  201. package/dist/_getAllKeys-cjs.js +2 -8
  202. package/dist/_getAllKeys-es.js +4 -10
  203. package/dist/_getTag-es.js +1 -1
  204. package/dist/_isIterateeCall-es.js +3 -3
  205. package/dist/_setToString-es.js +2 -2
  206. package/dist/debounce-es.js +4 -4
  207. package/dist/floating-ui.react-cjs.js +35 -16
  208. package/dist/floating-ui.react-dom-es.js +2 -2
  209. package/dist/floating-ui.react-es.js +37 -18
  210. package/dist/identity-es.js +5 -5
  211. package/dist/index-cjs.js +6 -6
  212. package/dist/index-es.js +6 -6
  213. package/dist/index.esm-es.js +1 -1
  214. package/dist/index.mjs +6 -6
  215. package/dist/isSymbol-es.js +1 -1
  216. package/dist/isTypedArray-cjs.js +4 -4
  217. package/dist/isTypedArray-es.js +6 -6
  218. package/dist/keysIn-cjs.js +2 -2
  219. package/dist/keysIn-es.js +5 -5
  220. package/dist/noop-es.js +4 -4
  221. package/dist/omit-cjs.js +37 -5
  222. package/dist/omit-es.js +46 -14
  223. package/dist/primitives/BottomSheet/BottomSheet.d.ts +13 -8
  224. package/dist/showToast-cjs.js +1 -1
  225. package/dist/showToast-es.js +1 -1
  226. package/dist/styles.css +56 -124
  227. package/dist/unstyledPrimitives/index.mjs +3 -3
  228. package/dist/useScrollToActive-cjs.js +1 -1
  229. package/dist/useScrollToActive-es.js +8 -8
  230. package/package.json +32 -15
  231. package/rollup.config.mjs +4 -1
@@ -1,9 +1,9 @@
1
- import React__default, { cloneElement, Component, createRef, useRef, useCallback, useEffect, createElement, forwardRef, isValidElement, useState, useId } from 'react';
1
+ import React__default, { cloneElement, createRef, Component, useRef, useEffect, useCallback, createElement, forwardRef, isValidElement, useState, useId } from 'react';
2
2
  import classnames from 'classnames';
3
3
  import { c as clsx } from './clsx-es.js';
4
4
  import { u as useFloating, m as FloatingArrow, b as useFloatingNodeId, a as useFloatingParentNodeId, e as FloatingTree, f as FloatingNode, F as FloatingPortal } from './floating-ui.react-es.js';
5
5
  import ReactDOM__default from 'react-dom';
6
- import { b as autoUpdate, f as flip, o as offset, a as arrow } from './floating-ui.react-dom-es.js';
6
+ import { a as autoUpdate, f as flip, o as offset, b as arrow } from './floating-ui.react-dom-es.js';
7
7
  import { useRefocusOnActivator } from '@jobber/hooks';
8
8
  import { T as Typography } from './Typography-es.js';
9
9
  import { B as Button } from './Button-es.js';
@@ -2456,8 +2456,6 @@ const lightFormatters = {
2456
2456
  };
2457
2457
 
2458
2458
  const dayPeriodEnum = {
2459
- am: "am",
2460
- pm: "pm",
2461
2459
  midnight: "midnight",
2462
2460
  noon: "noon",
2463
2461
  morning: "morning",
@@ -6827,7 +6825,7 @@ function isWithinInterval(date, interval, options) {
6827
6825
  * //=> Fri Aug 22 2014 00:00:00
6828
6826
  */
6829
6827
  function subDays(date, amount, options) {
6830
- return addDays(date, -amount, options);
6828
+ return addDays(date, -1, options);
6831
6829
  }
6832
6830
 
6833
6831
  /**
@@ -7378,7 +7376,7 @@ function subMonths(date, amount, options) {
7378
7376
  * //=> Sun Dec 01 2013 00:00:00
7379
7377
  */
7380
7378
  function subQuarters(date, amount, options) {
7381
- return addQuarters(date, -amount, options);
7379
+ return addQuarters(date, -1, options);
7382
7380
  }
7383
7381
 
7384
7382
  /**
@@ -7408,7 +7406,7 @@ function subQuarters(date, amount, options) {
7408
7406
  * //=> Mon Aug 04 2014 00:00:00
7409
7407
  */
7410
7408
  function subWeeks(date, amount, options) {
7411
- return addWeeks(date, -amount, options);
7409
+ return addWeeks(date, -1, options);
7412
7410
  }
7413
7411
 
7414
7412
  /**
@@ -7442,7 +7440,7 @@ function subYears(date, amount, options) {
7442
7440
  }
7443
7441
 
7444
7442
  /*!
7445
- react-datepicker v8.7.0
7443
+ react-datepicker v8.10.0
7446
7444
  https://github.com/Hacker0x01/react-datepicker
7447
7445
  Released under the MIT License.
7448
7446
  */
@@ -7506,17 +7504,19 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
7506
7504
  };
7507
7505
 
7508
7506
  var CalendarContainer = function (_a) {
7509
- var _b = _a.showTimeSelectOnly, showTimeSelectOnly = _b === void 0 ? false : _b, _c = _a.showTime, showTime = _c === void 0 ? false : _c, className = _a.className, children = _a.children;
7507
+ var _b = _a.showTimeSelectOnly, showTimeSelectOnly = _b === void 0 ? false : _b, _c = _a.showTime, showTime = _c === void 0 ? false : _c, className = _a.className, children = _a.children, inline = _a.inline;
7510
7508
  var ariaLabel = showTimeSelectOnly
7511
7509
  ? "Choose Time"
7512
7510
  : "Choose Date".concat(showTime ? " and Time" : "");
7513
- return (React__default.createElement("div", { className: className, role: "dialog", "aria-label": ariaLabel, "aria-modal": "true" }, children));
7511
+ return (React__default.createElement("div", { className: className, "aria-label": ariaLabel, role: inline ? undefined : "dialog", "aria-modal": inline ? undefined : "true" }, children));
7514
7512
  };
7515
7513
 
7516
7514
  var useDetectClickOutside = function (onClickOutside, ignoreClass) {
7517
7515
  var ref = useRef(null);
7518
7516
  var onClickOutsideRef = useRef(onClickOutside);
7519
- onClickOutsideRef.current = onClickOutside;
7517
+ useEffect(function () {
7518
+ onClickOutsideRef.current = onClickOutside;
7519
+ }, [onClickOutside]);
7520
7520
  var handleClickOutside = useCallback(function (event) {
7521
7521
  var _a;
7522
7522
  var target = (event.composed &&
@@ -7602,10 +7602,7 @@ function parseDate(value, dateFormat, locale, strictParsing, refDate) {
7602
7602
  for (var _i = 0, formats_1 = formats; _i < formats_1.length; _i++) {
7603
7603
  var format_1 = formats_1[_i];
7604
7604
  var parsedDate = parse(value, format_1, refDate, {
7605
- locale: localeObject,
7606
- useAdditionalWeekYearTokens: true,
7607
- useAdditionalDayOfYearTokens: true,
7608
- });
7605
+ locale: localeObject});
7609
7606
  if (isValid(parsedDate) &&
7610
7607
  (!strictParsing || value === formatDate(parsedDate, format_1, locale))) {
7611
7608
  return parsedDate;
@@ -8022,7 +8019,10 @@ function getQuarterShortInLocale(quarter, locale) {
8022
8019
  * @returns - Returns true if the day is disabled, false otherwise.
8023
8020
  */
8024
8021
  function isDayDisabled(day, _a) {
8025
- var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, excludeDateIntervals = _b.excludeDateIntervals, includeDates = _b.includeDates, includeDateIntervals = _b.includeDateIntervals, filterDate = _b.filterDate;
8022
+ var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, excludeDateIntervals = _b.excludeDateIntervals, includeDates = _b.includeDates, includeDateIntervals = _b.includeDateIntervals, filterDate = _b.filterDate, disabled = _b.disabled;
8023
+ if (disabled) {
8024
+ return true;
8025
+ }
8026
8026
  return (isOutOfBounds(day, { minDate: minDate, maxDate: maxDate }) ||
8027
8027
  (excludeDates &&
8028
8028
  excludeDates.some(function (excludeDate) {
@@ -8122,7 +8122,10 @@ function isMonthYearDisabled(date, _a) {
8122
8122
  false);
8123
8123
  }
8124
8124
  function isQuarterDisabled(quarter, _a) {
8125
- var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate;
8125
+ var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate, disabled = _b.disabled;
8126
+ if (disabled) {
8127
+ return true;
8128
+ }
8126
8129
  return (isOutOfBounds(quarter, { minDate: minDate, maxDate: maxDate }) ||
8127
8130
  (excludeDates === null || excludeDates === void 0 ? void 0 : excludeDates.some(function (excludeDate) {
8128
8131
  return isSameQuarter(quarter, excludeDate instanceof Date ? excludeDate : excludeDate.date);
@@ -8144,7 +8147,10 @@ function isYearInRange(year, start, end) {
8144
8147
  return startYear <= year && endYear >= year;
8145
8148
  }
8146
8149
  function isYearDisabled(year, _a) {
8147
- var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate;
8150
+ var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate, disabled = _b.disabled;
8151
+ if (disabled) {
8152
+ return true;
8153
+ }
8148
8154
  var date = new Date(year, 0, 1);
8149
8155
  return (isOutOfBounds(date, {
8150
8156
  minDate: minDate ? startOfYear(minDate) : undefined,
@@ -8216,6 +8222,7 @@ function isTimeInDisabledRange(time, _a) {
8216
8222
  valid = !isWithinInterval(baseTime, { start: min, end: max });
8217
8223
  }
8218
8224
  catch (err) {
8225
+ /* istanbul ignore next - date-fns historically threw on invalid intervals */
8219
8226
  valid = false;
8220
8227
  }
8221
8228
  return valid;
@@ -8241,7 +8248,7 @@ function monthDisabledAfter(day, _a) {
8241
8248
  function quarterDisabledBefore(date, _a) {
8242
8249
  var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, includeDates = _b.includeDates;
8243
8250
  var firstDateOfYear = startOfYear(date);
8244
- var previousQuarter = subQuarters(firstDateOfYear, 1);
8251
+ var previousQuarter = subQuarters(firstDateOfYear);
8245
8252
  return ((minDate && differenceInCalendarQuarters(minDate, previousQuarter) > 0) ||
8246
8253
  (includeDates &&
8247
8254
  includeDates.every(function (includeDate) {
@@ -8734,6 +8741,7 @@ var Day = /** @class */ (function (_super) {
8734
8741
  includeDateIntervals: _this.props.includeDateIntervals,
8735
8742
  includeDates: _this.props.includeDates,
8736
8743
  filterDate: _this.props.filterDate,
8744
+ disabled: _this.props.disabled,
8737
8745
  });
8738
8746
  };
8739
8747
  _this.isExcluded = function () {
@@ -9381,6 +9389,7 @@ var Month = /** @class */ (function (_super) {
9381
9389
  includeDateIntervals: _this.props.includeDateIntervals,
9382
9390
  includeDates: _this.props.includeDates,
9383
9391
  filterDate: _this.props.filterDate,
9392
+ disabled: _this.props.disabled,
9384
9393
  });
9385
9394
  };
9386
9395
  _this.isExcluded = function (day) {
@@ -9517,7 +9526,12 @@ var Month = /** @class */ (function (_super) {
9517
9526
  });
9518
9527
  };
9519
9528
  _this.isSelectedQuarter = function (day, q, selected) {
9520
- return getQuarter(day) === q && getYear(day) === getYear(selected);
9529
+ return getQuarter(selected) === q && getYear(day) === getYear(selected);
9530
+ };
9531
+ _this.isSelectQuarterInList = function (day, q, selectedDates) {
9532
+ return selectedDates.some(function (selectedDate) {
9533
+ return _this.isSelectedQuarter(day, q, selectedDate);
9534
+ });
9521
9535
  };
9522
9536
  _this.isMonthSelected = function () {
9523
9537
  var _a = _this.props, day = _a.day, selected = _a.selected, selectedDates = _a.selectedDates, selectsMultiple = _a.selectsMultiple;
@@ -9529,7 +9543,21 @@ var Month = /** @class */ (function (_super) {
9529
9543
  }
9530
9544
  return !!selected && _this.isSelectedMonth(day, monthIdx, selected);
9531
9545
  };
9546
+ _this.isQuarterSelected = function () {
9547
+ var _a = _this.props, day = _a.day, selected = _a.selected, selectedDates = _a.selectedDates, selectsMultiple = _a.selectsMultiple;
9548
+ var quarterIdx = getQuarter(day);
9549
+ if (selectsMultiple) {
9550
+ return selectedDates === null || selectedDates === void 0 ? void 0 : selectedDates.some(function (selectedDate) {
9551
+ return _this.isSelectedQuarter(day, quarterIdx, selectedDate);
9552
+ });
9553
+ }
9554
+ return !!selected && _this.isSelectedQuarter(day, quarterIdx, selected);
9555
+ };
9532
9556
  _this.renderWeeks = function () {
9557
+ // Return empty array if day is invalid
9558
+ if (!isValid(_this.props.day)) {
9559
+ return [];
9560
+ }
9533
9561
  var weeks = [];
9534
9562
  var isFixedHeight = _this.props.fixedHeight;
9535
9563
  var i = 0;
@@ -9741,15 +9769,21 @@ var Month = /** @class */ (function (_super) {
9741
9769
  if (!_this.props.preSelection) {
9742
9770
  break;
9743
9771
  }
9744
- _this.handleQuarterNavigation(quarter === 1 ? 4 : quarter - 1, subQuarters(_this.props.preSelection, 1));
9772
+ _this.handleQuarterNavigation(quarter === 1 ? 4 : quarter - 1, subQuarters(_this.props.preSelection));
9745
9773
  break;
9746
9774
  }
9747
9775
  }
9748
9776
  };
9749
9777
  _this.isMonthDisabledForLabelDate = function (month) {
9750
9778
  var _a;
9751
- var _b = _this.props, day = _b.day, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates;
9779
+ var _b = _this.props, day = _b.day, disabled = _b.disabled, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates;
9752
9780
  var labelDate = setMonth(day, month);
9781
+ if (disabled) {
9782
+ return {
9783
+ isDisabled: true,
9784
+ labelDate: setMonth(day, month),
9785
+ };
9786
+ }
9753
9787
  return {
9754
9788
  isDisabled: (_a = ((minDate || maxDate || excludeDates || includeDates) &&
9755
9789
  isMonthDisabled(labelDate, _this.props))) !== null && _a !== void 0 ? _a : false,
@@ -9820,17 +9854,24 @@ var Month = /** @class */ (function (_super) {
9820
9854
  return "".concat(prefix, " ").concat(formatDate(labelDate, "MMMM yyyy", locale));
9821
9855
  };
9822
9856
  _this.getQuarterClassNames = function (q) {
9823
- var _a = _this.props, day = _a.day, startDate = _a.startDate, endDate = _a.endDate, selected = _a.selected, minDate = _a.minDate, maxDate = _a.maxDate, excludeDates = _a.excludeDates, includeDates = _a.includeDates, filterDate = _a.filterDate, preSelection = _a.preSelection, disabledKeyboardNavigation = _a.disabledKeyboardNavigation;
9824
- var isDisabled = (minDate || maxDate || excludeDates || includeDates || filterDate) &&
9857
+ var _a = _this.props, day = _a.day, startDate = _a.startDate, endDate = _a.endDate, minDate = _a.minDate, maxDate = _a.maxDate, excludeDates = _a.excludeDates, includeDates = _a.includeDates, filterDate = _a.filterDate, preSelection = _a.preSelection, disabledKeyboardNavigation = _a.disabledKeyboardNavigation, disabled = _a.disabled;
9858
+ var isDisabled = (minDate ||
9859
+ maxDate ||
9860
+ excludeDates ||
9861
+ includeDates ||
9862
+ filterDate ||
9863
+ disabled) &&
9825
9864
  isQuarterDisabled(setQuarter(day, q), _this.props);
9865
+ var selection = _this.getSelection();
9826
9866
  return clsx("react-datepicker__quarter-text", "react-datepicker__quarter-".concat(q), {
9827
9867
  "react-datepicker__quarter-text--disabled": isDisabled,
9828
- "react-datepicker__quarter-text--selected": selected
9829
- ? _this.isSelectedQuarter(day, q, selected)
9868
+ "react-datepicker__quarter-text--selected": selection
9869
+ ? _this.isSelectQuarterInList(day, q, selection)
9830
9870
  : undefined,
9831
9871
  "react-datepicker__quarter-text--keyboard-selected": !disabledKeyboardNavigation &&
9832
9872
  preSelection &&
9833
9873
  _this.isSelectedQuarter(day, q, preSelection) &&
9874
+ !_this.isQuarterSelected() &&
9834
9875
  !isDisabled,
9835
9876
  "react-datepicker__quarter-text--in-selecting-range": _this.isInSelectingRangeQuarter(q),
9836
9877
  "react-datepicker__quarter-text--in-range": startDate && endDate
@@ -9910,14 +9951,18 @@ var Month = /** @class */ (function (_super) {
9910
9951
  var formattedAriaLabelPrefix = ariaLabelPrefix
9911
9952
  ? ariaLabelPrefix.trim() + " "
9912
9953
  : "";
9954
+ // Format aria-label, return empty string if date is invalid
9955
+ var formattedAriaLabel = isValid(day)
9956
+ ? "".concat(formattedAriaLabelPrefix).concat(formatDate(day, "MMMM, yyyy", this.props.locale))
9957
+ : "";
9913
9958
  var shouldUseListboxRole = showMonthYearPicker || showQuarterYearPicker;
9914
9959
  if (shouldUseListboxRole) {
9915
- return (React__default.createElement("div", { className: this.getClassNames(), onMouseLeave: !this.props.usePointerEvent ? this.handleMouseLeave : undefined, onPointerLeave: this.props.usePointerEvent ? this.handleMouseLeave : undefined, "aria-label": "".concat(formattedAriaLabelPrefix).concat(formatDate(day, "MMMM, yyyy", this.props.locale)), role: "listbox" }, showMonthYearPicker ? this.renderMonths() : this.renderQuarters()));
9960
+ return (React__default.createElement("div", { className: this.getClassNames(), onMouseLeave: !this.props.usePointerEvent ? this.handleMouseLeave : undefined, onPointerLeave: this.props.usePointerEvent ? this.handleMouseLeave : undefined, "aria-label": formattedAriaLabel, role: "listbox" }, showMonthYearPicker ? this.renderMonths() : this.renderQuarters()));
9916
9961
  }
9917
9962
  // For regular calendar view, use table structure
9918
9963
  return (React__default.createElement("div", { role: "table" },
9919
9964
  this.props.dayNamesHeader && (React__default.createElement("div", { role: "rowgroup" }, this.props.dayNamesHeader)),
9920
- React__default.createElement("div", { className: this.getClassNames(), onMouseLeave: !this.props.usePointerEvent ? this.handleMouseLeave : undefined, onPointerLeave: this.props.usePointerEvent ? this.handleMouseLeave : undefined, "aria-label": "".concat(formattedAriaLabelPrefix).concat(formatDate(day, "MMMM, yyyy", this.props.locale)), role: "rowgroup" }, this.renderWeeks())));
9965
+ React__default.createElement("div", { className: this.getClassNames(), onMouseLeave: !this.props.usePointerEvent ? this.handleMouseLeave : undefined, onPointerLeave: this.props.usePointerEvent ? this.handleMouseLeave : undefined, "aria-label": formattedAriaLabel, role: "rowgroup" }, this.renderWeeks())));
9921
9966
  };
9922
9967
  return Month;
9923
9968
  }(Component));
@@ -10580,10 +10625,15 @@ var Year = /** @class */ (function (_super) {
10580
10625
  handleOnKeyDown && handleOnKeyDown(event);
10581
10626
  };
10582
10627
  _this.getYearClassNames = function (y) {
10583
- var _a = _this.props, date = _a.date, minDate = _a.minDate, maxDate = _a.maxDate, excludeDates = _a.excludeDates, includeDates = _a.includeDates, filterDate = _a.filterDate, yearClassName = _a.yearClassName;
10628
+ var _a = _this.props, date = _a.date, disabled = _a.disabled, minDate = _a.minDate, maxDate = _a.maxDate, excludeDates = _a.excludeDates, includeDates = _a.includeDates, filterDate = _a.filterDate, yearClassName = _a.yearClassName;
10584
10629
  return clsx("react-datepicker__year-text", "react-datepicker__year-".concat(y), date ? yearClassName === null || yearClassName === void 0 ? void 0 : yearClassName(setYear(date, y)) : undefined, {
10585
10630
  "react-datepicker__year-text--selected": _this.isSelectedYear(y),
10586
- "react-datepicker__year-text--disabled": (minDate || maxDate || excludeDates || includeDates || filterDate) &&
10631
+ "react-datepicker__year-text--disabled": (minDate ||
10632
+ maxDate ||
10633
+ excludeDates ||
10634
+ includeDates ||
10635
+ filterDate ||
10636
+ disabled) &&
10587
10637
  isYearDisabled(y, _this.props),
10588
10638
  "react-datepicker__year-text--keyboard-selected": _this.isKeyboardSelected(y),
10589
10639
  "react-datepicker__year-text--range-start": _this.isRangeStart(y),
@@ -11012,10 +11062,15 @@ var Calendar = /** @class */ (function (_super) {
11012
11062
  };
11013
11063
  _this.header = function (date) {
11014
11064
  if (date === void 0) { date = _this.state.date; }
11065
+ // Return empty array if date is invalid
11066
+ if (!isValid(date)) {
11067
+ return [];
11068
+ }
11069
+ var disabled = _this.props.disabled;
11015
11070
  var startOfWeek = getStartOfWeek(date, _this.props.locale, _this.props.calendarStartDay);
11016
11071
  var dayNames = [];
11017
11072
  if (_this.props.showWeekNumbers) {
11018
- dayNames.push(React__default.createElement("div", { key: "W", className: "react-datepicker__day-name", role: "columnheader" },
11073
+ dayNames.push(React__default.createElement("div", { key: "W", className: "react-datepicker__day-name ".concat(disabled ? "react-datepicker__day-name--disabled" : ""), role: "columnheader" },
11019
11074
  React__default.createElement("span", { className: "react-datepicker__sr-only" }, "Week number"),
11020
11075
  React__default.createElement("span", { "aria-hidden": "true" }, _this.props.weekLabel || "#")));
11021
11076
  }
@@ -11025,7 +11080,7 @@ var Calendar = /** @class */ (function (_super) {
11025
11080
  var weekDayClassName = _this.props.weekDayClassName
11026
11081
  ? _this.props.weekDayClassName(day)
11027
11082
  : undefined;
11028
- return (React__default.createElement("div", { key: offset, role: "columnheader", className: clsx("react-datepicker__day-name", weekDayClassName) },
11083
+ return (React__default.createElement("div", { key: offset, role: "columnheader", className: clsx("react-datepicker__day-name", weekDayClassName, disabled ? "react-datepicker__day-name--disabled" : "") },
11029
11084
  React__default.createElement("span", { className: "react-datepicker__sr-only" }, formatDate(day, "EEEE", _this.props.locale)),
11030
11085
  React__default.createElement("span", { "aria-hidden": "true" }, weekDayName)));
11031
11086
  }));
@@ -11065,6 +11120,9 @@ var Calendar = /** @class */ (function (_super) {
11065
11120
  var fromMonthDate = subMonths(_this.state.date, monthSelectedIn);
11066
11121
  var allPrevDaysDisabled;
11067
11122
  switch (true) {
11123
+ case _this.props.disabled:
11124
+ allPrevDaysDisabled = true;
11125
+ break;
11068
11126
  case _this.props.showMonthYearPicker:
11069
11127
  allPrevDaysDisabled = yearDisabledBefore(_this.state.date, _this.props);
11070
11128
  break;
@@ -11132,6 +11190,9 @@ var Calendar = /** @class */ (function (_super) {
11132
11190
  }
11133
11191
  var allNextDaysDisabled;
11134
11192
  switch (true) {
11193
+ case _this.props.disabled:
11194
+ allNextDaysDisabled = true;
11195
+ break;
11135
11196
  case _this.props.showMonthYearPicker:
11136
11197
  allNextDaysDisabled = yearDisabledAfter(_this.state.date, _this.props);
11137
11198
  break;
@@ -11199,7 +11260,9 @@ var Calendar = /** @class */ (function (_super) {
11199
11260
  if (_this.props.showMonthYearDropdown) {
11200
11261
  classes.push("react-datepicker__current-month--hasMonthYearDropdown");
11201
11262
  }
11202
- return (React__default.createElement("h2", { className: classes.join(" ") }, formatDate(date, _this.props.dateFormat, _this.props.locale)));
11263
+ return (React__default.createElement("h2", { className: classes.join(" ") }, isValid(date)
11264
+ ? formatDate(date, _this.props.dateFormat, _this.props.locale)
11265
+ : ""));
11203
11266
  };
11204
11267
  _this.renderYearDropdown = function (overrideHide) {
11205
11268
  if (overrideHide === void 0) { overrideHide = false; }
@@ -11349,6 +11412,10 @@ var Calendar = /** @class */ (function (_super) {
11349
11412
  };
11350
11413
  _this.renderAriaLiveRegion = function () {
11351
11414
  var _a;
11415
+ // Don't render aria-live message if date is invalid
11416
+ if (!isValid(_this.state.date)) {
11417
+ return (React__default.createElement("span", { role: "alert", "aria-live": "polite", className: "react-datepicker__aria-live" }));
11418
+ }
11352
11419
  var _b = getYearsPeriod(_this.state.date, (_a = _this.props.yearItemNumber) !== null && _a !== void 0 ? _a : Calendar.defaultProps.yearItemNumber), startPeriod = _b.startPeriod, endPeriod = _b.endPeriod;
11353
11420
  var ariaLiveMessage;
11354
11421
  if (_this.props.showYearPicker) {
@@ -11410,6 +11477,7 @@ var Calendar = /** @class */ (function (_super) {
11410
11477
  Calendar.prototype.componentDidUpdate = function (prevProps) {
11411
11478
  var _this = this;
11412
11479
  if (this.props.preSelection &&
11480
+ isValid(this.props.preSelection) &&
11413
11481
  (!isSameDay(this.props.preSelection, prevProps.preSelection) ||
11414
11482
  this.props.monthSelectedIn !== prevProps.monthSelectedIn)) {
11415
11483
  var hasMonthChanged_1 = !isSameMonth(this.state.date, this.props.preSelection);
@@ -11430,7 +11498,7 @@ var Calendar = /** @class */ (function (_super) {
11430
11498
  React__default.createElement("div", { style: { display: "contents" }, ref: this.containerRef },
11431
11499
  React__default.createElement(Container, { className: clsx("react-datepicker", this.props.className, {
11432
11500
  "react-datepicker--time-only": this.props.showTimeSelectOnly,
11433
- }), showTime: this.props.showTimeSelect || this.props.showTimeInput, showTimeSelectOnly: this.props.showTimeSelectOnly },
11501
+ }), showTime: this.props.showTimeSelect || this.props.showTimeInput, showTimeSelectOnly: this.props.showTimeSelectOnly, inline: this.props.inline },
11434
11502
  this.renderAriaLiveRegion(),
11435
11503
  this.renderPreviousButton(),
11436
11504
  this.renderNextButton(),
@@ -11624,6 +11692,7 @@ function withFloating(Component) {
11624
11692
  var floatingProps = useFloating(_assign({ open: !hidePopper, whileElementsMounted: autoUpdate, placement: props.popperPlacement, middleware: __spreadArray([
11625
11693
  flip({ padding: 15 }),
11626
11694
  offset(10),
11695
+ // eslint-disable-next-line react-hooks/refs -- Floating UI requires refs to be passed during render
11627
11696
  arrow({ element: arrowRef })
11628
11697
  ], ((_a = props.popperModifiers) !== null && _a !== void 0 ? _a : []), true) }, props.popperProps));
11629
11698
  var componentProps = _assign(_assign({}, props), { hidePopper: hidePopper, popperProps: _assign(_assign({}, floatingProps), { arrowRef: arrowRef }) });
@@ -11634,7 +11703,7 @@ function withFloating(Component) {
11634
11703
  }
11635
11704
 
11636
11705
  // Exported for testing purposes
11637
- var PopperComponent = function (props) {
11706
+ var PopperComponent$1 = function (props) {
11638
11707
  var className = props.className, wrapperClassName = props.wrapperClassName, _a = props.hidePopper, hidePopper = _a === void 0 ? true : _a, popperComponent = props.popperComponent, targetComponent = props.targetComponent, enableTabLoop = props.enableTabLoop, popperOnKeyDown = props.popperOnKeyDown, portalId = props.portalId, portalHost = props.portalHost, popperProps = props.popperProps, showArrow = props.showArrow;
11639
11708
  var popper = undefined;
11640
11709
  if (!hidePopper) {
@@ -11655,7 +11724,7 @@ var PopperComponent = function (props) {
11655
11724
  React__default.createElement("div", { ref: popperProps.refs.setReference, className: wrapperClasses }, targetComponent),
11656
11725
  popper));
11657
11726
  };
11658
- var PopperComponent$1 = withFloating(PopperComponent);
11727
+ var PopperComponent = withFloating(PopperComponent$1);
11659
11728
 
11660
11729
  // Compares dates year+month combinations
11661
11730
  function hasPreSelectionChanged(date1, date2) {
@@ -11933,9 +12002,11 @@ var DatePicker$1 = /** @class */ (function (_super) {
11933
12002
  }
11934
12003
  };
11935
12004
  _this.handleSelect = function (date, event, monthSelectedIn) {
12005
+ var _a;
11936
12006
  if (_this.props.readOnly)
11937
12007
  return;
11938
- var _a = _this.props, selectsRange = _a.selectsRange, startDate = _a.startDate, endDate = _a.endDate, swapRange = _a.swapRange;
12008
+ var _b = _this.props, selectsRange = _b.selectsRange, startDate = _b.startDate, endDate = _b.endDate, locale = _b.locale, swapRange = _b.swapRange;
12009
+ var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
11939
12010
  var isDateSelectionComplete = !selectsRange ||
11940
12011
  (startDate && !endDate && (swapRange || !isDateBefore(date, startDate)));
11941
12012
  if (_this.props.shouldCloseOnSelect &&
@@ -11946,7 +12017,11 @@ var DatePicker$1 = /** @class */ (function (_super) {
11946
12017
  _this.sendFocusBackToInput();
11947
12018
  }
11948
12019
  if (_this.props.onChangeRaw) {
11949
- _this.props.onChangeRaw(event);
12020
+ var formattedDate = safeDateFormat(date, {
12021
+ dateFormat: dateFormat,
12022
+ locale: locale,
12023
+ });
12024
+ _this.props.onChangeRaw(event, { date: date, formattedDate: formattedDate });
11950
12025
  }
11951
12026
  _this.setSelected(date, event, false, monthSelectedIn);
11952
12027
  if (_this.props.showDateSelect) {
@@ -12152,6 +12227,117 @@ var DatePicker$1 = /** @class */ (function (_super) {
12152
12227
  }
12153
12228
  (_b = (_a = _this.props).onInputClick) === null || _b === void 0 ? void 0 : _b.call(_a);
12154
12229
  };
12230
+ _this.handleTimeOnlyArrowKey = function (eventKey) {
12231
+ var _a, _b, _c, _d;
12232
+ var currentTime = _this.props.selected || _this.state.preSelection || newDate();
12233
+ var timeIntervals = (_a = _this.props.timeIntervals) !== null && _a !== void 0 ? _a : 30;
12234
+ var dateFormat = (_b = _this.props.dateFormat) !== null && _b !== void 0 ? _b : DatePicker.defaultProps.dateFormat;
12235
+ var formatStr = Array.isArray(dateFormat) ? dateFormat[0] : dateFormat;
12236
+ var baseDate = getStartOfDay(currentTime);
12237
+ var currentMinutes = getHours(currentTime) * 60 + getMinutes(currentTime);
12238
+ var maxMinutes = 23 * 60 + 60 - timeIntervals; // Cap at last valid interval of the day
12239
+ var newTime;
12240
+ if (eventKey === KeyType.ArrowUp) {
12241
+ var newMinutes = Math.max(0, currentMinutes - timeIntervals);
12242
+ newTime = addMinutes(baseDate, newMinutes);
12243
+ }
12244
+ else {
12245
+ var newMinutes = Math.min(maxMinutes, currentMinutes + timeIntervals);
12246
+ newTime = addMinutes(baseDate, newMinutes);
12247
+ }
12248
+ var formattedTime = formatDate(newTime, formatStr || DatePicker.defaultProps.dateFormat, _this.props.locale);
12249
+ _this.setState({
12250
+ preSelection: newTime,
12251
+ inputValue: formattedTime,
12252
+ });
12253
+ if (_this.props.selectsRange || _this.props.selectsMultiple) {
12254
+ return;
12255
+ }
12256
+ var selected = _this.props.selected
12257
+ ? _this.props.selected
12258
+ : _this.getPreSelection();
12259
+ var changedDate = _this.props.selected
12260
+ ? newTime
12261
+ : setTime(selected, {
12262
+ hour: getHours(newTime),
12263
+ minute: getMinutes(newTime),
12264
+ });
12265
+ (_d = (_c = _this.props).onChange) === null || _d === void 0 ? void 0 : _d.call(_c, changedDate);
12266
+ if (_this.props.showTimeSelectOnly || _this.props.showTimeSelect) {
12267
+ _this.setState({ isRenderAriaLiveMessage: true });
12268
+ }
12269
+ requestAnimationFrame(function () {
12270
+ _this.scrollToTimeOption(newTime);
12271
+ });
12272
+ };
12273
+ _this.handleTimeOnlyEnterKey = function (event) {
12274
+ var _a, _b, _c, _d;
12275
+ var inputElement = event.target;
12276
+ var inputValue = inputElement.value;
12277
+ var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
12278
+ var timeFormat = _this.props.timeFormat || "p";
12279
+ var defaultTime = _this.state.preSelection || _this.props.selected || newDate();
12280
+ var parsedDate = parseDate(inputValue, dateFormat, _this.props.locale, (_b = _this.props.strictParsing) !== null && _b !== void 0 ? _b : false, defaultTime);
12281
+ var timeToCommit = defaultTime;
12282
+ if (parsedDate && isValid(parsedDate)) {
12283
+ timeToCommit = parsedDate;
12284
+ }
12285
+ else {
12286
+ var highlightedItem = ((_c = _this.calendar) === null || _c === void 0 ? void 0 : _c.containerRef.current) instanceof Element &&
12287
+ _this.calendar.containerRef.current.querySelector(".react-datepicker__time-list-item[tabindex='0']");
12288
+ if (highlightedItem instanceof HTMLElement) {
12289
+ var itemText = (_d = highlightedItem.textContent) === null || _d === void 0 ? void 0 : _d.trim();
12290
+ if (itemText) {
12291
+ var itemTime = parseDate(itemText, timeFormat, _this.props.locale, false, defaultTime);
12292
+ if (itemTime && isValid(itemTime)) {
12293
+ timeToCommit = itemTime;
12294
+ }
12295
+ }
12296
+ }
12297
+ }
12298
+ _this.handleTimeChange(timeToCommit);
12299
+ _this.setOpen(false);
12300
+ _this.sendFocusBackToInput();
12301
+ };
12302
+ _this.scrollToTimeOption = function (time) {
12303
+ var _a, _b;
12304
+ if (!((_a = _this.calendar) === null || _a === void 0 ? void 0 : _a.containerRef.current)) {
12305
+ return;
12306
+ }
12307
+ var container = _this.calendar.containerRef.current;
12308
+ var timeListItems = Array.from(container.querySelectorAll(".react-datepicker__time-list-item"));
12309
+ var targetItem = null;
12310
+ var closestTimeDiff = Infinity;
12311
+ var timeFormat = _this.props.timeFormat || "p";
12312
+ for (var _i = 0, timeListItems_1 = timeListItems; _i < timeListItems_1.length; _i++) {
12313
+ var item = timeListItems_1[_i];
12314
+ var itemText = (_b = item.textContent) === null || _b === void 0 ? void 0 : _b.trim();
12315
+ if (itemText) {
12316
+ var itemTime = parseDate(itemText, timeFormat, _this.props.locale, false, time);
12317
+ if (itemTime && isValid(itemTime)) {
12318
+ if (isSameMinute(itemTime, time)) {
12319
+ targetItem = item;
12320
+ break;
12321
+ }
12322
+ var timeDiff = Math.abs(itemTime.getTime() - time.getTime());
12323
+ if (timeDiff < closestTimeDiff) {
12324
+ closestTimeDiff = timeDiff;
12325
+ targetItem = item;
12326
+ }
12327
+ }
12328
+ }
12329
+ }
12330
+ if (targetItem) {
12331
+ timeListItems.forEach(function (item) {
12332
+ item.setAttribute("tabindex", "-1");
12333
+ });
12334
+ targetItem.setAttribute("tabindex", "0");
12335
+ targetItem.scrollIntoView({
12336
+ behavior: "smooth",
12337
+ block: "center",
12338
+ });
12339
+ }
12340
+ };
12155
12341
  _this.onInputKeyDown = function (event) {
12156
12342
  var _a, _b, _c, _d, _e, _f;
12157
12343
  (_b = (_a = _this.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, event);
@@ -12166,6 +12352,18 @@ var DatePicker$1 = /** @class */ (function (_super) {
12166
12352
  }
12167
12353
  return;
12168
12354
  }
12355
+ if (_this.state.open && _this.props.showTimeSelectOnly) {
12356
+ if (eventKey === KeyType.ArrowDown || eventKey === KeyType.ArrowUp) {
12357
+ event.preventDefault();
12358
+ _this.handleTimeOnlyArrowKey(eventKey);
12359
+ return;
12360
+ }
12361
+ if (eventKey === KeyType.Enter) {
12362
+ event.preventDefault();
12363
+ _this.handleTimeOnlyEnterKey(event);
12364
+ return;
12365
+ }
12366
+ }
12169
12367
  // if calendar is open, these keys will focus the selected item
12170
12368
  if (_this.state.open) {
12171
12369
  if (eventKey === KeyType.ArrowDown || eventKey === KeyType.ArrowUp) {
@@ -12246,11 +12444,11 @@ var DatePicker$1 = /** @class */ (function (_super) {
12246
12444
  break;
12247
12445
  case KeyType.ArrowLeft:
12248
12446
  newCalculatedDate = showWeekPicker
12249
- ? subWeeks(date, 1)
12250
- : subDays(date, 1);
12447
+ ? subWeeks(date)
12448
+ : subDays(date);
12251
12449
  break;
12252
12450
  case KeyType.ArrowUp:
12253
- newCalculatedDate = subWeeks(date, 1);
12451
+ newCalculatedDate = subWeeks(date);
12254
12452
  break;
12255
12453
  case KeyType.ArrowDown:
12256
12454
  newCalculatedDate = addWeeks(date, 1);
@@ -12356,20 +12554,12 @@ var DatePicker$1 = /** @class */ (function (_super) {
12356
12554
  _this.setSelected(newSelection);
12357
12555
  }
12358
12556
  _this.setPreSelection(newSelection);
12359
- // need to figure out whether month has changed to focus day in inline version
12557
+ // In inline mode, always set shouldFocusDayInline to true when navigating via keyboard.
12558
+ // This ensures focus is properly transferred to the new day element regardless of
12559
+ // whether the month changed. The user initiated this navigation from a focused day,
12560
+ // so we should always focus the destination day.
12360
12561
  if (inline) {
12361
- var prevMonth = getMonth(copy);
12362
- var newMonth = getMonth(newSelection);
12363
- var prevYear = getYear(copy);
12364
- var newYear = getYear(newSelection);
12365
- if (prevMonth !== newMonth || prevYear !== newYear) {
12366
- // month has changed
12367
- _this.setState({ shouldFocusDayInline: true });
12368
- }
12369
- else {
12370
- // month hasn't changed
12371
- _this.setState({ shouldFocusDayInline: false });
12372
- }
12562
+ _this.setState({ shouldFocusDayInline: true });
12373
12563
  }
12374
12564
  };
12375
12565
  // handle generic key down events in the popper that do not adjust or select dates
@@ -12471,39 +12661,31 @@ var DatePicker$1 = /** @class */ (function (_super) {
12471
12661
  };
12472
12662
  _this.renderDateInput = function () {
12473
12663
  var _a, _b;
12664
+ var _c, _d, _e, _f;
12474
12665
  var className = clsx(_this.props.className, (_a = {},
12475
12666
  _a[_this.props.outsideClickIgnoreClass ||
12476
12667
  DatePicker.defaultProps.outsideClickIgnoreClass] = _this.state.open,
12477
12668
  _a));
12478
12669
  var customInput = _this.props.customInput || React__default.createElement("input", { type: "text" });
12479
12670
  var customInputRef = _this.props.customInputRef || "ref";
12480
- return cloneElement(customInput, (_b = {},
12481
- _b[customInputRef] = function (input) {
12482
- _this.input = input;
12483
- },
12484
- _b.value = _this.getInputValue(),
12485
- _b.onBlur = _this.handleBlur,
12486
- _b.onChange = _this.handleChange,
12487
- _b.onClick = _this.onInputClick,
12488
- _b.onFocus = _this.handleFocus,
12489
- _b.onKeyDown = _this.onInputKeyDown,
12490
- _b.id = _this.props.id,
12491
- _b.name = _this.props.name,
12492
- _b.form = _this.props.form,
12493
- _b.autoFocus = _this.props.autoFocus,
12494
- _b.placeholder = _this.props.placeholderText,
12495
- _b.disabled = _this.props.disabled,
12496
- _b.autoComplete = _this.props.autoComplete,
12497
- _b.className = clsx(customInput.props.className, className),
12498
- _b.title = _this.props.title,
12499
- _b.readOnly = _this.props.readOnly,
12500
- _b.required = _this.props.required,
12501
- _b.tabIndex = _this.props.tabIndex,
12502
- _b["aria-describedby"] = _this.props.ariaDescribedBy,
12503
- _b["aria-invalid"] = _this.props.ariaInvalid,
12504
- _b["aria-labelledby"] = _this.props.ariaLabelledBy,
12505
- _b["aria-required"] = _this.props.ariaRequired,
12506
- _b));
12671
+ // Build aria props object, only including defined values to avoid
12672
+ // overwriting aria attributes that may be set on the custom input
12673
+ var ariaProps = {};
12674
+ var ariaDescribedBy = (_c = _this.props["aria-describedby"]) !== null && _c !== void 0 ? _c : _this.props.ariaDescribedBy;
12675
+ var ariaInvalid = (_d = _this.props["aria-invalid"]) !== null && _d !== void 0 ? _d : _this.props.ariaInvalid;
12676
+ var ariaLabelledBy = (_e = _this.props["aria-labelledby"]) !== null && _e !== void 0 ? _e : _this.props.ariaLabelledBy;
12677
+ var ariaRequired = (_f = _this.props["aria-required"]) !== null && _f !== void 0 ? _f : _this.props.ariaRequired;
12678
+ if (ariaDescribedBy != null)
12679
+ ariaProps["aria-describedby"] = ariaDescribedBy;
12680
+ if (ariaInvalid != null)
12681
+ ariaProps["aria-invalid"] = ariaInvalid;
12682
+ if (ariaLabelledBy != null)
12683
+ ariaProps["aria-labelledby"] = ariaLabelledBy;
12684
+ if (ariaRequired != null)
12685
+ ariaProps["aria-required"] = ariaRequired;
12686
+ return cloneElement(customInput, _assign((_b = {}, _b[customInputRef] = function (input) {
12687
+ _this.input = input;
12688
+ }, _b.value = _this.getInputValue(), _b.onBlur = _this.handleBlur, _b.onChange = _this.handleChange, _b.onClick = _this.onInputClick, _b.onFocus = _this.handleFocus, _b.onKeyDown = _this.onInputKeyDown, _b.id = _this.props.id, _b.name = _this.props.name, _b.form = _this.props.form, _b.autoFocus = _this.props.autoFocus, _b.placeholder = _this.props.placeholderText, _b.disabled = _this.props.disabled, _b.autoComplete = _this.props.autoComplete, _b.className = clsx(customInput.props.className, className), _b.title = _this.props.title, _b.readOnly = _this.props.readOnly, _b.required = _this.props.required, _b.tabIndex = _this.props.tabIndex, _b), ariaProps));
12507
12689
  };
12508
12690
  _this.renderClearButton = function () {
12509
12691
  var _a = _this.props, isClearable = _a.isClearable, disabled = _a.disabled, selected = _a.selected, startDate = _a.startDate, endDate = _a.endDate, clearButtonTitle = _a.clearButtonTitle, _b = _a.clearButtonClassName, clearButtonClassName = _b === void 0 ? "" : _b, _c = _a.ariaLabelClose, ariaLabelClose = _c === void 0 ? "Close" : _c, selectedDates = _a.selectedDates, readOnly = _a.readOnly;
@@ -12591,6 +12773,9 @@ var DatePicker$1 = /** @class */ (function (_super) {
12591
12773
  prevProps.monthsShown !== this.props.monthsShown) {
12592
12774
  this.setState({ monthSelectedIn: 0 });
12593
12775
  }
12776
+ if (this.props.selectsRange && this.state.monthSelectedIn !== 0) {
12777
+ this.setState({ monthSelectedIn: 0 });
12778
+ }
12594
12779
  if (prevProps.highlightDates !== this.props.highlightDates) {
12595
12780
  this.setState({
12596
12781
  highlightDates: getHighLightDaysMap(this.props.highlightDates),
@@ -12644,14 +12829,14 @@ var DatePicker$1 = /** @class */ (function (_super) {
12644
12829
  this.renderInputContainer(),
12645
12830
  portalContainer));
12646
12831
  }
12647
- return (React__default.createElement(PopperComponent$1, _assign({}, this.props, { className: this.props.popperClassName, hidePopper: !this.isCalendarOpen(), targetComponent: this.renderInputContainer(), popperComponent: calendar, popperOnKeyDown: this.onPopperKeyDown, showArrow: this.props.showPopperArrow })));
12832
+ return (React__default.createElement(PopperComponent, _assign({}, this.props, { className: this.props.popperClassName, hidePopper: !this.isCalendarOpen(), targetComponent: this.renderInputContainer(), popperComponent: calendar, popperOnKeyDown: this.onPopperKeyDown, showArrow: this.props.showPopperArrow })));
12648
12833
  };
12649
12834
  return DatePicker;
12650
12835
  }(Component));
12651
12836
  var PRESELECT_CHANGE_VIA_INPUT = "input";
12652
12837
  var PRESELECT_CHANGE_VIA_NAVIGATE = "navigate";
12653
12838
 
12654
- var styles = {"datePickerWrapper":"OmFI-Bfdzgw-","fullWidth":"HWDFy10kcYA-","datePicker":"Ma55F5Y-XhE-","inline":"_58kEbTu-IAA-","portalContainer":"LDxKi0E-1rg-","header":"Epg-Ub8Dn9A-","month":"Wx3NP8La95k-","spinning":"o0JLwNATy-M-"};
12839
+ var styles = {"datePickerWrapper":"OmFI-Bfdzgw-","fullWidth":"HWDFy10kcYA-","datePicker":"Ma55F5Y-XhE-","inline":"_58kEbTu-IAA-","portalContainer":"LDxKi0E-1rg-","header":"Epg-Ub8Dn9A-","month":"Wx3NP8La95k-"};
12655
12840
 
12656
12841
  function DatePickerCustomHeader({ monthDate, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled, }) {
12657
12842
  return (React__default.createElement("div", { className: styles.header },