@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
@@ -3,44 +3,6 @@ export interface GridClasses {
3
3
  root: string;
4
4
  /** Styles applied to the root element if `container={true}`. */
5
5
  container: string;
6
- /** Styles applied to the root element if `item={true}`. */
7
- item: string;
8
- /** Styles applied to the root element if `zeroMinWidth={true}`. */
9
- zeroMinWidth: string;
10
- /** Styles applied to the root element if `direction="column"`. */
11
- 'direction-xs-column': string;
12
- /** Styles applied to the root element if `direction="column-reverse"`. */
13
- 'direction-xs-column-reverse': string;
14
- /** Styles applied to the root element if `direction="row-reverse"`. */
15
- 'direction-xs-row-reverse': string;
16
- /** Styles applied to the root element if `wrap="nowrap"`. */
17
- 'wrap-xs-nowrap': string;
18
- /** Styles applied to the root element if `wrap="reverse"`. */
19
- 'wrap-xs-wrap-reverse': string;
20
- 'spacing-xs-1': string;
21
- 'spacing-xs-2': string;
22
- 'spacing-xs-3': string;
23
- 'spacing-xs-4': string;
24
- 'spacing-xs-5': string;
25
- 'spacing-xs-6': string;
26
- 'spacing-xs-7': string;
27
- 'spacing-xs-8': string;
28
- 'spacing-xs-9': string;
29
- 'spacing-xs-10': string;
30
- 'grid-xs-auto': string;
31
- 'grid-xs-true': string;
32
- 'grid-xs-1': string;
33
- 'grid-xs-2': string;
34
- 'grid-xs-3': string;
35
- 'grid-xs-4': string;
36
- 'grid-xs-5': string;
37
- 'grid-xs-6': string;
38
- 'grid-xs-7': string;
39
- 'grid-xs-8': string;
40
- 'grid-xs-9': string;
41
- 'grid-xs-10': string;
42
- 'grid-xs-11': string;
43
- 'grid-xs-12': string;
44
6
  }
45
7
  export type GridClassKey = keyof GridClasses;
46
8
  export declare function getGridUtilityClass(slot: string): string;
@@ -15,7 +15,7 @@ const SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
15
15
  const DIRECTIONS = ['column-reverse', 'column', 'row-reverse', 'row'];
16
16
  const WRAPS = ['nowrap', 'wrap-reverse', 'wrap'];
17
17
  const GRID_SIZES = ['auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
18
- const gridClasses = (0, _generateUtilityClasses.default)('MuiGrid', ['root', 'container', 'item', 'zeroMinWidth',
18
+ const gridClasses = (0, _generateUtilityClasses.default)('MuiGrid', ['root', 'container',
19
19
  // spacings
20
20
  ...SPACINGS.map(spacing => `spacing-xs-${spacing}`),
21
21
  // direction values
package/Grid/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -20,7 +19,18 @@ Object.defineProperty(exports, "gridClasses", {
20
19
  return _gridClasses.default;
21
20
  }
22
21
  });
23
- var _Grid = _interopRequireDefault(require("./Grid"));
22
+ var _Grid = _interopRequireWildcard(require("./Grid"));
23
+ Object.keys(_Grid).forEach(function (key) {
24
+ if (key === "default" || key === "__esModule") return;
25
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
26
+ if (key in exports && exports[key] === _Grid[key]) return;
27
+ Object.defineProperty(exports, key, {
28
+ enumerable: true,
29
+ get: function () {
30
+ return _Grid[key];
31
+ }
32
+ });
33
+ });
24
34
  var _gridClasses = _interopRequireWildcard(require("./gridClasses"));
25
35
  Object.keys(_gridClasses).forEach(function (key) {
26
36
  if (key === "default" || key === "__esModule") return;
@@ -0,0 +1,160 @@
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 { GridLegacyClasses } from "./gridLegacyClasses.js";
7
+ export type GridLegacyDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
8
+ export type GridLegacySpacing = number | string;
9
+ export type GridLegacyWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
10
+ export type GridLegacySize = '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 | GridLegacySize;
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 | GridLegacySize;
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 | GridLegacySize;
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 | GridLegacySize;
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 | GridLegacySize;
62
+ }
63
+ type CustomBreakpoints = Partial<Record<Breakpoint, boolean | GridLegacySize>>;
64
+ interface BreakpointOverridesEmpty {}
65
+ type Breakpoints = IfEquals<BreakpointOverrides, BreakpointOverridesEmpty, RegularBreakpoints, CustomBreakpoints>;
66
+ export interface GridLegacyOwnProps extends SystemProps<Theme>, Breakpoints {
67
+ /**
68
+ * The content of the component.
69
+ */
70
+ children?: React.ReactNode;
71
+ /**
72
+ * Override or extend the styles applied to the component.
73
+ */
74
+ classes?: Partial<GridLegacyClasses>;
75
+ /**
76
+ * The number of columns.
77
+ * @default 12
78
+ */
79
+ columns?: ResponsiveStyleValue<number>;
80
+ /**
81
+ * Defines the horizontal space between the type `item` components.
82
+ * It overrides the value of the `spacing` prop.
83
+ */
84
+ columnSpacing?: ResponsiveStyleValue<GridLegacySpacing>;
85
+ /**
86
+ * If `true`, the component will have the flex *container* behavior.
87
+ * You should be wrapping *items* with a *container*.
88
+ * @default false
89
+ */
90
+ container?: boolean;
91
+ /**
92
+ * Defines the `flex-direction` style property.
93
+ * It is applied for all screen sizes.
94
+ * @default 'row'
95
+ */
96
+ direction?: ResponsiveStyleValue<GridLegacyDirection>;
97
+ /**
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;
103
+ /**
104
+ * Defines the vertical space between the type `item` components.
105
+ * It overrides the value of the `spacing` prop.
106
+ */
107
+ rowSpacing?: ResponsiveStyleValue<GridLegacySpacing>;
108
+ /**
109
+ * Defines the space between the type `item` components.
110
+ * It can only be used on a type `container` component.
111
+ * @default 0
112
+ */
113
+ spacing?: ResponsiveStyleValue<GridLegacySpacing>;
114
+ /**
115
+ * The system prop that allows defining system overrides as well as additional CSS styles.
116
+ */
117
+ sx?: SxProps<Theme>;
118
+ /**
119
+ * Defines the `flex-wrap` style property.
120
+ * It's applied for all screen sizes.
121
+ * @default 'wrap'
122
+ */
123
+ wrap?: GridLegacyWrap;
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
+ }
131
+
132
+ /**
133
+ * @deprecated Use the [`Grid`](https://mui.com/material-ui/react-grid/) component instead.
134
+ */
135
+ export interface GridLegacyTypeMap<AdditionalProps = {}, RootComponent extends React.ElementType = 'div'> {
136
+ props: AdditionalProps & GridLegacyOwnProps;
137
+ defaultComponent: RootComponent;
138
+ }
139
+
140
+ /**
141
+ *
142
+ * Demos:
143
+ *
144
+ * - [GridLegacy](https://next.mui.com/material-ui/react-grid-legacy/)
145
+ *
146
+ * API:
147
+ *
148
+ * - [GridLegacy API](https://next.mui.com/material-ui/api/grid-legacy/)
149
+ *
150
+ * @deprecated Use the [`Grid`](https://mui.com/material-ui/react-grid/) component instead.
151
+ */
152
+ declare const GridLegacy: OverridableComponent<GridLegacyTypeMap>;
153
+
154
+ /**
155
+ * @deprecated Use the [`Grid`](https://mui.com/material-ui/react-grid/) component instead.
156
+ */
157
+ export type GridLegacyProps<RootComponent extends React.ElementType = GridLegacyTypeMap['defaultComponent'], AdditionalProps = {}> = OverrideProps<GridLegacyTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
158
+ component?: React.ElementType;
159
+ };
160
+ export default GridLegacy;