@mui/system 5.13.1 → 5.13.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 (93) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/Container/Container.d.ts +13 -13
  3. package/Container/ContainerProps.d.ts +40 -40
  4. package/Container/containerClasses.d.ts +22 -22
  5. package/Container/createContainer.d.ts +18 -18
  6. package/Container/createContainer.js +35 -41
  7. package/GlobalStyles/GlobalStyles.d.ts +13 -13
  8. package/GlobalStyles/index.d.ts +2 -2
  9. package/Stack/Stack.d.ts +14 -14
  10. package/Stack/StackProps.d.ts +53 -53
  11. package/Stack/createStack.d.ts +21 -21
  12. package/Stack/createStack.js +26 -24
  13. package/Stack/index.d.ts +5 -5
  14. package/Stack/stackClasses.d.ts +8 -8
  15. package/ThemeProvider/ThemeProvider.js +5 -9
  16. package/Unstable_Grid/Grid.d.ts +12 -12
  17. package/Unstable_Grid/GridProps.d.ts +185 -185
  18. package/Unstable_Grid/createGrid.d.ts +11 -11
  19. package/Unstable_Grid/createGrid.js +23 -21
  20. package/Unstable_Grid/gridClasses.d.ts +20 -20
  21. package/Unstable_Grid/gridGenerator.d.ts +38 -38
  22. package/Unstable_Grid/gridGenerator.js +18 -20
  23. package/Unstable_Grid/index.d.ts +5 -5
  24. package/breakpoints.js +6 -7
  25. package/createBox.js +12 -9
  26. package/createStyled.js +32 -40
  27. package/createTheme/createBreakpoints.js +26 -24
  28. package/createTheme/createSpacing.d.ts +10 -10
  29. package/createTheme/createTheme.js +14 -18
  30. package/cssVars/createCssVarsProvider.js +20 -21
  31. package/cssVars/createCssVarsTheme.d.ts +15 -15
  32. package/cssVars/createCssVarsTheme.js +10 -10
  33. package/cssVars/createGetCssVar.d.ts +5 -5
  34. package/cssVars/cssVarsParser.d.ts +64 -64
  35. package/cssVars/getInitColorSchemeScript.d.ts +42 -42
  36. package/cssVars/index.d.ts +5 -5
  37. package/cssVars/prepareCssVars.d.ts +16 -16
  38. package/cssVars/prepareCssVars.js +12 -13
  39. package/cssVars/useCurrentColorScheme.d.ts +53 -53
  40. package/cssVars/useCurrentColorScheme.js +11 -17
  41. package/esm/Container/createContainer.js +35 -41
  42. package/esm/Stack/createStack.js +26 -24
  43. package/esm/ThemeProvider/ThemeProvider.js +5 -9
  44. package/esm/Unstable_Grid/createGrid.js +23 -21
  45. package/esm/Unstable_Grid/gridGenerator.js +17 -20
  46. package/esm/breakpoints.js +6 -7
  47. package/esm/createBox.js +12 -9
  48. package/esm/createStyled.js +31 -38
  49. package/esm/createTheme/createBreakpoints.js +25 -24
  50. package/esm/createTheme/createTheme.js +14 -18
  51. package/esm/cssVars/createCssVarsProvider.js +20 -21
  52. package/esm/cssVars/createCssVarsTheme.js +10 -10
  53. package/esm/cssVars/prepareCssVars.js +12 -13
  54. package/esm/cssVars/useCurrentColorScheme.js +10 -17
  55. package/esm/propsToClassKey.js +5 -3
  56. package/esm/styleFunctionSx/extendSxProp.js +10 -14
  57. package/index.js +1 -1
  58. package/legacy/Container/createContainer.js +6 -7
  59. package/legacy/Stack/createStack.js +5 -6
  60. package/legacy/ThemeProvider/ThemeProvider.js +3 -4
  61. package/legacy/Unstable_Grid/createGrid.js +4 -6
  62. package/legacy/Unstable_Grid/gridGenerator.js +4 -6
  63. package/legacy/breakpoints.js +3 -5
  64. package/legacy/createBox.js +2 -4
  65. package/legacy/createStyled.js +11 -13
  66. package/legacy/createTheme/createBreakpoints.js +3 -4
  67. package/legacy/createTheme/createTheme.js +4 -6
  68. package/legacy/cssVars/createCssVarsProvider.js +5 -6
  69. package/legacy/cssVars/createCssVarsTheme.js +2 -4
  70. package/legacy/cssVars/prepareCssVars.js +3 -5
  71. package/legacy/cssVars/useCurrentColorScheme.js +7 -9
  72. package/legacy/index.js +1 -1
  73. package/legacy/styleFunctionSx/extendSxProp.js +4 -6
  74. package/modern/Container/createContainer.js +35 -41
  75. package/modern/Stack/createStack.js +26 -24
  76. package/modern/ThemeProvider/ThemeProvider.js +5 -9
  77. package/modern/Unstable_Grid/createGrid.js +23 -21
  78. package/modern/Unstable_Grid/gridGenerator.js +17 -20
  79. package/modern/breakpoints.js +6 -7
  80. package/modern/createBox.js +12 -9
  81. package/modern/createStyled.js +31 -38
  82. package/modern/createTheme/createBreakpoints.js +25 -24
  83. package/modern/createTheme/createTheme.js +14 -18
  84. package/modern/cssVars/createCssVarsProvider.js +20 -21
  85. package/modern/cssVars/createCssVarsTheme.js +10 -10
  86. package/modern/cssVars/prepareCssVars.js +12 -13
  87. package/modern/cssVars/useCurrentColorScheme.js +10 -17
  88. package/modern/index.js +1 -1
  89. package/modern/propsToClassKey.js +5 -3
  90. package/modern/styleFunctionSx/extendSxProp.js +10 -14
  91. package/package.json +2 -2
  92. package/propsToClassKey.js +6 -3
  93. package/styleFunctionSx/extendSxProp.js +10 -14
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = createStack;
8
8
  exports.style = void 0;
9
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
11
  var React = _interopRequireWildcard(require("react"));
10
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
13
  var _clsx = _interopRequireDefault(require("clsx"));
@@ -17,6 +19,7 @@ var _createTheme = _interopRequireDefault(require("../createTheme"));
17
19
  var _breakpoints = require("../breakpoints");
18
20
  var _spacing = require("../spacing");
19
21
  var _jsxRuntime = require("react/jsx-runtime");
22
+ const _excluded = ["component", "direction", "spacing", "divider", "children", "className", "useFlexGap"];
20
23
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
25
  const defaultTheme = (0, _createTheme.default)();
@@ -65,18 +68,17 @@ const style = ({
65
68
  ownerState,
66
69
  theme
67
70
  }) => {
68
- let styles = {
71
+ let styles = (0, _extends2.default)({
69
72
  display: 'flex',
70
- flexDirection: 'column',
71
- ...(0, _breakpoints.handleBreakpoints)({
72
- theme
73
- }, (0, _breakpoints.resolveBreakpointValues)({
74
- values: ownerState.direction,
75
- breakpoints: theme.breakpoints.values
76
- }), propValue => ({
77
- flexDirection: propValue
78
- }))
79
- };
73
+ flexDirection: 'column'
74
+ }, (0, _breakpoints.handleBreakpoints)({
75
+ theme
76
+ }, (0, _breakpoints.resolveBreakpointValues)({
77
+ values: ownerState.direction,
78
+ breakpoints: theme.breakpoints.values
79
+ }), propValue => ({
80
+ flexDirection: propValue
81
+ })));
80
82
  if (ownerState.spacing) {
81
83
  const transformer = (0, _spacing.createUnarySpacing)(theme);
82
84
  const base = Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => {
@@ -141,29 +143,29 @@ function createStack(options = {}) {
141
143
  const themeProps = useThemeProps(inProps);
142
144
  const props = (0, _styleFunctionSx.extendSxProp)(themeProps); // `color` type conflicts with html color attribute.
143
145
  const {
144
- component = 'div',
145
- direction = 'column',
146
- spacing = 0,
147
- divider,
148
- children,
149
- className,
150
- useFlexGap = false,
151
- ...other
152
- } = props;
146
+ component = 'div',
147
+ direction = 'column',
148
+ spacing = 0,
149
+ divider,
150
+ children,
151
+ className,
152
+ useFlexGap = false
153
+ } = props,
154
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
153
155
  const ownerState = {
154
156
  direction,
155
157
  spacing,
156
158
  useFlexGap
157
159
  };
158
160
  const classes = useUtilityClasses();
159
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(StackRoot, {
161
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(StackRoot, (0, _extends2.default)({
160
162
  as: component,
161
163
  ownerState: ownerState,
162
164
  ref: ref,
163
- className: (0, _clsx.default)(classes.root, className),
164
- ...other,
165
+ className: (0, _clsx.default)(classes.root, className)
166
+ }, other, {
165
167
  children: divider ? joinChildren(children, divider) : children
166
- });
168
+ }));
167
169
  });
168
170
  process.env.NODE_ENV !== "production" ? Stack.propTypes /* remove-proptypes */ = {
169
171
  children: _propTypes.default.node,
package/Stack/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { default } from './Stack';
2
- export { default as createStack } from './createStack';
3
- export * from './StackProps';
4
- export { default as stackClasses } from './stackClasses';
5
- export * from './stackClasses';
1
+ export { default } from './Stack';
2
+ export { default as createStack } from './createStack';
3
+ export * from './StackProps';
4
+ export { default as stackClasses } from './stackClasses';
5
+ export * from './stackClasses';
@@ -1,8 +1,8 @@
1
- export interface StackClasses {
2
- /** Styles applied to the root element. */
3
- root: string;
4
- }
5
- export type StackClassKey = keyof StackClasses;
6
- export declare function getStackUtilityClass(slot: string): string;
7
- declare const stackClasses: StackClasses;
8
- export default stackClasses;
1
+ export interface StackClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ }
5
+ export type StackClassKey = keyof StackClasses;
6
+ export declare function getStackUtilityClass(slot: string): string;
7
+ declare const stackClasses: StackClasses;
8
+ export default stackClasses;
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
9
  var React = _interopRequireWildcard(require("react"));
9
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
10
11
  var _privateTheming = require("@mui/private-theming");
@@ -20,10 +21,9 @@ function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
20
21
  const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;
21
22
  if (typeof localTheme === 'function') {
22
23
  const mergedTheme = localTheme(resolvedTheme);
23
- const result = themeId ? {
24
- ...upperTheme,
24
+ const result = themeId ? (0, _extends2.default)({}, upperTheme, {
25
25
  [themeId]: mergedTheme
26
- } : mergedTheme;
26
+ }) : mergedTheme;
27
27
  // must return a function for the private theme to NOT merge with the upper theme.
28
28
  // see the test case "use provided theme from a callback" in ThemeProvider.test.js
29
29
  if (isPrivate) {
@@ -31,13 +31,9 @@ function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
31
31
  }
32
32
  return result;
33
33
  }
34
- return themeId ? {
35
- ...upperTheme,
34
+ return themeId ? (0, _extends2.default)({}, upperTheme, {
36
35
  [themeId]: localTheme
37
- } : {
38
- ...upperTheme,
39
- ...localTheme
40
- };
36
+ }) : (0, _extends2.default)({}, upperTheme, localTheme);
41
37
  }, [themeId, upperTheme, localTheme, isPrivate]);
42
38
  }
43
39
 
@@ -1,12 +1,12 @@
1
- /**
2
- *
3
- * Demos:
4
- *
5
- * - [Grid (Material UI)](https://mui.com/material-ui/react-grid/)
6
- *
7
- * API:
8
- *
9
- * - [Grid API](https://mui.com/system/api/grid/)
10
- */
11
- declare const Grid: import("@mui/types").OverridableComponent<import("./GridProps").GridTypeMap<{}, "div">>;
12
- export default Grid;
1
+ /**
2
+ *
3
+ * Demos:
4
+ *
5
+ * - [Grid (Material UI)](https://mui.com/material-ui/react-grid/)
6
+ *
7
+ * API:
8
+ *
9
+ * - [Grid API](https://mui.com/system/api/grid/)
10
+ */
11
+ declare const Grid: import("@mui/types").OverridableComponent<import("./GridProps").GridTypeMap<{}, "div">>;
12
+ export default Grid;
@@ -1,185 +1,185 @@
1
- import * as React from 'react';
2
- import { OverrideProps, IfEquals } from '@mui/types';
3
- import { SxProps } from '../styleFunctionSx';
4
- import { Theme, Breakpoint, BreakpointOverrides } from '../createTheme';
5
- import { SystemProps } from '../Box';
6
- type ResponsiveStyleValue<T> = T | Array<T | null> | {
7
- [key in Breakpoint]?: T | null;
8
- };
9
- export type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
10
- export type GridSpacing = number | string;
11
- export type GridWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
12
- export type GridSize = 'auto' | number;
13
- export interface GridDefaultBreakpoints {
14
- /**
15
- * If a number, it sets the number of columns the grid item uses.
16
- * It can't be greater than the total number of columns of the container (12 by default).
17
- * If 'auto', the grid item's width matches its content.
18
- * If false, the prop is ignored.
19
- * If true, the grid item's width grows to use the space available in the grid container.
20
- * The value is applied for the `lg` breakpoint and wider screens if not overridden.
21
- * @default false
22
- */
23
- lg?: boolean | GridSize;
24
- /**
25
- * If a number, it sets the margin-left equals to the number of columns the grid item uses.
26
- * If 'auto', the grid item push itself to the right-end of the container.
27
- * The value is applied for the `lg` breakpoint and wider screens if not overridden.
28
- */
29
- lgOffset?: GridSize;
30
- /**
31
- * If a number, it sets the number of columns the grid item uses.
32
- * It can't be greater than the total number of columns of the container (12 by default).
33
- * If 'auto', the grid item's width matches its content.
34
- * If false, the prop is ignored.
35
- * If true, the grid item's width grows to use the space available in the grid container.
36
- * The value is applied for the `md` breakpoint and wider screens if not overridden.
37
- * @default false
38
- */
39
- md?: boolean | GridSize;
40
- /**
41
- * If a number, it sets the margin-left equals to the number of columns the grid item uses.
42
- * If 'auto', the grid item push itself to the right-end of the container.
43
- * The value is applied for the `md` breakpoint and wider screens if not overridden.
44
- */
45
- mdOffset?: GridSize;
46
- /**
47
- * If a number, it sets the number of columns the grid item uses.
48
- * It can't be greater than the total number of columns of the container (12 by default).
49
- * If 'auto', the grid item's width matches its content.
50
- * If false, the prop is ignored.
51
- * If true, the grid item's width grows to use the space available in the grid container.
52
- * The value is applied for the `sm` breakpoint and wider screens if not overridden.
53
- * @default false
54
- */
55
- sm?: boolean | GridSize;
56
- /**
57
- * If a number, it sets the margin-left equals to the number of columns the grid item uses.
58
- * If 'auto', the grid item push itself to the right-end of the container.
59
- * The value is applied for the `sm` breakpoint and wider screens if not overridden.
60
- */
61
- smOffset?: GridSize;
62
- /**
63
- * If a number, it sets the number of columns the grid item uses.
64
- * It can't be greater than the total number of columns of the container (12 by default).
65
- * If 'auto', the grid item's width matches its content.
66
- * If false, the prop is ignored.
67
- * If true, the grid item's width grows to use the space available in the grid container.
68
- * The value is applied for the `xl` breakpoint and wider screens if not overridden.
69
- * @default false
70
- */
71
- xl?: boolean | GridSize;
72
- /**
73
- * If a number, it sets the margin-left equals to the number of columns the grid item uses.
74
- * If 'auto', the grid item push itself to the right-end of the container.
75
- * The value is applied for the `xl` breakpoint and wider screens if not overridden.
76
- */
77
- xlOffset?: GridSize;
78
- /**
79
- * If a number, it sets the number of columns the grid item uses.
80
- * It can't be greater than the total number of columns of the container (12 by default).
81
- * If 'auto', the grid item's width matches its content.
82
- * If false, the prop is ignored.
83
- * If true, the grid item's width grows to use the space available in the grid container.
84
- * The value is applied for all the screen sizes with the lowest priority.
85
- * @default false
86
- */
87
- xs?: boolean | GridSize;
88
- /**
89
- * If a number, it sets the margin-left equals to the number of columns the grid item uses.
90
- * If 'auto', the grid item push itself to the right-end of the container.
91
- * The value is applied for the `xs` breakpoint and wider screens if not overridden.
92
- */
93
- xsOffset?: GridSize;
94
- }
95
- type CustomBreakpoints = Partial<Record<Breakpoint, boolean | GridSize> & Record<`${Breakpoint}Offset`, GridSize>>;
96
- interface BreakpointOverridesEmpty {
97
- }
98
- type Breakpoints = IfEquals<BreakpointOverrides, BreakpointOverridesEmpty, GridDefaultBreakpoints, CustomBreakpoints>;
99
- export interface GridBaseProps extends Breakpoints {
100
- /**
101
- * The content of the component.
102
- */
103
- children?: React.ReactNode;
104
- /**
105
- * The number of columns.
106
- * @default 12
107
- */
108
- columns?: ResponsiveStyleValue<number>;
109
- /**
110
- * Defines the horizontal space between the type `item` components.
111
- * It overrides the value of the `spacing` prop.
112
- */
113
- columnSpacing?: ResponsiveStyleValue<GridSpacing>;
114
- /**
115
- * If `true`, the component will have the flex *container* behavior.
116
- * You should be wrapping *items* with a *container*.
117
- * @default false
118
- */
119
- container?: boolean;
120
- /**
121
- * Defines the `flex-direction` style property.
122
- * It is applied for all screen sizes.
123
- * @default 'row'
124
- */
125
- direction?: ResponsiveStyleValue<GridDirection>;
126
- /**
127
- * If `true`, the negative margin and padding are apply only to the top and left sides of the grid.
128
- */
129
- disableEqualOverflow?: boolean;
130
- /**
131
- * @internal
132
- * The level of the grid starts from `0`
133
- * and increases when the grid nests inside another grid regardless of container or item.
134
- *
135
- * ```js
136
- * <Grid> // level 0
137
- * <Grid> // level 1
138
- * <Grid> // level 2
139
- * <Grid> // level 1
140
- * ```
141
- *
142
- * Only consecutive grid is considered nesting.
143
- * A grid container will start at `0` if there are non-Grid element above it.
144
- *
145
- * ```js
146
- * <Grid> // level 0
147
- * <div>
148
- * <Grid> // level 0
149
- * <Grid> // level 1
150
- * ```
151
- */
152
- unstable_level?: number;
153
- /**
154
- * Defines the vertical space between the type `item` components.
155
- * It overrides the value of the `spacing` prop.
156
- */
157
- rowSpacing?: ResponsiveStyleValue<GridSpacing>;
158
- /**
159
- * Defines the space between the type `item` components.
160
- * It can only be used on a type `container` component.
161
- * @default 0
162
- */
163
- spacing?: ResponsiveStyleValue<GridSpacing> | undefined;
164
- /**
165
- * Defines the `flex-wrap` style property.
166
- * It's applied for all screen sizes.
167
- * @default 'wrap'
168
- */
169
- wrap?: GridWrap;
170
- }
171
- export interface GridOwnerState extends GridBaseProps {
172
- unstable_level: number;
173
- gridSize: Partial<Record<Breakpoint, GridSize | boolean>>;
174
- gridOffset: Partial<Record<Breakpoint, GridSize>>;
175
- }
176
- export interface GridTypeMap<P = {}, D extends React.ElementType = 'div'> {
177
- props: P & GridBaseProps & {
178
- sx?: SxProps<Theme>;
179
- } & SystemProps<Theme>;
180
- defaultComponent: D;
181
- }
182
- export type GridProps<D extends React.ElementType = GridTypeMap['defaultComponent'], P = {
183
- component?: React.ElementType;
184
- }> = OverrideProps<GridTypeMap<P, D>, D>;
185
- export {};
1
+ import * as React from 'react';
2
+ import { OverrideProps, IfEquals } from '@mui/types';
3
+ import { SxProps } from '../styleFunctionSx';
4
+ import { Theme, Breakpoint, BreakpointOverrides } from '../createTheme';
5
+ import { SystemProps } from '../Box';
6
+ type ResponsiveStyleValue<T> = T | Array<T | null> | {
7
+ [key in Breakpoint]?: T | null;
8
+ };
9
+ export type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
10
+ export type GridSpacing = number | string;
11
+ export type GridWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
12
+ export type GridSize = 'auto' | number;
13
+ export interface GridDefaultBreakpoints {
14
+ /**
15
+ * If a number, it sets the number of columns the grid item uses.
16
+ * It can't be greater than the total number of columns of the container (12 by default).
17
+ * If 'auto', the grid item's width matches its content.
18
+ * If false, the prop is ignored.
19
+ * If true, the grid item's width grows to use the space available in the grid container.
20
+ * The value is applied for the `lg` breakpoint and wider screens if not overridden.
21
+ * @default false
22
+ */
23
+ lg?: boolean | GridSize;
24
+ /**
25
+ * If a number, it sets the margin-left equals to the number of columns the grid item uses.
26
+ * If 'auto', the grid item push itself to the right-end of the container.
27
+ * The value is applied for the `lg` breakpoint and wider screens if not overridden.
28
+ */
29
+ lgOffset?: GridSize;
30
+ /**
31
+ * If a number, it sets the number of columns the grid item uses.
32
+ * It can't be greater than the total number of columns of the container (12 by default).
33
+ * If 'auto', the grid item's width matches its content.
34
+ * If false, the prop is ignored.
35
+ * If true, the grid item's width grows to use the space available in the grid container.
36
+ * The value is applied for the `md` breakpoint and wider screens if not overridden.
37
+ * @default false
38
+ */
39
+ md?: boolean | GridSize;
40
+ /**
41
+ * If a number, it sets the margin-left equals to the number of columns the grid item uses.
42
+ * If 'auto', the grid item push itself to the right-end of the container.
43
+ * The value is applied for the `md` breakpoint and wider screens if not overridden.
44
+ */
45
+ mdOffset?: GridSize;
46
+ /**
47
+ * If a number, it sets the number of columns the grid item uses.
48
+ * It can't be greater than the total number of columns of the container (12 by default).
49
+ * If 'auto', the grid item's width matches its content.
50
+ * If false, the prop is ignored.
51
+ * If true, the grid item's width grows to use the space available in the grid container.
52
+ * The value is applied for the `sm` breakpoint and wider screens if not overridden.
53
+ * @default false
54
+ */
55
+ sm?: boolean | GridSize;
56
+ /**
57
+ * If a number, it sets the margin-left equals to the number of columns the grid item uses.
58
+ * If 'auto', the grid item push itself to the right-end of the container.
59
+ * The value is applied for the `sm` breakpoint and wider screens if not overridden.
60
+ */
61
+ smOffset?: GridSize;
62
+ /**
63
+ * If a number, it sets the number of columns the grid item uses.
64
+ * It can't be greater than the total number of columns of the container (12 by default).
65
+ * If 'auto', the grid item's width matches its content.
66
+ * If false, the prop is ignored.
67
+ * If true, the grid item's width grows to use the space available in the grid container.
68
+ * The value is applied for the `xl` breakpoint and wider screens if not overridden.
69
+ * @default false
70
+ */
71
+ xl?: boolean | GridSize;
72
+ /**
73
+ * If a number, it sets the margin-left equals to the number of columns the grid item uses.
74
+ * If 'auto', the grid item push itself to the right-end of the container.
75
+ * The value is applied for the `xl` breakpoint and wider screens if not overridden.
76
+ */
77
+ xlOffset?: GridSize;
78
+ /**
79
+ * If a number, it sets the number of columns the grid item uses.
80
+ * It can't be greater than the total number of columns of the container (12 by default).
81
+ * If 'auto', the grid item's width matches its content.
82
+ * If false, the prop is ignored.
83
+ * If true, the grid item's width grows to use the space available in the grid container.
84
+ * The value is applied for all the screen sizes with the lowest priority.
85
+ * @default false
86
+ */
87
+ xs?: boolean | GridSize;
88
+ /**
89
+ * If a number, it sets the margin-left equals to the number of columns the grid item uses.
90
+ * If 'auto', the grid item push itself to the right-end of the container.
91
+ * The value is applied for the `xs` breakpoint and wider screens if not overridden.
92
+ */
93
+ xsOffset?: GridSize;
94
+ }
95
+ type CustomBreakpoints = Partial<Record<Breakpoint, boolean | GridSize> & Record<`${Breakpoint}Offset`, GridSize>>;
96
+ interface BreakpointOverridesEmpty {
97
+ }
98
+ type Breakpoints = IfEquals<BreakpointOverrides, BreakpointOverridesEmpty, GridDefaultBreakpoints, CustomBreakpoints>;
99
+ export interface GridBaseProps extends Breakpoints {
100
+ /**
101
+ * The content of the component.
102
+ */
103
+ children?: React.ReactNode;
104
+ /**
105
+ * The number of columns.
106
+ * @default 12
107
+ */
108
+ columns?: ResponsiveStyleValue<number>;
109
+ /**
110
+ * Defines the horizontal space between the type `item` components.
111
+ * It overrides the value of the `spacing` prop.
112
+ */
113
+ columnSpacing?: ResponsiveStyleValue<GridSpacing>;
114
+ /**
115
+ * If `true`, the component will have the flex *container* behavior.
116
+ * You should be wrapping *items* with a *container*.
117
+ * @default false
118
+ */
119
+ container?: boolean;
120
+ /**
121
+ * Defines the `flex-direction` style property.
122
+ * It is applied for all screen sizes.
123
+ * @default 'row'
124
+ */
125
+ direction?: ResponsiveStyleValue<GridDirection>;
126
+ /**
127
+ * If `true`, the negative margin and padding are apply only to the top and left sides of the grid.
128
+ */
129
+ disableEqualOverflow?: boolean;
130
+ /**
131
+ * @internal
132
+ * The level of the grid starts from `0`
133
+ * and increases when the grid nests inside another grid regardless of container or item.
134
+ *
135
+ * ```js
136
+ * <Grid> // level 0
137
+ * <Grid> // level 1
138
+ * <Grid> // level 2
139
+ * <Grid> // level 1
140
+ * ```
141
+ *
142
+ * Only consecutive grid is considered nesting.
143
+ * A grid container will start at `0` if there are non-Grid element above it.
144
+ *
145
+ * ```js
146
+ * <Grid> // level 0
147
+ * <div>
148
+ * <Grid> // level 0
149
+ * <Grid> // level 1
150
+ * ```
151
+ */
152
+ unstable_level?: number;
153
+ /**
154
+ * Defines the vertical space between the type `item` components.
155
+ * It overrides the value of the `spacing` prop.
156
+ */
157
+ rowSpacing?: ResponsiveStyleValue<GridSpacing>;
158
+ /**
159
+ * Defines the space between the type `item` components.
160
+ * It can only be used on a type `container` component.
161
+ * @default 0
162
+ */
163
+ spacing?: ResponsiveStyleValue<GridSpacing> | undefined;
164
+ /**
165
+ * Defines the `flex-wrap` style property.
166
+ * It's applied for all screen sizes.
167
+ * @default 'wrap'
168
+ */
169
+ wrap?: GridWrap;
170
+ }
171
+ export interface GridOwnerState extends GridBaseProps {
172
+ unstable_level: number;
173
+ gridSize: Partial<Record<Breakpoint, GridSize | boolean>>;
174
+ gridOffset: Partial<Record<Breakpoint, GridSize>>;
175
+ }
176
+ export interface GridTypeMap<P = {}, D extends React.ElementType = 'div'> {
177
+ props: P & GridBaseProps & {
178
+ sx?: SxProps<Theme>;
179
+ } & SystemProps<Theme>;
180
+ defaultComponent: D;
181
+ }
182
+ export type GridProps<D extends React.ElementType = GridTypeMap['defaultComponent'], P = {
183
+ component?: React.ElementType;
184
+ }> = OverrideProps<GridTypeMap<P, D>, D>;
185
+ export {};
@@ -1,11 +1,11 @@
1
- import * as React from 'react';
2
- import { OverridableComponent } from '@mui/types';
3
- import { GridTypeMap } from './GridProps';
4
- declare const defaultCreateStyledComponent: import("@mui/styled-engine").CreateStyledComponent<import("../createStyled").MUIStyledCommonProps<any>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}, any>;
5
- declare function useThemePropsDefault<T extends {}>(props: T): T & {};
6
- export default function createGrid(options?: {
7
- createStyledComponent?: typeof defaultCreateStyledComponent;
8
- useThemeProps?: typeof useThemePropsDefault;
9
- componentName?: string;
10
- }): OverridableComponent<GridTypeMap<{}, "div">>;
11
- export {};
1
+ import * as React from 'react';
2
+ import { OverridableComponent } from '@mui/types';
3
+ import { GridTypeMap } from './GridProps';
4
+ declare const defaultCreateStyledComponent: import("@mui/styled-engine").CreateStyledComponent<import("../createStyled").MUIStyledCommonProps<any>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}, any>;
5
+ declare function useThemePropsDefault<T extends {}>(props: T): T & {};
6
+ export default function createGrid(options?: {
7
+ createStyledComponent?: typeof defaultCreateStyledComponent;
8
+ useThemeProps?: typeof useThemePropsDefault;
9
+ componentName?: string;
10
+ }): OverridableComponent<GridTypeMap<{}, "div">>;
11
+ export {};