@mui/x-date-pickers 6.16.0 → 6.16.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 (145) hide show
  1. package/CHANGELOG.md +61 -1
  2. package/DateCalendar/DateCalendar.js +3 -1
  3. package/DateCalendar/DayCalendar.js +2 -2
  4. package/DateCalendar/PickersFadeTransitionGroup.js +6 -6
  5. package/DateCalendar/PickersSlideTransition.d.ts +0 -1
  6. package/DateCalendar/PickersSlideTransition.js +5 -5
  7. package/MonthCalendar/MonthCalendar.js +4 -1
  8. package/YearCalendar/PickersYear.js +1 -1
  9. package/YearCalendar/YearCalendar.js +6 -3
  10. package/index.js +1 -1
  11. package/internals/constants/dimensions.d.ts +2 -1
  12. package/internals/constants/dimensions.js +2 -1
  13. package/internals/hooks/useField/useField.js +6 -4
  14. package/internals/hooks/useField/useField.types.d.ts +6 -0
  15. package/legacy/DateCalendar/DateCalendar.js +3 -1
  16. package/legacy/DateCalendar/DayCalendar.js +2 -2
  17. package/legacy/DateCalendar/PickersFadeTransitionGroup.js +6 -6
  18. package/legacy/DateCalendar/PickersSlideTransition.js +5 -5
  19. package/legacy/MonthCalendar/MonthCalendar.js +4 -1
  20. package/legacy/YearCalendar/PickersYear.js +1 -1
  21. package/legacy/YearCalendar/YearCalendar.js +6 -4
  22. package/legacy/index.js +1 -1
  23. package/legacy/internals/constants/dimensions.js +2 -1
  24. package/legacy/internals/hooks/useField/useField.js +5 -3
  25. package/modern/DateCalendar/DateCalendar.js +3 -1
  26. package/modern/DateCalendar/DayCalendar.js +2 -2
  27. package/modern/DateCalendar/PickersFadeTransitionGroup.js +6 -6
  28. package/modern/DateCalendar/PickersSlideTransition.js +5 -5
  29. package/modern/MonthCalendar/MonthCalendar.js +4 -1
  30. package/modern/YearCalendar/PickersYear.js +1 -1
  31. package/modern/YearCalendar/YearCalendar.js +5 -3
  32. package/modern/index.js +1 -1
  33. package/modern/internals/constants/dimensions.js +2 -1
  34. package/modern/internals/hooks/useField/useField.js +6 -4
  35. package/node/DateCalendar/DateCalendar.js +4 -3
  36. package/node/DateCalendar/DayCalendar.js +2 -2
  37. package/node/DateCalendar/PickersFadeTransitionGroup.js +6 -6
  38. package/node/DateCalendar/PickersSlideTransition.js +5 -7
  39. package/node/DateCalendar/dateCalendarClasses.js +1 -2
  40. package/node/DateCalendar/dayCalendarClasses.js +1 -2
  41. package/node/DateCalendar/pickersFadeTransitionGroupClasses.js +1 -2
  42. package/node/DateCalendar/pickersSlideTransitionClasses.js +1 -2
  43. package/node/DateField/DateField.js +1 -2
  44. package/node/DatePicker/DatePicker.js +1 -2
  45. package/node/DatePicker/DatePickerToolbar.js +1 -2
  46. package/node/DatePicker/datePickerToolbarClasses.js +1 -2
  47. package/node/DateTimeField/DateTimeField.js +1 -2
  48. package/node/DateTimePicker/DateTimePicker.js +1 -2
  49. package/node/DateTimePicker/DateTimePickerTabs.js +1 -2
  50. package/node/DateTimePicker/dateTimePickerTabsClasses.js +1 -2
  51. package/node/DateTimePicker/dateTimePickerToolbarClasses.js +1 -2
  52. package/node/DayCalendarSkeleton/dayCalendarSkeletonClasses.js +1 -2
  53. package/node/DesktopDatePicker/DesktopDatePicker.js +1 -2
  54. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -2
  55. package/node/DesktopTimePicker/DesktopTimePicker.js +1 -2
  56. package/node/DigitalClock/DigitalClock.js +1 -2
  57. package/node/DigitalClock/digitalClockClasses.js +1 -2
  58. package/node/LocalizationProvider/LocalizationProvider.js +2 -4
  59. package/node/MobileDatePicker/MobileDatePicker.js +1 -2
  60. package/node/MobileDateTimePicker/MobileDateTimePicker.js +1 -2
  61. package/node/MobileTimePicker/MobileTimePicker.js +1 -2
  62. package/node/MonthCalendar/MonthCalendar.js +5 -3
  63. package/node/MonthCalendar/PickersMonth.js +2 -3
  64. package/node/MonthCalendar/monthCalendarClasses.js +1 -2
  65. package/node/MonthCalendar/pickersMonthClasses.js +1 -2
  66. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -2
  67. package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +2 -3
  68. package/node/MultiSectionDigitalClock/multiSectionDigitalClockClasses.js +1 -2
  69. package/node/MultiSectionDigitalClock/multiSectionDigitalClockSectionClasses.js +1 -2
  70. package/node/PickersCalendarHeader/PickersCalendarHeader.js +1 -2
  71. package/node/PickersCalendarHeader/pickersCalendarHeaderClasses.js +1 -2
  72. package/node/PickersDay/PickersDay.js +1 -2
  73. package/node/PickersDay/pickersDayClasses.js +1 -2
  74. package/node/PickersLayout/PickersLayout.js +3 -6
  75. package/node/PickersLayout/pickersLayoutClasses.js +1 -2
  76. package/node/PickersLayout/usePickerLayout.js +1 -2
  77. package/node/StaticDatePicker/StaticDatePicker.js +1 -2
  78. package/node/StaticDateTimePicker/StaticDateTimePicker.js +1 -2
  79. package/node/StaticTimePicker/StaticTimePicker.js +1 -2
  80. package/node/TimeClock/TimeClock.js +1 -2
  81. package/node/TimeClock/clockClasses.js +1 -2
  82. package/node/TimeClock/clockNumberClasses.js +1 -2
  83. package/node/TimeClock/clockPointerClasses.js +1 -2
  84. package/node/TimeClock/shared.js +2 -4
  85. package/node/TimeClock/timeClockClasses.js +1 -2
  86. package/node/TimeField/TimeField.js +1 -2
  87. package/node/TimePicker/TimePicker.js +1 -2
  88. package/node/TimePicker/timePickerToolbarClasses.js +1 -2
  89. package/node/YearCalendar/PickersYear.js +3 -4
  90. package/node/YearCalendar/YearCalendar.js +6 -5
  91. package/node/YearCalendar/pickersYearClasses.js +1 -2
  92. package/node/YearCalendar/yearCalendarClasses.js +1 -2
  93. package/node/icons/index.js +9 -17
  94. package/node/index.js +1 -1
  95. package/node/internals/components/DateTimeViewWrapper/DateTimeViewWrapper.js +2 -3
  96. package/node/internals/components/PickerViewRoot/PickerViewRoot.js +2 -3
  97. package/node/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +2 -3
  98. package/node/internals/components/PickersArrowSwitcher/pickersArrowSwitcherClasses.js +1 -2
  99. package/node/internals/components/PickersToolbar.js +2 -3
  100. package/node/internals/components/PickersToolbarButton.js +2 -3
  101. package/node/internals/components/PickersToolbarText.js +2 -3
  102. package/node/internals/components/pickersPopperClasses.js +1 -2
  103. package/node/internals/components/pickersToolbarButtonClasses.js +1 -2
  104. package/node/internals/components/pickersToolbarClasses.js +1 -2
  105. package/node/internals/components/pickersToolbarTextClasses.js +1 -2
  106. package/node/internals/constants/dimensions.js +8 -13
  107. package/node/internals/hooks/useDefaultReduceAnimations.js +1 -2
  108. package/node/internals/hooks/useField/useField.js +6 -4
  109. package/node/internals/utils/getDefaultReferenceDate.js +1 -2
  110. package/node/internals/utils/utils.js +1 -2
  111. package/node/internals/utils/validation/extractValidationProps.js +3 -6
  112. package/node/internals/utils/valueManagers.js +3 -5
  113. package/node/locales/beBY.js +1 -2
  114. package/node/locales/caES.js +1 -2
  115. package/node/locales/csCZ.js +1 -2
  116. package/node/locales/daDK.js +1 -2
  117. package/node/locales/deDE.js +1 -2
  118. package/node/locales/elGR.js +1 -2
  119. package/node/locales/enUS.js +2 -4
  120. package/node/locales/esES.js +1 -2
  121. package/node/locales/faIR.js +1 -2
  122. package/node/locales/fiFI.js +1 -2
  123. package/node/locales/frFR.js +1 -2
  124. package/node/locales/heIL.js +1 -2
  125. package/node/locales/huHU.js +1 -2
  126. package/node/locales/isIS.js +1 -2
  127. package/node/locales/itIT.js +1 -2
  128. package/node/locales/jaJP.js +1 -2
  129. package/node/locales/koKR.js +1 -2
  130. package/node/locales/kzKZ.js +1 -2
  131. package/node/locales/nbNO.js +1 -2
  132. package/node/locales/nlNL.js +1 -2
  133. package/node/locales/plPL.js +1 -2
  134. package/node/locales/ptBR.js +1 -2
  135. package/node/locales/roRO.js +1 -2
  136. package/node/locales/ruRU.js +1 -2
  137. package/node/locales/skSK.js +1 -2
  138. package/node/locales/svSE.js +1 -2
  139. package/node/locales/trTR.js +1 -2
  140. package/node/locales/ukUA.js +1 -2
  141. package/node/locales/urPK.js +1 -2
  142. package/node/locales/viVN.js +1 -2
  143. package/node/locales/zhCN.js +1 -2
  144. package/node/locales/zhHK.js +1 -2
  145. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -3,6 +3,66 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 6.16.1
7
+
8
+ _Oct 6, 2023_
9
+
10
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🥧 Support interaction with pie chart
13
+ - 🐞 Bugfixes
14
+ - 📚 Documentation improvements
15
+
16
+ ### Data Grid
17
+
18
+ #### `@mui/x-data-grid@6.16.1`
19
+
20
+ - [DataGrid] Add a new demo with sparklines (#9228) @flaviendelangle
21
+ - [DataGrid] Fix autosize missing a few pixels (#10471) @romgrk
22
+ - [DataGrid] Make `disableColumnSelector` demo idempotent (#10548) @MBilalShafi
23
+
24
+ #### `@mui/x-data-grid-pro@6.16.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
25
+
26
+ Same changes as in `@mui/x-data-grid@6.16.1`.
27
+
28
+ #### `@mui/x-data-grid-premium@6.16.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
29
+
30
+ Same changes as in `@mui/x-data-grid-pro@6.16.1`.
31
+
32
+ ### Date Pickers
33
+
34
+ #### `@mui/x-date-pickers@6.16.1`
35
+
36
+ - [pickers] Avoid calendar layout shifting when changing views (#10541) @LukasTy
37
+ - [pickers] Fix clearable behavior when disabled (#10542) @noraleonte
38
+ - [pickers] Improve customization playground examples (#10544) @noraleonte
39
+
40
+ #### `@mui/x-date-pickers-pro@6.16.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
41
+
42
+ Same changes as in `@mui/x-date-pickers@6.16.1`, plus:
43
+
44
+ - [DateRangePicker] Fix `InputProps` propagation in multi input (#10564) @alexfauquette
45
+
46
+ ### Charts / `@mui/x-charts@6.0.0-alpha.14`
47
+
48
+ - [charts] Display cursor pointer for pie chart only if `onClick` is provided (#10551) @giladappsforce
49
+ - [charts] Add `onClick` prop to PieChart (#10506) @giladappsforce
50
+ - [charts] Support `slots`/`slotProps` for the tooltip (#10515) @alexfauquette
51
+
52
+ ### Docs
53
+
54
+ - [docs] Add `DateRangePicker` example with a `Button` trigger (#10485) @LukasTy
55
+ - [docs] Add section about disabling columns panel (#10328) @MBilalShafi
56
+ - [docs] Add section about overriding slots to base concepts (#10421) @noraleonte
57
+ - [docs] Add "What's new" page listing all release announcements (#9727) @joserodolfofreitas
58
+ - [docs] Update RTL Support section of the grid localization docs (#10561) @MBilalShafi
59
+
60
+ ### Core
61
+
62
+ - [core] Fix casing consistency with legal and marketing content @oliviertassinari
63
+ - [core] Revert the link in the priority support ticket description (#10517) @michelengelen
64
+ - [CHANGELOG] Polish image @oliviertassinari
65
+
6
66
  ## 6.16.0
7
67
 
8
68
  _Sep 29, 2023_
@@ -13,7 +73,7 @@ We'd like to offer a big thanks to the 9 contributors who made this release poss
13
73
 
14
74
  The pickers and fields now have an out-of-the box implementation for clearing the field value. You can see the documentation for this behavior on the [Date Picker documentation](https://mui.com/x/react-date-pickers/date-picker/#clearing-the-value).
15
75
 
16
- <img width="380" alt="Clearable behavior" src="https://github.com/mui/mui-x/assets/72460825/e4a66169-83b5-4579-b9f6-6e15bb528411">
76
+ <img width="337" height="139" alt="Clearable behavior" src="https://github.com/mui/mui-x/assets/3165635/a5407cb6-0b8a-443c-b4b9-1f81ceb4d087">
17
77
 
18
78
  - 💫 Add Date Picker customization playground (#9581) @noraleonte
19
79
 
@@ -21,6 +21,7 @@ import { useDefaultReduceAnimations } from '../internals/hooks/useDefaultReduceA
21
21
  import { getDateCalendarUtilityClass } from './dateCalendarClasses';
22
22
  import { useControlledValueWithTimezone } from '../internals/hooks/useValueWithTimezone';
23
23
  import { singleItemValueManager } from '../internals/utils/valueManagers';
24
+ import { VIEW_HEIGHT } from '../internals/constants/dimensions';
24
25
  import { jsx as _jsx } from "react/jsx-runtime";
25
26
  import { jsxs as _jsxs } from "react/jsx-runtime";
26
27
  const useUtilityClasses = ownerState => {
@@ -62,7 +63,8 @@ const DateCalendarRoot = styled(PickerViewRoot, {
62
63
  overridesResolver: (props, styles) => styles.root
63
64
  })({
64
65
  display: 'flex',
65
- flexDirection: 'column'
66
+ flexDirection: 'column',
67
+ height: VIEW_HEIGHT
66
68
  });
67
69
  const DateCalendarViewTransitionContainer = styled(PickersFadeTransitionGroup, {
68
70
  name: 'MuiDateCalendar',
@@ -67,7 +67,7 @@ const PickersCalendarWeekDayLabel = styled(Typography, {
67
67
  color: (theme.vars || theme).palette.text.secondary
68
68
  }));
69
69
  const PickersCalendarWeekNumberLabel = styled(Typography, {
70
- name: 'MuiDayPicker',
70
+ name: 'MuiDayCalendar',
71
71
  slot: 'WeekNumberLabel',
72
72
  overridesResolver: (_, styles) => styles.weekNumberLabel
73
73
  })(({
@@ -83,7 +83,7 @@ const PickersCalendarWeekNumberLabel = styled(Typography, {
83
83
  color: theme.palette.text.disabled
84
84
  }));
85
85
  const PickersCalendarWeekNumber = styled(Typography, {
86
- name: 'MuiDayPicker',
86
+ name: 'MuiDayCalendar',
87
87
  slot: 'WeekNumber',
88
88
  overridesResolver: (_, styles) => styles.weekNumber
89
89
  })(({
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import clsx from 'clsx';
3
- import Fade from '@mui/material/Fade';
4
- import { styled, useThemeProps } from '@mui/material/styles';
5
- import { unstable_composeClasses as composeClasses } from '@mui/utils';
6
3
  import { TransitionGroup } from 'react-transition-group';
4
+ import Fade from '@mui/material/Fade';
5
+ import { styled, useTheme, useThemeProps } from '@mui/material/styles';
6
+ import composeClasses from '@mui/utils/composeClasses';
7
7
  import { getPickersFadeTransitionGroupUtilityClass } from './pickersFadeTransitionGroupClasses';
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  const useUtilityClasses = ownerState => {
@@ -15,7 +15,6 @@ const useUtilityClasses = ownerState => {
15
15
  };
16
16
  return composeClasses(slots, getPickersFadeTransitionGroupUtilityClass, classes);
17
17
  };
18
- const animationDuration = 500;
19
18
  const PickersFadeTransitionGroupRoot = styled(TransitionGroup, {
20
19
  name: 'MuiPickersFadeTransitionGroup',
21
20
  slot: 'Root',
@@ -40,6 +39,7 @@ export function PickersFadeTransitionGroup(inProps) {
40
39
  transKey
41
40
  } = props;
42
41
  const classes = useUtilityClasses(props);
42
+ const theme = useTheme();
43
43
  if (reduceAnimations) {
44
44
  return children;
45
45
  }
@@ -50,8 +50,8 @@ export function PickersFadeTransitionGroup(inProps) {
50
50
  mountOnEnter: true,
51
51
  unmountOnExit: true,
52
52
  timeout: {
53
- appear: animationDuration,
54
- enter: animationDuration / 2,
53
+ appear: theme.transitions.duration.enteringScreen,
54
+ enter: theme.transitions.duration.enteringScreen,
55
55
  exit: 0
56
56
  },
57
57
  children: children
@@ -12,7 +12,6 @@ export interface SlideTransitionProps extends Omit<CSSTransitionProps, 'timeout'
12
12
  slideDirection: SlideDirection;
13
13
  transKey: React.Key;
14
14
  }
15
- export declare const slideAnimationDuration = 350;
16
15
  /**
17
16
  * @ignore - do not document.
18
17
  */
@@ -3,8 +3,8 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
3
3
  const _excluded = ["children", "className", "reduceAnimations", "slideDirection", "transKey", "classes"];
4
4
  import * as React from 'react';
5
5
  import clsx from 'clsx';
6
- import { styled, useThemeProps } from '@mui/material/styles';
7
- import { unstable_composeClasses as composeClasses } from '@mui/utils';
6
+ import { styled, useTheme, useThemeProps } from '@mui/material/styles';
7
+ import composeClasses from '@mui/utils/composeClasses';
8
8
  import { CSSTransition, TransitionGroup } from 'react-transition-group';
9
9
  import { getPickersSlideTransitionUtilityClass, pickersSlideTransitionClasses } from './pickersSlideTransitionClasses';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -22,7 +22,6 @@ const useUtilityClasses = ownerState => {
22
22
  };
23
23
  return composeClasses(slots, getPickersSlideTransitionUtilityClass, classes);
24
24
  };
25
- export const slideAnimationDuration = 350;
26
25
  const PickersSlideTransitionRoot = styled(TransitionGroup, {
27
26
  name: 'MuiPickersSlideTransition',
28
27
  slot: 'Root',
@@ -43,7 +42,7 @@ const PickersSlideTransitionRoot = styled(TransitionGroup, {
43
42
  theme
44
43
  }) => {
45
44
  const slideTransition = theme.transitions.create('transform', {
46
- duration: slideAnimationDuration,
45
+ duration: theme.transitions.duration.complex,
47
46
  easing: 'cubic-bezier(0.35, 0.8, 0.4, 1)'
48
47
  });
49
48
  return {
@@ -105,6 +104,7 @@ export function PickersSlideTransition(inProps) {
105
104
  } = props,
106
105
  other = _objectWithoutPropertiesLoose(props, _excluded);
107
106
  const classes = useUtilityClasses(props);
107
+ const theme = useTheme();
108
108
  if (reduceAnimations) {
109
109
  return /*#__PURE__*/_jsx("div", {
110
110
  className: clsx(classes.root, className),
@@ -126,7 +126,7 @@ export function PickersSlideTransition(inProps) {
126
126
  children: /*#__PURE__*/_jsx(CSSTransition, _extends({
127
127
  mountOnEnter: true,
128
128
  unmountOnExit: true,
129
- timeout: slideAnimationDuration,
129
+ timeout: theme.transitions.duration.complex,
130
130
  classNames: transitionClasses
131
131
  }, other, {
132
132
  children: children
@@ -14,6 +14,7 @@ import { applyDefaultDate, getMonthsInYear } from '../internals/utils/date-utils
14
14
  import { singleItemValueManager } from '../internals/utils/valueManagers';
15
15
  import { SECTION_TYPE_GRANULARITY } from '../internals/utils/getDefaultReferenceDate';
16
16
  import { useControlledValueWithTimezone } from '../internals/hooks/useValueWithTimezone';
17
+ import { DIALOG_WIDTH } from '../internals/constants/dimensions';
17
18
  import { jsx as _jsx } from "react/jsx-runtime";
18
19
  const useUtilityClasses = ownerState => {
19
20
  const {
@@ -48,7 +49,9 @@ const MonthCalendarRoot = styled('div', {
48
49
  flexWrap: 'wrap',
49
50
  alignContent: 'stretch',
50
51
  padding: '0 4px',
51
- width: 320
52
+ width: DIALOG_WIDTH,
53
+ // avoid padding increasing width over defined
54
+ boxSizing: 'border-box'
52
55
  });
53
56
  export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalendar(inProps, ref) {
54
57
  const props = useMonthCalendarDefaultizedProps(inProps, 'MuiMonthCalendar');
@@ -47,7 +47,7 @@ const PickersYearButton = styled('button', {
47
47
  border: 0,
48
48
  outline: 0
49
49
  }, theme.typography.subtitle1, {
50
- margin: '8px 0',
50
+ margin: '6px 0',
51
51
  height: 36,
52
52
  width: 72,
53
53
  borderRadius: 18,
@@ -14,6 +14,7 @@ import { applyDefaultDate } from '../internals/utils/date-utils';
14
14
  import { singleItemValueManager } from '../internals/utils/valueManagers';
15
15
  import { SECTION_TYPE_GRANULARITY } from '../internals/utils/getDefaultReferenceDate';
16
16
  import { useControlledValueWithTimezone } from '../internals/hooks/useValueWithTimezone';
17
+ import { DIALOG_WIDTH, MAX_CALENDAR_HEIGHT } from '../internals/constants/dimensions';
17
18
  import { jsx as _jsx } from "react/jsx-runtime";
18
19
  const useUtilityClasses = ownerState => {
19
20
  const {
@@ -25,6 +26,7 @@ const useUtilityClasses = ownerState => {
25
26
  return composeClasses(slots, getYearCalendarUtilityClass, classes);
26
27
  };
27
28
  function useYearCalendarDefaultizedProps(props, name) {
29
+ var _themeProps$yearsPerR;
28
30
  const utils = useUtils();
29
31
  const defaultDates = useDefaultDates();
30
32
  const themeProps = useThemeProps({
@@ -35,6 +37,7 @@ function useYearCalendarDefaultizedProps(props, name) {
35
37
  disablePast: false,
36
38
  disableFuture: false
37
39
  }, themeProps, {
40
+ yearsPerRow: (_themeProps$yearsPerR = themeProps.yearsPerRow) != null ? _themeProps$yearsPerR : 3,
38
41
  minDate: applyDefaultDate(utils, themeProps.minDate, defaultDates.minDate),
39
42
  maxDate: applyDefaultDate(utils, themeProps.maxDate, defaultDates.maxDate)
40
43
  });
@@ -50,8 +53,8 @@ const YearCalendarRoot = styled('div', {
50
53
  overflowY: 'auto',
51
54
  height: '100%',
52
55
  padding: '0 4px',
53
- width: 320,
54
- maxHeight: 304,
56
+ width: DIALOG_WIDTH,
57
+ maxHeight: MAX_CALENDAR_HEIGHT,
55
58
  // avoid padding increasing width over defined
56
59
  boxSizing: 'border-box',
57
60
  position: 'relative'
@@ -76,7 +79,7 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
76
79
  onYearFocus,
77
80
  hasFocus,
78
81
  onFocusedViewChange,
79
- yearsPerRow = 3,
82
+ yearsPerRow,
80
83
  timezone: timezoneProp,
81
84
  gridLabelId
82
85
  } = props,
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.16.0
2
+ * @mui/x-date-pickers v6.16.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,6 +1,7 @@
1
1
  export declare const DAY_SIZE = 36;
2
2
  export declare const DAY_MARGIN = 2;
3
3
  export declare const DIALOG_WIDTH = 320;
4
- export declare const VIEW_HEIGHT = 358;
4
+ export declare const MAX_CALENDAR_HEIGHT = 280;
5
+ export declare const VIEW_HEIGHT = 334;
5
6
  export declare const DIGITAL_CLOCK_VIEW_HEIGHT = 232;
6
7
  export declare const MULTI_SECTION_CLOCK_SECTION_WIDTH = 48;
@@ -1,6 +1,7 @@
1
1
  export const DAY_SIZE = 36;
2
2
  export const DAY_MARGIN = 2;
3
3
  export const DIALOG_WIDTH = 320;
4
- export const VIEW_HEIGHT = 358;
4
+ export const MAX_CALENDAR_HEIGHT = 280;
5
+ export const VIEW_HEIGHT = 334;
5
6
  export const DIGITAL_CLOCK_VIEW_HEIGHT = 232;
6
7
  export const MULTI_SECTION_CLOCK_SECTION_WIDTH = 48;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["onClick", "onKeyDown", "onFocus", "onBlur", "onMouseUp", "onPaste", "error", "clearable", "onClear"];
3
+ const _excluded = ["onClick", "onKeyDown", "onFocus", "onBlur", "onMouseUp", "onPaste", "error", "clearable", "onClear", "disabled"];
4
4
  import * as React from 'react';
5
5
  import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
6
6
  import useEventCallback from '@mui/utils/useEventCallback';
@@ -44,7 +44,8 @@ export const useField = params => {
44
44
  onPaste,
45
45
  error,
46
46
  clearable,
47
- onClear
47
+ onClear,
48
+ disabled
48
49
  },
49
50
  fieldValueManager,
50
51
  valueManager,
@@ -407,7 +408,8 @@ export const useField = params => {
407
408
  });
408
409
  return _extends({
409
410
  placeholder,
410
- autoComplete: 'off'
411
+ autoComplete: 'off',
412
+ disabled: Boolean(disabled)
411
413
  }, otherForwardedProps, {
412
414
  value: shouldShowPlaceholder ? '' : valueStr,
413
415
  inputMode,
@@ -422,6 +424,6 @@ export const useField = params => {
422
424
  onClear: handleClearValue,
423
425
  error: inputError,
424
426
  ref: handleRef,
425
- clearable: Boolean(clearable && !areAllSectionsEmpty && !readOnly)
427
+ clearable: Boolean(clearable && !areAllSectionsEmpty && !readOnly && !disabled)
426
428
  });
427
429
  };
@@ -105,6 +105,11 @@ export interface UseFieldInternalProps<TValue, TDate, TSection extends FieldSect
105
105
  * @default false
106
106
  */
107
107
  clearable?: boolean;
108
+ /**
109
+ * If `true`, the component is disabled.
110
+ * @default false
111
+ */
112
+ disabled?: boolean;
108
113
  }
109
114
  export interface FieldRef<TSection extends FieldSection> {
110
115
  /**
@@ -134,6 +139,7 @@ export interface UseFieldForwardedProps {
134
139
  error?: boolean;
135
140
  onClear?: React.MouseEventHandler;
136
141
  clearable?: boolean;
142
+ disabled?: boolean;
137
143
  }
138
144
  export type UseFieldResponse<TForwardedProps extends UseFieldForwardedProps> = Omit<TForwardedProps, keyof UseFieldForwardedProps> & Required<UseFieldForwardedProps> & Pick<React.HTMLAttributes<HTMLInputElement>, 'autoCorrect' | 'inputMode' | 'placeholder'> & {
139
145
  ref: React.Ref<HTMLInputElement>;
@@ -21,6 +21,7 @@ import { useDefaultReduceAnimations } from '../internals/hooks/useDefaultReduceA
21
21
  import { getDateCalendarUtilityClass } from './dateCalendarClasses';
22
22
  import { useControlledValueWithTimezone } from '../internals/hooks/useValueWithTimezone';
23
23
  import { singleItemValueManager } from '../internals/utils/valueManagers';
24
+ import { VIEW_HEIGHT } from '../internals/constants/dimensions';
24
25
  import { jsx as _jsx } from "react/jsx-runtime";
25
26
  import { jsxs as _jsxs } from "react/jsx-runtime";
26
27
  var useUtilityClasses = function useUtilityClasses(ownerState) {
@@ -64,7 +65,8 @@ var DateCalendarRoot = styled(PickerViewRoot, {
64
65
  }
65
66
  })({
66
67
  display: 'flex',
67
- flexDirection: 'column'
68
+ flexDirection: 'column',
69
+ height: VIEW_HEIGHT
68
70
  });
69
71
  var DateCalendarViewTransitionContainer = styled(PickersFadeTransitionGroup, {
70
72
  name: 'MuiDateCalendar',
@@ -73,7 +73,7 @@ var PickersCalendarWeekDayLabel = styled(Typography, {
73
73
  };
74
74
  });
75
75
  var PickersCalendarWeekNumberLabel = styled(Typography, {
76
- name: 'MuiDayPicker',
76
+ name: 'MuiDayCalendar',
77
77
  slot: 'WeekNumberLabel',
78
78
  overridesResolver: function overridesResolver(_, styles) {
79
79
  return styles.weekNumberLabel;
@@ -92,7 +92,7 @@ var PickersCalendarWeekNumberLabel = styled(Typography, {
92
92
  };
93
93
  });
94
94
  var PickersCalendarWeekNumber = styled(Typography, {
95
- name: 'MuiDayPicker',
95
+ name: 'MuiDayCalendar',
96
96
  slot: 'WeekNumber',
97
97
  overridesResolver: function overridesResolver(_, styles) {
98
98
  return styles.weekNumber;
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import clsx from 'clsx';
3
- import Fade from '@mui/material/Fade';
4
- import { styled, useThemeProps } from '@mui/material/styles';
5
- import { unstable_composeClasses as composeClasses } from '@mui/utils';
6
3
  import { TransitionGroup } from 'react-transition-group';
4
+ import Fade from '@mui/material/Fade';
5
+ import { styled, useTheme, useThemeProps } from '@mui/material/styles';
6
+ import composeClasses from '@mui/utils/composeClasses';
7
7
  import { getPickersFadeTransitionGroupUtilityClass } from './pickersFadeTransitionGroupClasses';
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  var useUtilityClasses = function useUtilityClasses(ownerState) {
@@ -13,7 +13,6 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
13
13
  };
14
14
  return composeClasses(slots, getPickersFadeTransitionGroupUtilityClass, classes);
15
15
  };
16
- var animationDuration = 500;
17
16
  var PickersFadeTransitionGroupRoot = styled(TransitionGroup, {
18
17
  name: 'MuiPickersFadeTransitionGroup',
19
18
  slot: 'Root',
@@ -38,6 +37,7 @@ export function PickersFadeTransitionGroup(inProps) {
38
37
  reduceAnimations = props.reduceAnimations,
39
38
  transKey = props.transKey;
40
39
  var classes = useUtilityClasses(props);
40
+ var theme = useTheme();
41
41
  if (reduceAnimations) {
42
42
  return children;
43
43
  }
@@ -48,8 +48,8 @@ export function PickersFadeTransitionGroup(inProps) {
48
48
  mountOnEnter: true,
49
49
  unmountOnExit: true,
50
50
  timeout: {
51
- appear: animationDuration,
52
- enter: animationDuration / 2,
51
+ appear: theme.transitions.duration.enteringScreen,
52
+ enter: theme.transitions.duration.enteringScreen,
53
53
  exit: 0
54
54
  },
55
55
  children: children
@@ -4,8 +4,8 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
4
  var _excluded = ["children", "className", "reduceAnimations", "slideDirection", "transKey", "classes"];
5
5
  import * as React from 'react';
6
6
  import clsx from 'clsx';
7
- import { styled, useThemeProps } from '@mui/material/styles';
8
- import { unstable_composeClasses as composeClasses } from '@mui/utils';
7
+ import { styled, useTheme, useThemeProps } from '@mui/material/styles';
8
+ import composeClasses from '@mui/utils/composeClasses';
9
9
  import { CSSTransition, TransitionGroup } from 'react-transition-group';
10
10
  import { getPickersSlideTransitionUtilityClass, pickersSlideTransitionClasses } from './pickersSlideTransitionClasses';
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -21,7 +21,6 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
21
21
  };
22
22
  return composeClasses(slots, getPickersSlideTransitionUtilityClass, classes);
23
23
  };
24
- export var slideAnimationDuration = 350;
25
24
  var PickersSlideTransitionRoot = styled(TransitionGroup, {
26
25
  name: 'MuiPickersSlideTransition',
27
26
  slot: 'Root',
@@ -32,7 +31,7 @@ var PickersSlideTransitionRoot = styled(TransitionGroup, {
32
31
  var _ref8;
33
32
  var theme = _ref7.theme;
34
33
  var slideTransition = theme.transitions.create('transform', {
35
- duration: slideAnimationDuration,
34
+ duration: theme.transitions.duration.complex,
36
35
  easing: 'cubic-bezier(0.35, 0.8, 0.4, 1)'
37
36
  });
38
37
  return _ref8 = {
@@ -87,6 +86,7 @@ export function PickersSlideTransition(inProps) {
87
86
  providedClasses = props.classes,
88
87
  other = _objectWithoutProperties(props, _excluded);
89
88
  var classes = useUtilityClasses(props);
89
+ var theme = useTheme();
90
90
  if (reduceAnimations) {
91
91
  return /*#__PURE__*/_jsx("div", {
92
92
  className: clsx(classes.root, className),
@@ -110,7 +110,7 @@ export function PickersSlideTransition(inProps) {
110
110
  children: /*#__PURE__*/_jsx(CSSTransition, _extends({
111
111
  mountOnEnter: true,
112
112
  unmountOnExit: true,
113
- timeout: slideAnimationDuration,
113
+ timeout: theme.transitions.duration.complex,
114
114
  classNames: transitionClasses
115
115
  }, other, {
116
116
  children: children
@@ -15,6 +15,7 @@ import { applyDefaultDate, getMonthsInYear } from '../internals/utils/date-utils
15
15
  import { singleItemValueManager } from '../internals/utils/valueManagers';
16
16
  import { SECTION_TYPE_GRANULARITY } from '../internals/utils/getDefaultReferenceDate';
17
17
  import { useControlledValueWithTimezone } from '../internals/hooks/useValueWithTimezone';
18
+ import { DIALOG_WIDTH } from '../internals/constants/dimensions';
18
19
  import { jsx as _jsx } from "react/jsx-runtime";
19
20
  var useUtilityClasses = function useUtilityClasses(ownerState) {
20
21
  var classes = ownerState.classes;
@@ -49,7 +50,9 @@ var MonthCalendarRoot = styled('div', {
49
50
  flexWrap: 'wrap',
50
51
  alignContent: 'stretch',
51
52
  padding: '0 4px',
52
- width: 320
53
+ width: DIALOG_WIDTH,
54
+ // avoid padding increasing width over defined
55
+ boxSizing: 'border-box'
53
56
  });
54
57
  export var MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalendar(inProps, ref) {
55
58
  var props = useMonthCalendarDefaultizedProps(inProps, 'MuiMonthCalendar');
@@ -48,7 +48,7 @@ var PickersYearButton = styled('button', {
48
48
  border: 0,
49
49
  outline: 0
50
50
  }, theme.typography.subtitle1, (_extends2 = {
51
- margin: '8px 0',
51
+ margin: '6px 0',
52
52
  height: 36,
53
53
  width: 72,
54
54
  borderRadius: 18,
@@ -15,6 +15,7 @@ import { applyDefaultDate } from '../internals/utils/date-utils';
15
15
  import { singleItemValueManager } from '../internals/utils/valueManagers';
16
16
  import { SECTION_TYPE_GRANULARITY } from '../internals/utils/getDefaultReferenceDate';
17
17
  import { useControlledValueWithTimezone } from '../internals/hooks/useValueWithTimezone';
18
+ import { DIALOG_WIDTH, MAX_CALENDAR_HEIGHT } from '../internals/constants/dimensions';
18
19
  import { jsx as _jsx } from "react/jsx-runtime";
19
20
  var useUtilityClasses = function useUtilityClasses(ownerState) {
20
21
  var classes = ownerState.classes;
@@ -24,6 +25,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
24
25
  return composeClasses(slots, getYearCalendarUtilityClass, classes);
25
26
  };
26
27
  function useYearCalendarDefaultizedProps(props, name) {
28
+ var _themeProps$yearsPerR;
27
29
  var utils = useUtils();
28
30
  var defaultDates = useDefaultDates();
29
31
  var themeProps = useThemeProps({
@@ -34,6 +36,7 @@ function useYearCalendarDefaultizedProps(props, name) {
34
36
  disablePast: false,
35
37
  disableFuture: false
36
38
  }, themeProps, {
39
+ yearsPerRow: (_themeProps$yearsPerR = themeProps.yearsPerRow) != null ? _themeProps$yearsPerR : 3,
37
40
  minDate: applyDefaultDate(utils, themeProps.minDate, defaultDates.minDate),
38
41
  maxDate: applyDefaultDate(utils, themeProps.maxDate, defaultDates.maxDate)
39
42
  });
@@ -51,8 +54,8 @@ var YearCalendarRoot = styled('div', {
51
54
  overflowY: 'auto',
52
55
  height: '100%',
53
56
  padding: '0 4px',
54
- width: 320,
55
- maxHeight: 304,
57
+ width: DIALOG_WIDTH,
58
+ maxHeight: MAX_CALENDAR_HEIGHT,
56
59
  // avoid padding increasing width over defined
57
60
  boxSizing: 'border-box',
58
61
  position: 'relative'
@@ -76,8 +79,7 @@ export var YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(in
76
79
  onYearFocus = props.onYearFocus,
77
80
  hasFocus = props.hasFocus,
78
81
  onFocusedViewChange = props.onFocusedViewChange,
79
- _props$yearsPerRow = props.yearsPerRow,
80
- yearsPerRow = _props$yearsPerRow === void 0 ? 3 : _props$yearsPerRow,
82
+ yearsPerRow = props.yearsPerRow,
81
83
  timezoneProp = props.timezone,
82
84
  gridLabelId = props.gridLabelId,
83
85
  other = _objectWithoutProperties(props, _excluded);
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.16.0
2
+ * @mui/x-date-pickers v6.16.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,6 +1,7 @@
1
1
  export var DAY_SIZE = 36;
2
2
  export var DAY_MARGIN = 2;
3
3
  export var DIALOG_WIDTH = 320;
4
- export var VIEW_HEIGHT = 358;
4
+ export var MAX_CALENDAR_HEIGHT = 280;
5
+ export var VIEW_HEIGHT = 334;
5
6
  export var DIGITAL_CLOCK_VIEW_HEIGHT = 232;
6
7
  export var MULTI_SECTION_CLOCK_SECTION_WIDTH = 48;
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["onClick", "onKeyDown", "onFocus", "onBlur", "onMouseUp", "onPaste", "error", "clearable", "onClear"];
4
+ var _excluded = ["onClick", "onKeyDown", "onFocus", "onBlur", "onMouseUp", "onPaste", "error", "clearable", "onClear", "disabled"];
5
5
  import * as React from 'react';
6
6
  import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
7
7
  import useEventCallback from '@mui/utils/useEventCallback';
@@ -44,6 +44,7 @@ export var useField = function useField(params) {
44
44
  error = _params$forwardedProp.error,
45
45
  clearable = _params$forwardedProp.clearable,
46
46
  onClear = _params$forwardedProp.onClear,
47
+ disabled = _params$forwardedProp.disabled,
47
48
  otherForwardedProps = _objectWithoutProperties(_params$forwardedProp, _excluded),
48
49
  fieldValueManager = params.fieldValueManager,
49
50
  valueManager = params.valueManager,
@@ -429,7 +430,8 @@ export var useField = function useField(params) {
429
430
  });
430
431
  return _extends({
431
432
  placeholder: placeholder,
432
- autoComplete: 'off'
433
+ autoComplete: 'off',
434
+ disabled: Boolean(disabled)
433
435
  }, otherForwardedProps, {
434
436
  value: shouldShowPlaceholder ? '' : valueStr,
435
437
  inputMode: inputMode,
@@ -444,6 +446,6 @@ export var useField = function useField(params) {
444
446
  onClear: handleClearValue,
445
447
  error: inputError,
446
448
  ref: handleRef,
447
- clearable: Boolean(clearable && !areAllSectionsEmpty && !readOnly)
449
+ clearable: Boolean(clearable && !areAllSectionsEmpty && !readOnly && !disabled)
448
450
  });
449
451
  };
@@ -21,6 +21,7 @@ import { useDefaultReduceAnimations } from '../internals/hooks/useDefaultReduceA
21
21
  import { getDateCalendarUtilityClass } from './dateCalendarClasses';
22
22
  import { useControlledValueWithTimezone } from '../internals/hooks/useValueWithTimezone';
23
23
  import { singleItemValueManager } from '../internals/utils/valueManagers';
24
+ import { VIEW_HEIGHT } from '../internals/constants/dimensions';
24
25
  import { jsx as _jsx } from "react/jsx-runtime";
25
26
  import { jsxs as _jsxs } from "react/jsx-runtime";
26
27
  const useUtilityClasses = ownerState => {
@@ -61,7 +62,8 @@ const DateCalendarRoot = styled(PickerViewRoot, {
61
62
  overridesResolver: (props, styles) => styles.root
62
63
  })({
63
64
  display: 'flex',
64
- flexDirection: 'column'
65
+ flexDirection: 'column',
66
+ height: VIEW_HEIGHT
65
67
  });
66
68
  const DateCalendarViewTransitionContainer = styled(PickersFadeTransitionGroup, {
67
69
  name: 'MuiDateCalendar',
@@ -67,7 +67,7 @@ const PickersCalendarWeekDayLabel = styled(Typography, {
67
67
  color: (theme.vars || theme).palette.text.secondary
68
68
  }));
69
69
  const PickersCalendarWeekNumberLabel = styled(Typography, {
70
- name: 'MuiDayPicker',
70
+ name: 'MuiDayCalendar',
71
71
  slot: 'WeekNumberLabel',
72
72
  overridesResolver: (_, styles) => styles.weekNumberLabel
73
73
  })(({
@@ -83,7 +83,7 @@ const PickersCalendarWeekNumberLabel = styled(Typography, {
83
83
  color: theme.palette.text.disabled
84
84
  }));
85
85
  const PickersCalendarWeekNumber = styled(Typography, {
86
- name: 'MuiDayPicker',
86
+ name: 'MuiDayCalendar',
87
87
  slot: 'WeekNumber',
88
88
  overridesResolver: (_, styles) => styles.weekNumber
89
89
  })(({