@mui/x-date-pickers 7.0.0 → 7.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/CHANGELOG.md +246 -4
  2. package/DateCalendar/DateCalendar.js +1 -1
  3. package/DateCalendar/DayCalendar.d.ts +1 -1
  4. package/DateField/DateField.js +1 -1
  5. package/DatePicker/DatePicker.js +1 -1
  6. package/DatePicker/DatePickerToolbar.js +11 -6
  7. package/DateTimeField/DateTimeField.js +2 -2
  8. package/DateTimeField/DateTimeField.types.d.ts +1 -1
  9. package/DateTimePicker/DateTimePicker.js +2 -2
  10. package/DateTimePicker/DateTimePickerToolbar.js +97 -45
  11. package/DayCalendarSkeleton/DayCalendarSkeleton.js +12 -8
  12. package/DesktopDatePicker/DesktopDatePicker.js +1 -1
  13. package/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
  14. package/DesktopTimePicker/DesktopTimePicker.js +1 -1
  15. package/DigitalClock/DigitalClock.js +15 -7
  16. package/MobileDatePicker/MobileDatePicker.js +1 -1
  17. package/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
  18. package/MobileTimePicker/MobileTimePicker.js +1 -1
  19. package/MonthCalendar/PickersMonth.js +12 -6
  20. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -1
  21. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -4
  22. package/PickersCalendarHeader/PickersCalendarHeader.js +13 -9
  23. package/PickersDay/PickersDay.js +30 -15
  24. package/PickersLayout/PickersLayout.js +31 -17
  25. package/PickersShortcuts/PickersShortcuts.d.ts +1 -1
  26. package/PickersShortcuts/PickersShortcuts.js +1 -1
  27. package/PickersTextField/PickersFilledInput/PickersFilledInput.js +137 -72
  28. package/PickersTextField/PickersInput/PickersInput.js +76 -54
  29. package/PickersTextField/PickersInputBase/PickersInputBase.js +64 -24
  30. package/PickersTextField/PickersInputBase/PickersInputBase.types.d.ts +7 -0
  31. package/PickersTextField/PickersOutlinedInput/Outline.js +58 -41
  32. package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +31 -12
  33. package/README.md +1 -1
  34. package/StaticDatePicker/StaticDatePicker.js +1 -1
  35. package/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
  36. package/StaticTimePicker/StaticTimePicker.js +1 -1
  37. package/TimeClock/Clock.js +48 -35
  38. package/TimeClock/ClockNumber.js +12 -7
  39. package/TimeClock/ClockPointer.js +23 -13
  40. package/TimeClock/TimeClock.js +1 -1
  41. package/TimeField/TimeField.js +2 -2
  42. package/TimeField/TimeField.types.d.ts +1 -1
  43. package/TimePicker/TimePicker.js +1 -1
  44. package/TimePicker/TimePickerToolbar.js +25 -16
  45. package/YearCalendar/PickersYear.js +12 -6
  46. package/index.js +1 -1
  47. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +11 -6
  48. package/internals/components/PickersPopper.js +12 -8
  49. package/internals/components/PickersToolbar.js +39 -18
  50. package/internals/hooks/useField/useField.js +4 -2
  51. package/internals/hooks/useField/useField.types.d.ts +2 -1
  52. package/internals/hooks/useField/useFieldV6TextField.js +10 -3
  53. package/internals/models/props/clock.d.ts +1 -1
  54. package/locales/faIR.js +7 -8
  55. package/locales/itIT.js +16 -20
  56. package/locales/ptBR.js +14 -17
  57. package/locales/ukUA.js +15 -19
  58. package/locales/zhHK.js +14 -17
  59. package/modern/DateCalendar/DateCalendar.js +1 -1
  60. package/modern/DateField/DateField.js +1 -1
  61. package/modern/DatePicker/DatePicker.js +1 -1
  62. package/modern/DatePicker/DatePickerToolbar.js +11 -6
  63. package/modern/DateTimeField/DateTimeField.js +2 -2
  64. package/modern/DateTimePicker/DateTimePicker.js +2 -2
  65. package/modern/DateTimePicker/DateTimePickerToolbar.js +97 -45
  66. package/modern/DayCalendarSkeleton/DayCalendarSkeleton.js +12 -8
  67. package/modern/DesktopDatePicker/DesktopDatePicker.js +1 -1
  68. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
  69. package/modern/DesktopTimePicker/DesktopTimePicker.js +1 -1
  70. package/modern/DigitalClock/DigitalClock.js +15 -7
  71. package/modern/MobileDatePicker/MobileDatePicker.js +1 -1
  72. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
  73. package/modern/MobileTimePicker/MobileTimePicker.js +1 -1
  74. package/modern/MonthCalendar/PickersMonth.js +12 -6
  75. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -1
  76. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -4
  77. package/modern/PickersCalendarHeader/PickersCalendarHeader.js +13 -9
  78. package/modern/PickersDay/PickersDay.js +30 -15
  79. package/modern/PickersLayout/PickersLayout.js +31 -17
  80. package/modern/PickersShortcuts/PickersShortcuts.js +1 -1
  81. package/modern/PickersTextField/PickersFilledInput/PickersFilledInput.js +137 -72
  82. package/modern/PickersTextField/PickersInput/PickersInput.js +76 -54
  83. package/modern/PickersTextField/PickersInputBase/PickersInputBase.js +64 -24
  84. package/modern/PickersTextField/PickersOutlinedInput/Outline.js +58 -41
  85. package/modern/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +31 -12
  86. package/modern/StaticDatePicker/StaticDatePicker.js +1 -1
  87. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
  88. package/modern/StaticTimePicker/StaticTimePicker.js +1 -1
  89. package/modern/TimeClock/Clock.js +48 -35
  90. package/modern/TimeClock/ClockNumber.js +12 -7
  91. package/modern/TimeClock/ClockPointer.js +23 -13
  92. package/modern/TimeClock/TimeClock.js +1 -1
  93. package/modern/TimeField/TimeField.js +2 -2
  94. package/modern/TimePicker/TimePicker.js +1 -1
  95. package/modern/TimePicker/TimePickerToolbar.js +25 -16
  96. package/modern/YearCalendar/PickersYear.js +12 -6
  97. package/modern/index.js +1 -1
  98. package/modern/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +11 -6
  99. package/modern/internals/components/PickersPopper.js +12 -8
  100. package/modern/internals/components/PickersToolbar.js +39 -18
  101. package/modern/internals/hooks/useField/useField.js +4 -2
  102. package/modern/internals/hooks/useField/useFieldV6TextField.js +10 -3
  103. package/modern/locales/faIR.js +7 -8
  104. package/modern/locales/itIT.js +16 -20
  105. package/modern/locales/ptBR.js +14 -17
  106. package/modern/locales/ukUA.js +15 -19
  107. package/modern/locales/zhHK.js +14 -17
  108. package/node/DateCalendar/DateCalendar.js +1 -1
  109. package/node/DateField/DateField.js +1 -1
  110. package/node/DatePicker/DatePicker.js +1 -1
  111. package/node/DatePicker/DatePickerToolbar.js +11 -6
  112. package/node/DateTimeField/DateTimeField.js +2 -2
  113. package/node/DateTimePicker/DateTimePicker.js +2 -2
  114. package/node/DateTimePicker/DateTimePickerToolbar.js +97 -45
  115. package/node/DayCalendarSkeleton/DayCalendarSkeleton.js +12 -8
  116. package/node/DesktopDatePicker/DesktopDatePicker.js +1 -1
  117. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
  118. package/node/DesktopTimePicker/DesktopTimePicker.js +1 -1
  119. package/node/DigitalClock/DigitalClock.js +15 -7
  120. package/node/MobileDatePicker/MobileDatePicker.js +1 -1
  121. package/node/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
  122. package/node/MobileTimePicker/MobileTimePicker.js +1 -1
  123. package/node/MonthCalendar/PickersMonth.js +12 -6
  124. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -1
  125. package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -4
  126. package/node/PickersCalendarHeader/PickersCalendarHeader.js +13 -9
  127. package/node/PickersDay/PickersDay.js +30 -15
  128. package/node/PickersLayout/PickersLayout.js +31 -17
  129. package/node/PickersShortcuts/PickersShortcuts.js +1 -1
  130. package/node/PickersTextField/PickersFilledInput/PickersFilledInput.js +137 -72
  131. package/node/PickersTextField/PickersInput/PickersInput.js +76 -54
  132. package/node/PickersTextField/PickersInputBase/PickersInputBase.js +64 -24
  133. package/node/PickersTextField/PickersOutlinedInput/Outline.js +58 -41
  134. package/node/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +31 -12
  135. package/node/StaticDatePicker/StaticDatePicker.js +1 -1
  136. package/node/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
  137. package/node/StaticTimePicker/StaticTimePicker.js +1 -1
  138. package/node/TimeClock/Clock.js +48 -35
  139. package/node/TimeClock/ClockNumber.js +12 -7
  140. package/node/TimeClock/ClockPointer.js +23 -13
  141. package/node/TimeClock/TimeClock.js +1 -1
  142. package/node/TimeField/TimeField.js +2 -2
  143. package/node/TimePicker/TimePicker.js +1 -1
  144. package/node/TimePicker/TimePickerToolbar.js +25 -16
  145. package/node/YearCalendar/PickersYear.js +12 -6
  146. package/node/index.js +1 -1
  147. package/node/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +11 -6
  148. package/node/internals/components/PickersPopper.js +12 -8
  149. package/node/internals/components/PickersToolbar.js +39 -18
  150. package/node/internals/hooks/useField/useField.js +4 -2
  151. package/node/internals/hooks/useField/useFieldV6TextField.js +10 -3
  152. package/node/locales/faIR.js +7 -8
  153. package/node/locales/itIT.js +16 -20
  154. package/node/locales/ptBR.js +14 -17
  155. package/node/locales/ukUA.js +15 -19
  156. package/node/locales/zhHK.js +14 -17
  157. package/package.json +2 -2
@@ -15,11 +15,12 @@ var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
15
15
  var _utils = require("@mui/utils");
16
16
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
17
17
  var _capitalize = _interopRequireDefault(require("@mui/utils/capitalize"));
18
+ var _utils2 = require("@mui/base/utils");
18
19
  var _visuallyHidden = _interopRequireDefault(require("@mui/utils/visuallyHidden"));
19
20
  var _pickersInputBaseClasses = require("./pickersInputBaseClasses");
20
21
  var _PickersSectionList = require("../../PickersSectionList");
21
22
  var _jsxRuntime = require("react/jsx-runtime");
22
- const _excluded = ["elements", "areAllSectionsEmpty", "defaultValue", "label", "value", "onChange", "id", "autoFocus", "endAdornment", "startAdornment", "renderSuffix", "slots", "contentEditable", "tabIndex", "onInput", "onPaste", "onKeyDown", "fullWidth", "name", "readOnly", "inputProps", "inputRef", "sectionListRef"];
23
+ const _excluded = ["elements", "areAllSectionsEmpty", "defaultValue", "label", "value", "onChange", "id", "autoFocus", "endAdornment", "startAdornment", "renderSuffix", "slots", "slotProps", "contentEditable", "tabIndex", "onInput", "onPaste", "onKeyDown", "fullWidth", "name", "readOnly", "inputProps", "inputRef", "sectionListRef"];
23
24
  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); }
24
25
  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; }
25
26
  const round = value => Math.round(value * 1e5) / 1e5;
@@ -28,8 +29,7 @@ const PickersInputBaseRoot = exports.PickersInputBaseRoot = (0, _styles.styled)(
28
29
  slot: 'Root',
29
30
  overridesResolver: (props, styles) => styles.root
30
31
  })(({
31
- theme,
32
- ownerState
32
+ theme
33
33
  }) => (0, _extends2.default)({}, theme.typography.body1, {
34
34
  color: (theme.vars || theme).palette.text.primary,
35
35
  cursor: 'text',
@@ -40,17 +40,22 @@ const PickersInputBaseRoot = exports.PickersInputBaseRoot = (0, _styles.styled)(
40
40
  position: 'relative',
41
41
  boxSizing: 'border-box',
42
42
  // Prevent padding issue with fullWidth.
43
- letterSpacing: `${round(0.15 / 16)}em`
44
- }, ownerState.fullWidth && {
45
- width: '100%'
43
+ letterSpacing: `${round(0.15 / 16)}em`,
44
+ variants: [{
45
+ props: {
46
+ fullWidth: true
47
+ },
48
+ style: {
49
+ width: '100%'
50
+ }
51
+ }]
46
52
  }));
47
53
  const PickersInputBaseSectionsContainer = exports.PickersInputBaseSectionsContainer = (0, _styles.styled)(_PickersSectionList.Unstable_PickersSectionListRoot, {
48
54
  name: 'MuiPickersInputBase',
49
55
  slot: 'SectionsContainer',
50
56
  overridesResolver: (props, styles) => styles.sectionsContainer
51
57
  })(({
52
- theme,
53
- ownerState
58
+ theme
54
59
  }) => (0, _extends2.default)({
55
60
  padding: '4px 0 5px',
56
61
  fontFamily: theme.typography.fontFamily,
@@ -65,19 +70,41 @@ const PickersInputBaseSectionsContainer = exports.PickersInputBaseSectionsContai
65
70
  letterSpacing: 'inherit',
66
71
  // Baseline behavior
67
72
  width: '182px'
68
- }, ownerState.size === 'small' && {
69
- paddingTop: 1
70
73
  }, theme.direction === 'rtl' && {
71
74
  textAlign: 'right /*! @noflip */'
72
- }, !(ownerState.adornedStart || ownerState.focused || ownerState.filled) && (0, _extends2.default)({
73
- color: 'currentColor'
74
- }, ownerState.label == null && (theme.vars ? {
75
- opacity: theme.vars.opacity.inputPlaceholder
76
- } : {
77
- opacity: theme.palette.mode === 'light' ? 0.42 : 0.5
78
- }), ownerState.label != null && {
79
- opacity: 0
80
- })));
75
+ }, {
76
+ variants: [{
77
+ props: {
78
+ size: 'small'
79
+ },
80
+ style: {
81
+ paddingTop: 1
82
+ }
83
+ }, {
84
+ props: {
85
+ adornedStart: false,
86
+ focused: false,
87
+ filled: false
88
+ },
89
+ style: {
90
+ color: 'currentColor',
91
+ opacity: 0
92
+ }
93
+ }, {
94
+ // Can't use the object notation because label can be null or undefined
95
+ props: ({
96
+ adornedStart,
97
+ focused,
98
+ filled,
99
+ label
100
+ }) => !adornedStart && !focused && !filled && label == null,
101
+ style: theme.vars ? {
102
+ opacity: theme.vars.opacity.inputPlaceholder
103
+ } : {
104
+ opacity: theme.palette.mode === 'light' ? 0.42 : 0.5
105
+ }
106
+ }]
107
+ }));
81
108
  const PickersInputBaseSection = (0, _styles.styled)(_PickersSectionList.Unstable_PickersSectionListSection, {
82
109
  name: 'MuiPickersInputBase',
83
110
  slot: 'Section',
@@ -161,6 +188,7 @@ const PickersInputBase = exports.PickersInputBase = /*#__PURE__*/React.forwardRe
161
188
  startAdornment,
162
189
  renderSuffix,
163
190
  slots,
191
+ slotProps,
164
192
  contentEditable,
165
193
  tabIndex,
166
194
  onInput,
@@ -207,12 +235,19 @@ const PickersInputBase = exports.PickersInputBase = /*#__PURE__*/React.forwardRe
207
235
  const ownerState = (0, _extends2.default)({}, props, muiFormControl);
208
236
  const classes = useUtilityClasses(ownerState);
209
237
  const InputRoot = slots?.root || PickersInputBaseRoot;
210
- const InputSectionsContainer = slots?.input || PickersInputBaseSectionsContainer;
211
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(InputRoot, (0, _extends2.default)({}, other, {
238
+ const inputRootProps = (0, _utils2.useSlotProps)({
239
+ elementType: InputRoot,
240
+ externalSlotProps: slotProps?.root,
241
+ externalForwardedProps: other,
242
+ additionalProps: {
243
+ 'aria-invalid': muiFormControl.error,
244
+ ref: handleRootRef
245
+ },
212
246
  className: classes.root,
213
- ownerState: ownerState,
214
- "aria-invalid": muiFormControl.error,
215
- ref: handleRootRef,
247
+ ownerState
248
+ });
249
+ const InputSectionsContainer = slots?.input || PickersInputBaseSectionsContainer;
250
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(InputRoot, (0, _extends2.default)({}, inputRootProps, {
216
251
  children: [startAdornment, /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickersSectionList.Unstable_PickersSectionList, {
217
252
  sectionListRef: sectionListRef,
218
253
  elements: elements,
@@ -315,6 +350,11 @@ process.env.NODE_ENV !== "production" ? PickersInputBase.propTypes = {
315
350
  getSectionIndexFromDOMElement: _propTypes.default.func.isRequired
316
351
  })
317
352
  })]),
353
+ /**
354
+ * The props used for each component slot.
355
+ * @default {}
356
+ */
357
+ slotProps: _propTypes.default.object,
318
358
  /**
319
359
  * The components used for each slot inside.
320
360
  *
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = Outline;
8
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
9
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _styles = require("@mui/material/styles");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
@@ -46,51 +46,68 @@ const OutlineLabel = (0, _styles.styled)('span')(({
46
46
  fontSize: 'inherit'
47
47
  }));
48
48
  const OutlineLegend = (0, _styles.styled)('legend')(({
49
- ownerState,
50
49
  theme
51
- }) => (0, _extends2.default)({
50
+ }) => ({
52
51
  float: 'unset',
53
52
  // Fix conflict with bootstrap
54
53
  width: 'auto',
55
54
  // Fix conflict with bootstrap
56
- overflow: 'hidden'
57
- }, !ownerState.withLabel && {
58
- padding: 0,
59
- lineHeight: '11px',
60
- // sync with `height` in `legend` styles
61
- transition: theme.transitions.create('width', {
62
- duration: 150,
63
- easing: theme.transitions.easing.easeOut
64
- })
65
- }, ownerState.withLabel && (0, _extends2.default)({
66
- display: 'block',
67
- // Fix conflict with normalize.css and sanitize.css
68
- padding: 0,
69
- height: 11,
70
- // sync with `lineHeight` in `legend` styles
71
- fontSize: '0.75em',
72
- visibility: 'hidden',
73
- maxWidth: 0.01,
74
- transition: theme.transitions.create('max-width', {
75
- duration: 50,
76
- easing: theme.transitions.easing.easeOut
77
- }),
78
- whiteSpace: 'nowrap',
79
- '& > span': {
80
- paddingLeft: 5,
81
- paddingRight: 5,
82
- display: 'inline-block',
83
- opacity: 0,
84
- visibility: 'visible'
85
- }
86
- }, ownerState.notched && {
87
- maxWidth: '100%',
88
- transition: theme.transitions.create('max-width', {
89
- duration: 100,
90
- easing: theme.transitions.easing.easeOut,
91
- delay: 50
92
- })
93
- })));
55
+ overflow: 'hidden',
56
+ // Fix Horizontal scroll when label too long
57
+ variants: [{
58
+ props: {
59
+ withLabel: false
60
+ },
61
+ style: {
62
+ padding: 0,
63
+ lineHeight: '11px',
64
+ // sync with `height` in `legend` styles
65
+ transition: theme.transitions.create('width', {
66
+ duration: 150,
67
+ easing: theme.transitions.easing.easeOut
68
+ })
69
+ }
70
+ }, {
71
+ props: {
72
+ withLabel: true
73
+ },
74
+ style: {
75
+ display: 'block',
76
+ // Fix conflict with normalize.css and sanitize.css
77
+ padding: 0,
78
+ height: 11,
79
+ // sync with `lineHeight` in `legend` styles
80
+ fontSize: '0.75em',
81
+ visibility: 'hidden',
82
+ maxWidth: 0.01,
83
+ transition: theme.transitions.create('max-width', {
84
+ duration: 50,
85
+ easing: theme.transitions.easing.easeOut
86
+ }),
87
+ whiteSpace: 'nowrap',
88
+ '& > span': {
89
+ paddingLeft: 5,
90
+ paddingRight: 5,
91
+ display: 'inline-block',
92
+ opacity: 0,
93
+ visibility: 'visible'
94
+ }
95
+ }
96
+ }, {
97
+ props: {
98
+ withLabel: true,
99
+ notched: true
100
+ },
101
+ style: {
102
+ maxWidth: '100%',
103
+ transition: theme.transitions.create('max-width', {
104
+ duration: 100,
105
+ easing: theme.transitions.easing.easeOut,
106
+ delay: 50
107
+ })
108
+ }
109
+ }]
110
+ }));
94
111
 
95
112
  /**
96
113
  * @ignore - internal component.
@@ -26,8 +26,7 @@ const PickersOutlinedInputRoot = (0, _styles.styled)(_PickersInputBase2.PickersI
26
26
  slot: 'Root',
27
27
  overridesResolver: (props, styles) => styles.root
28
28
  })(({
29
- theme,
30
- ownerState
29
+ theme
31
30
  }) => {
32
31
  const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
33
32
  return {
@@ -44,8 +43,6 @@ const PickersOutlinedInputRoot = (0, _styles.styled)(_PickersInputBase2.PickersI
44
43
  },
45
44
  [`&.${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.focused} .${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.notchedOutline}`]: {
46
45
  borderStyle: 'solid',
47
- // @ts-ignore
48
- borderColor: (theme.vars || theme).palette[ownerState.color].main,
49
46
  borderWidth: 2
50
47
  },
51
48
  [`&.${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.disabled}`]: {
@@ -58,20 +55,37 @@ const PickersOutlinedInputRoot = (0, _styles.styled)(_PickersInputBase2.PickersI
58
55
  },
59
56
  [`&.${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.error} .${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.notchedOutline}`]: {
60
57
  borderColor: (theme.vars || theme).palette.error.main
61
- }
58
+ },
59
+ variants: Object.keys((theme.vars ?? theme).palette)
60
+ // @ts-ignore
61
+ .filter(key => (theme.vars ?? theme).palette[key].main).map(color => ({
62
+ props: {
63
+ color
64
+ },
65
+ style: {
66
+ [`&.${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.focused}:not(.${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.error}) .${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.notchedOutline}`]: {
67
+ // @ts-ignore
68
+ borderColor: (theme.vars || theme).palette[color].main
69
+ }
70
+ }
71
+ }))
62
72
  };
63
73
  });
64
74
  const PickersOutlinedInputSectionsContainer = (0, _styles.styled)(_PickersInputBase2.PickersInputBaseSectionsContainer, {
65
75
  name: 'MuiPickersOutlinedInput',
66
76
  slot: 'SectionsContainer',
67
77
  overridesResolver: (props, styles) => styles.sectionsContainer
68
- })(({
69
- ownerState
70
- }) => (0, _extends2.default)({
71
- padding: '16.5px 0'
72
- }, ownerState.size === 'small' && {
73
- padding: '8.5px 0'
74
- }));
78
+ })({
79
+ padding: '16.5px 0',
80
+ variants: [{
81
+ props: {
82
+ size: 'small'
83
+ },
84
+ style: {
85
+ padding: '8.5px 0'
86
+ }
87
+ }]
88
+ });
75
89
  const useUtilityClasses = ownerState => {
76
90
  const {
77
91
  classes
@@ -180,6 +194,11 @@ process.env.NODE_ENV !== "production" ? PickersOutlinedInput.propTypes = {
180
194
  getSectionIndexFromDOMElement: _propTypes.default.func.isRequired
181
195
  })
182
196
  })]),
197
+ /**
198
+ * The props used for each component slot.
199
+ * @default {}
200
+ */
201
+ slotProps: _propTypes.default.object,
183
202
  /**
184
203
  * The components used for each slot inside.
185
204
  *
@@ -73,7 +73,7 @@ StaticDatePicker.propTypes = {
73
73
  * Formats the day of week displayed in the calendar header.
74
74
  * @param {TDate} date The date of the day of week provided by the adapter.
75
75
  * @returns {string} The name to display.
76
- * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
76
+ * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
77
77
  */
78
78
  dayOfWeekFormatter: _propTypes.default.func,
79
79
  /**
@@ -73,7 +73,7 @@ StaticDateTimePicker.propTypes = {
73
73
  // ----------------------------------------------------------------------
74
74
  /**
75
75
  * 12h/24h view for hour selection clock.
76
- * @default `utils.is12HourCycleInCurrentLocale()`
76
+ * @default utils.is12HourCycleInCurrentLocale()
77
77
  */
78
78
  ampm: _propTypes.default.bool,
79
79
  /**
@@ -93,7 +93,7 @@ StaticDateTimePicker.propTypes = {
93
93
  * Formats the day of week displayed in the calendar header.
94
94
  * @param {TDate} date The date of the day of week provided by the adapter.
95
95
  * @returns {string} The name to display.
96
- * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
96
+ * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
97
97
  */
98
98
  dayOfWeekFormatter: _propTypes.default.func,
99
99
  /**
@@ -65,7 +65,7 @@ StaticTimePicker.propTypes = {
65
65
  // ----------------------------------------------------------------------
66
66
  /**
67
67
  * 12h/24h view for hour selection clock.
68
- * @default `utils.is12HourCycleInCurrentLocale()`
68
+ * @default utils.is12HourCycleInCurrentLocale()
69
69
  */
70
70
  ampm: _propTypes.default.bool,
71
71
  /**
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.Clock = Clock;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
8
  var React = _interopRequireWildcard(require("react"));
10
9
  var _clsx = _interopRequireDefault(require("clsx"));
11
10
  var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
@@ -74,9 +73,7 @@ const ClockSquareMask = (0, _styles.styled)('div', {
74
73
  name: 'MuiClock',
75
74
  slot: 'SquareMask',
76
75
  overridesResolver: (_, styles) => styles.squareMask
77
- })(({
78
- ownerState
79
- }) => (0, _extends2.default)({
76
+ })({
80
77
  width: '100%',
81
78
  height: '100%',
82
79
  position: 'absolute',
@@ -84,16 +81,22 @@ const ClockSquareMask = (0, _styles.styled)('div', {
84
81
  outline: 0,
85
82
  // Disable scroll capabilities.
86
83
  touchAction: 'none',
87
- userSelect: 'none'
88
- }, ownerState.disabled ? {} : {
89
- '@media (pointer: fine)': {
90
- cursor: 'pointer',
91
- borderRadius: '50%'
92
- },
93
- '&:active': {
94
- cursor: 'move'
95
- }
96
- }));
84
+ userSelect: 'none',
85
+ variants: [{
86
+ props: {
87
+ disabled: false
88
+ },
89
+ style: {
90
+ '@media (pointer: fine)': {
91
+ cursor: 'pointer',
92
+ borderRadius: '50%'
93
+ },
94
+ '&:active': {
95
+ cursor: 'move'
96
+ }
97
+ }
98
+ }]
99
+ });
97
100
  const ClockPin = (0, _styles.styled)('div', {
98
101
  name: 'MuiClock',
99
102
  slot: 'Pin',
@@ -115,44 +118,54 @@ const ClockAmButton = (0, _styles.styled)(_IconButton.default, {
115
118
  slot: 'AmButton',
116
119
  overridesResolver: (_, styles) => styles.amButton
117
120
  })(({
118
- theme,
119
- ownerState
120
- }) => (0, _extends2.default)({
121
+ theme
122
+ }) => ({
121
123
  zIndex: 1,
122
124
  position: 'absolute',
123
125
  bottom: 8,
124
126
  left: 8,
125
127
  paddingLeft: 4,
126
128
  paddingRight: 4,
127
- width: _shared.CLOCK_HOUR_WIDTH
128
- }, ownerState.meridiemMode === 'am' && {
129
- backgroundColor: (theme.vars || theme).palette.primary.main,
130
- color: (theme.vars || theme).palette.primary.contrastText,
131
- '&:hover': {
132
- backgroundColor: (theme.vars || theme).palette.primary.light
133
- }
129
+ width: _shared.CLOCK_HOUR_WIDTH,
130
+ variants: [{
131
+ props: {
132
+ meridiemMode: 'am'
133
+ },
134
+ style: {
135
+ backgroundColor: (theme.vars || theme).palette.primary.main,
136
+ color: (theme.vars || theme).palette.primary.contrastText,
137
+ '&:hover': {
138
+ backgroundColor: (theme.vars || theme).palette.primary.light
139
+ }
140
+ }
141
+ }]
134
142
  }));
135
143
  const ClockPmButton = (0, _styles.styled)(_IconButton.default, {
136
144
  name: 'MuiClock',
137
145
  slot: 'PmButton',
138
146
  overridesResolver: (_, styles) => styles.pmButton
139
147
  })(({
140
- theme,
141
- ownerState
142
- }) => (0, _extends2.default)({
148
+ theme
149
+ }) => ({
143
150
  zIndex: 1,
144
151
  position: 'absolute',
145
152
  bottom: 8,
146
153
  right: 8,
147
154
  paddingLeft: 4,
148
155
  paddingRight: 4,
149
- width: _shared.CLOCK_HOUR_WIDTH
150
- }, ownerState.meridiemMode === 'pm' && {
151
- backgroundColor: (theme.vars || theme).palette.primary.main,
152
- color: (theme.vars || theme).palette.primary.contrastText,
153
- '&:hover': {
154
- backgroundColor: (theme.vars || theme).palette.primary.light
155
- }
156
+ width: _shared.CLOCK_HOUR_WIDTH,
157
+ variants: [{
158
+ props: {
159
+ meridiemMode: 'pm'
160
+ },
161
+ style: {
162
+ backgroundColor: (theme.vars || theme).palette.primary.main,
163
+ color: (theme.vars || theme).palette.primary.contrastText,
164
+ '&:hover': {
165
+ backgroundColor: (theme.vars || theme).palette.primary.light
166
+ }
167
+ }
168
+ }]
156
169
  }));
157
170
  const ClockMeridiemText = (0, _styles.styled)(_Typography.default, {
158
171
  name: 'MuiClock',
@@ -186,7 +199,7 @@ function Clock(inProps) {
186
199
  selectedId,
187
200
  type,
188
201
  viewValue,
189
- disabled,
202
+ disabled = false,
190
203
  readOnly,
191
204
  className
192
205
  } = props;
@@ -37,9 +37,8 @@ const ClockNumberRoot = (0, _styles.styled)('span', {
37
37
  [`&.${_clockNumberClasses.clockNumberClasses.selected}`]: styles.selected
38
38
  }]
39
39
  })(({
40
- theme,
41
- ownerState
42
- }) => (0, _extends2.default)({
40
+ theme
41
+ }) => ({
43
42
  height: _shared.CLOCK_HOUR_WIDTH,
44
43
  width: _shared.CLOCK_HOUR_WIDTH,
45
44
  position: 'absolute',
@@ -59,10 +58,16 @@ const ClockNumberRoot = (0, _styles.styled)('span', {
59
58
  [`&.${_clockNumberClasses.clockNumberClasses.disabled}`]: {
60
59
  pointerEvents: 'none',
61
60
  color: (theme.vars || theme).palette.text.disabled
62
- }
63
- }, ownerState.inner && (0, _extends2.default)({}, theme.typography.body2, {
64
- color: (theme.vars || theme).palette.text.secondary
65
- })));
61
+ },
62
+ variants: [{
63
+ props: {
64
+ inner: true
65
+ },
66
+ style: (0, _extends2.default)({}, theme.typography.body2, {
67
+ color: (theme.vars || theme).palette.text.secondary
68
+ })
69
+ }]
70
+ }));
66
71
 
67
72
  /**
68
73
  * @ignore - internal component.
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.ClockPointer = ClockPointer;
8
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
9
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _clsx = _interopRequireDefault(require("clsx"));
12
12
  var _styles = require("@mui/material/styles");
@@ -32,26 +32,30 @@ const ClockPointerRoot = (0, _styles.styled)('div', {
32
32
  slot: 'Root',
33
33
  overridesResolver: (_, styles) => styles.root
34
34
  })(({
35
- theme,
36
- ownerState
37
- }) => (0, _extends2.default)({
35
+ theme
36
+ }) => ({
38
37
  width: 2,
39
38
  backgroundColor: (theme.vars || theme).palette.primary.main,
40
39
  position: 'absolute',
41
40
  left: 'calc(50% - 1px)',
42
41
  bottom: '50%',
43
- transformOrigin: 'center bottom 0px'
44
- }, ownerState.shouldAnimate && {
45
- transition: theme.transitions.create(['transform', 'height'])
42
+ transformOrigin: 'center bottom 0px',
43
+ variants: [{
44
+ props: {
45
+ shouldAnimate: true
46
+ },
47
+ style: {
48
+ transition: theme.transitions.create(['transform', 'height'])
49
+ }
50
+ }]
46
51
  }));
47
52
  const ClockPointerThumb = (0, _styles.styled)('div', {
48
53
  name: 'MuiClockPointer',
49
54
  slot: 'Thumb',
50
55
  overridesResolver: (_, styles) => styles.thumb
51
56
  })(({
52
- theme,
53
- ownerState
54
- }) => (0, _extends2.default)({
57
+ theme
58
+ }) => ({
55
59
  width: 4,
56
60
  height: 4,
57
61
  backgroundColor: (theme.vars || theme).palette.primary.contrastText,
@@ -60,9 +64,15 @@ const ClockPointerThumb = (0, _styles.styled)('div', {
60
64
  top: -21,
61
65
  left: `calc(50% - ${_shared.CLOCK_HOUR_WIDTH / 2}px)`,
62
66
  border: `${(_shared.CLOCK_HOUR_WIDTH - 4) / 2}px solid ${(theme.vars || theme).palette.primary.main}`,
63
- boxSizing: 'content-box'
64
- }, ownerState.hasSelected && {
65
- backgroundColor: (theme.vars || theme).palette.primary.main
67
+ boxSizing: 'content-box',
68
+ variants: [{
69
+ props: {
70
+ hasSelected: true
71
+ },
72
+ style: {
73
+ backgroundColor: (theme.vars || theme).palette.primary.main
74
+ }
75
+ }]
66
76
  }));
67
77
 
68
78
  /**
@@ -325,7 +325,7 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
325
325
  // ----------------------------------------------------------------------
326
326
  /**
327
327
  * 12h/24h view for hour selection clock.
328
- * @default `utils.is12HourCycleInCurrentLocale()`
328
+ * @default utils.is12HourCycleInCurrentLocale()
329
329
  */
330
330
  ampm: _propTypes.default.bool,
331
331
  /**
@@ -73,7 +73,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
73
73
  // ----------------------------------------------------------------------
74
74
  /**
75
75
  * 12h/24h view for hour selection clock.
76
- * @default `utils.is12HourCycleInCurrentLocale()`
76
+ * @default utils.is12HourCycleInCurrentLocale()
77
77
  */
78
78
  ampm: _propTypes.default.bool,
79
79
  /**
@@ -284,7 +284,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
284
284
  * Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
285
285
  * This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
286
286
  *
287
- * @default `false`
287
+ * @default false
288
288
  */
289
289
  shouldRespectLeadingZeros: _propTypes.default.bool,
290
290
  /**
@@ -59,7 +59,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
59
59
  // ----------------------------------------------------------------------
60
60
  /**
61
61
  * 12h/24h view for hour selection clock.
62
- * @default `utils.is12HourCycleInCurrentLocale()`
62
+ * @default utils.is12HourCycleInCurrentLocale()
63
63
  */
64
64
  ampm: _propTypes.default.bool,
65
65
  /**