@mui/system 5.14.11 → 5.14.12
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.d.ts +12 -0
- package/Box/Box.js +1 -2
- package/CHANGELOG.md +81 -0
- package/Container/Container.js +1 -2
- package/Container/containerClasses.js +1 -2
- package/GlobalStyles/GlobalStyles.js +1 -2
- package/Stack/Stack.js +1 -2
- package/Stack/stackClasses.js +1 -2
- package/ThemeProvider/ThemeProvider.js +1 -2
- package/Unstable_Grid/Grid.js +1 -2
- package/Unstable_Grid/gridClasses.js +1 -2
- package/borders.js +11 -22
- package/breakpoints.js +3 -4
- package/compose.js +1 -2
- package/createStyled.js +100 -37
- package/createTheme/createBreakpoints.js +1 -2
- package/createTheme/createTheme.js +1 -2
- package/createTheme/shape.js +1 -2
- package/cssGrid.js +10 -20
- package/cssVars/createCssVarsProvider.js +1 -2
- package/cssVars/createCssVarsTheme.js +1 -2
- package/cssVars/getInitColorSchemeScript.js +3 -6
- package/cssVars/prepareCssVars.js +1 -2
- package/display.js +7 -14
- package/esm/createStyled.js +100 -36
- package/flexbox.js +14 -28
- package/getThemeValue.js +3 -6
- package/index.js +1 -1
- package/legacy/createStyled.js +106 -41
- package/legacy/index.js +1 -1
- package/merge.js +1 -2
- package/modern/createStyled.js +99 -35
- package/modern/index.js +1 -1
- package/package.json +6 -6
- package/palette.js +4 -8
- package/positions.js +7 -14
- package/responsivePropType.js +1 -2
- package/shadows.js +1 -2
- package/sizing.js +9 -18
- package/spacing.js +3 -6
- package/style.js +1 -2
- package/styleFunctionSx/defaultSxConfig.js +1 -2
- package/styleFunctionSx/styleFunctionSx.js +1 -2
- package/styled.js +1 -2
- package/typography.js +10 -20
- package/useTheme.js +2 -4
- package/useThemeWithoutDefault.js +1 -2
package/modern/createStyled.js
CHANGED
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
const _excluded = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
|
|
4
4
|
/* eslint-disable no-underscore-dangle */
|
|
5
5
|
import styledEngineStyled, { internal_processStyles as processStyles } from '@mui/styled-engine';
|
|
6
|
-
import { getDisplayName, unstable_capitalize as capitalize } from '@mui/utils';
|
|
6
|
+
import { getDisplayName, unstable_capitalize as capitalize, isPlainObject, deepmerge } from '@mui/utils';
|
|
7
7
|
import createTheme from './createTheme';
|
|
8
8
|
import propsToClassKey from './propsToClassKey';
|
|
9
9
|
import styleFunctionSx from './styleFunctionSx';
|
|
@@ -25,39 +25,47 @@ const getStyleOverrides = (name, theme) => {
|
|
|
25
25
|
}
|
|
26
26
|
return null;
|
|
27
27
|
};
|
|
28
|
+
const transformVariants = variants => {
|
|
29
|
+
const variantsStyles = {};
|
|
30
|
+
if (variants) {
|
|
31
|
+
variants.forEach(definition => {
|
|
32
|
+
const key = propsToClassKey(definition.props);
|
|
33
|
+
variantsStyles[key] = definition.style;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return variantsStyles;
|
|
37
|
+
};
|
|
28
38
|
const getVariantStyles = (name, theme) => {
|
|
29
39
|
let variants = [];
|
|
30
40
|
if (theme && theme.components && theme.components[name] && theme.components[name].variants) {
|
|
31
41
|
variants = theme.components[name].variants;
|
|
32
42
|
}
|
|
33
|
-
|
|
34
|
-
variants.forEach(definition => {
|
|
35
|
-
const key = propsToClassKey(definition.props);
|
|
36
|
-
variantsStyles[key] = definition.style;
|
|
37
|
-
});
|
|
38
|
-
return variantsStyles;
|
|
43
|
+
return transformVariants(variants);
|
|
39
44
|
};
|
|
40
|
-
const variantsResolver = (props, styles,
|
|
45
|
+
const variantsResolver = (props, styles, variants) => {
|
|
41
46
|
const {
|
|
42
47
|
ownerState = {}
|
|
43
48
|
} = props;
|
|
44
49
|
const variantsStyles = [];
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
themeVariants.forEach(themeVariant => {
|
|
50
|
+
if (variants) {
|
|
51
|
+
variants.forEach(variant => {
|
|
48
52
|
let isMatch = true;
|
|
49
|
-
Object.keys(
|
|
50
|
-
if (ownerState[key] !==
|
|
53
|
+
Object.keys(variant.props).forEach(key => {
|
|
54
|
+
if (ownerState[key] !== variant.props[key] && props[key] !== variant.props[key]) {
|
|
51
55
|
isMatch = false;
|
|
52
56
|
}
|
|
53
57
|
});
|
|
54
58
|
if (isMatch) {
|
|
55
|
-
variantsStyles.push(styles[propsToClassKey(
|
|
59
|
+
variantsStyles.push(styles[propsToClassKey(variant.props)]);
|
|
56
60
|
}
|
|
57
61
|
});
|
|
58
62
|
}
|
|
59
63
|
return variantsStyles;
|
|
60
64
|
};
|
|
65
|
+
const themeVariantsResolver = (props, styles, theme, name) => {
|
|
66
|
+
const themeVariants = theme?.components?.[name]?.variants;
|
|
67
|
+
return variantsResolver(props, styles, themeVariants);
|
|
68
|
+
};
|
|
61
69
|
|
|
62
70
|
// Update /system/styled/#api in case if this changes
|
|
63
71
|
export function shouldForwardProp(prop) {
|
|
@@ -83,6 +91,29 @@ function defaultOverridesResolver(slot) {
|
|
|
83
91
|
}
|
|
84
92
|
return (props, styles) => styles[slot];
|
|
85
93
|
}
|
|
94
|
+
const muiStyledFunctionResolver = ({
|
|
95
|
+
styledArg,
|
|
96
|
+
props,
|
|
97
|
+
defaultTheme,
|
|
98
|
+
themeId
|
|
99
|
+
}) => {
|
|
100
|
+
const resolvedStyles = styledArg(_extends({}, props, {
|
|
101
|
+
theme: resolveTheme(_extends({}, props, {
|
|
102
|
+
defaultTheme,
|
|
103
|
+
themeId
|
|
104
|
+
}))
|
|
105
|
+
}));
|
|
106
|
+
let optionalVariants;
|
|
107
|
+
if (resolvedStyles && resolvedStyles.variants) {
|
|
108
|
+
optionalVariants = resolvedStyles.variants;
|
|
109
|
+
delete resolvedStyles.variants;
|
|
110
|
+
}
|
|
111
|
+
if (optionalVariants) {
|
|
112
|
+
const variantsStyles = variantsResolver(props, transformVariants(optionalVariants), optionalVariants);
|
|
113
|
+
return [resolvedStyles, ...variantsStyles];
|
|
114
|
+
}
|
|
115
|
+
return resolvedStyles;
|
|
116
|
+
};
|
|
86
117
|
export default function createStyled(input = {}) {
|
|
87
118
|
const {
|
|
88
119
|
themeId,
|
|
@@ -149,16 +180,61 @@ export default function createStyled(input = {}) {
|
|
|
149
180
|
// On the server Emotion doesn't use React.forwardRef for creating components, so the created
|
|
150
181
|
// component stays as a function. This condition makes sure that we do not interpolate functions
|
|
151
182
|
// which are basically components used as a selectors.
|
|
152
|
-
|
|
153
|
-
return
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
})
|
|
159
|
-
}
|
|
183
|
+
if (typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg) {
|
|
184
|
+
return props => muiStyledFunctionResolver({
|
|
185
|
+
styledArg: stylesArg,
|
|
186
|
+
props,
|
|
187
|
+
defaultTheme,
|
|
188
|
+
themeId
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
if (isPlainObject(stylesArg)) {
|
|
192
|
+
let transformedStylesArg = stylesArg;
|
|
193
|
+
let styledArgVariants;
|
|
194
|
+
if (stylesArg && stylesArg.variants) {
|
|
195
|
+
styledArgVariants = stylesArg.variants;
|
|
196
|
+
delete transformedStylesArg.variants;
|
|
197
|
+
transformedStylesArg = props => {
|
|
198
|
+
let result = stylesArg;
|
|
199
|
+
const variantStyles = variantsResolver(props, transformVariants(styledArgVariants), styledArgVariants);
|
|
200
|
+
variantStyles.forEach(variantStyle => {
|
|
201
|
+
result = deepmerge(result, variantStyle);
|
|
202
|
+
});
|
|
203
|
+
return result;
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
return transformedStylesArg;
|
|
207
|
+
}
|
|
208
|
+
return stylesArg;
|
|
160
209
|
}) : [];
|
|
161
210
|
let transformedStyleArg = styleArg;
|
|
211
|
+
if (isPlainObject(styleArg)) {
|
|
212
|
+
let styledArgVariants;
|
|
213
|
+
if (styleArg && styleArg.variants) {
|
|
214
|
+
styledArgVariants = styleArg.variants;
|
|
215
|
+
delete transformedStyleArg.variants;
|
|
216
|
+
transformedStyleArg = props => {
|
|
217
|
+
let result = styleArg;
|
|
218
|
+
const variantStyles = variantsResolver(props, transformVariants(styledArgVariants), styledArgVariants);
|
|
219
|
+
variantStyles.forEach(variantStyle => {
|
|
220
|
+
result = deepmerge(result, variantStyle);
|
|
221
|
+
});
|
|
222
|
+
return result;
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
} else if (typeof styleArg === 'function' &&
|
|
226
|
+
// On the server Emotion doesn't use React.forwardRef for creating components, so the created
|
|
227
|
+
// component stays as a function. This condition makes sure that we do not interpolate functions
|
|
228
|
+
// which are basically components used as a selectors.
|
|
229
|
+
styleArg.__emotion_real !== styleArg) {
|
|
230
|
+
// If the type is function, we need to define the default theme.
|
|
231
|
+
transformedStyleArg = props => muiStyledFunctionResolver({
|
|
232
|
+
styledArg: styleArg,
|
|
233
|
+
props,
|
|
234
|
+
defaultTheme,
|
|
235
|
+
themeId
|
|
236
|
+
});
|
|
237
|
+
}
|
|
162
238
|
if (componentName && overridesResolver) {
|
|
163
239
|
expressionsWithDefaultTheme.push(props => {
|
|
164
240
|
const theme = resolveTheme(_extends({}, props, {
|
|
@@ -184,7 +260,7 @@ export default function createStyled(input = {}) {
|
|
|
184
260
|
defaultTheme,
|
|
185
261
|
themeId
|
|
186
262
|
}));
|
|
187
|
-
return
|
|
263
|
+
return themeVariantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);
|
|
188
264
|
});
|
|
189
265
|
}
|
|
190
266
|
if (!skipSx) {
|
|
@@ -196,18 +272,6 @@ export default function createStyled(input = {}) {
|
|
|
196
272
|
// If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.
|
|
197
273
|
transformedStyleArg = [...styleArg, ...placeholders];
|
|
198
274
|
transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
|
|
199
|
-
} else if (typeof styleArg === 'function' &&
|
|
200
|
-
// On the server Emotion doesn't use React.forwardRef for creating components, so the created
|
|
201
|
-
// component stays as a function. This condition makes sure that we do not interpolate functions
|
|
202
|
-
// which are basically components used as a selectors.
|
|
203
|
-
styleArg.__emotion_real !== styleArg) {
|
|
204
|
-
// If the type is function, we need to define the default theme.
|
|
205
|
-
transformedStyleArg = props => styleArg(_extends({}, props, {
|
|
206
|
-
theme: resolveTheme(_extends({}, props, {
|
|
207
|
-
defaultTheme,
|
|
208
|
-
themeId
|
|
209
|
-
}))
|
|
210
|
-
}));
|
|
211
275
|
}
|
|
212
276
|
const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);
|
|
213
277
|
if (process.env.NODE_ENV !== 'production') {
|
package/modern/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/system",
|
|
3
|
-
"version": "5.14.
|
|
3
|
+
"version": "5.14.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "CSS utilities for rapidly laying out custom designs.",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"url": "https://opencollective.com/mui"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@babel/runtime": "^7.
|
|
30
|
-
"@mui/private-theming": "^5.14.
|
|
31
|
-
"@mui/styled-engine": "^5.14.
|
|
32
|
-
"@mui/types": "^7.2.
|
|
33
|
-
"@mui/utils": "^5.14.
|
|
29
|
+
"@babel/runtime": "^7.23.1",
|
|
30
|
+
"@mui/private-theming": "^5.14.12",
|
|
31
|
+
"@mui/styled-engine": "^5.14.12",
|
|
32
|
+
"@mui/types": "^7.2.5",
|
|
33
|
+
"@mui/utils": "^5.14.12",
|
|
34
34
|
"clsx": "^2.0.0",
|
|
35
35
|
"csstype": "^3.1.2",
|
|
36
36
|
"prop-types": "^15.8.1"
|
package/palette.js
CHANGED
|
@@ -14,25 +14,21 @@ function paletteTransform(value, userValue) {
|
|
|
14
14
|
}
|
|
15
15
|
return value;
|
|
16
16
|
}
|
|
17
|
-
const color = (0, _style.default)({
|
|
17
|
+
const color = exports.color = (0, _style.default)({
|
|
18
18
|
prop: 'color',
|
|
19
19
|
themeKey: 'palette',
|
|
20
20
|
transform: paletteTransform
|
|
21
21
|
});
|
|
22
|
-
exports.
|
|
23
|
-
const bgcolor = (0, _style.default)({
|
|
22
|
+
const bgcolor = exports.bgcolor = (0, _style.default)({
|
|
24
23
|
prop: 'bgcolor',
|
|
25
24
|
cssProperty: 'backgroundColor',
|
|
26
25
|
themeKey: 'palette',
|
|
27
26
|
transform: paletteTransform
|
|
28
27
|
});
|
|
29
|
-
exports.
|
|
30
|
-
const backgroundColor = (0, _style.default)({
|
|
28
|
+
const backgroundColor = exports.backgroundColor = (0, _style.default)({
|
|
31
29
|
prop: 'backgroundColor',
|
|
32
30
|
themeKey: 'palette',
|
|
33
31
|
transform: paletteTransform
|
|
34
32
|
});
|
|
35
|
-
exports.backgroundColor = backgroundColor;
|
|
36
33
|
const palette = (0, _compose.default)(color, bgcolor, backgroundColor);
|
|
37
|
-
var _default = palette;
|
|
38
|
-
exports.default = _default;
|
|
34
|
+
var _default = exports.default = palette;
|
package/positions.js
CHANGED
|
@@ -7,30 +7,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.zIndex = exports.top = exports.right = exports.position = exports.left = exports.default = exports.bottom = void 0;
|
|
8
8
|
var _style = _interopRequireDefault(require("./style"));
|
|
9
9
|
var _compose = _interopRequireDefault(require("./compose"));
|
|
10
|
-
const position = (0, _style.default)({
|
|
10
|
+
const position = exports.position = (0, _style.default)({
|
|
11
11
|
prop: 'position'
|
|
12
12
|
});
|
|
13
|
-
exports.
|
|
14
|
-
const zIndex = (0, _style.default)({
|
|
13
|
+
const zIndex = exports.zIndex = (0, _style.default)({
|
|
15
14
|
prop: 'zIndex',
|
|
16
15
|
themeKey: 'zIndex'
|
|
17
16
|
});
|
|
18
|
-
exports.
|
|
19
|
-
const top = (0, _style.default)({
|
|
17
|
+
const top = exports.top = (0, _style.default)({
|
|
20
18
|
prop: 'top'
|
|
21
19
|
});
|
|
22
|
-
exports.
|
|
23
|
-
const right = (0, _style.default)({
|
|
20
|
+
const right = exports.right = (0, _style.default)({
|
|
24
21
|
prop: 'right'
|
|
25
22
|
});
|
|
26
|
-
exports.
|
|
27
|
-
const bottom = (0, _style.default)({
|
|
23
|
+
const bottom = exports.bottom = (0, _style.default)({
|
|
28
24
|
prop: 'bottom'
|
|
29
25
|
});
|
|
30
|
-
exports.
|
|
31
|
-
const left = (0, _style.default)({
|
|
26
|
+
const left = exports.left = (0, _style.default)({
|
|
32
27
|
prop: 'left'
|
|
33
28
|
});
|
|
34
|
-
exports.
|
|
35
|
-
var _default = (0, _compose.default)(position, zIndex, top, right, bottom, left);
|
|
36
|
-
exports.default = _default;
|
|
29
|
+
var _default = exports.default = (0, _compose.default)(position, zIndex, top, right, bottom, left);
|
package/responsivePropType.js
CHANGED
|
@@ -7,5 +7,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
const responsivePropType = process.env.NODE_ENV !== 'production' ? _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string, _propTypes.default.object, _propTypes.default.array]) : {};
|
|
10
|
-
var _default = responsivePropType;
|
|
11
|
-
exports.default = _default;
|
|
10
|
+
var _default = exports.default = responsivePropType;
|
package/shadows.js
CHANGED
package/sizing.js
CHANGED
|
@@ -13,11 +13,10 @@ var _breakpoints = require("./breakpoints");
|
|
|
13
13
|
function sizingTransform(value) {
|
|
14
14
|
return value <= 1 && value !== 0 ? `${value * 100}%` : value;
|
|
15
15
|
}
|
|
16
|
-
const width = (0, _style.default)({
|
|
16
|
+
const width = exports.width = (0, _style.default)({
|
|
17
17
|
prop: 'width',
|
|
18
18
|
transform: sizingTransform
|
|
19
19
|
});
|
|
20
|
-
exports.width = width;
|
|
21
20
|
const maxWidth = props => {
|
|
22
21
|
if (props.maxWidth !== undefined && props.maxWidth !== null) {
|
|
23
22
|
const styleFromPropValue = propValue => {
|
|
@@ -43,42 +42,34 @@ const maxWidth = props => {
|
|
|
43
42
|
};
|
|
44
43
|
exports.maxWidth = maxWidth;
|
|
45
44
|
maxWidth.filterProps = ['maxWidth'];
|
|
46
|
-
const minWidth = (0, _style.default)({
|
|
45
|
+
const minWidth = exports.minWidth = (0, _style.default)({
|
|
47
46
|
prop: 'minWidth',
|
|
48
47
|
transform: sizingTransform
|
|
49
48
|
});
|
|
50
|
-
exports.
|
|
51
|
-
const height = (0, _style.default)({
|
|
49
|
+
const height = exports.height = (0, _style.default)({
|
|
52
50
|
prop: 'height',
|
|
53
51
|
transform: sizingTransform
|
|
54
52
|
});
|
|
55
|
-
exports.
|
|
56
|
-
const maxHeight = (0, _style.default)({
|
|
53
|
+
const maxHeight = exports.maxHeight = (0, _style.default)({
|
|
57
54
|
prop: 'maxHeight',
|
|
58
55
|
transform: sizingTransform
|
|
59
56
|
});
|
|
60
|
-
exports.
|
|
61
|
-
const minHeight = (0, _style.default)({
|
|
57
|
+
const minHeight = exports.minHeight = (0, _style.default)({
|
|
62
58
|
prop: 'minHeight',
|
|
63
59
|
transform: sizingTransform
|
|
64
60
|
});
|
|
65
|
-
exports.
|
|
66
|
-
const sizeWidth = (0, _style.default)({
|
|
61
|
+
const sizeWidth = exports.sizeWidth = (0, _style.default)({
|
|
67
62
|
prop: 'size',
|
|
68
63
|
cssProperty: 'width',
|
|
69
64
|
transform: sizingTransform
|
|
70
65
|
});
|
|
71
|
-
exports.
|
|
72
|
-
const sizeHeight = (0, _style.default)({
|
|
66
|
+
const sizeHeight = exports.sizeHeight = (0, _style.default)({
|
|
73
67
|
prop: 'size',
|
|
74
68
|
cssProperty: 'height',
|
|
75
69
|
transform: sizingTransform
|
|
76
70
|
});
|
|
77
|
-
exports.
|
|
78
|
-
const boxSizing = (0, _style.default)({
|
|
71
|
+
const boxSizing = exports.boxSizing = (0, _style.default)({
|
|
79
72
|
prop: 'boxSizing'
|
|
80
73
|
});
|
|
81
|
-
exports.boxSizing = boxSizing;
|
|
82
74
|
const sizing = (0, _compose.default)(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);
|
|
83
|
-
var _default = sizing;
|
|
84
|
-
exports.default = _default;
|
|
75
|
+
var _default = exports.default = sizing;
|
package/spacing.js
CHANGED
|
@@ -54,10 +54,8 @@ const getCssProperties = (0, _memoize.default)(prop => {
|
|
|
54
54
|
const direction = directions[b] || '';
|
|
55
55
|
return Array.isArray(direction) ? direction.map(dir => property + dir) : [property + direction];
|
|
56
56
|
});
|
|
57
|
-
const marginKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'marginInline', 'marginInlineStart', 'marginInlineEnd', 'marginBlock', 'marginBlockStart', 'marginBlockEnd'];
|
|
58
|
-
exports.
|
|
59
|
-
const paddingKeys = ['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd'];
|
|
60
|
-
exports.paddingKeys = paddingKeys;
|
|
57
|
+
const marginKeys = exports.marginKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'marginInline', 'marginInlineStart', 'marginInlineEnd', 'marginBlock', 'marginBlockStart', 'marginBlockEnd'];
|
|
58
|
+
const paddingKeys = exports.paddingKeys = ['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd'];
|
|
61
59
|
const spacingKeys = [...marginKeys, ...paddingKeys];
|
|
62
60
|
function createUnaryUnit(theme, themeKey, defaultValue, propName) {
|
|
63
61
|
var _getPath;
|
|
@@ -160,5 +158,4 @@ spacing.propTypes = process.env.NODE_ENV !== 'production' ? spacingKeys.reduce((
|
|
|
160
158
|
return obj;
|
|
161
159
|
}, {}) : {};
|
|
162
160
|
spacing.filterProps = spacingKeys;
|
|
163
|
-
var _default = spacing;
|
|
164
|
-
exports.default = _default;
|
|
161
|
+
var _default = exports.default = spacing;
|
package/style.js
CHANGED
|
@@ -133,5 +133,4 @@ function unstable_createStyleFunctionSx() {
|
|
|
133
133
|
}
|
|
134
134
|
const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
135
135
|
styleFunctionSx.filterProps = ['sx'];
|
|
136
|
-
var _default = styleFunctionSx;
|
|
137
|
-
exports.default = _default;
|
|
136
|
+
var _default = exports.default = styleFunctionSx;
|
package/styled.js
CHANGED
|
@@ -7,5 +7,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _createStyled = _interopRequireDefault(require("./createStyled"));
|
|
9
9
|
const styled = (0, _createStyled.default)();
|
|
10
|
-
var _default = styled;
|
|
11
|
-
exports.default = _default;
|
|
10
|
+
var _default = exports.default = styled;
|
package/typography.js
CHANGED
|
@@ -7,48 +7,38 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.typographyVariant = exports.textTransform = exports.textAlign = exports.lineHeight = exports.letterSpacing = exports.fontWeight = exports.fontStyle = exports.fontSize = exports.fontFamily = exports.default = void 0;
|
|
8
8
|
var _style = _interopRequireDefault(require("./style"));
|
|
9
9
|
var _compose = _interopRequireDefault(require("./compose"));
|
|
10
|
-
const fontFamily = (0, _style.default)({
|
|
10
|
+
const fontFamily = exports.fontFamily = (0, _style.default)({
|
|
11
11
|
prop: 'fontFamily',
|
|
12
12
|
themeKey: 'typography'
|
|
13
13
|
});
|
|
14
|
-
exports.
|
|
15
|
-
const fontSize = (0, _style.default)({
|
|
14
|
+
const fontSize = exports.fontSize = (0, _style.default)({
|
|
16
15
|
prop: 'fontSize',
|
|
17
16
|
themeKey: 'typography'
|
|
18
17
|
});
|
|
19
|
-
exports.
|
|
20
|
-
const fontStyle = (0, _style.default)({
|
|
18
|
+
const fontStyle = exports.fontStyle = (0, _style.default)({
|
|
21
19
|
prop: 'fontStyle',
|
|
22
20
|
themeKey: 'typography'
|
|
23
21
|
});
|
|
24
|
-
exports.
|
|
25
|
-
const fontWeight = (0, _style.default)({
|
|
22
|
+
const fontWeight = exports.fontWeight = (0, _style.default)({
|
|
26
23
|
prop: 'fontWeight',
|
|
27
24
|
themeKey: 'typography'
|
|
28
25
|
});
|
|
29
|
-
exports.
|
|
30
|
-
const letterSpacing = (0, _style.default)({
|
|
26
|
+
const letterSpacing = exports.letterSpacing = (0, _style.default)({
|
|
31
27
|
prop: 'letterSpacing'
|
|
32
28
|
});
|
|
33
|
-
exports.
|
|
34
|
-
const textTransform = (0, _style.default)({
|
|
29
|
+
const textTransform = exports.textTransform = (0, _style.default)({
|
|
35
30
|
prop: 'textTransform'
|
|
36
31
|
});
|
|
37
|
-
exports.
|
|
38
|
-
const lineHeight = (0, _style.default)({
|
|
32
|
+
const lineHeight = exports.lineHeight = (0, _style.default)({
|
|
39
33
|
prop: 'lineHeight'
|
|
40
34
|
});
|
|
41
|
-
exports.
|
|
42
|
-
const textAlign = (0, _style.default)({
|
|
35
|
+
const textAlign = exports.textAlign = (0, _style.default)({
|
|
43
36
|
prop: 'textAlign'
|
|
44
37
|
});
|
|
45
|
-
exports.
|
|
46
|
-
const typographyVariant = (0, _style.default)({
|
|
38
|
+
const typographyVariant = exports.typographyVariant = (0, _style.default)({
|
|
47
39
|
prop: 'typography',
|
|
48
40
|
cssProperty: false,
|
|
49
41
|
themeKey: 'typography'
|
|
50
42
|
});
|
|
51
|
-
exports.typographyVariant = typographyVariant;
|
|
52
43
|
const typography = (0, _compose.default)(typographyVariant, fontFamily, fontSize, fontStyle, fontWeight, letterSpacing, lineHeight, textAlign, textTransform);
|
|
53
|
-
var _default = typography;
|
|
54
|
-
exports.default = _default;
|
|
44
|
+
var _default = exports.default = typography;
|
package/useTheme.js
CHANGED
|
@@ -8,10 +8,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.systemDefaultTheme = exports.default = void 0;
|
|
9
9
|
var _createTheme = _interopRequireDefault(require("./createTheme"));
|
|
10
10
|
var _useThemeWithoutDefault = _interopRequireDefault(require("./useThemeWithoutDefault"));
|
|
11
|
-
const systemDefaultTheme = (0, _createTheme.default)();
|
|
12
|
-
exports.systemDefaultTheme = systemDefaultTheme;
|
|
11
|
+
const systemDefaultTheme = exports.systemDefaultTheme = (0, _createTheme.default)();
|
|
13
12
|
function useTheme(defaultTheme = systemDefaultTheme) {
|
|
14
13
|
return (0, _useThemeWithoutDefault.default)(defaultTheme);
|
|
15
14
|
}
|
|
16
|
-
var _default = useTheme;
|
|
17
|
-
exports.default = _default;
|
|
15
|
+
var _default = exports.default = useTheme;
|
|
@@ -16,5 +16,4 @@ function useTheme(defaultTheme = null) {
|
|
|
16
16
|
const contextTheme = React.useContext(_styledEngine.ThemeContext);
|
|
17
17
|
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
|
|
18
18
|
}
|
|
19
|
-
var _default = useTheme;
|
|
20
|
-
exports.default = _default;
|
|
19
|
+
var _default = exports.default = useTheme;
|