@mui/system 5.10.13 → 5.10.14
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.
- package/Box/Box.js +1 -10
- package/Box/Box.spec.d.ts +1 -1
- package/Box/index.js +0 -2
- package/CHANGELOG.md +70 -2
- package/Container/Container.d.ts +13 -13
- package/Container/Container.js +2 -17
- package/Container/ContainerProps.d.ts +40 -40
- package/Container/containerClasses.d.ts +22 -22
- package/Container/containerClasses.js +0 -3
- package/Container/createContainer.d.ts +18 -18
- package/Container/createContainer.js +15 -37
- package/Container/index.js +0 -6
- package/Stack/Stack.d.ts +13 -13
- package/Stack/Stack.js +1 -12
- package/Stack/StackProps.d.ts +42 -42
- package/Stack/createStack.d.ts +21 -21
- package/Stack/createStack.js +10 -48
- package/Stack/index.d.ts +5 -5
- package/Stack/index.js +0 -9
- package/Stack/stackClasses.d.ts +8 -8
- package/Stack/stackClasses.js +0 -3
- package/ThemeProvider/ThemeProvider.js +2 -22
- package/ThemeProvider/index.js +0 -2
- package/Unstable_Grid/Grid.d.ts +12 -12
- package/Unstable_Grid/Grid.js +6 -42
- package/Unstable_Grid/GridProps.d.ts +162 -162
- package/Unstable_Grid/createGrid.d.ts +11 -11
- package/Unstable_Grid/createGrid.js +19 -49
- package/Unstable_Grid/gridClasses.d.ts +20 -20
- package/Unstable_Grid/gridClasses.js +8 -7
- package/Unstable_Grid/gridGenerator.d.ts +29 -28
- package/Unstable_Grid/gridGenerator.js +22 -63
- package/Unstable_Grid/index.d.ts +5 -5
- package/Unstable_Grid/index.js +0 -9
- package/borders.js +0 -14
- package/breakpoints.js +3 -32
- package/colorManipulator.js +13 -55
- package/compose.js +0 -7
- package/createBox.js +5 -20
- package/createBox.spec.d.ts +1 -1
- package/createStyled.js +27 -71
- package/createTheme/createBreakpoints.js +22 -37
- package/createTheme/createSpacing.d.ts +10 -10
- package/createTheme/createSpacing.js +4 -8
- package/createTheme/createTheme.js +6 -16
- package/createTheme/index.js +0 -2
- package/cssGrid.js +0 -21
- package/cssVars/createCssVarsProvider.js +24 -72
- package/cssVars/createCssVarsProvider.spec.d.ts +1 -1
- package/cssVars/createGetCssVar.d.ts +5 -5
- package/cssVars/createGetCssVar.js +2 -7
- package/cssVars/cssVarsParser.d.ts +65 -65
- package/cssVars/cssVarsParser.js +3 -15
- package/cssVars/getInitColorSchemeScript.d.ts +42 -42
- package/cssVars/getInitColorSchemeScript.js +0 -6
- package/cssVars/index.d.ts +3 -3
- package/cssVars/index.js +0 -3
- package/cssVars/useCurrentColorScheme.d.ts +53 -53
- package/cssVars/useCurrentColorScheme.js +20 -49
- package/display.js +0 -6
- package/esm/Box/Box.js +1 -6
- package/esm/Container/Container.js +3 -14
- package/esm/Container/createContainer.js +15 -25
- package/esm/Stack/Stack.js +1 -9
- package/esm/Stack/createStack.js +10 -29
- package/esm/ThemeProvider/ThemeProvider.js +2 -11
- package/esm/Unstable_Grid/Grid.js +6 -39
- package/esm/Unstable_Grid/createGrid.js +18 -35
- package/esm/Unstable_Grid/gridClasses.js +8 -4
- package/esm/Unstable_Grid/gridGenerator.js +20 -38
- package/esm/borders.js +0 -6
- package/esm/breakpoints.js +7 -22
- package/esm/colorManipulator.js +13 -43
- package/esm/compose.js +0 -5
- package/esm/createBox.js +5 -7
- package/esm/createStyled.js +27 -64
- package/esm/createTheme/createBreakpoints.js +22 -34
- package/esm/createTheme/createSpacing.js +4 -7
- package/esm/createTheme/createTheme.js +6 -9
- package/esm/cssGrid.js +0 -9
- package/esm/cssVars/createCssVarsProvider.js +24 -58
- package/esm/cssVars/createGetCssVar.js +2 -6
- package/esm/cssVars/cssVarsParser.js +3 -11
- package/esm/cssVars/useCurrentColorScheme.js +20 -44
- package/esm/getThemeValue.js +0 -2
- package/esm/index.js +1 -2
- package/esm/memoize.js +0 -1
- package/esm/merge.js +0 -3
- package/esm/palette.js +0 -3
- package/esm/propsToClassKey.js +4 -7
- package/esm/sizing.js +0 -5
- package/esm/spacing.js +3 -23
- package/esm/style.js +2 -19
- package/esm/styleFunctionSx/extendSxProp.js +3 -10
- package/esm/styleFunctionSx/styleFunctionSx.js +3 -16
- package/esm/sx/sx.js +0 -2
- package/esm/useTheme.js +0 -2
- package/esm/useThemeProps/getThemeProps.js +0 -2
- package/esm/useThemeWithoutDefault.js +0 -3
- package/flexbox.js +0 -4
- package/getThemeValue.js +0 -14
- package/index.js +1 -55
- package/index.spec.d.ts +1 -1
- package/legacy/Box/Box.js +1 -6
- package/legacy/Container/Container.js +3 -14
- package/legacy/Container/createContainer.js +29 -39
- package/legacy/Stack/Stack.js +1 -9
- package/legacy/Stack/createStack.js +17 -37
- package/legacy/ThemeProvider/ThemeProvider.js +3 -12
- package/legacy/Unstable_Grid/Grid.js +6 -39
- package/legacy/Unstable_Grid/createGrid.js +34 -53
- package/legacy/Unstable_Grid/gridGenerator.js +36 -58
- package/legacy/borders.js +0 -6
- package/legacy/breakpoints.js +9 -28
- package/legacy/colorManipulator.js +16 -48
- package/legacy/compose.js +0 -6
- package/legacy/createBox.js +9 -11
- package/legacy/createStyled.js +27 -68
- package/legacy/createTheme/createBreakpoints.js +20 -33
- package/legacy/createTheme/createSpacing.js +4 -9
- package/legacy/createTheme/createTheme.js +7 -13
- package/legacy/cssGrid.js +0 -9
- package/legacy/cssVars/createCssVarsProvider.js +90 -129
- package/legacy/cssVars/createGetCssVar.js +2 -10
- package/legacy/cssVars/cssVarsParser.js +7 -20
- package/legacy/cssVars/getInitColorSchemeScript.js +14 -15
- package/legacy/cssVars/useCurrentColorScheme.js +43 -69
- package/legacy/getThemeValue.js +0 -3
- package/legacy/index.js +2 -3
- package/legacy/memoize.js +0 -1
- package/legacy/merge.js +0 -3
- package/legacy/palette.js +0 -3
- package/legacy/propsToClassKey.js +2 -5
- package/legacy/sizing.js +0 -5
- package/legacy/spacing.js +6 -27
- package/legacy/style.js +6 -24
- package/legacy/styleFunctionSx/extendSxProp.js +3 -11
- package/legacy/styleFunctionSx/styleFunctionSx.js +6 -21
- package/legacy/sx/sx.js +0 -2
- package/legacy/useTheme.js +0 -2
- package/legacy/useThemeProps/getThemeProps.js +2 -4
- package/legacy/useThemeProps/useThemeProps.js +2 -2
- package/legacy/useThemeWithoutDefault.js +0 -3
- package/memoize.js +0 -2
- package/merge.js +0 -5
- package/modern/Box/Box.js +1 -6
- package/modern/Container/Container.js +3 -14
- package/modern/Container/createContainer.js +15 -25
- package/modern/Stack/Stack.js +1 -9
- package/modern/Stack/createStack.js +10 -29
- package/modern/ThemeProvider/ThemeProvider.js +2 -11
- package/modern/Unstable_Grid/Grid.js +6 -39
- package/modern/Unstable_Grid/createGrid.js +18 -34
- package/modern/Unstable_Grid/gridClasses.js +8 -4
- package/modern/Unstable_Grid/gridGenerator.js +20 -36
- package/modern/borders.js +0 -6
- package/modern/breakpoints.js +7 -21
- package/modern/colorManipulator.js +13 -43
- package/modern/compose.js +0 -5
- package/modern/createBox.js +5 -7
- package/modern/createStyled.js +27 -63
- package/modern/createTheme/createBreakpoints.js +22 -34
- package/modern/createTheme/createSpacing.js +4 -7
- package/modern/createTheme/createTheme.js +6 -9
- package/modern/cssGrid.js +0 -9
- package/modern/cssVars/createCssVarsProvider.js +24 -58
- package/modern/cssVars/createGetCssVar.js +2 -6
- package/modern/cssVars/cssVarsParser.js +3 -11
- package/modern/cssVars/useCurrentColorScheme.js +20 -44
- package/modern/getThemeValue.js +0 -2
- package/modern/index.js +2 -3
- package/modern/memoize.js +0 -1
- package/modern/merge.js +0 -3
- package/modern/palette.js +0 -3
- package/modern/propsToClassKey.js +4 -7
- package/modern/sizing.js +0 -4
- package/modern/spacing.js +3 -22
- package/modern/style.js +2 -19
- package/modern/styleFunctionSx/extendSxProp.js +3 -10
- package/modern/styleFunctionSx/styleFunctionSx.js +3 -16
- package/modern/sx/sx.js +0 -2
- package/modern/useTheme.js +0 -2
- package/modern/useThemeProps/getThemeProps.js +0 -2
- package/modern/useThemeWithoutDefault.js +0 -3
- package/package.json +6 -6
- package/palette.js +0 -6
- package/positions.js +0 -6
- package/propsToClassKey.js +4 -10
- package/responsivePropType.js +0 -3
- package/shadows.js +0 -3
- package/sizing.js +0 -11
- package/spacing.js +3 -37
- package/style.js +2 -24
- package/styleFunctionSx/extendSxProp.js +3 -15
- package/styleFunctionSx/index.js +0 -5
- package/styleFunctionSx/styleFunctionSx.js +3 -21
- package/styleFunctionSx/styleFunctionSx.spec.d.ts +1 -1
- package/styled.js +0 -3
- package/sx/index.js +0 -2
- package/sx/sx.js +0 -4
- package/typography.js +0 -4
- package/useTheme.js +0 -6
- package/useThemeProps/getThemeProps.js +0 -4
- package/useThemeProps/index.js +0 -3
- package/useThemeProps/useThemeProps.js +0 -4
- package/useThemeWithoutDefault.js +0 -4
package/Unstable_Grid/Grid.js
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _createGrid = _interopRequireDefault(require("./createGrid"));
|
|
13
|
-
|
|
14
10
|
/**
|
|
15
11
|
*
|
|
16
12
|
* Demos:
|
|
@@ -22,56 +18,41 @@ var _createGrid = _interopRequireDefault(require("./createGrid"));
|
|
|
22
18
|
* - [Grid API](https://mui.com/system/api/grid/)
|
|
23
19
|
*/
|
|
24
20
|
const Grid = (0, _createGrid.default)();
|
|
25
|
-
process.env.NODE_ENV !== "production" ? Grid.propTypes
|
|
26
|
-
/* remove-proptypes */
|
|
27
|
-
= {
|
|
21
|
+
process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ = {
|
|
28
22
|
// ----------------------------- Warning --------------------------------
|
|
29
23
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
30
24
|
// | To update them edit TypeScript types and run "yarn proptypes" |
|
|
31
25
|
// ----------------------------------------------------------------------
|
|
32
|
-
|
|
33
26
|
/**
|
|
34
27
|
* The content of the component.
|
|
35
28
|
*/
|
|
36
29
|
children: _propTypes.default.node,
|
|
37
|
-
|
|
38
30
|
/**
|
|
39
31
|
* The number of columns.
|
|
40
32
|
* @default 12
|
|
41
33
|
*/
|
|
42
|
-
columns: _propTypes.default
|
|
43
|
-
/* @typescript-to-proptypes-ignore */
|
|
44
|
-
.oneOfType([_propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.number, _propTypes.default.object]),
|
|
45
|
-
|
|
34
|
+
columns: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.number, _propTypes.default.object]),
|
|
46
35
|
/**
|
|
47
36
|
* Defines the horizontal space between the type `item` components.
|
|
48
37
|
* It overrides the value of the `spacing` prop.
|
|
49
38
|
*/
|
|
50
|
-
columnSpacing: _propTypes.default
|
|
51
|
-
/* @typescript-to-proptypes-ignore */
|
|
52
|
-
.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
|
|
53
|
-
|
|
39
|
+
columnSpacing: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
|
|
54
40
|
/**
|
|
55
41
|
* If `true`, the component will have the flex *container* behavior.
|
|
56
42
|
* You should be wrapping *items* with a *container*.
|
|
57
43
|
* @default false
|
|
58
44
|
*/
|
|
59
45
|
container: _propTypes.default.bool,
|
|
60
|
-
|
|
61
46
|
/**
|
|
62
47
|
* Defines the `flex-direction` style property.
|
|
63
48
|
* It is applied for all screen sizes.
|
|
64
49
|
* @default 'row'
|
|
65
50
|
*/
|
|
66
|
-
direction: _propTypes.default
|
|
67
|
-
/* @typescript-to-proptypes-ignore */
|
|
68
|
-
.oneOfType([_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), _propTypes.default.arrayOf(_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), _propTypes.default.object]),
|
|
69
|
-
|
|
51
|
+
direction: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), _propTypes.default.arrayOf(_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), _propTypes.default.object]),
|
|
70
52
|
/**
|
|
71
53
|
* If `true`, the negative margin and padding are apply only to the top and left sides of the grid.
|
|
72
54
|
*/
|
|
73
55
|
disableEqualOverflow: _propTypes.default.bool,
|
|
74
|
-
|
|
75
56
|
/**
|
|
76
57
|
* If a number, it sets the number of columns the grid item uses.
|
|
77
58
|
* It can't be greater than the total number of columns of the container (12 by default).
|
|
@@ -82,14 +63,12 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes
|
|
|
82
63
|
* @default false
|
|
83
64
|
*/
|
|
84
65
|
lg: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),
|
|
85
|
-
|
|
86
66
|
/**
|
|
87
67
|
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
88
68
|
* If 'auto', the grid item push itself to the right-end of the container.
|
|
89
69
|
* The value is applied for the `lg` breakpoint and wider screens if not overridden.
|
|
90
70
|
*/
|
|
91
71
|
lgOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]),
|
|
92
|
-
|
|
93
72
|
/**
|
|
94
73
|
* If a number, it sets the number of columns the grid item uses.
|
|
95
74
|
* It can't be greater than the total number of columns of the container (12 by default).
|
|
@@ -100,22 +79,17 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes
|
|
|
100
79
|
* @default false
|
|
101
80
|
*/
|
|
102
81
|
md: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),
|
|
103
|
-
|
|
104
82
|
/**
|
|
105
83
|
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
106
84
|
* If 'auto', the grid item push itself to the right-end of the container.
|
|
107
85
|
* The value is applied for the `md` breakpoint and wider screens if not overridden.
|
|
108
86
|
*/
|
|
109
87
|
mdOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]),
|
|
110
|
-
|
|
111
88
|
/**
|
|
112
89
|
* Defines the vertical space between the type `item` components.
|
|
113
90
|
* It overrides the value of the `spacing` prop.
|
|
114
91
|
*/
|
|
115
|
-
rowSpacing: _propTypes.default
|
|
116
|
-
/* @typescript-to-proptypes-ignore */
|
|
117
|
-
.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
|
|
118
|
-
|
|
92
|
+
rowSpacing: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
|
|
119
93
|
/**
|
|
120
94
|
* If a number, it sets the number of columns the grid item uses.
|
|
121
95
|
* It can't be greater than the total number of columns of the container (12 by default).
|
|
@@ -126,35 +100,28 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes
|
|
|
126
100
|
* @default false
|
|
127
101
|
*/
|
|
128
102
|
sm: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),
|
|
129
|
-
|
|
130
103
|
/**
|
|
131
104
|
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
132
105
|
* If 'auto', the grid item push itself to the right-end of the container.
|
|
133
106
|
* The value is applied for the `sm` breakpoint and wider screens if not overridden.
|
|
134
107
|
*/
|
|
135
108
|
smOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]),
|
|
136
|
-
|
|
137
109
|
/**
|
|
138
110
|
* Defines the space between the type `item` components.
|
|
139
111
|
* It can only be used on a type `container` component.
|
|
140
112
|
* @default 0
|
|
141
113
|
*/
|
|
142
|
-
spacing: _propTypes.default
|
|
143
|
-
/* @typescript-to-proptypes-ignore */
|
|
144
|
-
.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
|
|
145
|
-
|
|
114
|
+
spacing: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
|
|
146
115
|
/**
|
|
147
116
|
* @ignore
|
|
148
117
|
*/
|
|
149
118
|
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]),
|
|
150
|
-
|
|
151
119
|
/**
|
|
152
120
|
* Defines the `flex-wrap` style property.
|
|
153
121
|
* It's applied for all screen sizes.
|
|
154
122
|
* @default 'wrap'
|
|
155
123
|
*/
|
|
156
124
|
wrap: _propTypes.default.oneOf(['nowrap', 'wrap-reverse', 'wrap']),
|
|
157
|
-
|
|
158
125
|
/**
|
|
159
126
|
* If a number, it sets the number of columns the grid item uses.
|
|
160
127
|
* It can't be greater than the total number of columns of the container (12 by default).
|
|
@@ -165,14 +132,12 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes
|
|
|
165
132
|
* @default false
|
|
166
133
|
*/
|
|
167
134
|
xl: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),
|
|
168
|
-
|
|
169
135
|
/**
|
|
170
136
|
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
171
137
|
* If 'auto', the grid item push itself to the right-end of the container.
|
|
172
138
|
* The value is applied for the `xl` breakpoint and wider screens if not overridden.
|
|
173
139
|
*/
|
|
174
140
|
xlOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]),
|
|
175
|
-
|
|
176
141
|
/**
|
|
177
142
|
* If a number, it sets the number of columns the grid item uses.
|
|
178
143
|
* It can't be greater than the total number of columns of the container (12 by default).
|
|
@@ -183,7 +148,6 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes
|
|
|
183
148
|
* @default false
|
|
184
149
|
*/
|
|
185
150
|
xs: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),
|
|
186
|
-
|
|
187
151
|
/**
|
|
188
152
|
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
189
153
|
* If 'auto', the grid item push itself to the right-end of the container.
|
|
@@ -1,162 +1,162 @@
|
|
|
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
|
-
declare type ResponsiveStyleValue<T> = T | Array<T | null> | {
|
|
7
|
-
[key in Breakpoint]?: T | null;
|
|
8
|
-
};
|
|
9
|
-
export declare type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
10
|
-
export declare type GridSpacing = number | string;
|
|
11
|
-
export declare type GridWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
12
|
-
export declare 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
|
-
declare type CustomBreakpoints = Partial<Record<Breakpoint, boolean | GridSize> & Record<`${Breakpoint}Offset`, GridSize>>;
|
|
96
|
-
interface BreakpointOverridesEmpty {
|
|
97
|
-
}
|
|
98
|
-
declare 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
|
-
* Defines the vertical space between the type `item` components.
|
|
132
|
-
* It overrides the value of the `spacing` prop.
|
|
133
|
-
*/
|
|
134
|
-
rowSpacing?: ResponsiveStyleValue<GridSpacing>;
|
|
135
|
-
/**
|
|
136
|
-
* Defines the space between the type `item` components.
|
|
137
|
-
* It can only be used on a type `container` component.
|
|
138
|
-
* @default 0
|
|
139
|
-
*/
|
|
140
|
-
spacing?: ResponsiveStyleValue<GridSpacing> | undefined;
|
|
141
|
-
/**
|
|
142
|
-
* Defines the `flex-wrap` style property.
|
|
143
|
-
* It's applied for all screen sizes.
|
|
144
|
-
* @default 'wrap'
|
|
145
|
-
*/
|
|
146
|
-
wrap?: GridWrap;
|
|
147
|
-
}
|
|
148
|
-
export interface GridOwnerState extends GridBaseProps {
|
|
149
|
-
nested: boolean;
|
|
150
|
-
gridSize: Partial<Record<Breakpoint, GridSize | boolean>>;
|
|
151
|
-
gridOffset: Partial<Record<Breakpoint, GridSize>>;
|
|
152
|
-
}
|
|
153
|
-
export interface GridTypeMap<P = {}, D extends React.ElementType = 'div'> {
|
|
154
|
-
props: P & GridBaseProps & {
|
|
155
|
-
sx?: SxProps<Theme>;
|
|
156
|
-
} & SystemProps<Theme>;
|
|
157
|
-
defaultComponent: D;
|
|
158
|
-
}
|
|
159
|
-
export declare type GridProps<D extends React.ElementType = GridTypeMap['defaultComponent'], P = {
|
|
160
|
-
component?: React.ElementType;
|
|
161
|
-
}> = OverrideProps<GridTypeMap<P, D>, D>;
|
|
162
|
-
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
|
+
declare type ResponsiveStyleValue<T> = T | Array<T | null> | {
|
|
7
|
+
[key in Breakpoint]?: T | null;
|
|
8
|
+
};
|
|
9
|
+
export declare type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
10
|
+
export declare type GridSpacing = number | string;
|
|
11
|
+
export declare type GridWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
12
|
+
export declare 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
|
+
declare type CustomBreakpoints = Partial<Record<Breakpoint, boolean | GridSize> & Record<`${Breakpoint}Offset`, GridSize>>;
|
|
96
|
+
interface BreakpointOverridesEmpty {
|
|
97
|
+
}
|
|
98
|
+
declare 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
|
+
* Defines the vertical space between the type `item` components.
|
|
132
|
+
* It overrides the value of the `spacing` prop.
|
|
133
|
+
*/
|
|
134
|
+
rowSpacing?: ResponsiveStyleValue<GridSpacing>;
|
|
135
|
+
/**
|
|
136
|
+
* Defines the space between the type `item` components.
|
|
137
|
+
* It can only be used on a type `container` component.
|
|
138
|
+
* @default 0
|
|
139
|
+
*/
|
|
140
|
+
spacing?: ResponsiveStyleValue<GridSpacing> | undefined;
|
|
141
|
+
/**
|
|
142
|
+
* Defines the `flex-wrap` style property.
|
|
143
|
+
* It's applied for all screen sizes.
|
|
144
|
+
* @default 'wrap'
|
|
145
|
+
*/
|
|
146
|
+
wrap?: GridWrap;
|
|
147
|
+
}
|
|
148
|
+
export interface GridOwnerState extends GridBaseProps {
|
|
149
|
+
nested: boolean;
|
|
150
|
+
gridSize: Partial<Record<Breakpoint, GridSize | boolean>>;
|
|
151
|
+
gridOffset: Partial<Record<Breakpoint, GridSize>>;
|
|
152
|
+
}
|
|
153
|
+
export interface GridTypeMap<P = {}, D extends React.ElementType = 'div'> {
|
|
154
|
+
props: P & GridBaseProps & {
|
|
155
|
+
sx?: SxProps<Theme>;
|
|
156
|
+
} & SystemProps<Theme>;
|
|
157
|
+
defaultComponent: D;
|
|
158
|
+
}
|
|
159
|
+
export declare type GridProps<D extends React.ElementType = GridTypeMap['defaultComponent'], P = {
|
|
160
|
+
component?: React.ElementType;
|
|
161
|
+
}> = OverrideProps<GridTypeMap<P, D>, D>;
|
|
162
|
+
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 {};
|