@mui/x-date-pickers 7.22.1 → 8.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (498) 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 +143 -92
  12. package/DateCalendar/DateCalendar.d.ts +1 -2
  13. package/DateCalendar/DateCalendar.js +20 -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 +12 -2
  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 +3 -3
  42. package/DateTimePicker/DateTimePickerToolbar.js +12 -2
  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 +10 -0
  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 +7 -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 +17 -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 +7 -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 +10 -0
  84. package/PickersLayout/PickersLayout.types.d.ts +14 -17
  85. package/PickersLayout/index.d.ts +1 -1
  86. package/PickersLayout/usePickerLayout.d.ts +1 -2
  87. package/PickersLayout/usePickerLayout.js +17 -18
  88. package/README.md +2 -2
  89. package/StaticDatePicker/StaticDatePicker.d.ts +1 -2
  90. package/StaticDatePicker/StaticDatePicker.js +14 -13
  91. package/StaticDatePicker/StaticDatePicker.types.d.ts +7 -7
  92. package/StaticDateTimePicker/StaticDateTimePicker.d.ts +1 -2
  93. package/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
  94. package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +7 -7
  95. package/StaticTimePicker/StaticTimePicker.d.ts +1 -2
  96. package/StaticTimePicker/StaticTimePicker.js +8 -3
  97. package/StaticTimePicker/StaticTimePicker.types.d.ts +7 -7
  98. package/TimeClock/Clock.d.ts +4 -5
  99. package/TimeClock/Clock.js +3 -3
  100. package/TimeClock/ClockNumbers.d.ts +5 -5
  101. package/TimeClock/TimeClock.d.ts +1 -2
  102. package/TimeClock/TimeClock.js +7 -6
  103. package/TimeClock/TimeClock.types.d.ts +4 -4
  104. package/TimeField/TimeField.d.ts +1 -2
  105. package/TimeField/TimeField.js +6 -6
  106. package/TimeField/TimeField.types.d.ts +9 -14
  107. package/TimeField/index.d.ts +1 -1
  108. package/TimeField/useTimeField.d.ts +1 -2
  109. package/TimePicker/TimePicker.d.ts +1 -2
  110. package/TimePicker/TimePicker.js +9 -4
  111. package/TimePicker/TimePicker.types.d.ts +10 -13
  112. package/TimePicker/TimePickerToolbar.d.ts +2 -2
  113. package/TimePicker/TimePickerToolbar.js +12 -2
  114. package/TimePicker/shared.d.ts +10 -10
  115. package/YearCalendar/PickersYear.js +17 -13
  116. package/YearCalendar/YearCalendar.d.ts +1 -2
  117. package/YearCalendar/YearCalendar.js +17 -14
  118. package/YearCalendar/YearCalendar.types.d.ts +14 -15
  119. package/dateViewRenderers/dateViewRenderers.d.ts +3 -3
  120. package/hooks/index.d.ts +2 -2
  121. package/hooks/index.js +2 -2
  122. package/hooks/useClearableField.js +4 -3
  123. package/hooks/useParsedFormat.d.ts +2 -3
  124. package/hooks/useParsedFormat.js +2 -2
  125. package/hooks/usePickerContext.d.ts +4 -0
  126. package/hooks/usePickerContext.js +15 -0
  127. package/hooks/usePickerTranslations.d.ts +1 -0
  128. package/{modern/hooks/usePickersTranslations.js → hooks/usePickerTranslations.js} +1 -1
  129. package/index.js +1 -1
  130. package/internals/components/{PickersProvider.d.ts → PickerProvider.d.ts} +15 -8
  131. package/internals/components/PickerProvider.js +38 -0
  132. package/internals/hooks/date-helpers-hooks.d.ts +6 -6
  133. package/internals/hooks/defaultizedFieldProps.d.ts +7 -8
  134. package/internals/hooks/useClockReferenceDate.d.ts +5 -5
  135. package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +1 -2
  136. package/internals/hooks/useDesktopPicker/useDesktopPicker.js +21 -17
  137. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +15 -15
  138. package/internals/hooks/useField/buildSectionsFromFormat.d.ts +5 -5
  139. package/internals/hooks/useField/useField.d.ts +3 -3
  140. package/internals/hooks/useField/useField.js +1 -1
  141. package/internals/hooks/useField/useField.types.d.ts +38 -48
  142. package/internals/hooks/useField/useField.utils.d.ts +13 -13
  143. package/internals/hooks/useField/useField.utils.js +2 -1
  144. package/internals/hooks/useField/useFieldCharacterEditing.d.ts +4 -4
  145. package/internals/hooks/useField/useFieldState.d.ts +4 -4
  146. package/internals/hooks/useField/useFieldState.js +3 -3
  147. package/internals/hooks/useField/useFieldV7TextField.js +2 -2
  148. package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -2
  149. package/internals/hooks/useMobilePicker/useMobilePicker.js +23 -18
  150. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +12 -12
  151. package/internals/hooks/usePicker/usePicker.d.ts +2 -2
  152. package/internals/hooks/usePicker/usePicker.js +12 -4
  153. package/internals/hooks/usePicker/usePicker.types.d.ts +7 -5
  154. package/internals/hooks/usePicker/usePickerLayoutProps.d.ts +2 -3
  155. package/internals/hooks/usePicker/usePickerOwnerState.d.ts +4 -3
  156. package/internals/hooks/usePicker/usePickerOwnerState.js +9 -6
  157. package/internals/hooks/usePicker/usePickerProvider.d.ts +10 -0
  158. package/internals/hooks/usePicker/usePickerProvider.js +21 -0
  159. package/internals/hooks/usePicker/usePickerValue.d.ts +2 -2
  160. package/internals/hooks/usePicker/usePickerValue.js +2 -7
  161. package/internals/hooks/usePicker/usePickerValue.types.d.ts +32 -34
  162. package/internals/hooks/usePicker/usePickerViews.d.ts +6 -11
  163. package/internals/hooks/usePickerPrivateContext.d.ts +4 -0
  164. package/internals/hooks/usePickerPrivateContext.js +9 -0
  165. package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +1 -2
  166. package/internals/hooks/useStaticPicker/useStaticPicker.js +5 -4
  167. package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +6 -6
  168. package/internals/hooks/useUtils.d.ts +7 -7
  169. package/internals/hooks/useValueWithTimezone.d.ts +5 -5
  170. package/internals/hooks/useViews.d.ts +3 -3
  171. package/internals/hooks/useViews.js +1 -1
  172. package/internals/index.d.ts +6 -4
  173. package/internals/index.js +2 -1
  174. package/internals/models/fields.d.ts +32 -7
  175. package/internals/models/formProps.d.ts +14 -0
  176. package/internals/models/helpers.d.ts +0 -4
  177. package/internals/models/index.d.ts +2 -0
  178. package/internals/models/index.js +3 -1
  179. package/internals/models/props/basePickerProps.d.ts +5 -6
  180. package/internals/models/props/{clock.d.ts → time.d.ts} +10 -17
  181. package/internals/models/props/toolbar.d.ts +2 -3
  182. package/internals/models/validation.d.ts +21 -25
  183. package/internals/models/value.d.ts +3 -0
  184. package/internals/models/value.js +1 -0
  185. package/internals/utils/date-time-utils.d.ts +7 -7
  186. package/internals/utils/date-utils.d.ts +16 -16
  187. package/internals/utils/getDefaultReferenceDate.d.ts +10 -10
  188. package/internals/utils/time-utils.d.ts +5 -5
  189. package/internals/utils/valueManagers.d.ts +3 -3
  190. package/locales/beBY.d.ts +3 -3
  191. package/locales/beBY.js +3 -3
  192. package/locales/bgBG.d.ts +3 -3
  193. package/locales/bgBG.js +3 -3
  194. package/locales/caES.d.ts +3 -3
  195. package/locales/caES.js +3 -3
  196. package/locales/csCZ.d.ts +3 -3
  197. package/locales/csCZ.js +3 -3
  198. package/locales/daDK.d.ts +3 -3
  199. package/locales/daDK.js +3 -3
  200. package/locales/deDE.d.ts +3 -3
  201. package/locales/deDE.js +3 -3
  202. package/locales/elGR.d.ts +3 -3
  203. package/locales/elGR.js +12 -13
  204. package/locales/enUS.d.ts +4 -4
  205. package/locales/enUS.js +3 -3
  206. package/locales/esES.d.ts +3 -3
  207. package/locales/esES.js +3 -3
  208. package/locales/eu.d.ts +3 -3
  209. package/locales/eu.js +3 -3
  210. package/locales/faIR.d.ts +3 -3
  211. package/locales/faIR.js +3 -3
  212. package/locales/fiFI.d.ts +3 -3
  213. package/locales/fiFI.js +3 -3
  214. package/locales/frFR.d.ts +3 -3
  215. package/locales/frFR.js +3 -3
  216. package/locales/heIL.d.ts +3 -3
  217. package/locales/heIL.js +3 -3
  218. package/locales/hrHR.d.ts +3 -3
  219. package/locales/hrHR.js +3 -3
  220. package/locales/huHU.d.ts +3 -3
  221. package/locales/huHU.js +3 -3
  222. package/locales/isIS.d.ts +3 -3
  223. package/locales/isIS.js +3 -3
  224. package/locales/itIT.d.ts +3 -3
  225. package/locales/itIT.js +3 -3
  226. package/locales/jaJP.d.ts +3 -3
  227. package/locales/jaJP.js +3 -3
  228. package/locales/koKR.d.ts +3 -3
  229. package/locales/koKR.js +3 -3
  230. package/locales/kzKZ.d.ts +3 -3
  231. package/locales/kzKZ.js +3 -3
  232. package/locales/mk.d.ts +3 -3
  233. package/locales/mk.js +3 -3
  234. package/locales/nbNO.d.ts +3 -3
  235. package/locales/nbNO.js +3 -3
  236. package/locales/nlNL.d.ts +3 -3
  237. package/locales/nlNL.js +3 -3
  238. package/locales/nnNO.d.ts +3 -3
  239. package/locales/nnNO.js +3 -3
  240. package/locales/plPL.d.ts +3 -3
  241. package/locales/plPL.js +3 -3
  242. package/locales/ptBR.d.ts +3 -3
  243. package/locales/ptBR.js +5 -3
  244. package/locales/ptPT.d.ts +3 -3
  245. package/locales/ptPT.js +3 -3
  246. package/locales/roRO.d.ts +3 -3
  247. package/locales/roRO.js +3 -3
  248. package/locales/ruRU.d.ts +3 -3
  249. package/locales/ruRU.js +3 -3
  250. package/locales/skSK.d.ts +3 -3
  251. package/locales/skSK.js +3 -3
  252. package/locales/svSE.d.ts +3 -3
  253. package/locales/svSE.js +3 -3
  254. package/locales/trTR.d.ts +3 -3
  255. package/locales/trTR.js +3 -3
  256. package/locales/ukUA.d.ts +3 -3
  257. package/locales/ukUA.js +3 -3
  258. package/locales/urPK.d.ts +3 -3
  259. package/locales/urPK.js +3 -3
  260. package/locales/utils/getPickersLocalization.d.ts +9 -9
  261. package/locales/utils/getPickersLocalization.js +1 -1
  262. package/locales/utils/pickersLocaleTextApi.d.ts +12 -36
  263. package/locales/viVN.d.ts +3 -3
  264. package/locales/viVN.js +3 -3
  265. package/locales/zhCN.d.ts +3 -3
  266. package/locales/zhCN.js +3 -3
  267. package/locales/zhHK.d.ts +3 -3
  268. package/locales/zhHK.js +3 -3
  269. package/models/adapters.d.ts +151 -202
  270. package/models/fields.d.ts +9 -41
  271. package/models/pickers.d.ts +10 -6
  272. package/modern/DateCalendar/DateCalendar.js +20 -22
  273. package/modern/DateCalendar/DayCalendar.js +13 -10
  274. package/modern/DateField/DateField.js +8 -10
  275. package/modern/DatePicker/DatePicker.js +15 -14
  276. package/modern/DatePicker/DatePickerToolbar.js +12 -2
  277. package/modern/DateTimeField/DateTimeField.js +9 -12
  278. package/modern/DateTimePicker/DateTimePicker.js +16 -16
  279. package/modern/DateTimePicker/DateTimePickerTabs.js +2 -2
  280. package/modern/DateTimePicker/DateTimePickerToolbar.js +12 -2
  281. package/modern/DesktopDatePicker/DesktopDatePicker.js +17 -16
  282. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
  283. package/modern/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +10 -0
  284. package/modern/DesktopTimePicker/DesktopTimePicker.js +11 -6
  285. package/modern/DigitalClock/DigitalClock.js +7 -6
  286. package/modern/MobileDatePicker/MobileDatePicker.js +17 -16
  287. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
  288. package/modern/MobileTimePicker/MobileTimePicker.js +11 -6
  289. package/modern/MonthCalendar/MonthCalendar.js +17 -14
  290. package/modern/MonthCalendar/PickersMonth.js +17 -13
  291. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -6
  292. package/modern/PickersActionBar/PickersActionBar.js +2 -2
  293. package/modern/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
  294. package/modern/PickersLayout/PickersLayout.js +10 -0
  295. package/modern/PickersLayout/usePickerLayout.js +17 -18
  296. package/modern/StaticDatePicker/StaticDatePicker.js +14 -13
  297. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
  298. package/modern/StaticTimePicker/StaticTimePicker.js +8 -3
  299. package/modern/TimeClock/Clock.js +3 -3
  300. package/modern/TimeClock/TimeClock.js +7 -6
  301. package/modern/TimeField/TimeField.js +6 -6
  302. package/modern/TimePicker/TimePicker.js +9 -4
  303. package/modern/TimePicker/TimePickerToolbar.js +12 -2
  304. package/modern/YearCalendar/PickersYear.js +17 -13
  305. package/modern/YearCalendar/YearCalendar.js +17 -14
  306. package/modern/hooks/index.js +2 -2
  307. package/modern/hooks/useClearableField.js +4 -3
  308. package/modern/hooks/useParsedFormat.js +2 -2
  309. package/modern/hooks/usePickerContext.js +15 -0
  310. package/{hooks/usePickersTranslations.js → modern/hooks/usePickerTranslations.js} +1 -1
  311. package/modern/index.js +1 -1
  312. package/modern/internals/components/PickerProvider.js +38 -0
  313. package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +21 -17
  314. package/modern/internals/hooks/useField/useField.js +1 -1
  315. package/modern/internals/hooks/useField/useField.utils.js +2 -1
  316. package/modern/internals/hooks/useField/useFieldState.js +3 -3
  317. package/modern/internals/hooks/useField/useFieldV7TextField.js +2 -2
  318. package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +23 -18
  319. package/modern/internals/hooks/usePicker/usePicker.js +12 -4
  320. package/modern/internals/hooks/usePicker/usePickerOwnerState.js +9 -6
  321. package/modern/internals/hooks/usePicker/usePickerProvider.js +21 -0
  322. package/modern/internals/hooks/usePicker/usePickerValue.js +2 -7
  323. package/modern/internals/hooks/usePickerPrivateContext.js +9 -0
  324. package/modern/internals/hooks/useStaticPicker/useStaticPicker.js +5 -4
  325. package/modern/internals/hooks/useViews.js +1 -1
  326. package/modern/internals/index.js +2 -1
  327. package/modern/internals/models/formProps.js +1 -0
  328. package/modern/internals/models/index.js +3 -1
  329. package/modern/internals/models/props/time.js +1 -0
  330. package/modern/internals/models/value.js +1 -0
  331. package/modern/locales/beBY.js +3 -3
  332. package/modern/locales/bgBG.js +3 -3
  333. package/modern/locales/caES.js +3 -3
  334. package/modern/locales/csCZ.js +3 -3
  335. package/modern/locales/daDK.js +3 -3
  336. package/modern/locales/deDE.js +3 -3
  337. package/modern/locales/elGR.js +12 -13
  338. package/modern/locales/enUS.js +3 -3
  339. package/modern/locales/esES.js +3 -3
  340. package/modern/locales/eu.js +3 -3
  341. package/modern/locales/faIR.js +3 -3
  342. package/modern/locales/fiFI.js +3 -3
  343. package/modern/locales/frFR.js +3 -3
  344. package/modern/locales/heIL.js +3 -3
  345. package/modern/locales/hrHR.js +3 -3
  346. package/modern/locales/huHU.js +3 -3
  347. package/modern/locales/isIS.js +3 -3
  348. package/modern/locales/itIT.js +3 -3
  349. package/modern/locales/jaJP.js +3 -3
  350. package/modern/locales/koKR.js +3 -3
  351. package/modern/locales/kzKZ.js +3 -3
  352. package/modern/locales/mk.js +3 -3
  353. package/modern/locales/nbNO.js +3 -3
  354. package/modern/locales/nlNL.js +3 -3
  355. package/modern/locales/nnNO.js +3 -3
  356. package/modern/locales/plPL.js +3 -3
  357. package/modern/locales/ptBR.js +5 -3
  358. package/modern/locales/ptPT.js +3 -3
  359. package/modern/locales/roRO.js +3 -3
  360. package/modern/locales/ruRU.js +3 -3
  361. package/modern/locales/skSK.js +3 -3
  362. package/modern/locales/svSE.js +3 -3
  363. package/modern/locales/trTR.js +3 -3
  364. package/modern/locales/ukUA.js +3 -3
  365. package/modern/locales/urPK.js +3 -3
  366. package/modern/locales/utils/getPickersLocalization.js +1 -1
  367. package/modern/locales/viVN.js +3 -3
  368. package/modern/locales/zhCN.js +3 -3
  369. package/modern/locales/zhHK.js +3 -3
  370. package/modern/validation/useValidation.js +2 -3
  371. package/modern/validation/validateDate.js +5 -0
  372. package/modern/validation/validateDateTime.js +5 -0
  373. package/modern/validation/validateTime.js +5 -0
  374. package/node/DateCalendar/DateCalendar.js +20 -22
  375. package/node/DateCalendar/DayCalendar.js +13 -10
  376. package/node/DateField/DateField.js +8 -10
  377. package/node/DatePicker/DatePicker.js +15 -14
  378. package/node/DatePicker/DatePickerToolbar.js +12 -2
  379. package/node/DateTimeField/DateTimeField.js +9 -12
  380. package/node/DateTimePicker/DateTimePicker.js +16 -16
  381. package/node/DateTimePicker/DateTimePickerTabs.js +2 -2
  382. package/node/DateTimePicker/DateTimePickerToolbar.js +12 -2
  383. package/node/DesktopDatePicker/DesktopDatePicker.js +17 -16
  384. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
  385. package/node/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +10 -0
  386. package/node/DesktopTimePicker/DesktopTimePicker.js +11 -6
  387. package/node/DigitalClock/DigitalClock.js +7 -6
  388. package/node/MobileDatePicker/MobileDatePicker.js +17 -16
  389. package/node/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
  390. package/node/MobileTimePicker/MobileTimePicker.js +11 -6
  391. package/node/MonthCalendar/MonthCalendar.js +17 -14
  392. package/node/MonthCalendar/PickersMonth.js +17 -13
  393. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -6
  394. package/node/PickersActionBar/PickersActionBar.js +2 -2
  395. package/node/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
  396. package/node/PickersLayout/PickersLayout.js +10 -0
  397. package/node/PickersLayout/usePickerLayout.js +17 -18
  398. package/node/StaticDatePicker/StaticDatePicker.js +14 -13
  399. package/node/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
  400. package/node/StaticTimePicker/StaticTimePicker.js +8 -3
  401. package/node/TimeClock/Clock.js +3 -3
  402. package/node/TimeClock/TimeClock.js +7 -6
  403. package/node/TimeField/TimeField.js +6 -6
  404. package/node/TimePicker/TimePicker.js +9 -4
  405. package/node/TimePicker/TimePickerToolbar.js +12 -2
  406. package/node/YearCalendar/PickersYear.js +17 -13
  407. package/node/YearCalendar/YearCalendar.js +17 -14
  408. package/node/hooks/index.js +6 -6
  409. package/node/hooks/useClearableField.js +4 -3
  410. package/node/hooks/useParsedFormat.js +2 -2
  411. package/node/hooks/usePickerContext.js +21 -0
  412. package/node/hooks/usePickerTranslations.js +10 -0
  413. package/node/index.js +1 -1
  414. package/node/internals/components/PickerProvider.js +46 -0
  415. package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +21 -17
  416. package/node/internals/hooks/useField/useField.js +1 -1
  417. package/node/internals/hooks/useField/useField.utils.js +2 -1
  418. package/node/internals/hooks/useField/useFieldState.js +3 -3
  419. package/node/internals/hooks/useField/useFieldV7TextField.js +2 -2
  420. package/node/internals/hooks/useMobilePicker/useMobilePicker.js +23 -18
  421. package/node/internals/hooks/usePicker/usePicker.js +12 -4
  422. package/node/internals/hooks/usePicker/usePickerOwnerState.js +9 -6
  423. package/node/internals/hooks/usePicker/usePickerProvider.js +28 -0
  424. package/node/internals/hooks/usePicker/usePickerValue.js +1 -7
  425. package/node/internals/hooks/usePickerPrivateContext.js +15 -0
  426. package/node/internals/hooks/useStaticPicker/useStaticPicker.js +5 -4
  427. package/node/internals/hooks/useViews.js +3 -3
  428. package/node/internals/index.js +14 -7
  429. package/node/internals/models/index.js +22 -0
  430. package/node/internals/models/props/time.js +5 -0
  431. package/node/internals/models/value.js +5 -0
  432. package/node/locales/beBY.js +3 -3
  433. package/node/locales/bgBG.js +3 -3
  434. package/node/locales/caES.js +3 -3
  435. package/node/locales/csCZ.js +3 -3
  436. package/node/locales/daDK.js +3 -3
  437. package/node/locales/deDE.js +3 -3
  438. package/node/locales/elGR.js +12 -13
  439. package/node/locales/enUS.js +3 -3
  440. package/node/locales/esES.js +3 -3
  441. package/node/locales/eu.js +3 -3
  442. package/node/locales/faIR.js +3 -3
  443. package/node/locales/fiFI.js +3 -3
  444. package/node/locales/frFR.js +3 -3
  445. package/node/locales/heIL.js +3 -3
  446. package/node/locales/hrHR.js +3 -3
  447. package/node/locales/huHU.js +3 -3
  448. package/node/locales/isIS.js +3 -3
  449. package/node/locales/itIT.js +3 -3
  450. package/node/locales/jaJP.js +3 -3
  451. package/node/locales/koKR.js +3 -3
  452. package/node/locales/kzKZ.js +3 -3
  453. package/node/locales/mk.js +3 -3
  454. package/node/locales/nbNO.js +3 -3
  455. package/node/locales/nlNL.js +3 -3
  456. package/node/locales/nnNO.js +3 -3
  457. package/node/locales/plPL.js +3 -3
  458. package/node/locales/ptBR.js +5 -3
  459. package/node/locales/ptPT.js +3 -3
  460. package/node/locales/roRO.js +3 -3
  461. package/node/locales/ruRU.js +3 -3
  462. package/node/locales/skSK.js +3 -3
  463. package/node/locales/svSE.js +3 -3
  464. package/node/locales/trTR.js +3 -3
  465. package/node/locales/ukUA.js +3 -3
  466. package/node/locales/urPK.js +3 -3
  467. package/node/locales/utils/getPickersLocalization.js +1 -1
  468. package/node/locales/viVN.js +3 -3
  469. package/node/locales/zhCN.js +3 -3
  470. package/node/locales/zhHK.js +3 -3
  471. package/node/validation/useValidation.js +2 -3
  472. package/node/validation/validateDate.js +4 -0
  473. package/node/validation/validateDateTime.js +4 -0
  474. package/node/validation/validateTime.js +4 -0
  475. package/package.json +4 -4
  476. package/themeAugmentation/props.d.ts +28 -28
  477. package/timeViewRenderers/timeViewRenderers.d.ts +6 -6
  478. package/validation/extractValidationProps.d.ts +4 -4
  479. package/validation/useValidation.d.ts +9 -10
  480. package/validation/useValidation.js +2 -3
  481. package/validation/validateDate.d.ts +7 -2
  482. package/validation/validateDate.js +5 -0
  483. package/validation/validateDateTime.d.ts +10 -4
  484. package/validation/validateDateTime.js +5 -0
  485. package/validation/validateTime.d.ts +7 -2
  486. package/validation/validateTime.js +5 -0
  487. package/hooks/usePickersContext.d.ts +0 -4
  488. package/hooks/usePickersContext.js +0 -15
  489. package/hooks/usePickersTranslations.d.ts +0 -2
  490. package/internals/components/PickersProvider.js +0 -26
  491. package/modern/hooks/usePickersContext.js +0 -15
  492. package/modern/internals/components/PickersProvider.js +0 -26
  493. package/node/hooks/usePickersContext.js +0 -21
  494. package/node/hooks/usePickersTranslations.js +0 -10
  495. package/node/internals/components/PickersProvider.js +0 -34
  496. /package/internals/models/{props/clock.js → formProps.js} +0 -0
  497. /package/{modern/internals/models/props/clock.js → internals/models/props/time.js} +0 -0
  498. /package/node/internals/models/{props/clock.js → formProps.js} +0 -0
@@ -7,13 +7,13 @@ import composeClasses from '@mui/utils/composeClasses';
7
7
  import { PickersActionBar } from "../PickersActionBar/index.js";
8
8
  import { getPickersLayoutUtilityClass } from "./pickersLayoutClasses.js";
9
9
  import { PickersShortcuts } from "../PickersShortcuts/index.js";
10
+ import { usePickerPrivateContext } from "../internals/hooks/usePickerPrivateContext.js";
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  function toolbarHasView(toolbarProps) {
12
13
  return toolbarProps.view !== null;
13
14
  }
14
- const useUtilityClasses = ownerState => {
15
+ const useUtilityClasses = (classes, ownerState) => {
15
16
  const {
16
- classes,
17
17
  isLandscape
18
18
  } = ownerState;
19
19
  const slots = {
@@ -28,6 +28,9 @@ const useUtilityClasses = ownerState => {
28
28
  return composeClasses(slots, getPickersLayoutUtilityClass, classes);
29
29
  };
30
30
  const usePickerLayout = props => {
31
+ const {
32
+ ownerState: pickersOwnerState
33
+ } = usePickerPrivateContext();
31
34
  const {
32
35
  wrapperVariant,
33
36
  onAccept,
@@ -46,13 +49,18 @@ const usePickerLayout = props => {
46
49
  readOnly,
47
50
  children,
48
51
  slots,
49
- slotProps
52
+ slotProps,
53
+ classes: classesProp
50
54
  // TODO: Remove this "as" hack. It get introduced to mark `value` prop in PickersLayoutProps as not required.
51
55
  // The true type should be
52
- // - For pickers value: TDate | null
53
- // - For range pickers value: [TDate | null, TDate | null]
56
+ // - For pickers value: PickerValidDate | null
57
+ // - For range pickers value: [PickerValidDate | null, PickerValidDate | null]
54
58
  } = props;
55
- const classes = useUtilityClasses(props);
59
+ const ownerState = _extends({}, pickersOwnerState, {
60
+ wrapperVariant,
61
+ isLandscape
62
+ });
63
+ const classes = useUtilityClasses(classesProp, ownerState);
56
64
 
57
65
  // Action bar
58
66
  const ActionBar = slots?.actionBar ?? PickersActionBar;
@@ -67,9 +75,7 @@ const usePickerLayout = props => {
67
75
  actions: wrapperVariant === 'desktop' ? [] : ['cancel', 'accept']
68
76
  },
69
77
  className: classes.actionBar,
70
- ownerState: _extends({}, props, {
71
- wrapperVariant
72
- })
78
+ ownerState
73
79
  });
74
80
  const actionBar = /*#__PURE__*/_jsx(ActionBar, _extends({}, actionBarProps));
75
81
 
@@ -89,9 +95,7 @@ const usePickerLayout = props => {
89
95
  readOnly
90
96
  },
91
97
  className: classes.toolbar,
92
- ownerState: _extends({}, props, {
93
- wrapperVariant
94
- })
98
+ ownerState
95
99
  });
96
100
  const toolbar = toolbarHasView(toolbarProps) && !!Toolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, toolbarProps)) : null;
97
101
 
@@ -117,12 +121,7 @@ const usePickerLayout = props => {
117
121
  onChange: onSelectShortcut
118
122
  },
119
123
  className: classes.shortcuts,
120
- ownerState: {
121
- isValid,
122
- isLandscape,
123
- onChange: onSelectShortcut,
124
- wrapperVariant
125
- }
124
+ ownerState
126
125
  });
127
126
  const shortcuts = view && !!Shortcuts ? /*#__PURE__*/_jsx(Shortcuts, _extends({}, shortcutsProps)) : null;
128
127
  return {
package/README.md CHANGED
@@ -30,11 +30,11 @@ npm install luxon
30
30
  npm install moment
31
31
  ```
32
32
 
33
- This component has the following peer dependencies that you will need to install as well.
33
+ This component has the following peer dependencies that you need to install as well.
34
34
 
35
35
  ```json
36
36
  "peerDependencies": {
37
- "@mui/material": "^5.15.14",
37
+ "@mui/material": "^5.15.14 || ^6.0.0",
38
38
  "react": "^17.0.0 || ^18.0.0",
39
39
  "react-dom": "^17.0.0 || ^18.0.0"
40
40
  },
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { StaticDatePickerProps } from './StaticDatePicker.types';
3
- import { PickerValidDate } from '../models';
4
- type StaticDatePickerComponent = (<TDate extends PickerValidDate>(props: StaticDatePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
3
+ type StaticDatePickerComponent = ((props: StaticDatePickerProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
5
4
  propTypes?: any;
6
5
  };
7
6
  /**
@@ -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,
@@ -1,22 +1,22 @@
1
+ import { MakeOptional } from '@mui/x-internals/types';
1
2
  import { BaseDatePickerProps, BaseDatePickerSlots, BaseDatePickerSlotProps } from '../DatePicker/shared';
2
3
  import { StaticOnlyPickerProps, UseStaticPickerSlots, UseStaticPickerSlotProps } from '../internals/hooks/useStaticPicker';
3
- import { MakeOptional } from '../internals/models/helpers';
4
- import { DateView, PickerValidDate } from '../models';
5
- export interface StaticDatePickerSlots<TDate extends PickerValidDate> extends BaseDatePickerSlots<TDate>, UseStaticPickerSlots<TDate, DateView> {
4
+ import { DateView } from '../models';
5
+ export interface StaticDatePickerSlots extends BaseDatePickerSlots, UseStaticPickerSlots<DateView> {
6
6
  }
7
- export interface StaticDatePickerSlotProps<TDate extends PickerValidDate> extends BaseDatePickerSlotProps<TDate>, UseStaticPickerSlotProps<TDate, DateView> {
7
+ export interface StaticDatePickerSlotProps extends BaseDatePickerSlotProps, UseStaticPickerSlotProps<DateView> {
8
8
  }
9
- export interface StaticDatePickerProps<TDate extends PickerValidDate> extends BaseDatePickerProps<TDate>, MakeOptional<StaticOnlyPickerProps, 'displayStaticWrapperAs'> {
9
+ export interface StaticDatePickerProps extends BaseDatePickerProps, MakeOptional<StaticOnlyPickerProps, 'displayStaticWrapperAs'> {
10
10
  /**
11
11
  * Overridable component slots.
12
12
  * @default {}
13
13
  */
14
- slots?: StaticDatePickerSlots<TDate>;
14
+ slots?: StaticDatePickerSlots;
15
15
  /**
16
16
  * The props used for each component slot.
17
17
  * @default {}
18
18
  */
19
- slotProps?: StaticDatePickerSlotProps<TDate>;
19
+ slotProps?: StaticDatePickerSlotProps;
20
20
  /**
21
21
  * Years rendered per row.
22
22
  * @default `4` when `displayStaticWrapperAs === 'desktop'`, `3` otherwise.
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { StaticDateTimePickerProps } from './StaticDateTimePicker.types';
3
- import { PickerValidDate } from '../models';
4
- type StaticDateTimePickerComponent = (<TDate extends PickerValidDate>(props: StaticDateTimePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
3
+ type StaticDateTimePickerComponent = ((props: StaticDateTimePickerProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
5
4
  propTypes?: any;
6
5
  };
7
6
  /**
@@ -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,
@@ -1,22 +1,22 @@
1
+ import { MakeOptional } from '@mui/x-internals/types';
1
2
  import { BaseDateTimePickerProps, BaseDateTimePickerSlots, BaseDateTimePickerSlotProps } from '../DateTimePicker/shared';
2
3
  import { StaticOnlyPickerProps, UseStaticPickerSlots, UseStaticPickerSlotProps } from '../internals/hooks/useStaticPicker';
3
- import { MakeOptional } from '../internals/models/helpers';
4
- import { DateOrTimeView, PickerValidDate } from '../models';
5
- export interface StaticDateTimePickerSlots<TDate extends PickerValidDate> extends BaseDateTimePickerSlots<TDate>, UseStaticPickerSlots<TDate, DateOrTimeView> {
4
+ import { DateOrTimeView } from '../models';
5
+ export interface StaticDateTimePickerSlots extends BaseDateTimePickerSlots, UseStaticPickerSlots<DateOrTimeView> {
6
6
  }
7
- export interface StaticDateTimePickerSlotProps<TDate extends PickerValidDate> extends BaseDateTimePickerSlotProps<TDate>, UseStaticPickerSlotProps<TDate, DateOrTimeView> {
7
+ export interface StaticDateTimePickerSlotProps extends BaseDateTimePickerSlotProps, UseStaticPickerSlotProps<DateOrTimeView> {
8
8
  }
9
- export interface StaticDateTimePickerProps<TDate extends PickerValidDate> extends BaseDateTimePickerProps<TDate, DateOrTimeView>, MakeOptional<StaticOnlyPickerProps, 'displayStaticWrapperAs'> {
9
+ export interface StaticDateTimePickerProps extends BaseDateTimePickerProps<DateOrTimeView>, MakeOptional<StaticOnlyPickerProps, 'displayStaticWrapperAs'> {
10
10
  /**
11
11
  * Overridable component slots.
12
12
  * @default {}
13
13
  */
14
- slots?: StaticDateTimePickerSlots<TDate>;
14
+ slots?: StaticDateTimePickerSlots;
15
15
  /**
16
16
  * The props used for each component slot.
17
17
  * @default {}
18
18
  */
19
- slotProps?: StaticDateTimePickerSlotProps<TDate>;
19
+ slotProps?: StaticDateTimePickerSlotProps;
20
20
  /**
21
21
  * Years rendered per row.
22
22
  * @default `4` when `displayStaticWrapperAs === 'desktop'`, `3` otherwise.
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
- import { PickerValidDate } from '../models';
3
2
  import { StaticTimePickerProps } from './StaticTimePicker.types';
4
- type StaticTimePickerComponent = (<TDate extends PickerValidDate>(props: StaticTimePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
3
+ type StaticTimePickerComponent = ((props: StaticTimePickerProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
5
4
  propTypes?: any;
6
5
  };
7
6
  /**
@@ -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
  */
@@ -1,20 +1,20 @@
1
+ import { MakeOptional } from '@mui/x-internals/types';
1
2
  import { BaseTimePickerProps, BaseTimePickerSlots, BaseTimePickerSlotProps } from '../TimePicker/shared';
2
3
  import { StaticOnlyPickerProps, UseStaticPickerSlots, UseStaticPickerSlotProps } from '../internals/hooks/useStaticPicker';
3
- import { MakeOptional } from '../internals/models/helpers';
4
- import { PickerValidDate, TimeView } from '../models';
5
- export interface StaticTimePickerSlots<TDate extends PickerValidDate> extends BaseTimePickerSlots<TDate>, UseStaticPickerSlots<TDate, TimeView> {
4
+ import { TimeView } from '../models';
5
+ export interface StaticTimePickerSlots extends BaseTimePickerSlots, UseStaticPickerSlots<TimeView> {
6
6
  }
7
- export interface StaticTimePickerSlotProps<TDate extends PickerValidDate> extends BaseTimePickerSlotProps, UseStaticPickerSlotProps<TDate, TimeView> {
7
+ export interface StaticTimePickerSlotProps extends BaseTimePickerSlotProps, UseStaticPickerSlotProps<TimeView> {
8
8
  }
9
- export interface StaticTimePickerProps<TDate extends PickerValidDate> extends BaseTimePickerProps<TDate, TimeView>, MakeOptional<StaticOnlyPickerProps, 'displayStaticWrapperAs'> {
9
+ export interface StaticTimePickerProps extends BaseTimePickerProps<TimeView>, MakeOptional<StaticOnlyPickerProps, 'displayStaticWrapperAs'> {
10
10
  /**
11
11
  * Overridable component slots.
12
12
  * @default {}
13
13
  */
14
- slots?: StaticTimePickerSlots<TDate>;
14
+ slots?: StaticTimePickerSlots;
15
15
  /**
16
16
  * The props used for each component slot.
17
17
  * @default {}
18
18
  */
19
- slotProps?: StaticTimePickerSlotProps<TDate>;
19
+ slotProps?: StaticTimePickerSlotProps;
20
20
  }
@@ -3,7 +3,8 @@ import type { PickerSelectionState } from '../internals/hooks/usePicker';
3
3
  import { useMeridiemMode } from '../internals/hooks/date-helpers-hooks';
4
4
  import { PickerValidDate, TimeView } from '../models';
5
5
  import { ClockClasses } from './clockClasses';
6
- export interface ClockProps<TDate extends PickerValidDate> extends ReturnType<typeof useMeridiemMode> {
6
+ import { FormProps } from '../internals/models/formProps';
7
+ export interface ClockProps extends ReturnType<typeof useMeridiemMode>, FormProps {
7
8
  ampm: boolean;
8
9
  ampmInClock: boolean;
9
10
  autoFocus?: boolean;
@@ -24,13 +25,11 @@ export interface ClockProps<TDate extends PickerValidDate> extends ReturnType<ty
24
25
  /**
25
26
  * The current full date value.
26
27
  */
27
- value: TDate | null;
28
- disabled?: boolean;
29
- readOnly?: boolean;
28
+ value: PickerValidDate | null;
30
29
  className?: string;
31
30
  classes?: Partial<ClockClasses>;
32
31
  }
33
32
  /**
34
33
  * @ignore - internal component.
35
34
  */
36
- export declare function Clock<TDate extends PickerValidDate>(inProps: ClockProps<TDate>): React.JSX.Element;
35
+ export declare function Clock(inProps: ClockProps): React.JSX.Element;
@@ -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);
@@ -316,7 +316,7 @@ export function Clock(inProps) {
316
316
  })]
317
317
  }), /*#__PURE__*/_jsx(ClockWrapper, {
318
318
  "aria-activedescendant": selectedId,
319
- "aria-label": translations.clockLabelText(type, value, utils, value == null ? null : utils.format(value, 'fullTime')),
319
+ "aria-label": translations.clockLabelText(type, value == null ? null : utils.format(value, 'fullTime')),
320
320
  ref: listboxRef,
321
321
  role: "listbox",
322
322
  onKeyDown: handleKeyDown,
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { MuiPickersAdapter, PickerValidDate } from '../models';
3
3
  import type { PickerSelectionState } from '../internals/hooks/usePicker';
4
- interface GetHourNumbersOptions<TDate extends PickerValidDate> {
4
+ interface GetHourNumbersOptions {
5
5
  ampm: boolean;
6
- value: TDate | null;
6
+ value: PickerValidDate | null;
7
7
  getClockNumberText: (hour: string) => string;
8
8
  isDisabled: (value: number) => boolean;
9
9
  onChange: (value: number, isFinish?: PickerSelectionState) => void;
@@ -12,13 +12,13 @@ interface GetHourNumbersOptions<TDate extends PickerValidDate> {
12
12
  * Should only be `undefined` on the server
13
13
  */
14
14
  selectedId: string | undefined;
15
- utils: MuiPickersAdapter<TDate>;
15
+ utils: MuiPickersAdapter;
16
16
  }
17
17
  /**
18
18
  * @ignore - internal component.
19
19
  */
20
- export declare const getHourNumbers: <TDate extends PickerValidDate>({ ampm, value, getClockNumberText, isDisabled, selectedId, utils, }: GetHourNumbersOptions<TDate>) => React.JSX.Element[];
21
- export declare const getMinutesNumbers: <TDate extends PickerValidDate>({ utils, value, isDisabled, getClockNumberText, selectedId, }: Omit<GetHourNumbersOptions<TDate>, "ampm" | "value"> & {
20
+ export declare const getHourNumbers: ({ ampm, value, getClockNumberText, isDisabled, selectedId, utils, }: GetHourNumbersOptions) => React.JSX.Element[];
21
+ export declare const getMinutesNumbers: ({ utils, value, isDisabled, getClockNumberText, selectedId, }: Omit<GetHourNumbersOptions, "ampm" | "value"> & {
22
22
  value: number;
23
23
  }) => React.JSX.Element[];
24
24
  export {};
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
- import { PickerValidDate } from '../models';
3
2
  import { TimeClockProps } from './TimeClock.types';
4
- type TimeClockComponent = (<TDate extends PickerValidDate>(props: TimeClockProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
3
+ type TimeClockComponent = ((props: TimeClockProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
5
4
  propTypes?: any;
6
5
  };
7
6
  /**
@@ -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";
@@ -117,7 +117,7 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
117
117
  props,
118
118
  timezone
119
119
  });
120
- const translations = usePickersTranslations();
120
+ const translations = usePickerTranslations();
121
121
  const now = useNow(timezone);
122
122
  const {
123
123
  view,
@@ -345,7 +345,8 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
345
345
  */
346
346
  defaultValue: PropTypes.object,
347
347
  /**
348
- * If `true`, the picker views and text field are disabled.
348
+ * If `true`, the component is disabled.
349
+ * When disabled, the value cannot be changed and no interaction is possible.
349
350
  * @default false
350
351
  */
351
352
  disabled: PropTypes.bool,
@@ -412,7 +413,8 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
412
413
  */
413
414
  openTo: PropTypes.oneOf(['hours', 'minutes', 'seconds']),
414
415
  /**
415
- * If `true`, the picker views and text field are read-only.
416
+ * If `true`, the component is read-only.
417
+ * When read-only, the value cannot be changed but the user can interact with the interface.
416
418
  * @default false
417
419
  */
418
420
  readOnly: PropTypes.bool,
@@ -423,8 +425,7 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
423
425
  referenceDate: PropTypes.object,
424
426
  /**
425
427
  * Disable specific time.
426
- * @template TDate
427
- * @param {TDate} value The value to check.
428
+ * @param {PickerValidDate} value The value to check.
428
429
  * @param {TimeView} view The clock type of the timeValue.
429
430
  * @returns {boolean} If `true` the time will be disabled.
430
431
  */
@@ -1,9 +1,9 @@
1
1
  import { TimeClockClasses } from './timeClockClasses';
2
2
  import { PickersArrowSwitcherSlots, PickersArrowSwitcherSlotProps } from '../internals/components/PickersArrowSwitcher';
3
- import { BaseClockProps, ExportedBaseClockProps } from '../internals/models/props/clock';
4
- import { PickerValidDate, TimeView } from '../models';
3
+ import { BaseClockProps, ExportedBaseClockProps } from '../internals/models/props/time';
4
+ import { TimeView } from '../models';
5
5
  import { TimeViewWithMeridiem } from '../internals/models';
6
- export interface ExportedTimeClockProps<TDate extends PickerValidDate> extends ExportedBaseClockProps<TDate> {
6
+ export interface ExportedTimeClockProps extends ExportedBaseClockProps {
7
7
  /**
8
8
  * Display ampm controls under the clock (instead of in the toolbar).
9
9
  * @default false
@@ -14,7 +14,7 @@ export interface TimeClockSlots extends PickersArrowSwitcherSlots {
14
14
  }
15
15
  export interface TimeClockSlotProps extends PickersArrowSwitcherSlotProps {
16
16
  }
17
- export interface TimeClockProps<TDate extends PickerValidDate, TView extends TimeViewWithMeridiem = TimeView> extends ExportedTimeClockProps<TDate>, BaseClockProps<TDate, TView> {
17
+ export interface TimeClockProps<TView extends TimeViewWithMeridiem = TimeView> extends ExportedTimeClockProps, BaseClockProps<TView> {
18
18
  /**
19
19
  * Available views.
20
20
  * @default ['hours', 'minutes']
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { TimeFieldProps } from './TimeField.types';
3
- import { PickerValidDate } from '../models';
4
- type TimeFieldComponent = (<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false>(props: TimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
3
+ type TimeFieldComponent = (<TEnableAccessibleFieldDOMStructure extends boolean = true>(props: TimeFieldProps<TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
5
4
  propTypes?: any;
6
5
  };
7
6
  /**
@@ -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
  */