@mui/codemod 6.0.0-alpha.6 → 6.0.0-alpha.8
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/README.md +125 -0
- package/node/deprecations/accordion-props/test-cases/actual.js +6 -3
- package/node/deprecations/accordion-props/test-cases/expected.js +14 -10
- package/node/deprecations/accordion-props/test-cases/theme.expected.js +8 -7
- package/node/deprecations/alert-props/test-cases/expected.js +12 -4
- package/node/deprecations/alert-props/test-cases/theme.expected.js +12 -5
- package/node/deprecations/all/deprecations-all.js +6 -0
- package/node/deprecations/all/postcss.config.js +4 -1
- package/node/deprecations/autocomplete-props/autocomplete-props.js +54 -0
- package/node/deprecations/autocomplete-props/index.js +13 -0
- package/node/deprecations/autocomplete-props/test-cases/actual.js +97 -0
- package/node/deprecations/autocomplete-props/test-cases/expected.js +103 -0
- package/node/deprecations/autocomplete-props/test-cases/theme.actual.js +65 -0
- package/node/deprecations/autocomplete-props/test-cases/theme.expected.js +69 -0
- package/node/deprecations/avatar-props/test-cases/expected.js +8 -6
- package/node/deprecations/avatar-props/test-cases/theme.expected.js +8 -7
- package/node/deprecations/backdrop-props/test-cases/actual.js +3 -2
- package/node/deprecations/backdrop-props/test-cases/expected.js +3 -3
- package/node/deprecations/badge-props/test-cases/expected.js +12 -5
- package/node/deprecations/badge-props/test-cases/theme.expected.js +12 -5
- package/node/deprecations/circular-progress-classes/circular-progress-classes.js +77 -0
- package/node/deprecations/circular-progress-classes/index.js +13 -0
- package/node/deprecations/circular-progress-classes/postcss-plugin.js +33 -0
- package/node/deprecations/circular-progress-classes/postcss.config.js +8 -0
- package/node/deprecations/circular-progress-classes/test-cases/actual.js +7 -0
- package/node/deprecations/circular-progress-classes/test-cases/expected.js +7 -0
- package/node/deprecations/divider-props/divider-props.js +36 -30
- package/node/deprecations/divider-props/test-cases/actual.js +3 -0
- package/node/deprecations/divider-props/test-cases/expected.js +3 -0
- package/node/deprecations/divider-props/test-cases/theme.actual.js +7 -0
- package/node/deprecations/divider-props/test-cases/theme.expected.js +7 -0
- package/node/deprecations/form-control-label-props/test-cases/expected.js +4 -2
- package/node/deprecations/form-control-label-props/test-cases/theme.expected.js +4 -3
- package/node/deprecations/slider-props/test-cases/expected.js +12 -4
- package/node/deprecations/slider-props/test-cases/theme.expected.js +12 -5
- package/node/deprecations/speed-dial-props/test-cases/actual.js +3 -2
- package/node/deprecations/speed-dial-props/test-cases/expected.js +3 -3
- package/node/deprecations/step-label-props/test-cases/expected.js +8 -3
- package/node/deprecations/step-label-props/test-cases/theme.expected.js +8 -4
- package/node/deprecations/text-field-props/index.js +13 -0
- package/node/deprecations/text-field-props/test-cases/actual.js +27 -0
- package/node/deprecations/text-field-props/test-cases/expected.js +31 -0
- package/node/deprecations/text-field-props/test-cases/theme.actual.js +13 -0
- package/node/deprecations/text-field-props/test-cases/theme.expected.js +15 -0
- package/node/deprecations/text-field-props/text-field-props.js +48 -0
- package/node/deprecations/utils/replaceComponentsWithSlots.js +29 -17
- package/node/util/migrateToVariants.js +50 -31
- package/node/v5.0.0/badge-overlap-value.test/actual.js +3 -4
- package/node/v5.0.0/badge-overlap-value.test/expected.js +3 -4
- package/node/v5.0.0/base-remove-component-prop.test/actual.js +4 -4
- package/node/v5.0.0/base-remove-component-prop.test/expected.js +4 -4
- package/node/v5.0.0/box-sx-prop.test/actual.js +4 -4
- package/node/v5.0.0/box-sx-prop.test/expected.js +3 -3
- package/node/v5.0.0/create-theme.test/custom-fn.actual.js +3 -4
- package/node/v5.0.0/create-theme.test/custom-fn.expected.js +3 -4
- package/node/v5.0.0/jss-to-styled.test/first.actual.js +11 -14
- package/node/v5.0.0/jss-to-styled.test/first.expected.js +11 -14
- package/node/v5.0.0/jss-to-styled.test/seventh.actual.js +4 -4
- package/node/v5.0.0/jss-to-styled.test/seventh.expected.js +4 -4
- package/node/v5.0.0/jss-to-styled.test/sixth.actual.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/sixth.expected.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles.actual.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles.expected.js +3 -4
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles1.actual.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles1.expected.js +3 -4
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles2.actual.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles2.expected.js +3 -4
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles3.actual.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles3.expected.js +3 -4
- package/node/v5.0.0/jss-to-tss-react.test/actual-mixins-pattern.js +6 -5
- package/node/v5.0.0/jss-to-tss-react.test/expected-mixins-pattern.js +6 -5
- package/node/v5.0.0/preset-safe.test/actual.js +6 -4
- package/node/v5.0.0/preset-safe.test/expected.js +9 -6
- package/node/v5.0.0/table-props.test/actual.js +4 -5
- package/node/v5.0.0/table-props.test/expected.js +4 -5
- package/node/v5.0.0/theme-spacing.test/large-actual.js +10 -10
- package/node/v5.0.0/theme-spacing.test/large-expected.js +10 -10
- package/node/v5.0.0/variant-prop.test/actual.js +12 -6
- package/node/v5.0.0/variant-prop.test/expected.js +15 -12
- package/node/v5.0.0/with-mobile-dialog.test/expected.js +6 -5
- package/node/v5.0.0/with-width.test/expected.js +6 -5
- package/node/v6.0.0/styled/test-cases/BasicStyled.actual.js +55 -44
- package/node/v6.0.0/styled/test-cases/BasicStyled.expected.js +5 -6
- package/node/v6.0.0/styled/test-cases/ConditionalStyled.actual.js +80 -70
- package/node/v6.0.0/styled/test-cases/ConditionalStyled.expected.js +7 -6
- package/node/v6.0.0/styled/test-cases/NestedSpread.actual.js +32 -26
- package/node/v6.0.0/styled/test-cases/NestedSpread.expected.js +7 -6
- package/node/v6.0.0/styled/test-cases/ThemePaletteMode.expected.js +28 -26
- package/node/v6.0.0/styled/test-cases/VariantAndModeStyled.actual.js +6 -5
- package/node/v6.0.0/styled/test-cases/VariantAndModeStyled.expected.js +8 -8
- package/node/v6.0.0/theme-v6/test-cases/basicTheme.actual.js +254 -225
- package/node/v6.0.0/theme-v6/test-cases/basicTheme.expected.js +180 -162
- package/node/v6.0.0/theme-v6/test-cases/themeVariants.actual.js +23 -21
- package/node/v6.0.0/theme-v6/test-cases/themeVariants.expected.js +20 -19
- package/package.json +5 -5
|
@@ -1,42 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
5
3
|
const Component = styled('div')(({
|
|
6
4
|
theme,
|
|
7
5
|
ownerState
|
|
8
6
|
}) => {
|
|
9
7
|
var _palette;
|
|
10
8
|
const palette = (_palette = (theme.vars || theme).palette) == null ? void 0 : _palette[ownerState.color];
|
|
11
|
-
return
|
|
9
|
+
return {
|
|
12
10
|
overflow: 'visible',
|
|
13
11
|
// Explicitly set the default value to solve a bug on IE11.
|
|
14
12
|
color: (theme.vars || theme).palette.action.active,
|
|
15
13
|
transition: theme.transitions.create('background-color', {
|
|
16
14
|
duration: theme.transitions.duration.shortest
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
}, ownerState.edge === 'start' && {
|
|
27
|
-
marginLeft: ownerState.size === 'small' ? -3 : -12
|
|
28
|
-
}, ownerState.edge === 'end' && {
|
|
29
|
-
marginRight: ownerState.size === 'small' ? -3 : -12
|
|
30
|
-
}, ownerState.color !== 'inherit' && ownerState.color !== 'default' && (0, _extends2.default)({
|
|
31
|
-
color: palette == null ? void 0 : palette.main
|
|
32
|
-
}, !ownerState.disableRipple && {
|
|
33
|
-
'&:hover': (0, _extends2.default)({}, palette && {
|
|
34
|
-
backgroundColor: theme.vars ? `rgba(${palette.mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(palette.main, theme.palette.action.hoverOpacity)
|
|
35
|
-
}, {
|
|
36
|
-
// Reset on touch devices, it doesn't add specificity
|
|
37
|
-
'@media (hover: none)': {
|
|
38
|
-
backgroundColor: 'transparent'
|
|
15
|
+
}),
|
|
16
|
+
...(!ownerState.disableRipple && {
|
|
17
|
+
'&:hover': {
|
|
18
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity),
|
|
19
|
+
// Reset on touch devices, it doesn't add specificity
|
|
20
|
+
'@media (hover: none)': {
|
|
21
|
+
backgroundColor: 'transparent'
|
|
22
|
+
}
|
|
39
23
|
}
|
|
24
|
+
}),
|
|
25
|
+
...(ownerState.edge === 'start' && {
|
|
26
|
+
marginLeft: ownerState.size === 'small' ? -3 : -12
|
|
27
|
+
}),
|
|
28
|
+
...(ownerState.edge === 'end' && {
|
|
29
|
+
marginRight: ownerState.size === 'small' ? -3 : -12
|
|
30
|
+
}),
|
|
31
|
+
...(ownerState.color !== 'inherit' && ownerState.color !== 'default' && {
|
|
32
|
+
color: palette == null ? void 0 : palette.main,
|
|
33
|
+
...(!ownerState.disableRipple && {
|
|
34
|
+
'&:hover': {
|
|
35
|
+
// The codemod won't handle this case when the variable is not declared in the style argument.
|
|
36
|
+
// In this case, the `palette` create a new variable in the style argument.
|
|
37
|
+
...(palette && {
|
|
38
|
+
backgroundColor: theme.vars ? `rgba(${palette.mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(palette.main, theme.palette.action.hoverOpacity)
|
|
39
|
+
}),
|
|
40
|
+
// Reset on touch devices, it doesn't add specificity
|
|
41
|
+
'@media (hover: none)': {
|
|
42
|
+
backgroundColor: 'transparent'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
})
|
|
40
46
|
})
|
|
41
|
-
}
|
|
47
|
+
};
|
|
42
48
|
});
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
5
3
|
const Component = styled('div')(({
|
|
6
4
|
theme
|
|
7
5
|
}) => {
|
|
@@ -71,14 +69,17 @@ const Component = styled('div')(({
|
|
|
71
69
|
ownerState
|
|
72
70
|
}) => ownerState.color !== 'inherit' && ownerState.color !== 'default' && !ownerState.disableRipple,
|
|
73
71
|
style: {
|
|
74
|
-
'&:hover':
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
'&:hover': {
|
|
73
|
+
// The codemod won't handle this case when the variable is not declared in the style argument.
|
|
74
|
+
// In this case, the `palette` create a new variable in the style argument.
|
|
75
|
+
...(palette && {
|
|
76
|
+
backgroundColor: theme.vars ? `rgba(${palette.mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(palette.main, theme.palette.action.hoverOpacity)
|
|
77
|
+
}),
|
|
77
78
|
// Reset on touch devices, it doesn't add specificity
|
|
78
79
|
'@media (hover: none)': {
|
|
79
80
|
backgroundColor: 'transparent'
|
|
80
81
|
}
|
|
81
|
-
}
|
|
82
|
+
}
|
|
82
83
|
}
|
|
83
84
|
}]
|
|
84
85
|
};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
5
3
|
const Test = styled('div')(({
|
|
6
4
|
theme
|
|
7
|
-
}) => (
|
|
5
|
+
}) => ({
|
|
8
6
|
color: theme.palette.primary.main,
|
|
9
|
-
background: `linear-gradient(45deg, ${theme.palette.primary[600]} 30%, ${theme.palette.primary[500]} 90%})
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})
|
|
7
|
+
background: `linear-gradient(45deg, ${theme.palette.primary[600]} 30%, ${theme.palette.primary[500]} 90%})`,
|
|
8
|
+
...theme.applyStyles("dark", {
|
|
9
|
+
color: theme.palette.primary.light,
|
|
10
|
+
background: `linear-gradient(45deg, ${theme.palette.primary[400]} 30%, ${theme.palette.primary[200]} 90%})`
|
|
11
|
+
})
|
|
12
|
+
}));
|
|
14
13
|
const StyledPopper = styled(Popper)(({
|
|
15
14
|
theme
|
|
16
|
-
}) => (
|
|
15
|
+
}) => ({
|
|
17
16
|
border: `1px solid ${'#30363d'}`,
|
|
18
17
|
boxShadow: `0 8px 24px ${'rgb(1, 4, 9)'}`,
|
|
19
18
|
borderRadius: 6,
|
|
@@ -21,13 +20,14 @@ const StyledPopper = styled(Popper)(({
|
|
|
21
20
|
zIndex: theme.zIndex.modal,
|
|
22
21
|
fontSize: 13,
|
|
23
22
|
color: '#c9d1d9',
|
|
24
|
-
backgroundColor: '#1c2128'
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
})
|
|
23
|
+
backgroundColor: '#1c2128',
|
|
24
|
+
...theme.applyStyles("light", {
|
|
25
|
+
border: `1px solid ${'#e1e4e8'}`,
|
|
26
|
+
boxShadow: `0 8px 24px ${'rgba(149, 157, 165, 0.2)'}`,
|
|
27
|
+
color: '#24292e',
|
|
28
|
+
backgroundColor: '#fff'
|
|
29
|
+
})
|
|
30
|
+
}));
|
|
31
31
|
const AntSwitch = styled(Switch)(({
|
|
32
32
|
theme
|
|
33
33
|
}) => ({
|
|
@@ -48,12 +48,13 @@ const AntSwitch = styled(Switch)(({
|
|
|
48
48
|
'&.Mui-checked': {
|
|
49
49
|
transform: 'translateX(12px)',
|
|
50
50
|
color: '#fff',
|
|
51
|
-
'& + .MuiSwitch-track':
|
|
51
|
+
'& + .MuiSwitch-track': {
|
|
52
52
|
opacity: 1,
|
|
53
|
-
backgroundColor: '#1890ff'
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
backgroundColor: '#1890ff',
|
|
54
|
+
...theme.applyStyles("dark", {
|
|
55
|
+
backgroundColor: '#177ddc'
|
|
56
|
+
})
|
|
57
|
+
}
|
|
57
58
|
}
|
|
58
59
|
},
|
|
59
60
|
'& .MuiSwitch-thumb': {
|
|
@@ -65,12 +66,13 @@ const AntSwitch = styled(Switch)(({
|
|
|
65
66
|
duration: 200
|
|
66
67
|
})
|
|
67
68
|
},
|
|
68
|
-
'& .MuiSwitch-track':
|
|
69
|
+
'& .MuiSwitch-track': {
|
|
69
70
|
borderRadius: 16 / 2,
|
|
70
71
|
opacity: 1,
|
|
71
72
|
backgroundColor: 'rgba(0,0,0,.25)',
|
|
72
|
-
boxSizing: 'border-box'
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
boxSizing: 'border-box',
|
|
74
|
+
...theme.applyStyles("dark", {
|
|
75
|
+
backgroundColor: 'rgba(255,255,255,.35)'
|
|
76
|
+
})
|
|
77
|
+
}
|
|
76
78
|
}));
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
5
3
|
const Component = styled.div(({
|
|
6
4
|
theme,
|
|
7
5
|
ownerState
|
|
8
|
-
}) => (
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
}) => ({
|
|
7
|
+
...theme.typography.caption,
|
|
8
|
+
...(ownerState.size === 'small' && {
|
|
9
|
+
marginTop: (theme.vars || theme).spacing(1),
|
|
10
|
+
color: theme.palette.mode === 'dark' ? theme.palette.primary.light : theme.palette.primary.main
|
|
11
|
+
})
|
|
11
12
|
}));
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
5
3
|
const Component = styled.div(({
|
|
6
4
|
theme
|
|
7
|
-
}) => (
|
|
5
|
+
}) => ({
|
|
6
|
+
...theme.typography.caption,
|
|
8
7
|
variants: [{
|
|
9
8
|
props: {
|
|
10
9
|
size: 'small'
|
|
11
10
|
},
|
|
12
|
-
style:
|
|
11
|
+
style: {
|
|
13
12
|
marginTop: (theme.vars || theme).spacing(1),
|
|
14
|
-
color: theme.palette.primary.main
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
color: theme.palette.primary.main,
|
|
14
|
+
...theme.applyStyles("dark", {
|
|
15
|
+
color: theme.palette.primary.light
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
18
|
}]
|
|
19
19
|
}));
|