@mui/x-date-pickers 6.13.0 → 6.15.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 (100) hide show
  1. package/CHANGELOG.md +162 -1
  2. package/DateCalendar/DateCalendar.js +2 -2
  3. package/DateField/DateField.js +2 -3
  4. package/DatePicker/DatePicker.js +2 -3
  5. package/DateTimeField/DateTimeField.js +2 -3
  6. package/DateTimePicker/DateTimePicker.js +2 -3
  7. package/DesktopDatePicker/DesktopDatePicker.js +2 -3
  8. package/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -3
  9. package/DesktopTimePicker/DesktopTimePicker.js +2 -3
  10. package/MobileDatePicker/MobileDatePicker.js +2 -3
  11. package/MobileDateTimePicker/MobileDateTimePicker.js +2 -3
  12. package/MobileTimePicker/MobileTimePicker.js +2 -3
  13. package/MonthCalendar/MonthCalendar.js +9 -3
  14. package/MonthCalendar/MonthCalendar.types.d.ts +1 -0
  15. package/MonthCalendar/PickersMonth.d.ts +1 -0
  16. package/MonthCalendar/PickersMonth.js +7 -2
  17. package/README.md +4 -4
  18. package/TimeClock/Clock.js +29 -8
  19. package/TimeClock/clockClasses.d.ts +2 -0
  20. package/TimeClock/clockClasses.js +1 -1
  21. package/TimeField/TimeField.js +2 -3
  22. package/TimePicker/TimePicker.js +2 -3
  23. package/YearCalendar/PickersYear.js +3 -0
  24. package/YearCalendar/YearCalendar.js +7 -3
  25. package/YearCalendar/YearCalendar.types.d.ts +1 -0
  26. package/index.js +1 -1
  27. package/internals/components/PickersPopper.d.ts +2 -2
  28. package/internals/components/PickersPopper.js +3 -3
  29. package/internals/hooks/useField/useField.utils.js +8 -3
  30. package/legacy/DateCalendar/DateCalendar.js +2 -2
  31. package/legacy/DateField/DateField.js +2 -3
  32. package/legacy/DatePicker/DatePicker.js +2 -3
  33. package/legacy/DateTimeField/DateTimeField.js +2 -3
  34. package/legacy/DateTimePicker/DateTimePicker.js +2 -3
  35. package/legacy/DesktopDatePicker/DesktopDatePicker.js +2 -3
  36. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -3
  37. package/legacy/DesktopTimePicker/DesktopTimePicker.js +2 -3
  38. package/legacy/MobileDatePicker/MobileDatePicker.js +2 -3
  39. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +2 -3
  40. package/legacy/MobileTimePicker/MobileTimePicker.js +2 -3
  41. package/legacy/MonthCalendar/MonthCalendar.js +8 -2
  42. package/legacy/MonthCalendar/PickersMonth.js +5 -1
  43. package/legacy/TimeClock/Clock.js +31 -8
  44. package/legacy/TimeClock/clockClasses.js +1 -1
  45. package/legacy/TimeField/TimeField.js +2 -3
  46. package/legacy/TimePicker/TimePicker.js +2 -3
  47. package/legacy/YearCalendar/PickersYear.js +2 -0
  48. package/legacy/YearCalendar/YearCalendar.js +6 -2
  49. package/legacy/index.js +1 -1
  50. package/legacy/internals/components/PickersPopper.js +3 -3
  51. package/legacy/internals/hooks/useField/useField.utils.js +16 -8
  52. package/legacy/locales/fiFI.js +25 -11
  53. package/locales/fiFI.js +9 -11
  54. package/modern/DateCalendar/DateCalendar.js +2 -2
  55. package/modern/DateField/DateField.js +2 -3
  56. package/modern/DatePicker/DatePicker.js +2 -3
  57. package/modern/DateTimeField/DateTimeField.js +2 -3
  58. package/modern/DateTimePicker/DateTimePicker.js +2 -3
  59. package/modern/DesktopDatePicker/DesktopDatePicker.js +2 -3
  60. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -3
  61. package/modern/DesktopTimePicker/DesktopTimePicker.js +2 -3
  62. package/modern/MobileDatePicker/MobileDatePicker.js +2 -3
  63. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +2 -3
  64. package/modern/MobileTimePicker/MobileTimePicker.js +2 -3
  65. package/modern/MonthCalendar/MonthCalendar.js +9 -3
  66. package/modern/MonthCalendar/PickersMonth.js +7 -2
  67. package/modern/TimeClock/Clock.js +29 -8
  68. package/modern/TimeClock/clockClasses.js +1 -1
  69. package/modern/TimeField/TimeField.js +2 -3
  70. package/modern/TimePicker/TimePicker.js +2 -3
  71. package/modern/YearCalendar/PickersYear.js +3 -0
  72. package/modern/YearCalendar/YearCalendar.js +7 -3
  73. package/modern/index.js +1 -1
  74. package/modern/internals/components/PickersPopper.js +3 -3
  75. package/modern/internals/hooks/useField/useField.utils.js +8 -3
  76. package/modern/locales/fiFI.js +9 -11
  77. package/node/DateCalendar/DateCalendar.js +2 -2
  78. package/node/DateField/DateField.js +2 -3
  79. package/node/DatePicker/DatePicker.js +4 -5
  80. package/node/DateTimeField/DateTimeField.js +2 -3
  81. package/node/DateTimePicker/DateTimePicker.js +4 -5
  82. package/node/DesktopDatePicker/DesktopDatePicker.js +2 -3
  83. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -3
  84. package/node/DesktopTimePicker/DesktopTimePicker.js +2 -3
  85. package/node/MobileDatePicker/MobileDatePicker.js +2 -3
  86. package/node/MobileDateTimePicker/MobileDateTimePicker.js +2 -3
  87. package/node/MobileTimePicker/MobileTimePicker.js +2 -3
  88. package/node/MonthCalendar/MonthCalendar.js +9 -3
  89. package/node/MonthCalendar/PickersMonth.js +7 -2
  90. package/node/TimeClock/Clock.js +28 -7
  91. package/node/TimeClock/clockClasses.js +1 -1
  92. package/node/TimeField/TimeField.js +2 -3
  93. package/node/TimePicker/TimePicker.js +4 -5
  94. package/node/YearCalendar/PickersYear.js +3 -0
  95. package/node/YearCalendar/YearCalendar.js +7 -3
  96. package/node/index.js +1 -1
  97. package/node/internals/components/PickersPopper.js +2 -2
  98. package/node/internals/hooks/useField/useField.utils.js +8 -3
  99. package/node/locales/fiFI.js +9 -11
  100. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -3,6 +3,166 @@
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.15.0
7
+
8
+ _Sep 22, 2023_
9
+
10
+ We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🚀 Implement columns auto-sizing (#10180) @romgrk
13
+ - 🎁 Add support for `getRowsToExport` option to print export on the data grid (#10084) @zreecespieces
14
+ - 🌍 Improve Finnish (fi-FI) locale
15
+ - 🐞 Bugfixes
16
+ - 📚 Documentation improvements
17
+
18
+ ### Data Grid
19
+
20
+ #### `@mui/x-data-grid@6.15.0`
21
+
22
+ - [DataGrid] Add support for `getRowsToExport` option to print export (#10084) @zreecespieces
23
+ - [DataGrid] Fix dev warning about `InputLabelProps` (#10413) @romgrk
24
+ - [DataGrid] Refactor `GridMenu` prop `onClickAway` to `onClose` (#10411) @romgrk
25
+ - [DataGrid] Restore focus after `GridMenu` closes (#10412) @romgrk
26
+ - [DataGrid] Fix typing of `GridActionsCellItem` (#10344) @romgrk
27
+ - [DataGrid] Hide `eval` from bundlers (#10329) @romgrk
28
+ - [DataGrid] Add `border: 0` to unmounted focused cell to avoid layout shifts in that row (#10318) @lauri865
29
+
30
+ #### `@mui/x-data-grid-pro@6.15.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
31
+
32
+ Same changes as in `@mui/x-data-grid@6.15.0`, plus:
33
+
34
+ - [DataGridPro] Implement columns auto-sizing (#10180) @romgrk
35
+ - [DataGridPro] Fix keyboard navigation issue in header filters (#10358) @MBilalShafi
36
+ - [DataGridPro] Add missing row hover styles (#10252) @cherniavskii
37
+ - [DataGridPro] Make default filter items have stable references in header filters (#10338) @MBilalShafi
38
+
39
+ #### `@mui/x-data-grid-premium@6.15.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
40
+
41
+ Same changes as in `@mui/x-data-grid-pro@6.15.0`.
42
+
43
+ ### Date Pickers
44
+
45
+ #### `@mui/x-date-pickers@6.15.0`
46
+
47
+ - [pickers] Support tokens without spaces (#10185) @alexfauquette
48
+ - [l10n] Improve Finnish (fi-FI) locale (#10346) @samijouppila
49
+
50
+ #### `@mui/x-date-pickers-pro@6.15.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
51
+
52
+ Same changes as in `@mui/x-date-pickers@6.15.0`.
53
+
54
+ ### Charts / `@mui/x-charts@6.0.0-alpha.12`
55
+
56
+ - [charts] Fix sparkline scale and rendering (#10402) @alexfauquette
57
+ - [charts] Remove components from `@mui/material` (#10115) @alexfauquette
58
+
59
+ ### Tree View / `@mui/x-tree-view@6.0.0-alpha.4`
60
+
61
+ - [TreeView] Split features into plugins to prepare for Pro version (#10123) @flaviendelangle
62
+
63
+ ### Docs
64
+
65
+ - [docs] Add charts documentation pages to complete pricing table (#10394) @alexfauquette
66
+ - [docs] Add missing MIT packages on the Licensing page (#10348) @flaviendelangle
67
+ - [docs] Clearer component pattern @oliviertassinari
68
+ - [docs] Easier to understand demo (#10370) @oliviertassinari
69
+ - [docs] Fix `301` to Material UI @oliviertassinari
70
+ - [docs] Improve the column visibility section (#10327) @MBilalShafi
71
+ - [docs] Improve the documentation section `rowIdentifier` (#10326) @MBilalShafi
72
+ - [docs] Improve pickers localization documentation (#10202) @flaviendelangle
73
+ - [docs] Polish typescript ref usage (#10359) @oliviertassinari
74
+ - [docs] Improve charts tooltip wording (#10406) @alexfauquette
75
+
76
+ ### Core
77
+
78
+ - [core] Cleanup GitHub issues template (#10372) @romgrk
79
+ - [core] Fix Circle CI OOM (#10385) @romgrk
80
+ - [core] Improve sleep test helper @oliviertassinari
81
+ - [core] Remove unwanted prefixes @oliviertassinari
82
+ - [core] Remove duplicate label @oliviertassinari
83
+ - [core] Simplify source @oliviertassinari
84
+ - [core] Upgrade monorepo (#10425) @cherniavskii
85
+ - [core] Upgrade monorepo to have the new typescript-to-proptype (#10224) @flaviendelangle
86
+ - [test] Do not use deprecated adapter methods (#10416) @flaviendelangle
87
+ - [test] Name test suites according to sentence case (#10429) @alexfauquette
88
+
89
+ ## 6.14.0
90
+
91
+ _Sep 14, 2023_
92
+
93
+ We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
94
+
95
+ - 🎁 Fix `YearCalendar` and `MonthCalendar` accessibility (#10312) @LukasTy
96
+
97
+ The `YearCalendar` and `MonthCalendar` items role has been changed from `button` to `radio` in order to improve the component's a11y support.
98
+ If you were relying on the mentioned components having a `button` role for items, you will need to update your usage to expect a `radio` role instead.
99
+
100
+ - 🌍 Improve Japanese (ja-JP), Persian (fa-IR), and Vietnamese (vi-VN) locales on the data grid
101
+ - 🐞 Bugfixes
102
+ - 📚 Documentation improvements
103
+
104
+ ### Data Grid
105
+
106
+ #### `@mui/x-data-grid@6.14.0`
107
+
108
+ - [l10n] Improve Japanese (ja-JP) locale (#10299) @makoto14
109
+ - [l10n] Improve Persian (fa-IR) locale (#10277) @aminsaedi
110
+ - [l10n] Improve Vietnamese (vi-VN) locale (#10280) @khangnguyen2100
111
+
112
+ #### `@mui/x-data-grid-pro@6.14.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
113
+
114
+ Same changes as in `@mui/x-data-grid@6.14.0`.
115
+
116
+ #### `@mui/x-data-grid-premium@6.14.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
117
+
118
+ Same changes as in `@mui/x-data-grid-pro@6.14.0`, plus:
119
+
120
+ - [DataGridPremium] Fix clipboard import cutting off at 100 rows (#9930) @gitstart
121
+
122
+ ### Date Pickers
123
+
124
+ #### `@mui/x-date-pickers@6.14.0`
125
+
126
+ - [pickers] Fix `YearCalendar` and `MonthCalendar` a11y (#10312) @LukasTy
127
+ - [pickers] Localize `TimeClock` meridiem text (#10324) @LukasTy
128
+
129
+ #### `@mui/x-date-pickers-pro@6.14.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
130
+
131
+ Same changes as in `@mui/x-date-pickers@6.14.0`.
132
+
133
+ ### Charts / `@mui/x-charts@6.0.0-alpha.11`
134
+
135
+ - [charts] Add default `barGapRatio` and increase `categoryGapRatio` (#10317) @LukasTy
136
+ - [charts] Enable `eslint` on the package (#10330) @LukasTy
137
+
138
+ ### Tree View / `@mui/x-tree-view@6.0.0-alpha.3`
139
+
140
+ - [TreeView] Fix box-sizing dependency (#10255) @oliviertassinari
141
+
142
+ ### Docs
143
+
144
+ - [docs] Add conditional range picker props example (#10227) @LukasTy
145
+ - [docs] Add toolbar to the multi-filters demo (#10223) @MBilalShafi
146
+ - [docs] Avoid the use of "We" @oliviertassinari
147
+ - [docs] Clarify MUI vs. MUI Core difference @oliviertassinari
148
+ - [docs] Enable `ariaV7` flag for demos using `useDemoData` hook (#10204) @cherniavskii
149
+ - [docs] Fix Tree View link to API references (#10282) @oliviertassinari
150
+ - [docs] Fix image layout shift (#10313) @oliviertassinari
151
+ - [docs] Fix link to MUI X from readme logo @oliviertassinari
152
+ - [docs] Fix redirection to Base UI URLs @oliviertassinari
153
+ - [docs] Improve Tree View demos (#10268) @oliviertassinari
154
+ - [docs] Improve docs for ref type props (#10273) @michelengelen
155
+ - [docs] Improve npm package README (#10269) @oliviertassinari
156
+ - [docs] Improve the clarity of the npm links @oliviertassinari
157
+ - [docs] Keep installation readme simple @oliviertassinari
158
+ - [docs] Make each component feel more standalone @oliviertassinari
159
+
160
+ ### Core
161
+
162
+ - [core] Add types extension for clarity @oliviertassinari
163
+ - [core] Set logo height to fix layout shift in GitHub @oliviertassinari
164
+ - [core] TrapFocus was renamed to FocusTrap @oliviertassinari
165
+
6
166
  ## 6.13.0
7
167
 
8
168
  _Sep 8, 2023_
@@ -12,6 +172,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
12
172
  - 🎁 Fix `anchorRef` behavior on range pickers (#10077) @LukasTy
13
173
 
14
174
  The range picker popup will now be anchored to the first input element and left aligned like other pickers.
175
+
15
176
  - 🌍 Improve Slovak (sk-SK) locale on the data grid
16
177
  - 🐞 Bugfixes
17
178
  - 📚 Documentation improvements
@@ -1838,7 +1999,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
1838
1999
  #### Changes
1839
2000
 
1840
2001
  - [DataGrid] Add interface for `singleSelect` column (#7685) @m4theushw
1841
- - [DataGrid] Allow to pass props to the `TrapFocus` inside the panel wrapper (#7733) @ivek-Prajapatii
2002
+ - [DataGrid] Allow to pass props to the `FocusTrap` inside the panel wrapper (#7733) @ivek-Prajapatii
1842
2003
  - [DataGrid] Avoid unnecessary rerenders after `updateRows` (#7857) @cherniavskii
1843
2004
  - [DataGridPro] Change cursor when dragging a column (#7725) @sai6855
1844
2005
  - [DataGridPremium] Fix `leafField` to have correct focus value (#7950) @MBilalShafi
@@ -277,7 +277,8 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
277
277
  disableHighlightToday,
278
278
  readOnly,
279
279
  disabled,
280
- timezone
280
+ timezone,
281
+ gridLabelId
281
282
  };
282
283
  const prevOpenViewRef = React.useRef(view);
283
284
  React.useEffect(() => {
@@ -331,7 +332,6 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
331
332
  shouldDisableYear: shouldDisableYear,
332
333
  hasFocus: hasFocus,
333
334
  onFocusedViewChange: isViewFocused => setFocusedView('day', isViewFocused),
334
- gridLabelId: gridLabelId,
335
335
  showDaysOutsideCurrentMonth: showDaysOutsideCurrentMonth,
336
336
  fixedWeekNumber: fixedWeekNumber,
337
337
  dayOfWeekFormatter: dayOfWeekFormatter,
@@ -8,6 +8,7 @@ import PropTypes from 'prop-types';
8
8
  import MuiTextField from '@mui/material/TextField';
9
9
  import { useThemeProps } from '@mui/material/styles';
10
10
  import { useSlotProps } from '@mui/base/utils';
11
+ import { refType } from '@mui/utils';
11
12
  import { useDateField } from './useDateField';
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
14
  const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref) {
@@ -175,9 +176,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
175
176
  /**
176
177
  * Pass a ref to the `input` element.
177
178
  */
178
- inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
179
- current: PropTypes.any.isRequired
180
- })]),
179
+ inputRef: refType,
181
180
  /**
182
181
  * The label content.
183
182
  */
@@ -5,6 +5,7 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import useMediaQuery from '@mui/material/useMediaQuery';
7
7
  import { useThemeProps } from '@mui/material/styles';
8
+ import { refType } from '@mui/utils';
8
9
  import { DesktopDatePicker } from '../DesktopDatePicker';
9
10
  import { MobileDatePicker } from '../MobileDatePicker';
10
11
  import { DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from '../internals/utils/utils';
@@ -136,9 +137,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
136
137
  /**
137
138
  * Pass a ref to the `input` element.
138
139
  */
139
- inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
140
- current: PropTypes.object
141
- })]),
140
+ inputRef: refType,
142
141
  /**
143
142
  * The label content.
144
143
  */
@@ -8,6 +8,7 @@ import PropTypes from 'prop-types';
8
8
  import MuiTextField from '@mui/material/TextField';
9
9
  import { useThemeProps } from '@mui/material/styles';
10
10
  import { useSlotProps } from '@mui/base/utils';
11
+ import { refType } from '@mui/utils';
11
12
  import { useDateTimeField } from './useDateTimeField';
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
14
  const DateTimeField = /*#__PURE__*/React.forwardRef(function DateTimeField(inProps, ref) {
@@ -185,9 +186,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
185
186
  /**
186
187
  * Pass a ref to the `input` element.
187
188
  */
188
- inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
189
- current: PropTypes.any.isRequired
190
- })]),
189
+ inputRef: refType,
191
190
  /**
192
191
  * The label content.
193
192
  */
@@ -5,6 +5,7 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import useMediaQuery from '@mui/material/useMediaQuery';
7
7
  import { useThemeProps } from '@mui/material/styles';
8
+ import { refType } from '@mui/utils';
8
9
  import { DesktopDateTimePicker } from '../DesktopDateTimePicker';
9
10
  import { MobileDateTimePicker } from '../MobileDateTimePicker';
10
11
  import { DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from '../internals/utils/utils';
@@ -151,9 +152,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
151
152
  /**
152
153
  * Pass a ref to the `input` element.
153
154
  */
154
- inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
155
- current: PropTypes.object
156
- })]),
155
+ inputRef: refType,
157
156
  /**
158
157
  * The label content.
159
158
  */
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { resolveComponentProps } from '@mui/base/utils';
5
+ import { refType } from '@mui/utils';
5
6
  import { singleItemValueManager } from '../internals/utils/valueManagers';
6
7
  import { useDatePickerDefaultizedProps } from '../DatePicker/shared';
7
8
  import { useLocaleText, useUtils, validateDate } from '../internals';
@@ -154,9 +155,7 @@ DesktopDatePicker.propTypes = {
154
155
  /**
155
156
  * Pass a ref to the `input` element.
156
157
  */
157
- inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
158
- current: PropTypes.object
159
- })]),
158
+ inputRef: refType,
160
159
  /**
161
160
  * The label content.
162
161
  */
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { resolveComponentProps } from '@mui/base/utils';
5
+ import { refType } from '@mui/utils';
5
6
  import { singleItemValueManager } from '../internals/utils/valueManagers';
6
7
  import { DateTimeField } from '../DateTimeField';
7
8
  import { useDateTimePickerDefaultizedProps } from '../DateTimePicker/shared';
@@ -205,9 +206,7 @@ DesktopDateTimePicker.propTypes = {
205
206
  /**
206
207
  * Pass a ref to the `input` element.
207
208
  */
208
- inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
209
- current: PropTypes.object
210
- })]),
209
+ inputRef: refType,
211
210
  /**
212
211
  * The label content.
213
212
  */
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { resolveComponentProps } from '@mui/base/utils';
5
+ import { refType } from '@mui/utils';
5
6
  import { singleItemValueManager } from '../internals/utils/valueManagers';
6
7
  import { TimeField } from '../TimeField';
7
8
  import { useTimePickerDefaultizedProps } from '../TimePicker/shared';
@@ -166,9 +167,7 @@ DesktopTimePicker.propTypes = {
166
167
  /**
167
168
  * Pass a ref to the `input` element.
168
169
  */
169
- inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
170
- current: PropTypes.object
171
- })]),
170
+ inputRef: refType,
172
171
  /**
173
172
  * The label content.
174
173
  */
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { resolveComponentProps } from '@mui/base/utils';
5
+ import { refType } from '@mui/utils';
5
6
  import { useMobilePicker } from '../internals/hooks/useMobilePicker';
6
7
  import { useDatePickerDefaultizedProps } from '../DatePicker/shared';
7
8
  import { useLocaleText, useUtils, validateDate } from '../internals';
@@ -151,9 +152,7 @@ MobileDatePicker.propTypes = {
151
152
  /**
152
153
  * Pass a ref to the `input` element.
153
154
  */
154
- inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
155
- current: PropTypes.object
156
- })]),
155
+ inputRef: refType,
157
156
  /**
158
157
  * The label content.
159
158
  */
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { resolveComponentProps } from '@mui/base/utils';
5
+ import { refType } from '@mui/utils';
5
6
  import { singleItemValueManager } from '../internals/utils/valueManagers';
6
7
  import { DateTimeField } from '../DateTimeField';
7
8
  import { useDateTimePickerDefaultizedProps } from '../DateTimePicker/shared';
@@ -177,9 +178,7 @@ MobileDateTimePicker.propTypes = {
177
178
  /**
178
179
  * Pass a ref to the `input` element.
179
180
  */
180
- inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
181
- current: PropTypes.object
182
- })]),
181
+ inputRef: refType,
183
182
  /**
184
183
  * The label content.
185
184
  */
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { resolveComponentProps } from '@mui/base/utils';
5
+ import { refType } from '@mui/utils';
5
6
  import { singleItemValueManager } from '../internals/utils/valueManagers';
6
7
  import { TimeField } from '../TimeField';
7
8
  import { useTimePickerDefaultizedProps } from '../TimePicker/shared';
@@ -144,9 +145,7 @@ MobileTimePicker.propTypes = {
144
145
  /**
145
146
  * Pass a ref to the `input` element.
146
147
  */
147
- inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
148
- current: PropTypes.object
149
- })]),
148
+ inputRef: refType,
150
149
  /**
151
150
  * The label content.
152
151
  */
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "shouldDisableMonth", "readOnly", "disableHighlightToday", "autoFocus", "onMonthFocus", "hasFocus", "onFocusedViewChange", "monthsPerRow", "timezone"];
3
+ const _excluded = ["className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "shouldDisableMonth", "readOnly", "disableHighlightToday", "autoFocus", "onMonthFocus", "hasFocus", "onFocusedViewChange", "monthsPerRow", "timezone", "gridLabelId"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
@@ -71,7 +71,8 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
71
71
  hasFocus,
72
72
  onFocusedViewChange,
73
73
  monthsPerRow = 3,
74
- timezone: timezoneProp
74
+ timezone: timezoneProp,
75
+ gridLabelId
75
76
  } = props,
76
77
  other = _objectWithoutPropertiesLoose(props, _excluded);
77
78
  const {
@@ -193,11 +194,14 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
193
194
  return /*#__PURE__*/_jsx(MonthCalendarRoot, _extends({
194
195
  ref: ref,
195
196
  className: clsx(classes.root, className),
196
- ownerState: ownerState
197
+ ownerState: ownerState,
198
+ role: "radiogroup",
199
+ "aria-labelledby": gridLabelId
197
200
  }, other, {
198
201
  children: getMonthsInYear(utils, value != null ? value : referenceDate).map(month => {
199
202
  const monthNumber = utils.getMonth(month);
200
203
  const monthText = utils.format(month, 'monthShort');
204
+ const monthLabel = utils.format(month, 'month');
201
205
  const isSelected = monthNumber === selectedMonth;
202
206
  const isDisabled = disabled || isMonthDisabled(month);
203
207
  return /*#__PURE__*/_jsx(PickersMonth, {
@@ -211,6 +215,7 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
211
215
  onFocus: handleMonthFocus,
212
216
  onBlur: handleMonthBlur,
213
217
  "aria-current": todayMonth === monthNumber ? 'date' : undefined,
218
+ "aria-label": monthLabel,
214
219
  monthsPerRow: monthsPerRow,
215
220
  children: monthText
216
221
  }, monthText);
@@ -255,6 +260,7 @@ process.env.NODE_ENV !== "production" ? MonthCalendar.propTypes = {
255
260
  * @default false
256
261
  */
257
262
  disablePast: PropTypes.bool,
263
+ gridLabelId: PropTypes.string,
258
264
  hasFocus: PropTypes.bool,
259
265
  /**
260
266
  * Maximal selectable date.
@@ -57,4 +57,5 @@ export interface MonthCalendarProps<TDate> extends ExportedMonthCalendarProps, M
57
57
  onMonthFocus?: (month: number) => void;
58
58
  hasFocus?: boolean;
59
59
  onFocusedViewChange?: (hasFocus: boolean) => void;
60
+ gridLabelId?: string;
60
61
  }
@@ -5,6 +5,7 @@ export interface ExportedPickersMonthProps {
5
5
  }
6
6
  export interface PickersMonthProps extends ExportedPickersMonthProps {
7
7
  'aria-current'?: React.AriaAttributes['aria-current'];
8
+ 'aria-label'?: React.AriaAttributes['aria-label'];
8
9
  autoFocus: boolean;
9
10
  children: React.ReactNode;
10
11
  disabled?: boolean;
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["autoFocus", "children", "disabled", "selected", "value", "tabIndex", "onClick", "onKeyDown", "onFocus", "onBlur", "aria-current", "monthsPerRow"];
3
+ const _excluded = ["autoFocus", "children", "disabled", "selected", "value", "tabIndex", "onClick", "onKeyDown", "onFocus", "onBlur", "aria-current", "aria-label", "monthsPerRow"];
4
4
  import * as React from 'react';
5
5
  import { styled, alpha, useThemeProps } from '@mui/material/styles';
6
6
  import { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
@@ -85,13 +85,15 @@ export const PickersMonth = /*#__PURE__*/React.memo(function PickersMonth(inProp
85
85
  autoFocus,
86
86
  children,
87
87
  disabled,
88
+ selected,
88
89
  value,
89
90
  tabIndex,
90
91
  onClick,
91
92
  onKeyDown,
92
93
  onFocus,
93
94
  onBlur,
94
- 'aria-current': ariaCurrent
95
+ 'aria-current': ariaCurrent,
96
+ 'aria-label': ariaLabel
95
97
  // We don't want to forward this prop to the root element
96
98
  } = props,
97
99
  other = _objectWithoutPropertiesLoose(props, _excluded);
@@ -111,8 +113,11 @@ export const PickersMonth = /*#__PURE__*/React.memo(function PickersMonth(inProp
111
113
  ref: ref,
112
114
  disabled: disabled,
113
115
  type: "button",
116
+ role: "radio",
114
117
  tabIndex: disabled ? -1 : tabIndex,
115
118
  "aria-current": ariaCurrent,
119
+ "aria-checked": selected,
120
+ "aria-label": ariaLabel,
116
121
  onClick: event => onClick(event, value),
117
122
  onKeyDown: event => onKeyDown(event, value),
118
123
  onFocus: event => onFocus(event, value),
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # @mui/x-date-pickers
1
+ # MUI X Date Pickers
2
2
 
3
3
  This package is the community edition of the date and time picker components.
4
- It's part of MUI X, an open-core extension of MUI, with advanced components.
4
+ It's part of [MUI X](https://mui.com/x/), an open-core extension of MUI Core, with advanced components.
5
5
 
6
6
  ## Installation
7
7
 
@@ -12,7 +12,7 @@ npm install @mui/x-date-pickers
12
12
  ```
13
13
 
14
14
  Then install the date library of your choice (if not already installed).
15
- We currently support 4 different date libraries:
15
+ The pickers currently support the following date libraries:
16
16
 
17
17
  - [date-fns](https://date-fns.org/)
18
18
  - [Day.js](https://day.js.org/)
@@ -62,4 +62,4 @@ function App({ children }) {
62
62
 
63
63
  ## Documentation
64
64
 
65
- [The documentation](https://mui.com/x/react-date-pickers/getting-started/)
65
+ Visit [https://mui.com/x/react-date-pickers/](https://mui.com/x/react-date-pickers/) to view the full documentation.
@@ -7,8 +7,9 @@ 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';
9
9
  import { useLocaleText, useUtils } from '../internals/hooks/useUtils';
10
- import { getHours, getMinutes } from './shared';
10
+ import { CLOCK_HOUR_WIDTH, getHours, getMinutes } from './shared';
11
11
  import { getClockUtilityClass } from './clockClasses';
12
+ import { formatMeridiem } from '../internals/utils/date-utils';
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
15
  const useUtilityClasses = ownerState => {
@@ -22,7 +23,8 @@ const useUtilityClasses = ownerState => {
22
23
  squareMask: ['squareMask'],
23
24
  pin: ['pin'],
24
25
  amButton: ['amButton'],
25
- pmButton: ['pmButton']
26
+ pmButton: ['pmButton'],
27
+ meridiemText: ['meridiemText']
26
28
  };
27
29
  return composeClasses(slots, getClockUtilityClass, classes);
28
30
  };
@@ -111,7 +113,10 @@ const ClockAmButton = styled(IconButton, {
111
113
  zIndex: 1,
112
114
  position: 'absolute',
113
115
  bottom: 8,
114
- left: 8
116
+ left: 8,
117
+ paddingLeft: 4,
118
+ paddingRight: 4,
119
+ width: CLOCK_HOUR_WIDTH
115
120
  }, ownerState.meridiemMode === 'am' && {
116
121
  backgroundColor: (theme.vars || theme).palette.primary.main,
117
122
  color: (theme.vars || theme).palette.primary.contrastText,
@@ -130,7 +135,10 @@ const ClockPmButton = styled(IconButton, {
130
135
  zIndex: 1,
131
136
  position: 'absolute',
132
137
  bottom: 8,
133
- right: 8
138
+ right: 8,
139
+ paddingLeft: 4,
140
+ paddingRight: 4,
141
+ width: CLOCK_HOUR_WIDTH
134
142
  }, ownerState.meridiemMode === 'pm' && {
135
143
  backgroundColor: (theme.vars || theme).palette.primary.main,
136
144
  color: (theme.vars || theme).palette.primary.contrastText,
@@ -138,6 +146,15 @@ const ClockPmButton = styled(IconButton, {
138
146
  backgroundColor: (theme.vars || theme).palette.primary.light
139
147
  }
140
148
  }));
149
+ const ClockMeridiemText = styled(Typography, {
150
+ name: 'MuiClock',
151
+ slot: 'meridiemText',
152
+ overridesResolver: (_, styles) => styles.meridiemText
153
+ })({
154
+ overflow: 'hidden',
155
+ whiteSpace: 'nowrap',
156
+ textOverflow: 'ellipsis'
157
+ });
141
158
 
142
159
  /**
143
160
  * @ignore - internal component.
@@ -298,18 +315,22 @@ export function Clock(inProps) {
298
315
  disabled: disabled || meridiemMode === null,
299
316
  ownerState: ownerState,
300
317
  className: classes.amButton,
301
- children: /*#__PURE__*/_jsx(Typography, {
318
+ title: formatMeridiem(utils, 'am'),
319
+ children: /*#__PURE__*/_jsx(ClockMeridiemText, {
302
320
  variant: "caption",
303
- children: "AM"
321
+ className: classes.meridiemText,
322
+ children: formatMeridiem(utils, 'am')
304
323
  })
305
324
  }), /*#__PURE__*/_jsx(ClockPmButton, {
306
325
  disabled: disabled || meridiemMode === null,
307
326
  onClick: readOnly ? undefined : () => handleMeridiemChange('pm'),
308
327
  ownerState: ownerState,
309
328
  className: classes.pmButton,
310
- children: /*#__PURE__*/_jsx(Typography, {
329
+ title: formatMeridiem(utils, 'pm'),
330
+ children: /*#__PURE__*/_jsx(ClockMeridiemText, {
311
331
  variant: "caption",
312
- children: "PM"
332
+ className: classes.meridiemText,
333
+ children: formatMeridiem(utils, 'pm')
313
334
  })
314
335
  })]
315
336
  })]
@@ -13,6 +13,8 @@ export interface ClockClasses {
13
13
  amButton: string;
14
14
  /** Styles applied to the pm button element. */
15
15
  pmButton: string;
16
+ /** Styles applied to the meridiem typography element. */
17
+ meridiemText: string;
16
18
  }
17
19
  export type ClockClassKey = keyof ClockClasses;
18
20
  export declare function getClockUtilityClass(slot: string): string;
@@ -2,4 +2,4 @@ import { unstable_generateUtilityClass as generateUtilityClass, unstable_generat
2
2
  export function getClockUtilityClass(slot) {
3
3
  return generateUtilityClass('MuiClock', slot);
4
4
  }
5
- export const clockClasses = generateUtilityClasses('MuiClock', ['root', 'clock', 'wrapper', 'squareMask', 'pin', 'amButton', 'pmButton']);
5
+ export const clockClasses = generateUtilityClasses('MuiClock', ['root', 'clock', 'wrapper', 'squareMask', 'pin', 'amButton', 'pmButton', 'meridiemText']);
@@ -8,6 +8,7 @@ import PropTypes from 'prop-types';
8
8
  import MuiTextField from '@mui/material/TextField';
9
9
  import { useThemeProps } from '@mui/material/styles';
10
10
  import { useSlotProps } from '@mui/base/utils';
11
+ import { refType } from '@mui/utils';
11
12
  import { useTimeField } from './useTimeField';
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
14
  const TimeField = /*#__PURE__*/React.forwardRef(function TimeField(inProps, ref) {
@@ -185,9 +186,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
185
186
  /**
186
187
  * Pass a ref to the `input` element.
187
188
  */
188
- inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
189
- current: PropTypes.any.isRequired
190
- })]),
189
+ inputRef: refType,
191
190
  /**
192
191
  * The label content.
193
192
  */