@jobber/components 6.123.1 → 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 (230) 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 +1 -1
  10. package/dist/BottomSheet-es.js +1 -1
  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/showToast-cjs.js +1 -1
  224. package/dist/showToast-es.js +1 -1
  225. package/dist/styles.css +56 -124
  226. package/dist/unstyledPrimitives/index.mjs +3 -3
  227. package/dist/useScrollToActive-cjs.js +1 -1
  228. package/dist/useScrollToActive-es.js +8 -8
  229. package/package.json +32 -15
  230. package/rollup.config.mjs +4 -1
@@ -2458,8 +2458,6 @@ const lightFormatters = {
2458
2458
  };
2459
2459
 
2460
2460
  const dayPeriodEnum = {
2461
- am: "am",
2462
- pm: "pm",
2463
2461
  midnight: "midnight",
2464
2462
  noon: "noon",
2465
2463
  morning: "morning",
@@ -6829,7 +6827,7 @@ function isWithinInterval(date, interval, options) {
6829
6827
  * //=> Fri Aug 22 2014 00:00:00
6830
6828
  */
6831
6829
  function subDays(date, amount, options) {
6832
- return addDays(date, -amount, options);
6830
+ return addDays(date, -1, options);
6833
6831
  }
6834
6832
 
6835
6833
  /**
@@ -7380,7 +7378,7 @@ function subMonths(date, amount, options) {
7380
7378
  * //=> Sun Dec 01 2013 00:00:00
7381
7379
  */
7382
7380
  function subQuarters(date, amount, options) {
7383
- return addQuarters(date, -amount, options);
7381
+ return addQuarters(date, -1, options);
7384
7382
  }
7385
7383
 
7386
7384
  /**
@@ -7410,7 +7408,7 @@ function subQuarters(date, amount, options) {
7410
7408
  * //=> Mon Aug 04 2014 00:00:00
7411
7409
  */
7412
7410
  function subWeeks(date, amount, options) {
7413
- return addWeeks(date, -amount, options);
7411
+ return addWeeks(date, -1, options);
7414
7412
  }
7415
7413
 
7416
7414
  /**
@@ -7444,7 +7442,7 @@ function subYears(date, amount, options) {
7444
7442
  }
7445
7443
 
7446
7444
  /*!
7447
- react-datepicker v8.7.0
7445
+ react-datepicker v8.10.0
7448
7446
  https://github.com/Hacker0x01/react-datepicker
7449
7447
  Released under the MIT License.
7450
7448
  */
@@ -7508,17 +7506,19 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
7508
7506
  };
7509
7507
 
7510
7508
  var CalendarContainer = function (_a) {
7511
- 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;
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, inline = _a.inline;
7512
7510
  var ariaLabel = showTimeSelectOnly
7513
7511
  ? "Choose Time"
7514
7512
  : "Choose Date".concat(showTime ? " and Time" : "");
7515
- return (React.createElement("div", { className: className, role: "dialog", "aria-label": ariaLabel, "aria-modal": "true" }, children));
7513
+ return (React.createElement("div", { className: className, "aria-label": ariaLabel, role: inline ? undefined : "dialog", "aria-modal": inline ? undefined : "true" }, children));
7516
7514
  };
7517
7515
 
7518
7516
  var useDetectClickOutside = function (onClickOutside, ignoreClass) {
7519
7517
  var ref = React.useRef(null);
7520
7518
  var onClickOutsideRef = React.useRef(onClickOutside);
7521
- onClickOutsideRef.current = onClickOutside;
7519
+ React.useEffect(function () {
7520
+ onClickOutsideRef.current = onClickOutside;
7521
+ }, [onClickOutside]);
7522
7522
  var handleClickOutside = React.useCallback(function (event) {
7523
7523
  var _a;
7524
7524
  var target = (event.composed &&
@@ -7604,10 +7604,7 @@ function parseDate(value, dateFormat, locale, strictParsing, refDate) {
7604
7604
  for (var _i = 0, formats_1 = formats; _i < formats_1.length; _i++) {
7605
7605
  var format_1 = formats_1[_i];
7606
7606
  var parsedDate = parse(value, format_1, refDate, {
7607
- locale: localeObject,
7608
- useAdditionalWeekYearTokens: true,
7609
- useAdditionalDayOfYearTokens: true,
7610
- });
7607
+ locale: localeObject});
7611
7608
  if (isValid(parsedDate) &&
7612
7609
  (!strictParsing || value === formatDate(parsedDate, format_1, locale))) {
7613
7610
  return parsedDate;
@@ -8024,7 +8021,10 @@ function getQuarterShortInLocale(quarter, locale) {
8024
8021
  * @returns - Returns true if the day is disabled, false otherwise.
8025
8022
  */
8026
8023
  function isDayDisabled(day, _a) {
8027
- 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;
8024
+ 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;
8025
+ if (disabled) {
8026
+ return true;
8027
+ }
8028
8028
  return (isOutOfBounds(day, { minDate: minDate, maxDate: maxDate }) ||
8029
8029
  (excludeDates &&
8030
8030
  excludeDates.some(function (excludeDate) {
@@ -8124,7 +8124,10 @@ function isMonthYearDisabled(date, _a) {
8124
8124
  false);
8125
8125
  }
8126
8126
  function isQuarterDisabled(quarter, _a) {
8127
- var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate;
8127
+ var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate, disabled = _b.disabled;
8128
+ if (disabled) {
8129
+ return true;
8130
+ }
8128
8131
  return (isOutOfBounds(quarter, { minDate: minDate, maxDate: maxDate }) ||
8129
8132
  (excludeDates === null || excludeDates === void 0 ? void 0 : excludeDates.some(function (excludeDate) {
8130
8133
  return isSameQuarter(quarter, excludeDate instanceof Date ? excludeDate : excludeDate.date);
@@ -8146,7 +8149,10 @@ function isYearInRange(year, start, end) {
8146
8149
  return startYear <= year && endYear >= year;
8147
8150
  }
8148
8151
  function isYearDisabled(year, _a) {
8149
- var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate;
8152
+ var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate, disabled = _b.disabled;
8153
+ if (disabled) {
8154
+ return true;
8155
+ }
8150
8156
  var date = new Date(year, 0, 1);
8151
8157
  return (isOutOfBounds(date, {
8152
8158
  minDate: minDate ? startOfYear(minDate) : undefined,
@@ -8218,6 +8224,7 @@ function isTimeInDisabledRange(time, _a) {
8218
8224
  valid = !isWithinInterval(baseTime, { start: min, end: max });
8219
8225
  }
8220
8226
  catch (err) {
8227
+ /* istanbul ignore next - date-fns historically threw on invalid intervals */
8221
8228
  valid = false;
8222
8229
  }
8223
8230
  return valid;
@@ -8243,7 +8250,7 @@ function monthDisabledAfter(day, _a) {
8243
8250
  function quarterDisabledBefore(date, _a) {
8244
8251
  var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, includeDates = _b.includeDates;
8245
8252
  var firstDateOfYear = startOfYear(date);
8246
- var previousQuarter = subQuarters(firstDateOfYear, 1);
8253
+ var previousQuarter = subQuarters(firstDateOfYear);
8247
8254
  return ((minDate && differenceInCalendarQuarters(minDate, previousQuarter) > 0) ||
8248
8255
  (includeDates &&
8249
8256
  includeDates.every(function (includeDate) {
@@ -8736,6 +8743,7 @@ var Day = /** @class */ (function (_super) {
8736
8743
  includeDateIntervals: _this.props.includeDateIntervals,
8737
8744
  includeDates: _this.props.includeDates,
8738
8745
  filterDate: _this.props.filterDate,
8746
+ disabled: _this.props.disabled,
8739
8747
  });
8740
8748
  };
8741
8749
  _this.isExcluded = function () {
@@ -9383,6 +9391,7 @@ var Month = /** @class */ (function (_super) {
9383
9391
  includeDateIntervals: _this.props.includeDateIntervals,
9384
9392
  includeDates: _this.props.includeDates,
9385
9393
  filterDate: _this.props.filterDate,
9394
+ disabled: _this.props.disabled,
9386
9395
  });
9387
9396
  };
9388
9397
  _this.isExcluded = function (day) {
@@ -9519,7 +9528,12 @@ var Month = /** @class */ (function (_super) {
9519
9528
  });
9520
9529
  };
9521
9530
  _this.isSelectedQuarter = function (day, q, selected) {
9522
- return getQuarter(day) === q && getYear(day) === getYear(selected);
9531
+ return getQuarter(selected) === q && getYear(day) === getYear(selected);
9532
+ };
9533
+ _this.isSelectQuarterInList = function (day, q, selectedDates) {
9534
+ return selectedDates.some(function (selectedDate) {
9535
+ return _this.isSelectedQuarter(day, q, selectedDate);
9536
+ });
9523
9537
  };
9524
9538
  _this.isMonthSelected = function () {
9525
9539
  var _a = _this.props, day = _a.day, selected = _a.selected, selectedDates = _a.selectedDates, selectsMultiple = _a.selectsMultiple;
@@ -9531,7 +9545,21 @@ var Month = /** @class */ (function (_super) {
9531
9545
  }
9532
9546
  return !!selected && _this.isSelectedMonth(day, monthIdx, selected);
9533
9547
  };
9548
+ _this.isQuarterSelected = function () {
9549
+ var _a = _this.props, day = _a.day, selected = _a.selected, selectedDates = _a.selectedDates, selectsMultiple = _a.selectsMultiple;
9550
+ var quarterIdx = getQuarter(day);
9551
+ if (selectsMultiple) {
9552
+ return selectedDates === null || selectedDates === void 0 ? void 0 : selectedDates.some(function (selectedDate) {
9553
+ return _this.isSelectedQuarter(day, quarterIdx, selectedDate);
9554
+ });
9555
+ }
9556
+ return !!selected && _this.isSelectedQuarter(day, quarterIdx, selected);
9557
+ };
9534
9558
  _this.renderWeeks = function () {
9559
+ // Return empty array if day is invalid
9560
+ if (!isValid(_this.props.day)) {
9561
+ return [];
9562
+ }
9535
9563
  var weeks = [];
9536
9564
  var isFixedHeight = _this.props.fixedHeight;
9537
9565
  var i = 0;
@@ -9743,15 +9771,21 @@ var Month = /** @class */ (function (_super) {
9743
9771
  if (!_this.props.preSelection) {
9744
9772
  break;
9745
9773
  }
9746
- _this.handleQuarterNavigation(quarter === 1 ? 4 : quarter - 1, subQuarters(_this.props.preSelection, 1));
9774
+ _this.handleQuarterNavigation(quarter === 1 ? 4 : quarter - 1, subQuarters(_this.props.preSelection));
9747
9775
  break;
9748
9776
  }
9749
9777
  }
9750
9778
  };
9751
9779
  _this.isMonthDisabledForLabelDate = function (month) {
9752
9780
  var _a;
9753
- var _b = _this.props, day = _b.day, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates;
9781
+ var _b = _this.props, day = _b.day, disabled = _b.disabled, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates;
9754
9782
  var labelDate = setMonth(day, month);
9783
+ if (disabled) {
9784
+ return {
9785
+ isDisabled: true,
9786
+ labelDate: setMonth(day, month),
9787
+ };
9788
+ }
9755
9789
  return {
9756
9790
  isDisabled: (_a = ((minDate || maxDate || excludeDates || includeDates) &&
9757
9791
  isMonthDisabled(labelDate, _this.props))) !== null && _a !== void 0 ? _a : false,
@@ -9822,17 +9856,24 @@ var Month = /** @class */ (function (_super) {
9822
9856
  return "".concat(prefix, " ").concat(formatDate(labelDate, "MMMM yyyy", locale));
9823
9857
  };
9824
9858
  _this.getQuarterClassNames = function (q) {
9825
- 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;
9826
- var isDisabled = (minDate || maxDate || excludeDates || includeDates || filterDate) &&
9859
+ 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;
9860
+ var isDisabled = (minDate ||
9861
+ maxDate ||
9862
+ excludeDates ||
9863
+ includeDates ||
9864
+ filterDate ||
9865
+ disabled) &&
9827
9866
  isQuarterDisabled(setQuarter(day, q), _this.props);
9867
+ var selection = _this.getSelection();
9828
9868
  return clsx.clsx("react-datepicker__quarter-text", "react-datepicker__quarter-".concat(q), {
9829
9869
  "react-datepicker__quarter-text--disabled": isDisabled,
9830
- "react-datepicker__quarter-text--selected": selected
9831
- ? _this.isSelectedQuarter(day, q, selected)
9870
+ "react-datepicker__quarter-text--selected": selection
9871
+ ? _this.isSelectQuarterInList(day, q, selection)
9832
9872
  : undefined,
9833
9873
  "react-datepicker__quarter-text--keyboard-selected": !disabledKeyboardNavigation &&
9834
9874
  preSelection &&
9835
9875
  _this.isSelectedQuarter(day, q, preSelection) &&
9876
+ !_this.isQuarterSelected() &&
9836
9877
  !isDisabled,
9837
9878
  "react-datepicker__quarter-text--in-selecting-range": _this.isInSelectingRangeQuarter(q),
9838
9879
  "react-datepicker__quarter-text--in-range": startDate && endDate
@@ -9912,14 +9953,18 @@ var Month = /** @class */ (function (_super) {
9912
9953
  var formattedAriaLabelPrefix = ariaLabelPrefix
9913
9954
  ? ariaLabelPrefix.trim() + " "
9914
9955
  : "";
9956
+ // Format aria-label, return empty string if date is invalid
9957
+ var formattedAriaLabel = isValid(day)
9958
+ ? "".concat(formattedAriaLabelPrefix).concat(formatDate(day, "MMMM, yyyy", this.props.locale))
9959
+ : "";
9915
9960
  var shouldUseListboxRole = showMonthYearPicker || showQuarterYearPicker;
9916
9961
  if (shouldUseListboxRole) {
9917
- return (React.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()));
9962
+ return (React.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()));
9918
9963
  }
9919
9964
  // For regular calendar view, use table structure
9920
9965
  return (React.createElement("div", { role: "table" },
9921
9966
  this.props.dayNamesHeader && (React.createElement("div", { role: "rowgroup" }, this.props.dayNamesHeader)),
9922
- React.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())));
9967
+ React.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())));
9923
9968
  };
9924
9969
  return Month;
9925
9970
  }(React.Component));
@@ -10582,10 +10627,15 @@ var Year = /** @class */ (function (_super) {
10582
10627
  handleOnKeyDown && handleOnKeyDown(event);
10583
10628
  };
10584
10629
  _this.getYearClassNames = function (y) {
10585
- 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;
10630
+ 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;
10586
10631
  return clsx.clsx("react-datepicker__year-text", "react-datepicker__year-".concat(y), date ? yearClassName === null || yearClassName === void 0 ? void 0 : yearClassName(setYear(date, y)) : undefined, {
10587
10632
  "react-datepicker__year-text--selected": _this.isSelectedYear(y),
10588
- "react-datepicker__year-text--disabled": (minDate || maxDate || excludeDates || includeDates || filterDate) &&
10633
+ "react-datepicker__year-text--disabled": (minDate ||
10634
+ maxDate ||
10635
+ excludeDates ||
10636
+ includeDates ||
10637
+ filterDate ||
10638
+ disabled) &&
10589
10639
  isYearDisabled(y, _this.props),
10590
10640
  "react-datepicker__year-text--keyboard-selected": _this.isKeyboardSelected(y),
10591
10641
  "react-datepicker__year-text--range-start": _this.isRangeStart(y),
@@ -11014,10 +11064,15 @@ var Calendar = /** @class */ (function (_super) {
11014
11064
  };
11015
11065
  _this.header = function (date) {
11016
11066
  if (date === void 0) { date = _this.state.date; }
11067
+ // Return empty array if date is invalid
11068
+ if (!isValid(date)) {
11069
+ return [];
11070
+ }
11071
+ var disabled = _this.props.disabled;
11017
11072
  var startOfWeek = getStartOfWeek(date, _this.props.locale, _this.props.calendarStartDay);
11018
11073
  var dayNames = [];
11019
11074
  if (_this.props.showWeekNumbers) {
11020
- dayNames.push(React.createElement("div", { key: "W", className: "react-datepicker__day-name", role: "columnheader" },
11075
+ dayNames.push(React.createElement("div", { key: "W", className: "react-datepicker__day-name ".concat(disabled ? "react-datepicker__day-name--disabled" : ""), role: "columnheader" },
11021
11076
  React.createElement("span", { className: "react-datepicker__sr-only" }, "Week number"),
11022
11077
  React.createElement("span", { "aria-hidden": "true" }, _this.props.weekLabel || "#")));
11023
11078
  }
@@ -11027,7 +11082,7 @@ var Calendar = /** @class */ (function (_super) {
11027
11082
  var weekDayClassName = _this.props.weekDayClassName
11028
11083
  ? _this.props.weekDayClassName(day)
11029
11084
  : undefined;
11030
- return (React.createElement("div", { key: offset, role: "columnheader", className: clsx.clsx("react-datepicker__day-name", weekDayClassName) },
11085
+ return (React.createElement("div", { key: offset, role: "columnheader", className: clsx.clsx("react-datepicker__day-name", weekDayClassName, disabled ? "react-datepicker__day-name--disabled" : "") },
11031
11086
  React.createElement("span", { className: "react-datepicker__sr-only" }, formatDate(day, "EEEE", _this.props.locale)),
11032
11087
  React.createElement("span", { "aria-hidden": "true" }, weekDayName)));
11033
11088
  }));
@@ -11067,6 +11122,9 @@ var Calendar = /** @class */ (function (_super) {
11067
11122
  var fromMonthDate = subMonths(_this.state.date, monthSelectedIn);
11068
11123
  var allPrevDaysDisabled;
11069
11124
  switch (true) {
11125
+ case _this.props.disabled:
11126
+ allPrevDaysDisabled = true;
11127
+ break;
11070
11128
  case _this.props.showMonthYearPicker:
11071
11129
  allPrevDaysDisabled = yearDisabledBefore(_this.state.date, _this.props);
11072
11130
  break;
@@ -11134,6 +11192,9 @@ var Calendar = /** @class */ (function (_super) {
11134
11192
  }
11135
11193
  var allNextDaysDisabled;
11136
11194
  switch (true) {
11195
+ case _this.props.disabled:
11196
+ allNextDaysDisabled = true;
11197
+ break;
11137
11198
  case _this.props.showMonthYearPicker:
11138
11199
  allNextDaysDisabled = yearDisabledAfter(_this.state.date, _this.props);
11139
11200
  break;
@@ -11201,7 +11262,9 @@ var Calendar = /** @class */ (function (_super) {
11201
11262
  if (_this.props.showMonthYearDropdown) {
11202
11263
  classes.push("react-datepicker__current-month--hasMonthYearDropdown");
11203
11264
  }
11204
- return (React.createElement("h2", { className: classes.join(" ") }, formatDate(date, _this.props.dateFormat, _this.props.locale)));
11265
+ return (React.createElement("h2", { className: classes.join(" ") }, isValid(date)
11266
+ ? formatDate(date, _this.props.dateFormat, _this.props.locale)
11267
+ : ""));
11205
11268
  };
11206
11269
  _this.renderYearDropdown = function (overrideHide) {
11207
11270
  if (overrideHide === void 0) { overrideHide = false; }
@@ -11351,6 +11414,10 @@ var Calendar = /** @class */ (function (_super) {
11351
11414
  };
11352
11415
  _this.renderAriaLiveRegion = function () {
11353
11416
  var _a;
11417
+ // Don't render aria-live message if date is invalid
11418
+ if (!isValid(_this.state.date)) {
11419
+ return (React.createElement("span", { role: "alert", "aria-live": "polite", className: "react-datepicker__aria-live" }));
11420
+ }
11354
11421
  var _b = getYearsPeriod(_this.state.date, (_a = _this.props.yearItemNumber) !== null && _a !== void 0 ? _a : Calendar.defaultProps.yearItemNumber), startPeriod = _b.startPeriod, endPeriod = _b.endPeriod;
11355
11422
  var ariaLiveMessage;
11356
11423
  if (_this.props.showYearPicker) {
@@ -11412,6 +11479,7 @@ var Calendar = /** @class */ (function (_super) {
11412
11479
  Calendar.prototype.componentDidUpdate = function (prevProps) {
11413
11480
  var _this = this;
11414
11481
  if (this.props.preSelection &&
11482
+ isValid(this.props.preSelection) &&
11415
11483
  (!isSameDay(this.props.preSelection, prevProps.preSelection) ||
11416
11484
  this.props.monthSelectedIn !== prevProps.monthSelectedIn)) {
11417
11485
  var hasMonthChanged_1 = !isSameMonth(this.state.date, this.props.preSelection);
@@ -11432,7 +11500,7 @@ var Calendar = /** @class */ (function (_super) {
11432
11500
  React.createElement("div", { style: { display: "contents" }, ref: this.containerRef },
11433
11501
  React.createElement(Container, { className: clsx.clsx("react-datepicker", this.props.className, {
11434
11502
  "react-datepicker--time-only": this.props.showTimeSelectOnly,
11435
- }), showTime: this.props.showTimeSelect || this.props.showTimeInput, showTimeSelectOnly: this.props.showTimeSelectOnly },
11503
+ }), showTime: this.props.showTimeSelect || this.props.showTimeInput, showTimeSelectOnly: this.props.showTimeSelectOnly, inline: this.props.inline },
11436
11504
  this.renderAriaLiveRegion(),
11437
11505
  this.renderPreviousButton(),
11438
11506
  this.renderNextButton(),
@@ -11626,6 +11694,7 @@ function withFloating(Component) {
11626
11694
  var floatingProps = floatingUi_react.useFloating(_assign({ open: !hidePopper, whileElementsMounted: floatingUi_reactDom.autoUpdate, placement: props.popperPlacement, middleware: __spreadArray([
11627
11695
  floatingUi_reactDom.flip({ padding: 15 }),
11628
11696
  floatingUi_reactDom.offset(10),
11697
+ // eslint-disable-next-line react-hooks/refs -- Floating UI requires refs to be passed during render
11629
11698
  floatingUi_reactDom.arrow({ element: arrowRef })
11630
11699
  ], ((_a = props.popperModifiers) !== null && _a !== void 0 ? _a : []), true) }, props.popperProps));
11631
11700
  var componentProps = _assign(_assign({}, props), { hidePopper: hidePopper, popperProps: _assign(_assign({}, floatingProps), { arrowRef: arrowRef }) });
@@ -11636,7 +11705,7 @@ function withFloating(Component) {
11636
11705
  }
11637
11706
 
11638
11707
  // Exported for testing purposes
11639
- var PopperComponent = function (props) {
11708
+ var PopperComponent$1 = function (props) {
11640
11709
  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;
11641
11710
  var popper = undefined;
11642
11711
  if (!hidePopper) {
@@ -11657,7 +11726,7 @@ var PopperComponent = function (props) {
11657
11726
  React.createElement("div", { ref: popperProps.refs.setReference, className: wrapperClasses }, targetComponent),
11658
11727
  popper));
11659
11728
  };
11660
- var PopperComponent$1 = withFloating(PopperComponent);
11729
+ var PopperComponent = withFloating(PopperComponent$1);
11661
11730
 
11662
11731
  // Compares dates year+month combinations
11663
11732
  function hasPreSelectionChanged(date1, date2) {
@@ -11935,9 +12004,11 @@ var DatePicker$1 = /** @class */ (function (_super) {
11935
12004
  }
11936
12005
  };
11937
12006
  _this.handleSelect = function (date, event, monthSelectedIn) {
12007
+ var _a;
11938
12008
  if (_this.props.readOnly)
11939
12009
  return;
11940
- var _a = _this.props, selectsRange = _a.selectsRange, startDate = _a.startDate, endDate = _a.endDate, swapRange = _a.swapRange;
12010
+ var _b = _this.props, selectsRange = _b.selectsRange, startDate = _b.startDate, endDate = _b.endDate, locale = _b.locale, swapRange = _b.swapRange;
12011
+ var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
11941
12012
  var isDateSelectionComplete = !selectsRange ||
11942
12013
  (startDate && !endDate && (swapRange || !isDateBefore(date, startDate)));
11943
12014
  if (_this.props.shouldCloseOnSelect &&
@@ -11948,7 +12019,11 @@ var DatePicker$1 = /** @class */ (function (_super) {
11948
12019
  _this.sendFocusBackToInput();
11949
12020
  }
11950
12021
  if (_this.props.onChangeRaw) {
11951
- _this.props.onChangeRaw(event);
12022
+ var formattedDate = safeDateFormat(date, {
12023
+ dateFormat: dateFormat,
12024
+ locale: locale,
12025
+ });
12026
+ _this.props.onChangeRaw(event, { date: date, formattedDate: formattedDate });
11952
12027
  }
11953
12028
  _this.setSelected(date, event, false, monthSelectedIn);
11954
12029
  if (_this.props.showDateSelect) {
@@ -12154,6 +12229,117 @@ var DatePicker$1 = /** @class */ (function (_super) {
12154
12229
  }
12155
12230
  (_b = (_a = _this.props).onInputClick) === null || _b === void 0 ? void 0 : _b.call(_a);
12156
12231
  };
12232
+ _this.handleTimeOnlyArrowKey = function (eventKey) {
12233
+ var _a, _b, _c, _d;
12234
+ var currentTime = _this.props.selected || _this.state.preSelection || newDate();
12235
+ var timeIntervals = (_a = _this.props.timeIntervals) !== null && _a !== void 0 ? _a : 30;
12236
+ var dateFormat = (_b = _this.props.dateFormat) !== null && _b !== void 0 ? _b : DatePicker.defaultProps.dateFormat;
12237
+ var formatStr = Array.isArray(dateFormat) ? dateFormat[0] : dateFormat;
12238
+ var baseDate = getStartOfDay(currentTime);
12239
+ var currentMinutes = getHours(currentTime) * 60 + getMinutes(currentTime);
12240
+ var maxMinutes = 23 * 60 + 60 - timeIntervals; // Cap at last valid interval of the day
12241
+ var newTime;
12242
+ if (eventKey === KeyType.ArrowUp) {
12243
+ var newMinutes = Math.max(0, currentMinutes - timeIntervals);
12244
+ newTime = addMinutes(baseDate, newMinutes);
12245
+ }
12246
+ else {
12247
+ var newMinutes = Math.min(maxMinutes, currentMinutes + timeIntervals);
12248
+ newTime = addMinutes(baseDate, newMinutes);
12249
+ }
12250
+ var formattedTime = formatDate(newTime, formatStr || DatePicker.defaultProps.dateFormat, _this.props.locale);
12251
+ _this.setState({
12252
+ preSelection: newTime,
12253
+ inputValue: formattedTime,
12254
+ });
12255
+ if (_this.props.selectsRange || _this.props.selectsMultiple) {
12256
+ return;
12257
+ }
12258
+ var selected = _this.props.selected
12259
+ ? _this.props.selected
12260
+ : _this.getPreSelection();
12261
+ var changedDate = _this.props.selected
12262
+ ? newTime
12263
+ : setTime(selected, {
12264
+ hour: getHours(newTime),
12265
+ minute: getMinutes(newTime),
12266
+ });
12267
+ (_d = (_c = _this.props).onChange) === null || _d === void 0 ? void 0 : _d.call(_c, changedDate);
12268
+ if (_this.props.showTimeSelectOnly || _this.props.showTimeSelect) {
12269
+ _this.setState({ isRenderAriaLiveMessage: true });
12270
+ }
12271
+ requestAnimationFrame(function () {
12272
+ _this.scrollToTimeOption(newTime);
12273
+ });
12274
+ };
12275
+ _this.handleTimeOnlyEnterKey = function (event) {
12276
+ var _a, _b, _c, _d;
12277
+ var inputElement = event.target;
12278
+ var inputValue = inputElement.value;
12279
+ var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
12280
+ var timeFormat = _this.props.timeFormat || "p";
12281
+ var defaultTime = _this.state.preSelection || _this.props.selected || newDate();
12282
+ var parsedDate = parseDate(inputValue, dateFormat, _this.props.locale, (_b = _this.props.strictParsing) !== null && _b !== void 0 ? _b : false, defaultTime);
12283
+ var timeToCommit = defaultTime;
12284
+ if (parsedDate && isValid(parsedDate)) {
12285
+ timeToCommit = parsedDate;
12286
+ }
12287
+ else {
12288
+ var highlightedItem = ((_c = _this.calendar) === null || _c === void 0 ? void 0 : _c.containerRef.current) instanceof Element &&
12289
+ _this.calendar.containerRef.current.querySelector(".react-datepicker__time-list-item[tabindex='0']");
12290
+ if (highlightedItem instanceof HTMLElement) {
12291
+ var itemText = (_d = highlightedItem.textContent) === null || _d === void 0 ? void 0 : _d.trim();
12292
+ if (itemText) {
12293
+ var itemTime = parseDate(itemText, timeFormat, _this.props.locale, false, defaultTime);
12294
+ if (itemTime && isValid(itemTime)) {
12295
+ timeToCommit = itemTime;
12296
+ }
12297
+ }
12298
+ }
12299
+ }
12300
+ _this.handleTimeChange(timeToCommit);
12301
+ _this.setOpen(false);
12302
+ _this.sendFocusBackToInput();
12303
+ };
12304
+ _this.scrollToTimeOption = function (time) {
12305
+ var _a, _b;
12306
+ if (!((_a = _this.calendar) === null || _a === void 0 ? void 0 : _a.containerRef.current)) {
12307
+ return;
12308
+ }
12309
+ var container = _this.calendar.containerRef.current;
12310
+ var timeListItems = Array.from(container.querySelectorAll(".react-datepicker__time-list-item"));
12311
+ var targetItem = null;
12312
+ var closestTimeDiff = Infinity;
12313
+ var timeFormat = _this.props.timeFormat || "p";
12314
+ for (var _i = 0, timeListItems_1 = timeListItems; _i < timeListItems_1.length; _i++) {
12315
+ var item = timeListItems_1[_i];
12316
+ var itemText = (_b = item.textContent) === null || _b === void 0 ? void 0 : _b.trim();
12317
+ if (itemText) {
12318
+ var itemTime = parseDate(itemText, timeFormat, _this.props.locale, false, time);
12319
+ if (itemTime && isValid(itemTime)) {
12320
+ if (isSameMinute(itemTime, time)) {
12321
+ targetItem = item;
12322
+ break;
12323
+ }
12324
+ var timeDiff = Math.abs(itemTime.getTime() - time.getTime());
12325
+ if (timeDiff < closestTimeDiff) {
12326
+ closestTimeDiff = timeDiff;
12327
+ targetItem = item;
12328
+ }
12329
+ }
12330
+ }
12331
+ }
12332
+ if (targetItem) {
12333
+ timeListItems.forEach(function (item) {
12334
+ item.setAttribute("tabindex", "-1");
12335
+ });
12336
+ targetItem.setAttribute("tabindex", "0");
12337
+ targetItem.scrollIntoView({
12338
+ behavior: "smooth",
12339
+ block: "center",
12340
+ });
12341
+ }
12342
+ };
12157
12343
  _this.onInputKeyDown = function (event) {
12158
12344
  var _a, _b, _c, _d, _e, _f;
12159
12345
  (_b = (_a = _this.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, event);
@@ -12168,6 +12354,18 @@ var DatePicker$1 = /** @class */ (function (_super) {
12168
12354
  }
12169
12355
  return;
12170
12356
  }
12357
+ if (_this.state.open && _this.props.showTimeSelectOnly) {
12358
+ if (eventKey === KeyType.ArrowDown || eventKey === KeyType.ArrowUp) {
12359
+ event.preventDefault();
12360
+ _this.handleTimeOnlyArrowKey(eventKey);
12361
+ return;
12362
+ }
12363
+ if (eventKey === KeyType.Enter) {
12364
+ event.preventDefault();
12365
+ _this.handleTimeOnlyEnterKey(event);
12366
+ return;
12367
+ }
12368
+ }
12171
12369
  // if calendar is open, these keys will focus the selected item
12172
12370
  if (_this.state.open) {
12173
12371
  if (eventKey === KeyType.ArrowDown || eventKey === KeyType.ArrowUp) {
@@ -12248,11 +12446,11 @@ var DatePicker$1 = /** @class */ (function (_super) {
12248
12446
  break;
12249
12447
  case KeyType.ArrowLeft:
12250
12448
  newCalculatedDate = showWeekPicker
12251
- ? subWeeks(date, 1)
12252
- : subDays(date, 1);
12449
+ ? subWeeks(date)
12450
+ : subDays(date);
12253
12451
  break;
12254
12452
  case KeyType.ArrowUp:
12255
- newCalculatedDate = subWeeks(date, 1);
12453
+ newCalculatedDate = subWeeks(date);
12256
12454
  break;
12257
12455
  case KeyType.ArrowDown:
12258
12456
  newCalculatedDate = addWeeks(date, 1);
@@ -12358,20 +12556,12 @@ var DatePicker$1 = /** @class */ (function (_super) {
12358
12556
  _this.setSelected(newSelection);
12359
12557
  }
12360
12558
  _this.setPreSelection(newSelection);
12361
- // need to figure out whether month has changed to focus day in inline version
12559
+ // In inline mode, always set shouldFocusDayInline to true when navigating via keyboard.
12560
+ // This ensures focus is properly transferred to the new day element regardless of
12561
+ // whether the month changed. The user initiated this navigation from a focused day,
12562
+ // so we should always focus the destination day.
12362
12563
  if (inline) {
12363
- var prevMonth = getMonth(copy);
12364
- var newMonth = getMonth(newSelection);
12365
- var prevYear = getYear(copy);
12366
- var newYear = getYear(newSelection);
12367
- if (prevMonth !== newMonth || prevYear !== newYear) {
12368
- // month has changed
12369
- _this.setState({ shouldFocusDayInline: true });
12370
- }
12371
- else {
12372
- // month hasn't changed
12373
- _this.setState({ shouldFocusDayInline: false });
12374
- }
12564
+ _this.setState({ shouldFocusDayInline: true });
12375
12565
  }
12376
12566
  };
12377
12567
  // handle generic key down events in the popper that do not adjust or select dates
@@ -12473,39 +12663,31 @@ var DatePicker$1 = /** @class */ (function (_super) {
12473
12663
  };
12474
12664
  _this.renderDateInput = function () {
12475
12665
  var _a, _b;
12666
+ var _c, _d, _e, _f;
12476
12667
  var className = clsx.clsx(_this.props.className, (_a = {},
12477
12668
  _a[_this.props.outsideClickIgnoreClass ||
12478
12669
  DatePicker.defaultProps.outsideClickIgnoreClass] = _this.state.open,
12479
12670
  _a));
12480
12671
  var customInput = _this.props.customInput || React.createElement("input", { type: "text" });
12481
12672
  var customInputRef = _this.props.customInputRef || "ref";
12482
- return React.cloneElement(customInput, (_b = {},
12483
- _b[customInputRef] = function (input) {
12484
- _this.input = input;
12485
- },
12486
- _b.value = _this.getInputValue(),
12487
- _b.onBlur = _this.handleBlur,
12488
- _b.onChange = _this.handleChange,
12489
- _b.onClick = _this.onInputClick,
12490
- _b.onFocus = _this.handleFocus,
12491
- _b.onKeyDown = _this.onInputKeyDown,
12492
- _b.id = _this.props.id,
12493
- _b.name = _this.props.name,
12494
- _b.form = _this.props.form,
12495
- _b.autoFocus = _this.props.autoFocus,
12496
- _b.placeholder = _this.props.placeholderText,
12497
- _b.disabled = _this.props.disabled,
12498
- _b.autoComplete = _this.props.autoComplete,
12499
- _b.className = clsx.clsx(customInput.props.className, className),
12500
- _b.title = _this.props.title,
12501
- _b.readOnly = _this.props.readOnly,
12502
- _b.required = _this.props.required,
12503
- _b.tabIndex = _this.props.tabIndex,
12504
- _b["aria-describedby"] = _this.props.ariaDescribedBy,
12505
- _b["aria-invalid"] = _this.props.ariaInvalid,
12506
- _b["aria-labelledby"] = _this.props.ariaLabelledBy,
12507
- _b["aria-required"] = _this.props.ariaRequired,
12508
- _b));
12673
+ // Build aria props object, only including defined values to avoid
12674
+ // overwriting aria attributes that may be set on the custom input
12675
+ var ariaProps = {};
12676
+ var ariaDescribedBy = (_c = _this.props["aria-describedby"]) !== null && _c !== void 0 ? _c : _this.props.ariaDescribedBy;
12677
+ var ariaInvalid = (_d = _this.props["aria-invalid"]) !== null && _d !== void 0 ? _d : _this.props.ariaInvalid;
12678
+ var ariaLabelledBy = (_e = _this.props["aria-labelledby"]) !== null && _e !== void 0 ? _e : _this.props.ariaLabelledBy;
12679
+ var ariaRequired = (_f = _this.props["aria-required"]) !== null && _f !== void 0 ? _f : _this.props.ariaRequired;
12680
+ if (ariaDescribedBy != null)
12681
+ ariaProps["aria-describedby"] = ariaDescribedBy;
12682
+ if (ariaInvalid != null)
12683
+ ariaProps["aria-invalid"] = ariaInvalid;
12684
+ if (ariaLabelledBy != null)
12685
+ ariaProps["aria-labelledby"] = ariaLabelledBy;
12686
+ if (ariaRequired != null)
12687
+ ariaProps["aria-required"] = ariaRequired;
12688
+ return React.cloneElement(customInput, _assign((_b = {}, _b[customInputRef] = function (input) {
12689
+ _this.input = input;
12690
+ }, _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.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));
12509
12691
  };
12510
12692
  _this.renderClearButton = function () {
12511
12693
  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;
@@ -12593,6 +12775,9 @@ var DatePicker$1 = /** @class */ (function (_super) {
12593
12775
  prevProps.monthsShown !== this.props.monthsShown) {
12594
12776
  this.setState({ monthSelectedIn: 0 });
12595
12777
  }
12778
+ if (this.props.selectsRange && this.state.monthSelectedIn !== 0) {
12779
+ this.setState({ monthSelectedIn: 0 });
12780
+ }
12596
12781
  if (prevProps.highlightDates !== this.props.highlightDates) {
12597
12782
  this.setState({
12598
12783
  highlightDates: getHighLightDaysMap(this.props.highlightDates),
@@ -12646,14 +12831,14 @@ var DatePicker$1 = /** @class */ (function (_super) {
12646
12831
  this.renderInputContainer(),
12647
12832
  portalContainer));
12648
12833
  }
12649
- return (React.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 })));
12834
+ return (React.createElement(PopperComponent, _assign({}, this.props, { className: this.props.popperClassName, hidePopper: !this.isCalendarOpen(), targetComponent: this.renderInputContainer(), popperComponent: calendar, popperOnKeyDown: this.onPopperKeyDown, showArrow: this.props.showPopperArrow })));
12650
12835
  };
12651
12836
  return DatePicker;
12652
12837
  }(React.Component));
12653
12838
  var PRESELECT_CHANGE_VIA_INPUT = "input";
12654
12839
  var PRESELECT_CHANGE_VIA_NAVIGATE = "navigate";
12655
12840
 
12656
- var styles = {"datePickerWrapper":"OmFI-Bfdzgw-","fullWidth":"HWDFy10kcYA-","datePicker":"Ma55F5Y-XhE-","inline":"_58kEbTu-IAA-","portalContainer":"LDxKi0E-1rg-","header":"Epg-Ub8Dn9A-","month":"Wx3NP8La95k-","spinning":"o0JLwNATy-M-"};
12841
+ var styles = {"datePickerWrapper":"OmFI-Bfdzgw-","fullWidth":"HWDFy10kcYA-","datePicker":"Ma55F5Y-XhE-","inline":"_58kEbTu-IAA-","portalContainer":"LDxKi0E-1rg-","header":"Epg-Ub8Dn9A-","month":"Wx3NP8La95k-"};
12657
12842
 
12658
12843
  function DatePickerCustomHeader({ monthDate, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled, }) {
12659
12844
  return (React.createElement("div", { className: styles.header },