@mui/x-date-pickers 8.5.0 → 8.5.2

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 (60) hide show
  1. package/CHANGELOG.md +204 -0
  2. package/DateField/DateField.js +1 -1
  3. package/DateTimeField/DateTimeField.js +1 -1
  4. package/DigitalClock/DigitalClock.d.ts +1 -1
  5. package/PickerDay2/PickerDay2.d.ts +7 -0
  6. package/PickerDay2/PickerDay2.js +369 -0
  7. package/PickerDay2/PickerDay2.types.d.ts +18 -0
  8. package/PickerDay2/PickerDay2.types.js +5 -0
  9. package/PickerDay2/index.d.ts +4 -0
  10. package/PickerDay2/index.js +25 -0
  11. package/PickerDay2/pickerDay2Classes.d.ts +17 -0
  12. package/PickerDay2/pickerDay2Classes.js +14 -0
  13. package/PickersCalendarHeader/PickersCalendarHeader.js +3 -1
  14. package/PickersDay/PickersDay.js +1 -1
  15. package/PickersLayout/PickersLayout.d.ts +2 -2
  16. package/PickersSectionList/PickersSectionList.d.ts +4 -4
  17. package/PickersTextField/PickersFilledInput/PickersFilledInput.d.ts +1 -0
  18. package/PickersTextField/PickersInput/PickersInput.js +4 -2
  19. package/PickersTextField/PickersInputBase/PickersInputBase.d.ts +2 -2
  20. package/PickersTextField/PickersTextField.js +4 -1
  21. package/TimeField/TimeField.js +1 -1
  22. package/esm/DateField/DateField.js +1 -1
  23. package/esm/DateTimeField/DateTimeField.js +1 -1
  24. package/esm/DigitalClock/DigitalClock.d.ts +1 -1
  25. package/esm/PickerDay2/PickerDay2.d.ts +7 -0
  26. package/esm/PickerDay2/PickerDay2.js +361 -0
  27. package/esm/PickerDay2/PickerDay2.types.d.ts +18 -0
  28. package/esm/PickerDay2/PickerDay2.types.js +1 -0
  29. package/esm/PickerDay2/index.d.ts +4 -0
  30. package/esm/PickerDay2/index.js +2 -0
  31. package/esm/PickerDay2/pickerDay2Classes.d.ts +17 -0
  32. package/esm/PickerDay2/pickerDay2Classes.js +6 -0
  33. package/esm/PickersCalendarHeader/PickersCalendarHeader.js +3 -1
  34. package/esm/PickersDay/PickersDay.js +1 -1
  35. package/esm/PickersLayout/PickersLayout.d.ts +2 -2
  36. package/esm/PickersSectionList/PickersSectionList.d.ts +4 -4
  37. package/esm/PickersTextField/PickersFilledInput/PickersFilledInput.d.ts +1 -0
  38. package/esm/PickersTextField/PickersInput/PickersInput.js +4 -2
  39. package/esm/PickersTextField/PickersInputBase/PickersInputBase.d.ts +2 -2
  40. package/esm/PickersTextField/PickersTextField.js +4 -1
  41. package/esm/TimeField/TimeField.js +1 -1
  42. package/esm/icons/index.d.ts +8 -8
  43. package/esm/index.d.ts +1 -0
  44. package/esm/index.js +2 -1
  45. package/esm/internals/components/PickerPopper/PickerPopper.d.ts +1 -1
  46. package/esm/internals/components/PickerPopper/PickerPopper.js +5 -5
  47. package/esm/internals/components/PickerViewRoot/PickerViewRoot.d.ts +1 -1
  48. package/esm/themeAugmentation/components.d.ts +4 -0
  49. package/esm/themeAugmentation/overrides.d.ts +2 -0
  50. package/esm/themeAugmentation/props.d.ts +2 -0
  51. package/icons/index.d.ts +8 -8
  52. package/index.d.ts +1 -0
  53. package/index.js +13 -1
  54. package/internals/components/PickerPopper/PickerPopper.d.ts +1 -1
  55. package/internals/components/PickerPopper/PickerPopper.js +5 -5
  56. package/internals/components/PickerViewRoot/PickerViewRoot.d.ts +1 -1
  57. package/package.json +4 -4
  58. package/themeAugmentation/components.d.ts +4 -0
  59. package/themeAugmentation/overrides.d.ts +2 -0
  60. package/themeAugmentation/props.d.ts +2 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,210 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.5.2
9
+
10
+ _Jun 12, 2025_
11
+
12
+ We'd like to extend a big thank you to the 15 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 📊 Improve Data Grid selectors performance
15
+ - 🐞 Fix `useSyncExternalStore` import error in React 17
16
+
17
+ Special thanks go out to the community members for their valuable contributions:
18
+ @alisasanib, @noobyogi0010.
19
+
20
+ The following are all team members who have contributed to this release:
21
+ @alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @JCQuintas, @KenanYusuf, @LukasTy, @mapache-salvaje, @michelengelen, @noraleonte, @oliviertassinari, @prakhargupta1, @romgrk.
22
+
23
+ ### Data Grid
24
+
25
+ #### `@mui/x-data-grid@8.5.2`
26
+
27
+ - [DataGrid] Improve selectors performance (#18234) @romgrk
28
+ - [DataGrid] Fix data grid palette when using CSS vars (#18310) @KenanYusuf
29
+ - [DataGrid] Ignore data source request if the grid got unmounted (#18268) @arminmeh
30
+
31
+ #### `@mui/x-data-grid-pro@8.5.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
32
+
33
+ Same changes as in `@mui/x-data-grid@8.5.2`, plus:
34
+
35
+ - [DataGridPro] Fix flex column width if it is a pinned column (#18293) @alisasanib
36
+ - [DataGridPro] Fix inconsistent filtering results with aggregation (#17954) @cherniavskii
37
+
38
+ #### `@mui/x-data-grid-premium@8.5.2` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
39
+
40
+ Same changes as in `@mui/x-data-grid-pro@8.5.2`.
41
+
42
+ ### Date and Time Pickers
43
+
44
+ #### `@mui/x-date-pickers@8.5.2`
45
+
46
+ - [pickers] Add `PickerDay2` and `DateRangePickerDay2` components (#15921) @noraleonte
47
+ - [pickers] Fix `hiddenLabel` prop propagation (#18195) @noobyogi0010
48
+
49
+ #### `@mui/x-date-pickers-pro@8.5.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
50
+
51
+ Same changes as in `@mui/x-date-pickers@8.5.2`.
52
+
53
+ ### Charts
54
+
55
+ #### `@mui/x-charts@8.5.2`
56
+
57
+ - [charts] Add a default value formatter for continuous scales (#18178) @bernardobelchior
58
+ - [charts] Add margin-bottom to charts toolbar (#18326) @bernardobelchior
59
+ - [charts] Fix grid with band scale (#18295) @alexfauquette
60
+ - [charts] Remove unnecessary style changes in tests (#18317) @JCQuintas
61
+ - [charts] Remove `sx` prop merging from `useComponentRenderer` (#18235) @bernardobelchior
62
+ - [charts] Fix `useSyncExternalStore` import error in React 17 (#18314) @bernardobelchior
63
+
64
+ #### `@mui/x-charts-pro@8.5.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
65
+
66
+ Same changes as in `@mui/x-charts@8.5.2`, plus:
67
+
68
+ - [charts-pro] Document zoom slider tooltip value formatting (#18261) @bernardobelchior
69
+ - [charts-pro] Funnel `gap` prop does not impact the drawing area (#18233) @JCQuintas
70
+ - [charts-pro] Use `ChartsToolbarPro` types in pro charts (#18243) @bernardobelchior
71
+
72
+ ### Tree View
73
+
74
+ #### `@mui/x-tree-view@8.5.2`
75
+
76
+ - [tree-view] Fix `useSyncExternalStore` import error in React 17 (#18314) @bernardobelchior
77
+
78
+ #### `@mui/x-tree-view-pro@8.5.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
79
+
80
+ Same changes as in `@mui/x-tree-view@8.5.2`.
81
+
82
+ ### Docs
83
+
84
+ - [docs] Add toolbar custom trigger and panel recipe (#18297) @KenanYusuf
85
+ - [docs] Copyedit the Priority support page (#18311) @mapache-salvaje
86
+ - [docs] Remove confusing opt-out mention in telemetry docs (#18257) @prakhargupta1
87
+ - [docs] Revise the Master Detail doc (#17927) @mapache-salvaje
88
+ - [docs] Revise the list view doc (#17928) @mapache-salvaje
89
+ - [docs] Audit and revise the Pro column docs (#17844) @mapache-salvaje
90
+ - [docs] Add some more context on Heatmap (#18256) @oliviertassinari
91
+ - [x-telemetry] Reduce Telemetry overhead (#18292) @oliviertassinari
92
+ - [code-infra] Align Node version used in CI to v22 (#18319) @LukasTy
93
+ - [code-infra] Fix pkg.pr.new publishing (#18316) @bernardobelchior
94
+ - [code-infra] Revert `React` to `19.0.0` (#18265) @LukasTy
95
+ - [code-infra] Use `catalog` for reused dependencies (#18302) @LukasTy
96
+ - [infra] Remove unused karma/mocha deps and files (#18340) @JCQuintas
97
+ - [infra] Update github label references to use 'scope' instead of 'component' (#18260) @michelengelen
98
+ - [infra] Use a single browser server in CI (#18230) @JCQuintas
99
+
100
+ ## 8.5.1
101
+
102
+ <!-- generated comparing v8.5.0..master -->
103
+
104
+ _Jun 5, 2025_
105
+
106
+ We'd like to extend a big thank you to the 9 contributors who made this release possible. Here are some highlights ✨:
107
+
108
+ - 📊 Allow exporting pie charts
109
+ - 📚 Documentation improvements
110
+ - 🌎 Improve Portuguese (ptPT) translations on the Data Grid
111
+ - 🌎 Improve Portuguese (ptPT, ptBR) translations on Charts
112
+ - 🌎 Improve Arabic (ar-SD) locale
113
+ - 🐞 Bugfixes
114
+
115
+ Special thanks go out to the community members for their valuable contributions: @moosekebab, @TiagoPortfolio.
116
+ The following are all team members who have contributed to this release:
117
+ @alexfauquette, @bernardobelchior, @JCQuintas, @KenanYusuf, @LukasTy, @michelengelen, @arminmeh.
118
+
119
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
120
+
121
+ ### Data Grid
122
+
123
+ #### `@mui/x-data-grid@8.5.1`
124
+
125
+ - [DataGrid] Fix `registerPipeProcessor()` for Node v20 (#18241) @arminmeh
126
+ - [DataGrid] Fix background color in column header filler cells (#18188) @KenanYusuf
127
+ - [DataGrid] Keep pipe pre-processors execution order when callback reference changes (#17558) @arminmeh
128
+ - [DataGrid] Use `useComponentRenderer` from x-internals (#18203) @bernardobelchior
129
+ - [l10n] Improve Arabic (ar-SD) locale (#17959) @moosekebab
130
+ - [l10n] Improve Portuguese from Portugal (pt-PT) locale (#18064) @TiagoPortfolio
131
+
132
+ #### `@mui/x-data-grid-pro@8.5.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
133
+
134
+ Same changes as in `@mui/x-data-grid@8.5.1`, plus:
135
+
136
+ - [DataGridPro] Skip rendering detail panels of the rows turned into skeleton rows with lazy loading (#17958) @arminmeh
137
+
138
+ #### `@mui/x-data-grid-premium@8.5.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
139
+
140
+ Same changes as in `@mui/x-data-grid-pro@8.5.1`.
141
+
142
+ ### Date and Time Pickers
143
+
144
+ #### `@mui/x-date-pickers@8.5.1`
145
+
146
+ - [pickers] Fix `transformOrigin` resolving based on popper `placement` (#18206) @LukasTy
147
+
148
+ #### `@mui/x-date-pickers-pro@8.5.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
149
+
150
+ Same changes as in `@mui/x-date-pickers@8.5.1`.
151
+
152
+ ### Charts
153
+
154
+ #### `@mui/x-charts@8.5.1`
155
+
156
+ - [charts] Allow skipping tooltip render (#18050) @alexfauquette
157
+ - [charts] Fix act warnings in toolbar tests (#18212) @JCQuintas
158
+ - [charts] Fix prop typo in `extendVertically` (#18211) @JCQuintas
159
+ - [charts] Fix responsive height for ChartsWrapper (#18183) @alexfauquette
160
+ - [charts] Improve charts toolbar accessibility (#18056) @bernardobelchior
161
+ - [charts] Let line series propagate null from the dataset (#18223) @alexfauquette
162
+ - [l10n] Add Portuguese locales for charts (pt-PT, pt-BR) (#18069) @bernardobelchior
163
+
164
+ #### `@mui/x-charts-pro@8.5.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
165
+
166
+ Same changes as in `@mui/x-charts@8.5.1`, plus:
167
+
168
+ - [charts-pro] Add `linear-sharp` curve as alternative to square edge (#17966) @JCQuintas
169
+ - [charts-pro] Add correct classes to `FunnelSectionLabel` (#18061) @JCQuintas
170
+ - [charts-pro] Allow exporting a pie chart (#18063) @bernardobelchior
171
+ - [charts-pro] Fix initial render for zoom slider selection (#18208) @bernardobelchior
172
+ - [charts-pro] Fix props being passed to DOM in FunnelChart (#18192) @JCQuintas
173
+ - [charts-pro] Show axis value in zoom slider tooltip (#18054) @bernardobelchior
174
+ - [charts-pro] Render the toolbar in the heatmap chart (#18247) @bernardobelchior
175
+
176
+ ### Tree View
177
+
178
+ #### `@mui/x-tree-view@8.5.1`
179
+
180
+ Internal changes.
181
+
182
+ #### `@mui/x-tree-view-pro@8.5.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
183
+
184
+ Same changes as in `@mui/x-tree-view@8.5.1`.
185
+
186
+ ### Docs
187
+
188
+ - [docs] Update `valueFormatter` signature in migration guide (#18226) @michelengelen
189
+
190
+ ### Core
191
+
192
+ - chore(deps): bump @next/eslint-plugin-next to 15.3.3 (#18155) @renovate[bot]
193
+ - chore(deps): bump @types/lodash to ^4.17.17 (#17990) @renovate[bot]
194
+ - chore(deps): bump babel (#18157) @renovate[bot]
195
+ - chore(deps): bump eslint to ^9.28.0 (#17352) @renovate[bot]
196
+ - chore(deps): bump material ui (#17802) @renovate[bot]
197
+ - chore(deps): bump next to ^15.3.3 (#18159) @renovate[bot]
198
+ - chore(deps): bump ossf/scorecard-action action to v2.4.2 (#18160) @renovate[bot]
199
+ - chore(deps): bump react-router to ^7.6.1 (#18162) @renovate[bot]
200
+ - chore(deps): bump yargs to ^18.0.0 (#18169) @renovate[bot]
201
+ - [code-infra] Different approach to console testing for `processRowUpdate` (#18213) @JCQuintas
202
+ - [code-infra] Fix act warnings in DataGrid/toolbar (#18207) @JCQuintas
203
+ - [code-infra] Remove `istanbul` references (#18194) @JCQuintas
204
+ - [code-infra] Remove codesandbox:ci (#18179) @JCQuintas
205
+ - [code-infra] Replace `mocha` with `vitest` on e2e and regression tests (#18071) @JCQuintas
206
+ - [code-infra] Upgrade @mui/internal-test-utils (#18191) @JCQuintas
207
+ - [code-infra] Use vitest for `no-direct-state-access` tests (#18209) @JCQuintas
208
+ - [infra] Improve test setup (#18228) @LukasTy
209
+ - [infra] Update bug and feature request templates to standardize label types (#18198) @michelengelen
210
+ - [infra] Use `playwright` docker image (#18186) @LukasTy
211
+
8
212
  ## 8.5.0
9
213
 
10
214
  _May 29, 2025_
@@ -152,7 +152,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
152
152
  */
153
153
  InputLabelProps: _propTypes.default.object,
154
154
  /**
155
- * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
155
+ * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#attributes) applied to the `input` element.
156
156
  * @deprecated Use `slotProps.htmlInput` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
157
157
  */
158
158
  inputProps: _propTypes.default.object,
@@ -162,7 +162,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
162
162
  */
163
163
  InputLabelProps: _propTypes.default.object,
164
164
  /**
165
- * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
165
+ * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#attributes) applied to the `input` element.
166
166
  * @deprecated Use `slotProps.htmlInput` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
167
167
  */
168
168
  inputProps: _propTypes.default.object,
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { DigitalClockProps } from "./DigitalClock.types.js";
3
- export declare const DigitalClockItem: import("@emotion/styled").StyledComponent<import("@mui/material").MenuItemOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "disabled" | "autoFocus" | "dense" | "tabIndex" | "classes" | "className" | "style" | "children" | "sx" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableGutters" | "divider" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
3
+ export declare const DigitalClockItem: import("@emotion/styled").StyledComponent<import("@mui/material/MenuItem").MenuItemOwnProps & Omit<import("@mui/material/ButtonBase").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "disabled" | "autoFocus" | "dense" | "tabIndex" | "classes" | "className" | "style" | "children" | "sx" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableGutters" | "divider" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
4
4
  type DigitalClockComponent = ((props: DigitalClockProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
5
5
  propTypes?: any;
6
6
  };
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { PickerDay2Props } from "./PickerDay2.types.js";
3
+ type PickerDay2Component = ((props: PickerDay2Props & React.RefAttributes<HTMLButtonElement>) => React.JSX.Element) & {
4
+ propTypes?: any;
5
+ };
6
+ export declare const PickerDay2: PickerDay2Component;
7
+ export {};
@@ -0,0 +1,369 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.PickerDay2 = void 0;
9
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
+ var _clsx = _interopRequireDefault(require("clsx"));
14
+ var _styles = require("@mui/material/styles");
15
+ var _ButtonBase = _interopRequireDefault(require("@mui/material/ButtonBase"));
16
+ var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
17
+ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
18
+ var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
19
+ var _dimensions = require("../internals/constants/dimensions");
20
+ var _pickerDay2Classes = require("./pickerDay2Classes");
21
+ var _useUtils = require("../internals/hooks/useUtils");
22
+ var _usePickerDayOwnerState = require("../PickersDay/usePickerDayOwnerState");
23
+ var _jsxRuntime = require("react/jsx-runtime");
24
+ const _excluded = ["autoFocus", "className", "classes", "hidden", "isAnimating", "onClick", "onDaySelect", "onFocus", "onBlur", "onKeyDown", "onMouseDown", "onMouseEnter", "children", "isFirstVisibleCell", "isLastVisibleCell", "day", "selected", "disabled", "today", "outsideCurrentMonth", "disableMargin", "disableHighlightToday", "showDaysOutsideCurrentMonth", "isVisuallySelected"];
25
+ const useUtilityClasses = (ownerState, classes) => {
26
+ const {
27
+ isDaySelected,
28
+ disableHighlightToday,
29
+ isDayCurrent,
30
+ isDayDisabled,
31
+ isDayOutsideMonth,
32
+ isDayFillerCell
33
+ } = ownerState;
34
+ const slots = {
35
+ root: ['root', isDaySelected && !isDayFillerCell && 'selected', isDayDisabled && 'disabled', !disableHighlightToday && isDayCurrent && !isDaySelected && !isDayFillerCell && 'today', isDayOutsideMonth && 'dayOutsideMonth', isDayFillerCell && 'fillerCell']
36
+ };
37
+ return (0, _composeClasses.default)(slots, _pickerDay2Classes.getPickerDay2UtilityClass, classes);
38
+ };
39
+ const PickerDay2Root = (0, _styles.styled)(_ButtonBase.default, {
40
+ name: 'MuiPickerDay2',
41
+ slot: 'Root',
42
+ overridesResolver: (props, styles) => {
43
+ const {
44
+ ownerState
45
+ } = props;
46
+ return [styles.root, !ownerState.disableHighlightToday && ownerState.isDayCurrent && styles.today, !ownerState.isDayOutsideMonth && styles.dayOutsideMonth, ownerState.isDayFillerCell && styles.fillerCell];
47
+ }
48
+ })(({
49
+ theme
50
+ }) => (0, _extends2.default)({
51
+ '--PickerDay-horizontalMargin': `${_dimensions.DAY_MARGIN}px`,
52
+ '--PickerDay-size': `${_dimensions.DAY_SIZE}px`
53
+ }, theme.typography.caption, {
54
+ width: 'var(--PickerDay-size)',
55
+ height: 'var(--PickerDay-size)',
56
+ borderRadius: 'calc(var(--PickerDay-size) / 2)',
57
+ padding: 0,
58
+ // explicitly setting to `transparent` to avoid potentially getting impacted by change from the overridden component
59
+ backgroundColor: 'transparent',
60
+ transition: theme.transitions.create('background-color', {
61
+ duration: theme.transitions.duration.short
62
+ }),
63
+ color: (theme.vars || theme).palette.text.primary,
64
+ '@media (pointer: fine)': {
65
+ '&:hover': {
66
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _styles.alpha)(theme.palette.primary.main, theme.palette.action.hoverOpacity)
67
+ }
68
+ },
69
+ '&:focus': {
70
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.focusOpacity})` : (0, _styles.alpha)(theme.palette.primary.main, theme.palette.action.focusOpacity)
71
+ },
72
+ marginLeft: 'var(--PickerDay-horizontalMargin)',
73
+ marginRight: 'var(--PickerDay-horizontalMargin)',
74
+ variants: [{
75
+ props: {
76
+ isDaySelected: true
77
+ },
78
+ style: {
79
+ color: (theme.vars || theme).palette.primary.contrastText,
80
+ backgroundColor: (theme.vars || theme).palette.primary.main,
81
+ fontWeight: theme.typography.fontWeightMedium,
82
+ '&:focus, &:hover': {
83
+ willChange: 'background-color',
84
+ backgroundColor: (theme.vars || theme).palette.primary.dark
85
+ },
86
+ [`&.${_pickerDay2Classes.pickerDay2Classes.disabled}`]: {
87
+ opacity: 0.6
88
+ }
89
+ }
90
+ }, {
91
+ props: {
92
+ isDayDisabled: true
93
+ },
94
+ style: {
95
+ color: (theme.vars || theme).palette.text.disabled
96
+ }
97
+ }, {
98
+ props: {
99
+ isDayFillerCell: true
100
+ },
101
+ style: {
102
+ // visibility: 'hidden' does not work here as it hides the element from screen readers
103
+ // and results in unexpected relationships between week day and day columns.
104
+ opacity: 0,
105
+ pointerEvents: 'none'
106
+ }
107
+ }, {
108
+ props: {
109
+ isDayOutsideMonth: true
110
+ },
111
+ style: {
112
+ color: (theme.vars || theme).palette.text.secondary
113
+ }
114
+ }, {
115
+ props: {
116
+ isDayCurrent: true,
117
+ isDaySelected: false
118
+ },
119
+ style: {
120
+ outline: `1px solid ${(theme.vars || theme).palette.text.secondary}`,
121
+ outlineOffset: -1
122
+ }
123
+ }]
124
+ }));
125
+ const noop = () => {};
126
+ const PickerDay2Raw = /*#__PURE__*/React.forwardRef(function PickerDay2(inProps, forwardedRef) {
127
+ const props = (0, _styles.useThemeProps)({
128
+ props: inProps,
129
+ name: 'MuiPickerDay2'
130
+ });
131
+ const utils = (0, _useUtils.useUtils)();
132
+ const {
133
+ autoFocus = false,
134
+ className,
135
+ classes: classesProp,
136
+ isAnimating,
137
+ onClick,
138
+ onDaySelect,
139
+ onFocus = noop,
140
+ onBlur = noop,
141
+ onKeyDown = noop,
142
+ onMouseDown = noop,
143
+ onMouseEnter = noop,
144
+ children,
145
+ day,
146
+ selected,
147
+ disabled,
148
+ today,
149
+ outsideCurrentMonth,
150
+ disableMargin,
151
+ disableHighlightToday,
152
+ showDaysOutsideCurrentMonth
153
+ } = props,
154
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
155
+ const pickersDayOwnerState = (0, _usePickerDayOwnerState.usePickerDayOwnerState)({
156
+ day,
157
+ selected,
158
+ disabled,
159
+ today,
160
+ outsideCurrentMonth,
161
+ disableMargin,
162
+ disableHighlightToday,
163
+ showDaysOutsideCurrentMonth
164
+ });
165
+ const ownerState = (0, _extends2.default)({}, pickersDayOwnerState, {
166
+ // Properties specific to the MUI implementation (some might be removed in the next major)
167
+ isDayFillerCell: outsideCurrentMonth && !showDaysOutsideCurrentMonth
168
+ });
169
+ const classes = useUtilityClasses(ownerState, classesProp);
170
+ const ref = React.useRef(null);
171
+ const handleRef = (0, _useForkRef.default)(ref, forwardedRef);
172
+
173
+ // Since this is rendered when a Popper is opened we can't use passive effects.
174
+ // Focusing in passive effects in Popper causes scroll jump.
175
+ (0, _useEnhancedEffect.default)(() => {
176
+ if (autoFocus && !disabled && !isAnimating && !outsideCurrentMonth) {
177
+ // ref.current being null would be a bug in MUI
178
+ ref.current.focus();
179
+ }
180
+ }, [autoFocus, disabled, isAnimating, outsideCurrentMonth]);
181
+
182
+ // For a day outside the current month, move the focus from mouseDown to mouseUp
183
+ // Goal: have the onClick ends before sliding to the new month
184
+ const handleMouseDown = event => {
185
+ onMouseDown(event);
186
+ if (outsideCurrentMonth) {
187
+ event.preventDefault();
188
+ }
189
+ };
190
+ const handleClick = event => {
191
+ if (!disabled) {
192
+ onDaySelect(day);
193
+ }
194
+ if (outsideCurrentMonth) {
195
+ event.currentTarget.focus();
196
+ }
197
+ if (onClick) {
198
+ onClick(event);
199
+ }
200
+ };
201
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(PickerDay2Root, (0, _extends2.default)({
202
+ ref: handleRef,
203
+ centerRipple: true
204
+ // compat with PickersDay for tests
205
+ ,
206
+
207
+ disabled: disabled,
208
+ tabIndex: selected ? 0 : -1,
209
+ onKeyDown: event => onKeyDown(event, day),
210
+ onFocus: event => onFocus(event, day),
211
+ onBlur: event => onBlur(event, day),
212
+ onMouseEnter: event => onMouseEnter(event, day),
213
+ onClick: handleClick,
214
+ onMouseDown: handleMouseDown
215
+ }, other, {
216
+ ownerState: ownerState,
217
+ className: (0, _clsx.default)(classes.root, className),
218
+ children: children ?? (ownerState.isDayFillerCell ? null : utils.format(day, 'dayOfMonth'))
219
+ }));
220
+ });
221
+ if (process.env.NODE_ENV !== "production") PickerDay2Raw.displayName = "PickerDay2Raw";
222
+ process.env.NODE_ENV !== "production" ? PickerDay2Raw.propTypes = {
223
+ // ----------------------------- Warning --------------------------------
224
+ // | These PropTypes are generated from the TypeScript type definitions |
225
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
226
+ // ----------------------------------------------------------------------
227
+ /**
228
+ * A ref for imperative actions.
229
+ * It currently only supports `focusVisible()` action.
230
+ */
231
+ action: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
232
+ current: _propTypes.default.shape({
233
+ focusVisible: _propTypes.default.func.isRequired
234
+ })
235
+ })]),
236
+ /**
237
+ * If `true`, the ripples are centered.
238
+ * They won't start at the cursor interaction position.
239
+ * @default false
240
+ */
241
+ centerRipple: _propTypes.default.bool,
242
+ /**
243
+ * Override or extend the styles applied to the component.
244
+ */
245
+ classes: _propTypes.default.object,
246
+ className: _propTypes.default.string,
247
+ component: _propTypes.default.elementType,
248
+ /**
249
+ * The date to show.
250
+ */
251
+ day: _propTypes.default.object.isRequired,
252
+ /**
253
+ * If `true`, renders as disabled.
254
+ * @default false
255
+ */
256
+ disabled: _propTypes.default.bool,
257
+ /**
258
+ * If `true`, today's date is rendering without highlighting with circle.
259
+ * @default false
260
+ */
261
+ disableHighlightToday: _propTypes.default.bool,
262
+ /**
263
+ * If `true`, days are rendering without margin. Useful for displaying linked range of days.
264
+ * @default false
265
+ */
266
+ disableMargin: _propTypes.default.bool,
267
+ /**
268
+ * If `true`, the ripple effect is disabled.
269
+ *
270
+ * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
271
+ * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
272
+ * @default false
273
+ */
274
+ disableRipple: _propTypes.default.bool,
275
+ /**
276
+ * If `true`, the touch ripple effect is disabled.
277
+ * @default false
278
+ */
279
+ disableTouchRipple: _propTypes.default.bool,
280
+ /**
281
+ * If `true`, the base button will have a keyboard focus ripple.
282
+ * @default false
283
+ */
284
+ focusRipple: _propTypes.default.bool,
285
+ /**
286
+ * This prop can help identify which element has keyboard focus.
287
+ * The class name will be applied when the element gains the focus through keyboard interaction.
288
+ * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
289
+ * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
290
+ * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
291
+ * if needed.
292
+ */
293
+ focusVisibleClassName: _propTypes.default.string,
294
+ isAnimating: _propTypes.default.bool,
295
+ /**
296
+ * If `true`, day is the first visible cell of the month.
297
+ * Either the first day of the month or the first day of the week depending on `showDaysOutsideCurrentMonth`.
298
+ */
299
+ isFirstVisibleCell: _propTypes.default.bool.isRequired,
300
+ /**
301
+ * If `true`, day is the last visible cell of the month.
302
+ * Either the last day of the month or the last day of the week depending on `showDaysOutsideCurrentMonth`.
303
+ */
304
+ isLastVisibleCell: _propTypes.default.bool.isRequired,
305
+ /**
306
+ * Indicates if the day should be visually selected.
307
+ */
308
+ isVisuallySelected: _propTypes.default.bool,
309
+ onBlur: _propTypes.default.func,
310
+ onDaySelect: _propTypes.default.func.isRequired,
311
+ onFocus: _propTypes.default.func,
312
+ /**
313
+ * Callback fired when the component is focused with a keyboard.
314
+ * We trigger a `onFocus` callback too.
315
+ */
316
+ onFocusVisible: _propTypes.default.func,
317
+ onKeyDown: _propTypes.default.func,
318
+ onMouseEnter: _propTypes.default.func,
319
+ /**
320
+ * If `true`, day is outside of month and will be hidden.
321
+ */
322
+ outsideCurrentMonth: _propTypes.default.bool.isRequired,
323
+ /**
324
+ * If `true`, renders as selected.
325
+ * @default false
326
+ */
327
+ selected: _propTypes.default.bool,
328
+ /**
329
+ * If `true`, days outside the current month are rendered:
330
+ *
331
+ * - if `fixedWeekNumber` is defined, renders days to have the weeks requested.
332
+ *
333
+ * - if `fixedWeekNumber` is not defined, renders day to fill the first and last week of the current month.
334
+ *
335
+ * - ignored if `calendars` equals more than `1` on range pickers.
336
+ * @default false
337
+ */
338
+ showDaysOutsideCurrentMonth: _propTypes.default.bool,
339
+ style: _propTypes.default.object,
340
+ /**
341
+ * The system prop that allows defining system overrides as well as additional CSS styles.
342
+ */
343
+ 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]),
344
+ /**
345
+ * @default 0
346
+ */
347
+ tabIndex: _propTypes.default.number,
348
+ /**
349
+ * If `true`, renders as today date.
350
+ * @default false
351
+ */
352
+ today: _propTypes.default.bool,
353
+ /**
354
+ * Props applied to the `TouchRipple` element.
355
+ */
356
+ TouchRippleProps: _propTypes.default.object,
357
+ /**
358
+ * A ref that points to the `TouchRipple` element.
359
+ */
360
+ touchRippleRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
361
+ current: _propTypes.default.shape({
362
+ pulsate: _propTypes.default.func.isRequired,
363
+ start: _propTypes.default.func.isRequired,
364
+ stop: _propTypes.default.func.isRequired
365
+ })
366
+ })])
367
+ } : void 0;
368
+ const PickerDay2 = exports.PickerDay2 = /*#__PURE__*/React.memo(PickerDay2Raw);
369
+ if (process.env.NODE_ENV !== "production") PickerDay2.displayName = "PickerDay2";
@@ -0,0 +1,18 @@
1
+ import { PickerDay2Classes } from "./pickerDay2Classes.js";
2
+ import { PickerDayOwnerState, PickersDayProps } from "../PickersDay/index.js";
3
+ export interface PickerDay2Props extends Omit<PickersDayProps, 'classes'> {
4
+ /**
5
+ * Override or extend the styles applied to the component.
6
+ */
7
+ classes?: Partial<PickerDay2Classes>;
8
+ /**
9
+ * Indicates if the day should be visually selected.
10
+ */
11
+ isVisuallySelected?: boolean;
12
+ }
13
+ export interface PickerDay2OwnerState extends PickerDayOwnerState {
14
+ /**
15
+ * Whether the day is a filler day (its content is hidden).
16
+ */
17
+ isDayFillerCell: boolean;
18
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,4 @@
1
+ export { PickerDay2 } from "./PickerDay2.js";
2
+ export type { PickerDay2Props, PickerDay2OwnerState } from "./PickerDay2.types.js";
3
+ export { getPickerDay2UtilityClass, pickerDay2Classes } from "./pickerDay2Classes.js";
4
+ export type { PickerDay2ClassKey } from "./pickerDay2Classes.js";
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "PickerDay2", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _PickerDay.PickerDay2;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "getPickerDay2UtilityClass", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _pickerDay2Classes.getPickerDay2UtilityClass;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "pickerDay2Classes", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _pickerDay2Classes.pickerDay2Classes;
22
+ }
23
+ });
24
+ var _PickerDay = require("./PickerDay2");
25
+ var _pickerDay2Classes = require("./pickerDay2Classes");