@mui/x-date-pickers 7.22.3 → 8.0.0-alpha.1

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 (514) hide show
  1. package/AdapterDateFns/AdapterDateFns.d.ts +1 -1
  2. package/AdapterDateFnsBase/AdapterDateFnsBase.d.ts +3 -3
  3. package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +1 -1
  4. package/AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.d.ts +1 -1
  5. package/AdapterDateFnsV3/AdapterDateFnsV3.d.ts +1 -1
  6. package/AdapterDayjs/AdapterDayjs.d.ts +2 -2
  7. package/AdapterLuxon/AdapterLuxon.d.ts +2 -2
  8. package/AdapterMoment/AdapterMoment.d.ts +2 -2
  9. package/AdapterMomentHijri/AdapterMomentHijri.d.ts +2 -2
  10. package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +2 -2
  11. package/CHANGELOG.md +348 -12
  12. package/DateCalendar/DateCalendar.d.ts +1 -2
  13. package/DateCalendar/DateCalendar.js +21 -22
  14. package/DateCalendar/DateCalendar.types.d.ts +21 -31
  15. package/DateCalendar/DayCalendar.d.ts +25 -24
  16. package/DateCalendar/DayCalendar.js +13 -10
  17. package/DateCalendar/index.d.ts +1 -0
  18. package/DateCalendar/useCalendarState.d.ts +16 -16
  19. package/DateCalendar/useIsDateDisabled.d.ts +2 -2
  20. package/DateField/DateField.d.ts +1 -2
  21. package/DateField/DateField.js +8 -10
  22. package/DateField/DateField.types.d.ts +8 -9
  23. package/DateField/index.d.ts +1 -1
  24. package/DateField/useDateField.d.ts +1 -2
  25. package/DatePicker/DatePicker.d.ts +1 -2
  26. package/DatePicker/DatePicker.js +15 -14
  27. package/DatePicker/DatePicker.types.d.ts +10 -11
  28. package/DatePicker/DatePickerToolbar.d.ts +2 -2
  29. package/DatePicker/DatePickerToolbar.js +2 -4
  30. package/DatePicker/shared.d.ts +11 -11
  31. package/DateTimeField/DateTimeField.d.ts +1 -2
  32. package/DateTimeField/DateTimeField.js +9 -12
  33. package/DateTimeField/DateTimeField.types.d.ts +9 -14
  34. package/DateTimeField/index.d.ts +1 -1
  35. package/DateTimeField/useDateTimeField.d.ts +1 -2
  36. package/DateTimePicker/DateTimePicker.d.ts +1 -2
  37. package/DateTimePicker/DateTimePicker.js +16 -16
  38. package/DateTimePicker/DateTimePicker.types.d.ts +10 -13
  39. package/DateTimePicker/DateTimePickerTabs.d.ts +1 -2
  40. package/DateTimePicker/DateTimePickerTabs.js +2 -2
  41. package/DateTimePicker/DateTimePickerToolbar.d.ts +5 -5
  42. package/DateTimePicker/DateTimePickerToolbar.js +8 -7
  43. package/DateTimePicker/shared.d.ts +12 -12
  44. package/DesktopDatePicker/DesktopDatePicker.d.ts +1 -2
  45. package/DesktopDatePicker/DesktopDatePicker.js +17 -16
  46. package/DesktopDatePicker/DesktopDatePicker.types.d.ts +7 -7
  47. package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +1 -2
  48. package/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
  49. package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +8 -8
  50. package/DesktopDateTimePicker/DesktopDateTimePickerLayout.d.ts +1 -2
  51. package/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +0 -2
  52. package/DesktopTimePicker/DesktopTimePicker.d.ts +1 -2
  53. package/DesktopTimePicker/DesktopTimePicker.js +11 -6
  54. package/DesktopTimePicker/DesktopTimePicker.types.d.ts +8 -8
  55. package/DigitalClock/DigitalClock.d.ts +1 -2
  56. package/DigitalClock/DigitalClock.js +8 -6
  57. package/DigitalClock/DigitalClock.types.d.ts +4 -4
  58. package/LocalizationProvider/LocalizationProvider.d.ts +12 -12
  59. package/MobileDatePicker/MobileDatePicker.d.ts +1 -2
  60. package/MobileDatePicker/MobileDatePicker.js +17 -16
  61. package/MobileDatePicker/MobileDatePicker.types.d.ts +7 -7
  62. package/MobileDateTimePicker/MobileDateTimePicker.d.ts +2 -2
  63. package/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
  64. package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +7 -7
  65. package/MobileTimePicker/MobileTimePicker.d.ts +2 -2
  66. package/MobileTimePicker/MobileTimePicker.js +11 -6
  67. package/MobileTimePicker/MobileTimePicker.types.d.ts +7 -7
  68. package/MonthCalendar/MonthCalendar.d.ts +3 -4
  69. package/MonthCalendar/MonthCalendar.js +18 -14
  70. package/MonthCalendar/MonthCalendar.types.d.ts +14 -15
  71. package/MonthCalendar/PickersMonth.js +17 -13
  72. package/MultiSectionDigitalClock/MultiSectionDigitalClock.d.ts +1 -2
  73. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +8 -6
  74. package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +3 -4
  75. package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +9 -9
  76. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +2 -3
  77. package/PickersActionBar/PickersActionBar.js +2 -2
  78. package/PickersCalendarHeader/PickersCalendarHeader.d.ts +1 -2
  79. package/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
  80. package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +9 -9
  81. package/PickersDay/PickersDay.d.ts +8 -8
  82. package/PickersLayout/PickersLayout.d.ts +2 -3
  83. package/PickersLayout/PickersLayout.js +0 -2
  84. package/PickersLayout/PickersLayout.types.d.ts +16 -19
  85. package/PickersLayout/index.d.ts +1 -1
  86. package/PickersLayout/usePickerLayout.d.ts +1 -2
  87. package/PickersLayout/usePickerLayout.js +18 -23
  88. package/PickersTextField/PickersInputBase/PickersInputBase.js +10 -9
  89. package/PickersTextField/PickersTextField.js +2 -2
  90. package/README.md +4 -4
  91. package/StaticDatePicker/StaticDatePicker.d.ts +1 -2
  92. package/StaticDatePicker/StaticDatePicker.js +14 -13
  93. package/StaticDatePicker/StaticDatePicker.types.d.ts +7 -7
  94. package/StaticDateTimePicker/StaticDateTimePicker.d.ts +1 -2
  95. package/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
  96. package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +7 -7
  97. package/StaticTimePicker/StaticTimePicker.d.ts +1 -2
  98. package/StaticTimePicker/StaticTimePicker.js +8 -3
  99. package/StaticTimePicker/StaticTimePicker.types.d.ts +7 -7
  100. package/TimeClock/Clock.d.ts +4 -5
  101. package/TimeClock/Clock.js +4 -3
  102. package/TimeClock/ClockNumbers.d.ts +5 -5
  103. package/TimeClock/TimeClock.d.ts +1 -2
  104. package/TimeClock/TimeClock.js +8 -6
  105. package/TimeClock/TimeClock.types.d.ts +4 -4
  106. package/TimeField/TimeField.d.ts +1 -2
  107. package/TimeField/TimeField.js +6 -6
  108. package/TimeField/TimeField.types.d.ts +9 -14
  109. package/TimeField/index.d.ts +1 -1
  110. package/TimeField/useTimeField.d.ts +1 -2
  111. package/TimePicker/TimePicker.d.ts +1 -2
  112. package/TimePicker/TimePicker.js +9 -4
  113. package/TimePicker/TimePicker.types.d.ts +10 -13
  114. package/TimePicker/TimePickerToolbar.d.ts +2 -2
  115. package/TimePicker/TimePickerToolbar.js +8 -7
  116. package/TimePicker/shared.d.ts +10 -10
  117. package/YearCalendar/PickersYear.js +17 -13
  118. package/YearCalendar/YearCalendar.d.ts +1 -2
  119. package/YearCalendar/YearCalendar.js +18 -14
  120. package/YearCalendar/YearCalendar.types.d.ts +14 -15
  121. package/dateViewRenderers/dateViewRenderers.d.ts +3 -3
  122. package/hooks/index.d.ts +2 -2
  123. package/hooks/index.js +2 -2
  124. package/hooks/useClearableField.js +4 -3
  125. package/hooks/useParsedFormat.d.ts +2 -3
  126. package/hooks/useParsedFormat.js +2 -2
  127. package/hooks/usePickerContext.d.ts +4 -0
  128. package/hooks/usePickerContext.js +15 -0
  129. package/hooks/usePickerTranslations.d.ts +1 -0
  130. package/{modern/hooks/usePickersTranslations.js → hooks/usePickerTranslations.js} +1 -1
  131. package/hooks/useSplitFieldProps.d.ts +3 -3
  132. package/index.js +1 -1
  133. package/internals/components/PickerProvider.d.ts +67 -0
  134. package/internals/components/PickerProvider.js +40 -0
  135. package/internals/hooks/date-helpers-hooks.d.ts +6 -6
  136. package/internals/hooks/defaultizedFieldProps.d.ts +7 -8
  137. package/internals/hooks/useClockReferenceDate.d.ts +5 -5
  138. package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +1 -2
  139. package/internals/hooks/useDesktopPicker/useDesktopPicker.js +22 -18
  140. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +15 -15
  141. package/internals/hooks/useField/buildSectionsFromFormat.d.ts +5 -5
  142. package/internals/hooks/useField/useField.d.ts +3 -3
  143. package/internals/hooks/useField/useField.js +1 -1
  144. package/internals/hooks/useField/useField.types.d.ts +40 -50
  145. package/internals/hooks/useField/useField.utils.d.ts +15 -15
  146. package/internals/hooks/useField/useFieldCharacterEditing.d.ts +4 -4
  147. package/internals/hooks/useField/useFieldState.d.ts +4 -4
  148. package/internals/hooks/useField/useFieldState.js +4 -3
  149. package/internals/hooks/useField/useFieldV7TextField.js +4 -3
  150. package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -2
  151. package/internals/hooks/useMobilePicker/useMobilePicker.js +24 -19
  152. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +12 -12
  153. package/internals/hooks/usePicker/usePicker.d.ts +2 -2
  154. package/internals/hooks/usePicker/usePicker.js +15 -10
  155. package/internals/hooks/usePicker/usePicker.types.d.ts +9 -7
  156. package/internals/hooks/usePicker/usePickerLayoutProps.d.ts +6 -8
  157. package/internals/hooks/usePicker/usePickerLayoutProps.js +2 -5
  158. package/internals/hooks/usePicker/usePickerProvider.d.ts +26 -0
  159. package/internals/hooks/usePicker/usePickerProvider.js +77 -0
  160. package/internals/hooks/usePicker/usePickerValue.d.ts +2 -2
  161. package/internals/hooks/usePicker/usePickerValue.js +7 -10
  162. package/internals/hooks/usePicker/usePickerValue.types.d.ts +38 -39
  163. package/internals/hooks/usePicker/usePickerViews.d.ts +7 -11
  164. package/internals/hooks/usePicker/usePickerViews.js +1 -0
  165. package/internals/hooks/usePickerPrivateContext.d.ts +4 -0
  166. package/internals/hooks/usePickerPrivateContext.js +9 -0
  167. package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +1 -2
  168. package/internals/hooks/useStaticPicker/useStaticPicker.js +6 -5
  169. package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +6 -6
  170. package/internals/hooks/useUtils.d.ts +7 -7
  171. package/internals/hooks/useValueWithTimezone.d.ts +19 -15
  172. package/internals/hooks/useValueWithTimezone.js +13 -1
  173. package/internals/hooks/useViews.d.ts +3 -3
  174. package/internals/hooks/useViews.js +1 -1
  175. package/internals/index.d.ts +7 -5
  176. package/internals/index.js +2 -1
  177. package/internals/models/common.d.ts +2 -1
  178. package/internals/models/fields.d.ts +32 -7
  179. package/internals/models/formProps.d.ts +14 -0
  180. package/internals/models/helpers.d.ts +0 -4
  181. package/internals/models/index.d.ts +2 -0
  182. package/internals/models/index.js +3 -1
  183. package/internals/models/props/basePickerProps.d.ts +5 -6
  184. package/internals/models/props/{clock.d.ts → time.d.ts} +10 -17
  185. package/internals/models/props/toolbar.d.ts +0 -2
  186. package/internals/models/validation.d.ts +21 -25
  187. package/internals/models/value.d.ts +3 -0
  188. package/internals/models/value.js +1 -0
  189. package/internals/utils/date-time-utils.d.ts +7 -7
  190. package/internals/utils/date-utils.d.ts +17 -17
  191. package/internals/utils/getDefaultReferenceDate.d.ts +10 -10
  192. package/internals/utils/time-utils.d.ts +5 -5
  193. package/internals/utils/valueManagers.d.ts +3 -3
  194. package/locales/beBY.d.ts +3 -3
  195. package/locales/beBY.js +3 -3
  196. package/locales/bgBG.d.ts +3 -3
  197. package/locales/bgBG.js +3 -3
  198. package/locales/caES.d.ts +3 -3
  199. package/locales/caES.js +3 -3
  200. package/locales/csCZ.d.ts +3 -3
  201. package/locales/csCZ.js +3 -3
  202. package/locales/daDK.d.ts +3 -3
  203. package/locales/daDK.js +3 -3
  204. package/locales/deDE.d.ts +3 -3
  205. package/locales/deDE.js +3 -3
  206. package/locales/elGR.d.ts +3 -3
  207. package/locales/elGR.js +12 -13
  208. package/locales/enUS.d.ts +4 -4
  209. package/locales/enUS.js +3 -3
  210. package/locales/esES.d.ts +3 -3
  211. package/locales/esES.js +3 -3
  212. package/locales/eu.d.ts +3 -3
  213. package/locales/eu.js +3 -3
  214. package/locales/faIR.d.ts +3 -3
  215. package/locales/faIR.js +3 -3
  216. package/locales/fiFI.d.ts +3 -3
  217. package/locales/fiFI.js +3 -3
  218. package/locales/frFR.d.ts +3 -3
  219. package/locales/frFR.js +3 -3
  220. package/locales/heIL.d.ts +3 -3
  221. package/locales/heIL.js +3 -3
  222. package/locales/hrHR.d.ts +3 -3
  223. package/locales/hrHR.js +3 -3
  224. package/locales/huHU.d.ts +3 -3
  225. package/locales/huHU.js +3 -3
  226. package/locales/isIS.d.ts +3 -3
  227. package/locales/isIS.js +3 -3
  228. package/locales/itIT.d.ts +3 -3
  229. package/locales/itIT.js +3 -3
  230. package/locales/jaJP.d.ts +3 -3
  231. package/locales/jaJP.js +3 -3
  232. package/locales/koKR.d.ts +3 -3
  233. package/locales/koKR.js +3 -3
  234. package/locales/kzKZ.d.ts +3 -3
  235. package/locales/kzKZ.js +3 -3
  236. package/locales/mk.d.ts +3 -3
  237. package/locales/mk.js +3 -3
  238. package/locales/nbNO.d.ts +3 -3
  239. package/locales/nbNO.js +3 -3
  240. package/locales/nlNL.d.ts +3 -3
  241. package/locales/nlNL.js +3 -3
  242. package/locales/nnNO.d.ts +3 -3
  243. package/locales/nnNO.js +3 -3
  244. package/locales/plPL.d.ts +3 -3
  245. package/locales/plPL.js +3 -3
  246. package/locales/ptBR.d.ts +3 -3
  247. package/locales/ptBR.js +5 -3
  248. package/locales/ptPT.d.ts +3 -3
  249. package/locales/ptPT.js +3 -3
  250. package/locales/roRO.d.ts +3 -3
  251. package/locales/roRO.js +3 -3
  252. package/locales/ruRU.d.ts +3 -3
  253. package/locales/ruRU.js +3 -3
  254. package/locales/skSK.d.ts +3 -3
  255. package/locales/skSK.js +3 -3
  256. package/locales/svSE.d.ts +3 -3
  257. package/locales/svSE.js +3 -3
  258. package/locales/trTR.d.ts +3 -3
  259. package/locales/trTR.js +3 -3
  260. package/locales/ukUA.d.ts +3 -3
  261. package/locales/ukUA.js +3 -3
  262. package/locales/urPK.d.ts +3 -3
  263. package/locales/urPK.js +3 -3
  264. package/locales/utils/getPickersLocalization.d.ts +9 -9
  265. package/locales/utils/getPickersLocalization.js +1 -1
  266. package/locales/utils/pickersLocaleTextApi.d.ts +12 -36
  267. package/locales/viVN.d.ts +3 -3
  268. package/locales/viVN.js +3 -3
  269. package/locales/zhCN.d.ts +3 -3
  270. package/locales/zhCN.js +3 -3
  271. package/locales/zhHK.d.ts +3 -3
  272. package/locales/zhHK.js +3 -3
  273. package/models/adapters.d.ts +151 -202
  274. package/models/common.d.ts +1 -0
  275. package/models/fields.d.ts +9 -42
  276. package/models/pickers.d.ts +28 -6
  277. package/modern/DateCalendar/DateCalendar.js +21 -22
  278. package/modern/DateCalendar/DayCalendar.js +13 -10
  279. package/modern/DateField/DateField.js +8 -10
  280. package/modern/DatePicker/DatePicker.js +15 -14
  281. package/modern/DatePicker/DatePickerToolbar.js +2 -4
  282. package/modern/DateTimeField/DateTimeField.js +9 -12
  283. package/modern/DateTimePicker/DateTimePicker.js +16 -16
  284. package/modern/DateTimePicker/DateTimePickerTabs.js +2 -2
  285. package/modern/DateTimePicker/DateTimePickerToolbar.js +8 -7
  286. package/modern/DesktopDatePicker/DesktopDatePicker.js +17 -16
  287. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
  288. package/modern/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +0 -2
  289. package/modern/DesktopTimePicker/DesktopTimePicker.js +11 -6
  290. package/modern/DigitalClock/DigitalClock.js +8 -6
  291. package/modern/MobileDatePicker/MobileDatePicker.js +17 -16
  292. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
  293. package/modern/MobileTimePicker/MobileTimePicker.js +11 -6
  294. package/modern/MonthCalendar/MonthCalendar.js +18 -14
  295. package/modern/MonthCalendar/PickersMonth.js +17 -13
  296. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +8 -6
  297. package/modern/PickersActionBar/PickersActionBar.js +2 -2
  298. package/modern/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
  299. package/modern/PickersLayout/PickersLayout.js +0 -2
  300. package/modern/PickersLayout/usePickerLayout.js +18 -23
  301. package/modern/PickersTextField/PickersInputBase/PickersInputBase.js +10 -9
  302. package/modern/PickersTextField/PickersTextField.js +2 -2
  303. package/modern/StaticDatePicker/StaticDatePicker.js +14 -13
  304. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
  305. package/modern/StaticTimePicker/StaticTimePicker.js +8 -3
  306. package/modern/TimeClock/Clock.js +4 -3
  307. package/modern/TimeClock/TimeClock.js +8 -6
  308. package/modern/TimeField/TimeField.js +6 -6
  309. package/modern/TimePicker/TimePicker.js +9 -4
  310. package/modern/TimePicker/TimePickerToolbar.js +8 -7
  311. package/modern/YearCalendar/PickersYear.js +17 -13
  312. package/modern/YearCalendar/YearCalendar.js +18 -14
  313. package/modern/hooks/index.js +2 -2
  314. package/modern/hooks/useClearableField.js +4 -3
  315. package/modern/hooks/useParsedFormat.js +2 -2
  316. package/modern/hooks/usePickerContext.js +15 -0
  317. package/{hooks/usePickersTranslations.js → modern/hooks/usePickerTranslations.js} +1 -1
  318. package/modern/index.js +1 -1
  319. package/modern/internals/components/PickerProvider.js +40 -0
  320. package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +22 -18
  321. package/modern/internals/hooks/useField/useField.js +1 -1
  322. package/modern/internals/hooks/useField/useFieldState.js +4 -3
  323. package/modern/internals/hooks/useField/useFieldV7TextField.js +4 -3
  324. package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +24 -19
  325. package/modern/internals/hooks/usePicker/usePicker.js +15 -10
  326. package/modern/internals/hooks/usePicker/usePickerLayoutProps.js +2 -5
  327. package/modern/internals/hooks/usePicker/usePickerProvider.js +77 -0
  328. package/modern/internals/hooks/usePicker/usePickerValue.js +7 -10
  329. package/modern/internals/hooks/usePicker/usePickerViews.js +1 -0
  330. package/modern/internals/hooks/usePickerPrivateContext.js +9 -0
  331. package/modern/internals/hooks/useStaticPicker/useStaticPicker.js +6 -5
  332. package/modern/internals/hooks/useValueWithTimezone.js +13 -1
  333. package/modern/internals/hooks/useViews.js +1 -1
  334. package/modern/internals/index.js +2 -1
  335. package/modern/internals/models/formProps.js +1 -0
  336. package/modern/internals/models/index.js +3 -1
  337. package/modern/internals/models/props/time.js +1 -0
  338. package/modern/internals/models/value.js +1 -0
  339. package/modern/locales/beBY.js +3 -3
  340. package/modern/locales/bgBG.js +3 -3
  341. package/modern/locales/caES.js +3 -3
  342. package/modern/locales/csCZ.js +3 -3
  343. package/modern/locales/daDK.js +3 -3
  344. package/modern/locales/deDE.js +3 -3
  345. package/modern/locales/elGR.js +12 -13
  346. package/modern/locales/enUS.js +3 -3
  347. package/modern/locales/esES.js +3 -3
  348. package/modern/locales/eu.js +3 -3
  349. package/modern/locales/faIR.js +3 -3
  350. package/modern/locales/fiFI.js +3 -3
  351. package/modern/locales/frFR.js +3 -3
  352. package/modern/locales/heIL.js +3 -3
  353. package/modern/locales/hrHR.js +3 -3
  354. package/modern/locales/huHU.js +3 -3
  355. package/modern/locales/isIS.js +3 -3
  356. package/modern/locales/itIT.js +3 -3
  357. package/modern/locales/jaJP.js +3 -3
  358. package/modern/locales/koKR.js +3 -3
  359. package/modern/locales/kzKZ.js +3 -3
  360. package/modern/locales/mk.js +3 -3
  361. package/modern/locales/nbNO.js +3 -3
  362. package/modern/locales/nlNL.js +3 -3
  363. package/modern/locales/nnNO.js +3 -3
  364. package/modern/locales/plPL.js +3 -3
  365. package/modern/locales/ptBR.js +5 -3
  366. package/modern/locales/ptPT.js +3 -3
  367. package/modern/locales/roRO.js +3 -3
  368. package/modern/locales/ruRU.js +3 -3
  369. package/modern/locales/skSK.js +3 -3
  370. package/modern/locales/svSE.js +3 -3
  371. package/modern/locales/trTR.js +3 -3
  372. package/modern/locales/ukUA.js +3 -3
  373. package/modern/locales/urPK.js +3 -3
  374. package/modern/locales/utils/getPickersLocalization.js +1 -1
  375. package/modern/locales/viVN.js +3 -3
  376. package/modern/locales/zhCN.js +3 -3
  377. package/modern/locales/zhHK.js +3 -3
  378. package/modern/validation/useValidation.js +2 -3
  379. package/modern/validation/validateDate.js +5 -0
  380. package/modern/validation/validateDateTime.js +5 -0
  381. package/modern/validation/validateTime.js +5 -0
  382. package/node/DateCalendar/DateCalendar.js +21 -22
  383. package/node/DateCalendar/DayCalendar.js +13 -10
  384. package/node/DateField/DateField.js +8 -10
  385. package/node/DatePicker/DatePicker.js +15 -14
  386. package/node/DatePicker/DatePickerToolbar.js +2 -4
  387. package/node/DateTimeField/DateTimeField.js +9 -12
  388. package/node/DateTimePicker/DateTimePicker.js +16 -16
  389. package/node/DateTimePicker/DateTimePickerTabs.js +2 -2
  390. package/node/DateTimePicker/DateTimePickerToolbar.js +8 -7
  391. package/node/DesktopDatePicker/DesktopDatePicker.js +17 -16
  392. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
  393. package/node/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +0 -2
  394. package/node/DesktopTimePicker/DesktopTimePicker.js +11 -6
  395. package/node/DigitalClock/DigitalClock.js +8 -6
  396. package/node/MobileDatePicker/MobileDatePicker.js +17 -16
  397. package/node/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
  398. package/node/MobileTimePicker/MobileTimePicker.js +11 -6
  399. package/node/MonthCalendar/MonthCalendar.js +18 -14
  400. package/node/MonthCalendar/PickersMonth.js +17 -13
  401. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +8 -6
  402. package/node/PickersActionBar/PickersActionBar.js +2 -2
  403. package/node/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
  404. package/node/PickersLayout/PickersLayout.js +0 -2
  405. package/node/PickersLayout/usePickerLayout.js +18 -23
  406. package/node/PickersTextField/PickersInputBase/PickersInputBase.js +10 -9
  407. package/node/PickersTextField/PickersTextField.js +2 -2
  408. package/node/StaticDatePicker/StaticDatePicker.js +14 -13
  409. package/node/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
  410. package/node/StaticTimePicker/StaticTimePicker.js +8 -3
  411. package/node/TimeClock/Clock.js +4 -3
  412. package/node/TimeClock/TimeClock.js +8 -6
  413. package/node/TimeField/TimeField.js +6 -6
  414. package/node/TimePicker/TimePicker.js +9 -4
  415. package/node/TimePicker/TimePickerToolbar.js +8 -7
  416. package/node/YearCalendar/PickersYear.js +17 -13
  417. package/node/YearCalendar/YearCalendar.js +18 -14
  418. package/node/hooks/index.js +6 -6
  419. package/node/hooks/useClearableField.js +4 -3
  420. package/node/hooks/useParsedFormat.js +2 -2
  421. package/node/hooks/usePickerContext.js +21 -0
  422. package/node/hooks/usePickerTranslations.js +10 -0
  423. package/node/index.js +1 -1
  424. package/node/internals/components/PickerProvider.js +48 -0
  425. package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +22 -18
  426. package/node/internals/hooks/useField/useField.js +1 -1
  427. package/node/internals/hooks/useField/useFieldState.js +4 -3
  428. package/node/internals/hooks/useField/useFieldV7TextField.js +4 -3
  429. package/node/internals/hooks/useMobilePicker/useMobilePicker.js +24 -19
  430. package/node/internals/hooks/usePicker/usePicker.js +15 -10
  431. package/node/internals/hooks/usePicker/usePickerLayoutProps.js +2 -5
  432. package/node/internals/hooks/usePicker/usePickerProvider.js +87 -0
  433. package/node/internals/hooks/usePicker/usePickerValue.js +6 -10
  434. package/node/internals/hooks/usePicker/usePickerViews.js +1 -0
  435. package/node/internals/hooks/usePickerPrivateContext.js +15 -0
  436. package/node/internals/hooks/useStaticPicker/useStaticPicker.js +6 -5
  437. package/node/internals/hooks/useValueWithTimezone.js +13 -1
  438. package/node/internals/hooks/useViews.js +3 -3
  439. package/node/internals/index.js +14 -7
  440. package/node/internals/models/index.js +22 -0
  441. package/node/internals/models/props/time.js +5 -0
  442. package/node/internals/models/value.js +5 -0
  443. package/node/locales/beBY.js +3 -3
  444. package/node/locales/bgBG.js +3 -3
  445. package/node/locales/caES.js +3 -3
  446. package/node/locales/csCZ.js +3 -3
  447. package/node/locales/daDK.js +3 -3
  448. package/node/locales/deDE.js +3 -3
  449. package/node/locales/elGR.js +12 -13
  450. package/node/locales/enUS.js +3 -3
  451. package/node/locales/esES.js +3 -3
  452. package/node/locales/eu.js +3 -3
  453. package/node/locales/faIR.js +3 -3
  454. package/node/locales/fiFI.js +3 -3
  455. package/node/locales/frFR.js +3 -3
  456. package/node/locales/heIL.js +3 -3
  457. package/node/locales/hrHR.js +3 -3
  458. package/node/locales/huHU.js +3 -3
  459. package/node/locales/isIS.js +3 -3
  460. package/node/locales/itIT.js +3 -3
  461. package/node/locales/jaJP.js +3 -3
  462. package/node/locales/koKR.js +3 -3
  463. package/node/locales/kzKZ.js +3 -3
  464. package/node/locales/mk.js +3 -3
  465. package/node/locales/nbNO.js +3 -3
  466. package/node/locales/nlNL.js +3 -3
  467. package/node/locales/nnNO.js +3 -3
  468. package/node/locales/plPL.js +3 -3
  469. package/node/locales/ptBR.js +5 -3
  470. package/node/locales/ptPT.js +3 -3
  471. package/node/locales/roRO.js +3 -3
  472. package/node/locales/ruRU.js +3 -3
  473. package/node/locales/skSK.js +3 -3
  474. package/node/locales/svSE.js +3 -3
  475. package/node/locales/trTR.js +3 -3
  476. package/node/locales/ukUA.js +3 -3
  477. package/node/locales/urPK.js +3 -3
  478. package/node/locales/utils/getPickersLocalization.js +1 -1
  479. package/node/locales/viVN.js +3 -3
  480. package/node/locales/zhCN.js +3 -3
  481. package/node/locales/zhHK.js +3 -3
  482. package/node/validation/useValidation.js +2 -3
  483. package/node/validation/validateDate.js +4 -0
  484. package/node/validation/validateDateTime.js +4 -0
  485. package/node/validation/validateTime.js +4 -0
  486. package/package.json +5 -5
  487. package/themeAugmentation/props.d.ts +28 -28
  488. package/timeViewRenderers/timeViewRenderers.d.ts +6 -6
  489. package/validation/extractValidationProps.d.ts +4 -4
  490. package/validation/useValidation.d.ts +9 -10
  491. package/validation/useValidation.js +2 -3
  492. package/validation/validateDate.d.ts +7 -2
  493. package/validation/validateDate.js +5 -0
  494. package/validation/validateDateTime.d.ts +10 -4
  495. package/validation/validateDateTime.js +5 -0
  496. package/validation/validateTime.d.ts +7 -2
  497. package/validation/validateTime.js +5 -0
  498. package/hooks/usePickersContext.d.ts +0 -4
  499. package/hooks/usePickersContext.js +0 -15
  500. package/hooks/usePickersTranslations.d.ts +0 -2
  501. package/internals/components/PickersProvider.d.ts +0 -34
  502. package/internals/components/PickersProvider.js +0 -26
  503. package/internals/hooks/usePicker/usePickerOwnerState.d.ts +0 -9
  504. package/internals/hooks/usePicker/usePickerOwnerState.js +0 -13
  505. package/modern/hooks/usePickersContext.js +0 -15
  506. package/modern/internals/components/PickersProvider.js +0 -26
  507. package/modern/internals/hooks/usePicker/usePickerOwnerState.js +0 -13
  508. package/node/hooks/usePickersContext.js +0 -21
  509. package/node/hooks/usePickersTranslations.js +0 -10
  510. package/node/internals/components/PickersProvider.js +0 -34
  511. package/node/internals/hooks/usePicker/usePickerOwnerState.js +0 -20
  512. /package/internals/models/{props/clock.js → formProps.js} +0 -0
  513. /package/{modern/internals/models/props/clock.js → internals/models/props/time.js} +0 -0
  514. /package/node/internals/models/{props/clock.js → formProps.js} +0 -0
@@ -1,15 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { TextFieldProps } from '@mui/material/TextField';
3
- import { SxProps } from '@mui/material/styles';
4
- import type { BaseFieldProps } from '../internals/models/fields';
5
- import type { ExportedUseClearableFieldProps, UseClearableFieldResponse, UseClearableFieldSlotProps, UseClearableFieldSlots } from '../hooks/useClearableField';
6
- import { ExportedPickersSectionListProps, PickersSectionListRef } from '../PickersSectionList';
7
- import type { UseFieldResponse } from '../internals/hooks/useField';
3
+ import type { ExportedUseClearableFieldProps, UseClearableFieldResponse } from '../hooks/useClearableField';
4
+ import { ExportedPickersSectionListProps } from '../PickersSectionList';
5
+ import type { UseFieldInternalProps, UseFieldResponse } from '../internals/hooks/useField';
8
6
  import type { PickersTextFieldProps } from '../PickersTextField';
9
- import { PickerValidDate } from './pickers';
7
+ import { BaseForwardedSingleInputFieldProps } from '../internals/models';
10
8
  export type FieldSectionType = 'year' | 'month' | 'day' | 'weekDay' | 'hours' | 'minutes' | 'seconds' | 'meridiem' | 'empty';
11
9
  export type FieldSectionContentType = 'digit' | 'digit-with-letter' | 'letter';
12
- export type FieldValueType = 'date' | 'time' | 'date-time';
13
10
  export interface FieldSection {
14
11
  /**
15
12
  * Value of the section, as rendered inside the input.
@@ -101,48 +98,18 @@ export interface FieldRef<TSection extends FieldSection> {
101
98
  isFieldFocused: () => boolean;
102
99
  }
103
100
  export type FieldSelectedSections = number | FieldSectionType | null | 'all';
104
- interface BaseForwardedCommonSingleInputFieldProps extends ExportedUseClearableFieldProps {
105
- ref?: React.Ref<HTMLDivElement>;
106
- sx?: SxProps<any>;
107
- label?: React.ReactNode;
108
- id?: string;
109
- name?: string;
110
- onKeyDown?: React.KeyboardEventHandler;
111
- onBlur?: React.FocusEventHandler;
112
- focused?: boolean;
113
- InputProps?: {
114
- ref?: React.Ref<any>;
115
- endAdornment?: React.ReactNode;
116
- startAdornment?: React.ReactNode;
117
- };
118
- inputProps?: {
119
- 'aria-label'?: string;
120
- };
121
- slots?: UseClearableFieldSlots;
122
- slotProps?: UseClearableFieldSlotProps & {
123
- textField?: {};
124
- };
125
- }
126
- interface BaseForwardedV6SingleInputFieldProps {
127
- inputRef?: React.Ref<HTMLInputElement>;
128
- }
129
- interface BaseForwardedV7SingleInputFieldProps {
130
- sectionListRef?: React.Ref<PickersSectionListRef>;
131
- }
132
- type BaseForwardedSingleInputFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> = BaseForwardedCommonSingleInputFieldProps & (TEnableAccessibleFieldDOMStructure extends false ? BaseForwardedV6SingleInputFieldProps : BaseForwardedV7SingleInputFieldProps);
133
101
  /**
134
- * Props the single input field can receive when used inside a picker.
135
- * Only contains what the MUI components are passing to the field,
136
- * not what users can pass using the `props.slotProps.field`.
102
+ * Props the prop `slotProps.field` of a picker can receive.
137
103
  */
138
- export type BaseSingleInputFieldProps<TValue, TDate extends PickerValidDate, TSection extends FieldSection, TEnableAccessibleFieldDOMStructure extends boolean, TError> = BaseFieldProps<TValue, TDate, TSection, TEnableAccessibleFieldDOMStructure, TError> & BaseForwardedSingleInputFieldProps<TEnableAccessibleFieldDOMStructure>;
104
+ export type PickerFieldSlotProps<TValue, TSection extends FieldSection, TEnableAccessibleFieldDOMStructure extends boolean> = ExportedUseClearableFieldProps & Pick<UseFieldInternalProps<TValue, TSection, TEnableAccessibleFieldDOMStructure, unknown>, 'shouldRespectLeadingZeros' | 'readOnly'> & React.HTMLAttributes<HTMLDivElement> & {
105
+ ref?: React.Ref<HTMLDivElement>;
106
+ };
139
107
  /**
140
108
  * Props the text field receives when used with a single input picker.
141
109
  * Only contains what the MUI components are passing to the text field, not what users can pass using the `props.slotProps.field` and `props.slotProps.textField`.
142
110
  */
143
- export type BaseSingleInputPickersTextFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> = UseClearableFieldResponse<UseFieldResponse<TEnableAccessibleFieldDOMStructure, BaseForwardedSingleInputFieldProps<TEnableAccessibleFieldDOMStructure>>>;
111
+ export type BaseSingleInputPickersTextFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> = UseClearableFieldResponse<UseFieldResponse<TEnableAccessibleFieldDOMStructure, BaseForwardedSingleInputFieldProps>>;
144
112
  /**
145
113
  * Props the built-in text field component can receive.
146
114
  */
147
115
  export type BuiltInFieldTextFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> = TEnableAccessibleFieldDOMStructure extends false ? Omit<TextFieldProps, 'autoComplete' | 'error' | 'maxRows' | 'minRows' | 'multiline' | 'placeholder' | 'rows' | 'select' | 'SelectProps' | 'type'> : Partial<Omit<PickersTextFieldProps, keyof ExportedPickersSectionListProps>>;
148
- export {};
@@ -1,3 +1,4 @@
1
+ import { PickerOrientation, PickerVariant } from '../internals/models/common';
1
2
  import type { PickersShortcutsItemContext } from '../PickersShortcuts';
2
3
  export interface PickerChangeHandlerContext<TError> {
3
4
  validationError: TError;
@@ -10,21 +11,42 @@ export interface PickerChangeHandlerContext<TError> {
10
11
  export interface PickerValidDateLookup {
11
12
  }
12
13
  export type PickerValidDate = keyof PickerValidDateLookup extends never ? any : PickerValidDateLookup[keyof PickerValidDateLookup];
13
- export interface PickerOwnerState<TValue> {
14
+ export interface PickerOwnerState {
14
15
  /**
15
- * The value currently displayed in the field and in the view.
16
+ * `true` if the value of the picker is currently empty.
17
+ * Is always `false` if the component you are accessing the ownerState from is not wrapped by a picker.
16
18
  */
17
- value: TValue;
19
+ isPickerValueEmpty: boolean;
18
20
  /**
19
21
  * `true` if the picker is open, `false` otherwise.
22
+ * Is always `false` if the component you are accessing the ownerState from is not wrapped by a picker.
20
23
  */
21
- open: boolean;
24
+ isPickerOpen: boolean;
22
25
  /**
23
26
  * `true` if the picker is disabled, `false` otherwise.
27
+ * Is always `false` if the component you are accessing the ownerState from is not wrapped by a picker.
24
28
  */
25
- disabled: boolean;
29
+ isPickerDisabled: boolean;
26
30
  /**
27
31
  * `true` if the picker is read-only, `false` otherwise.
32
+ * Is always `false` if the component you are accessing the ownerState from is not wrapped by a picker.
28
33
  */
29
- readOnly: boolean;
34
+ isPickerReadOnly: boolean;
35
+ /**
36
+ * The responsive variant of the picker.
37
+ * Is equal to "desktop" when using a desktop picker (like <DesktopDatePicker />).
38
+ * Is equal to "mobile" when using a mobile picker (like <MobileDatePicker />).
39
+ * Is equal to "mobile" or "desktop" when using a responsive picker (like <DatePicker />) depending on the `desktopModeMediaQuery` prop.
40
+ * Is equal to "mobile" or "desktop" when using a static picker (like <StaticDatePicker />) depending on the `displayStaticWrapperAs` prop.
41
+ * Is always equal to "desktop" if the component you are accessing the ownerState from is not wrapped by a picker.
42
+ */
43
+ pickerVariant: PickerVariant;
44
+ /**
45
+ * The orientation of the picker.
46
+ * Is equal to "landscape" when the picker is in landscape orientation.
47
+ * Is equal to "portrait" when the picker is in portrait orientation.
48
+ * You can use the "orientation" on any picker component to force the orientation.
49
+ * Is always equal to "portrait" if the component you are accessing the ownerState from is not wrapped by a picker.
50
+ */
51
+ pickerOrientation: PickerOrientation;
30
52
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
- const _excluded = ["autoFocus", "onViewChange", "value", "defaultValue", "referenceDate", "disableFuture", "disablePast", "onChange", "onYearChange", "onMonthChange", "reduceAnimations", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "view", "views", "openTo", "className", "disabled", "readOnly", "minDate", "maxDate", "disableHighlightToday", "focusedView", "onFocusedViewChange", "showDaysOutsideCurrentMonth", "fixedWeekNumber", "dayOfWeekFormatter", "slots", "slotProps", "loading", "renderLoading", "displayWeekNumber", "yearsOrder", "yearsPerRow", "monthsPerRow", "timezone"];
5
+ const _excluded = ["autoFocus", "onViewChange", "value", "defaultValue", "referenceDate", "disableFuture", "disablePast", "onChange", "onYearChange", "onMonthChange", "reduceAnimations", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "view", "views", "openTo", "className", "classes", "disabled", "readOnly", "minDate", "maxDate", "disableHighlightToday", "focusedView", "onFocusedViewChange", "showDaysOutsideCurrentMonth", "fixedWeekNumber", "dayOfWeekFormatter", "slots", "slotProps", "loading", "renderLoading", "displayWeekNumber", "yearsOrder", "yearsPerRow", "monthsPerRow", "timezone"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
@@ -24,11 +24,9 @@ import { getDateCalendarUtilityClass } from "./dateCalendarClasses.js";
24
24
  import { useControlledValueWithTimezone } from "../internals/hooks/useValueWithTimezone.js";
25
25
  import { singleItemValueManager } from "../internals/utils/valueManagers.js";
26
26
  import { VIEW_HEIGHT } from "../internals/constants/dimensions.js";
27
+ import { usePickerPrivateContext } from "../internals/hooks/usePickerPrivateContext.js";
27
28
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
28
- const useUtilityClasses = ownerState => {
29
- const {
30
- classes
31
- } = ownerState;
29
+ const useUtilityClasses = classes => {
32
30
  const slots = {
33
31
  root: ['root'],
34
32
  viewTransitionContainer: ['viewTransitionContainer']
@@ -84,6 +82,9 @@ const DateCalendarViewTransitionContainer = styled(PickersFadeTransitionGroup, {
84
82
  */
85
83
  export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(inProps, ref) {
86
84
  const utils = useUtils();
85
+ const {
86
+ ownerState
87
+ } = usePickerPrivateContext();
87
88
  const id = useId();
88
89
  const props = useDateCalendarDefaultizedProps(inProps, 'MuiDateCalendar');
89
90
  const {
@@ -105,6 +106,7 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
105
106
  views,
106
107
  openTo,
107
108
  className,
109
+ classes: classesProp,
108
110
  disabled,
109
111
  readOnly,
110
112
  minDate,
@@ -135,6 +137,7 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
135
137
  timezone: timezoneProp,
136
138
  value: valueProp,
137
139
  defaultValue,
140
+ referenceDate: referenceDateProp,
138
141
  onChange,
139
142
  valueManager: singleItemValueManager
140
143
  });
@@ -203,7 +206,7 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
203
206
  timezone,
204
207
  labelId: gridLabelId
205
208
  },
206
- ownerState: props
209
+ ownerState
207
210
  });
208
211
  const handleDateMonthChange = useEventCallback(newDate => {
209
212
  const startOfMonth = utils.startOfMonth(newDate);
@@ -262,8 +265,7 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
262
265
  }
263
266
  }, [value]); // eslint-disable-line
264
267
 
265
- const ownerState = props;
266
- const classes = useUtilityClasses(ownerState);
268
+ const classes = useUtilityClasses(classesProp);
267
269
  const baseDateValidationProps = {
268
270
  disablePast,
269
271
  disableFuture,
@@ -365,9 +367,9 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
365
367
  className: PropTypes.string,
366
368
  /**
367
369
  * Formats the day of week displayed in the calendar header.
368
- * @param {TDate} date The date of the day of week provided by the adapter.
370
+ * @param {PickerValidDate} date The date of the day of week provided by the adapter.
369
371
  * @returns {string} The name to display.
370
- * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
372
+ * @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
371
373
  */
372
374
  dayOfWeekFormatter: PropTypes.func,
373
375
  /**
@@ -376,7 +378,8 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
376
378
  */
377
379
  defaultValue: PropTypes.object,
378
380
  /**
379
- * If `true`, the picker and text field are disabled.
381
+ * If `true`, the component is disabled.
382
+ * When disabled, the value cannot be changed and no interaction is possible.
380
383
  * @default false
381
384
  */
382
385
  disabled: PropTypes.bool,
@@ -447,8 +450,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
447
450
  onFocusedViewChange: PropTypes.func,
448
451
  /**
449
452
  * Callback fired on month change.
450
- * @template TDate
451
- * @param {TDate} month The new month.
453
+ * @param {PickerValidDate} month The new month.
452
454
  */
453
455
  onMonthChange: PropTypes.func,
454
456
  /**
@@ -459,8 +461,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
459
461
  onViewChange: PropTypes.func,
460
462
  /**
461
463
  * Callback fired on year change.
462
- * @template TDate
463
- * @param {TDate} year The new year.
464
+ * @param {PickerValidDate} year The new year.
464
465
  */
465
466
  onYearChange: PropTypes.func,
466
467
  /**
@@ -470,7 +471,8 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
470
471
  */
471
472
  openTo: PropTypes.oneOf(['day', 'month', 'year']),
472
473
  /**
473
- * Make picker read only.
474
+ * If `true`, the component is read-only.
475
+ * When read-only, the value cannot be changed but the user can interact with the interface.
474
476
  * @default false
475
477
  */
476
478
  readOnly: PropTypes.bool,
@@ -495,22 +497,19 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
495
497
  *
496
498
  * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
497
499
  *
498
- * @template TDate
499
- * @param {TDate} day The date to test.
500
+ * @param {PickerValidDate} day The date to test.
500
501
  * @returns {boolean} If `true` the date will be disabled.
501
502
  */
502
503
  shouldDisableDate: PropTypes.func,
503
504
  /**
504
505
  * Disable specific month.
505
- * @template TDate
506
- * @param {TDate} month The month to test.
506
+ * @param {PickerValidDate} month The month to test.
507
507
  * @returns {boolean} If `true`, the month will be disabled.
508
508
  */
509
509
  shouldDisableMonth: PropTypes.func,
510
510
  /**
511
511
  * Disable specific year.
512
- * @template TDate
513
- * @param {TDate} year The year to test.
512
+ * @param {PickerValidDate} year The year to test.
514
513
  * @returns {boolean} If `true`, the year will be disabled.
515
514
  */
516
515
  shouldDisableYear: PropTypes.func,
@@ -11,18 +11,16 @@ import { styled, useThemeProps } from '@mui/material/styles';
11
11
  import { unstable_composeClasses as composeClasses, unstable_useControlled as useControlled } from '@mui/utils';
12
12
  import clsx from 'clsx';
13
13
  import { PickersDay } from "../PickersDay/PickersDay.js";
14
- import { usePickersTranslations } from "../hooks/usePickersTranslations.js";
14
+ import { usePickerTranslations } from "../hooks/usePickerTranslations.js";
15
15
  import { useUtils, useNow } from "../internals/hooks/useUtils.js";
16
16
  import { DAY_SIZE, DAY_MARGIN } from "../internals/constants/dimensions.js";
17
17
  import { PickersSlideTransition } from "./PickersSlideTransition.js";
18
18
  import { useIsDateDisabled } from "./useIsDateDisabled.js";
19
19
  import { findClosestEnabledDate, getWeekdays } from "../internals/utils/date-utils.js";
20
20
  import { getDayCalendarUtilityClass } from "./dayCalendarClasses.js";
21
+ import { usePickerPrivateContext } from "../internals/hooks/usePickerPrivateContext.js";
21
22
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
- const useUtilityClasses = ownerState => {
23
- const {
24
- classes
25
- } = ownerState;
23
+ const useUtilityClasses = classes => {
26
24
  const slots = {
27
25
  root: ['root'],
28
26
  header: ['header'],
@@ -155,9 +153,13 @@ function WrappedDay(_ref) {
155
153
  } = parentProps;
156
154
  const utils = useUtils();
157
155
  const now = useNow(timezone);
156
+ const {
157
+ ownerState
158
+ } = usePickerPrivateContext();
158
159
  const isFocusableDay = focusableDay !== null && utils.isSameDay(day, focusableDay);
159
160
  const isSelected = selectedDays.some(selectedDay => utils.isSameDay(selectedDay, day));
160
161
  const isToday = utils.isSameDay(day, now);
162
+ const isDisabled = React.useMemo(() => disabled || isDateDisabled(day), [disabled, isDateDisabled, day]);
161
163
  const Day = slots?.day ?? PickersDay;
162
164
  // We don't want to pass to ownerState down, to avoid re-rendering all the day whenever a prop changes.
163
165
  const _useSlotProps = useSlotProps({
@@ -171,13 +173,13 @@ function WrappedDay(_ref) {
171
173
  // it is used in date range dragging logic by accessing `dataset.timestamp`
172
174
  'data-timestamp': utils.toJsDate(day).valueOf()
173
175
  }, other),
174
- ownerState: _extends({}, parentProps, {
176
+ ownerState: _extends({}, ownerState, {
175
177
  day,
176
- selected: isSelected
178
+ isDayDisabled: isDisabled,
179
+ isDaySelected: isSelected
177
180
  })
178
181
  }),
179
182
  dayProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
180
- const isDisabled = React.useMemo(() => disabled || isDateDisabled(day), [disabled, isDateDisabled, day]);
181
183
  const outsideCurrentMonth = React.useMemo(() => utils.getMonth(day) !== currentMonthNumber, [utils, day, currentMonthNumber]);
182
184
  const isFirstVisibleCell = React.useMemo(() => {
183
185
  const startOfMonth = utils.startOfMonth(utils.setMonth(day, currentMonthNumber));
@@ -220,6 +222,7 @@ export function DayCalendar(inProps) {
220
222
  const {
221
223
  onFocusedDayChange,
222
224
  className,
225
+ classes: classesProp,
223
226
  currentMonth,
224
227
  selectedDays,
225
228
  focusedDay,
@@ -250,7 +253,7 @@ export function DayCalendar(inProps) {
250
253
  timezone
251
254
  } = props;
252
255
  const now = useNow(timezone);
253
- const classes = useUtilityClasses(props);
256
+ const classes = useUtilityClasses(classesProp);
254
257
  const isRtl = useRtl();
255
258
  const isDateDisabled = useIsDateDisabled({
256
259
  shouldDisableDate,
@@ -262,7 +265,7 @@ export function DayCalendar(inProps) {
262
265
  disableFuture,
263
266
  timezone
264
267
  });
265
- const translations = usePickersTranslations();
268
+ const translations = usePickerTranslations();
266
269
  const [internalHasFocus, setInternalHasFocus] = useControlled({
267
270
  name: 'DayCalendar',
268
271
  state: 'hasFocus',
@@ -37,7 +37,7 @@ const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, inRe
37
37
  } = themeProps,
38
38
  other = _objectWithoutPropertiesLoose(themeProps, _excluded);
39
39
  const ownerState = themeProps;
40
- const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure ? PickersTextField : MuiTextField);
40
+ const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure === false ? MuiTextField : PickersTextField);
41
41
  const textFieldProps = useSlotProps({
42
42
  elementType: TextField,
43
43
  externalSlotProps: slotProps?.textField,
@@ -89,6 +89,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
89
89
  defaultValue: PropTypes.object,
90
90
  /**
91
91
  * If `true`, the component is disabled.
92
+ * When disabled, the value cannot be changed and no interaction is possible.
92
93
  * @default false
93
94
  */
94
95
  disabled: PropTypes.bool,
@@ -103,7 +104,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
103
104
  */
104
105
  disablePast: PropTypes.bool,
105
106
  /**
106
- * @default false
107
+ * @default true
107
108
  */
108
109
  enableAccessibleFieldDOMStructure: PropTypes.bool,
109
110
  /**
@@ -218,8 +219,8 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
218
219
  */
219
220
  onSelectedSectionsChange: PropTypes.func,
220
221
  /**
221
- * It prevents the user from changing the value of the field
222
- * (not from interacting with the field).
222
+ * If `true`, the component is read-only.
223
+ * When read-only, the value cannot be changed but the user can interact with the interface.
223
224
  * @default false
224
225
  */
225
226
  readOnly: PropTypes.bool,
@@ -249,22 +250,19 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
249
250
  *
250
251
  * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
251
252
  *
252
- * @template TDate
253
- * @param {TDate} day The date to test.
253
+ * @param {PickerValidDate} day The date to test.
254
254
  * @returns {boolean} If `true` the date will be disabled.
255
255
  */
256
256
  shouldDisableDate: PropTypes.func,
257
257
  /**
258
258
  * Disable specific month.
259
- * @template TDate
260
- * @param {TDate} month The month to test.
259
+ * @param {PickerValidDate} month The month to test.
261
260
  * @returns {boolean} If `true`, the month will be disabled.
262
261
  */
263
262
  shouldDisableMonth: PropTypes.func,
264
263
  /**
265
264
  * Disable specific year.
266
- * @template TDate
267
- * @param {TDate} year The year to test.
265
+ * @param {PickerValidDate} year The year to test.
268
266
  * @returns {boolean} If `true`, the year will be disabled.
269
267
  */
270
268
  shouldDisableYear: PropTypes.func,
@@ -65,9 +65,9 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
65
65
  closeOnSelect: PropTypes.bool,
66
66
  /**
67
67
  * Formats the day of week displayed in the calendar header.
68
- * @param {TDate} date The date of the day of week provided by the adapter.
68
+ * @param {PickerValidDate} date The date of the day of week provided by the adapter.
69
69
  * @returns {string} The name to display.
70
- * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
70
+ * @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
71
71
  */
72
72
  dayOfWeekFormatter: PropTypes.func,
73
73
  /**
@@ -82,7 +82,8 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
82
82
  */
83
83
  desktopModeMediaQuery: PropTypes.string,
84
84
  /**
85
- * If `true`, the picker and text field are disabled.
85
+ * If `true`, the component is disabled.
86
+ * When disabled, the value cannot be changed and no interaction is possible.
86
87
  * @default false
87
88
  */
88
89
  disabled: PropTypes.bool,
@@ -111,7 +112,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
111
112
  */
112
113
  displayWeekNumber: PropTypes.bool,
113
114
  /**
114
- * @default false
115
+ * @default true
115
116
  */
116
117
  enableAccessibleFieldDOMStructure: PropTypes.any,
117
118
  /**
@@ -201,8 +202,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
201
202
  onError: PropTypes.func,
202
203
  /**
203
204
  * Callback fired on month change.
204
- * @template TDate
205
- * @param {TDate} month The new month.
205
+ * @param {PickerValidDate} month The new month.
206
206
  */
207
207
  onMonthChange: PropTypes.func,
208
208
  /**
@@ -223,8 +223,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
223
223
  onViewChange: PropTypes.func,
224
224
  /**
225
225
  * Callback fired on year change.
226
- * @template TDate
227
- * @param {TDate} year The new year.
226
+ * @param {PickerValidDate} year The new year.
228
227
  */
229
228
  onYearChange: PropTypes.func,
230
229
  /**
@@ -242,6 +241,11 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
242
241
  * Force rendering in particular orientation.
243
242
  */
244
243
  orientation: PropTypes.oneOf(['landscape', 'portrait']),
244
+ /**
245
+ * If `true`, the component is read-only.
246
+ * When read-only, the value cannot be changed but the user can interact with the interface.
247
+ * @default false
248
+ */
245
249
  readOnly: PropTypes.bool,
246
250
  /**
247
251
  * If `true`, disable heavy animations.
@@ -274,22 +278,19 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
274
278
  *
275
279
  * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
276
280
  *
277
- * @template TDate
278
- * @param {TDate} day The date to test.
281
+ * @param {PickerValidDate} day The date to test.
279
282
  * @returns {boolean} If `true` the date will be disabled.
280
283
  */
281
284
  shouldDisableDate: PropTypes.func,
282
285
  /**
283
286
  * Disable specific month.
284
- * @template TDate
285
- * @param {TDate} month The month to test.
287
+ * @param {PickerValidDate} month The month to test.
286
288
  * @returns {boolean} If `true`, the month will be disabled.
287
289
  */
288
290
  shouldDisableMonth: PropTypes.func,
289
291
  /**
290
292
  * Disable specific year.
291
- * @template TDate
292
- * @param {TDate} year The year to test.
293
+ * @param {PickerValidDate} year The year to test.
293
294
  * @returns {boolean} If `true`, the year will be disabled.
294
295
  */
295
296
  shouldDisableYear: PropTypes.func,
@@ -10,7 +10,7 @@ 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 { usePickersTranslations } from "../hooks/usePickersTranslations.js";
13
+ import { usePickerTranslations } from "../hooks/usePickerTranslations.js";
14
14
  import { useUtils } from "../internals/hooks/useUtils.js";
15
15
  import { getDatePickerToolbarUtilityClass } from "./datePickerToolbarClasses.js";
16
16
  import { resolveDateFormat } from "../internals/utils/date-utils.js";
@@ -69,7 +69,7 @@ export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePick
69
69
  } = props,
70
70
  other = _objectWithoutPropertiesLoose(props, _excluded);
71
71
  const utils = useUtils();
72
- const translations = usePickersTranslations();
72
+ const translations = usePickerTranslations();
73
73
  const classes = useUtilityClasses(props);
74
74
  const dateText = React.useMemo(() => {
75
75
  if (!value) {
@@ -107,7 +107,6 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
107
107
  */
108
108
  classes: PropTypes.object,
109
109
  className: PropTypes.string,
110
- disabled: PropTypes.bool,
111
110
  /**
112
111
  * If `true`, show the toolbar even in desktop mode.
113
112
  * @default `true` for Desktop, `false` for Mobile.
@@ -121,7 +120,6 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
121
120
  * @param {TView} view The view to open
122
121
  */
123
122
  onViewChange: PropTypes.func.isRequired,
124
- readOnly: PropTypes.bool,
125
123
  /**
126
124
  * The system prop that allows defining system overrides as well as additional CSS styles.
127
125
  */
@@ -37,7 +37,7 @@ const DateTimeField = /*#__PURE__*/React.forwardRef(function DateTimeField(inPro
37
37
  } = themeProps,
38
38
  other = _objectWithoutPropertiesLoose(themeProps, _excluded);
39
39
  const ownerState = themeProps;
40
- const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure ? PickersTextField : MuiTextField);
40
+ const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure === false ? MuiTextField : PickersTextField);
41
41
  const textFieldProps = useSlotProps({
42
42
  elementType: TextField,
43
43
  externalSlotProps: slotProps?.textField,
@@ -94,6 +94,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
94
94
  defaultValue: PropTypes.object,
95
95
  /**
96
96
  * If `true`, the component is disabled.
97
+ * When disabled, the value cannot be changed and no interaction is possible.
97
98
  * @default false
98
99
  */
99
100
  disabled: PropTypes.bool,
@@ -113,7 +114,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
113
114
  */
114
115
  disablePast: PropTypes.bool,
115
116
  /**
116
- * @default false
117
+ * @default true
117
118
  */
118
119
  enableAccessibleFieldDOMStructure: PropTypes.bool,
119
120
  /**
@@ -251,8 +252,8 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
251
252
  */
252
253
  onSelectedSectionsChange: PropTypes.func,
253
254
  /**
254
- * It prevents the user from changing the value of the field
255
- * (not from interacting with the field).
255
+ * If `true`, the component is read-only.
256
+ * When read-only, the value cannot be changed but the user can interact with the interface.
256
257
  * @default false
257
258
  */
258
259
  readOnly: PropTypes.bool,
@@ -282,30 +283,26 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
282
283
  *
283
284
  * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
284
285
  *
285
- * @template TDate
286
- * @param {TDate} day The date to test.
286
+ * @param {PickerValidDate} day The date to test.
287
287
  * @returns {boolean} If `true` the date will be disabled.
288
288
  */
289
289
  shouldDisableDate: PropTypes.func,
290
290
  /**
291
291
  * Disable specific month.
292
- * @template TDate
293
- * @param {TDate} month The month to test.
292
+ * @param {PickerValidDate} month The month to test.
294
293
  * @returns {boolean} If `true`, the month will be disabled.
295
294
  */
296
295
  shouldDisableMonth: PropTypes.func,
297
296
  /**
298
297
  * Disable specific time.
299
- * @template TDate
300
- * @param {TDate} value The value to check.
298
+ * @param {PickerValidDate} value The value to check.
301
299
  * @param {TimeView} view The clock type of the timeValue.
302
300
  * @returns {boolean} If `true` the time will be disabled.
303
301
  */
304
302
  shouldDisableTime: PropTypes.func,
305
303
  /**
306
304
  * Disable specific year.
307
- * @template TDate
308
- * @param {TDate} year The year to test.
305
+ * @param {PickerValidDate} year The year to test.
309
306
  * @returns {boolean} If `true`, the year will be disabled.
310
307
  */
311
308
  shouldDisableYear: PropTypes.func,