@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
@@ -64,9 +64,9 @@ StaticDatePicker.propTypes = {
64
64
  className: PropTypes.string,
65
65
  /**
66
66
  * Formats the day of week displayed in the calendar header.
67
- * @param {TDate} date The date of the day of week provided by the adapter.
67
+ * @param {PickerValidDate} date The date of the day of week provided by the adapter.
68
68
  * @returns {string} The name to display.
69
- * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
69
+ * @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
70
70
  */
71
71
  dayOfWeekFormatter: PropTypes.func,
72
72
  /**
@@ -75,7 +75,8 @@ StaticDatePicker.propTypes = {
75
75
  */
76
76
  defaultValue: PropTypes.object,
77
77
  /**
78
- * If `true`, the picker and text field are disabled.
78
+ * If `true`, the component is disabled.
79
+ * When disabled, the value cannot be changed and no interaction is possible.
79
80
  * @default false
80
81
  */
81
82
  disabled: PropTypes.bool,
@@ -168,8 +169,7 @@ StaticDatePicker.propTypes = {
168
169
  onError: PropTypes.func,
169
170
  /**
170
171
  * Callback fired on month change.
171
- * @template TDate
172
- * @param {TDate} month The new month.
172
+ * @param {PickerValidDate} month The new month.
173
173
  */
174
174
  onMonthChange: PropTypes.func,
175
175
  /**
@@ -180,8 +180,7 @@ StaticDatePicker.propTypes = {
180
180
  onViewChange: PropTypes.func,
181
181
  /**
182
182
  * Callback fired on year change.
183
- * @template TDate
184
- * @param {TDate} year The new year.
183
+ * @param {PickerValidDate} year The new year.
185
184
  */
186
185
  onYearChange: PropTypes.func,
187
186
  /**
@@ -194,6 +193,11 @@ StaticDatePicker.propTypes = {
194
193
  * Force rendering in particular orientation.
195
194
  */
196
195
  orientation: PropTypes.oneOf(['landscape', 'portrait']),
196
+ /**
197
+ * If `true`, the component is read-only.
198
+ * When read-only, the value cannot be changed but the user can interact with the interface.
199
+ * @default false
200
+ */
197
201
  readOnly: PropTypes.bool,
198
202
  /**
199
203
  * If `true`, disable heavy animations.
@@ -216,22 +220,19 @@ StaticDatePicker.propTypes = {
216
220
  *
217
221
  * 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.
218
222
  *
219
- * @template TDate
220
- * @param {TDate} day The date to test.
223
+ * @param {PickerValidDate} day The date to test.
221
224
  * @returns {boolean} If `true` the date will be disabled.
222
225
  */
223
226
  shouldDisableDate: PropTypes.func,
224
227
  /**
225
228
  * Disable specific month.
226
- * @template TDate
227
- * @param {TDate} month The month to test.
229
+ * @param {PickerValidDate} month The month to test.
228
230
  * @returns {boolean} If `true`, the month will be disabled.
229
231
  */
230
232
  shouldDisableMonth: PropTypes.func,
231
233
  /**
232
234
  * Disable specific year.
233
- * @template TDate
234
- * @param {TDate} year The year to test.
235
+ * @param {PickerValidDate} year The year to test.
235
236
  * @returns {boolean} If `true`, the year will be disabled.
236
237
  */
237
238
  shouldDisableYear: PropTypes.func,
@@ -84,9 +84,9 @@ StaticDateTimePicker.propTypes = {
84
84
  className: PropTypes.string,
85
85
  /**
86
86
  * Formats the day of week displayed in the calendar header.
87
- * @param {TDate} date The date of the day of week provided by the adapter.
87
+ * @param {PickerValidDate} date The date of the day of week provided by the adapter.
88
88
  * @returns {string} The name to display.
89
- * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
89
+ * @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
90
90
  */
91
91
  dayOfWeekFormatter: PropTypes.func,
92
92
  /**
@@ -95,7 +95,8 @@ StaticDateTimePicker.propTypes = {
95
95
  */
96
96
  defaultValue: PropTypes.object,
97
97
  /**
98
- * If `true`, the picker and text field are disabled.
98
+ * If `true`, the component is disabled.
99
+ * When disabled, the value cannot be changed and no interaction is possible.
99
100
  * @default false
100
101
  */
101
102
  disabled: PropTypes.bool,
@@ -216,8 +217,7 @@ StaticDateTimePicker.propTypes = {
216
217
  onError: PropTypes.func,
217
218
  /**
218
219
  * Callback fired on month change.
219
- * @template TDate
220
- * @param {TDate} month The new month.
220
+ * @param {PickerValidDate} month The new month.
221
221
  */
222
222
  onMonthChange: PropTypes.func,
223
223
  /**
@@ -228,8 +228,7 @@ StaticDateTimePicker.propTypes = {
228
228
  onViewChange: PropTypes.func,
229
229
  /**
230
230
  * Callback fired on year change.
231
- * @template TDate
232
- * @param {TDate} year The new year.
231
+ * @param {PickerValidDate} year The new year.
233
232
  */
234
233
  onYearChange: PropTypes.func,
235
234
  /**
@@ -242,6 +241,11 @@ StaticDateTimePicker.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.
@@ -264,30 +268,26 @@ StaticDateTimePicker.propTypes = {
264
268
  *
265
269
  * 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.
266
270
  *
267
- * @template TDate
268
- * @param {TDate} day The date to test.
271
+ * @param {PickerValidDate} day The date to test.
269
272
  * @returns {boolean} If `true` the date will be disabled.
270
273
  */
271
274
  shouldDisableDate: PropTypes.func,
272
275
  /**
273
276
  * Disable specific month.
274
- * @template TDate
275
- * @param {TDate} month The month to test.
277
+ * @param {PickerValidDate} month The month to test.
276
278
  * @returns {boolean} If `true`, the month will be disabled.
277
279
  */
278
280
  shouldDisableMonth: PropTypes.func,
279
281
  /**
280
282
  * Disable specific time.
281
- * @template TDate
282
- * @param {TDate} value The value to check.
283
+ * @param {PickerValidDate} value The value to check.
283
284
  * @param {TimeView} view The clock type of the timeValue.
284
285
  * @returns {boolean} If `true` the time will be disabled.
285
286
  */
286
287
  shouldDisableTime: PropTypes.func,
287
288
  /**
288
289
  * Disable specific year.
289
- * @template TDate
290
- * @param {TDate} year The year to test.
290
+ * @param {PickerValidDate} year The year to test.
291
291
  * @returns {boolean} If `true`, the year will be disabled.
292
292
  */
293
293
  shouldDisableYear: PropTypes.func,
@@ -80,7 +80,8 @@ StaticTimePicker.propTypes = {
80
80
  */
81
81
  defaultValue: PropTypes.object,
82
82
  /**
83
- * If `true`, the picker and text field are disabled.
83
+ * If `true`, the component is disabled.
84
+ * When disabled, the value cannot be changed and no interaction is possible.
84
85
  * @default false
85
86
  */
86
87
  disabled: PropTypes.bool,
@@ -172,6 +173,11 @@ StaticTimePicker.propTypes = {
172
173
  * Force rendering in particular orientation.
173
174
  */
174
175
  orientation: PropTypes.oneOf(['landscape', 'portrait']),
176
+ /**
177
+ * If `true`, the component is read-only.
178
+ * When read-only, the value cannot be changed but the user can interact with the interface.
179
+ * @default false
180
+ */
175
181
  readOnly: PropTypes.bool,
176
182
  /**
177
183
  * If `true`, disable heavy animations.
@@ -185,8 +191,7 @@ StaticTimePicker.propTypes = {
185
191
  referenceDate: PropTypes.object,
186
192
  /**
187
193
  * Disable specific time.
188
- * @template TDate
189
- * @param {TDate} value The value to check.
194
+ * @param {PickerValidDate} value The value to check.
190
195
  * @param {TimeView} view The clock type of the timeValue.
191
196
  * @returns {boolean} If `true` the time will be disabled.
192
197
  */
@@ -6,7 +6,7 @@ import Typography from '@mui/material/Typography';
6
6
  import { styled, useThemeProps } from '@mui/material/styles';
7
7
  import { unstable_useEnhancedEffect as useEnhancedEffect, unstable_composeClasses as composeClasses } from '@mui/utils';
8
8
  import { ClockPointer } from "./ClockPointer.js";
9
- import { usePickersTranslations } from "../hooks/usePickersTranslations.js";
9
+ import { usePickerTranslations } from "../hooks/usePickerTranslations.js";
10
10
  import { useUtils } from "../internals/hooks/useUtils.js";
11
11
  import { CLOCK_HOUR_WIDTH, getHours, getMinutes } from "./shared.js";
12
12
  import { getClockUtilityClass } from "./clockClasses.js";
@@ -186,7 +186,7 @@ export function Clock(inProps) {
186
186
  } = props;
187
187
  const ownerState = props;
188
188
  const utils = useUtils();
189
- const translations = usePickersTranslations();
189
+ const translations = usePickerTranslations();
190
190
  const isMoving = React.useRef(false);
191
191
  const classes = useUtilityClasses(ownerState);
192
192
  const isSelectedTimeDisabled = isTimeDisabled(viewValue, type);
@@ -222,6 +222,7 @@ export function Clock(inProps) {
222
222
  setTime(event, 'finish');
223
223
  isMoving.current = false;
224
224
  }
225
+ event.preventDefault();
225
226
  };
226
227
  const handleMouseMove = event => {
227
228
  // event.buttons & PRIMARY_MOUSE_BUTTON
@@ -316,7 +317,7 @@ export function Clock(inProps) {
316
317
  })]
317
318
  }), /*#__PURE__*/_jsx(ClockWrapper, {
318
319
  "aria-activedescendant": selectedId,
319
- "aria-label": translations.clockLabelText(type, value, utils, value == null ? null : utils.format(value, 'fullTime')),
320
+ "aria-label": translations.clockLabelText(type, value == null ? null : utils.format(value, 'fullTime')),
320
321
  ref: listboxRef,
321
322
  role: "listbox",
322
323
  onKeyDown: handleKeyDown,
@@ -8,7 +8,7 @@ import clsx from 'clsx';
8
8
  import PropTypes from 'prop-types';
9
9
  import { styled, useThemeProps } from '@mui/material/styles';
10
10
  import { unstable_composeClasses as composeClasses, unstable_useId as useId } from '@mui/utils';
11
- import { usePickersTranslations } from "../hooks/usePickersTranslations.js";
11
+ import { usePickerTranslations } from "../hooks/usePickerTranslations.js";
12
12
  import { useUtils, useNow } from "../internals/hooks/useUtils.js";
13
13
  import { PickersArrowSwitcher } from "../internals/components/PickersArrowSwitcher/index.js";
14
14
  import { convertValueToMeridiem, createIsAfterIgnoreDatePart } from "../internals/utils/time-utils.js";
@@ -107,6 +107,7 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
107
107
  timezone: timezoneProp,
108
108
  value: valueProp,
109
109
  defaultValue,
110
+ referenceDate: referenceDateProp,
110
111
  onChange,
111
112
  valueManager: singleItemValueManager
112
113
  });
@@ -117,7 +118,7 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
117
118
  props,
118
119
  timezone
119
120
  });
120
- const translations = usePickersTranslations();
121
+ const translations = usePickerTranslations();
121
122
  const now = useNow(timezone);
122
123
  const {
123
124
  view,
@@ -345,7 +346,8 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
345
346
  */
346
347
  defaultValue: PropTypes.object,
347
348
  /**
348
- * If `true`, the picker views and text field are disabled.
349
+ * If `true`, the component is disabled.
350
+ * When disabled, the value cannot be changed and no interaction is possible.
349
351
  * @default false
350
352
  */
351
353
  disabled: PropTypes.bool,
@@ -412,7 +414,8 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
412
414
  */
413
415
  openTo: PropTypes.oneOf(['hours', 'minutes', 'seconds']),
414
416
  /**
415
- * If `true`, the picker views and text field are read-only.
417
+ * If `true`, the component is read-only.
418
+ * When read-only, the value cannot be changed but the user can interact with the interface.
416
419
  * @default false
417
420
  */
418
421
  readOnly: PropTypes.bool,
@@ -423,8 +426,7 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
423
426
  referenceDate: PropTypes.object,
424
427
  /**
425
428
  * Disable specific time.
426
- * @template TDate
427
- * @param {TDate} value The value to check.
429
+ * @param {PickerValidDate} value The value to check.
428
430
  * @param {TimeView} view The clock type of the timeValue.
429
431
  * @returns {boolean} If `true` the time will be disabled.
430
432
  */
@@ -37,7 +37,7 @@ const TimeField = /*#__PURE__*/React.forwardRef(function TimeField(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,
@@ -94,6 +94,7 @@ process.env.NODE_ENV !== "production" ? TimeField.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" ? TimeField.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
  /**
@@ -233,8 +234,8 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
233
234
  */
234
235
  onSelectedSectionsChange: PropTypes.func,
235
236
  /**
236
- * It prevents the user from changing the value of the field
237
- * (not from interacting with the field).
237
+ * If `true`, the component is read-only.
238
+ * When read-only, the value cannot be changed but the user can interact with the interface.
238
239
  * @default false
239
240
  */
240
241
  readOnly: PropTypes.bool,
@@ -261,8 +262,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
261
262
  selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number]),
262
263
  /**
263
264
  * Disable specific time.
264
- * @template TDate
265
- * @param {TDate} value The value to check.
265
+ * @param {PickerValidDate} value The value to check.
266
266
  * @param {TimeView} view The clock type of the timeValue.
267
267
  * @returns {boolean} If `true` the time will be disabled.
268
268
  */
@@ -85,7 +85,8 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
85
85
  */
86
86
  desktopModeMediaQuery: PropTypes.string,
87
87
  /**
88
- * If `true`, the picker and text field are disabled.
88
+ * If `true`, the component is disabled.
89
+ * When disabled, the value cannot be changed and no interaction is possible.
89
90
  * @default false
90
91
  */
91
92
  disabled: PropTypes.bool,
@@ -110,7 +111,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
110
111
  */
111
112
  disablePast: PropTypes.bool,
112
113
  /**
113
- * @default false
114
+ * @default true
114
115
  */
115
116
  enableAccessibleFieldDOMStructure: PropTypes.any,
116
117
  /**
@@ -218,6 +219,11 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
218
219
  * Force rendering in particular orientation.
219
220
  */
220
221
  orientation: PropTypes.oneOf(['landscape', 'portrait']),
222
+ /**
223
+ * If `true`, the component is read-only.
224
+ * When read-only, the value cannot be changed but the user can interact with the interface.
225
+ * @default false
226
+ */
221
227
  readOnly: PropTypes.bool,
222
228
  /**
223
229
  * If `true`, disable heavy animations.
@@ -241,8 +247,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
241
247
  selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number]),
242
248
  /**
243
249
  * Disable specific time.
244
- * @template TDate
245
- * @param {TDate} value The value to check.
250
+ * @param {PickerValidDate} value The value to check.
246
251
  * @param {TimeView} view The clock type of the timeValue.
247
252
  * @returns {boolean} If `true` the time will be disabled.
248
253
  */
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- const _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly", "className"];
5
+ const _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "className"];
6
6
  import * as React from 'react';
7
7
  import clsx from 'clsx';
8
8
  import PropTypes from 'prop-types';
@@ -13,11 +13,12 @@ import { PickersToolbarText } from "../internals/components/PickersToolbarText.j
13
13
  import { PickersToolbarButton } from "../internals/components/PickersToolbarButton.js";
14
14
  import { PickersToolbar } from "../internals/components/PickersToolbar.js";
15
15
  import { arrayIncludes } from "../internals/utils/utils.js";
16
- import { usePickersTranslations } from "../hooks/usePickersTranslations.js";
16
+ import { usePickerTranslations } from "../hooks/usePickerTranslations.js";
17
17
  import { useUtils } from "../internals/hooks/useUtils.js";
18
18
  import { useMeridiemMode } from "../internals/hooks/date-helpers-hooks.js";
19
19
  import { getTimePickerToolbarUtilityClass, timePickerToolbarClasses } from "./timePickerToolbarClasses.js";
20
20
  import { formatMeridiem } from "../internals/utils/date-utils.js";
21
+ import { usePickerContext } from "../hooks/index.js";
21
22
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
23
  const useUtilityClasses = ownerState => {
23
24
  const {
@@ -128,14 +129,16 @@ function TimePickerToolbar(inProps) {
128
129
  view,
129
130
  onViewChange,
130
131
  views,
131
- disabled,
132
- readOnly,
133
132
  className
134
133
  } = props,
135
134
  other = _objectWithoutPropertiesLoose(props, _excluded);
136
135
  const utils = useUtils();
137
- const translations = usePickersTranslations();
136
+ const translations = usePickerTranslations();
138
137
  const isRtl = useRtl();
138
+ const {
139
+ disabled,
140
+ readOnly
141
+ } = usePickerContext();
139
142
  const showAmPmControl = Boolean(ampm && !ampmInClock && views.includes('hours'));
140
143
  const {
141
144
  meridiemMode,
@@ -216,7 +219,6 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
216
219
  */
217
220
  classes: PropTypes.object,
218
221
  className: PropTypes.string,
219
- disabled: PropTypes.bool,
220
222
  /**
221
223
  * If `true`, show the toolbar even in desktop mode.
222
224
  * @default `true` for Desktop, `false` for Mobile.
@@ -230,7 +232,6 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
230
232
  * @param {TView} view The view to open
231
233
  */
232
234
  onViewChange: PropTypes.func.isRequired,
233
- readOnly: PropTypes.bool,
234
235
  /**
235
236
  * The system prop that allows defining system overrides as well as additional CSS styles.
236
237
  */
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["autoFocus", "className", "children", "disabled", "selected", "value", "tabIndex", "onClick", "onKeyDown", "onFocus", "onBlur", "aria-current", "yearsPerRow", "slots", "slotProps"];
3
+ const _excluded = ["autoFocus", "className", "classes", "children", "disabled", "selected", "value", "tabIndex", "onClick", "onKeyDown", "onFocus", "onBlur", "aria-current", "yearsPerRow", "slots", "slotProps"];
4
4
  import * as React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import { styled, alpha, useThemeProps } from '@mui/material/styles';
@@ -8,16 +8,12 @@ import useSlotProps from '@mui/utils/useSlotProps';
8
8
  import composeClasses from '@mui/utils/composeClasses';
9
9
  import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
10
10
  import { getPickersYearUtilityClass, pickersYearClasses } from "./pickersYearClasses.js";
11
+ import { usePickerPrivateContext } from "../internals/hooks/usePickerPrivateContext.js";
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
- const useUtilityClasses = ownerState => {
13
- const {
14
- disabled,
15
- selected,
16
- classes
17
- } = ownerState;
13
+ const useUtilityClasses = (classes, ownerState) => {
18
14
  const slots = {
19
15
  root: ['root'],
20
- yearButton: ['yearButton', disabled && 'disabled', selected && 'selected']
16
+ yearButton: ['yearButton', ownerState.isYearDisabled && 'disabled', ownerState.isYearSelected && 'selected']
21
17
  };
22
18
  return composeClasses(slots, getPickersYearUtilityClass, classes);
23
19
  };
@@ -93,9 +89,10 @@ export const PickersYear = /*#__PURE__*/React.memo(function PickersYear(inProps)
93
89
  const {
94
90
  autoFocus,
95
91
  className,
92
+ classes: classesProp,
96
93
  children,
97
- disabled,
98
- selected,
94
+ disabled = false,
95
+ selected = false,
99
96
  value,
100
97
  tabIndex,
101
98
  onClick,
@@ -111,7 +108,14 @@ export const PickersYear = /*#__PURE__*/React.memo(function PickersYear(inProps)
111
108
  } = props,
112
109
  other = _objectWithoutPropertiesLoose(props, _excluded);
113
110
  const ref = React.useRef(null);
114
- const classes = useUtilityClasses(props);
111
+ const {
112
+ ownerState: pickerOwnerState
113
+ } = usePickerPrivateContext();
114
+ const ownerState = _extends({}, pickerOwnerState, {
115
+ isYearDisabled: disabled,
116
+ isYearSelected: selected
117
+ });
118
+ const classes = useUtilityClasses(classesProp, ownerState);
115
119
 
116
120
  // We can't forward the `autoFocus` to the button because it is a native button, not a MUI Button
117
121
  useEnhancedEffect(() => {
@@ -138,12 +142,12 @@ export const PickersYear = /*#__PURE__*/React.memo(function PickersYear(inProps)
138
142
  onFocus: event => onFocus(event, value),
139
143
  onBlur: event => onBlur(event, value)
140
144
  },
141
- ownerState: props,
145
+ ownerState,
142
146
  className: classes.yearButton
143
147
  });
144
148
  return /*#__PURE__*/_jsx(PickersYearRoot, _extends({
145
149
  className: clsx(classes.root, className),
146
- ownerState: props
150
+ ownerState: ownerState
147
151
  }, other, {
148
152
  children: /*#__PURE__*/_jsx(YearButton, _extends({}, yearButtonProps))
149
153
  }));
@@ -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", "className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "readOnly", "shouldDisableYear", "disableHighlightToday", "onYearFocus", "hasFocus", "onFocusedViewChange", "yearsOrder", "yearsPerRow", "timezone", "gridLabelId", "slots", "slotProps"];
5
+ const _excluded = ["autoFocus", "className", "classes", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "readOnly", "shouldDisableYear", "disableHighlightToday", "onYearFocus", "hasFocus", "onFocusedViewChange", "yearsOrder", "yearsPerRow", "timezone", "gridLabelId", "slots", "slotProps"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
@@ -17,11 +17,9 @@ import { singleItemValueManager } from "../internals/utils/valueManagers.js";
17
17
  import { SECTION_TYPE_GRANULARITY } from "../internals/utils/getDefaultReferenceDate.js";
18
18
  import { useControlledValueWithTimezone } from "../internals/hooks/useValueWithTimezone.js";
19
19
  import { DIALOG_WIDTH, MAX_CALENDAR_HEIGHT } from "../internals/constants/dimensions.js";
20
+ import { usePickerPrivateContext } from "../internals/hooks/usePickerPrivateContext.js";
20
21
  import { jsx as _jsx } from "react/jsx-runtime";
21
- const useUtilityClasses = ownerState => {
22
- const {
23
- classes
24
- } = ownerState;
22
+ const useUtilityClasses = classes => {
25
23
  const slots = {
26
24
  root: ['root']
27
25
  };
@@ -74,6 +72,7 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
74
72
  const {
75
73
  autoFocus,
76
74
  className,
75
+ classes: classesProp,
77
76
  value: valueProp,
78
77
  defaultValue,
79
78
  referenceDate: referenceDateProp,
@@ -105,12 +104,16 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
105
104
  timezone: timezoneProp,
106
105
  value: valueProp,
107
106
  defaultValue,
108
- onChange: onChange,
107
+ referenceDate: referenceDateProp,
108
+ onChange,
109
109
  valueManager: singleItemValueManager
110
110
  });
111
111
  const now = useNow(timezone);
112
112
  const isRtl = useRtl();
113
113
  const utils = useUtils();
114
+ const {
115
+ ownerState
116
+ } = usePickerPrivateContext();
114
117
  const referenceDate = React.useMemo(() => singleItemValueManager.getInitialReferenceValue({
115
118
  value,
116
119
  utils,
@@ -120,8 +123,7 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
120
123
  granularity: SECTION_TYPE_GRANULARITY.year
121
124
  }), [] // eslint-disable-line react-hooks/exhaustive-deps
122
125
  );
123
- const ownerState = props;
124
- const classes = useUtilityClasses(ownerState);
126
+ const classes = useUtilityClasses(classesProp);
125
127
  const todayYear = React.useMemo(() => utils.getYear(now), [utils, now]);
126
128
  const selectedYear = React.useMemo(() => {
127
129
  if (value != null) {
@@ -284,7 +286,9 @@ process.env.NODE_ENV !== "production" ? YearCalendar.propTypes = {
284
286
  */
285
287
  defaultValue: PropTypes.object,
286
288
  /**
287
- * If `true` picker is disabled
289
+ * If `true`, the component is disabled.
290
+ * When disabled, the value cannot be changed and no interaction is possible.
291
+ * @default false
288
292
  */
289
293
  disabled: PropTypes.bool,
290
294
  /**
@@ -316,14 +320,15 @@ process.env.NODE_ENV !== "production" ? YearCalendar.propTypes = {
316
320
  minDate: PropTypes.object,
317
321
  /**
318
322
  * Callback fired when the value changes.
319
- * @template TDate
320
- * @param {TDate} value The new value.
323
+ * @param {PickerValidDate} value The new value.
321
324
  */
322
325
  onChange: PropTypes.func,
323
326
  onFocusedViewChange: PropTypes.func,
324
327
  onYearFocus: PropTypes.func,
325
328
  /**
326
- * If `true` picker is readonly
329
+ * If `true`, the component is read-only.
330
+ * When read-only, the value cannot be changed but the user can interact with the interface.
331
+ * @default false
327
332
  */
328
333
  readOnly: PropTypes.bool,
329
334
  /**
@@ -333,8 +338,7 @@ process.env.NODE_ENV !== "production" ? YearCalendar.propTypes = {
333
338
  referenceDate: PropTypes.object,
334
339
  /**
335
340
  * Disable specific year.
336
- * @template TDate
337
- * @param {TDate} year The year to test.
341
+ * @param {PickerValidDate} year The year to test.
338
342
  * @returns {boolean} If `true`, the year will be disabled.
339
343
  */
340
344
  shouldDisableYear: PropTypes.func,
@@ -1,5 +1,5 @@
1
1
  export { useClearableField } from "./useClearableField.js";
2
- export { usePickersTranslations } from "./usePickersTranslations.js";
2
+ export { usePickerTranslations } from "./usePickerTranslations.js";
3
3
  export { useSplitFieldProps } from "./useSplitFieldProps.js";
4
4
  export { useParsedFormat } from "./useParsedFormat.js";
5
- export { usePickersContext } from "./usePickersContext.js";
5
+ export { usePickerContext } from "./usePickerContext.js";
@@ -9,10 +9,10 @@ import useSlotProps from '@mui/utils/useSlotProps';
9
9
  import MuiIconButton from '@mui/material/IconButton';
10
10
  import InputAdornment from '@mui/material/InputAdornment';
11
11
  import { ClearIcon } from "../icons/index.js";
12
- import { usePickersTranslations } from "./usePickersTranslations.js";
12
+ import { usePickerTranslations } from "./usePickerTranslations.js";
13
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  export const useClearableField = props => {
15
- const translations = usePickersTranslations();
15
+ const translations = usePickerTranslations();
16
16
  const {
17
17
  clearable,
18
18
  onClear,
@@ -30,7 +30,8 @@ export const useClearableField = props => {
30
30
  ownerState: {},
31
31
  className: 'clearButton',
32
32
  additionalProps: {
33
- title: translations.fieldClearLabel
33
+ title: translations.fieldClearLabel,
34
+ tabIndex: -1
34
35
  }
35
36
  }),
36
37
  iconButtonProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
@@ -5,7 +5,7 @@ import { useRtl } from '@mui/system/RtlProvider';
5
5
  import { useUtils } from "../internals/hooks/useUtils.js";
6
6
  import { buildSectionsFromFormat } from "../internals/hooks/useField/buildSectionsFromFormat.js";
7
7
  import { getLocalizedDigits } from "../internals/hooks/useField/useField.utils.js";
8
- import { usePickersTranslations } from "./usePickersTranslations.js";
8
+ import { usePickerTranslations } from "./usePickerTranslations.js";
9
9
  /**
10
10
  * Returns the parsed format to be rendered in the field when there is no value or in other parts of the Picker.
11
11
  * This format is localized (e.g: `AAAA` for the year with the French locale) and cannot be parsed by your date library.
@@ -23,7 +23,7 @@ export const useParsedFormat = parameters => {
23
23
  } = parameters;
24
24
  const utils = useUtils();
25
25
  const isRtl = useRtl();
26
- const translations = usePickersTranslations();
26
+ const translations = usePickerTranslations();
27
27
  const localizedDigits = React.useMemo(() => getLocalizedDigits(utils), [utils]);
28
28
  return React.useMemo(() => {
29
29
  const sections = buildSectionsFromFormat({