@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
|
@@ -10,58 +10,42 @@ import createGrid from './createGrid';
|
|
|
10
10
|
*
|
|
11
11
|
* - [Grid API](https://mui.com/system/api/grid/)
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
13
|
const Grid = createGrid();
|
|
15
|
-
process.env.NODE_ENV !== "production" ? Grid.propTypes
|
|
16
|
-
/* remove-proptypes */
|
|
17
|
-
= {
|
|
14
|
+
process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ = {
|
|
18
15
|
// ----------------------------- Warning --------------------------------
|
|
19
16
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
20
17
|
// | To update them edit TypeScript types and run "yarn proptypes" |
|
|
21
18
|
// ----------------------------------------------------------------------
|
|
22
|
-
|
|
23
19
|
/**
|
|
24
20
|
* The content of the component.
|
|
25
21
|
*/
|
|
26
22
|
children: PropTypes.node,
|
|
27
|
-
|
|
28
23
|
/**
|
|
29
24
|
* The number of columns.
|
|
30
25
|
* @default 12
|
|
31
26
|
*/
|
|
32
|
-
columns: PropTypes
|
|
33
|
-
/* @typescript-to-proptypes-ignore */
|
|
34
|
-
.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number, PropTypes.object]),
|
|
35
|
-
|
|
27
|
+
columns: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number, PropTypes.object]),
|
|
36
28
|
/**
|
|
37
29
|
* Defines the horizontal space between the type `item` components.
|
|
38
30
|
* It overrides the value of the `spacing` prop.
|
|
39
31
|
*/
|
|
40
|
-
columnSpacing: PropTypes
|
|
41
|
-
/* @typescript-to-proptypes-ignore */
|
|
42
|
-
.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
|
43
|
-
|
|
32
|
+
columnSpacing: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
|
44
33
|
/**
|
|
45
34
|
* If `true`, the component will have the flex *container* behavior.
|
|
46
35
|
* You should be wrapping *items* with a *container*.
|
|
47
36
|
* @default false
|
|
48
37
|
*/
|
|
49
38
|
container: PropTypes.bool,
|
|
50
|
-
|
|
51
39
|
/**
|
|
52
40
|
* Defines the `flex-direction` style property.
|
|
53
41
|
* It is applied for all screen sizes.
|
|
54
42
|
* @default 'row'
|
|
55
43
|
*/
|
|
56
|
-
direction: PropTypes
|
|
57
|
-
/* @typescript-to-proptypes-ignore */
|
|
58
|
-
.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),
|
|
59
|
-
|
|
44
|
+
direction: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),
|
|
60
45
|
/**
|
|
61
46
|
* If `true`, the negative margin and padding are apply only to the top and left sides of the grid.
|
|
62
47
|
*/
|
|
63
48
|
disableEqualOverflow: PropTypes.bool,
|
|
64
|
-
|
|
65
49
|
/**
|
|
66
50
|
* If a number, it sets the number of columns the grid item uses.
|
|
67
51
|
* It can't be greater than the total number of columns of the container (12 by default).
|
|
@@ -72,14 +56,12 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes
|
|
|
72
56
|
* @default false
|
|
73
57
|
*/
|
|
74
58
|
lg: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]),
|
|
75
|
-
|
|
76
59
|
/**
|
|
77
60
|
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
78
61
|
* If 'auto', the grid item push itself to the right-end of the container.
|
|
79
62
|
* The value is applied for the `lg` breakpoint and wider screens if not overridden.
|
|
80
63
|
*/
|
|
81
64
|
lgOffset: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]),
|
|
82
|
-
|
|
83
65
|
/**
|
|
84
66
|
* If a number, it sets the number of columns the grid item uses.
|
|
85
67
|
* It can't be greater than the total number of columns of the container (12 by default).
|
|
@@ -90,22 +72,17 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes
|
|
|
90
72
|
* @default false
|
|
91
73
|
*/
|
|
92
74
|
md: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]),
|
|
93
|
-
|
|
94
75
|
/**
|
|
95
76
|
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
96
77
|
* If 'auto', the grid item push itself to the right-end of the container.
|
|
97
78
|
* The value is applied for the `md` breakpoint and wider screens if not overridden.
|
|
98
79
|
*/
|
|
99
80
|
mdOffset: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]),
|
|
100
|
-
|
|
101
81
|
/**
|
|
102
82
|
* Defines the vertical space between the type `item` components.
|
|
103
83
|
* It overrides the value of the `spacing` prop.
|
|
104
84
|
*/
|
|
105
|
-
rowSpacing: PropTypes
|
|
106
|
-
/* @typescript-to-proptypes-ignore */
|
|
107
|
-
.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
|
108
|
-
|
|
85
|
+
rowSpacing: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
|
109
86
|
/**
|
|
110
87
|
* If a number, it sets the number of columns the grid item uses.
|
|
111
88
|
* It can't be greater than the total number of columns of the container (12 by default).
|
|
@@ -116,35 +93,28 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes
|
|
|
116
93
|
* @default false
|
|
117
94
|
*/
|
|
118
95
|
sm: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]),
|
|
119
|
-
|
|
120
96
|
/**
|
|
121
97
|
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
122
98
|
* If 'auto', the grid item push itself to the right-end of the container.
|
|
123
99
|
* The value is applied for the `sm` breakpoint and wider screens if not overridden.
|
|
124
100
|
*/
|
|
125
101
|
smOffset: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]),
|
|
126
|
-
|
|
127
102
|
/**
|
|
128
103
|
* Defines the space between the type `item` components.
|
|
129
104
|
* It can only be used on a type `container` component.
|
|
130
105
|
* @default 0
|
|
131
106
|
*/
|
|
132
|
-
spacing: PropTypes
|
|
133
|
-
/* @typescript-to-proptypes-ignore */
|
|
134
|
-
.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
|
135
|
-
|
|
107
|
+
spacing: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
|
136
108
|
/**
|
|
137
109
|
* @ignore
|
|
138
110
|
*/
|
|
139
111
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
140
|
-
|
|
141
112
|
/**
|
|
142
113
|
* Defines the `flex-wrap` style property.
|
|
143
114
|
* It's applied for all screen sizes.
|
|
144
115
|
* @default 'wrap'
|
|
145
116
|
*/
|
|
146
117
|
wrap: PropTypes.oneOf(['nowrap', 'wrap-reverse', 'wrap']),
|
|
147
|
-
|
|
148
118
|
/**
|
|
149
119
|
* If a number, it sets the number of columns the grid item uses.
|
|
150
120
|
* It can't be greater than the total number of columns of the container (12 by default).
|
|
@@ -155,14 +125,12 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes
|
|
|
155
125
|
* @default false
|
|
156
126
|
*/
|
|
157
127
|
xl: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]),
|
|
158
|
-
|
|
159
128
|
/**
|
|
160
129
|
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
161
130
|
* If 'auto', the grid item push itself to the right-end of the container.
|
|
162
131
|
* The value is applied for the `xl` breakpoint and wider screens if not overridden.
|
|
163
132
|
*/
|
|
164
133
|
xlOffset: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]),
|
|
165
|
-
|
|
166
134
|
/**
|
|
167
135
|
* If a number, it sets the number of columns the grid item uses.
|
|
168
136
|
* It can't be greater than the total number of columns of the container (12 by default).
|
|
@@ -173,7 +141,6 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes
|
|
|
173
141
|
* @default false
|
|
174
142
|
*/
|
|
175
143
|
xs: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]),
|
|
176
|
-
|
|
177
144
|
/**
|
|
178
145
|
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
179
146
|
* If 'auto', the grid item push itself to the right-end of the container.
|
|
@@ -12,14 +12,14 @@ import { extendSxProp } from '../styleFunctionSx';
|
|
|
12
12
|
import createTheme from '../createTheme';
|
|
13
13
|
import { generateGridStyles, generateGridSizeStyles, generateGridColumnsStyles, generateGridColumnSpacingStyles, generateGridRowSpacingStyles, generateGridDirectionStyles, generateGridOffsetStyles, generateSizeClassNames, generateSpacingClassNames, generateDirectionClasses } from './gridGenerator';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
const defaultTheme = createTheme();
|
|
15
|
+
const defaultTheme = createTheme();
|
|
16
16
|
|
|
17
|
+
// widening Theme to any so that the consumer can own the theme structure.
|
|
17
18
|
const defaultCreateStyledComponent = systemStyled('div', {
|
|
18
19
|
name: 'MuiGrid',
|
|
19
20
|
slot: 'Root',
|
|
20
21
|
overridesResolver: (props, styles) => styles.root
|
|
21
22
|
});
|
|
22
|
-
|
|
23
23
|
function useThemePropsDefault(props) {
|
|
24
24
|
return useThemePropsSystem({
|
|
25
25
|
props,
|
|
@@ -27,7 +27,6 @@ function useThemePropsDefault(props) {
|
|
|
27
27
|
defaultTheme
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
|
|
31
30
|
export default function createGrid(options = {}) {
|
|
32
31
|
const {
|
|
33
32
|
// This will allow adding custom styled fn (for example for custom sx style function)
|
|
@@ -37,7 +36,6 @@ export default function createGrid(options = {}) {
|
|
|
37
36
|
} = options;
|
|
38
37
|
const NestedContext = /*#__PURE__*/React.createContext(false);
|
|
39
38
|
const OverflowContext = /*#__PURE__*/React.createContext(undefined);
|
|
40
|
-
|
|
41
39
|
const useUtilityClasses = (ownerState, theme) => {
|
|
42
40
|
const {
|
|
43
41
|
container,
|
|
@@ -51,38 +49,32 @@ export default function createGrid(options = {}) {
|
|
|
51
49
|
};
|
|
52
50
|
return composeClasses(slots, slot => generateUtilityClass(componentName, slot), {});
|
|
53
51
|
};
|
|
54
|
-
|
|
55
52
|
const GridRoot = createStyledComponent(generateGridColumnsStyles, generateGridColumnSpacingStyles, generateGridRowSpacingStyles, generateGridSizeStyles, generateGridDirectionStyles, generateGridStyles, generateGridOffsetStyles);
|
|
56
53
|
const Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
|
|
57
54
|
const theme = useTheme();
|
|
58
55
|
const themeProps = useThemeProps(inProps);
|
|
59
56
|
const props = extendSxProp(themeProps); // `color` type conflicts with html color attribute.
|
|
60
|
-
|
|
61
57
|
const nested = React.useContext(NestedContext);
|
|
62
58
|
const overflow = React.useContext(OverflowContext);
|
|
63
|
-
|
|
64
59
|
const {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
60
|
+
className,
|
|
61
|
+
columns: columnsProp = 12,
|
|
62
|
+
container = false,
|
|
63
|
+
component = 'div',
|
|
64
|
+
direction = 'row',
|
|
65
|
+
wrap = 'wrap',
|
|
66
|
+
spacing: spacingProp = 0,
|
|
67
|
+
rowSpacing: rowSpacingProp = spacingProp,
|
|
68
|
+
columnSpacing: columnSpacingProp = spacingProp,
|
|
69
|
+
disableEqualOverflow: themeDisableEqualOverflow
|
|
70
|
+
} = props,
|
|
71
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
72
|
+
// Because `disableEqualOverflow` can be set from the theme's defaultProps, the **nested** grid should look at the instance props instead.
|
|
79
73
|
let disableEqualOverflow = themeDisableEqualOverflow;
|
|
80
|
-
|
|
81
74
|
if (nested && themeDisableEqualOverflow !== undefined) {
|
|
82
75
|
disableEqualOverflow = inProps.disableEqualOverflow;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
}
|
|
77
|
+
// collect breakpoints related props because they can be customized from the theme.
|
|
86
78
|
const gridSize = {};
|
|
87
79
|
const gridOffset = {};
|
|
88
80
|
const other = {};
|
|
@@ -99,7 +91,6 @@ export default function createGrid(options = {}) {
|
|
|
99
91
|
const spacing = inProps.spacing ?? (nested ? undefined : spacingProp);
|
|
100
92
|
const rowSpacing = inProps.rowSpacing ?? inProps.spacing ?? (nested ? undefined : rowSpacingProp);
|
|
101
93
|
const columnSpacing = inProps.columnSpacing ?? inProps.spacing ?? (nested ? undefined : columnSpacingProp);
|
|
102
|
-
|
|
103
94
|
const ownerState = _extends({}, props, {
|
|
104
95
|
nested,
|
|
105
96
|
columns,
|
|
@@ -114,25 +105,21 @@ export default function createGrid(options = {}) {
|
|
|
114
105
|
disableEqualOverflow: disableEqualOverflow ?? overflow ?? false,
|
|
115
106
|
// use context value if exists.
|
|
116
107
|
parentDisableEqualOverflow: overflow // for nested grid
|
|
117
|
-
|
|
118
108
|
});
|
|
119
109
|
|
|
120
110
|
const classes = useUtilityClasses(ownerState, theme);
|
|
121
|
-
|
|
122
111
|
let result = /*#__PURE__*/_jsx(GridRoot, _extends({
|
|
123
112
|
ref: ref,
|
|
124
113
|
as: component,
|
|
125
114
|
ownerState: ownerState,
|
|
126
115
|
className: clsx(classes.root, className)
|
|
127
116
|
}, other));
|
|
128
|
-
|
|
129
117
|
if (!nested) {
|
|
130
118
|
result = /*#__PURE__*/_jsx(NestedContext.Provider, {
|
|
131
119
|
value: true,
|
|
132
120
|
children: result
|
|
133
121
|
});
|
|
134
122
|
}
|
|
135
|
-
|
|
136
123
|
if (disableEqualOverflow !== undefined && disableEqualOverflow !== (overflow ?? false)) {
|
|
137
124
|
// There are 2 possibilities that should wrap with the OverflowContext to communicate with the nested grids:
|
|
138
125
|
// 1. It is the root grid with `disableEqualOverflow`.
|
|
@@ -142,12 +129,9 @@ export default function createGrid(options = {}) {
|
|
|
142
129
|
children: result
|
|
143
130
|
});
|
|
144
131
|
}
|
|
145
|
-
|
|
146
132
|
return result;
|
|
147
133
|
});
|
|
148
|
-
process.env.NODE_ENV !== "production" ? Grid.propTypes
|
|
149
|
-
/* remove-proptypes */
|
|
150
|
-
= {
|
|
134
|
+
process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ = {
|
|
151
135
|
children: PropTypes.node,
|
|
152
136
|
className: PropTypes.string,
|
|
153
137
|
columns: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number, PropTypes.object]),
|
|
@@ -6,9 +6,13 @@ const SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
|
6
6
|
const DIRECTIONS = ['column-reverse', 'column', 'row-reverse', 'row'];
|
|
7
7
|
const WRAPS = ['nowrap', 'wrap-reverse', 'wrap'];
|
|
8
8
|
const GRID_SIZES = ['auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
9
|
-
const gridClasses = generateUtilityClasses('MuiGrid', ['root', 'container', 'item',
|
|
10
|
-
|
|
11
|
-
...
|
|
12
|
-
|
|
9
|
+
const gridClasses = generateUtilityClasses('MuiGrid', ['root', 'container', 'item',
|
|
10
|
+
// spacings
|
|
11
|
+
...SPACINGS.map(spacing => `spacing-xs-${spacing}`),
|
|
12
|
+
// direction values
|
|
13
|
+
...DIRECTIONS.map(direction => `direction-xs-${direction}`),
|
|
14
|
+
// wrap values
|
|
15
|
+
...WRAPS.map(wrap => `wrap-xs-${wrap}`),
|
|
16
|
+
// grid sizes for all breakpoints
|
|
13
17
|
...GRID_SIZES.map(size => `grid-xs-${size}`), ...GRID_SIZES.map(size => `grid-sm-${size}`), ...GRID_SIZES.map(size => `grid-md-${size}`), ...GRID_SIZES.map(size => `grid-lg-${size}`), ...GRID_SIZES.map(size => `grid-xl-${size}`)]);
|
|
14
18
|
export default gridClasses;
|
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
export const
|
|
2
|
+
export const filterBreakpointKeys = (breakpointsKeys, responsiveKeys) => breakpointsKeys.filter(key => responsiveKeys.includes(key));
|
|
3
|
+
export const traverseBreakpoints = (breakpoints, responsive, iterator) => {
|
|
3
4
|
const smallestBreakpoint = breakpoints.keys[0]; // the keys is sorted from smallest to largest by `createBreakpoints`.
|
|
4
5
|
|
|
5
|
-
if (Array.isArray(
|
|
6
|
-
|
|
7
|
-
iterator((
|
|
6
|
+
if (Array.isArray(responsive)) {
|
|
7
|
+
responsive.forEach((breakpointValue, index) => {
|
|
8
|
+
iterator((responsiveStyles, style) => {
|
|
8
9
|
if (index <= breakpoints.keys.length - 1) {
|
|
9
10
|
if (index === 0) {
|
|
10
|
-
Object.assign(
|
|
11
|
+
Object.assign(responsiveStyles, style);
|
|
11
12
|
} else {
|
|
12
|
-
|
|
13
|
+
responsiveStyles[breakpoints.up(breakpoints.keys[index])] = style;
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
}, breakpointValue);
|
|
16
17
|
});
|
|
17
|
-
} else if (
|
|
18
|
+
} else if (responsive && typeof responsive === 'object') {
|
|
18
19
|
// prevent null
|
|
19
|
-
//
|
|
20
|
-
|
|
20
|
+
// responsive could be a very big object, pick the smallest responsive values
|
|
21
|
+
|
|
22
|
+
const keys = Object.keys(responsive).length > breakpoints.keys.length ? breakpoints.keys : filterBreakpointKeys(breakpoints.keys, Object.keys(responsive));
|
|
21
23
|
keys.forEach(key => {
|
|
22
24
|
if (breakpoints.keys.indexOf(key) !== -1) {
|
|
23
|
-
// @ts-ignore already checked that
|
|
24
|
-
const breakpointValue =
|
|
25
|
-
|
|
25
|
+
// @ts-ignore already checked that responsive is an object
|
|
26
|
+
const breakpointValue = responsive[key];
|
|
26
27
|
if (breakpointValue !== undefined) {
|
|
27
|
-
iterator((
|
|
28
|
+
iterator((responsiveStyles, style) => {
|
|
28
29
|
if (smallestBreakpoint === key) {
|
|
29
|
-
Object.assign(
|
|
30
|
+
Object.assign(responsiveStyles, style);
|
|
30
31
|
} else {
|
|
31
|
-
|
|
32
|
+
responsiveStyles[breakpoints.up(key)] = style;
|
|
32
33
|
}
|
|
33
34
|
}, breakpointValue);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
});
|
|
37
|
-
} else if (typeof
|
|
38
|
-
iterator((
|
|
39
|
-
Object.assign(
|
|
40
|
-
},
|
|
38
|
+
} else if (typeof responsive === 'number' || typeof responsive === 'string') {
|
|
39
|
+
iterator((responsiveStyles, style) => {
|
|
40
|
+
Object.assign(responsiveStyles, style);
|
|
41
|
+
}, responsive);
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
export const generateGridSizeStyles = ({
|
|
@@ -47,7 +48,6 @@ export const generateGridSizeStyles = ({
|
|
|
47
48
|
const styles = {};
|
|
48
49
|
traverseBreakpoints(theme.breakpoints, ownerState.gridSize, (appendStyle, value) => {
|
|
49
50
|
let style = {};
|
|
50
|
-
|
|
51
51
|
if (value === true) {
|
|
52
52
|
style = {
|
|
53
53
|
flexBasis: 0,
|
|
@@ -55,7 +55,6 @@ export const generateGridSizeStyles = ({
|
|
|
55
55
|
maxWidth: '100%'
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
|
|
59
58
|
if (value === 'auto') {
|
|
60
59
|
style = {
|
|
61
60
|
flexBasis: 'auto',
|
|
@@ -65,7 +64,6 @@ export const generateGridSizeStyles = ({
|
|
|
65
64
|
width: 'auto'
|
|
66
65
|
};
|
|
67
66
|
}
|
|
68
|
-
|
|
69
67
|
if (typeof value === 'number') {
|
|
70
68
|
style = {
|
|
71
69
|
flexGrow: 0,
|
|
@@ -73,7 +71,6 @@ export const generateGridSizeStyles = ({
|
|
|
73
71
|
width: `calc(100% * ${value} / var(--Grid-columns)${ownerState.nested && ownerState.container ? ` + var(--Grid-columnSpacing)` : ''})`
|
|
74
72
|
};
|
|
75
73
|
}
|
|
76
|
-
|
|
77
74
|
appendStyle(styles, style);
|
|
78
75
|
});
|
|
79
76
|
return styles;
|
|
@@ -85,19 +82,16 @@ export const generateGridOffsetStyles = ({
|
|
|
85
82
|
const styles = {};
|
|
86
83
|
traverseBreakpoints(theme.breakpoints, ownerState.gridOffset, (appendStyle, value) => {
|
|
87
84
|
let style = {};
|
|
88
|
-
|
|
89
85
|
if (value === 'auto') {
|
|
90
86
|
style = {
|
|
91
87
|
marginLeft: 'auto'
|
|
92
88
|
};
|
|
93
89
|
}
|
|
94
|
-
|
|
95
90
|
if (typeof value === 'number') {
|
|
96
91
|
style = {
|
|
97
92
|
marginLeft: value === 0 ? '0px' : `calc(100% * ${value} / var(--Grid-columns))`
|
|
98
93
|
};
|
|
99
94
|
}
|
|
100
|
-
|
|
101
95
|
appendStyle(styles, style);
|
|
102
96
|
});
|
|
103
97
|
return styles;
|
|
@@ -109,7 +103,6 @@ export const generateGridColumnsStyles = ({
|
|
|
109
103
|
if (!ownerState.container) {
|
|
110
104
|
return {};
|
|
111
105
|
}
|
|
112
|
-
|
|
113
106
|
const styles = {
|
|
114
107
|
'--Grid-columns': 12
|
|
115
108
|
};
|
|
@@ -127,7 +120,6 @@ export const generateGridRowSpacingStyles = ({
|
|
|
127
120
|
if (!ownerState.container) {
|
|
128
121
|
return {};
|
|
129
122
|
}
|
|
130
|
-
|
|
131
123
|
const styles = {};
|
|
132
124
|
traverseBreakpoints(theme.breakpoints, ownerState.rowSpacing, (appendStyle, value) => {
|
|
133
125
|
appendStyle(styles, {
|
|
@@ -143,7 +135,6 @@ export const generateGridColumnSpacingStyles = ({
|
|
|
143
135
|
if (!ownerState.container) {
|
|
144
136
|
return {};
|
|
145
137
|
}
|
|
146
|
-
|
|
147
138
|
const styles = {};
|
|
148
139
|
traverseBreakpoints(theme.breakpoints, ownerState.columnSpacing, (appendStyle, value) => {
|
|
149
140
|
appendStyle(styles, {
|
|
@@ -159,7 +150,6 @@ export const generateGridDirectionStyles = ({
|
|
|
159
150
|
if (!ownerState.container) {
|
|
160
151
|
return {};
|
|
161
152
|
}
|
|
162
|
-
|
|
163
153
|
const styles = {};
|
|
164
154
|
traverseBreakpoints(theme.breakpoints, ownerState.direction, (appendStyle, value) => {
|
|
165
155
|
appendStyle(styles, {
|
|
@@ -210,14 +200,11 @@ export const generateSpacingClassNames = (spacing, smallestBreakpoint = 'xs') =>
|
|
|
210
200
|
if (val === undefined) {
|
|
211
201
|
return false;
|
|
212
202
|
}
|
|
213
|
-
|
|
214
203
|
return typeof val === 'string' && !Number.isNaN(Number(val)) || typeof val === 'number' && val > 0;
|
|
215
204
|
}
|
|
216
|
-
|
|
217
205
|
if (isValidSpacing(spacing)) {
|
|
218
206
|
return [`spacing-${smallestBreakpoint}-${String(spacing)}`];
|
|
219
207
|
}
|
|
220
|
-
|
|
221
208
|
if (typeof spacing === 'object' && !Array.isArray(spacing)) {
|
|
222
209
|
const classNames = [];
|
|
223
210
|
Object.entries(spacing).forEach(([key, value]) => {
|
|
@@ -227,17 +214,14 @@ export const generateSpacingClassNames = (spacing, smallestBreakpoint = 'xs') =>
|
|
|
227
214
|
});
|
|
228
215
|
return classNames;
|
|
229
216
|
}
|
|
230
|
-
|
|
231
217
|
return [];
|
|
232
218
|
};
|
|
233
219
|
export const generateDirectionClasses = direction => {
|
|
234
220
|
if (direction === undefined) {
|
|
235
221
|
return [];
|
|
236
222
|
}
|
|
237
|
-
|
|
238
223
|
if (typeof direction === 'object') {
|
|
239
224
|
return Object.entries(direction).map(([key, value]) => `direction-${key}-${value}`);
|
|
240
225
|
}
|
|
241
|
-
|
|
242
226
|
return [`direction-xs-${String(direction)}`];
|
|
243
227
|
};
|
package/modern/borders.js
CHANGED
|
@@ -3,15 +3,12 @@ import style from './style';
|
|
|
3
3
|
import compose from './compose';
|
|
4
4
|
import { createUnaryUnit, getValue } from './spacing';
|
|
5
5
|
import { handleBreakpoints } from './breakpoints';
|
|
6
|
-
|
|
7
6
|
function getBorder(value) {
|
|
8
7
|
if (typeof value !== 'number') {
|
|
9
8
|
return value;
|
|
10
9
|
}
|
|
11
|
-
|
|
12
10
|
return `${value}px solid`;
|
|
13
11
|
}
|
|
14
|
-
|
|
15
12
|
export const border = style({
|
|
16
13
|
prop: 'border',
|
|
17
14
|
themeKey: 'borders',
|
|
@@ -60,14 +57,11 @@ export const borderLeftColor = style({
|
|
|
60
57
|
export const borderRadius = props => {
|
|
61
58
|
if (props.borderRadius !== undefined && props.borderRadius !== null) {
|
|
62
59
|
const transformer = createUnaryUnit(props.theme, 'shape.borderRadius', 4, 'borderRadius');
|
|
63
|
-
|
|
64
60
|
const styleFromPropValue = propValue => ({
|
|
65
61
|
borderRadius: getValue(transformer, propValue)
|
|
66
62
|
});
|
|
67
|
-
|
|
68
63
|
return handleBreakpoints(props, props.borderRadius, styleFromPropValue);
|
|
69
64
|
}
|
|
70
|
-
|
|
71
65
|
return null;
|
|
72
66
|
};
|
|
73
67
|
borderRadius.propTypes = process.env.NODE_ENV !== 'production' ? {
|
package/modern/breakpoints.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { deepmerge } from '@mui/utils';
|
|
4
|
-
import merge from './merge';
|
|
5
|
-
// For instance with the first breakpoint xs: [xs, sm[.
|
|
4
|
+
import merge from './merge';
|
|
6
5
|
|
|
6
|
+
// The breakpoint **start** at this value.
|
|
7
|
+
// For instance with the first breakpoint xs: [xs, sm[.
|
|
7
8
|
export const values = {
|
|
8
9
|
xs: 0,
|
|
9
10
|
// phone
|
|
@@ -14,8 +15,8 @@ export const values = {
|
|
|
14
15
|
lg: 1200,
|
|
15
16
|
// desktop
|
|
16
17
|
xl: 1536 // large screen
|
|
17
|
-
|
|
18
18
|
};
|
|
19
|
+
|
|
19
20
|
const defaultBreakpoints = {
|
|
20
21
|
// Sorted ASC by size. That's important.
|
|
21
22
|
// It can't be configured as it's used statically for propTypes.
|
|
@@ -24,7 +25,6 @@ const defaultBreakpoints = {
|
|
|
24
25
|
};
|
|
25
26
|
export function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
26
27
|
const theme = props.theme || {};
|
|
27
|
-
|
|
28
28
|
if (Array.isArray(propValue)) {
|
|
29
29
|
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
30
30
|
return propValue.reduce((acc, item, index) => {
|
|
@@ -32,7 +32,6 @@ export function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
|
32
32
|
return acc;
|
|
33
33
|
}, {});
|
|
34
34
|
}
|
|
35
|
-
|
|
36
35
|
if (typeof propValue === 'object') {
|
|
37
36
|
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
38
37
|
return Object.keys(propValue).reduce((acc, breakpoint) => {
|
|
@@ -44,15 +43,12 @@ export function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
|
44
43
|
const cssKey = breakpoint;
|
|
45
44
|
acc[cssKey] = propValue[cssKey];
|
|
46
45
|
}
|
|
47
|
-
|
|
48
46
|
return acc;
|
|
49
47
|
}, {});
|
|
50
48
|
}
|
|
51
|
-
|
|
52
49
|
const output = styleFromPropValue(propValue);
|
|
53
50
|
return output;
|
|
54
51
|
}
|
|
55
|
-
|
|
56
52
|
function breakpoints(styleFunction) {
|
|
57
53
|
const newStyleFunction = props => {
|
|
58
54
|
const theme = props.theme || {};
|
|
@@ -65,12 +61,10 @@ function breakpoints(styleFunction) {
|
|
|
65
61
|
theme
|
|
66
62
|
}, props[key]));
|
|
67
63
|
}
|
|
68
|
-
|
|
69
64
|
return acc;
|
|
70
65
|
}, null);
|
|
71
66
|
return merge(base, extended);
|
|
72
67
|
};
|
|
73
|
-
|
|
74
68
|
newStyleFunction.propTypes = process.env.NODE_ENV !== 'production' ? _extends({}, styleFunction.propTypes, {
|
|
75
69
|
xs: PropTypes.object,
|
|
76
70
|
sm: PropTypes.object,
|
|
@@ -81,7 +75,6 @@ function breakpoints(styleFunction) {
|
|
|
81
75
|
newStyleFunction.filterProps = ['xs', 'sm', 'md', 'lg', 'xl', ...styleFunction.filterProps];
|
|
82
76
|
return newStyleFunction;
|
|
83
77
|
}
|
|
84
|
-
|
|
85
78
|
export function createEmptyBreakpointObject(breakpointsInput = {}) {
|
|
86
79
|
const breakpointsInOrder = breakpointsInput.keys?.reduce((acc, key) => {
|
|
87
80
|
const breakpointStyleKey = breakpointsInput.up(key);
|
|
@@ -94,11 +87,9 @@ export function removeUnusedBreakpoints(breakpointKeys, style) {
|
|
|
94
87
|
return breakpointKeys.reduce((acc, key) => {
|
|
95
88
|
const breakpointOutput = acc[key];
|
|
96
89
|
const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;
|
|
97
|
-
|
|
98
90
|
if (isBreakpointUnused) {
|
|
99
91
|
delete acc[key];
|
|
100
92
|
}
|
|
101
|
-
|
|
102
93
|
return acc;
|
|
103
94
|
}, style);
|
|
104
95
|
}
|
|
@@ -106,19 +97,18 @@ export function mergeBreakpointsInOrder(breakpointsInput, ...styles) {
|
|
|
106
97
|
const emptyBreakpoints = createEmptyBreakpointObject(breakpointsInput);
|
|
107
98
|
const mergedOutput = [emptyBreakpoints, ...styles].reduce((prev, next) => deepmerge(prev, next), {});
|
|
108
99
|
return removeUnusedBreakpoints(Object.keys(emptyBreakpoints), mergedOutput);
|
|
109
|
-
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// compute base for responsive values; e.g.,
|
|
110
103
|
// [1,2,3] => {xs: true, sm: true, md: true}
|
|
111
104
|
// {xs: 1, sm: 2, md: 3} => {xs: true, sm: true, md: true}
|
|
112
|
-
|
|
113
105
|
export function computeBreakpointsBase(breakpointValues, themeBreakpoints) {
|
|
114
106
|
// fixed value
|
|
115
107
|
if (typeof breakpointValues !== 'object') {
|
|
116
108
|
return {};
|
|
117
109
|
}
|
|
118
|
-
|
|
119
110
|
const base = {};
|
|
120
111
|
const breakpointsKeys = Object.keys(themeBreakpoints);
|
|
121
|
-
|
|
122
112
|
if (Array.isArray(breakpointValues)) {
|
|
123
113
|
breakpointsKeys.forEach((breakpoint, i) => {
|
|
124
114
|
if (i < breakpointValues.length) {
|
|
@@ -132,7 +122,6 @@ export function computeBreakpointsBase(breakpointValues, themeBreakpoints) {
|
|
|
132
122
|
}
|
|
133
123
|
});
|
|
134
124
|
}
|
|
135
|
-
|
|
136
125
|
return base;
|
|
137
126
|
}
|
|
138
127
|
export function resolveBreakpointValues({
|
|
@@ -142,11 +131,9 @@ export function resolveBreakpointValues({
|
|
|
142
131
|
}) {
|
|
143
132
|
const base = customBase || computeBreakpointsBase(breakpointValues, themeBreakpoints);
|
|
144
133
|
const keys = Object.keys(base);
|
|
145
|
-
|
|
146
134
|
if (keys.length === 0) {
|
|
147
135
|
return breakpointValues;
|
|
148
136
|
}
|
|
149
|
-
|
|
150
137
|
let previous;
|
|
151
138
|
return keys.reduce((acc, breakpoint, i) => {
|
|
152
139
|
if (Array.isArray(breakpointValues)) {
|
|
@@ -158,7 +145,6 @@ export function resolveBreakpointValues({
|
|
|
158
145
|
} else {
|
|
159
146
|
acc[breakpoint] = breakpointValues;
|
|
160
147
|
}
|
|
161
|
-
|
|
162
148
|
return acc;
|
|
163
149
|
}, {});
|
|
164
150
|
}
|