@mui/x-date-pickers 6.19.4 → 6.19.5

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 (47) hide show
  1. package/CHANGELOG.md +71 -10
  2. package/DateCalendar/DateCalendar.js +3 -0
  3. package/DateCalendar/DateCalendar.types.d.ts +3 -0
  4. package/DateCalendar/DayCalendar.d.ts +3 -0
  5. package/DateCalendar/PickersFadeTransitionGroup.d.ts +3 -0
  6. package/DateCalendar/PickersSlideTransition.d.ts +3 -0
  7. package/DateCalendar/useCalendarState.js +2 -3
  8. package/DatePicker/DatePickerToolbar.d.ts +5 -4
  9. package/DatePicker/DatePickerToolbar.js +11 -3
  10. package/DateTimePicker/DateTimePickerTabs.d.ts +2 -2
  11. package/DateTimePicker/DateTimePickerTabs.js +7 -1
  12. package/DateTimePicker/DateTimePickerToolbar.d.ts +2 -2
  13. package/DateTimePicker/DateTimePickerToolbar.js +3 -0
  14. package/PickersLayout/PickersLayout.js +6 -0
  15. package/PickersLayout/PickersLayout.types.d.ts +6 -0
  16. package/TimePicker/TimePickerToolbar.d.ts +5 -4
  17. package/TimePicker/TimePickerToolbar.js +11 -3
  18. package/index.js +1 -1
  19. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +3 -0
  20. package/internals/components/PickersPopper.d.ts +3 -0
  21. package/internals/models/props/tabs.d.ts +6 -0
  22. package/internals/models/props/toolbar.d.ts +3 -0
  23. package/legacy/DateCalendar/DateCalendar.js +3 -0
  24. package/legacy/DateCalendar/useCalendarState.js +2 -3
  25. package/legacy/DatePicker/DatePickerToolbar.js +10 -2
  26. package/legacy/DateTimePicker/DateTimePickerTabs.js +7 -1
  27. package/legacy/DateTimePicker/DateTimePickerToolbar.js +3 -0
  28. package/legacy/PickersLayout/PickersLayout.js +6 -0
  29. package/legacy/TimePicker/TimePickerToolbar.js +10 -2
  30. package/legacy/index.js +1 -1
  31. package/modern/DateCalendar/DateCalendar.js +3 -0
  32. package/modern/DateCalendar/useCalendarState.js +2 -3
  33. package/modern/DatePicker/DatePickerToolbar.js +11 -3
  34. package/modern/DateTimePicker/DateTimePickerTabs.js +7 -1
  35. package/modern/DateTimePicker/DateTimePickerToolbar.js +3 -0
  36. package/modern/PickersLayout/PickersLayout.js +6 -0
  37. package/modern/TimePicker/TimePickerToolbar.js +11 -3
  38. package/modern/index.js +1 -1
  39. package/node/DateCalendar/DateCalendar.js +3 -0
  40. package/node/DateCalendar/useCalendarState.js +1 -2
  41. package/node/DatePicker/DatePickerToolbar.js +11 -3
  42. package/node/DateTimePicker/DateTimePickerTabs.js +7 -1
  43. package/node/DateTimePicker/DateTimePickerToolbar.js +3 -0
  44. package/node/PickersLayout/PickersLayout.js +6 -0
  45. package/node/TimePicker/TimePickerToolbar.js +11 -3
  46. package/node/index.js +1 -1
  47. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -3,7 +3,68 @@
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
- ## v6.19.4
6
+ ## 6.19.5
7
+
8
+ _Feb 23, 2024_
9
+
10
+ We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🐞 Bugfixes
13
+ - 📚 Documentation improvements
14
+
15
+ ### Data Grid
16
+
17
+ #### `@mui/x-data-grid@6.19.5`
18
+
19
+ - [DataGrid] Fix styling grid filter input single select (#12079) @FreakDroid
20
+
21
+ #### `@mui/x-data-grid-pro@6.19.5` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
22
+
23
+ Same changes as in `@mui/x-data-grid@6.19.5`.
24
+
25
+ #### `@mui/x-data-grid-premium@6.19.5` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
26
+
27
+ Same changes as in `@mui/x-data-grid-pro@6.19.5`.
28
+
29
+ ### Date Pickers
30
+
31
+ #### `@mui/x-date-pickers@6.19.5`
32
+
33
+ - [pickers] Fix `referenceDate` day calendar focus (#12136) @LukasTy
34
+ - [pickers] Fix styling props propagation to `DateTimePickerTabs` (#12131) @LukasTy
35
+
36
+ #### `@mui/x-date-pickers-pro@6.19.5` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
37
+
38
+ Same changes as in `@mui/x-date-pickers@6.19.5`.
39
+
40
+ ### Charts / `@mui/x-charts@6.19.5`
41
+
42
+ - [charts] Allow to skip animation on sparkline bar (#12160) @alexfauquette
43
+
44
+ ### Docs
45
+
46
+ - [docs] Clarify Pickers 'Component composition' section (#12147) @LukasTy
47
+ - [docs] Fix 301 redirection to StackBlitz @oliviertassinari
48
+ - [docs] Fix 301 to Material UI @oliviertassinari
49
+ - [docs] Fix 301 to Material UI @oliviertassinari
50
+ - [docs] Fix 404 links to translation source @oliviertassinari
51
+ - [docs] Fix dead link to translations @oliviertassinari
52
+ - [docs] Fix the Treemap illustration (#12189) @danilo-leal
53
+ - [docs] Fix typo for `AdapterDateFnsV3` (#12037) @flaviendelangle
54
+ - [docs] Improve performance on Charts entry point @oliviertassinari
55
+ - [docs] Move Heatmap to pro (#12170) @alexfauquette
56
+ - [docs] Remove Charts installation next tag call-out (#12133) @LukasTy
57
+ - [docs] Removed `focused` prop from demo (#12126) @michelengelen
58
+ - [docs] Add missing Heatmap pro icon @oliviertassinari
59
+ - [docs] Add more illustrations to the Overview page (#12041) @danilo-leal
60
+ - [docs] Avoid use of shorthand (#12009) @oliviertassinari
61
+
62
+ ### Core
63
+
64
+ - [core] Fix CI @oliviertassinari
65
+ - [core] Fix docs link check (#12137) @LukasTy
66
+
67
+ ## 6.19.4
7
68
 
8
69
  _Feb 9, 2024_
9
70
 
@@ -15,7 +76,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
15
76
 
16
77
  ### Data Grid
17
78
 
18
- #### `@mui/x-data-grid@v6.19.4`
79
+ #### `@mui/x-data-grid@6.19.4`
19
80
 
20
81
  - [DataGrid] Add support for dialogs in menu actions (#11937) @cherniavskii
21
82
  - [DataGrid] Allow passing readonly arrays to `pageSizeOptions` prop (#11992) @pcorpet
@@ -23,28 +84,28 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
23
84
  - [DataGrid] Replace `eval` with `new Function` (#11962) @cherniavskii
24
85
  - [l10n] Improve Danish (da-DK) locale (#11972) @ShahrazH
25
86
 
26
- #### `@mui/x-data-grid-pro@v6.19.4` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
87
+ #### `@mui/x-data-grid-pro@6.19.4` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
27
88
 
28
- Same changes as in `@mui/x-data-grid@v6.19.4`.
89
+ Same changes as in `@mui/x-data-grid@6.19.4`.
29
90
 
30
- #### `@mui/x-data-grid-premium@v6.19.4` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
91
+ #### `@mui/x-data-grid-premium@6.19.4` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
31
92
 
32
- Same changes as in `@mui/x-data-grid-pro@v6.19.4`, plus:
93
+ Same changes as in `@mui/x-data-grid-pro@6.19.4`, plus:
33
94
 
34
95
  - [DataGridPremium] Fix autosize grouping cell (#11990) @romgrk
35
96
  - [DataGridPremium] Fix error after closing print export (#11889) @cherniavskii
36
97
 
37
98
  ### Date Pickers
38
99
 
39
- #### `@mui/x-date-pickers@v6.19.4`
100
+ #### `@mui/x-date-pickers@6.19.4`
40
101
 
41
102
  - [pickers] Avoid relying on locale in Luxon `isWithinRange` method (#11940) @LukasTy
42
103
 
43
- #### `@mui/x-date-pickers-pro@v6.19.4` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
104
+ #### `@mui/x-date-pickers-pro@6.19.4` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
44
105
 
45
- Same changes as in `@mui/x-date-pickers@v6.19.4`.
106
+ Same changes as in `@mui/x-date-pickers@6.19.4`.
46
107
 
47
- ### Charts / `@mui/x-charts@v6.19.4`
108
+ ### Charts / `@mui/x-charts@6.19.4`
48
109
 
49
110
  - [charts] Add `reverse` property to axes (#11959) @alexfauquette
50
111
  - [charts] Allow series ids to be numbers (#11960) @alexfauquette
@@ -362,6 +362,9 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
362
362
  * - the `input` element if there is a field rendered.
363
363
  */
364
364
  autoFocus: PropTypes.bool,
365
+ /**
366
+ * Override or extend the styles applied to the component.
367
+ */
365
368
  classes: PropTypes.object,
366
369
  className: PropTypes.string,
367
370
  /**
@@ -80,6 +80,9 @@ export interface DateCalendarProps<TDate> extends ExportedDateCalendarProps<TDat
80
80
  */
81
81
  referenceDate?: TDate;
82
82
  className?: string;
83
+ /**
84
+ * Override or extend the styles applied to the component.
85
+ */
83
86
  classes?: Partial<DateCalendarClasses>;
84
87
  /**
85
88
  * The system prop that allows defining system overrides as well as additional CSS styles.
@@ -72,6 +72,9 @@ export interface DayCalendarProps<TDate> extends ExportedDayCalendarProps<TDate>
72
72
  hasFocus?: boolean;
73
73
  onFocusedViewChange?: (newHasFocus: boolean) => void;
74
74
  gridLabelId?: string;
75
+ /**
76
+ * Override or extend the styles applied to the component.
77
+ */
75
78
  classes?: Partial<DayCalendarClasses>;
76
79
  }
77
80
  /**
@@ -5,6 +5,9 @@ export interface PickersFadeTransitionGroupProps {
5
5
  className?: string;
6
6
  reduceAnimations: boolean;
7
7
  transKey: React.Key;
8
+ /**
9
+ * Override or extend the styles applied to the component.
10
+ */
8
11
  classes?: Partial<PickersFadeTransitionGroupClasses>;
9
12
  }
10
13
  /**
@@ -3,6 +3,9 @@ import { CSSTransitionProps } from 'react-transition-group/CSSTransition';
3
3
  import { PickersSlideTransitionClasses } from './pickersSlideTransitionClasses';
4
4
  export type SlideDirection = 'right' | 'left';
5
5
  export interface ExportedSlideTransitionProps {
6
+ /**
7
+ * Override or extend the styles applied to the component.
8
+ */
6
9
  classes?: Partial<PickersSlideTransitionClasses>;
7
10
  }
8
11
  export interface SlideTransitionProps extends Omit<CSSTransitionProps, 'timeout'>, ExportedSlideTransitionProps {
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import useEventCallback from '@mui/utils/useEventCallback';
4
4
  import { useIsDateDisabled } from './useIsDateDisabled';
5
- import { useUtils, useNow } from '../internals/hooks/useUtils';
5
+ import { useUtils } from '../internals/hooks/useUtils';
6
6
  import { singleItemValueManager } from '../internals/utils/valueManagers';
7
7
  import { SECTION_TYPE_GRANULARITY } from '../internals/utils/getDefaultReferenceDate';
8
8
  export const createCalendarStateReducer = (reduceAnimations, disableSwitchToMonthOnDayFocus, utils) => (state, action) => {
@@ -49,7 +49,6 @@ export const useCalendarState = params => {
49
49
  shouldDisableDate,
50
50
  timezone
51
51
  } = params;
52
- const now = useNow(timezone);
53
52
  const utils = useUtils();
54
53
  const reducerFn = React.useRef(createCalendarStateReducer(Boolean(reduceAnimations), disableSwitchToMonthOnDayFocus, utils)).current;
55
54
  const referenceDate = React.useMemo(() => {
@@ -72,7 +71,7 @@ export const useCalendarState = params => {
72
71
  );
73
72
  const [calendarState, dispatch] = React.useReducer(reducerFn, {
74
73
  isMonthSwitchingAnimating: false,
75
- focusedDay: utils.isValid(value) ? value : now,
74
+ focusedDay: referenceDate,
76
75
  currentMonth: utils.startOfMonth(referenceDate),
77
76
  slideDirection: 'left'
78
77
  });
@@ -1,13 +1,14 @@
1
1
  import * as React from 'react';
2
- import { SxProps, Theme } from '@mui/material/styles';
3
2
  import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
4
3
  import { DateView } from '../models';
5
4
  import { DatePickerToolbarClasses } from './datePickerToolbarClasses';
6
- export interface DatePickerToolbarProps<TDate> extends BaseToolbarProps<TDate | null, DateView> {
7
- classes?: Partial<DatePickerToolbarClasses>;
8
- sx?: SxProps<Theme>;
5
+ export interface DatePickerToolbarProps<TDate> extends BaseToolbarProps<TDate | null, DateView>, ExportedDatePickerToolbarProps {
9
6
  }
10
7
  export interface ExportedDatePickerToolbarProps extends ExportedBaseToolbarProps {
8
+ /**
9
+ * Override or extend the styles applied to the component.
10
+ */
11
+ classes?: Partial<DatePickerToolbarClasses>;
11
12
  }
12
13
  type DatePickerToolbarComponent = (<TDate>(props: DatePickerToolbarProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
13
14
  propTypes?: any;
@@ -1,7 +1,8 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views"];
3
+ const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views", "className"];
4
4
  import * as React from 'react';
5
+ import clsx from 'clsx';
5
6
  import PropTypes from 'prop-types';
6
7
  import Typography from '@mui/material/Typography';
7
8
  import { styled, useThemeProps } from '@mui/material/styles';
@@ -55,7 +56,8 @@ export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePick
55
56
  isLandscape,
56
57
  toolbarFormat,
57
58
  toolbarPlaceholder = '––',
58
- views
59
+ views,
60
+ className
59
61
  } = props,
60
62
  other = _objectWithoutPropertiesLoose(props, _excluded);
61
63
  const utils = useUtils();
@@ -76,7 +78,7 @@ export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePick
76
78
  ref: ref,
77
79
  toolbarTitle: localeText.datePickerToolbarTitle,
78
80
  isLandscape: isLandscape,
79
- className: classes.root
81
+ className: clsx(classes.root, className)
80
82
  }, other, {
81
83
  children: /*#__PURE__*/_jsx(DatePickerToolbarTitle, {
82
84
  variant: "h4",
@@ -92,6 +94,9 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
92
94
  // | These PropTypes are generated from the TypeScript type definitions |
93
95
  // | To update them edit the TypeScript types and run "yarn proptypes" |
94
96
  // ----------------------------------------------------------------------
97
+ /**
98
+ * Override or extend the styles applied to the component.
99
+ */
95
100
  classes: PropTypes.object,
96
101
  /**
97
102
  * className applied to the root component.
@@ -112,6 +117,9 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
112
117
  */
113
118
  onViewChange: PropTypes.func.isRequired,
114
119
  readOnly: PropTypes.bool,
120
+ /**
121
+ * The system prop that allows defining system overrides as well as additional CSS styles.
122
+ */
115
123
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
116
124
  titleId: PropTypes.string,
117
125
  /**
@@ -18,13 +18,13 @@ export interface ExportedDateTimePickerTabsProps extends ExportedBaseTabsProps {
18
18
  * @default Time
19
19
  */
20
20
  timeIcon?: React.ReactNode;
21
- }
22
- export interface DateTimePickerTabsProps extends ExportedDateTimePickerTabsProps, BaseTabsProps<DateOrTimeViewWithMeridiem> {
23
21
  /**
24
22
  * Override or extend the styles applied to the component.
25
23
  */
26
24
  classes?: Partial<DateTimePickerTabsClasses>;
27
25
  }
26
+ export interface DateTimePickerTabsProps extends ExportedDateTimePickerTabsProps, BaseTabsProps<DateOrTimeViewWithMeridiem> {
27
+ }
28
28
  /**
29
29
  * Demos:
30
30
  *
@@ -70,7 +70,8 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
70
70
  timeIcon = /*#__PURE__*/_jsx(TimeIcon, {}),
71
71
  view,
72
72
  hidden = typeof window === 'undefined' || window.innerHeight < 667,
73
- className
73
+ className,
74
+ sx
74
75
  } = props;
75
76
  const localeText = useLocaleText();
76
77
  const classes = useUtilityClasses(props);
@@ -86,6 +87,7 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
86
87
  value: viewToTab(view),
87
88
  onChange: handleChange,
88
89
  className: clsx(className, classes.root),
90
+ sx: sx,
89
91
  children: [/*#__PURE__*/_jsx(Tab, {
90
92
  value: "date",
91
93
  "aria-label": localeText.dateTableLabel,
@@ -127,6 +129,10 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
127
129
  * @param {TView} view The view to open
128
130
  */
129
131
  onViewChange: PropTypes.func.isRequired,
132
+ /**
133
+ * The system prop that allows defining system overrides as well as additional CSS styles.
134
+ */
135
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
130
136
  /**
131
137
  * Time tab icon.
132
138
  * @default Time
@@ -5,12 +5,12 @@ import { DateOrTimeViewWithMeridiem, WrapperVariant } from '../internals/models'
5
5
  export interface ExportedDateTimePickerToolbarProps extends ExportedBaseToolbarProps {
6
6
  ampm?: boolean;
7
7
  ampmInClock?: boolean;
8
- }
9
- export interface DateTimePickerToolbarProps<TDate> extends ExportedDateTimePickerToolbarProps, BaseToolbarProps<TDate | null, DateOrTimeViewWithMeridiem> {
10
8
  /**
11
9
  * Override or extend the styles applied to the component.
12
10
  */
13
11
  classes?: Partial<DateTimePickerToolbarClasses>;
12
+ }
13
+ export interface DateTimePickerToolbarProps<TDate> extends ExportedDateTimePickerToolbarProps, BaseToolbarProps<TDate | null, DateOrTimeViewWithMeridiem> {
14
14
  toolbarVariant?: WrapperVariant;
15
15
  }
16
16
  /**
@@ -327,6 +327,9 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
327
327
  */
328
328
  onViewChange: PropTypes.func.isRequired,
329
329
  readOnly: PropTypes.bool,
330
+ /**
331
+ * The system prop that allows defining system overrides as well as additional CSS styles.
332
+ */
330
333
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
331
334
  titleId: PropTypes.string,
332
335
  /**
@@ -122,6 +122,9 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
122
122
  // | To update them edit the TypeScript types and run "yarn proptypes" |
123
123
  // ----------------------------------------------------------------------
124
124
  children: PropTypes.node,
125
+ /**
126
+ * Override or extend the styles applied to the component.
127
+ */
125
128
  classes: PropTypes.object,
126
129
  className: PropTypes.string,
127
130
  /**
@@ -164,6 +167,9 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
164
167
  * @default {}
165
168
  */
166
169
  slots: PropTypes.object,
170
+ /**
171
+ * The system prop that allows defining system overrides as well as additional CSS styles.
172
+ */
167
173
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
168
174
  value: PropTypes.any,
169
175
  view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),
@@ -71,11 +71,17 @@ export interface PickersLayoutProps<TValue, TDate, TView extends DateOrTimeViewW
71
71
  value?: TValue;
72
72
  className?: string;
73
73
  children?: React.ReactNode;
74
+ /**
75
+ * The system prop that allows defining system overrides as well as additional CSS styles.
76
+ */
74
77
  sx?: SxProps<Theme>;
75
78
  /**
76
79
  * Ref to pass to the root element
77
80
  */
78
81
  ref?: React.Ref<HTMLDivElement>;
82
+ /**
83
+ * Override or extend the styles applied to the component.
84
+ */
79
85
  classes?: Partial<PickersLayoutClasses>;
80
86
  /**
81
87
  * Overridable components.
@@ -2,14 +2,15 @@ import * as React from 'react';
2
2
  import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
3
3
  import { TimePickerToolbarClasses } from './timePickerToolbarClasses';
4
4
  import { TimeViewWithMeridiem } from '../internals/models';
5
- export interface TimePickerToolbarProps<TDate> extends BaseToolbarProps<TDate | null, TimeViewWithMeridiem> {
5
+ export interface TimePickerToolbarProps<TDate> extends BaseToolbarProps<TDate | null, TimeViewWithMeridiem>, ExportedTimePickerToolbarProps {
6
6
  ampm?: boolean;
7
7
  ampmInClock?: boolean;
8
- classes?: Partial<TimePickerToolbarClasses>;
9
8
  }
10
9
  export interface ExportedTimePickerToolbarProps extends ExportedBaseToolbarProps {
11
- ampm?: boolean;
12
- ampmInClock?: boolean;
10
+ /**
11
+ * Override or extend the styles applied to the component.
12
+ */
13
+ classes?: Partial<TimePickerToolbarClasses>;
13
14
  }
14
15
  /**
15
16
  * Demos:
@@ -1,7 +1,8 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly"];
3
+ const _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly", "className"];
4
4
  import * as React from 'react';
5
+ import clsx from 'clsx';
5
6
  import PropTypes from 'prop-types';
6
7
  import { useTheme, styled, useThemeProps } from '@mui/material/styles';
7
8
  import { unstable_composeClasses as composeClasses } from '@mui/utils';
@@ -132,7 +133,8 @@ function TimePickerToolbar(inProps) {
132
133
  onViewChange,
133
134
  views,
134
135
  disabled,
135
- readOnly
136
+ readOnly,
137
+ className
136
138
  } = props,
137
139
  other = _objectWithoutPropertiesLoose(props, _excluded);
138
140
  const utils = useUtils();
@@ -160,7 +162,7 @@ function TimePickerToolbar(inProps) {
160
162
  toolbarTitle: localeText.timePickerToolbarTitle,
161
163
  isLandscape: isLandscape,
162
164
  ownerState: ownerState,
163
- className: classes.root
165
+ className: clsx(classes.root, className)
164
166
  }, other, {
165
167
  children: [/*#__PURE__*/_jsxs(TimePickerToolbarHourMinuteLabel, {
166
168
  className: classes.hourMinuteLabel,
@@ -213,6 +215,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
213
215
  // ----------------------------------------------------------------------
214
216
  ampm: PropTypes.bool,
215
217
  ampmInClock: PropTypes.bool,
218
+ /**
219
+ * Override or extend the styles applied to the component.
220
+ */
216
221
  classes: PropTypes.object,
217
222
  /**
218
223
  * className applied to the root component.
@@ -233,6 +238,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
233
238
  */
234
239
  onViewChange: PropTypes.func.isRequired,
235
240
  readOnly: PropTypes.bool,
241
+ /**
242
+ * The system prop that allows defining system overrides as well as additional CSS styles.
243
+ */
236
244
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
237
245
  titleId: PropTypes.string,
238
246
  /**
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.19.4
2
+ * @mui/x-date-pickers v6.19.5
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -15,6 +15,9 @@ export interface ExportedPickersArrowSwitcherProps {
15
15
  * @default {}
16
16
  */
17
17
  slotProps?: PickersArrowSwitcherSlotsComponentsProps;
18
+ /**
19
+ * Override or extend the styles applied to the component.
20
+ */
18
21
  classes?: Partial<PickersArrowSwitcherClasses>;
19
22
  }
20
23
  export interface PickersArrowSwitcherProps extends ExportedPickersArrowSwitcherProps, Omit<React.HTMLProps<HTMLDivElement>, 'ref' | 'as'> {
@@ -60,6 +60,9 @@ export interface PickerPopperProps extends UsePickerValueActions {
60
60
  onBlur?: () => void;
61
61
  slots?: UncapitalizeObjectKeys<PickersPopperSlotsComponent>;
62
62
  slotProps?: PickersPopperSlotsComponentsProps;
63
+ /**
64
+ * Override or extend the styles applied to the component.
65
+ */
63
66
  classes?: Partial<PickersPopperClasses>;
64
67
  shouldRestoreFocus?: () => boolean;
65
68
  reduceAnimations?: boolean;
@@ -1,3 +1,5 @@
1
+ import { SxProps } from '@mui/system';
2
+ import { Theme } from '@mui/material/styles';
1
3
  import { DateOrTimeViewWithMeridiem } from '../common';
2
4
  export interface BaseTabsProps<TView extends DateOrTimeViewWithMeridiem> {
3
5
  /**
@@ -11,6 +13,10 @@ export interface BaseTabsProps<TView extends DateOrTimeViewWithMeridiem> {
11
13
  */
12
14
  onViewChange: (view: TView) => void;
13
15
  className?: string;
16
+ /**
17
+ * The system prop that allows defining system overrides as well as additional CSS styles.
18
+ */
19
+ sx?: SxProps<Theme>;
14
20
  }
15
21
  export interface ExportedBaseTabsProps {
16
22
  }
@@ -40,5 +40,8 @@ export interface ExportedBaseToolbarProps {
40
40
  * @default `true` for Desktop, `false` for Mobile.
41
41
  */
42
42
  hidden?: boolean;
43
+ /**
44
+ * The system prop that allows defining system overrides as well as additional CSS styles.
45
+ */
43
46
  sx?: SxProps<Theme>;
44
47
  }
@@ -371,6 +371,9 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
371
371
  * - the `input` element if there is a field rendered.
372
372
  */
373
373
  autoFocus: PropTypes.bool,
374
+ /**
375
+ * Override or extend the styles applied to the component.
376
+ */
374
377
  classes: PropTypes.object,
375
378
  className: PropTypes.string,
376
379
  /**
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import * as React from 'react';
4
4
  import useEventCallback from '@mui/utils/useEventCallback';
5
5
  import { useIsDateDisabled } from './useIsDateDisabled';
6
- import { useUtils, useNow } from '../internals/hooks/useUtils';
6
+ import { useUtils } from '../internals/hooks/useUtils';
7
7
  import { singleItemValueManager } from '../internals/utils/valueManagers';
8
8
  import { SECTION_TYPE_GRANULARITY } from '../internals/utils/getDefaultReferenceDate';
9
9
  export var createCalendarStateReducer = function createCalendarStateReducer(reduceAnimations, disableSwitchToMonthOnDayFocus, utils) {
@@ -51,7 +51,6 @@ export var useCalendarState = function useCalendarState(params) {
51
51
  reduceAnimations = params.reduceAnimations,
52
52
  shouldDisableDate = params.shouldDisableDate,
53
53
  timezone = params.timezone;
54
- var now = useNow(timezone);
55
54
  var utils = useUtils();
56
55
  var reducerFn = React.useRef(createCalendarStateReducer(Boolean(reduceAnimations), disableSwitchToMonthOnDayFocus, utils)).current;
57
56
  var referenceDate = React.useMemo(function () {
@@ -74,7 +73,7 @@ export var useCalendarState = function useCalendarState(params) {
74
73
  );
75
74
  var _React$useReducer = React.useReducer(reducerFn, {
76
75
  isMonthSwitchingAnimating: false,
77
- focusedDay: utils.isValid(value) ? value : now,
76
+ focusedDay: referenceDate,
78
77
  currentMonth: utils.startOfMonth(referenceDate),
79
78
  slideDirection: 'left'
80
79
  }),
@@ -1,7 +1,8 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- var _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views"];
3
+ var _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views", "className"];
4
4
  import * as React from 'react';
5
+ import clsx from 'clsx';
5
6
  import PropTypes from 'prop-types';
6
7
  import Typography from '@mui/material/Typography';
7
8
  import { styled, useThemeProps } from '@mui/material/styles';
@@ -60,6 +61,7 @@ export var DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePicker
60
61
  _props$toolbarPlaceho = props.toolbarPlaceholder,
61
62
  toolbarPlaceholder = _props$toolbarPlaceho === void 0 ? '––' : _props$toolbarPlaceho,
62
63
  views = props.views,
64
+ className = props.className,
63
65
  other = _objectWithoutProperties(props, _excluded);
64
66
  var utils = useUtils();
65
67
  var localeText = useLocaleText();
@@ -79,7 +81,7 @@ export var DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePicker
79
81
  ref: ref,
80
82
  toolbarTitle: localeText.datePickerToolbarTitle,
81
83
  isLandscape: isLandscape,
82
- className: classes.root
84
+ className: clsx(classes.root, className)
83
85
  }, other, {
84
86
  children: /*#__PURE__*/_jsx(DatePickerToolbarTitle, {
85
87
  variant: "h4",
@@ -95,6 +97,9 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
95
97
  // | These PropTypes are generated from the TypeScript type definitions |
96
98
  // | To update them edit the TypeScript types and run "yarn proptypes" |
97
99
  // ----------------------------------------------------------------------
100
+ /**
101
+ * Override or extend the styles applied to the component.
102
+ */
98
103
  classes: PropTypes.object,
99
104
  /**
100
105
  * className applied to the root component.
@@ -115,6 +120,9 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
115
120
  */
116
121
  onViewChange: PropTypes.func.isRequired,
117
122
  readOnly: PropTypes.bool,
123
+ /**
124
+ * The system prop that allows defining system overrides as well as additional CSS styles.
125
+ */
118
126
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
119
127
  titleId: PropTypes.string,
120
128
  /**
@@ -73,7 +73,8 @@ var DateTimePickerTabs = function DateTimePickerTabs(inProps) {
73
73
  view = props.view,
74
74
  _props$hidden = props.hidden,
75
75
  hidden = _props$hidden === void 0 ? typeof window === 'undefined' || window.innerHeight < 667 : _props$hidden,
76
- className = props.className;
76
+ className = props.className,
77
+ sx = props.sx;
77
78
  var localeText = useLocaleText();
78
79
  var classes = useUtilityClasses(props);
79
80
  var handleChange = function handleChange(event, value) {
@@ -88,6 +89,7 @@ var DateTimePickerTabs = function DateTimePickerTabs(inProps) {
88
89
  value: viewToTab(view),
89
90
  onChange: handleChange,
90
91
  className: clsx(className, classes.root),
92
+ sx: sx,
91
93
  children: [/*#__PURE__*/_jsx(Tab, {
92
94
  value: "date",
93
95
  "aria-label": localeText.dateTableLabel,
@@ -129,6 +131,10 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
129
131
  * @param {TView} view The view to open
130
132
  */
131
133
  onViewChange: PropTypes.func.isRequired,
134
+ /**
135
+ * The system prop that allows defining system overrides as well as additional CSS styles.
136
+ */
137
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
132
138
  /**
133
139
  * Time tab icon.
134
140
  * @default Time
@@ -352,6 +352,9 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
352
352
  */
353
353
  onViewChange: PropTypes.func.isRequired,
354
354
  readOnly: PropTypes.bool,
355
+ /**
356
+ * The system prop that allows defining system overrides as well as additional CSS styles.
357
+ */
355
358
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
356
359
  titleId: PropTypes.string,
357
360
  /**
@@ -120,6 +120,9 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
120
120
  // | To update them edit the TypeScript types and run "yarn proptypes" |
121
121
  // ----------------------------------------------------------------------
122
122
  children: PropTypes.node,
123
+ /**
124
+ * Override or extend the styles applied to the component.
125
+ */
123
126
  classes: PropTypes.object,
124
127
  className: PropTypes.string,
125
128
  /**
@@ -162,6 +165,9 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
162
165
  * @default {}
163
166
  */
164
167
  slots: PropTypes.object,
168
+ /**
169
+ * The system prop that allows defining system overrides as well as additional CSS styles.
170
+ */
165
171
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
166
172
  value: PropTypes.any,
167
173
  view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),
@@ -1,8 +1,9 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
- var _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly"];
4
+ var _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly", "className"];
5
5
  import * as React from 'react';
6
+ import clsx from 'clsx';
6
7
  import PropTypes from 'prop-types';
7
8
  import { useTheme, styled, useThemeProps } from '@mui/material/styles';
8
9
  import { unstable_composeClasses as composeClasses } from '@mui/utils';
@@ -132,6 +133,7 @@ function TimePickerToolbar(inProps) {
132
133
  views = props.views,
133
134
  disabled = props.disabled,
134
135
  readOnly = props.readOnly,
136
+ className = props.className,
135
137
  other = _objectWithoutProperties(props, _excluded);
136
138
  var utils = useUtils();
137
139
  var localeText = useLocaleText();
@@ -159,7 +161,7 @@ function TimePickerToolbar(inProps) {
159
161
  toolbarTitle: localeText.timePickerToolbarTitle,
160
162
  isLandscape: isLandscape,
161
163
  ownerState: ownerState,
162
- className: classes.root
164
+ className: clsx(classes.root, className)
163
165
  }, other, {
164
166
  children: [/*#__PURE__*/_jsxs(TimePickerToolbarHourMinuteLabel, {
165
167
  className: classes.hourMinuteLabel,
@@ -222,6 +224,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
222
224
  // ----------------------------------------------------------------------
223
225
  ampm: PropTypes.bool,
224
226
  ampmInClock: PropTypes.bool,
227
+ /**
228
+ * Override or extend the styles applied to the component.
229
+ */
225
230
  classes: PropTypes.object,
226
231
  /**
227
232
  * className applied to the root component.
@@ -242,6 +247,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
242
247
  */
243
248
  onViewChange: PropTypes.func.isRequired,
244
249
  readOnly: PropTypes.bool,
250
+ /**
251
+ * The system prop that allows defining system overrides as well as additional CSS styles.
252
+ */
245
253
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
246
254
  titleId: PropTypes.string,
247
255
  /**
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.19.4
2
+ * @mui/x-date-pickers v6.19.5
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -360,6 +360,9 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
360
360
  * - the `input` element if there is a field rendered.
361
361
  */
362
362
  autoFocus: PropTypes.bool,
363
+ /**
364
+ * Override or extend the styles applied to the component.
365
+ */
363
366
  classes: PropTypes.object,
364
367
  className: PropTypes.string,
365
368
  /**
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import useEventCallback from '@mui/utils/useEventCallback';
4
4
  import { useIsDateDisabled } from './useIsDateDisabled';
5
- import { useUtils, useNow } from '../internals/hooks/useUtils';
5
+ import { useUtils } from '../internals/hooks/useUtils';
6
6
  import { singleItemValueManager } from '../internals/utils/valueManagers';
7
7
  import { SECTION_TYPE_GRANULARITY } from '../internals/utils/getDefaultReferenceDate';
8
8
  export const createCalendarStateReducer = (reduceAnimations, disableSwitchToMonthOnDayFocus, utils) => (state, action) => {
@@ -49,7 +49,6 @@ export const useCalendarState = params => {
49
49
  shouldDisableDate,
50
50
  timezone
51
51
  } = params;
52
- const now = useNow(timezone);
53
52
  const utils = useUtils();
54
53
  const reducerFn = React.useRef(createCalendarStateReducer(Boolean(reduceAnimations), disableSwitchToMonthOnDayFocus, utils)).current;
55
54
  const referenceDate = React.useMemo(() => {
@@ -72,7 +71,7 @@ export const useCalendarState = params => {
72
71
  );
73
72
  const [calendarState, dispatch] = React.useReducer(reducerFn, {
74
73
  isMonthSwitchingAnimating: false,
75
- focusedDay: utils.isValid(value) ? value : now,
74
+ focusedDay: referenceDate,
76
75
  currentMonth: utils.startOfMonth(referenceDate),
77
76
  slideDirection: 'left'
78
77
  });
@@ -1,7 +1,8 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views"];
3
+ const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views", "className"];
4
4
  import * as React from 'react';
5
+ import clsx from 'clsx';
5
6
  import PropTypes from 'prop-types';
6
7
  import Typography from '@mui/material/Typography';
7
8
  import { styled, useThemeProps } from '@mui/material/styles';
@@ -55,7 +56,8 @@ export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePick
55
56
  isLandscape,
56
57
  toolbarFormat,
57
58
  toolbarPlaceholder = '––',
58
- views
59
+ views,
60
+ className
59
61
  } = props,
60
62
  other = _objectWithoutPropertiesLoose(props, _excluded);
61
63
  const utils = useUtils();
@@ -76,7 +78,7 @@ export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePick
76
78
  ref: ref,
77
79
  toolbarTitle: localeText.datePickerToolbarTitle,
78
80
  isLandscape: isLandscape,
79
- className: classes.root
81
+ className: clsx(classes.root, className)
80
82
  }, other, {
81
83
  children: /*#__PURE__*/_jsx(DatePickerToolbarTitle, {
82
84
  variant: "h4",
@@ -92,6 +94,9 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
92
94
  // | These PropTypes are generated from the TypeScript type definitions |
93
95
  // | To update them edit the TypeScript types and run "yarn proptypes" |
94
96
  // ----------------------------------------------------------------------
97
+ /**
98
+ * Override or extend the styles applied to the component.
99
+ */
95
100
  classes: PropTypes.object,
96
101
  /**
97
102
  * className applied to the root component.
@@ -112,6 +117,9 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
112
117
  */
113
118
  onViewChange: PropTypes.func.isRequired,
114
119
  readOnly: PropTypes.bool,
120
+ /**
121
+ * The system prop that allows defining system overrides as well as additional CSS styles.
122
+ */
115
123
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
116
124
  titleId: PropTypes.string,
117
125
  /**
@@ -70,7 +70,8 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
70
70
  timeIcon = /*#__PURE__*/_jsx(TimeIcon, {}),
71
71
  view,
72
72
  hidden = typeof window === 'undefined' || window.innerHeight < 667,
73
- className
73
+ className,
74
+ sx
74
75
  } = props;
75
76
  const localeText = useLocaleText();
76
77
  const classes = useUtilityClasses(props);
@@ -86,6 +87,7 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
86
87
  value: viewToTab(view),
87
88
  onChange: handleChange,
88
89
  className: clsx(className, classes.root),
90
+ sx: sx,
89
91
  children: [/*#__PURE__*/_jsx(Tab, {
90
92
  value: "date",
91
93
  "aria-label": localeText.dateTableLabel,
@@ -127,6 +129,10 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
127
129
  * @param {TView} view The view to open
128
130
  */
129
131
  onViewChange: PropTypes.func.isRequired,
132
+ /**
133
+ * The system prop that allows defining system overrides as well as additional CSS styles.
134
+ */
135
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
130
136
  /**
131
137
  * Time tab icon.
132
138
  * @default Time
@@ -327,6 +327,9 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
327
327
  */
328
328
  onViewChange: PropTypes.func.isRequired,
329
329
  readOnly: PropTypes.bool,
330
+ /**
331
+ * The system prop that allows defining system overrides as well as additional CSS styles.
332
+ */
330
333
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
331
334
  titleId: PropTypes.string,
332
335
  /**
@@ -122,6 +122,9 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
122
122
  // | To update them edit the TypeScript types and run "yarn proptypes" |
123
123
  // ----------------------------------------------------------------------
124
124
  children: PropTypes.node,
125
+ /**
126
+ * Override or extend the styles applied to the component.
127
+ */
125
128
  classes: PropTypes.object,
126
129
  className: PropTypes.string,
127
130
  /**
@@ -164,6 +167,9 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
164
167
  * @default {}
165
168
  */
166
169
  slots: PropTypes.object,
170
+ /**
171
+ * The system prop that allows defining system overrides as well as additional CSS styles.
172
+ */
167
173
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
168
174
  value: PropTypes.any,
169
175
  view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),
@@ -1,7 +1,8 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly"];
3
+ const _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly", "className"];
4
4
  import * as React from 'react';
5
+ import clsx from 'clsx';
5
6
  import PropTypes from 'prop-types';
6
7
  import { useTheme, styled, useThemeProps } from '@mui/material/styles';
7
8
  import { unstable_composeClasses as composeClasses } from '@mui/utils';
@@ -132,7 +133,8 @@ function TimePickerToolbar(inProps) {
132
133
  onViewChange,
133
134
  views,
134
135
  disabled,
135
- readOnly
136
+ readOnly,
137
+ className
136
138
  } = props,
137
139
  other = _objectWithoutPropertiesLoose(props, _excluded);
138
140
  const utils = useUtils();
@@ -160,7 +162,7 @@ function TimePickerToolbar(inProps) {
160
162
  toolbarTitle: localeText.timePickerToolbarTitle,
161
163
  isLandscape: isLandscape,
162
164
  ownerState: ownerState,
163
- className: classes.root
165
+ className: clsx(classes.root, className)
164
166
  }, other, {
165
167
  children: [/*#__PURE__*/_jsxs(TimePickerToolbarHourMinuteLabel, {
166
168
  className: classes.hourMinuteLabel,
@@ -213,6 +215,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
213
215
  // ----------------------------------------------------------------------
214
216
  ampm: PropTypes.bool,
215
217
  ampmInClock: PropTypes.bool,
218
+ /**
219
+ * Override or extend the styles applied to the component.
220
+ */
216
221
  classes: PropTypes.object,
217
222
  /**
218
223
  * className applied to the root component.
@@ -233,6 +238,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
233
238
  */
234
239
  onViewChange: PropTypes.func.isRequired,
235
240
  readOnly: PropTypes.bool,
241
+ /**
242
+ * The system prop that allows defining system overrides as well as additional CSS styles.
243
+ */
236
244
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
237
245
  titleId: PropTypes.string,
238
246
  /**
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.19.4
2
+ * @mui/x-date-pickers v6.19.5
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -368,6 +368,9 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
368
368
  * - the `input` element if there is a field rendered.
369
369
  */
370
370
  autoFocus: _propTypes.default.bool,
371
+ /**
372
+ * Override or extend the styles applied to the component.
373
+ */
371
374
  classes: _propTypes.default.object,
372
375
  className: _propTypes.default.string,
373
376
  /**
@@ -59,7 +59,6 @@ const useCalendarState = params => {
59
59
  shouldDisableDate,
60
60
  timezone
61
61
  } = params;
62
- const now = (0, _useUtils.useNow)(timezone);
63
62
  const utils = (0, _useUtils.useUtils)();
64
63
  const reducerFn = React.useRef(createCalendarStateReducer(Boolean(reduceAnimations), disableSwitchToMonthOnDayFocus, utils)).current;
65
64
  const referenceDate = React.useMemo(() => {
@@ -82,7 +81,7 @@ const useCalendarState = params => {
82
81
  );
83
82
  const [calendarState, dispatch] = React.useReducer(reducerFn, {
84
83
  isMonthSwitchingAnimating: false,
85
- focusedDay: utils.isValid(value) ? value : now,
84
+ focusedDay: referenceDate,
86
85
  currentMonth: utils.startOfMonth(referenceDate),
87
86
  slideDirection: 'left'
88
87
  });
@@ -8,6 +8,7 @@ exports.DatePickerToolbar = void 0;
8
8
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var React = _interopRequireWildcard(require("react"));
11
+ var _clsx = _interopRequireDefault(require("clsx"));
11
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
13
  var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
13
14
  var _styles = require("@mui/material/styles");
@@ -17,7 +18,7 @@ var _useUtils = require("../internals/hooks/useUtils");
17
18
  var _datePickerToolbarClasses = require("./datePickerToolbarClasses");
18
19
  var _dateUtils = require("../internals/utils/date-utils");
19
20
  var _jsxRuntime = require("react/jsx-runtime");
20
- const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views"];
21
+ const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views", "className"];
21
22
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
22
23
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
23
24
  const useUtilityClasses = ownerState => {
@@ -64,7 +65,8 @@ const DatePickerToolbar = exports.DatePickerToolbar = /*#__PURE__*/React.forward
64
65
  isLandscape,
65
66
  toolbarFormat,
66
67
  toolbarPlaceholder = '––',
67
- views
68
+ views,
69
+ className
68
70
  } = props,
69
71
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
70
72
  const utils = (0, _useUtils.useUtils)();
@@ -85,7 +87,7 @@ const DatePickerToolbar = exports.DatePickerToolbar = /*#__PURE__*/React.forward
85
87
  ref: ref,
86
88
  toolbarTitle: localeText.datePickerToolbarTitle,
87
89
  isLandscape: isLandscape,
88
- className: classes.root
90
+ className: (0, _clsx.default)(classes.root, className)
89
91
  }, other, {
90
92
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DatePickerToolbarTitle, {
91
93
  variant: "h4",
@@ -101,6 +103,9 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
101
103
  // | These PropTypes are generated from the TypeScript type definitions |
102
104
  // | To update them edit the TypeScript types and run "yarn proptypes" |
103
105
  // ----------------------------------------------------------------------
106
+ /**
107
+ * Override or extend the styles applied to the component.
108
+ */
104
109
  classes: _propTypes.default.object,
105
110
  /**
106
111
  * className applied to the root component.
@@ -121,6 +126,9 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
121
126
  */
122
127
  onViewChange: _propTypes.default.func.isRequired,
123
128
  readOnly: _propTypes.default.bool,
129
+ /**
130
+ * The system prop that allows defining system overrides as well as additional CSS styles.
131
+ */
124
132
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
125
133
  titleId: _propTypes.default.string,
126
134
  /**
@@ -78,7 +78,8 @@ const DateTimePickerTabs = exports.DateTimePickerTabs = function DateTimePickerT
78
78
  timeIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.TimeIcon, {}),
79
79
  view,
80
80
  hidden = typeof window === 'undefined' || window.innerHeight < 667,
81
- className
81
+ className,
82
+ sx
82
83
  } = props;
83
84
  const localeText = (0, _useUtils.useLocaleText)();
84
85
  const classes = useUtilityClasses(props);
@@ -94,6 +95,7 @@ const DateTimePickerTabs = exports.DateTimePickerTabs = function DateTimePickerT
94
95
  value: viewToTab(view),
95
96
  onChange: handleChange,
96
97
  className: (0, _clsx.default)(className, classes.root),
98
+ sx: sx,
97
99
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Tab.default, {
98
100
  value: "date",
99
101
  "aria-label": localeText.dateTableLabel,
@@ -135,6 +137,10 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
135
137
  * @param {TView} view The view to open
136
138
  */
137
139
  onViewChange: _propTypes.default.func.isRequired,
140
+ /**
141
+ * The system prop that allows defining system overrides as well as additional CSS styles.
142
+ */
143
+ sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
138
144
  /**
139
145
  * Time tab icon.
140
146
  * @default Time
@@ -335,6 +335,9 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
335
335
  */
336
336
  onViewChange: _propTypes.default.func.isRequired,
337
337
  readOnly: _propTypes.default.bool,
338
+ /**
339
+ * The system prop that allows defining system overrides as well as additional CSS styles.
340
+ */
338
341
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
339
342
  titleId: _propTypes.default.string,
340
343
  /**
@@ -129,6 +129,9 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
129
129
  // | To update them edit the TypeScript types and run "yarn proptypes" |
130
130
  // ----------------------------------------------------------------------
131
131
  children: _propTypes.default.node,
132
+ /**
133
+ * Override or extend the styles applied to the component.
134
+ */
132
135
  classes: _propTypes.default.object,
133
136
  className: _propTypes.default.string,
134
137
  /**
@@ -171,6 +174,9 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
171
174
  * @default {}
172
175
  */
173
176
  slots: _propTypes.default.object,
177
+ /**
178
+ * The system prop that allows defining system overrides as well as additional CSS styles.
179
+ */
174
180
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
175
181
  value: _propTypes.default.any,
176
182
  view: _propTypes.default.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),
@@ -8,6 +8,7 @@ exports.TimePickerToolbar = TimePickerToolbar;
8
8
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var React = _interopRequireWildcard(require("react"));
11
+ var _clsx = _interopRequireDefault(require("clsx"));
11
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
13
  var _styles = require("@mui/material/styles");
13
14
  var _utils = require("@mui/utils");
@@ -20,7 +21,7 @@ var _dateHelpersHooks = require("../internals/hooks/date-helpers-hooks");
20
21
  var _timePickerToolbarClasses = require("./timePickerToolbarClasses");
21
22
  var _dateUtils = require("../internals/utils/date-utils");
22
23
  var _jsxRuntime = require("react/jsx-runtime");
23
- const _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly"];
24
+ const _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly", "className"];
24
25
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
25
26
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
26
27
  const useUtilityClasses = ownerState => {
@@ -140,7 +141,8 @@ function TimePickerToolbar(inProps) {
140
141
  onViewChange,
141
142
  views,
142
143
  disabled,
143
- readOnly
144
+ readOnly,
145
+ className
144
146
  } = props,
145
147
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
146
148
  const utils = (0, _useUtils.useUtils)();
@@ -168,7 +170,7 @@ function TimePickerToolbar(inProps) {
168
170
  toolbarTitle: localeText.timePickerToolbarTitle,
169
171
  isLandscape: isLandscape,
170
172
  ownerState: ownerState,
171
- className: classes.root
173
+ className: (0, _clsx.default)(classes.root, className)
172
174
  }, other, {
173
175
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(TimePickerToolbarHourMinuteLabel, {
174
176
  className: classes.hourMinuteLabel,
@@ -221,6 +223,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
221
223
  // ----------------------------------------------------------------------
222
224
  ampm: _propTypes.default.bool,
223
225
  ampmInClock: _propTypes.default.bool,
226
+ /**
227
+ * Override or extend the styles applied to the component.
228
+ */
224
229
  classes: _propTypes.default.object,
225
230
  /**
226
231
  * className applied to the root component.
@@ -241,6 +246,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
241
246
  */
242
247
  onViewChange: _propTypes.default.func.isRequired,
243
248
  readOnly: _propTypes.default.bool,
249
+ /**
250
+ * The system prop that allows defining system overrides as well as additional CSS styles.
251
+ */
244
252
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
245
253
  titleId: _propTypes.default.string,
246
254
  /**
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.19.4
2
+ * @mui/x-date-pickers v6.19.5
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "6.19.4",
3
+ "version": "6.19.5",
4
4
  "description": "The community edition of the date picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",