@mui/x-date-pickers 8.5.3 → 8.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/CHANGELOG.md +107 -0
  2. package/DateCalendar/DateCalendar.js +16 -16
  3. package/DateCalendar/DayCalendar.js +48 -48
  4. package/DateCalendar/useCalendarState.js +25 -25
  5. package/DateCalendar/useIsDateDisabled.js +2 -2
  6. package/DatePicker/DatePickerToolbar.js +7 -9
  7. package/DateTimeField/DateTimeField.js +1 -1
  8. package/DateTimePicker/DateTimePicker.js +1 -1
  9. package/DateTimePicker/DateTimePickerToolbar.js +12 -13
  10. package/DateTimePicker/shared.js +3 -3
  11. package/DesktopDatePicker/DesktopDatePicker.js +3 -3
  12. package/DesktopDateTimePicker/DesktopDateTimePicker.js +4 -4
  13. package/DesktopTimePicker/DesktopTimePicker.js +4 -4
  14. package/DigitalClock/DigitalClock.d.ts +1 -1
  15. package/DigitalClock/DigitalClock.js +16 -16
  16. package/LocalizationProvider/LocalizationProvider.d.ts +9 -3
  17. package/LocalizationProvider/LocalizationProvider.js +28 -19
  18. package/MobileDatePicker/MobileDatePicker.js +3 -3
  19. package/MobileDateTimePicker/MobileDateTimePicker.js +4 -4
  20. package/MobileTimePicker/MobileTimePicker.js +4 -4
  21. package/MonthCalendar/MonthCalendar.js +19 -18
  22. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +32 -32
  23. package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +4 -4
  24. package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +7 -7
  25. package/PickerDay2/PickerDay2.js +3 -3
  26. package/PickersActionBar/PickersActionBar.d.ts +2 -2
  27. package/PickersActionBar/PickersActionBar.js +2 -2
  28. package/PickersCalendarHeader/PickersCalendarHeader.js +7 -8
  29. package/PickersDay/PickersDay.js +3 -3
  30. package/PickersDay/usePickerDayOwnerState.js +5 -5
  31. package/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
  32. package/StaticTimePicker/StaticTimePicker.js +1 -1
  33. package/TimeClock/Clock.js +8 -9
  34. package/TimeClock/ClockNumbers.d.ts +3 -3
  35. package/TimeClock/ClockNumbers.js +5 -5
  36. package/TimeClock/TimeClock.js +29 -29
  37. package/TimeField/TimeField.js +1 -1
  38. package/TimePicker/TimePicker.js +1 -1
  39. package/TimePicker/TimePickerToolbar.js +7 -9
  40. package/TimePicker/shared.js +3 -3
  41. package/YearCalendar/YearCalendar.js +19 -18
  42. package/esm/DateCalendar/DateCalendar.js +16 -16
  43. package/esm/DateCalendar/DayCalendar.js +48 -48
  44. package/esm/DateCalendar/useCalendarState.js +25 -25
  45. package/esm/DateCalendar/useIsDateDisabled.js +2 -2
  46. package/esm/DatePicker/DatePickerToolbar.js +6 -8
  47. package/esm/DateTimeField/DateTimeField.js +1 -1
  48. package/esm/DateTimePicker/DateTimePicker.js +1 -1
  49. package/esm/DateTimePicker/DateTimePickerToolbar.js +11 -12
  50. package/esm/DateTimePicker/shared.js +3 -3
  51. package/esm/DesktopDatePicker/DesktopDatePicker.js +3 -3
  52. package/esm/DesktopDateTimePicker/DesktopDateTimePicker.js +4 -4
  53. package/esm/DesktopTimePicker/DesktopTimePicker.js +4 -4
  54. package/esm/DigitalClock/DigitalClock.d.ts +1 -1
  55. package/esm/DigitalClock/DigitalClock.js +16 -16
  56. package/esm/LocalizationProvider/LocalizationProvider.d.ts +9 -3
  57. package/esm/LocalizationProvider/LocalizationProvider.js +27 -18
  58. package/esm/MobileDatePicker/MobileDatePicker.js +3 -3
  59. package/esm/MobileDateTimePicker/MobileDateTimePicker.js +4 -4
  60. package/esm/MobileTimePicker/MobileTimePicker.js +4 -4
  61. package/esm/MonthCalendar/MonthCalendar.js +20 -19
  62. package/esm/MultiSectionDigitalClock/MultiSectionDigitalClock.js +32 -32
  63. package/esm/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +4 -4
  64. package/esm/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +7 -7
  65. package/esm/PickerDay2/PickerDay2.js +3 -3
  66. package/esm/PickersActionBar/PickersActionBar.d.ts +2 -2
  67. package/esm/PickersActionBar/PickersActionBar.js +2 -2
  68. package/esm/PickersCalendarHeader/PickersCalendarHeader.js +6 -7
  69. package/esm/PickersDay/PickersDay.js +3 -3
  70. package/esm/PickersDay/usePickerDayOwnerState.js +5 -5
  71. package/esm/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
  72. package/esm/StaticTimePicker/StaticTimePicker.js +1 -1
  73. package/esm/TimeClock/Clock.js +7 -8
  74. package/esm/TimeClock/ClockNumbers.d.ts +3 -3
  75. package/esm/TimeClock/ClockNumbers.js +5 -5
  76. package/esm/TimeClock/TimeClock.js +29 -29
  77. package/esm/TimeField/TimeField.js +1 -1
  78. package/esm/TimePicker/TimePicker.js +1 -1
  79. package/esm/TimePicker/TimePickerToolbar.js +6 -8
  80. package/esm/TimePicker/shared.js +3 -3
  81. package/esm/YearCalendar/YearCalendar.js +20 -19
  82. package/esm/hooks/index.d.ts +2 -1
  83. package/esm/hooks/index.js +2 -1
  84. package/esm/hooks/useParsedFormat.js +6 -6
  85. package/esm/hooks/usePickerAdapter.d.ts +7 -0
  86. package/esm/hooks/usePickerAdapter.js +20 -0
  87. package/esm/hooks/usePickerTranslations.js +1 -1
  88. package/esm/index.js +1 -1
  89. package/esm/internals/components/pickersToolbarClasses.d.ts +1 -1
  90. package/esm/internals/demo/DemoContainer.d.ts +2 -3
  91. package/esm/internals/demo/DemoContainer.js +3 -2
  92. package/esm/internals/hooks/date-helpers-hooks.js +16 -16
  93. package/esm/internals/hooks/useClockReferenceDate.d.ts +2 -2
  94. package/esm/internals/hooks/useClockReferenceDate.js +3 -3
  95. package/esm/internals/hooks/useControlledValue.js +8 -7
  96. package/esm/internals/hooks/useField/buildSectionsFromFormat.d.ts +1 -1
  97. package/esm/internals/hooks/useField/buildSectionsFromFormat.js +17 -17
  98. package/esm/internals/hooks/useField/useField.types.d.ts +2 -2
  99. package/esm/internals/hooks/useField/useField.utils.d.ts +10 -10
  100. package/esm/internals/hooks/useField/useField.utils.js +69 -69
  101. package/esm/internals/hooks/useField/useFieldCharacterEditing.js +11 -11
  102. package/esm/internals/hooks/useField/useFieldRootHandleKeyDown.js +7 -7
  103. package/esm/internals/hooks/useField/useFieldSectionContentProps.js +15 -16
  104. package/esm/internals/hooks/useField/useFieldState.js +22 -24
  105. package/esm/internals/hooks/usePicker/hooks/useValueAndOpenStates.js +6 -6
  106. package/esm/internals/hooks/usePicker/usePicker.js +5 -6
  107. package/esm/internals/hooks/useUtils.d.ts +1 -8
  108. package/esm/internals/hooks/useUtils.js +3 -19
  109. package/esm/internals/index.d.ts +2 -1
  110. package/esm/internals/index.js +2 -1
  111. package/esm/internals/models/manager.d.ts +14 -14
  112. package/esm/internals/models/props/time.d.ts +1 -1
  113. package/esm/internals/utils/date-time-utils.d.ts +1 -1
  114. package/esm/internals/utils/date-time-utils.js +5 -5
  115. package/esm/internals/utils/date-utils.d.ts +11 -11
  116. package/esm/internals/utils/date-utils.js +34 -34
  117. package/esm/internals/utils/getDefaultReferenceDate.d.ts +2 -2
  118. package/esm/internals/utils/getDefaultReferenceDate.js +16 -16
  119. package/esm/internals/utils/time-utils.d.ts +5 -5
  120. package/esm/internals/utils/time-utils.js +12 -12
  121. package/esm/internals/utils/valueManagers.js +4 -4
  122. package/esm/managers/useDateManager.js +12 -12
  123. package/esm/managers/useDateTimeManager.js +13 -13
  124. package/esm/managers/useTimeManager.js +9 -10
  125. package/esm/validation/useValidation.d.ts +2 -3
  126. package/esm/validation/useValidation.js +2 -2
  127. package/esm/validation/validateDate.js +6 -6
  128. package/esm/validation/validateTime.js +6 -6
  129. package/hooks/index.d.ts +2 -1
  130. package/hooks/index.js +8 -1
  131. package/hooks/useParsedFormat.js +6 -6
  132. package/hooks/usePickerAdapter.d.ts +7 -0
  133. package/hooks/usePickerAdapter.js +29 -0
  134. package/hooks/usePickerTranslations.js +2 -2
  135. package/index.js +1 -1
  136. package/internals/components/pickersToolbarClasses.d.ts +1 -1
  137. package/internals/demo/DemoContainer.d.ts +2 -3
  138. package/internals/demo/DemoContainer.js +3 -2
  139. package/internals/hooks/date-helpers-hooks.js +16 -16
  140. package/internals/hooks/useClockReferenceDate.d.ts +2 -2
  141. package/internals/hooks/useClockReferenceDate.js +3 -3
  142. package/internals/hooks/useControlledValue.js +7 -7
  143. package/internals/hooks/useField/buildSectionsFromFormat.d.ts +1 -1
  144. package/internals/hooks/useField/buildSectionsFromFormat.js +17 -17
  145. package/internals/hooks/useField/useField.types.d.ts +2 -2
  146. package/internals/hooks/useField/useField.utils.d.ts +10 -10
  147. package/internals/hooks/useField/useField.utils.js +69 -69
  148. package/internals/hooks/useField/useFieldCharacterEditing.js +11 -11
  149. package/internals/hooks/useField/useFieldRootHandleKeyDown.js +7 -7
  150. package/internals/hooks/useField/useFieldSectionContentProps.js +14 -15
  151. package/internals/hooks/useField/useFieldState.js +23 -25
  152. package/internals/hooks/usePicker/hooks/useValueAndOpenStates.js +6 -6
  153. package/internals/hooks/usePicker/usePicker.js +5 -6
  154. package/internals/hooks/useUtils.d.ts +1 -8
  155. package/internals/hooks/useUtils.js +5 -24
  156. package/internals/index.d.ts +2 -1
  157. package/internals/index.js +2 -7
  158. package/internals/models/manager.d.ts +14 -14
  159. package/internals/models/props/time.d.ts +1 -1
  160. package/internals/utils/date-time-utils.d.ts +1 -1
  161. package/internals/utils/date-time-utils.js +5 -5
  162. package/internals/utils/date-utils.d.ts +11 -11
  163. package/internals/utils/date-utils.js +34 -34
  164. package/internals/utils/getDefaultReferenceDate.d.ts +2 -2
  165. package/internals/utils/getDefaultReferenceDate.js +16 -16
  166. package/internals/utils/time-utils.d.ts +5 -5
  167. package/internals/utils/time-utils.js +12 -12
  168. package/internals/utils/valueManagers.js +4 -4
  169. package/managers/useDateManager.js +12 -12
  170. package/managers/useDateTimeManager.js +13 -13
  171. package/managers/useTimeManager.js +10 -11
  172. package/package.json +2 -2
  173. package/validation/useValidation.d.ts +2 -3
  174. package/validation/useValidation.js +2 -2
  175. package/validation/validateDate.js +6 -6
  176. package/validation/validateTime.js +6 -6
@@ -13,8 +13,8 @@ import { styled, useThemeProps } from '@mui/material/styles';
13
13
  import composeClasses from '@mui/utils/composeClasses';
14
14
  import clsx from 'clsx';
15
15
  import { PickersDay } from "../PickersDay/index.js";
16
- import { usePickerTranslations } from "../hooks/usePickerTranslations.js";
17
- import { useUtils, useNow } from "../internals/hooks/useUtils.js";
16
+ import { usePickerAdapter, usePickerTranslations } from "../hooks/index.js";
17
+ import { useNow } from "../internals/hooks/useUtils.js";
18
18
  import { DAY_SIZE, DAY_MARGIN } from "../internals/constants/dimensions.js";
19
19
  import { PickersSlideTransition } from "./PickersSlideTransition.js";
20
20
  import { useIsDateDisabled } from "./useIsDateDisabled.js";
@@ -144,14 +144,14 @@ function WrappedDay(_ref) {
144
144
  slotProps,
145
145
  timezone
146
146
  } = parentProps;
147
- const utils = useUtils();
147
+ const adapter = usePickerAdapter();
148
148
  const now = useNow(timezone);
149
- const isFocusableDay = focusedDay != null && utils.isSameDay(day, focusedDay);
149
+ const isFocusableDay = focusedDay != null && adapter.isSameDay(day, focusedDay);
150
150
  const isFocusedDay = isViewFocused && isFocusableDay;
151
- const isSelected = selectedDays.some(selectedDay => utils.isSameDay(selectedDay, day));
152
- const isToday = utils.isSameDay(day, now);
151
+ const isSelected = selectedDays.some(selectedDay => adapter.isSameDay(selectedDay, day));
152
+ const isToday = adapter.isSameDay(day, now);
153
153
  const isDisabled = React.useMemo(() => disabled || isDateDisabled(day), [disabled, isDateDisabled, day]);
154
- const isOutsideCurrentMonth = React.useMemo(() => utils.getMonth(day) !== currentMonthNumber, [utils, day, currentMonthNumber]);
154
+ const isOutsideCurrentMonth = React.useMemo(() => adapter.getMonth(day) !== currentMonthNumber, [adapter, day, currentMonthNumber]);
155
155
  const ownerState = usePickerDayOwnerState({
156
156
  day,
157
157
  selected: isSelected,
@@ -174,7 +174,7 @@ function WrappedDay(_ref) {
174
174
  role: 'gridcell',
175
175
  isAnimating: isMonthSwitchingAnimating,
176
176
  // it is used in date range dragging logic by accessing `dataset.timestamp`
177
- 'data-timestamp': utils.toJsDate(day).valueOf()
177
+ 'data-timestamp': adapter.toJsDate(day).valueOf()
178
178
  }, other),
179
179
  ownerState: _extends({}, ownerState, {
180
180
  day,
@@ -184,19 +184,19 @@ function WrappedDay(_ref) {
184
184
  }),
185
185
  dayProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
186
186
  const isFirstVisibleCell = React.useMemo(() => {
187
- const startOfMonth = utils.startOfMonth(utils.setMonth(day, currentMonthNumber));
187
+ const startOfMonth = adapter.startOfMonth(adapter.setMonth(day, currentMonthNumber));
188
188
  if (!showDaysOutsideCurrentMonth) {
189
- return utils.isSameDay(day, startOfMonth);
189
+ return adapter.isSameDay(day, startOfMonth);
190
190
  }
191
- return utils.isSameDay(day, utils.startOfWeek(startOfMonth));
192
- }, [currentMonthNumber, day, showDaysOutsideCurrentMonth, utils]);
191
+ return adapter.isSameDay(day, adapter.startOfWeek(startOfMonth));
192
+ }, [currentMonthNumber, day, showDaysOutsideCurrentMonth, adapter]);
193
193
  const isLastVisibleCell = React.useMemo(() => {
194
- const endOfMonth = utils.endOfMonth(utils.setMonth(day, currentMonthNumber));
194
+ const endOfMonth = adapter.endOfMonth(adapter.setMonth(day, currentMonthNumber));
195
195
  if (!showDaysOutsideCurrentMonth) {
196
- return utils.isSameDay(day, endOfMonth);
196
+ return adapter.isSameDay(day, endOfMonth);
197
197
  }
198
- return utils.isSameDay(day, utils.endOfWeek(endOfMonth));
199
- }, [currentMonthNumber, day, showDaysOutsideCurrentMonth, utils]);
198
+ return adapter.isSameDay(day, adapter.endOfWeek(endOfMonth));
199
+ }, [currentMonthNumber, day, showDaysOutsideCurrentMonth, adapter]);
200
200
  return /*#__PURE__*/_jsx(Day, _extends({}, dayProps, {
201
201
  day: day,
202
202
  disabled: isDisabled,
@@ -220,7 +220,7 @@ export function DayCalendar(inProps) {
220
220
  props: inProps,
221
221
  name: 'MuiDayCalendar'
222
222
  });
223
- const utils = useUtils();
223
+ const adapter = usePickerAdapter();
224
224
  const {
225
225
  onFocusedDayChange,
226
226
  className,
@@ -245,7 +245,7 @@ export function DayCalendar(inProps) {
245
245
  shouldDisableDate,
246
246
  shouldDisableMonth,
247
247
  shouldDisableYear,
248
- dayOfWeekFormatter = date => utils.format(date, 'weekdayShort').charAt(0).toUpperCase(),
248
+ dayOfWeekFormatter = date => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase(),
249
249
  hasFocus,
250
250
  onFocusedViewChange,
251
251
  gridLabelId,
@@ -282,22 +282,22 @@ export function DayCalendar(inProps) {
282
282
  const handleKeyDown = useEventCallback((event, day) => {
283
283
  switch (event.key) {
284
284
  case 'ArrowUp':
285
- focusDay(utils.addDays(day, -7));
285
+ focusDay(adapter.addDays(day, -7));
286
286
  event.preventDefault();
287
287
  break;
288
288
  case 'ArrowDown':
289
- focusDay(utils.addDays(day, 7));
289
+ focusDay(adapter.addDays(day, 7));
290
290
  event.preventDefault();
291
291
  break;
292
292
  case 'ArrowLeft':
293
293
  {
294
- const newFocusedDayDefault = utils.addDays(day, isRtl ? 1 : -1);
295
- const nextAvailableMonth = utils.addMonths(day, isRtl ? 1 : -1);
294
+ const newFocusedDayDefault = adapter.addDays(day, isRtl ? 1 : -1);
295
+ const nextAvailableMonth = adapter.addMonths(day, isRtl ? 1 : -1);
296
296
  const closestDayToFocus = findClosestEnabledDate({
297
- utils,
297
+ adapter,
298
298
  date: newFocusedDayDefault,
299
- minDate: isRtl ? newFocusedDayDefault : utils.startOfMonth(nextAvailableMonth),
300
- maxDate: isRtl ? utils.endOfMonth(nextAvailableMonth) : newFocusedDayDefault,
299
+ minDate: isRtl ? newFocusedDayDefault : adapter.startOfMonth(nextAvailableMonth),
300
+ maxDate: isRtl ? adapter.endOfMonth(nextAvailableMonth) : newFocusedDayDefault,
301
301
  isDateDisabled,
302
302
  timezone
303
303
  });
@@ -307,13 +307,13 @@ export function DayCalendar(inProps) {
307
307
  }
308
308
  case 'ArrowRight':
309
309
  {
310
- const newFocusedDayDefault = utils.addDays(day, isRtl ? -1 : 1);
311
- const nextAvailableMonth = utils.addMonths(day, isRtl ? -1 : 1);
310
+ const newFocusedDayDefault = adapter.addDays(day, isRtl ? -1 : 1);
311
+ const nextAvailableMonth = adapter.addMonths(day, isRtl ? -1 : 1);
312
312
  const closestDayToFocus = findClosestEnabledDate({
313
- utils,
313
+ adapter,
314
314
  date: newFocusedDayDefault,
315
- minDate: isRtl ? utils.startOfMonth(nextAvailableMonth) : newFocusedDayDefault,
316
- maxDate: isRtl ? newFocusedDayDefault : utils.endOfMonth(nextAvailableMonth),
315
+ minDate: isRtl ? adapter.startOfMonth(nextAvailableMonth) : newFocusedDayDefault,
316
+ maxDate: isRtl ? newFocusedDayDefault : adapter.endOfMonth(nextAvailableMonth),
317
317
  isDateDisabled,
318
318
  timezone
319
319
  });
@@ -322,19 +322,19 @@ export function DayCalendar(inProps) {
322
322
  break;
323
323
  }
324
324
  case 'Home':
325
- focusDay(utils.startOfWeek(day));
325
+ focusDay(adapter.startOfWeek(day));
326
326
  event.preventDefault();
327
327
  break;
328
328
  case 'End':
329
- focusDay(utils.endOfWeek(day));
329
+ focusDay(adapter.endOfWeek(day));
330
330
  event.preventDefault();
331
331
  break;
332
332
  case 'PageUp':
333
- focusDay(utils.addMonths(day, 1));
333
+ focusDay(adapter.addMonths(day, 1));
334
334
  event.preventDefault();
335
335
  break;
336
336
  case 'PageDown':
337
- focusDay(utils.addMonths(day, -1));
337
+ focusDay(adapter.addMonths(day, -1));
338
338
  event.preventDefault();
339
339
  break;
340
340
  default:
@@ -343,33 +343,33 @@ export function DayCalendar(inProps) {
343
343
  });
344
344
  const handleFocus = useEventCallback((event, day) => focusDay(day));
345
345
  const handleBlur = useEventCallback((event, day) => {
346
- if (focusedDay != null && utils.isSameDay(focusedDay, day)) {
346
+ if (focusedDay != null && adapter.isSameDay(focusedDay, day)) {
347
347
  onFocusedViewChange?.(false);
348
348
  }
349
349
  });
350
- const currentMonthNumber = utils.getMonth(currentMonth);
351
- const currentYearNumber = utils.getYear(currentMonth);
352
- const validSelectedDays = React.useMemo(() => selectedDays.filter(day => !!day).map(day => utils.startOfDay(day)), [utils, selectedDays]);
350
+ const currentMonthNumber = adapter.getMonth(currentMonth);
351
+ const currentYearNumber = adapter.getYear(currentMonth);
352
+ const validSelectedDays = React.useMemo(() => selectedDays.filter(day => !!day).map(day => adapter.startOfDay(day)), [adapter, selectedDays]);
353
353
 
354
354
  // need a new ref whenever the `key` of the transition changes: https://reactcommunity.org/react-transition-group/transition/#Transition-prop-nodeRef.
355
355
  const transitionKey = `${currentYearNumber}-${currentMonthNumber}`;
356
356
  // eslint-disable-next-line react-hooks/exhaustive-deps
357
357
  const slideNodeRef = React.useMemo(() => /*#__PURE__*/React.createRef(), [transitionKey]);
358
358
  const weeksToDisplay = React.useMemo(() => {
359
- const toDisplay = utils.getWeekArray(currentMonth);
360
- let nextMonth = utils.addMonths(currentMonth, 1);
359
+ const toDisplay = adapter.getWeekArray(currentMonth);
360
+ let nextMonth = adapter.addMonths(currentMonth, 1);
361
361
  while (fixedWeekNumber && toDisplay.length < fixedWeekNumber) {
362
- const additionalWeeks = utils.getWeekArray(nextMonth);
363
- const hasCommonWeek = utils.isSameDay(toDisplay[toDisplay.length - 1][0], additionalWeeks[0][0]);
362
+ const additionalWeeks = adapter.getWeekArray(nextMonth);
363
+ const hasCommonWeek = adapter.isSameDay(toDisplay[toDisplay.length - 1][0], additionalWeeks[0][0]);
364
364
  additionalWeeks.slice(hasCommonWeek ? 1 : 0).forEach(week => {
365
365
  if (toDisplay.length < fixedWeekNumber) {
366
366
  toDisplay.push(week);
367
367
  }
368
368
  });
369
- nextMonth = utils.addMonths(nextMonth, 1);
369
+ nextMonth = adapter.addMonths(nextMonth, 1);
370
370
  }
371
371
  return toDisplay;
372
- }, [currentMonth, fixedWeekNumber, utils]);
372
+ }, [currentMonth, fixedWeekNumber, adapter]);
373
373
  return /*#__PURE__*/_jsxs(PickersCalendarDayRoot, {
374
374
  role: "grid",
375
375
  "aria-labelledby": gridLabelId,
@@ -383,10 +383,10 @@ export function DayCalendar(inProps) {
383
383
  "aria-label": translations.calendarWeekNumberHeaderLabel,
384
384
  className: classes.weekNumberLabel,
385
385
  children: translations.calendarWeekNumberHeaderText
386
- }), getWeekdays(utils, now).map((weekday, i) => /*#__PURE__*/_jsx(PickersCalendarWeekDayLabel, {
386
+ }), getWeekdays(adapter, now).map((weekday, i) => /*#__PURE__*/_jsx(PickersCalendarWeekDayLabel, {
387
387
  variant: "caption",
388
388
  role: "columnheader",
389
- "aria-label": utils.format(weekday, 'weekday'),
389
+ "aria-label": adapter.format(weekday, 'weekday'),
390
390
  className: classes.weekDayLabel,
391
391
  children: dayOfWeekFormatter(weekday)
392
392
  }, i.toString()))]
@@ -415,8 +415,8 @@ export function DayCalendar(inProps) {
415
415
  children: [displayWeekNumber && /*#__PURE__*/_jsx(PickersCalendarWeekNumber, {
416
416
  className: classes.weekNumber,
417
417
  role: "rowheader",
418
- "aria-label": translations.calendarWeekNumberAriaLabelText(utils.getWeekNumber(week[0])),
419
- children: translations.calendarWeekNumberText(utils.getWeekNumber(week[0]))
418
+ "aria-label": translations.calendarWeekNumberAriaLabelText(adapter.getWeekNumber(week[0])),
419
+ children: translations.calendarWeekNumberText(adapter.getWeekNumber(week[0]))
420
420
  }), week.map((day, dayIndex) => /*#__PURE__*/_jsx(WrappedDay, {
421
421
  parentProps: props,
422
422
  day: day,
@@ -4,28 +4,28 @@ import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
5
  import useEventCallback from '@mui/utils/useEventCallback';
6
6
  import { useIsDateDisabled } from "./useIsDateDisabled.js";
7
- import { useUtils } from "../internals/hooks/useUtils.js";
8
7
  import { singleItemValueManager } from "../internals/utils/valueManagers.js";
9
8
  import { SECTION_TYPE_GRANULARITY } from "../internals/utils/getDefaultReferenceDate.js";
10
9
  import { findClosestEnabledDate } from "../internals/utils/date-utils.js";
11
- const createCalendarStateReducer = (reduceAnimations, utils) => (state, action) => {
10
+ import { usePickerAdapter } from "../hooks/usePickerAdapter.js";
11
+ const createCalendarStateReducer = (reduceAnimations, adapter) => (state, action) => {
12
12
  switch (action.type) {
13
13
  case 'setVisibleDate':
14
14
  return _extends({}, state, {
15
15
  slideDirection: action.direction,
16
16
  currentMonth: action.month,
17
- isMonthSwitchingAnimating: !utils.isSameMonth(action.month, state.currentMonth) && !reduceAnimations && !action.skipAnimation,
17
+ isMonthSwitchingAnimating: !adapter.isSameMonth(action.month, state.currentMonth) && !reduceAnimations && !action.skipAnimation,
18
18
  focusedDay: action.focusedDay
19
19
  });
20
20
  case 'changeMonthTimezone':
21
21
  {
22
22
  const newTimezone = action.newTimezone;
23
- if (utils.getTimezone(state.currentMonth) === newTimezone) {
23
+ if (adapter.getTimezone(state.currentMonth) === newTimezone) {
24
24
  return state;
25
25
  }
26
- let newCurrentMonth = utils.setTimezone(state.currentMonth, newTimezone);
27
- if (utils.getMonth(newCurrentMonth) !== utils.getMonth(state.currentMonth)) {
28
- newCurrentMonth = utils.setMonth(newCurrentMonth, utils.getMonth(state.currentMonth));
26
+ let newCurrentMonth = adapter.setTimezone(state.currentMonth, newTimezone);
27
+ if (adapter.getMonth(newCurrentMonth) !== adapter.getMonth(state.currentMonth)) {
28
+ newCurrentMonth = adapter.setMonth(newCurrentMonth, adapter.getMonth(state.currentMonth));
29
29
  }
30
30
  return _extends({}, state, {
31
31
  currentMonth: newCurrentMonth
@@ -54,12 +54,12 @@ export const useCalendarState = params => {
54
54
  timezone,
55
55
  getCurrentMonthFromVisibleDate
56
56
  } = params;
57
- const utils = useUtils();
58
- const reducerFn = React.useRef(createCalendarStateReducer(Boolean(reduceAnimations), utils)).current;
57
+ const adapter = usePickerAdapter();
58
+ const reducerFn = React.useRef(createCalendarStateReducer(Boolean(reduceAnimations), adapter)).current;
59
59
  const referenceDate = React.useMemo(() => {
60
60
  return singleItemValueManager.getInitialReferenceValue({
61
61
  value,
62
- utils,
62
+ adapter,
63
63
  timezone,
64
64
  props: params,
65
65
  referenceDate: referenceDateProp,
@@ -72,7 +72,7 @@ export const useCalendarState = params => {
72
72
  const [calendarState, dispatch] = React.useReducer(reducerFn, {
73
73
  isMonthSwitchingAnimating: false,
74
74
  focusedDay: referenceDate,
75
- currentMonth: utils.startOfMonth(referenceDate),
75
+ currentMonth: adapter.startOfMonth(referenceDate),
76
76
  slideDirection: 'left'
77
77
  });
78
78
  const isDateDisabled = useIsDateDisabled({
@@ -89,14 +89,14 @@ export const useCalendarState = params => {
89
89
  React.useEffect(() => {
90
90
  dispatch({
91
91
  type: 'changeMonthTimezone',
92
- newTimezone: utils.getTimezone(referenceDate)
92
+ newTimezone: adapter.getTimezone(referenceDate)
93
93
  });
94
- }, [referenceDate, utils]);
94
+ }, [referenceDate, adapter]);
95
95
  const setVisibleDate = useEventCallback(({
96
96
  target,
97
97
  reason
98
98
  }) => {
99
- if (reason === 'cell-interaction' && calendarState.focusedDay != null && utils.isSameDay(target, calendarState.focusedDay)) {
99
+ if (reason === 'cell-interaction' && calendarState.focusedDay != null && adapter.isSameDay(target, calendarState.focusedDay)) {
100
100
  return;
101
101
  }
102
102
  const skipAnimation = reason === 'cell-interaction';
@@ -106,18 +106,18 @@ export const useCalendarState = params => {
106
106
  month = getCurrentMonthFromVisibleDate(target, calendarState.currentMonth);
107
107
  focusedDay = target;
108
108
  } else {
109
- month = utils.isSameMonth(target, calendarState.currentMonth) ? calendarState.currentMonth : utils.startOfMonth(target);
109
+ month = adapter.isSameMonth(target, calendarState.currentMonth) ? calendarState.currentMonth : adapter.startOfMonth(target);
110
110
  focusedDay = target;
111
111
 
112
112
  // If the date is disabled, we try to find a non-disabled date inside the same month.
113
113
  if (isDateDisabled(focusedDay)) {
114
- const startOfMonth = utils.startOfMonth(target);
115
- const endOfMonth = utils.endOfMonth(target);
114
+ const startOfMonth = adapter.startOfMonth(target);
115
+ const endOfMonth = adapter.endOfMonth(target);
116
116
  focusedDay = findClosestEnabledDate({
117
- utils,
117
+ adapter,
118
118
  date: focusedDay,
119
- minDate: utils.isBefore(minDate, startOfMonth) ? startOfMonth : minDate,
120
- maxDate: utils.isAfter(maxDate, endOfMonth) ? endOfMonth : maxDate,
119
+ minDate: adapter.isBefore(minDate, startOfMonth) ? startOfMonth : minDate,
120
+ maxDate: adapter.isAfter(maxDate, endOfMonth) ? endOfMonth : maxDate,
121
121
  disablePast,
122
122
  disableFuture,
123
123
  isDateDisabled,
@@ -125,19 +125,19 @@ export const useCalendarState = params => {
125
125
  });
126
126
  }
127
127
  }
128
- const hasChangedMonth = !utils.isSameMonth(calendarState.currentMonth, month);
129
- const hasChangedYear = !utils.isSameYear(calendarState.currentMonth, month);
128
+ const hasChangedMonth = !adapter.isSameMonth(calendarState.currentMonth, month);
129
+ const hasChangedYear = !adapter.isSameYear(calendarState.currentMonth, month);
130
130
  if (hasChangedMonth) {
131
131
  onMonthChange?.(month);
132
132
  }
133
133
  if (hasChangedYear) {
134
- onYearChange?.(utils.startOfYear(month));
134
+ onYearChange?.(adapter.startOfYear(month));
135
135
  }
136
136
  dispatch({
137
137
  type: 'setVisibleDate',
138
138
  month,
139
- direction: utils.isAfterDay(month, calendarState.currentMonth) ? 'left' : 'right',
140
- focusedDay: calendarState.focusedDay != null && focusedDay != null && utils.isSameDay(focusedDay, calendarState.focusedDay) ? calendarState.focusedDay : focusedDay,
139
+ direction: adapter.isAfterDay(month, calendarState.currentMonth) ? 'left' : 'right',
140
+ focusedDay: calendarState.focusedDay != null && focusedDay != null && adapter.isSameDay(focusedDay, calendarState.focusedDay) ? calendarState.focusedDay : focusedDay,
141
141
  skipAnimation
142
142
  });
143
143
  });
@@ -2,7 +2,7 @@
2
2
 
3
3
  import * as React from 'react';
4
4
  import { validateDate } from "../validation/index.js";
5
- import { useLocalizationContext } from "../internals/hooks/useUtils.js";
5
+ import { usePickerAdapter } from "../hooks/usePickerAdapter.js";
6
6
  export const useIsDateDisabled = ({
7
7
  shouldDisableDate,
8
8
  shouldDisableMonth,
@@ -13,7 +13,7 @@ export const useIsDateDisabled = ({
13
13
  disablePast,
14
14
  timezone
15
15
  }) => {
16
- const adapter = useLocalizationContext();
16
+ const adapter = usePickerAdapter();
17
17
  return React.useCallback(day => validateDate({
18
18
  adapter,
19
19
  value: day,
@@ -10,12 +10,10 @@ import Typography from '@mui/material/Typography';
10
10
  import { styled, useThemeProps } from '@mui/material/styles';
11
11
  import composeClasses from '@mui/utils/composeClasses';
12
12
  import { PickersToolbar } from "../internals/components/PickersToolbar.js";
13
- import { usePickerTranslations } from "../hooks/usePickerTranslations.js";
14
- import { useUtils } from "../internals/hooks/useUtils.js";
13
+ import { usePickerAdapter, usePickerContext, usePickerTranslations } from "../hooks/index.js";
15
14
  import { getDatePickerToolbarUtilityClass } from "./datePickerToolbarClasses.js";
16
15
  import { resolveDateFormat } from "../internals/utils/date-utils.js";
17
16
  import { useToolbarOwnerState } from "../internals/hooks/useToolbarOwnerState.js";
18
- import { usePickerContext } from "../hooks/index.js";
19
17
  import { jsx as _jsx } from "react/jsx-runtime";
20
18
  const useUtilityClasses = classes => {
21
19
  const slots = {
@@ -63,7 +61,7 @@ export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePick
63
61
  classes: classesProp
64
62
  } = props,
65
63
  other = _objectWithoutPropertiesLoose(props, _excluded);
66
- const utils = useUtils();
64
+ const adapter = usePickerAdapter();
67
65
  const {
68
66
  value,
69
67
  views,
@@ -73,15 +71,15 @@ export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePick
73
71
  const ownerState = useToolbarOwnerState();
74
72
  const classes = useUtilityClasses(classesProp);
75
73
  const dateText = React.useMemo(() => {
76
- if (!utils.isValid(value)) {
74
+ if (!adapter.isValid(value)) {
77
75
  return toolbarPlaceholder;
78
76
  }
79
- const formatFromViews = resolveDateFormat(utils, {
77
+ const formatFromViews = resolveDateFormat(adapter, {
80
78
  format: toolbarFormat,
81
79
  views
82
80
  }, true);
83
- return utils.formatByString(value, formatFromViews);
84
- }, [value, toolbarFormat, toolbarPlaceholder, utils, views]);
81
+ return adapter.formatByString(value, formatFromViews);
82
+ }, [value, toolbarFormat, toolbarPlaceholder, adapter, views]);
85
83
  return /*#__PURE__*/_jsx(DatePickerToolbarRoot, _extends({
86
84
  ref: ref,
87
85
  toolbarTitle: translations.datePickerToolbarTitle,
@@ -51,7 +51,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
51
51
  // ----------------------------------------------------------------------
52
52
  /**
53
53
  * 12h/24h view for hour selection clock.
54
- * @default utils.is12HourCycleInCurrentLocale()
54
+ * @default adapter.is12HourCycleInCurrentLocale()
55
55
  */
56
56
  ampm: PropTypes.bool,
57
57
  /**
@@ -53,7 +53,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
53
53
  // ----------------------------------------------------------------------
54
54
  /**
55
55
  * 12h/24h view for hour selection clock.
56
- * @default utils.is12HourCycleInCurrentLocale()
56
+ * @default adapter.is12HourCycleInCurrentLocale()
57
57
  */
58
58
  ampm: PropTypes.bool,
59
59
  /**
@@ -12,8 +12,7 @@ import { shouldForwardProp } from '@mui/system/createStyled';
12
12
  import { PickersToolbarText } from "../internals/components/PickersToolbarText.js";
13
13
  import { PickersToolbar } from "../internals/components/PickersToolbar.js";
14
14
  import { PickersToolbarButton } from "../internals/components/PickersToolbarButton.js";
15
- import { usePickerTranslations } from "../hooks/usePickerTranslations.js";
16
- import { useUtils } from "../internals/hooks/useUtils.js";
15
+ import { usePickerAdapter, usePickerTranslations } from "../hooks/index.js";
17
16
  import { dateTimePickerToolbarClasses, getDateTimePickerToolbarUtilityClass } from "./dateTimePickerToolbarClasses.js";
18
17
  import { useMeridiemMode } from "../internals/hooks/date-helpers-hooks.js";
19
18
  import { MULTI_SECTION_CLOCK_SECTION_WIDTH } from "../internals/constants/dimensions.js";
@@ -247,7 +246,7 @@ function DateTimePickerToolbar(inProps) {
247
246
  const translations = usePickerTranslations();
248
247
  const ownerState = useToolbarOwnerState();
249
248
  const classes = useUtilityClasses(classesProp, ownerState);
250
- const utils = useUtils();
249
+ const adapter = usePickerAdapter();
251
250
  const overrides = React.useContext(DateTimePickerToolbarOverrideContext);
252
251
  const value = overrides ? overrides.value : valueContext;
253
252
  const setValue = overrides ? overrides.setValue : setValueContext;
@@ -264,19 +263,19 @@ function DateTimePickerToolbar(inProps) {
264
263
  const showAmPmControl = Boolean(ampm && !ampmInClock);
265
264
  const toolbarTitle = inToolbarTitle ?? translations.dateTimePickerToolbarTitle;
266
265
  const dateText = React.useMemo(() => {
267
- if (!utils.isValid(value)) {
266
+ if (!adapter.isValid(value)) {
268
267
  return toolbarPlaceholder;
269
268
  }
270
269
  if (toolbarFormat) {
271
- return utils.formatByString(value, toolbarFormat);
270
+ return adapter.formatByString(value, toolbarFormat);
272
271
  }
273
- return utils.format(value, 'shortDate');
274
- }, [value, toolbarFormat, toolbarPlaceholder, utils]);
272
+ return adapter.format(value, 'shortDate');
273
+ }, [value, toolbarFormat, toolbarPlaceholder, adapter]);
275
274
  const formatSection = (format, fallback) => {
276
- if (!utils.isValid(value)) {
275
+ if (!adapter.isValid(value)) {
277
276
  return fallback;
278
277
  }
279
- return utils.format(value, format);
278
+ return adapter.format(value, format);
280
279
  };
281
280
  return /*#__PURE__*/_jsxs(DateTimePickerToolbarRoot, _extends({
282
281
  className: clsx(classes.root, className),
@@ -351,14 +350,14 @@ function DateTimePickerToolbar(inProps) {
351
350
  variant: "subtitle2",
352
351
  selected: meridiemMode === 'am',
353
352
  typographyClassName: classes.ampmLabel,
354
- value: formatMeridiem(utils, 'am'),
353
+ value: formatMeridiem(adapter, 'am'),
355
354
  onClick: readOnly ? undefined : () => handleMeridiemChange('am'),
356
355
  disabled: disabled
357
356
  }), /*#__PURE__*/_jsx(PickersToolbarButton, {
358
357
  variant: "subtitle2",
359
358
  selected: meridiemMode === 'pm',
360
359
  typographyClassName: classes.ampmLabel,
361
- value: formatMeridiem(utils, 'pm'),
360
+ value: formatMeridiem(adapter, 'pm'),
362
361
  onClick: readOnly ? undefined : () => handleMeridiemChange('pm'),
363
362
  disabled: disabled
364
363
  })]
@@ -366,7 +365,7 @@ function DateTimePickerToolbar(inProps) {
366
365
  variant: "h5",
367
366
  onClick: () => setView('meridiem'),
368
367
  selected: view === 'meridiem',
369
- value: value && meridiemMode ? formatMeridiem(utils, meridiemMode) : '--',
368
+ value: value && meridiemMode ? formatMeridiem(adapter, meridiemMode) : '--',
370
369
  width: MULTI_SECTION_CLOCK_SECTION_WIDTH
371
370
  })]
372
371
  })]
@@ -1,20 +1,20 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import { useThemeProps } from '@mui/material/styles';
4
- import { useUtils } from "../internals/hooks/useUtils.js";
4
+ import { usePickerAdapter } from "../hooks/usePickerAdapter.js";
5
5
  import { DateTimePickerTabs } from "./DateTimePickerTabs.js";
6
6
  import { DateTimePickerToolbar } from "./DateTimePickerToolbar.js";
7
7
  import { applyDefaultViewProps } from "../internals/utils/views.js";
8
8
  import { resolveTimeViewsResponse } from "../internals/utils/date-time-utils.js";
9
9
  import { useApplyDefaultValuesToDateTimeValidationProps } from "../managers/useDateTimeManager.js";
10
10
  export function useDateTimePickerDefaultizedProps(props, name) {
11
- const utils = useUtils();
11
+ const adapter = usePickerAdapter();
12
12
  const themeProps = useThemeProps({
13
13
  props,
14
14
  name
15
15
  });
16
16
  const validationProps = useApplyDefaultValuesToDateTimeValidationProps(themeProps);
17
- const ampm = themeProps.ampm ?? utils.is12HourCycleInCurrentLocale();
17
+ const ampm = themeProps.ampm ?? adapter.is12HourCycleInCurrentLocale();
18
18
  const localeText = React.useMemo(() => {
19
19
  if (themeProps.localeText?.toolbarTitle == null) {
20
20
  return themeProps.localeText;
@@ -7,7 +7,7 @@ import resolveComponentProps from '@mui/utils/resolveComponentProps';
7
7
  import refType from '@mui/utils/refType';
8
8
  import { singleItemValueManager } from "../internals/utils/valueManagers.js";
9
9
  import { useDatePickerDefaultizedProps } from "../DatePicker/shared.js";
10
- import { useUtils } from "../internals/hooks/useUtils.js";
10
+ import { usePickerAdapter } from "../hooks/usePickerAdapter.js";
11
11
  import { validateDate, extractValidationProps } from "../validation/index.js";
12
12
  import { useDesktopPicker } from "../internals/hooks/useDesktopPicker/index.js";
13
13
  import { DateField } from "../DateField/index.js";
@@ -24,7 +24,7 @@ import { resolveDateFormat } from "../internals/utils/date-utils.js";
24
24
  * - [DesktopDatePicker API](https://mui.com/x/api/date-pickers/desktop-date-picker/)
25
25
  */
26
26
  const DesktopDatePicker = /*#__PURE__*/React.forwardRef(function DesktopDatePicker(inProps, ref) {
27
- const utils = useUtils();
27
+ const adapter = usePickerAdapter();
28
28
 
29
29
  // Props with the default values common to all date pickers
30
30
  const defaultizedProps = useDatePickerDefaultizedProps(inProps, 'MuiDesktopDatePicker');
@@ -38,7 +38,7 @@ const DesktopDatePicker = /*#__PURE__*/React.forwardRef(function DesktopDatePick
38
38
  const props = _extends({}, defaultizedProps, {
39
39
  closeOnSelect: defaultizedProps.closeOnSelect ?? true,
40
40
  viewRenderers,
41
- format: resolveDateFormat(utils, defaultizedProps, false),
41
+ format: resolveDateFormat(adapter, defaultizedProps, false),
42
42
  yearsPerRow: defaultizedProps.yearsPerRow ?? 4,
43
43
  slots: _extends({
44
44
  field: DateField
@@ -12,7 +12,7 @@ import { singleItemValueManager } from "../internals/utils/valueManagers.js";
12
12
  import { DateTimeField } from "../DateTimeField/index.js";
13
13
  import { useDateTimePickerDefaultizedProps } from "../DateTimePicker/shared.js";
14
14
  import { renderDateViewCalendar } from "../dateViewRenderers/dateViewRenderers.js";
15
- import { useUtils } from "../internals/hooks/useUtils.js";
15
+ import { usePickerAdapter } from "../hooks/usePickerAdapter.js";
16
16
  import { validateDateTime, extractValidationProps } from "../validation/index.js";
17
17
  import { useDesktopPicker } from "../internals/hooks/useDesktopPicker/index.js";
18
18
  import { resolveDateTimeFormat } from "../internals/utils/date-time-utils.js";
@@ -90,7 +90,7 @@ if (process.env.NODE_ENV !== "production") rendererInterceptor.displayName = "re
90
90
  * - [DesktopDateTimePicker API](https://mui.com/x/api/date-pickers/desktop-date-time-picker/)
91
91
  */
92
92
  const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDateTimePicker(inProps, ref) {
93
- const utils = useUtils();
93
+ const adapter = usePickerAdapter();
94
94
 
95
95
  // Props with the default values common to all date time pickers
96
96
  const defaultizedProps = useDateTimePickerDefaultizedProps(inProps, 'MuiDesktopDateTimePicker');
@@ -112,7 +112,7 @@ const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDate
112
112
  // Props with the default values specific to the desktop variant
113
113
  const props = _extends({}, defaultizedProps, {
114
114
  viewRenderers,
115
- format: resolveDateTimeFormat(utils, defaultizedProps),
115
+ format: resolveDateTimeFormat(adapter, defaultizedProps),
116
116
  views,
117
117
  yearsPerRow: defaultizedProps.yearsPerRow ?? 4,
118
118
  ampmInClock,
@@ -152,7 +152,7 @@ DesktopDateTimePicker.propTypes = {
152
152
  // ----------------------------------------------------------------------
153
153
  /**
154
154
  * 12h/24h view for hour selection clock.
155
- * @default utils.is12HourCycleInCurrentLocale()
155
+ * @default adapter.is12HourCycleInCurrentLocale()
156
156
  */
157
157
  ampm: PropTypes.bool,
158
158
  /**
@@ -8,7 +8,7 @@ import refType from '@mui/utils/refType';
8
8
  import { singleItemValueManager } from "../internals/utils/valueManagers.js";
9
9
  import { TimeField } from "../TimeField/index.js";
10
10
  import { useTimePickerDefaultizedProps } from "../TimePicker/shared.js";
11
- import { useUtils } from "../internals/hooks/useUtils.js";
11
+ import { usePickerAdapter } from "../hooks/usePickerAdapter.js";
12
12
  import { extractValidationProps, validateTime } from "../validation/index.js";
13
13
  import { useDesktopPicker } from "../internals/hooks/useDesktopPicker/index.js";
14
14
  import { renderDigitalClockTimeView, renderMultiSectionDigitalClockTimeView } from "../timeViewRenderers/index.js";
@@ -25,7 +25,7 @@ import { resolveTimeViewsResponse } from "../internals/utils/date-time-utils.js"
25
25
  * - [DesktopTimePicker API](https://mui.com/x/api/date-pickers/desktop-time-picker/)
26
26
  */
27
27
  const DesktopTimePicker = /*#__PURE__*/React.forwardRef(function DesktopTimePicker(inProps, ref) {
28
- const utils = useUtils();
28
+ const adapter = usePickerAdapter();
29
29
 
30
30
  // Props with the default values common to all time pickers
31
31
  const defaultizedProps = useTimePickerDefaultizedProps(inProps, 'MuiDesktopTimePicker');
@@ -51,7 +51,7 @@ const DesktopTimePicker = /*#__PURE__*/React.forwardRef(function DesktopTimePick
51
51
  ampmInClock,
52
52
  timeSteps,
53
53
  viewRenderers,
54
- format: resolveTimeFormat(utils, defaultizedProps),
54
+ format: resolveTimeFormat(adapter, defaultizedProps),
55
55
  // Setting only `hours` time view in case of single column time picker
56
56
  // Allows for easy view lifecycle management
57
57
  views: shouldRenderTimeInASingleColumn ? ['hours'] : views,
@@ -86,7 +86,7 @@ DesktopTimePicker.propTypes = {
86
86
  // ----------------------------------------------------------------------
87
87
  /**
88
88
  * 12h/24h view for hour selection clock.
89
- * @default utils.is12HourCycleInCurrentLocale()
89
+ * @default adapter.is12HourCycleInCurrentLocale()
90
90
  */
91
91
  ampm: PropTypes.bool,
92
92
  /**
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { DigitalClockProps } from "./DigitalClock.types.js";
3
- export declare const DigitalClockItem: import("@emotion/styled").StyledComponent<import("@mui/material/MenuItem").MenuItemOwnProps & Omit<import("@mui/material/ButtonBase").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "disabled" | "autoFocus" | "dense" | "tabIndex" | "classes" | "className" | "style" | "children" | "sx" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableGutters" | "divider" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
3
+ export declare const DigitalClockItem: import("@emotion/styled").StyledComponent<import("@mui/material/MenuItem").MenuItemOwnProps & Omit<import("@mui/material/ButtonBase").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "disabled" | "autoFocus" | "dense" | "style" | "tabIndex" | "className" | "children" | "classes" | "sx" | "disableGutters" | "divider" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
4
4
  type DigitalClockComponent = ((props: DigitalClockProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
5
5
  propTypes?: any;
6
6
  };