@mui/x-date-pickers 7.0.0-alpha.9 → 7.0.0-beta.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 (225) hide show
  1. package/CHANGELOG.md +386 -38
  2. package/DateTimePicker/DateTimePickerTabs.js +7 -4
  3. package/DateTimePicker/DateTimePickerToolbar.d.ts +6 -1
  4. package/DateTimePicker/DateTimePickerToolbar.js +33 -17
  5. package/PickersLayout/PickersLayout.types.d.ts +6 -5
  6. package/PickersLayout/pickersLayoutClasses.js +3 -2
  7. package/PickersLayout/usePickerLayout.d.ts +2 -2
  8. package/PickersLayout/usePickerLayout.js +2 -1
  9. package/README.md +2 -2
  10. package/TimeClock/TimeClock.js +3 -3
  11. package/TimePicker/timePickerToolbarClasses.d.ts +8 -0
  12. package/dateTimeViewRenderers/dateTimeViewRenderers.js +4 -4
  13. package/index.js +1 -1
  14. package/internals/hooks/usePicker/usePicker.d.ts +1 -1
  15. package/internals/hooks/usePicker/usePicker.js +4 -2
  16. package/internals/hooks/usePicker/usePicker.types.d.ts +1 -1
  17. package/internals/hooks/usePicker/usePickerViews.d.ts +11 -2
  18. package/internals/hooks/usePicker/usePickerViews.js +8 -3
  19. package/internals/index.d.ts +4 -4
  20. package/internals/index.js +2 -2
  21. package/internals/models/props/tabs.d.ts +2 -1
  22. package/legacy/DateTimePicker/DateTimePickerTabs.js +7 -4
  23. package/legacy/DateTimePicker/DateTimePickerToolbar.js +43 -29
  24. package/legacy/PickersLayout/pickersLayoutClasses.js +3 -2
  25. package/legacy/PickersLayout/usePickerLayout.js +2 -1
  26. package/legacy/TimeClock/TimeClock.js +3 -3
  27. package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +5 -4
  28. package/legacy/index.js +1 -1
  29. package/legacy/internals/hooks/usePicker/usePicker.js +4 -2
  30. package/legacy/internals/hooks/usePicker/usePickerViews.js +8 -3
  31. package/legacy/internals/index.js +2 -2
  32. package/legacy/locales/beBY.js +8 -3
  33. package/legacy/locales/caES.js +7 -2
  34. package/legacy/locales/csCZ.js +8 -3
  35. package/legacy/locales/daDK.js +8 -3
  36. package/legacy/locales/deDE.js +6 -1
  37. package/legacy/locales/elGR.js +8 -3
  38. package/legacy/locales/enUS.js +7 -3
  39. package/legacy/locales/esES.js +8 -3
  40. package/legacy/locales/eu.js +6 -1
  41. package/legacy/locales/faIR.js +6 -1
  42. package/legacy/locales/fiFI.js +8 -3
  43. package/legacy/locales/frFR.js +6 -1
  44. package/legacy/locales/heIL.js +6 -1
  45. package/legacy/locales/huHU.js +6 -1
  46. package/legacy/locales/isIS.js +8 -3
  47. package/legacy/locales/itIT.js +8 -3
  48. package/legacy/locales/jaJP.js +6 -1
  49. package/legacy/locales/koKR.js +6 -1
  50. package/legacy/locales/kzKZ.js +6 -1
  51. package/legacy/locales/mk.js +6 -1
  52. package/legacy/locales/nbNO.js +8 -3
  53. package/legacy/locales/nlNL.js +8 -3
  54. package/legacy/locales/plPL.js +8 -3
  55. package/legacy/locales/ptBR.js +6 -1
  56. package/legacy/locales/roRO.js +6 -1
  57. package/legacy/locales/ruRU.js +8 -3
  58. package/legacy/locales/skSK.js +8 -3
  59. package/legacy/locales/svSE.js +8 -3
  60. package/legacy/locales/trTR.js +8 -3
  61. package/legacy/locales/ukUA.js +8 -3
  62. package/legacy/locales/urPK.js +6 -1
  63. package/legacy/locales/viVN.js +8 -3
  64. package/legacy/locales/zhCN.js +6 -1
  65. package/legacy/locales/zhHK.js +6 -1
  66. package/locales/beBY.d.ts +4 -0
  67. package/locales/beBY.js +8 -3
  68. package/locales/caES.d.ts +4 -0
  69. package/locales/caES.js +7 -2
  70. package/locales/csCZ.d.ts +4 -0
  71. package/locales/csCZ.js +8 -3
  72. package/locales/daDK.d.ts +4 -0
  73. package/locales/daDK.js +8 -3
  74. package/locales/deDE.d.ts +4 -0
  75. package/locales/deDE.js +6 -1
  76. package/locales/elGR.d.ts +4 -0
  77. package/locales/elGR.js +8 -3
  78. package/locales/enUS.d.ts +4 -0
  79. package/locales/enUS.js +7 -3
  80. package/locales/esES.d.ts +4 -0
  81. package/locales/esES.js +8 -3
  82. package/locales/eu.d.ts +4 -0
  83. package/locales/eu.js +6 -1
  84. package/locales/faIR.d.ts +4 -0
  85. package/locales/faIR.js +6 -1
  86. package/locales/fiFI.d.ts +4 -0
  87. package/locales/fiFI.js +8 -3
  88. package/locales/frFR.d.ts +4 -0
  89. package/locales/frFR.js +6 -1
  90. package/locales/heIL.d.ts +4 -0
  91. package/locales/heIL.js +6 -1
  92. package/locales/huHU.d.ts +4 -0
  93. package/locales/huHU.js +6 -1
  94. package/locales/isIS.d.ts +4 -0
  95. package/locales/isIS.js +8 -3
  96. package/locales/itIT.d.ts +4 -0
  97. package/locales/itIT.js +8 -3
  98. package/locales/jaJP.d.ts +4 -0
  99. package/locales/jaJP.js +6 -1
  100. package/locales/koKR.d.ts +4 -0
  101. package/locales/koKR.js +6 -1
  102. package/locales/kzKZ.d.ts +4 -0
  103. package/locales/kzKZ.js +6 -1
  104. package/locales/mk.d.ts +4 -0
  105. package/locales/mk.js +6 -1
  106. package/locales/nbNO.d.ts +4 -0
  107. package/locales/nbNO.js +8 -3
  108. package/locales/nlNL.d.ts +4 -0
  109. package/locales/nlNL.js +8 -3
  110. package/locales/plPL.d.ts +4 -0
  111. package/locales/plPL.js +8 -3
  112. package/locales/ptBR.d.ts +4 -0
  113. package/locales/ptBR.js +6 -1
  114. package/locales/roRO.d.ts +4 -0
  115. package/locales/roRO.js +6 -1
  116. package/locales/ruRU.d.ts +4 -0
  117. package/locales/ruRU.js +8 -3
  118. package/locales/skSK.d.ts +4 -0
  119. package/locales/skSK.js +8 -3
  120. package/locales/svSE.d.ts +4 -0
  121. package/locales/svSE.js +8 -3
  122. package/locales/trTR.d.ts +4 -0
  123. package/locales/trTR.js +8 -3
  124. package/locales/ukUA.d.ts +4 -0
  125. package/locales/ukUA.js +8 -3
  126. package/locales/urPK.d.ts +4 -0
  127. package/locales/urPK.js +6 -1
  128. package/locales/utils/getPickersLocalization.d.ts +4 -0
  129. package/locales/utils/pickersLocaleTextApi.d.ts +4 -0
  130. package/locales/viVN.d.ts +4 -0
  131. package/locales/viVN.js +8 -3
  132. package/locales/zhCN.d.ts +4 -0
  133. package/locales/zhCN.js +6 -1
  134. package/locales/zhHK.d.ts +4 -0
  135. package/locales/zhHK.js +6 -1
  136. package/modern/DateTimePicker/DateTimePickerTabs.js +7 -4
  137. package/modern/DateTimePicker/DateTimePickerToolbar.js +33 -17
  138. package/modern/PickersLayout/pickersLayoutClasses.js +3 -2
  139. package/modern/PickersLayout/usePickerLayout.js +2 -1
  140. package/modern/TimeClock/TimeClock.js +3 -3
  141. package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +4 -4
  142. package/modern/index.js +1 -1
  143. package/modern/internals/hooks/usePicker/usePicker.js +4 -2
  144. package/modern/internals/hooks/usePicker/usePickerViews.js +8 -3
  145. package/modern/internals/index.js +2 -2
  146. package/modern/locales/beBY.js +8 -3
  147. package/modern/locales/caES.js +7 -2
  148. package/modern/locales/csCZ.js +8 -3
  149. package/modern/locales/daDK.js +8 -3
  150. package/modern/locales/deDE.js +6 -1
  151. package/modern/locales/elGR.js +8 -3
  152. package/modern/locales/enUS.js +7 -3
  153. package/modern/locales/esES.js +8 -3
  154. package/modern/locales/eu.js +6 -1
  155. package/modern/locales/faIR.js +6 -1
  156. package/modern/locales/fiFI.js +8 -3
  157. package/modern/locales/frFR.js +6 -1
  158. package/modern/locales/heIL.js +6 -1
  159. package/modern/locales/huHU.js +6 -1
  160. package/modern/locales/isIS.js +8 -3
  161. package/modern/locales/itIT.js +8 -3
  162. package/modern/locales/jaJP.js +6 -1
  163. package/modern/locales/koKR.js +6 -1
  164. package/modern/locales/kzKZ.js +6 -1
  165. package/modern/locales/mk.js +6 -1
  166. package/modern/locales/nbNO.js +8 -3
  167. package/modern/locales/nlNL.js +8 -3
  168. package/modern/locales/plPL.js +8 -3
  169. package/modern/locales/ptBR.js +6 -1
  170. package/modern/locales/roRO.js +6 -1
  171. package/modern/locales/ruRU.js +8 -3
  172. package/modern/locales/skSK.js +8 -3
  173. package/modern/locales/svSE.js +8 -3
  174. package/modern/locales/trTR.js +8 -3
  175. package/modern/locales/ukUA.js +8 -3
  176. package/modern/locales/urPK.js +6 -1
  177. package/modern/locales/viVN.js +8 -3
  178. package/modern/locales/zhCN.js +6 -1
  179. package/modern/locales/zhHK.js +6 -1
  180. package/node/DateTimePicker/DateTimePickerTabs.js +8 -5
  181. package/node/DateTimePicker/DateTimePickerToolbar.js +34 -18
  182. package/node/PickersLayout/pickersLayoutClasses.js +5 -3
  183. package/node/PickersLayout/usePickerLayout.js +2 -1
  184. package/node/TimeClock/TimeClock.js +3 -3
  185. package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +4 -4
  186. package/node/index.js +1 -1
  187. package/node/internals/hooks/usePicker/usePicker.js +4 -2
  188. package/node/internals/hooks/usePicker/usePickerViews.js +8 -3
  189. package/node/internals/index.js +12 -0
  190. package/node/locales/beBY.js +8 -3
  191. package/node/locales/caES.js +7 -2
  192. package/node/locales/csCZ.js +8 -3
  193. package/node/locales/daDK.js +8 -3
  194. package/node/locales/deDE.js +6 -1
  195. package/node/locales/elGR.js +8 -3
  196. package/node/locales/enUS.js +7 -3
  197. package/node/locales/esES.js +8 -3
  198. package/node/locales/eu.js +6 -1
  199. package/node/locales/faIR.js +6 -1
  200. package/node/locales/fiFI.js +8 -3
  201. package/node/locales/frFR.js +6 -1
  202. package/node/locales/heIL.js +6 -1
  203. package/node/locales/huHU.js +6 -1
  204. package/node/locales/isIS.js +8 -3
  205. package/node/locales/itIT.js +8 -3
  206. package/node/locales/jaJP.js +6 -1
  207. package/node/locales/koKR.js +6 -1
  208. package/node/locales/kzKZ.js +6 -1
  209. package/node/locales/mk.js +6 -1
  210. package/node/locales/nbNO.js +8 -3
  211. package/node/locales/nlNL.js +8 -3
  212. package/node/locales/plPL.js +8 -3
  213. package/node/locales/ptBR.js +6 -1
  214. package/node/locales/roRO.js +6 -1
  215. package/node/locales/ruRU.js +8 -3
  216. package/node/locales/skSK.js +8 -3
  217. package/node/locales/svSE.js +8 -3
  218. package/node/locales/trTR.js +8 -3
  219. package/node/locales/ukUA.js +8 -3
  220. package/node/locales/urPK.js +6 -1
  221. package/node/locales/viVN.js +8 -3
  222. package/node/locales/zhCN.js +6 -1
  223. package/node/locales/zhHK.js +6 -1
  224. package/package.json +5 -5
  225. package/timeViewRenderers/timeViewRenderers.d.ts +1 -1
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
+ import clsx from 'clsx';
2
3
  import PropTypes from 'prop-types';
3
4
  import Tab from '@mui/material/Tab';
4
5
  import Tabs, { tabsClasses } from '@mui/material/Tabs';
5
6
  import { styled, useThemeProps } from '@mui/material/styles';
6
- import { unstable_composeClasses as composeClasses } from '@mui/utils';
7
+ import composeClasses from '@mui/utils/composeClasses';
7
8
  import { TimeIcon, DateRangeIcon } from '../icons';
8
9
  import { useLocaleText } from '../internals/hooks/useUtils';
9
10
  import { getDateTimePickerTabsUtilityClass } from './dateTimePickerTabsClasses';
@@ -68,7 +69,8 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
68
69
  onViewChange,
69
70
  timeIcon = /*#__PURE__*/_jsx(TimeIcon, {}),
70
71
  view,
71
- hidden = typeof window === 'undefined' || window.innerHeight < 667
72
+ hidden = typeof window === 'undefined' || window.innerHeight < 667,
73
+ className
72
74
  } = props;
73
75
  const localeText = useLocaleText();
74
76
  const classes = useUtilityClasses(props);
@@ -83,7 +85,7 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
83
85
  variant: "fullWidth",
84
86
  value: viewToTab(view),
85
87
  onChange: handleChange,
86
- className: classes.root,
88
+ className: clsx(className, classes.root),
87
89
  children: [/*#__PURE__*/_jsx(Tab, {
88
90
  value: "date",
89
91
  "aria-label": localeText.dateTableLabel,
@@ -108,6 +110,7 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
108
110
  * Override or extend the styles applied to the component.
109
111
  */
110
112
  classes: PropTypes.object,
113
+ className: PropTypes.string,
111
114
  /**
112
115
  * Date tab icon.
113
116
  * @default DateRange
@@ -119,7 +122,7 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
119
122
  */
120
123
  hidden: PropTypes.bool,
121
124
  /**
122
- * Callback called when a tab is clicked
125
+ * Callback called when a tab is clicked.
123
126
  * @template TView
124
127
  * @param {TView} view The view to open
125
128
  */
@@ -2,16 +2,21 @@ import * as React from 'react';
2
2
  import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
3
3
  import { DateTimePickerToolbarClasses } from './dateTimePickerToolbarClasses';
4
4
  import { DateOrTimeViewWithMeridiem, WrapperVariant } from '../internals/models';
5
+ import { MakeOptional } from '../internals/models/helpers';
5
6
  export interface ExportedDateTimePickerToolbarProps extends ExportedBaseToolbarProps {
6
7
  ampm?: boolean;
7
8
  ampmInClock?: boolean;
8
9
  }
9
- export interface DateTimePickerToolbarProps<TDate> extends ExportedDateTimePickerToolbarProps, BaseToolbarProps<TDate | null, DateOrTimeViewWithMeridiem> {
10
+ export interface DateTimePickerToolbarProps<TDate> extends ExportedDateTimePickerToolbarProps, MakeOptional<BaseToolbarProps<TDate | null, DateOrTimeViewWithMeridiem>, 'view'> {
10
11
  /**
11
12
  * Override or extend the styles applied to the component.
12
13
  */
13
14
  classes?: Partial<DateTimePickerToolbarClasses>;
14
15
  toolbarVariant?: WrapperVariant;
16
+ /**
17
+ * If provided, it will be used instead of `dateTimePickerToolbarTitle` from localization.
18
+ */
19
+ toolbarTitle?: React.ReactNode;
15
20
  }
16
21
  /**
17
22
  * Demos:
@@ -1,10 +1,11 @@
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", "onChange", "view", "isLandscape", "onViewChange", "toolbarFormat", "toolbarPlaceholder", "views", "disabled", "readOnly", "toolbarVariant"];
3
+ const _excluded = ["ampm", "ampmInClock", "value", "onChange", "view", "isLandscape", "onViewChange", "toolbarFormat", "toolbarPlaceholder", "views", "disabled", "readOnly", "toolbarVariant", "toolbarTitle", "className"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { styled, useThemeProps, useTheme } from '@mui/material/styles';
7
- import { unstable_composeClasses as composeClasses } from '@mui/utils';
7
+ import composeClasses from '@mui/utils/composeClasses';
8
+ import clsx from 'clsx';
8
9
  import { PickersToolbarText } from '../internals/components/PickersToolbarText';
9
10
  import { PickersToolbar } from '../internals/components/PickersToolbar';
10
11
  import { PickersToolbarButton } from '../internals/components/PickersToolbarButton';
@@ -13,6 +14,8 @@ import { dateTimePickerToolbarClasses, getDateTimePickerToolbarUtilityClass } fr
13
14
  import { useMeridiemMode } from '../internals/hooks/date-helpers-hooks';
14
15
  import { MULTI_SECTION_CLOCK_SECTION_WIDTH } from '../internals/constants/dimensions';
15
16
  import { formatMeridiem } from '../internals/utils/date-utils';
17
+ import { pickersToolbarTextClasses } from '../internals/components/pickersToolbarTextClasses';
18
+ import { pickersToolbarClasses } from '../internals';
16
19
  import { jsx as _jsx } from "react/jsx-runtime";
17
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
18
21
  const useUtilityClasses = ownerState => {
@@ -39,13 +42,18 @@ const DateTimePickerToolbarRoot = styled(PickersToolbar, {
39
42
  })(({
40
43
  theme,
41
44
  ownerState
42
- }) => ({
45
+ }) => _extends({
43
46
  paddingLeft: ownerState.toolbarVariant === 'desktop' && !ownerState.isLandscape ? 24 : 16,
44
47
  paddingRight: ownerState.toolbarVariant === 'desktop' && !ownerState.isLandscape ? 0 : 16,
45
48
  borderBottom: ownerState.toolbarVariant === 'desktop' ? `1px solid ${(theme.vars || theme).palette.divider}` : undefined,
46
49
  borderRight: ownerState.toolbarVariant === 'desktop' && ownerState.isLandscape ? `1px solid ${(theme.vars || theme).palette.divider}` : undefined,
47
50
  justifyContent: 'space-around',
48
51
  position: 'relative'
52
+ }, ownerState.toolbarVariant === 'desktop' && {
53
+ [`& .${pickersToolbarClasses.content} .${pickersToolbarTextClasses.selected}`]: {
54
+ color: (theme.vars || theme).palette.primary.main,
55
+ fontWeight: theme.typography.fontWeightBold
56
+ }
49
57
  }));
50
58
  DateTimePickerToolbarRoot.propTypes = {
51
59
  // ----------------------------- Warning --------------------------------
@@ -182,7 +190,9 @@ function DateTimePickerToolbar(inProps) {
182
190
  views,
183
191
  disabled,
184
192
  readOnly,
185
- toolbarVariant = 'mobile'
193
+ toolbarVariant = 'mobile',
194
+ toolbarTitle: inToolbarTitle,
195
+ className
186
196
  } = props,
187
197
  other = _objectWithoutPropertiesLoose(props, _excluded);
188
198
  const ownerState = props;
@@ -198,6 +208,7 @@ function DateTimePickerToolbar(inProps) {
198
208
  const classes = useUtilityClasses(_extends({}, ownerState, {
199
209
  theme
200
210
  }));
211
+ const toolbarTitle = inToolbarTitle != null ? inToolbarTitle : localeText.dateTimePickerToolbarTitle;
201
212
  const formatHours = time => ampm ? utils.format(time, 'hours12h') : utils.format(time, 'hours24h');
202
213
  const dateText = React.useMemo(() => {
203
214
  if (!value) {
@@ -209,9 +220,9 @@ function DateTimePickerToolbar(inProps) {
209
220
  return utils.format(value, 'shortDate');
210
221
  }, [value, toolbarFormat, toolbarPlaceholder, utils]);
211
222
  return /*#__PURE__*/_jsxs(DateTimePickerToolbarRoot, _extends({
212
- toolbarTitle: localeText.dateTimePickerToolbarTitle,
213
223
  isLandscape: isLandscape,
214
- className: classes.root
224
+ className: clsx(classes.root, className),
225
+ toolbarTitle: toolbarTitle
215
226
  }, other, {
216
227
  ownerState: ownerState,
217
228
  children: [/*#__PURE__*/_jsxs(DateTimePickerToolbarDateContainer, {
@@ -236,14 +247,14 @@ function DateTimePickerToolbar(inProps) {
236
247
  children: [/*#__PURE__*/_jsxs(DateTimePickerToolbarTimeDigitsContainer, {
237
248
  className: classes.timeDigitsContainer,
238
249
  ownerState: ownerState,
239
- children: [views.includes('hours') && /*#__PURE__*/_jsx(PickersToolbarButton, {
240
- variant: isDesktop ? 'h5' : 'h3',
241
- width: isDesktop && !isLandscape ? MULTI_SECTION_CLOCK_SECTION_WIDTH : undefined,
242
- onClick: () => onViewChange('hours'),
243
- selected: view === 'hours',
244
- value: value ? formatHours(value) : '--'
245
- }), views.includes('minutes') && /*#__PURE__*/_jsxs(React.Fragment, {
246
- children: [/*#__PURE__*/_jsx(DateTimePickerToolbarSeparator, {
250
+ children: [views.includes('hours') && /*#__PURE__*/_jsxs(React.Fragment, {
251
+ children: [/*#__PURE__*/_jsx(PickersToolbarButton, {
252
+ variant: isDesktop ? 'h5' : 'h3',
253
+ width: isDesktop && !isLandscape ? MULTI_SECTION_CLOCK_SECTION_WIDTH : undefined,
254
+ onClick: () => onViewChange('hours'),
255
+ selected: view === 'hours',
256
+ value: value ? formatHours(value) : '--'
257
+ }), /*#__PURE__*/_jsx(DateTimePickerToolbarSeparator, {
247
258
  variant: isDesktop ? 'h5' : 'h3',
248
259
  value: ":",
249
260
  className: classes.separator,
@@ -252,8 +263,9 @@ function DateTimePickerToolbar(inProps) {
252
263
  variant: isDesktop ? 'h5' : 'h3',
253
264
  width: isDesktop && !isLandscape ? MULTI_SECTION_CLOCK_SECTION_WIDTH : undefined,
254
265
  onClick: () => onViewChange('minutes'),
255
- selected: view === 'minutes',
256
- value: value ? utils.format(value, 'minutes') : '--'
266
+ selected: view === 'minutes' || !views.includes('minutes') && view === 'hours',
267
+ value: value ? utils.format(value, 'minutes') : '--',
268
+ disabled: !views.includes('minutes')
257
269
  })]
258
270
  }), views.includes('seconds') && /*#__PURE__*/_jsxs(React.Fragment, {
259
271
  children: [/*#__PURE__*/_jsx(DateTimePickerToolbarSeparator, {
@@ -335,12 +347,16 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
335
347
  * @default "––"
336
348
  */
337
349
  toolbarPlaceholder: PropTypes.node,
350
+ /**
351
+ * If provided, it will be used instead of `dateTimePickerToolbarTitle` from localization.
352
+ */
353
+ toolbarTitle: PropTypes.node,
338
354
  toolbarVariant: PropTypes.oneOf(['desktop', 'mobile']),
339
355
  value: PropTypes.any,
340
356
  /**
341
357
  * Currently visible picker view.
342
358
  */
343
- view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']).isRequired,
359
+ view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),
344
360
  views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']).isRequired).isRequired
345
361
  } : void 0;
346
362
  export { DateTimePickerToolbar };
@@ -8,6 +8,7 @@ import { UsePickerLayoutPropsResponseLayoutProps } from '../internals/hooks/useP
8
8
  import { PickersLayoutClasses } from './pickersLayoutClasses';
9
9
  import { DateOrTimeViewWithMeridiem, WrapperVariant } from '../internals/models/common';
10
10
  import { PickersShortcutsProps } from '../PickersShortcuts';
11
+ import { ExportedPickersShortcutProps } from '../PickersShortcuts/PickersShortcuts';
11
12
  export interface ExportedPickersLayoutSlots<TValue, TDate, TView extends DateOrTimeViewWithMeridiem> {
12
13
  /**
13
14
  * Custom component for the action bar, it is placed below the picker views.
@@ -87,11 +88,11 @@ export interface PickersLayoutProps<TValue, TDate, TView extends DateOrTimeViewW
87
88
  */
88
89
  slotProps?: PickersLayoutSlotProps<TValue, TDate, TView>;
89
90
  }
90
- export interface SubComponents {
91
- toolbar: React.ReactNode;
91
+ export interface SubComponents<TValue> {
92
+ toolbar: React.ReactElement<ExportedBaseToolbarProps> | null;
92
93
  content: React.ReactNode;
93
- tabs: React.ReactNode;
94
- actionBar: React.ReactNode;
95
- shortcuts: React.ReactNode;
94
+ tabs: React.ReactElement<ExportedBaseTabsProps> | null;
95
+ actionBar: React.ReactElement<PickersActionBarProps>;
96
+ shortcuts: React.ReactElement<ExportedPickersShortcutProps<TValue>> | null;
96
97
  }
97
98
  export {};
@@ -1,5 +1,6 @@
1
- import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
1
+ import generateUtilityClass from '@mui/utils/generateUtilityClass';
2
+ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
2
3
  export function getPickersLayoutUtilityClass(slot) {
3
4
  return generateUtilityClass('MuiPickersLayout', slot);
4
5
  }
5
- export const pickersLayoutClasses = generateUtilityClasses('MuiPickersLayout', ['root', 'landscape', 'contentWrapper', 'toolbar', 'actionBar', 'shortcuts']);
6
+ export const pickersLayoutClasses = generateUtilityClasses('MuiPickersLayout', ['root', 'landscape', 'contentWrapper', 'toolbar', 'actionBar', 'tabs', 'shortcuts']);
@@ -1,6 +1,6 @@
1
1
  import { PickersLayoutProps, SubComponents } from './PickersLayout.types';
2
2
  import { DateOrTimeViewWithMeridiem } from '../internals/models';
3
- interface UsePickerLayoutResponse extends SubComponents {
3
+ interface UsePickerLayoutResponse<TValue> extends SubComponents<TValue> {
4
4
  }
5
- declare const usePickerLayout: <TValue, TDate, TView extends DateOrTimeViewWithMeridiem>(props: PickersLayoutProps<TValue, TDate, TView>) => UsePickerLayoutResponse;
5
+ declare const usePickerLayout: <TValue, TDate, TView extends DateOrTimeViewWithMeridiem>(props: PickersLayoutProps<TValue, TDate, TView>) => UsePickerLayoutResponse<TValue>;
6
6
  export default usePickerLayout;
@@ -105,7 +105,8 @@ const usePickerLayout = props => {
105
105
  const Tabs = slots == null ? void 0 : slots.tabs;
106
106
  const tabs = view && Tabs ? /*#__PURE__*/_jsx(Tabs, _extends({
107
107
  view: view,
108
- onViewChange: onViewChange
108
+ onViewChange: onViewChange,
109
+ className: classes.tabs
109
110
  }, slotProps == null ? void 0 : slotProps.tabs)) : null;
110
111
 
111
112
  // Shortcuts
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # MUI X Date Pickers
1
+ # MUI X Date Pickers
2
2
 
3
3
  This package is the community edition of the date and time picker components.
4
- It's part of [MUI X](https://mui.com/x/), an open-core extension of MUI Core, with advanced components.
4
+ It's part of [MUI X](https://mui.com/x/), an open-core extension of MUI Core, with advanced components.
5
5
 
6
6
  ## Installation
7
7
 
@@ -218,7 +218,7 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
218
218
  {
219
219
  const handleHoursChange = (hourValue, isFinish) => {
220
220
  const valueWithMeridiem = convertValueToMeridiem(hourValue, meridiemMode, ampm);
221
- setValueAndGoToNextView(utils.setHours(valueOrReferenceDate, valueWithMeridiem), isFinish);
221
+ setValueAndGoToNextView(utils.setHours(valueOrReferenceDate, valueWithMeridiem), isFinish, 'hours');
222
222
  };
223
223
  return {
224
224
  onChange: handleHoursChange,
@@ -238,7 +238,7 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
238
238
  {
239
239
  const minutesValue = utils.getMinutes(valueOrReferenceDate);
240
240
  const handleMinutesChange = (minuteValue, isFinish) => {
241
- setValueAndGoToNextView(utils.setMinutes(valueOrReferenceDate, minuteValue), isFinish);
241
+ setValueAndGoToNextView(utils.setMinutes(valueOrReferenceDate, minuteValue), isFinish, 'minutes');
242
242
  };
243
243
  return {
244
244
  viewValue: minutesValue,
@@ -257,7 +257,7 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
257
257
  {
258
258
  const secondsValue = utils.getSeconds(valueOrReferenceDate);
259
259
  const handleSecondsChange = (secondValue, isFinish) => {
260
- setValueAndGoToNextView(utils.setSeconds(valueOrReferenceDate, secondValue), isFinish);
260
+ setValueAndGoToNextView(utils.setSeconds(valueOrReferenceDate, secondValue), isFinish, 'seconds');
261
261
  };
262
262
  return {
263
263
  viewValue: secondsValue,
@@ -1,11 +1,19 @@
1
1
  export interface TimePickerToolbarClasses {
2
+ /** Styles applied to the root element. */
2
3
  root: string;
4
+ /** Styles applied to the separator element. */
3
5
  separator: string;
6
+ /** Styles applied to the time sections element. */
4
7
  hourMinuteLabel: string;
8
+ /** Styles applied to the time sections element in landscape mode. */
5
9
  hourMinuteLabelLandscape: string;
10
+ /** Styles applied to the time sections element in "rtl" theme mode. */
6
11
  hourMinuteLabelReverse: string;
12
+ /** Styles applied to the meridiem selection element. */
7
13
  ampmSelection: string;
14
+ /** Styles applied to the meridiem selection element in landscape mode. */
8
15
  ampmLandscape: string;
16
+ /** Styles applied to the meridiem label element. */
9
17
  ampmLabel: string;
10
18
  }
11
19
  export type TimePickerToolbarClassKey = keyof TimePickerToolbarClasses;
@@ -139,23 +139,23 @@ export const renderDesktopDateTimeView = ({
139
139
  view: 'hours',
140
140
  views: ['hours'],
141
141
  focusedView: focusedView && isInternalTimeView(focusedView) ? 'hours' : null,
142
- sx: _extends({
142
+ sx: [{
143
143
  width: 'auto',
144
144
  [`&.${digitalClockClasses.root}`]: {
145
145
  maxHeight: VIEW_HEIGHT
146
146
  }
147
- }, Array.isArray(sx) ? sx : [sx])
147
+ }, ...(Array.isArray(sx) ? sx : [sx])]
148
148
  })) : renderMultiSectionDigitalClockTimeView(_extends({}, commonTimeProps, {
149
149
  view: isInternalTimeView(view) ? view : 'hours',
150
150
  views: views.filter(isInternalTimeView),
151
151
  focusedView: focusedView && isInternalTimeView(focusedView) ? focusedView : null,
152
- sx: _extends({
152
+ sx: [{
153
153
  borderBottom: 0,
154
154
  width: 'auto',
155
155
  [`.${multiSectionDigitalClockSectionClasses.root}`]: {
156
156
  maxHeight: '100%'
157
157
  }
158
- }, Array.isArray(sx) ? sx : [sx])
158
+ }, ...(Array.isArray(sx) ? sx : [sx])]
159
159
  }))]
160
160
  })]
161
161
  }), isActionBarVisible && /*#__PURE__*/_jsx(Divider, {})]
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v7.0.0-alpha.9
2
+ * @mui/x-date-pickers v7.0.0-beta.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -2,4 +2,4 @@ import { UsePickerParams, UsePickerProps, UsePickerResponse } from './usePicker.
2
2
  import { InferError } from '../useValidation';
3
3
  import { FieldSection } from '../../../models';
4
4
  import { DateOrTimeViewWithMeridiem } from '../../models';
5
- export declare const usePicker: <TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TExternalProps extends UsePickerProps<TValue, TDate, TView, TSection, any, any, any>, TAdditionalProps extends {}>({ props, valueManager, valueType, wrapperVariant, inputRef, additionalViewProps, validator, autoFocusView, }: UsePickerParams<TValue, TDate, TView, TSection, TExternalProps, TAdditionalProps>) => UsePickerResponse<TValue, TView, TSection, InferError<TExternalProps>>;
5
+ export declare const usePicker: <TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TExternalProps extends UsePickerProps<TValue, TDate, TView, TSection, any, any, any>, TAdditionalProps extends {}>({ props, valueManager, valueType, wrapperVariant, inputRef, additionalViewProps, validator, autoFocusView, rendererInterceptor, }: UsePickerParams<TValue, TDate, TView, TSection, TExternalProps, TAdditionalProps>) => UsePickerResponse<TValue, TView, TSection, InferError<TExternalProps>>;
@@ -11,7 +11,8 @@ export const usePicker = ({
11
11
  inputRef,
12
12
  additionalViewProps,
13
13
  validator,
14
- autoFocusView
14
+ autoFocusView,
15
+ rendererInterceptor
15
16
  }) => {
16
17
  if (process.env.NODE_ENV !== 'production') {
17
18
  if (props.renderInput != null) {
@@ -30,7 +31,8 @@ export const usePicker = ({
30
31
  inputRef,
31
32
  additionalViewProps,
32
33
  autoFocusView,
33
- propsFromPickerValue: pickerValueResponse.viewProps
34
+ propsFromPickerValue: pickerValueResponse.viewProps,
35
+ rendererInterceptor
34
36
  });
35
37
  const pickerLayoutResponse = usePickerLayoutProps({
36
38
  props,
@@ -10,7 +10,7 @@ export interface UsePickerBaseProps<TValue, TDate, TView extends DateOrTimeViewW
10
10
  }
11
11
  export interface UsePickerProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TError, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerValueProps<TValue, TSection, TError>, UsePickerViewsProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, UsePickerLayoutProps {
12
12
  }
13
- export interface UsePickerParams<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TExternalProps extends UsePickerProps<TValue, TDate, TView, TSection, any, any, any>, TAdditionalProps extends {}> extends Pick<UsePickerValueParams<TValue, TDate, TSection, TExternalProps>, 'valueManager' | 'valueType' | 'wrapperVariant' | 'validator'>, Pick<UsePickerViewParams<TValue, TDate, TView, TExternalProps, TAdditionalProps>, 'additionalViewProps' | 'inputRef' | 'autoFocusView'> {
13
+ export interface UsePickerParams<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TExternalProps extends UsePickerProps<TValue, TDate, TView, TSection, any, any, any>, TAdditionalProps extends {}> extends Pick<UsePickerValueParams<TValue, TDate, TSection, TExternalProps>, 'valueManager' | 'valueType' | 'wrapperVariant' | 'validator'>, Pick<UsePickerViewParams<TValue, TDate, TView, TExternalProps, TAdditionalProps>, 'additionalViewProps' | 'inputRef' | 'autoFocusView' | 'rendererInterceptor'> {
14
14
  props: TExternalProps;
15
15
  }
16
16
  export interface UsePickerResponse<TValue, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TError> extends Omit<UsePickerValueResponse<TValue, TSection, TError>, 'viewProps' | 'layoutProps'>, Omit<UsePickerViewsResponse<TView>, 'layoutProps'>, UsePickerLayoutPropsResponse<TValue, TView> {
@@ -13,7 +13,7 @@ export type PickerViewsRendererProps<TValue, TView extends DateOrTimeViewWithMer
13
13
  focusedView: TView | null;
14
14
  onFocusedViewChange: (viewToFocus: TView, hasFocus: boolean) => void;
15
15
  };
16
- type PickerViewRenderer<TValue, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends PickerViewsRendererBaseExternalProps<TView>, TAdditionalProps extends {}> = (props: PickerViewsRendererProps<TValue, TView, TExternalProps, TAdditionalProps>) => React.ReactNode;
16
+ export type PickerViewRenderer<TValue, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends PickerViewsRendererBaseExternalProps<TView>, TAdditionalProps extends {}> = (props: PickerViewsRendererProps<TValue, TView, TExternalProps, TAdditionalProps>) => React.ReactNode;
17
17
  export type PickerViewRendererLookup<TValue, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends PickerViewsRendererBaseExternalProps<any>, TAdditionalProps extends {}> = {
18
18
  [K in TView]: PickerViewRenderer<TValue, K, TExternalProps, TAdditionalProps> | null;
19
19
  };
@@ -65,6 +65,15 @@ export interface UsePickerViewParams<TValue, TDate, TView extends DateOrTimeView
65
65
  additionalViewProps: TAdditionalProps;
66
66
  inputRef?: React.RefObject<HTMLInputElement>;
67
67
  autoFocusView: boolean;
68
+ /**
69
+ * A function that intercepts the regular picker rendering.
70
+ * Can be used to consume the provided `viewRenderers` and render a custom component wrapping them.
71
+ * @param {PickerViewRendererLookup<TValue, TView, TExternalProps, TAdditionalProps>} viewRenderers The `viewRenderers` that were provided to the picker component.
72
+ * @param {TView} popperView The current picker view.
73
+ * @param {any} rendererProps All the props that are being passed down to the renderer.
74
+ * @returns {React.ReactNode} A React node that will be rendered instead of the default renderer.
75
+ */
76
+ rendererInterceptor?: (viewRenderers: PickerViewRendererLookup<TValue, TView, TExternalProps, TAdditionalProps>, popperView: TView, rendererProps: Omit<TExternalProps, 'className' | 'sx'> & TAdditionalProps & UsePickerValueViewsResponse<TValue>) => React.ReactNode;
68
77
  }
69
78
  export interface UsePickerViewsResponse<TView extends DateOrTimeViewWithMeridiem> {
70
79
  /**
@@ -87,5 +96,5 @@ export interface UsePickerViewsLayoutResponse<TView extends DateOrTimeViewWithMe
87
96
  * - Handles the switch between UI views and field views
88
97
  * - Handles the focus management when switching views
89
98
  */
90
- export declare const usePickerViews: <TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}>({ props, propsFromPickerValue, additionalViewProps, inputRef, autoFocusView, }: UsePickerViewParams<TValue, TDate, TView, TExternalProps, TAdditionalProps>) => UsePickerViewsResponse<TView>;
99
+ export declare const usePickerViews: <TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}>({ props, propsFromPickerValue, additionalViewProps, inputRef, autoFocusView, rendererInterceptor, }: UsePickerViewParams<TValue, TDate, TView, TExternalProps, TAdditionalProps>) => UsePickerViewsResponse<TView>;
91
100
  export {};
@@ -30,7 +30,8 @@ export const usePickerViews = ({
30
30
  propsFromPickerValue,
31
31
  additionalViewProps,
32
32
  inputRef,
33
- autoFocusView
33
+ autoFocusView,
34
+ rendererInterceptor
34
35
  }) => {
35
36
  const {
36
37
  onChange,
@@ -146,7 +147,7 @@ export const usePickerViews = ({
146
147
  if (renderer == null) {
147
148
  return null;
148
149
  }
149
- return renderer(_extends({}, propsToForwardToView, additionalViewProps, propsFromPickerValue, {
150
+ const rendererProps = _extends({}, propsToForwardToView, additionalViewProps, propsFromPickerValue, {
150
151
  views,
151
152
  timezone,
152
153
  onChange: setValueAndGoToNextView,
@@ -156,7 +157,11 @@ export const usePickerViews = ({
156
157
  onFocusedViewChange: setFocusedView,
157
158
  showViewSwitcher: timeViewsCount > 1,
158
159
  timeViewsCount
159
- }));
160
+ });
161
+ if (rendererInterceptor) {
162
+ return rendererInterceptor(viewRenderers, popperView, rendererProps);
163
+ }
164
+ return renderer(rendererProps);
160
165
  }
161
166
  };
162
167
  };
@@ -20,16 +20,16 @@ export type { PickerPopperProps } from './components/PickersPopper';
20
20
  export { pickersPopperClasses } from './components/pickersPopperClasses';
21
21
  export type { PickersPopperClassKey, PickersPopperClasses, } from './components/pickersPopperClasses';
22
22
  export { PickersToolbarButton } from './components/PickersToolbarButton';
23
- export { DAY_MARGIN, DIALOG_WIDTH } from './constants/dimensions';
23
+ export { DAY_MARGIN, DIALOG_WIDTH, VIEW_HEIGHT } from './constants/dimensions';
24
24
  export { useControlledValueWithTimezone } from './hooks/useValueWithTimezone';
25
25
  export type { DesktopOnlyPickerProps } from './hooks/useDesktopPicker';
26
26
  export { useField, createDateStrForInputFromSections, addPositionPropertiesToSections, } from './hooks/useField';
27
27
  export type { UseFieldInternalProps, UseFieldParams, UseFieldResponse, UseFieldForwardedProps, FieldValueManager, FieldChangeHandler, FieldChangeHandlerContext, } from './hooks/useField';
28
28
  export type { MobileOnlyPickerProps } from './hooks/useMobilePicker';
29
29
  export { usePicker } from './hooks/usePicker';
30
- export type { UsePickerResponse, UsePickerParams, UsePickerProps } from './hooks/usePicker';
30
+ export type { UsePickerResponse, UsePickerParams, UsePickerProps, UsePickerValueFieldResponse, } from './hooks/usePicker';
31
31
  export type { UsePickerValueNonStaticProps, PickerValueManager, PickerSelectionState, } from './hooks/usePicker/usePickerValue.types';
32
- export type { UsePickerViewsNonStaticProps, PickerViewRendererLookup, UsePickerViewsProps, } from './hooks/usePicker/usePickerViews';
32
+ export type { UsePickerViewsNonStaticProps, PickerViewRendererLookup, PickerViewRenderer, UsePickerViewsProps, } from './hooks/usePicker/usePickerViews';
33
33
  export { useStaticPicker } from './hooks/useStaticPicker';
34
34
  export type { StaticOnlyPickerProps, UseStaticPickerSlots, UseStaticPickerSlotProps, } from './hooks/useStaticPicker';
35
35
  export { useLocalizationContext, useDefaultDates, useUtils, useLocaleText, useNow, } from './hooks/useUtils';
@@ -63,4 +63,4 @@ export { DayCalendar } from '../DateCalendar/DayCalendar';
63
63
  export type { DayCalendarProps, DayCalendarSlots, DayCalendarSlotProps, ExportedDayCalendarProps, } from '../DateCalendar/DayCalendar';
64
64
  export type { ExportedDateCalendarProps } from '../DateCalendar/DateCalendar.types';
65
65
  export { useCalendarState } from '../DateCalendar/useCalendarState';
66
- export { isTimeView } from './utils/time-utils';
66
+ export { isInternalTimeView, isTimeView } from './utils/time-utils';
@@ -8,7 +8,7 @@ export { pickersToolbarTextClasses } from './components/pickersToolbarTextClasse
8
8
  export { pickersArrowSwitcherClasses } from './components/PickersArrowSwitcher/pickersArrowSwitcherClasses';
9
9
  export { pickersPopperClasses } from './components/pickersPopperClasses';
10
10
  export { PickersToolbarButton } from './components/PickersToolbarButton';
11
- export { DAY_MARGIN, DIALOG_WIDTH } from './constants/dimensions';
11
+ export { DAY_MARGIN, DIALOG_WIDTH, VIEW_HEIGHT } from './constants/dimensions';
12
12
  export { useControlledValueWithTimezone } from './hooks/useValueWithTimezone';
13
13
  export { useField, createDateStrForInputFromSections, addPositionPropertiesToSections } from './hooks/useField';
14
14
  export { usePicker } from './hooks/usePicker';
@@ -32,4 +32,4 @@ export { applyDefaultViewProps } from './utils/views';
32
32
  export { buildDeprecatedPropsWarning, buildWarning } from './utils/warning';
33
33
  export { DayCalendar } from '../DateCalendar/DayCalendar';
34
34
  export { useCalendarState } from '../DateCalendar/useCalendarState';
35
- export { isTimeView } from './utils/time-utils';
35
+ export { isInternalTimeView, isTimeView } from './utils/time-utils';
@@ -5,11 +5,12 @@ export interface BaseTabsProps<TView extends DateOrTimeViewWithMeridiem> {
5
5
  */
6
6
  view: TView;
7
7
  /**
8
- * Callback called when a tab is clicked
8
+ * Callback called when a tab is clicked.
9
9
  * @template TView
10
10
  * @param {TView} view The view to open
11
11
  */
12
12
  onViewChange: (view: TView) => void;
13
13
  }
14
14
  export interface ExportedBaseTabsProps {
15
+ className?: string;
15
16
  }
@@ -1,10 +1,11 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import * as React from 'react';
3
+ import clsx from 'clsx';
3
4
  import PropTypes from 'prop-types';
4
5
  import Tab from '@mui/material/Tab';
5
6
  import Tabs, { tabsClasses } from '@mui/material/Tabs';
6
7
  import { styled, useThemeProps } from '@mui/material/styles';
7
- import { unstable_composeClasses as composeClasses } from '@mui/utils';
8
+ import composeClasses from '@mui/utils/composeClasses';
8
9
  import { TimeIcon, DateRangeIcon } from '../icons';
9
10
  import { useLocaleText } from '../internals/hooks/useUtils';
10
11
  import { getDateTimePickerTabsUtilityClass } from './dateTimePickerTabsClasses';
@@ -71,7 +72,8 @@ var DateTimePickerTabs = function DateTimePickerTabs(inProps) {
71
72
  timeIcon = _props$timeIcon === void 0 ? /*#__PURE__*/_jsx(TimeIcon, {}) : _props$timeIcon,
72
73
  view = props.view,
73
74
  _props$hidden = props.hidden,
74
- hidden = _props$hidden === void 0 ? typeof window === 'undefined' || window.innerHeight < 667 : _props$hidden;
75
+ hidden = _props$hidden === void 0 ? typeof window === 'undefined' || window.innerHeight < 667 : _props$hidden,
76
+ className = props.className;
75
77
  var localeText = useLocaleText();
76
78
  var classes = useUtilityClasses(props);
77
79
  var handleChange = function handleChange(event, value) {
@@ -85,7 +87,7 @@ var DateTimePickerTabs = function DateTimePickerTabs(inProps) {
85
87
  variant: "fullWidth",
86
88
  value: viewToTab(view),
87
89
  onChange: handleChange,
88
- className: classes.root,
90
+ className: clsx(className, classes.root),
89
91
  children: [/*#__PURE__*/_jsx(Tab, {
90
92
  value: "date",
91
93
  "aria-label": localeText.dateTableLabel,
@@ -110,6 +112,7 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
110
112
  * Override or extend the styles applied to the component.
111
113
  */
112
114
  classes: PropTypes.object,
115
+ className: PropTypes.string,
113
116
  /**
114
117
  * Date tab icon.
115
118
  * @default DateRange
@@ -121,7 +124,7 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
121
124
  */
122
125
  hidden: PropTypes.bool,
123
126
  /**
124
- * Callback called when a tab is clicked
127
+ * Callback called when a tab is clicked.
125
128
  * @template TView
126
129
  * @param {TView} view The view to open
127
130
  */