@mui/system 6.1.1 → 6.1.3
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 +17 -11
- package/Box/boxClasses.js +10 -3
- package/Box/index.js +35 -3
- package/Box/package.json +2 -2
- package/CHANGELOG.md +136 -0
- package/Container/Container.js +17 -12
- package/Container/ContainerProps.js +5 -1
- package/Container/containerClasses.js +14 -6
- package/Container/createContainer.js +36 -28
- package/Container/index.js +35 -3
- package/Container/package.json +2 -2
- package/DefaultPropsProvider/DefaultPropsProvider.js +19 -11
- package/DefaultPropsProvider/index.js +19 -1
- package/DefaultPropsProvider/package.json +2 -2
- package/GlobalStyles/GlobalStyles.js +18 -11
- package/GlobalStyles/index.js +25 -2
- package/GlobalStyles/package.json +2 -2
- package/Grid/Grid.js +38 -27
- package/Grid/GridProps.d.ts +16 -11
- package/Grid/GridProps.js +5 -1
- package/Grid/createGrid.js +46 -38
- package/Grid/gridClasses.js +14 -6
- package/Grid/gridGenerator.d.ts +3 -7
- package/Grid/gridGenerator.js +62 -69
- package/Grid/index.js +63 -6
- package/Grid/package.json +2 -2
- package/Grid/traverseBreakpoints.js +11 -3
- package/InitColorSchemeScript/InitColorSchemeScript.js +16 -7
- package/InitColorSchemeScript/index.js +13 -1
- package/InitColorSchemeScript/package.json +2 -2
- package/RtlProvider/index.js +17 -8
- package/RtlProvider/package.json +2 -2
- package/Stack/Stack.js +17 -11
- package/Stack/StackProps.js +5 -1
- package/Stack/createStack.js +46 -36
- package/Stack/index.js +55 -5
- package/Stack/package.json +2 -2
- package/Stack/stackClasses.js +14 -6
- package/ThemeProvider/ThemeProvider.js +27 -20
- package/ThemeProvider/index.js +13 -1
- package/ThemeProvider/package.json +2 -2
- package/borders/borders.js +36 -26
- package/borders/index.js +25 -2
- package/borders/package.json +2 -2
- package/breakpoints/breakpoints.js +34 -21
- package/breakpoints/index.js +25 -2
- package/breakpoints/package.json +2 -2
- package/colorManipulator/colorManipulator.js +50 -25
- package/colorManipulator/index.js +16 -1
- package/colorManipulator/package.json +2 -2
- package/compose/compose.js +10 -3
- package/compose/index.js +13 -1
- package/compose/package.json +2 -2
- package/createBox/createBox.js +20 -13
- package/createBox/index.js +13 -1
- package/createBox/package.json +2 -2
- package/createBreakpoints/createBreakpoints.js +9 -2
- package/createBreakpoints/index.js +13 -3
- package/createBreakpoints/package.json +2 -2
- package/createStyled/createStyled.js +161 -117
- package/createStyled/index.js +25 -2
- package/createStyled/package.json +2 -2
- package/createTheme/applyStyles.js +7 -1
- package/createTheme/createSpacing.js +8 -3
- package/createTheme/createTheme.d.ts +16 -10
- package/createTheme/createTheme.js +25 -18
- package/createTheme/index.js +27 -3
- package/createTheme/package.json +2 -2
- package/createTheme/shape.js +7 -1
- package/cssContainerQueries/cssContainerQueries.js +16 -7
- package/cssContainerQueries/index.js +31 -2
- package/cssContainerQueries/package.json +2 -2
- package/cssGrid/cssGrid.js +40 -31
- package/cssGrid/index.js +25 -2
- package/cssGrid/package.json +2 -2
- package/cssVars/createCssVarsProvider.d.ts +7 -1
- package/cssVars/createCssVarsProvider.js +46 -31
- package/cssVars/createCssVarsTheme.js +14 -7
- package/cssVars/createGetCssVar.js +7 -1
- package/cssVars/cssVarsParser.js +13 -3
- package/cssVars/getColorSchemeSelector.js +7 -1
- package/cssVars/index.js +41 -5
- package/cssVars/package.json +2 -2
- package/cssVars/prepareCssVars.js +16 -9
- package/cssVars/prepareTypographyVars.js +7 -1
- package/cssVars/useCurrentColorScheme.js +19 -11
- package/display/display.js +16 -9
- package/display/index.js +25 -2
- package/display/package.json +2 -2
- package/esm/Box/Box.js +30 -0
- package/esm/Box/boxClasses.js +3 -0
- package/esm/Box/index.js +3 -0
- package/{node → esm}/Container/Container.js +12 -17
- package/esm/Container/ContainerProps.js +1 -0
- package/esm/Container/containerClasses.js +7 -0
- package/{node → esm}/Container/createContainer.js +28 -36
- package/esm/Container/index.js +3 -0
- package/{node → esm}/DefaultPropsProvider/DefaultPropsProvider.js +11 -19
- package/esm/DefaultPropsProvider/index.js +1 -0
- package/esm/GlobalStyles/GlobalStyles.js +37 -0
- package/esm/GlobalStyles/index.js +2 -0
- package/esm/Grid/Grid.js +106 -0
- package/esm/Grid/GridProps.js +1 -0
- package/esm/Grid/createGrid.js +148 -0
- package/{node → esm}/Grid/gridClasses.js +6 -14
- package/esm/Grid/gridGenerator.js +193 -0
- package/esm/Grid/index.js +6 -0
- package/{node → esm}/Grid/traverseBreakpoints.js +3 -11
- package/{node → esm}/InitColorSchemeScript/InitColorSchemeScript.js +7 -16
- package/esm/InitColorSchemeScript/index.js +1 -0
- package/esm/RtlProvider/index.js +22 -0
- package/{node → esm}/Stack/Stack.js +11 -17
- package/esm/Stack/StackProps.js +1 -0
- package/{node → esm}/Stack/createStack.js +36 -46
- package/esm/Stack/index.js +5 -0
- package/esm/Stack/stackClasses.js +7 -0
- package/{node → esm}/ThemeProvider/ThemeProvider.js +20 -27
- package/esm/ThemeProvider/index.js +1 -0
- package/esm/borders/borders.js +49 -0
- package/esm/borders/index.js +2 -0
- package/{node → esm}/breakpoints/breakpoints.js +21 -34
- package/esm/breakpoints/index.js +2 -0
- package/{node → esm}/colorManipulator/colorManipulator.js +23 -51
- package/esm/colorManipulator/index.js +1 -0
- package/{node → esm}/compose/compose.js +3 -10
- package/esm/compose/index.js +1 -0
- package/esm/createBox/createBox.js +35 -0
- package/esm/createBox/index.js +1 -0
- package/{node → esm}/createBreakpoints/createBreakpoints.js +2 -9
- package/esm/createBreakpoints/index.js +3 -0
- package/esm/createStyled/createStyled.js +276 -0
- package/esm/createStyled/index.js +2 -0
- package/{node → esm}/createTheme/applyStyles.js +1 -7
- package/{node → esm}/createTheme/createSpacing.js +3 -8
- package/esm/createTheme/createTheme.js +49 -0
- package/esm/createTheme/index.js +3 -0
- package/esm/createTheme/shape.js +4 -0
- package/{node → esm}/cssContainerQueries/cssContainerQueries.js +6 -17
- package/esm/cssContainerQueries/index.js +2 -0
- package/esm/cssGrid/cssGrid.js +85 -0
- package/esm/cssGrid/index.js +2 -0
- package/{node → esm}/cssVars/createCssVarsProvider.js +37 -40
- package/esm/cssVars/createCssVarsTheme.js +21 -0
- package/{node → esm}/cssVars/createGetCssVar.js +1 -7
- package/{node → esm}/cssVars/cssVarsParser.js +3 -13
- package/{node → esm}/cssVars/getColorSchemeSelector.js +1 -7
- package/esm/cssVars/index.js +5 -0
- package/{node → esm}/cssVars/prepareCssVars.js +9 -16
- package/{node → esm}/cssVars/prepareTypographyVars.js +1 -7
- package/{node → esm}/cssVars/useCurrentColorScheme.js +11 -19
- package/esm/display/display.js +27 -0
- package/esm/display/index.js +2 -0
- package/esm/flexbox/flexbox.js +43 -0
- package/esm/flexbox/index.js +2 -0
- package/esm/getThemeValue/getThemeValue.js +51 -0
- package/esm/getThemeValue/index.js +2 -0
- package/esm/index.js +68 -0
- package/esm/memoTheme.js +28 -0
- package/esm/memoize/index.js +1 -0
- package/{node → esm}/memoize/memoize.js +1 -7
- package/esm/merge/index.js +1 -0
- package/esm/merge/merge.js +10 -0
- package/esm/palette/index.js +2 -0
- package/esm/palette/palette.js +26 -0
- package/esm/positions/index.js +2 -0
- package/esm/positions/positions.js +22 -0
- package/esm/preprocessStyles.js +25 -0
- package/esm/propsToClassKey/index.js +1 -0
- package/esm/propsToClassKey/propsToClassKey.js +25 -0
- package/esm/responsivePropType/index.js +1 -0
- package/esm/responsivePropType/responsivePropType.js +3 -0
- package/esm/shadows/index.js +1 -0
- package/esm/shadows/shadows.js +6 -0
- package/esm/sizing/index.js +2 -0
- package/esm/sizing/sizing.js +64 -0
- package/esm/spacing/index.js +2 -0
- package/{node → esm}/spacing/spacing.js +21 -36
- package/esm/style/index.js +2 -0
- package/{node → esm}/style/style.js +9 -18
- package/{node → esm}/styleFunctionSx/defaultSxConfig.js +65 -71
- package/{node → esm}/styleFunctionSx/extendSxProp.js +5 -12
- package/esm/styleFunctionSx/index.js +4 -0
- package/{node → esm}/styleFunctionSx/styleFunctionSx.js +19 -27
- package/esm/styled/index.js +1 -0
- package/esm/styled/styled.js +3 -0
- package/esm/typography/index.js +2 -0
- package/esm/typography/typography.js +37 -0
- package/esm/useMediaQuery/index.js +2 -0
- package/{node → esm}/useMediaQuery/useMediaQuery.js +8 -15
- package/esm/useTheme/index.js +2 -0
- package/esm/useTheme/useTheme.js +9 -0
- package/esm/useThemeProps/getThemeProps.js +12 -0
- package/esm/useThemeProps/index.js +2 -0
- package/esm/useThemeProps/useThemeProps.js +20 -0
- package/esm/useThemeWithoutDefault/index.js +1 -0
- package/esm/useThemeWithoutDefault/useThemeWithoutDefault.js +12 -0
- package/esm/version/index.js +6 -0
- package/flexbox/flexbox.js +24 -17
- package/flexbox/index.js +25 -2
- package/flexbox/package.json +2 -2
- package/getThemeValue/getThemeValue.js +40 -33
- package/getThemeValue/index.js +25 -2
- package/getThemeValue/package.json +2 -2
- package/index.d.ts +2 -0
- package/index.js +606 -63
- package/memoTheme.d.ts +12 -0
- package/memoTheme.js +34 -0
- package/memoize/index.js +13 -1
- package/memoize/memoize.js +7 -1
- package/memoize/package.json +2 -2
- package/merge/index.js +13 -1
- package/merge/merge.js +10 -3
- package/merge/package.json +2 -2
- package/modern/Grid/Grid.js +16 -11
- package/modern/Grid/createGrid.js +1 -1
- package/modern/Grid/gridGenerator.js +28 -51
- package/modern/colorManipulator/colorManipulator.js +3 -4
- package/modern/createStyled/createStyled.js +144 -109
- package/modern/cssContainerQueries/cssContainerQueries.js +1 -2
- package/modern/cssVars/createCssVarsProvider.js +8 -2
- package/modern/cssVars/useCurrentColorScheme.js +4 -4
- package/modern/index.js +3 -2
- package/modern/memoTheme.js +28 -0
- package/modern/preprocessStyles.js +25 -0
- package/modern/version/index.js +2 -2
- package/package.json +7 -7
- package/palette/index.js +25 -2
- package/palette/package.json +2 -2
- package/palette/palette.js +16 -8
- package/positions/index.js +25 -2
- package/positions/package.json +2 -2
- package/positions/positions.js +16 -9
- package/preprocessStyles.d.ts +5 -0
- package/preprocessStyles.js +31 -0
- package/propsToClassKey/index.js +13 -1
- package/propsToClassKey/package.json +2 -2
- package/propsToClassKey/propsToClassKey.js +11 -4
- package/responsivePropType/index.js +13 -1
- package/responsivePropType/package.json +2 -2
- package/responsivePropType/responsivePropType.js +10 -3
- package/shadows/index.js +13 -1
- package/shadows/package.json +2 -2
- package/shadows/shadows.js +10 -3
- package/sizing/index.js +25 -2
- package/sizing/package.json +2 -2
- package/sizing/sizing.js +27 -17
- package/spacing/index.js +25 -2
- package/spacing/package.json +2 -2
- package/spacing/spacing.js +36 -21
- package/style/index.js +25 -2
- package/style/package.json +2 -2
- package/style/style.js +18 -9
- package/styleFunctionSx/defaultSxConfig.js +71 -65
- package/styleFunctionSx/extendSxProp.js +12 -5
- package/styleFunctionSx/index.js +34 -4
- package/styleFunctionSx/package.json +2 -2
- package/styleFunctionSx/styleFunctionSx.d.ts +1 -1
- package/styleFunctionSx/styleFunctionSx.js +27 -19
- package/styled/index.js +13 -1
- package/styled/package.json +2 -2
- package/styled/styled.js +10 -3
- package/typography/index.js +25 -2
- package/typography/package.json +2 -2
- package/typography/typography.js +20 -13
- package/useMediaQuery/index.js +25 -2
- package/useMediaQuery/package.json +2 -2
- package/useMediaQuery/useMediaQuery.js +15 -8
- package/useTheme/index.js +25 -2
- package/useTheme/package.json +2 -2
- package/useTheme/useTheme.js +11 -5
- package/useThemeProps/getThemeProps.js +10 -3
- package/useThemeProps/index.js +20 -2
- package/useThemeProps/package.json +2 -2
- package/useThemeProps/useThemeProps.js +11 -5
- package/useThemeWithoutDefault/index.js +13 -1
- package/useThemeWithoutDefault/package.json +2 -2
- package/useThemeWithoutDefault/useThemeWithoutDefault.js +10 -4
- package/version/index.js +12 -6
- package/version/package.json +2 -2
- package/node/Box/Box.js +0 -36
- package/node/Box/boxClasses.js +0 -10
- package/node/Box/index.js +0 -35
- package/node/Container/ContainerProps.js +0 -5
- package/node/Container/containerClasses.js +0 -15
- package/node/Container/index.js +0 -35
- package/node/DefaultPropsProvider/index.js +0 -19
- package/node/GlobalStyles/GlobalStyles.js +0 -44
- package/node/GlobalStyles/index.js +0 -25
- package/node/Grid/Grid.js +0 -107
- package/node/Grid/GridProps.js +0 -5
- package/node/Grid/createGrid.js +0 -156
- package/node/Grid/gridGenerator.js +0 -232
- package/node/Grid/index.js +0 -63
- package/node/InitColorSchemeScript/index.js +0 -13
- package/node/RtlProvider/index.js +0 -31
- package/node/Stack/StackProps.js +0 -5
- package/node/Stack/index.js +0 -55
- package/node/Stack/stackClasses.js +0 -15
- package/node/ThemeProvider/index.js +0 -13
- package/node/borders/borders.js +0 -59
- package/node/borders/index.js +0 -25
- package/node/breakpoints/index.js +0 -25
- package/node/colorManipulator/index.js +0 -16
- package/node/compose/index.js +0 -13
- package/node/createBox/createBox.js +0 -42
- package/node/createBox/index.js +0 -13
- package/node/createBreakpoints/index.js +0 -13
- package/node/createStyled/createStyled.js +0 -252
- package/node/createStyled/index.js +0 -25
- package/node/createTheme/createTheme.js +0 -56
- package/node/createTheme/index.js +0 -27
- package/node/createTheme/shape.js +0 -10
- package/node/cssContainerQueries/index.js +0 -31
- package/node/cssGrid/cssGrid.js +0 -94
- package/node/cssGrid/index.js +0 -25
- package/node/cssVars/createCssVarsTheme.js +0 -28
- package/node/cssVars/index.js +0 -41
- package/node/display/display.js +0 -34
- package/node/display/index.js +0 -25
- package/node/flexbox/flexbox.js +0 -50
- package/node/flexbox/index.js +0 -25
- package/node/getThemeValue/getThemeValue.js +0 -58
- package/node/getThemeValue/index.js +0 -25
- package/node/index.js +0 -609
- package/node/memoize/index.js +0 -13
- package/node/merge/index.js +0 -13
- package/node/merge/merge.js +0 -17
- package/node/palette/index.js +0 -25
- package/node/palette/palette.js +0 -34
- package/node/positions/index.js +0 -25
- package/node/positions/positions.js +0 -29
- package/node/propsToClassKey/index.js +0 -13
- package/node/propsToClassKey/propsToClassKey.js +0 -32
- package/node/responsivePropType/index.js +0 -13
- package/node/responsivePropType/responsivePropType.js +0 -10
- package/node/shadows/index.js +0 -13
- package/node/shadows/shadows.js +0 -13
- package/node/sizing/index.js +0 -25
- package/node/sizing/sizing.js +0 -74
- package/node/spacing/index.js +0 -25
- package/node/style/index.js +0 -25
- package/node/styleFunctionSx/index.js +0 -34
- package/node/styled/index.js +0 -13
- package/node/styled/styled.js +0 -10
- package/node/typography/index.js +0 -25
- package/node/typography/typography.js +0 -44
- package/node/useMediaQuery/index.js +0 -25
- package/node/useTheme/index.js +0 -25
- package/node/useTheme/useTheme.js +0 -15
- package/node/useThemeProps/getThemeProps.js +0 -19
- package/node/useThemeProps/index.js +0 -20
- package/node/useThemeProps/useThemeProps.js +0 -26
- package/node/useThemeWithoutDefault/index.js +0 -13
- package/node/useThemeWithoutDefault/useThemeWithoutDefault.js +0 -18
- package/node/version/index.js +0 -12
|
@@ -1,35 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _spacing = require("../spacing");
|
|
8
|
-
var _borders = require("../borders");
|
|
9
|
-
var _cssGrid = require("../cssGrid");
|
|
10
|
-
var _palette = require("../palette");
|
|
11
|
-
var _sizing = require("../sizing");
|
|
1
|
+
import { padding, margin } from "../spacing/index.js";
|
|
2
|
+
import { borderRadius, borderTransform } from "../borders/index.js";
|
|
3
|
+
import { gap, rowGap, columnGap } from "../cssGrid/index.js";
|
|
4
|
+
import { paletteTransform } from "../palette/index.js";
|
|
5
|
+
import { maxWidth, sizingTransform } from "../sizing/index.js";
|
|
12
6
|
const defaultSxConfig = {
|
|
13
7
|
// borders
|
|
14
8
|
border: {
|
|
15
9
|
themeKey: 'borders',
|
|
16
|
-
transform:
|
|
10
|
+
transform: borderTransform
|
|
17
11
|
},
|
|
18
12
|
borderTop: {
|
|
19
13
|
themeKey: 'borders',
|
|
20
|
-
transform:
|
|
14
|
+
transform: borderTransform
|
|
21
15
|
},
|
|
22
16
|
borderRight: {
|
|
23
17
|
themeKey: 'borders',
|
|
24
|
-
transform:
|
|
18
|
+
transform: borderTransform
|
|
25
19
|
},
|
|
26
20
|
borderBottom: {
|
|
27
21
|
themeKey: 'borders',
|
|
28
|
-
transform:
|
|
22
|
+
transform: borderTransform
|
|
29
23
|
},
|
|
30
24
|
borderLeft: {
|
|
31
25
|
themeKey: 'borders',
|
|
32
|
-
transform:
|
|
26
|
+
transform: borderTransform
|
|
33
27
|
},
|
|
34
28
|
borderColor: {
|
|
35
29
|
themeKey: 'palette'
|
|
@@ -48,149 +42,149 @@ const defaultSxConfig = {
|
|
|
48
42
|
},
|
|
49
43
|
outline: {
|
|
50
44
|
themeKey: 'borders',
|
|
51
|
-
transform:
|
|
45
|
+
transform: borderTransform
|
|
52
46
|
},
|
|
53
47
|
outlineColor: {
|
|
54
48
|
themeKey: 'palette'
|
|
55
49
|
},
|
|
56
50
|
borderRadius: {
|
|
57
51
|
themeKey: 'shape.borderRadius',
|
|
58
|
-
style:
|
|
52
|
+
style: borderRadius
|
|
59
53
|
},
|
|
60
54
|
// palette
|
|
61
55
|
color: {
|
|
62
56
|
themeKey: 'palette',
|
|
63
|
-
transform:
|
|
57
|
+
transform: paletteTransform
|
|
64
58
|
},
|
|
65
59
|
bgcolor: {
|
|
66
60
|
themeKey: 'palette',
|
|
67
61
|
cssProperty: 'backgroundColor',
|
|
68
|
-
transform:
|
|
62
|
+
transform: paletteTransform
|
|
69
63
|
},
|
|
70
64
|
backgroundColor: {
|
|
71
65
|
themeKey: 'palette',
|
|
72
|
-
transform:
|
|
66
|
+
transform: paletteTransform
|
|
73
67
|
},
|
|
74
68
|
// spacing
|
|
75
69
|
p: {
|
|
76
|
-
style:
|
|
70
|
+
style: padding
|
|
77
71
|
},
|
|
78
72
|
pt: {
|
|
79
|
-
style:
|
|
73
|
+
style: padding
|
|
80
74
|
},
|
|
81
75
|
pr: {
|
|
82
|
-
style:
|
|
76
|
+
style: padding
|
|
83
77
|
},
|
|
84
78
|
pb: {
|
|
85
|
-
style:
|
|
79
|
+
style: padding
|
|
86
80
|
},
|
|
87
81
|
pl: {
|
|
88
|
-
style:
|
|
82
|
+
style: padding
|
|
89
83
|
},
|
|
90
84
|
px: {
|
|
91
|
-
style:
|
|
85
|
+
style: padding
|
|
92
86
|
},
|
|
93
87
|
py: {
|
|
94
|
-
style:
|
|
88
|
+
style: padding
|
|
95
89
|
},
|
|
96
90
|
padding: {
|
|
97
|
-
style:
|
|
91
|
+
style: padding
|
|
98
92
|
},
|
|
99
93
|
paddingTop: {
|
|
100
|
-
style:
|
|
94
|
+
style: padding
|
|
101
95
|
},
|
|
102
96
|
paddingRight: {
|
|
103
|
-
style:
|
|
97
|
+
style: padding
|
|
104
98
|
},
|
|
105
99
|
paddingBottom: {
|
|
106
|
-
style:
|
|
100
|
+
style: padding
|
|
107
101
|
},
|
|
108
102
|
paddingLeft: {
|
|
109
|
-
style:
|
|
103
|
+
style: padding
|
|
110
104
|
},
|
|
111
105
|
paddingX: {
|
|
112
|
-
style:
|
|
106
|
+
style: padding
|
|
113
107
|
},
|
|
114
108
|
paddingY: {
|
|
115
|
-
style:
|
|
109
|
+
style: padding
|
|
116
110
|
},
|
|
117
111
|
paddingInline: {
|
|
118
|
-
style:
|
|
112
|
+
style: padding
|
|
119
113
|
},
|
|
120
114
|
paddingInlineStart: {
|
|
121
|
-
style:
|
|
115
|
+
style: padding
|
|
122
116
|
},
|
|
123
117
|
paddingInlineEnd: {
|
|
124
|
-
style:
|
|
118
|
+
style: padding
|
|
125
119
|
},
|
|
126
120
|
paddingBlock: {
|
|
127
|
-
style:
|
|
121
|
+
style: padding
|
|
128
122
|
},
|
|
129
123
|
paddingBlockStart: {
|
|
130
|
-
style:
|
|
124
|
+
style: padding
|
|
131
125
|
},
|
|
132
126
|
paddingBlockEnd: {
|
|
133
|
-
style:
|
|
127
|
+
style: padding
|
|
134
128
|
},
|
|
135
129
|
m: {
|
|
136
|
-
style:
|
|
130
|
+
style: margin
|
|
137
131
|
},
|
|
138
132
|
mt: {
|
|
139
|
-
style:
|
|
133
|
+
style: margin
|
|
140
134
|
},
|
|
141
135
|
mr: {
|
|
142
|
-
style:
|
|
136
|
+
style: margin
|
|
143
137
|
},
|
|
144
138
|
mb: {
|
|
145
|
-
style:
|
|
139
|
+
style: margin
|
|
146
140
|
},
|
|
147
141
|
ml: {
|
|
148
|
-
style:
|
|
142
|
+
style: margin
|
|
149
143
|
},
|
|
150
144
|
mx: {
|
|
151
|
-
style:
|
|
145
|
+
style: margin
|
|
152
146
|
},
|
|
153
147
|
my: {
|
|
154
|
-
style:
|
|
148
|
+
style: margin
|
|
155
149
|
},
|
|
156
150
|
margin: {
|
|
157
|
-
style:
|
|
151
|
+
style: margin
|
|
158
152
|
},
|
|
159
153
|
marginTop: {
|
|
160
|
-
style:
|
|
154
|
+
style: margin
|
|
161
155
|
},
|
|
162
156
|
marginRight: {
|
|
163
|
-
style:
|
|
157
|
+
style: margin
|
|
164
158
|
},
|
|
165
159
|
marginBottom: {
|
|
166
|
-
style:
|
|
160
|
+
style: margin
|
|
167
161
|
},
|
|
168
162
|
marginLeft: {
|
|
169
|
-
style:
|
|
163
|
+
style: margin
|
|
170
164
|
},
|
|
171
165
|
marginX: {
|
|
172
|
-
style:
|
|
166
|
+
style: margin
|
|
173
167
|
},
|
|
174
168
|
marginY: {
|
|
175
|
-
style:
|
|
169
|
+
style: margin
|
|
176
170
|
},
|
|
177
171
|
marginInline: {
|
|
178
|
-
style:
|
|
172
|
+
style: margin
|
|
179
173
|
},
|
|
180
174
|
marginInlineStart: {
|
|
181
|
-
style:
|
|
175
|
+
style: margin
|
|
182
176
|
},
|
|
183
177
|
marginInlineEnd: {
|
|
184
|
-
style:
|
|
178
|
+
style: margin
|
|
185
179
|
},
|
|
186
180
|
marginBlock: {
|
|
187
|
-
style:
|
|
181
|
+
style: margin
|
|
188
182
|
},
|
|
189
183
|
marginBlockStart: {
|
|
190
|
-
style:
|
|
184
|
+
style: margin
|
|
191
185
|
},
|
|
192
186
|
marginBlockEnd: {
|
|
193
|
-
style:
|
|
187
|
+
style: margin
|
|
194
188
|
},
|
|
195
189
|
// display
|
|
196
190
|
displayPrint: {
|
|
@@ -222,13 +216,13 @@ const defaultSxConfig = {
|
|
|
222
216
|
justifySelf: {},
|
|
223
217
|
// grid
|
|
224
218
|
gap: {
|
|
225
|
-
style:
|
|
219
|
+
style: gap
|
|
226
220
|
},
|
|
227
221
|
rowGap: {
|
|
228
|
-
style:
|
|
222
|
+
style: rowGap
|
|
229
223
|
},
|
|
230
224
|
columnGap: {
|
|
231
|
-
style:
|
|
225
|
+
style: columnGap
|
|
232
226
|
},
|
|
233
227
|
gridColumn: {},
|
|
234
228
|
gridRow: {},
|
|
@@ -254,22 +248,22 @@ const defaultSxConfig = {
|
|
|
254
248
|
},
|
|
255
249
|
// sizing
|
|
256
250
|
width: {
|
|
257
|
-
transform:
|
|
251
|
+
transform: sizingTransform
|
|
258
252
|
},
|
|
259
253
|
maxWidth: {
|
|
260
|
-
style:
|
|
254
|
+
style: maxWidth
|
|
261
255
|
},
|
|
262
256
|
minWidth: {
|
|
263
|
-
transform:
|
|
257
|
+
transform: sizingTransform
|
|
264
258
|
},
|
|
265
259
|
height: {
|
|
266
|
-
transform:
|
|
260
|
+
transform: sizingTransform
|
|
267
261
|
},
|
|
268
262
|
maxHeight: {
|
|
269
|
-
transform:
|
|
263
|
+
transform: sizingTransform
|
|
270
264
|
},
|
|
271
265
|
minHeight: {
|
|
272
|
-
transform:
|
|
266
|
+
transform: sizingTransform
|
|
273
267
|
},
|
|
274
268
|
boxSizing: {},
|
|
275
269
|
// typography
|
|
@@ -297,4 +291,4 @@ const defaultSxConfig = {
|
|
|
297
291
|
themeKey: 'typography'
|
|
298
292
|
}
|
|
299
293
|
};
|
|
300
|
-
|
|
294
|
+
export default defaultSxConfig;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = extendSxProp;
|
|
8
|
-
var _deepmerge = require("@mui/utils/deepmerge");
|
|
9
|
-
var _defaultSxConfig = _interopRequireDefault(require("./defaultSxConfig"));
|
|
1
|
+
import { isPlainObject } from '@mui/utils/deepmerge';
|
|
2
|
+
import defaultSxConfig from "./defaultSxConfig.js";
|
|
10
3
|
const splitProps = props => {
|
|
11
4
|
const result = {
|
|
12
5
|
systemProps: {},
|
|
13
6
|
otherProps: {}
|
|
14
7
|
};
|
|
15
|
-
const config = props?.theme?.unstable_sxConfig ??
|
|
8
|
+
const config = props?.theme?.unstable_sxConfig ?? defaultSxConfig;
|
|
16
9
|
Object.keys(props).forEach(prop => {
|
|
17
10
|
if (config[prop]) {
|
|
18
11
|
result.systemProps[prop] = props[prop];
|
|
@@ -22,7 +15,7 @@ const splitProps = props => {
|
|
|
22
15
|
});
|
|
23
16
|
return result;
|
|
24
17
|
};
|
|
25
|
-
function extendSxProp(props) {
|
|
18
|
+
export default function extendSxProp(props) {
|
|
26
19
|
const {
|
|
27
20
|
sx: inSx,
|
|
28
21
|
...other
|
|
@@ -37,7 +30,7 @@ function extendSxProp(props) {
|
|
|
37
30
|
} else if (typeof inSx === 'function') {
|
|
38
31
|
finalSx = (...args) => {
|
|
39
32
|
const result = inSx(...args);
|
|
40
|
-
if (!
|
|
33
|
+
if (!isPlainObject(result)) {
|
|
41
34
|
return systemProps;
|
|
42
35
|
}
|
|
43
36
|
return {
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
exports.unstable_createStyleFunctionSx = unstable_createStyleFunctionSx;
|
|
9
|
-
var _capitalize = _interopRequireDefault(require("@mui/utils/capitalize"));
|
|
10
|
-
var _merge = _interopRequireDefault(require("../merge"));
|
|
11
|
-
var _style = require("../style");
|
|
12
|
-
var _breakpoints = require("../breakpoints");
|
|
13
|
-
var _cssContainerQueries = require("../cssContainerQueries");
|
|
14
|
-
var _defaultSxConfig = _interopRequireDefault(require("./defaultSxConfig"));
|
|
1
|
+
import capitalize from '@mui/utils/capitalize';
|
|
2
|
+
import merge from "../merge/index.js";
|
|
3
|
+
import { getPath, getStyleValue as getValue } from "../style/index.js";
|
|
4
|
+
import { handleBreakpoints, createEmptyBreakpointObject, removeUnusedBreakpoints } from "../breakpoints/index.js";
|
|
5
|
+
import { sortContainerQueries } from "../cssContainerQueries/index.js";
|
|
6
|
+
import defaultSxConfig from "./defaultSxConfig.js";
|
|
15
7
|
function objectsHaveSameKeys(...objects) {
|
|
16
8
|
const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);
|
|
17
9
|
const union = new Set(allKeys);
|
|
@@ -22,7 +14,7 @@ function callIfFn(maybeFn, arg) {
|
|
|
22
14
|
}
|
|
23
15
|
|
|
24
16
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
25
|
-
function unstable_createStyleFunctionSx() {
|
|
17
|
+
export function unstable_createStyleFunctionSx() {
|
|
26
18
|
function getThemeValue(prop, val, theme, config) {
|
|
27
19
|
const props = {
|
|
28
20
|
[prop]: val,
|
|
@@ -50,15 +42,15 @@ function unstable_createStyleFunctionSx() {
|
|
|
50
42
|
[prop]: val
|
|
51
43
|
};
|
|
52
44
|
}
|
|
53
|
-
const themeMapping =
|
|
45
|
+
const themeMapping = getPath(theme, themeKey) || {};
|
|
54
46
|
if (style) {
|
|
55
47
|
return style(props);
|
|
56
48
|
}
|
|
57
49
|
const styleFromPropValue = propValueFinal => {
|
|
58
|
-
let value = (
|
|
50
|
+
let value = getValue(themeMapping, transform, propValueFinal);
|
|
59
51
|
if (propValueFinal === value && typeof propValueFinal === 'string') {
|
|
60
52
|
// Haven't found value
|
|
61
|
-
value = (
|
|
53
|
+
value = getValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);
|
|
62
54
|
}
|
|
63
55
|
if (cssProperty === false) {
|
|
64
56
|
return value;
|
|
@@ -67,7 +59,7 @@ function unstable_createStyleFunctionSx() {
|
|
|
67
59
|
[cssProperty]: value
|
|
68
60
|
};
|
|
69
61
|
};
|
|
70
|
-
return
|
|
62
|
+
return handleBreakpoints(props, val, styleFromPropValue);
|
|
71
63
|
}
|
|
72
64
|
function styleFunctionSx(props) {
|
|
73
65
|
const {
|
|
@@ -77,7 +69,7 @@ function unstable_createStyleFunctionSx() {
|
|
|
77
69
|
if (!sx) {
|
|
78
70
|
return null; // Emotion & styled-components will neglect null
|
|
79
71
|
}
|
|
80
|
-
const config = theme.unstable_sxConfig ??
|
|
72
|
+
const config = theme.unstable_sxConfig ?? defaultSxConfig;
|
|
81
73
|
|
|
82
74
|
/*
|
|
83
75
|
* Receive `sxInput` as object or callback
|
|
@@ -95,7 +87,7 @@ function unstable_createStyleFunctionSx() {
|
|
|
95
87
|
if (!sxObject) {
|
|
96
88
|
return null;
|
|
97
89
|
}
|
|
98
|
-
const emptyBreakpoints =
|
|
90
|
+
const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);
|
|
99
91
|
const breakpointsKeys = Object.keys(emptyBreakpoints);
|
|
100
92
|
let css = emptyBreakpoints;
|
|
101
93
|
Object.keys(sxObject).forEach(styleKey => {
|
|
@@ -103,9 +95,9 @@ function unstable_createStyleFunctionSx() {
|
|
|
103
95
|
if (value !== null && value !== undefined) {
|
|
104
96
|
if (typeof value === 'object') {
|
|
105
97
|
if (config[styleKey]) {
|
|
106
|
-
css = (
|
|
98
|
+
css = merge(css, getThemeValue(styleKey, value, theme, config));
|
|
107
99
|
} else {
|
|
108
|
-
const breakpointsValues =
|
|
100
|
+
const breakpointsValues = handleBreakpoints({
|
|
109
101
|
theme
|
|
110
102
|
}, value, x => ({
|
|
111
103
|
[styleKey]: x
|
|
@@ -116,15 +108,15 @@ function unstable_createStyleFunctionSx() {
|
|
|
116
108
|
theme
|
|
117
109
|
});
|
|
118
110
|
} else {
|
|
119
|
-
css = (
|
|
111
|
+
css = merge(css, breakpointsValues);
|
|
120
112
|
}
|
|
121
113
|
}
|
|
122
114
|
} else {
|
|
123
|
-
css = (
|
|
115
|
+
css = merge(css, getThemeValue(styleKey, value, theme, config));
|
|
124
116
|
}
|
|
125
117
|
}
|
|
126
118
|
});
|
|
127
|
-
return
|
|
119
|
+
return sortContainerQueries(theme, removeUnusedBreakpoints(breakpointsKeys, css));
|
|
128
120
|
}
|
|
129
121
|
return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
|
|
130
122
|
}
|
|
@@ -132,4 +124,4 @@ function unstable_createStyleFunctionSx() {
|
|
|
132
124
|
}
|
|
133
125
|
const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
134
126
|
styleFunctionSx.filterProps = ['sx'];
|
|
135
|
-
|
|
127
|
+
export default styleFunctionSx;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./styled.js";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import style from "../style/index.js";
|
|
2
|
+
import compose from "../compose/index.js";
|
|
3
|
+
export const fontFamily = style({
|
|
4
|
+
prop: 'fontFamily',
|
|
5
|
+
themeKey: 'typography'
|
|
6
|
+
});
|
|
7
|
+
export const fontSize = style({
|
|
8
|
+
prop: 'fontSize',
|
|
9
|
+
themeKey: 'typography'
|
|
10
|
+
});
|
|
11
|
+
export const fontStyle = style({
|
|
12
|
+
prop: 'fontStyle',
|
|
13
|
+
themeKey: 'typography'
|
|
14
|
+
});
|
|
15
|
+
export const fontWeight = style({
|
|
16
|
+
prop: 'fontWeight',
|
|
17
|
+
themeKey: 'typography'
|
|
18
|
+
});
|
|
19
|
+
export const letterSpacing = style({
|
|
20
|
+
prop: 'letterSpacing'
|
|
21
|
+
});
|
|
22
|
+
export const textTransform = style({
|
|
23
|
+
prop: 'textTransform'
|
|
24
|
+
});
|
|
25
|
+
export const lineHeight = style({
|
|
26
|
+
prop: 'lineHeight'
|
|
27
|
+
});
|
|
28
|
+
export const textAlign = style({
|
|
29
|
+
prop: 'textAlign'
|
|
30
|
+
});
|
|
31
|
+
export const typographyVariant = style({
|
|
32
|
+
prop: 'typography',
|
|
33
|
+
cssProperty: false,
|
|
34
|
+
themeKey: 'typography'
|
|
35
|
+
});
|
|
36
|
+
const typography = compose(typographyVariant, fontFamily, fontSize, fontStyle, fontWeight, letterSpacing, lineHeight, textAlign, textTransform);
|
|
37
|
+
export default typography;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
'use client';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
});
|
|
9
|
-
exports.default = useMediaQuery;
|
|
10
|
-
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
12
|
-
var _useThemeProps = require("../useThemeProps");
|
|
13
|
-
var _useThemeWithoutDefault = _interopRequireDefault(require("../useThemeWithoutDefault"));
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
5
|
+
import { getThemeProps } from "../useThemeProps/index.js";
|
|
6
|
+
import useTheme from "../useThemeWithoutDefault/index.js";
|
|
14
7
|
// TODO React 17: Remove `useMediaQueryOld` once React 17 support is removed
|
|
15
8
|
function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
|
|
16
9
|
const [match, setMatch] = React.useState(() => {
|
|
@@ -25,7 +18,7 @@ function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSs
|
|
|
25
18
|
// event listeners to return the correct matches value.
|
|
26
19
|
return defaultMatches;
|
|
27
20
|
});
|
|
28
|
-
(
|
|
21
|
+
useEnhancedEffect(() => {
|
|
29
22
|
if (!matchMedia) {
|
|
30
23
|
return undefined;
|
|
31
24
|
}
|
|
@@ -76,8 +69,8 @@ function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia, noSs
|
|
|
76
69
|
const match = maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
77
70
|
return match;
|
|
78
71
|
}
|
|
79
|
-
function useMediaQuery(queryInput, options = {}) {
|
|
80
|
-
const theme = (
|
|
72
|
+
export default function useMediaQuery(queryInput, options = {}) {
|
|
73
|
+
const theme = useTheme();
|
|
81
74
|
// Wait for jsdom to support the match media feature.
|
|
82
75
|
// All the browsers MUI support have this built-in.
|
|
83
76
|
// This defensive check is here for simplicity.
|
|
@@ -88,7 +81,7 @@ function useMediaQuery(queryInput, options = {}) {
|
|
|
88
81
|
matchMedia = supportMatchMedia ? window.matchMedia : null,
|
|
89
82
|
ssrMatchMedia = null,
|
|
90
83
|
noSsr = false
|
|
91
|
-
} =
|
|
84
|
+
} = getThemeProps({
|
|
92
85
|
name: 'MuiUseMediaQuery',
|
|
93
86
|
props: options,
|
|
94
87
|
theme
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import createTheme from "../createTheme/index.js";
|
|
4
|
+
import useThemeWithoutDefault from "../useThemeWithoutDefault/index.js";
|
|
5
|
+
export const systemDefaultTheme = createTheme();
|
|
6
|
+
function useTheme(defaultTheme = systemDefaultTheme) {
|
|
7
|
+
return useThemeWithoutDefault(defaultTheme);
|
|
8
|
+
}
|
|
9
|
+
export default useTheme;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import resolveProps from '@mui/utils/resolveProps';
|
|
2
|
+
export default function getThemeProps(params) {
|
|
3
|
+
const {
|
|
4
|
+
theme,
|
|
5
|
+
name,
|
|
6
|
+
props
|
|
7
|
+
} = params;
|
|
8
|
+
if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {
|
|
9
|
+
return props;
|
|
10
|
+
}
|
|
11
|
+
return resolveProps(theme.components[name].defaultProps, props);
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import getThemeProps from "./getThemeProps.js";
|
|
4
|
+
import useTheme from "../useTheme/index.js";
|
|
5
|
+
export default function useThemeProps({
|
|
6
|
+
props,
|
|
7
|
+
name,
|
|
8
|
+
defaultTheme,
|
|
9
|
+
themeId
|
|
10
|
+
}) {
|
|
11
|
+
let theme = useTheme(defaultTheme);
|
|
12
|
+
if (themeId) {
|
|
13
|
+
theme = theme[themeId] || theme;
|
|
14
|
+
}
|
|
15
|
+
return getThemeProps({
|
|
16
|
+
theme,
|
|
17
|
+
name,
|
|
18
|
+
props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./useThemeWithoutDefault.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ThemeContext } from '@mui/styled-engine';
|
|
5
|
+
function isObjectEmpty(obj) {
|
|
6
|
+
return Object.keys(obj).length === 0;
|
|
7
|
+
}
|
|
8
|
+
function useTheme(defaultTheme = null) {
|
|
9
|
+
const contextTheme = React.useContext(ThemeContext);
|
|
10
|
+
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
|
|
11
|
+
}
|
|
12
|
+
export default useTheme;
|