@mui/material 7.0.0-alpha.2 → 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 (146) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/Dialog/Dialog.d.ts +0 -5
  3. package/Dialog/Dialog.js +0 -9
  4. package/Grid/Grid.d.ts +51 -100
  5. package/Grid/Grid.js +68 -515
  6. package/Grid/gridClasses.d.ts +0 -38
  7. package/Grid/gridClasses.js +1 -1
  8. package/Grid/index.js +12 -2
  9. package/GridLegacy/GridLegacy.d.ts +160 -0
  10. package/GridLegacy/GridLegacy.js +601 -0
  11. package/{Grid/GridContext.js → GridLegacy/GridLegacyContext.js} +3 -3
  12. package/GridLegacy/gridLegacyClasses.d.ts +48 -0
  13. package/{Grid2/grid2Classes.js → GridLegacy/gridLegacyClasses.js} +5 -5
  14. package/GridLegacy/index.d.ts +4 -0
  15. package/GridLegacy/index.js +35 -0
  16. package/Menu/Menu.d.ts +68 -1
  17. package/Menu/Menu.js +52 -17
  18. package/Modal/Modal.d.ts +0 -5
  19. package/Modal/Modal.js +0 -9
  20. package/PigmentGrid/PigmentGrid.d.ts +1 -1
  21. package/PigmentGrid/PigmentGrid.js +2 -2
  22. package/PigmentGrid/index.d.ts +1 -1
  23. package/PigmentGrid/index.js +4 -4
  24. package/Rating/Rating.d.ts +52 -1
  25. package/Rating/Rating.js +132 -46
  26. package/Select/SelectInput.js +8 -8
  27. package/StepButton/StepButton.d.ts +0 -5
  28. package/esm/Dialog/Dialog.d.ts +0 -5
  29. package/esm/Dialog/Dialog.js +0 -9
  30. package/esm/Grid/Grid.d.ts +51 -100
  31. package/esm/Grid/Grid.js +68 -508
  32. package/esm/Grid/gridClasses.d.ts +0 -38
  33. package/esm/Grid/gridClasses.js +1 -1
  34. package/esm/Grid/index.js +1 -0
  35. package/esm/GridLegacy/GridLegacy.d.ts +160 -0
  36. package/esm/GridLegacy/GridLegacy.js +588 -0
  37. package/esm/GridLegacy/GridLegacyContext.js +12 -0
  38. package/esm/GridLegacy/gridLegacyClasses.d.ts +48 -0
  39. package/esm/{Grid2/grid2Classes.js → GridLegacy/gridLegacyClasses.js} +4 -4
  40. package/esm/GridLegacy/index.d.ts +4 -0
  41. package/esm/GridLegacy/index.js +3 -0
  42. package/esm/Menu/Menu.d.ts +68 -1
  43. package/esm/Menu/Menu.js +52 -17
  44. package/esm/Modal/Modal.d.ts +0 -5
  45. package/esm/Modal/Modal.js +0 -9
  46. package/esm/PigmentGrid/PigmentGrid.d.ts +1 -1
  47. package/esm/PigmentGrid/PigmentGrid.js +2 -2
  48. package/esm/PigmentGrid/index.d.ts +1 -1
  49. package/esm/PigmentGrid/index.js +1 -1
  50. package/esm/Rating/Rating.d.ts +52 -1
  51. package/esm/Rating/Rating.js +131 -45
  52. package/esm/Select/SelectInput.js +8 -8
  53. package/esm/StepButton/StepButton.d.ts +0 -5
  54. package/esm/index.d.ts +3 -8
  55. package/esm/index.js +3 -3
  56. package/esm/styles/components.d.ts +5 -5
  57. package/esm/styles/createTheme.d.ts +0 -1
  58. package/esm/styles/createTheme.js +0 -1
  59. package/esm/styles/createThemeNoVars.d.ts +0 -6
  60. package/esm/styles/createThemeNoVars.js +7 -12
  61. package/esm/styles/index.d.ts +1 -5
  62. package/esm/styles/index.js +1 -2
  63. package/esm/styles/overrides.d.ts +2 -2
  64. package/esm/styles/props.d.ts +2 -2
  65. package/esm/utils/createSvgIcon.d.ts +1 -1
  66. package/esm/utils/createSvgIcon.js +1 -1
  67. package/esm/version/index.js +2 -2
  68. package/index.d.ts +3 -8
  69. package/index.js +9 -9
  70. package/modern/Dialog/Dialog.d.ts +0 -5
  71. package/modern/Dialog/Dialog.js +0 -9
  72. package/modern/Grid/Grid.d.ts +51 -100
  73. package/modern/Grid/Grid.js +68 -508
  74. package/modern/Grid/gridClasses.d.ts +0 -38
  75. package/modern/Grid/gridClasses.js +1 -1
  76. package/modern/Grid/index.js +1 -0
  77. package/modern/GridLegacy/GridLegacy.d.ts +160 -0
  78. package/modern/GridLegacy/GridLegacy.js +588 -0
  79. package/modern/GridLegacy/GridLegacyContext.js +12 -0
  80. package/modern/GridLegacy/gridLegacyClasses.d.ts +48 -0
  81. package/modern/{Grid2/grid2Classes.js → GridLegacy/gridLegacyClasses.js} +4 -4
  82. package/modern/GridLegacy/index.d.ts +4 -0
  83. package/modern/GridLegacy/index.js +3 -0
  84. package/modern/Menu/Menu.d.ts +68 -1
  85. package/modern/Menu/Menu.js +52 -17
  86. package/modern/Modal/Modal.d.ts +0 -5
  87. package/modern/Modal/Modal.js +0 -9
  88. package/modern/PigmentGrid/PigmentGrid.d.ts +1 -1
  89. package/modern/PigmentGrid/PigmentGrid.js +2 -2
  90. package/modern/PigmentGrid/index.d.ts +1 -1
  91. package/modern/PigmentGrid/index.js +1 -1
  92. package/modern/Rating/Rating.d.ts +52 -1
  93. package/modern/Rating/Rating.js +131 -45
  94. package/modern/Select/SelectInput.js +8 -8
  95. package/modern/StepButton/StepButton.d.ts +0 -5
  96. package/modern/index.d.ts +3 -8
  97. package/modern/index.js +3 -3
  98. package/modern/styles/components.d.ts +5 -5
  99. package/modern/styles/createTheme.d.ts +0 -1
  100. package/modern/styles/createTheme.js +0 -1
  101. package/modern/styles/createThemeNoVars.d.ts +0 -6
  102. package/modern/styles/createThemeNoVars.js +7 -12
  103. package/modern/styles/index.d.ts +1 -5
  104. package/modern/styles/index.js +1 -2
  105. package/modern/styles/overrides.d.ts +2 -2
  106. package/modern/styles/props.d.ts +2 -2
  107. package/modern/utils/createSvgIcon.d.ts +1 -1
  108. package/modern/utils/createSvgIcon.js +1 -1
  109. package/modern/version/index.js +2 -2
  110. package/package.json +4 -4
  111. package/styles/components.d.ts +5 -5
  112. package/styles/createTheme.d.ts +0 -1
  113. package/styles/createTheme.js +1 -8
  114. package/styles/createThemeNoVars.d.ts +0 -6
  115. package/styles/createThemeNoVars.js +7 -13
  116. package/styles/index.d.ts +1 -5
  117. package/styles/index.js +1 -15
  118. package/styles/overrides.d.ts +2 -2
  119. package/styles/props.d.ts +2 -2
  120. package/tsconfig.build.tsbuildinfo +1 -1
  121. package/utils/createSvgIcon.d.ts +1 -1
  122. package/utils/createSvgIcon.js +1 -1
  123. package/version/index.js +2 -2
  124. package/Grid2/Grid2.d.ts +0 -111
  125. package/Grid2/Grid2.js +0 -144
  126. package/Grid2/grid2Classes.d.ts +0 -10
  127. package/Grid2/index.d.ts +0 -4
  128. package/Grid2/index.js +0 -45
  129. package/StyledEngineProvider/index.d.ts +0 -4
  130. package/StyledEngineProvider/index.js +0 -12
  131. package/esm/Grid/GridContext.js +0 -12
  132. package/esm/Grid2/Grid2.d.ts +0 -111
  133. package/esm/Grid2/Grid2.js +0 -138
  134. package/esm/Grid2/grid2Classes.d.ts +0 -10
  135. package/esm/Grid2/index.d.ts +0 -4
  136. package/esm/Grid2/index.js +0 -4
  137. package/esm/StyledEngineProvider/index.d.ts +0 -4
  138. package/esm/StyledEngineProvider/index.js +0 -1
  139. package/modern/Grid/GridContext.js +0 -12
  140. package/modern/Grid2/Grid2.d.ts +0 -111
  141. package/modern/Grid2/Grid2.js +0 -138
  142. package/modern/Grid2/grid2Classes.d.ts +0 -10
  143. package/modern/Grid2/index.d.ts +0 -4
  144. package/modern/Grid2/index.js +0 -4
  145. package/modern/StyledEngineProvider/index.d.ts +0 -4
  146. package/modern/StyledEngineProvider/index.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 7.0.0-beta.1
4
+
5
+ <!-- generated comparing v7.0.0-beta.0..master -->
6
+
7
+ _Feb 27, 2025_
8
+
9
+ This release fixes incorrect build output from the previous release (`beta.0`).
10
+
11
+ ### Core
12
+
13
+ - [code-infra] Fix build:types script omitting folders with a dot in their name (#45422) @Janpot
14
+ - [release] Fix versions (#45420) @mj12albert
15
+
16
+ All contributors of this release in alphabetical order: @Janpot, @mj12albert
17
+
18
+ ## 7.0.0-beta.0
19
+
20
+ <!-- generated comparing v7.0.0-alpha.2..master -->
21
+
22
+ _Feb 26, 2025_
23
+
24
+ A big thanks to the 8 contributors who made this release possible.
25
+
26
+ ### `@mui/material@7.0.0-beta.0`
27
+
28
+ - [Modal][Dialog] Remove deprecated `onBackdropClick` (#45395) @DiegoAndai
29
+ - [Grid] Improve Grid2 upgrade experience (#45304) @DiegoAndai
30
+ - [Grid] Rename to GridLegacy (#45363) @DiegoAndai
31
+ - [Grid2] Rename to Grid (#45381) @DiegoAndai
32
+ - Remove SvgIcon data-testid in production (#45333) @Janpot
33
+ - Allow nested theme creation with `vars` (#45335) @siriwatknp
34
+ - [Rating] Deprecate \*Props and complete `slots`, `slotProps` (#45295) @harry-whorlow
35
+ - [Slider] Fix css class selector in migration guide (#45402) @sai6855
36
+ - [Slider] Fix spacings in .md files (#45388) @sai6855
37
+ - [styles] Remove deprecated exports (#45397) @DiegoAndai
38
+ - [Menu] Deprecate \*Props and complete `slots`, `slotProps` (#44913) @siriwatknp
39
+ - [StepButton] Remove StepIconButton type (#45396) @DiegoAndai
40
+
41
+ ### Docs
42
+
43
+ - [Autocomplete] Remove unnecessary renderTags prop from Sizes demo (#45401) @ZeeshanTamboli
44
+ - Add `overriding-component-structure` doc to Material UI (#45186) @siriwatknp
45
+ - Fix typo in slider docs (#45390) @sai6855
46
+ - Fix Context Menu selection lost on Safari (#44903) @NooBat
47
+
48
+ ### Core
49
+
50
+ - [code-infra] Fix types for @mui/styled-engine (#45413) @Janpot
51
+ - [docs-infra] Fix theme toggle call (#45400) @siriwatknp
52
+ - [docs-infra] Add `color-scheme` to document in iframe demos (#45406) @KenanYusuf
53
+ - [docs-infra] Revert to use deprecated `CssVarsProvider` for MUI X (#45371) @siriwatknp
54
+ - [docs-infra] Fix dark mode flicker for API pages (#45354) @siriwatknp
55
+ - [examples] Remove unnecessary comma in Material UI Vite JS example (#45370) @ZeeshanTamboli
56
+ - [test] Remove unused renderTags prop and fix key warning in Autocomplete regression test (#45410) @ZeeshanTamboli
57
+
58
+ All contributors of this release in alphabetical order: @DiegoAndai, @harry-whorlow, @Janpot, @KenanYusuf, @NooBat, @sai6855, @siriwatknp, @ZeeshanTamboli
59
+
3
60
  ## 7.0.0-alpha.2
4
61
 
5
62
  <!-- generated comparing v7.0.0-alpha.1..master -->
@@ -111,11 +111,6 @@ export interface DialogProps extends Omit<StandardProps<ModalProps, 'children'>,
111
111
  * @default 'sm'
112
112
  */
113
113
  maxWidth?: Breakpoint | false;
114
- /**
115
- * Callback fired when the backdrop is clicked.
116
- * @deprecated Use the `onClose` prop with the `reason` argument to handle the `backdropClick` events.
117
- */
118
- onBackdropClick?: ModalProps['onBackdropClick'];
119
114
  /**
120
115
  * Callback fired when the component requests to be closed.
121
116
  *
package/Dialog/Dialog.js CHANGED
@@ -219,7 +219,6 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
219
219
  fullScreen = false,
220
220
  fullWidth = false,
221
221
  maxWidth = 'sm',
222
- onBackdropClick,
223
222
  onClick,
224
223
  onClose,
225
224
  open,
@@ -258,9 +257,6 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
258
257
  return;
259
258
  }
260
259
  backdropClick.current = null;
261
- if (onBackdropClick) {
262
- onBackdropClick(event);
263
- }
264
260
  if (onClose) {
265
261
  onClose(event, 'backdropClick');
266
262
  }
@@ -437,11 +433,6 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes /* remove-proptypes */
437
433
  * @default 'sm'
438
434
  */
439
435
  maxWidth: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]), _propTypes.default.string]),
440
- /**
441
- * Callback fired when the backdrop is clicked.
442
- * @deprecated Use the `onClose` prop with the `reason` argument to handle the `backdropClick` events.
443
- */
444
- onBackdropClick: _propTypes.default.func,
445
436
  /**
446
437
  * @ignore
447
438
  */
package/Grid/Grid.d.ts CHANGED
@@ -1,77 +1,17 @@
1
- import * as React from 'react';
2
- import { ResponsiveStyleValue, SxProps, SystemProps, Breakpoint, BreakpointOverrides } from '@mui/system';
3
- import { IfEquals } from '@mui/types';
4
- import { Theme } from "../styles/index.js";
5
- import { OverridableComponent, OverrideProps } from "../OverridableComponent/index.js";
6
- import { GridClasses } from "./gridClasses.js";
1
+ import { SxProps, SystemProps } from '@mui/system';
2
+ import { OverridableComponent, OverrideProps } from '@mui/types';
3
+ import { Theme, Breakpoint } from "../styles/index.js";
4
+ type ResponsiveStyleValue<T> = T | Array<T | null> | { [key in Breakpoint]?: T | null };
7
5
  export type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
8
6
  export type GridSpacing = number | string;
9
7
  export type GridWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
10
- export type GridSize = 'auto' | number;
11
- export interface RegularBreakpoints {
12
- /**
13
- * If a number, it sets the number of columns the grid item uses.
14
- * It can't be greater than the total number of columns of the container (12 by default).
15
- * If 'auto', the grid item's width matches its content.
16
- * If false, the prop is ignored.
17
- * If true, the grid item's width grows to use the space available in the grid container.
18
- * The value is applied for the `lg` breakpoint and wider screens if not overridden.
19
- * @default false
20
- */
21
- lg?: boolean | GridSize;
22
- /**
23
- * If a number, it sets the number of columns the grid item uses.
24
- * It can't be greater than the total number of columns of the container (12 by default).
25
- * If 'auto', the grid item's width matches its content.
26
- * If false, the prop is ignored.
27
- * If true, the grid item's width grows to use the space available in the grid container.
28
- * The value is applied for the `md` breakpoint and wider screens if not overridden.
29
- * @default false
30
- */
31
- md?: boolean | GridSize;
32
- /**
33
- * If a number, it sets the number of columns the grid item uses.
34
- * It can't be greater than the total number of columns of the container (12 by default).
35
- * If 'auto', the grid item's width matches its content.
36
- * If false, the prop is ignored.
37
- * If true, the grid item's width grows to use the space available in the grid container.
38
- * The value is applied for the `sm` breakpoint and wider screens if not overridden.
39
- * @default false
40
- */
41
- sm?: boolean | GridSize;
42
- /**
43
- * If a number, it sets the number of columns the grid item uses.
44
- * It can't be greater than the total number of columns of the container (12 by default).
45
- * If 'auto', the grid item's width matches its content.
46
- * If false, the prop is ignored.
47
- * If true, the grid item's width grows to use the space available in the grid container.
48
- * The value is applied for the `xl` breakpoint and wider screens if not overridden.
49
- * @default false
50
- */
51
- xl?: boolean | GridSize;
52
- /**
53
- * If a number, it sets the number of columns the grid item uses.
54
- * It can't be greater than the total number of columns of the container (12 by default).
55
- * If 'auto', the grid item's width matches its content.
56
- * If false, the prop is ignored.
57
- * If true, the grid item's width grows to use the space available in the grid container.
58
- * The value is applied for all the screen sizes with the lowest priority.
59
- * @default false
60
- */
61
- xs?: boolean | GridSize;
62
- }
63
- type CustomBreakpoints = Partial<Record<Breakpoint, boolean | GridSize>>;
64
- interface BreakpointOverridesEmpty {}
65
- type Breakpoints = IfEquals<BreakpointOverrides, BreakpointOverridesEmpty, RegularBreakpoints, CustomBreakpoints>;
66
- export interface GridOwnProps extends SystemProps<Theme>, Breakpoints {
8
+ export type GridSize = 'auto' | 'grow' | number | false;
9
+ export type GridOffset = 'auto' | number;
10
+ export interface GridBaseProps {
67
11
  /**
68
12
  * The content of the component.
69
13
  */
70
14
  children?: React.ReactNode;
71
- /**
72
- * Override or extend the styles applied to the component.
73
- */
74
- classes?: Partial<GridClasses>;
75
15
  /**
76
16
  * The number of columns.
77
17
  * @default 12
@@ -95,48 +35,68 @@ export interface GridOwnProps extends SystemProps<Theme>, Breakpoints {
95
35
  */
96
36
  direction?: ResponsiveStyleValue<GridDirection>;
97
37
  /**
98
- * If `true`, the component will have the flex *item* behavior.
99
- * You should be wrapping *items* with a *container*.
100
- * @default false
101
- */
102
- item?: boolean;
38
+ * Defines the offset value for the type `item` components.
39
+ */
40
+ offset?: ResponsiveStyleValue<GridOffset>;
41
+ /**
42
+ * @internal
43
+ * The level of the grid starts from `0` and increases when the grid nests
44
+ * inside another grid. Nesting is defined as a container Grid being a direct
45
+ * child of a container Grid.
46
+ *
47
+ * ```js
48
+ * <Grid container> // level 0
49
+ * <Grid container> // level 1
50
+ * <Grid container> // level 2
51
+ * ```
52
+ *
53
+ * Only consecutive grid is considered nesting. A grid container will start at
54
+ * `0` if there are non-Grid container element above it.
55
+ *
56
+ * ```js
57
+ * <Grid container> // level 0
58
+ * <div>
59
+ * <Grid container> // level 0
60
+ * ```
61
+ *
62
+ * ```js
63
+ * <Grid container> // level 0
64
+ * <Grid>
65
+ * <Grid container> // level 0
66
+ * ```
67
+ */
68
+ unstable_level?: number;
103
69
  /**
104
70
  * Defines the vertical space between the type `item` components.
105
71
  * It overrides the value of the `spacing` prop.
106
72
  */
107
73
  rowSpacing?: ResponsiveStyleValue<GridSpacing>;
74
+ /**
75
+ * Defines the size of the the type `item` components.
76
+ */
77
+ size?: ResponsiveStyleValue<GridSize>;
108
78
  /**
109
79
  * Defines the space between the type `item` components.
110
80
  * It can only be used on a type `container` component.
111
81
  * @default 0
112
82
  */
113
- spacing?: ResponsiveStyleValue<GridSpacing>;
114
- /**
115
- * The system prop that allows defining system overrides as well as additional CSS styles.
116
- */
117
- sx?: SxProps<Theme>;
83
+ spacing?: ResponsiveStyleValue<GridSpacing> | undefined;
118
84
  /**
119
85
  * Defines the `flex-wrap` style property.
120
86
  * It's applied for all screen sizes.
121
87
  * @default 'wrap'
122
88
  */
123
89
  wrap?: GridWrap;
124
- /**
125
- * If `true`, it sets `min-width: 0` on the item.
126
- * Refer to the limitations section of the documentation to better understand the use case.
127
- * @default false
128
- */
129
- zeroMinWidth?: boolean;
130
90
  }
131
-
132
- /**
133
- * @deprecated Use the [`Grid2`](https://mui.com/material-ui/react-grid2/) component instead.
134
- */
135
- export interface GridTypeMap<AdditionalProps = {}, RootComponent extends React.ElementType = 'div'> {
136
- props: AdditionalProps & GridOwnProps;
137
- defaultComponent: RootComponent;
91
+ export interface GridTypeMap<P = {}, D extends React.ElementType = 'div'> {
92
+ props: P & GridBaseProps & {
93
+ sx?: SxProps<Theme>;
94
+ } & SystemProps<Theme>;
95
+ defaultComponent: D;
138
96
  }
139
-
97
+ export type GridProps<D extends React.ElementType = GridTypeMap['defaultComponent'], P = {
98
+ component?: React.ElementType;
99
+ }> = OverrideProps<GridTypeMap<P, D>, D>;
140
100
  /**
141
101
  *
142
102
  * Demos:
@@ -146,15 +106,6 @@ export interface GridTypeMap<AdditionalProps = {}, RootComponent extends React.E
146
106
  * API:
147
107
  *
148
108
  * - [Grid API](https://next.mui.com/material-ui/api/grid/)
149
- *
150
- * @deprecated Use the [`Grid2`](https://mui.com/material-ui/react-grid2/) component instead.
151
109
  */
152
110
  declare const Grid: OverridableComponent<GridTypeMap>;
153
-
154
- /**
155
- * @deprecated Use the [`Grid2`](https://mui.com/material-ui/react-grid2/) component instead.
156
- */
157
- export type GridProps<RootComponent extends React.ElementType = GridTypeMap['defaultComponent'], AdditionalProps = {}> = OverrideProps<GridTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
158
- component?: React.ElementType;
159
- };
160
111
  export default Grid;