@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/Box/Box.d.ts
CHANGED
|
@@ -105,6 +105,12 @@ export declare const spacing: SimpleStyleFunction<
|
|
|
105
105
|
| 'marginLeft'
|
|
106
106
|
| 'marginX'
|
|
107
107
|
| 'marginY'
|
|
108
|
+
| 'marginInline'
|
|
109
|
+
| 'marginInlineStart'
|
|
110
|
+
| 'marginInlineEnd'
|
|
111
|
+
| 'marginBlock'
|
|
112
|
+
| 'marginBlockStart'
|
|
113
|
+
| 'marginBlockEnd'
|
|
108
114
|
| 'padding'
|
|
109
115
|
| 'paddingTop'
|
|
110
116
|
| 'paddingRight'
|
|
@@ -112,6 +118,12 @@ export declare const spacing: SimpleStyleFunction<
|
|
|
112
118
|
| 'paddingLeft'
|
|
113
119
|
| 'paddingX'
|
|
114
120
|
| 'paddingY'
|
|
121
|
+
| 'paddingInline'
|
|
122
|
+
| 'paddingInlineStart'
|
|
123
|
+
| 'paddingInlineEnd'
|
|
124
|
+
| 'paddingBlock'
|
|
125
|
+
| 'paddingBlockStart'
|
|
126
|
+
| 'paddingBlockEnd'
|
|
115
127
|
>;
|
|
116
128
|
|
|
117
129
|
export declare const typography: SimpleStyleFunction<
|
package/Box/Box.js
CHANGED
|
@@ -28,5 +28,4 @@ process.env.NODE_ENV !== "production" ? Box.propTypes /* remove-proptypes */ = {
|
|
|
28
28
|
*/
|
|
29
29
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
30
30
|
} : void 0;
|
|
31
|
-
var _default = Box;
|
|
32
|
-
exports.default = _default;
|
|
31
|
+
var _default = exports.default = Box;
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,86 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 5.14.12
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v5.14.11..master -->
|
|
6
|
+
|
|
7
|
+
_Oct 3, 2023_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 17 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
- 🎨 Introduced color inversion utilities to Joy UI (#38916) @siriwatknp
|
|
12
|
+
- 🚀 Added Chip and related TextField components to Material You @DiegoAndai, @mj12albert
|
|
13
|
+
|
|
14
|
+
### `@mui/material@5.14.12`
|
|
15
|
+
|
|
16
|
+
- [DialogActions] Apply margin-left when children is not of `button` type (#39189) @sai6855
|
|
17
|
+
- [Select] Improve a11y by adding combobox role and aria-controls attribute (#38785) @xulingzhihou
|
|
18
|
+
- [Select] Fix MenuProps slotProps forwarding (#39177) @DiegoAndai
|
|
19
|
+
- [TextField] Polish types in Textfield demo (#39140) @sai6855
|
|
20
|
+
- [ButtonGroup] Fix rendering with conditional elements (#38989) @ZeeshanTamboli
|
|
21
|
+
|
|
22
|
+
### `@mui/system@5.14.12`
|
|
23
|
+
|
|
24
|
+
- [system] Add support for `variants` in the styled() util (#39073) @mnajdova
|
|
25
|
+
- [Box] Add missing logical spacing property types (#39169) @Semigradsky
|
|
26
|
+
|
|
27
|
+
### `@mui/base@5.0.0-beta.18`
|
|
28
|
+
|
|
29
|
+
- [useSlider] Align externalProps handling (#38854) @mj12albert
|
|
30
|
+
- [useTabs] Align external props handling for useTab/useTabPanel/useTabsList (#39037) @mj12albert
|
|
31
|
+
- [test] Fix import paths in useTab tests (#39291) @mj12albert
|
|
32
|
+
|
|
33
|
+
### `@mui/material-next@6.0.0-alpha.104`
|
|
34
|
+
|
|
35
|
+
- [Chip] Add Material You Chip component (#38927) @DiegoAndai
|
|
36
|
+
- [Divider] Copy v5 Divider (#39197) @mj12albert
|
|
37
|
+
- [FilledInput] Copy v5 FilledInput (#39040) @mj12albert
|
|
38
|
+
- [FormControl] Add FormControl component (#39032) @mj12albert
|
|
39
|
+
- [Select] Copy Select files from v5 (#39188) @DiegoAndai
|
|
40
|
+
- [TextField] Copy v5 TextField's inner components (#39166) @mj12albert
|
|
41
|
+
|
|
42
|
+
### `@mui/joy@5.0.0-beta.9`
|
|
43
|
+
|
|
44
|
+
- Introduce color inversion utilities (#38916) @siriwatknp
|
|
45
|
+
- Replace margin with `gap` property (#39147) @siriwatknp
|
|
46
|
+
- [CssBaseline] use Joy `GlobalStyles` (#39278) @siriwatknp
|
|
47
|
+
- [Drawer] Apply content styles from theme to content slot (#39199) @sai6855
|
|
48
|
+
- [List] Add gap and missing active styles (#39146) @siriwatknp
|
|
49
|
+
- [Switch] Slight adjustments to the design (#39276) @danilo-leal
|
|
50
|
+
|
|
51
|
+
### Docs
|
|
52
|
+
|
|
53
|
+
- [docs] Update Autocomplete demo for React 18 (#39162) @oliviertassinari
|
|
54
|
+
- [docs-infra] Tweak feedback footer section design (#36556) @danilo-leal
|
|
55
|
+
- [docs-infra] Improve code syntax highlight (#39181) @oliviertassinari
|
|
56
|
+
- [docs][base] Add Tailwind CSS + plain CSS demo on the TextArea page (#39046) @alisasanib
|
|
57
|
+
- [docs][base-ui] Fix style for root div of multiline input (#39182) @ttlpta
|
|
58
|
+
- [docs][base-ui] Improve Select's country select demo (#38983) @oliviertassinari
|
|
59
|
+
- [docs][joy-ui] Add scrollable tabs example (#39260) @siriwatknp
|
|
60
|
+
- [docs][joy-ui] Match `Autocomplete` github label demo to actual github label dropdown (#39228) @sai6855
|
|
61
|
+
- [docs][joy-ui] Refine the Rental dashboard template (#39059) @zanivan
|
|
62
|
+
- [docs][joy-ui] Removed incomplete sentence in the Aspect Ratio page (#39227) @Erik-McKelvey
|
|
63
|
+
- [docs][joy-ui] Fix typo in the Accordion page (#39226) @Erik-McKelvey
|
|
64
|
+
- [docs][joy-ui] Update and standardize template Sidemenus (#39271) @zanivan
|
|
65
|
+
- [docs][joy-ui] Add a roadmap page (#39163) @danilo-leal
|
|
66
|
+
- [docs][material-ui] Replace `Box` with `Stack` in applicable demos (#39174) @sai6855
|
|
67
|
+
- [docs][material-ui] Add small polish to the Templates page (#39224) @danilo-leal
|
|
68
|
+
- [docs][material-ui] Small revision to the Icons page (#38840) @danilo-leal
|
|
69
|
+
|
|
70
|
+
### Core
|
|
71
|
+
|
|
72
|
+
- Add next lint config to eslint (#39183) @Janpot
|
|
73
|
+
- [core] Update eslint rules (#39178) @romgrk
|
|
74
|
+
- [core] Fix Greg GitHub slug @oliviertassinari
|
|
75
|
+
- [core] Priority Support casing normalization @oliviertassinari
|
|
76
|
+
- [website] Add Heat map in pricing page (#39269) @oliviertassinari
|
|
77
|
+
- [website] Update `React Engineer - xCharts` Ashby link (#39172) @DanailH
|
|
78
|
+
- [website] Add Charts to the pricing table (#38680) @alexfauquette
|
|
79
|
+
- [website] Polish career experience @oliviertassinari
|
|
80
|
+
- [website] Simplify the Core products file (#39194) @danilo-leal
|
|
81
|
+
|
|
82
|
+
All contributors of this release in alphabetical order: @alexfauquette, @brijeshb42, @DanailH, @danilo-leal, @DiegoAndai, @Erik-McKelvey, @Janpot, @mj12albert, @mnajdova, @oliviertassinari, @romgrk, @sai6855, @Semigradsky, @siriwatknp, @xulingzhihou, @zanivan, @ZeeshanTamboli
|
|
83
|
+
|
|
3
84
|
## 5.14.11
|
|
4
85
|
|
|
5
86
|
<!-- generated comparing v5.14.10..master -->
|
package/Container/Container.js
CHANGED
|
@@ -63,5 +63,4 @@ process.env.NODE_ENV !== "production" ? Container.propTypes /* remove-proptypes
|
|
|
63
63
|
*/
|
|
64
64
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
65
65
|
} : void 0;
|
|
66
|
-
var _default = Container;
|
|
67
|
-
exports.default = _default;
|
|
66
|
+
var _default = exports.default = Container;
|
|
@@ -10,5 +10,4 @@ function getContainerUtilityClass(slot) {
|
|
|
10
10
|
return (0, _utils.unstable_generateUtilityClass)('MuiContainer', slot);
|
|
11
11
|
}
|
|
12
12
|
const containerClasses = (0, _utils.unstable_generateUtilityClasses)('MuiContainer', ['root', 'disableGutters', 'fixed', 'maxWidthXs', 'maxWidthSm', 'maxWidthMd', 'maxWidthLg', 'maxWidthXl']);
|
|
13
|
-
var _default = containerClasses;
|
|
14
|
-
exports.default = _default;
|
|
13
|
+
var _default = exports.default = containerClasses;
|
package/Stack/Stack.js
CHANGED
package/Stack/stackClasses.js
CHANGED
|
@@ -10,5 +10,4 @@ function getStackUtilityClass(slot) {
|
|
|
10
10
|
return (0, _utils.unstable_generateUtilityClass)('MuiStack', slot);
|
|
11
11
|
}
|
|
12
12
|
const stackClasses = (0, _utils.unstable_generateUtilityClasses)('MuiStack', ['root']);
|
|
13
|
-
var _default = stackClasses;
|
|
14
|
-
exports.default = _default;
|
|
13
|
+
var _default = exports.default = stackClasses;
|
|
@@ -89,5 +89,4 @@ process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes /* remove-propty
|
|
|
89
89
|
if (process.env.NODE_ENV !== 'production') {
|
|
90
90
|
process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes = (0, _utils.exactProp)(ThemeProvider.propTypes) : void 0;
|
|
91
91
|
}
|
|
92
|
-
var _default = ThemeProvider;
|
|
93
|
-
exports.default = _default;
|
|
92
|
+
var _default = exports.default = ThemeProvider;
|
package/Unstable_Grid/Grid.js
CHANGED
|
@@ -179,5 +179,4 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ =
|
|
|
179
179
|
*/
|
|
180
180
|
xsOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number])
|
|
181
181
|
} : void 0;
|
|
182
|
-
var _default = Grid;
|
|
183
|
-
exports.default = _default;
|
|
182
|
+
var _default = exports.default = Grid;
|
|
@@ -22,5 +22,4 @@ const gridClasses = (0, _utils.unstable_generateUtilityClasses)('MuiGrid', ['roo
|
|
|
22
22
|
...WRAPS.map(wrap => `wrap-xs-${wrap}`),
|
|
23
23
|
// grid sizes for all breakpoints
|
|
24
24
|
...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}`)]);
|
|
25
|
-
var _default = gridClasses;
|
|
26
|
-
exports.default = _default;
|
|
25
|
+
var _default = exports.default = gridClasses;
|
package/borders.js
CHANGED
|
@@ -18,64 +18,54 @@ function borderTransform(value) {
|
|
|
18
18
|
}
|
|
19
19
|
return `${value}px solid`;
|
|
20
20
|
}
|
|
21
|
-
const border = (0, _style.default)({
|
|
21
|
+
const border = exports.border = (0, _style.default)({
|
|
22
22
|
prop: 'border',
|
|
23
23
|
themeKey: 'borders',
|
|
24
24
|
transform: borderTransform
|
|
25
25
|
});
|
|
26
|
-
exports.
|
|
27
|
-
const borderTop = (0, _style.default)({
|
|
26
|
+
const borderTop = exports.borderTop = (0, _style.default)({
|
|
28
27
|
prop: 'borderTop',
|
|
29
28
|
themeKey: 'borders',
|
|
30
29
|
transform: borderTransform
|
|
31
30
|
});
|
|
32
|
-
exports.
|
|
33
|
-
const borderRight = (0, _style.default)({
|
|
31
|
+
const borderRight = exports.borderRight = (0, _style.default)({
|
|
34
32
|
prop: 'borderRight',
|
|
35
33
|
themeKey: 'borders',
|
|
36
34
|
transform: borderTransform
|
|
37
35
|
});
|
|
38
|
-
exports.
|
|
39
|
-
const borderBottom = (0, _style.default)({
|
|
36
|
+
const borderBottom = exports.borderBottom = (0, _style.default)({
|
|
40
37
|
prop: 'borderBottom',
|
|
41
38
|
themeKey: 'borders',
|
|
42
39
|
transform: borderTransform
|
|
43
40
|
});
|
|
44
|
-
exports.
|
|
45
|
-
const borderLeft = (0, _style.default)({
|
|
41
|
+
const borderLeft = exports.borderLeft = (0, _style.default)({
|
|
46
42
|
prop: 'borderLeft',
|
|
47
43
|
themeKey: 'borders',
|
|
48
44
|
transform: borderTransform
|
|
49
45
|
});
|
|
50
|
-
exports.
|
|
51
|
-
const borderColor = (0, _style.default)({
|
|
46
|
+
const borderColor = exports.borderColor = (0, _style.default)({
|
|
52
47
|
prop: 'borderColor',
|
|
53
48
|
themeKey: 'palette'
|
|
54
49
|
});
|
|
55
|
-
exports.
|
|
56
|
-
const borderTopColor = (0, _style.default)({
|
|
50
|
+
const borderTopColor = exports.borderTopColor = (0, _style.default)({
|
|
57
51
|
prop: 'borderTopColor',
|
|
58
52
|
themeKey: 'palette'
|
|
59
53
|
});
|
|
60
|
-
exports.
|
|
61
|
-
const borderRightColor = (0, _style.default)({
|
|
54
|
+
const borderRightColor = exports.borderRightColor = (0, _style.default)({
|
|
62
55
|
prop: 'borderRightColor',
|
|
63
56
|
themeKey: 'palette'
|
|
64
57
|
});
|
|
65
|
-
exports.
|
|
66
|
-
const borderBottomColor = (0, _style.default)({
|
|
58
|
+
const borderBottomColor = exports.borderBottomColor = (0, _style.default)({
|
|
67
59
|
prop: 'borderBottomColor',
|
|
68
60
|
themeKey: 'palette'
|
|
69
61
|
});
|
|
70
|
-
exports.
|
|
71
|
-
const borderLeftColor = (0, _style.default)({
|
|
62
|
+
const borderLeftColor = exports.borderLeftColor = (0, _style.default)({
|
|
72
63
|
prop: 'borderLeftColor',
|
|
73
64
|
themeKey: 'palette'
|
|
74
65
|
});
|
|
75
66
|
|
|
76
67
|
// false positive
|
|
77
68
|
// eslint-disable-next-line react/function-component-definition
|
|
78
|
-
exports.borderLeftColor = borderLeftColor;
|
|
79
69
|
const borderRadius = props => {
|
|
80
70
|
if (props.borderRadius !== undefined && props.borderRadius !== null) {
|
|
81
71
|
const transformer = (0, _spacing.createUnaryUnit)(props.theme, 'shape.borderRadius', 4, 'borderRadius');
|
|
@@ -92,5 +82,4 @@ borderRadius.propTypes = process.env.NODE_ENV !== 'production' ? {
|
|
|
92
82
|
} : {};
|
|
93
83
|
borderRadius.filterProps = ['borderRadius'];
|
|
94
84
|
const borders = (0, _compose.default)(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius);
|
|
95
|
-
var _default = borders;
|
|
96
|
-
exports.default = _default;
|
|
85
|
+
var _default = exports.default = borders;
|
package/breakpoints.js
CHANGED
|
@@ -18,7 +18,7 @@ var _utils = require("@mui/utils");
|
|
|
18
18
|
var _merge = _interopRequireDefault(require("./merge"));
|
|
19
19
|
// The breakpoint **start** at this value.
|
|
20
20
|
// For instance with the first breakpoint xs: [xs, sm[.
|
|
21
|
-
const values = {
|
|
21
|
+
const values = exports.values = {
|
|
22
22
|
xs: 0,
|
|
23
23
|
// phone
|
|
24
24
|
sm: 600,
|
|
@@ -29,7 +29,7 @@ const values = {
|
|
|
29
29
|
// desktop
|
|
30
30
|
xl: 1536 // large screen
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
const defaultBreakpoints = {
|
|
34
34
|
// Sorted ASC by size. That's important.
|
|
35
35
|
// It can't be configured as it's used statically for propTypes.
|
|
@@ -164,5 +164,4 @@ function resolveBreakpointValues({
|
|
|
164
164
|
return acc;
|
|
165
165
|
}, {});
|
|
166
166
|
}
|
|
167
|
-
var _default = breakpoints;
|
|
168
|
-
exports.default = _default;
|
|
167
|
+
var _default = exports.default = breakpoints;
|
package/compose.js
CHANGED
package/createStyled.js
CHANGED
|
@@ -36,47 +36,54 @@ const getStyleOverrides = (name, theme) => {
|
|
|
36
36
|
}
|
|
37
37
|
return null;
|
|
38
38
|
};
|
|
39
|
+
const transformVariants = variants => {
|
|
40
|
+
const variantsStyles = {};
|
|
41
|
+
if (variants) {
|
|
42
|
+
variants.forEach(definition => {
|
|
43
|
+
const key = (0, _propsToClassKey.default)(definition.props);
|
|
44
|
+
variantsStyles[key] = definition.style;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return variantsStyles;
|
|
48
|
+
};
|
|
39
49
|
const getVariantStyles = (name, theme) => {
|
|
40
50
|
let variants = [];
|
|
41
51
|
if (theme && theme.components && theme.components[name] && theme.components[name].variants) {
|
|
42
52
|
variants = theme.components[name].variants;
|
|
43
53
|
}
|
|
44
|
-
|
|
45
|
-
variants.forEach(definition => {
|
|
46
|
-
const key = (0, _propsToClassKey.default)(definition.props);
|
|
47
|
-
variantsStyles[key] = definition.style;
|
|
48
|
-
});
|
|
49
|
-
return variantsStyles;
|
|
54
|
+
return transformVariants(variants);
|
|
50
55
|
};
|
|
51
|
-
const variantsResolver = (props, styles,
|
|
52
|
-
var _theme$components;
|
|
56
|
+
const variantsResolver = (props, styles, variants) => {
|
|
53
57
|
const {
|
|
54
58
|
ownerState = {}
|
|
55
59
|
} = props;
|
|
56
60
|
const variantsStyles = [];
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
themeVariants.forEach(themeVariant => {
|
|
61
|
+
if (variants) {
|
|
62
|
+
variants.forEach(variant => {
|
|
60
63
|
let isMatch = true;
|
|
61
|
-
Object.keys(
|
|
62
|
-
if (ownerState[key] !==
|
|
64
|
+
Object.keys(variant.props).forEach(key => {
|
|
65
|
+
if (ownerState[key] !== variant.props[key] && props[key] !== variant.props[key]) {
|
|
63
66
|
isMatch = false;
|
|
64
67
|
}
|
|
65
68
|
});
|
|
66
69
|
if (isMatch) {
|
|
67
|
-
variantsStyles.push(styles[(0, _propsToClassKey.default)(
|
|
70
|
+
variantsStyles.push(styles[(0, _propsToClassKey.default)(variant.props)]);
|
|
68
71
|
}
|
|
69
72
|
});
|
|
70
73
|
}
|
|
71
74
|
return variantsStyles;
|
|
72
75
|
};
|
|
76
|
+
const themeVariantsResolver = (props, styles, theme, name) => {
|
|
77
|
+
var _theme$components;
|
|
78
|
+
const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[name]) == null ? void 0 : _theme$components.variants;
|
|
79
|
+
return variantsResolver(props, styles, themeVariants);
|
|
80
|
+
};
|
|
73
81
|
|
|
74
82
|
// Update /system/styled/#api in case if this changes
|
|
75
83
|
function shouldForwardProp(prop) {
|
|
76
84
|
return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';
|
|
77
85
|
}
|
|
78
|
-
const systemDefaultTheme = (0, _createTheme.default)();
|
|
79
|
-
exports.systemDefaultTheme = systemDefaultTheme;
|
|
86
|
+
const systemDefaultTheme = exports.systemDefaultTheme = (0, _createTheme.default)();
|
|
80
87
|
const lowercaseFirstLetter = string => {
|
|
81
88
|
if (!string) {
|
|
82
89
|
return string;
|
|
@@ -96,6 +103,29 @@ function defaultOverridesResolver(slot) {
|
|
|
96
103
|
}
|
|
97
104
|
return (props, styles) => styles[slot];
|
|
98
105
|
}
|
|
106
|
+
const muiStyledFunctionResolver = ({
|
|
107
|
+
styledArg,
|
|
108
|
+
props,
|
|
109
|
+
defaultTheme,
|
|
110
|
+
themeId
|
|
111
|
+
}) => {
|
|
112
|
+
const resolvedStyles = styledArg((0, _extends2.default)({}, props, {
|
|
113
|
+
theme: resolveTheme((0, _extends2.default)({}, props, {
|
|
114
|
+
defaultTheme,
|
|
115
|
+
themeId
|
|
116
|
+
}))
|
|
117
|
+
}));
|
|
118
|
+
let optionalVariants;
|
|
119
|
+
if (resolvedStyles && resolvedStyles.variants) {
|
|
120
|
+
optionalVariants = resolvedStyles.variants;
|
|
121
|
+
delete resolvedStyles.variants;
|
|
122
|
+
}
|
|
123
|
+
if (optionalVariants) {
|
|
124
|
+
const variantsStyles = variantsResolver(props, transformVariants(optionalVariants), optionalVariants);
|
|
125
|
+
return [resolvedStyles, ...variantsStyles];
|
|
126
|
+
}
|
|
127
|
+
return resolvedStyles;
|
|
128
|
+
};
|
|
99
129
|
function createStyled(input = {}) {
|
|
100
130
|
const {
|
|
101
131
|
themeId,
|
|
@@ -162,16 +192,61 @@ function createStyled(input = {}) {
|
|
|
162
192
|
// On the server Emotion doesn't use React.forwardRef for creating components, so the created
|
|
163
193
|
// component stays as a function. This condition makes sure that we do not interpolate functions
|
|
164
194
|
// which are basically components used as a selectors.
|
|
165
|
-
|
|
166
|
-
return
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
})
|
|
172
|
-
}
|
|
195
|
+
if (typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg) {
|
|
196
|
+
return props => muiStyledFunctionResolver({
|
|
197
|
+
styledArg: stylesArg,
|
|
198
|
+
props,
|
|
199
|
+
defaultTheme,
|
|
200
|
+
themeId
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
if ((0, _utils.isPlainObject)(stylesArg)) {
|
|
204
|
+
let transformedStylesArg = stylesArg;
|
|
205
|
+
let styledArgVariants;
|
|
206
|
+
if (stylesArg && stylesArg.variants) {
|
|
207
|
+
styledArgVariants = stylesArg.variants;
|
|
208
|
+
delete transformedStylesArg.variants;
|
|
209
|
+
transformedStylesArg = props => {
|
|
210
|
+
let result = stylesArg;
|
|
211
|
+
const variantStyles = variantsResolver(props, transformVariants(styledArgVariants), styledArgVariants);
|
|
212
|
+
variantStyles.forEach(variantStyle => {
|
|
213
|
+
result = (0, _utils.deepmerge)(result, variantStyle);
|
|
214
|
+
});
|
|
215
|
+
return result;
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
return transformedStylesArg;
|
|
219
|
+
}
|
|
220
|
+
return stylesArg;
|
|
173
221
|
}) : [];
|
|
174
222
|
let transformedStyleArg = styleArg;
|
|
223
|
+
if ((0, _utils.isPlainObject)(styleArg)) {
|
|
224
|
+
let styledArgVariants;
|
|
225
|
+
if (styleArg && styleArg.variants) {
|
|
226
|
+
styledArgVariants = styleArg.variants;
|
|
227
|
+
delete transformedStyleArg.variants;
|
|
228
|
+
transformedStyleArg = props => {
|
|
229
|
+
let result = styleArg;
|
|
230
|
+
const variantStyles = variantsResolver(props, transformVariants(styledArgVariants), styledArgVariants);
|
|
231
|
+
variantStyles.forEach(variantStyle => {
|
|
232
|
+
result = (0, _utils.deepmerge)(result, variantStyle);
|
|
233
|
+
});
|
|
234
|
+
return result;
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
} else if (typeof styleArg === 'function' &&
|
|
238
|
+
// On the server Emotion doesn't use React.forwardRef for creating components, so the created
|
|
239
|
+
// component stays as a function. This condition makes sure that we do not interpolate functions
|
|
240
|
+
// which are basically components used as a selectors.
|
|
241
|
+
styleArg.__emotion_real !== styleArg) {
|
|
242
|
+
// If the type is function, we need to define the default theme.
|
|
243
|
+
transformedStyleArg = props => muiStyledFunctionResolver({
|
|
244
|
+
styledArg: styleArg,
|
|
245
|
+
props,
|
|
246
|
+
defaultTheme,
|
|
247
|
+
themeId
|
|
248
|
+
});
|
|
249
|
+
}
|
|
175
250
|
if (componentName && overridesResolver) {
|
|
176
251
|
expressionsWithDefaultTheme.push(props => {
|
|
177
252
|
const theme = resolveTheme((0, _extends2.default)({}, props, {
|
|
@@ -197,7 +272,7 @@ function createStyled(input = {}) {
|
|
|
197
272
|
defaultTheme,
|
|
198
273
|
themeId
|
|
199
274
|
}));
|
|
200
|
-
return
|
|
275
|
+
return themeVariantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);
|
|
201
276
|
});
|
|
202
277
|
}
|
|
203
278
|
if (!skipSx) {
|
|
@@ -209,18 +284,6 @@ function createStyled(input = {}) {
|
|
|
209
284
|
// If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.
|
|
210
285
|
transformedStyleArg = [...styleArg, ...placeholders];
|
|
211
286
|
transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
|
|
212
|
-
} else if (typeof styleArg === 'function' &&
|
|
213
|
-
// On the server Emotion doesn't use React.forwardRef for creating components, so the created
|
|
214
|
-
// component stays as a function. This condition makes sure that we do not interpolate functions
|
|
215
|
-
// which are basically components used as a selectors.
|
|
216
|
-
styleArg.__emotion_real !== styleArg) {
|
|
217
|
-
// If the type is function, we need to define the default theme.
|
|
218
|
-
transformedStyleArg = props => styleArg((0, _extends2.default)({}, props, {
|
|
219
|
-
theme: resolveTheme((0, _extends2.default)({}, props, {
|
|
220
|
-
defaultTheme,
|
|
221
|
-
themeId
|
|
222
|
-
}))
|
|
223
|
-
}));
|
|
224
287
|
}
|
|
225
288
|
const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);
|
|
226
289
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -11,8 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
const _excluded = ["values", "unit", "step"];
|
|
12
12
|
// Sorted ASC by size. That's important.
|
|
13
13
|
// It can't be configured as it's used statically for propTypes.
|
|
14
|
-
const breakpointKeys = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
15
|
-
exports.breakpointKeys = breakpointKeys;
|
|
14
|
+
const breakpointKeys = exports.breakpointKeys = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
16
15
|
const sortBreakpointsValues = values => {
|
|
17
16
|
const breakpointsAsArray = Object.keys(values).map(key => ({
|
|
18
17
|
key,
|
package/createTheme/shape.js
CHANGED
package/cssGrid.js
CHANGED
|
@@ -63,42 +63,32 @@ rowGap.propTypes = process.env.NODE_ENV !== 'production' ? {
|
|
|
63
63
|
rowGap: _responsivePropType.default
|
|
64
64
|
} : {};
|
|
65
65
|
rowGap.filterProps = ['rowGap'];
|
|
66
|
-
const gridColumn = (0, _style.default)({
|
|
66
|
+
const gridColumn = exports.gridColumn = (0, _style.default)({
|
|
67
67
|
prop: 'gridColumn'
|
|
68
68
|
});
|
|
69
|
-
exports.
|
|
70
|
-
const gridRow = (0, _style.default)({
|
|
69
|
+
const gridRow = exports.gridRow = (0, _style.default)({
|
|
71
70
|
prop: 'gridRow'
|
|
72
71
|
});
|
|
73
|
-
exports.
|
|
74
|
-
const gridAutoFlow = (0, _style.default)({
|
|
72
|
+
const gridAutoFlow = exports.gridAutoFlow = (0, _style.default)({
|
|
75
73
|
prop: 'gridAutoFlow'
|
|
76
74
|
});
|
|
77
|
-
exports.
|
|
78
|
-
const gridAutoColumns = (0, _style.default)({
|
|
75
|
+
const gridAutoColumns = exports.gridAutoColumns = (0, _style.default)({
|
|
79
76
|
prop: 'gridAutoColumns'
|
|
80
77
|
});
|
|
81
|
-
exports.
|
|
82
|
-
const gridAutoRows = (0, _style.default)({
|
|
78
|
+
const gridAutoRows = exports.gridAutoRows = (0, _style.default)({
|
|
83
79
|
prop: 'gridAutoRows'
|
|
84
80
|
});
|
|
85
|
-
exports.
|
|
86
|
-
const gridTemplateColumns = (0, _style.default)({
|
|
81
|
+
const gridTemplateColumns = exports.gridTemplateColumns = (0, _style.default)({
|
|
87
82
|
prop: 'gridTemplateColumns'
|
|
88
83
|
});
|
|
89
|
-
exports.
|
|
90
|
-
const gridTemplateRows = (0, _style.default)({
|
|
84
|
+
const gridTemplateRows = exports.gridTemplateRows = (0, _style.default)({
|
|
91
85
|
prop: 'gridTemplateRows'
|
|
92
86
|
});
|
|
93
|
-
exports.
|
|
94
|
-
const gridTemplateAreas = (0, _style.default)({
|
|
87
|
+
const gridTemplateAreas = exports.gridTemplateAreas = (0, _style.default)({
|
|
95
88
|
prop: 'gridTemplateAreas'
|
|
96
89
|
});
|
|
97
|
-
exports.
|
|
98
|
-
const gridArea = (0, _style.default)({
|
|
90
|
+
const gridArea = exports.gridArea = (0, _style.default)({
|
|
99
91
|
prop: 'gridArea'
|
|
100
92
|
});
|
|
101
|
-
exports.gridArea = gridArea;
|
|
102
93
|
const grid = (0, _compose.default)(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);
|
|
103
|
-
var _default = grid;
|
|
104
|
-
exports.default = _default;
|
|
94
|
+
var _default = exports.default = grid;
|
|
@@ -20,8 +20,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
20
20
|
const _excluded = ["colorSchemes", "components", "generateCssVars", "cssVarPrefix"];
|
|
21
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
const DISABLE_CSS_TRANSITION = '*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}';
|
|
24
|
-
exports.DISABLE_CSS_TRANSITION = DISABLE_CSS_TRANSITION;
|
|
23
|
+
const DISABLE_CSS_TRANSITION = exports.DISABLE_CSS_TRANSITION = '*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}';
|
|
25
24
|
function createCssVarsProvider(options) {
|
|
26
25
|
const {
|
|
27
26
|
themeId,
|
|
@@ -9,12 +9,9 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
-
const DEFAULT_MODE_STORAGE_KEY = 'mode';
|
|
13
|
-
exports.
|
|
14
|
-
const
|
|
15
|
-
exports.DEFAULT_COLOR_SCHEME_STORAGE_KEY = DEFAULT_COLOR_SCHEME_STORAGE_KEY;
|
|
16
|
-
const DEFAULT_ATTRIBUTE = 'data-color-scheme';
|
|
17
|
-
exports.DEFAULT_ATTRIBUTE = DEFAULT_ATTRIBUTE;
|
|
12
|
+
const DEFAULT_MODE_STORAGE_KEY = exports.DEFAULT_MODE_STORAGE_KEY = 'mode';
|
|
13
|
+
const DEFAULT_COLOR_SCHEME_STORAGE_KEY = exports.DEFAULT_COLOR_SCHEME_STORAGE_KEY = 'color-scheme';
|
|
14
|
+
const DEFAULT_ATTRIBUTE = exports.DEFAULT_ATTRIBUTE = 'data-color-scheme';
|
|
18
15
|
function getInitColorSchemeScript(options) {
|
|
19
16
|
const {
|
|
20
17
|
defaultMode = 'light',
|