@mui/codemod 5.7.0 → 5.8.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/README.md +135 -53
- package/node/v5.0.0/jss-to-tss-react.js +460 -0
- package/node/v5.0.0/jss-to-tss-react.test/actual-from-material-ui-core-styles.js +52 -0
- package/node/v5.0.0/jss-to-tss-react.test/actual-from-material-ui-core.js +75 -0
- package/node/v5.0.0/jss-to-tss-react.test/actual-from-mui-styles.js +53 -0
- package/node/v5.0.0/jss-to-tss-react.test/actual-mixins-pattern.js +51 -0
- package/node/v5.0.0/jss-to-tss-react.test/actual-todo-comments.js +82 -0
- package/node/v5.0.0/jss-to-tss-react.test/actual-typescript-docs-example-params.js +59 -0
- package/node/v5.0.0/jss-to-tss-react.test/actual-typescript-docs-example.js +55 -0
- package/node/v5.0.0/jss-to-tss-react.test/actual-typescript.js +73 -0
- package/node/v5.0.0/jss-to-tss-react.test/actual-withStyles.js +123 -0
- package/node/v5.0.0/jss-to-tss-react.test/expected-from-material-ui-core-styles.js +56 -0
- package/node/v5.0.0/jss-to-tss-react.test/expected-from-material-ui-core.js +80 -0
- package/node/v5.0.0/jss-to-tss-react.test/expected-from-mui-styles.js +57 -0
- package/node/v5.0.0/jss-to-tss-react.test/expected-mixins-pattern.js +54 -0
- package/node/v5.0.0/jss-to-tss-react.test/expected-todo-comments.js +96 -0
- package/node/v5.0.0/jss-to-tss-react.test/expected-typescript-docs-example-params.js +61 -0
- package/node/v5.0.0/jss-to-tss-react.test/expected-typescript-docs-example.js +54 -0
- package/node/v5.0.0/jss-to-tss-react.test/expected-typescript.js +79 -0
- package/node/v5.0.0/jss-to-tss-react.test/expected-withStyles.js +124 -0
- package/node/v5.0.0/modal-props.js +1 -1
- package/node/v5.0.0/modal-props.test/expected.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useExportedStyles = exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _mui = require("tss-react/mui");
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var _InnerComponent;
|
|
17
|
+
|
|
18
|
+
// TODO jss-to-tss-react codemod: Unable to handle style definition reliably. ArrowFunctionExpression in CSS prop.
|
|
19
|
+
const useStyles = (0, _mui.makeStyles)()((_theme, _params, classes) => ({
|
|
20
|
+
test: {
|
|
21
|
+
backgroundColor: "purple",
|
|
22
|
+
color: "white",
|
|
23
|
+
[`&.${classes.qualifier}`]: {
|
|
24
|
+
textDecoration: props => props.textDecoration
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
qualifier: {}
|
|
28
|
+
})); // TODO jss-to-tss-react codemod: usages of this hook outside of this file will not be converted.
|
|
29
|
+
|
|
30
|
+
const useExportedStyles = (0, _mui.makeStyles)()({
|
|
31
|
+
test: {
|
|
32
|
+
backgroundColor: "purple",
|
|
33
|
+
color: "white"
|
|
34
|
+
}
|
|
35
|
+
}); // TODO jss-to-tss-react codemod: Unable to handle style definition reliably. Unsupported arrow function syntax.
|
|
36
|
+
// Arrow function has parameter type of Identifier instead of ObjectPattern (e.g. `(props) => ({...})` instead of `({color}) => ({...})`).
|
|
37
|
+
|
|
38
|
+
exports.useExportedStyles = useExportedStyles;
|
|
39
|
+
const useStyles2 = (0, _mui.makeStyles)()({
|
|
40
|
+
test2: props => ({
|
|
41
|
+
backgroundColor: "blue",
|
|
42
|
+
color: "lime"
|
|
43
|
+
})
|
|
44
|
+
}); // TODO jss-to-tss-react codemod: Unable to handle style definition reliably. Unsupported arrow function syntax.
|
|
45
|
+
// Arrow function has body type of BlockStatement instead of ObjectExpression.
|
|
46
|
+
|
|
47
|
+
const useStyles3 = (0, _mui.makeStyles)()({
|
|
48
|
+
test3: props => {
|
|
49
|
+
return {
|
|
50
|
+
backgroundColor: "blue",
|
|
51
|
+
color: "lime"
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}); // TODO jss-to-tss-react codemod: '@global' is not supported by tss-react.
|
|
55
|
+
// See https://mui.com/material-ui/customization/how-to-customize/#4-global-css-override for alternatives.
|
|
56
|
+
|
|
57
|
+
const useGlobalStyles = (0, _mui.makeStyles)()(() => ({
|
|
58
|
+
'@global': {
|
|
59
|
+
'.sample': {
|
|
60
|
+
backgroundColor: "purple",
|
|
61
|
+
color: "white"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}));
|
|
65
|
+
|
|
66
|
+
function InnerComponent() {
|
|
67
|
+
const {
|
|
68
|
+
classes
|
|
69
|
+
} = useStyles2();
|
|
70
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
71
|
+
className: classes.test2,
|
|
72
|
+
children: "Inner Test"
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function ComponentUsingStyles(props) {
|
|
77
|
+
const {
|
|
78
|
+
classes,
|
|
79
|
+
cx
|
|
80
|
+
} = useStyles(props, {
|
|
81
|
+
props: props
|
|
82
|
+
});
|
|
83
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
84
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
85
|
+
className: classes.test,
|
|
86
|
+
children: ["Test", _InnerComponent || (_InnerComponent = /*#__PURE__*/(0, _jsxRuntime.jsx)(InnerComponent, {}))]
|
|
87
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
88
|
+
className: cx(classes.test, classes.qualifier),
|
|
89
|
+
children: "Qualifier Test"
|
|
90
|
+
})]
|
|
91
|
+
});
|
|
92
|
+
} // TODO jss-to-tss-react codemod: usages of this hook outside of this file will not be converted.
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
var _default = useStyles3;
|
|
96
|
+
exports.default = _default;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _mui = require("tss-react/mui");
|
|
9
|
+
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
12
|
+
const useStyles = (0, _mui.makeStyles)({
|
|
13
|
+
name: 'App'
|
|
14
|
+
})((theme, {
|
|
15
|
+
color,
|
|
16
|
+
padding
|
|
17
|
+
}, classes) => ({
|
|
18
|
+
root: {
|
|
19
|
+
padding: padding,
|
|
20
|
+
[`&:hover .${classes.child}`]: {
|
|
21
|
+
backgroundColor: theme.palette[color].main
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
small: {},
|
|
25
|
+
child: {
|
|
26
|
+
border: '1px solid black',
|
|
27
|
+
height: 50,
|
|
28
|
+
[`&.${classes.small}`]: {
|
|
29
|
+
height: 30
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
function App({
|
|
35
|
+
classes: classesProp
|
|
36
|
+
}) {
|
|
37
|
+
const {
|
|
38
|
+
classes,
|
|
39
|
+
cx
|
|
40
|
+
} = useStyles({
|
|
41
|
+
color: 'primary',
|
|
42
|
+
padding: 30
|
|
43
|
+
}, {
|
|
44
|
+
props: {
|
|
45
|
+
classes: classesProp
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
49
|
+
className: classes.root,
|
|
50
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
51
|
+
className: classes.child,
|
|
52
|
+
children: "The Background take the primary theme color when the mouse hovers the parent."
|
|
53
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
54
|
+
className: cx(classes.child, classes.small),
|
|
55
|
+
children: "The Background take the primary theme color when the mouse hovers the parent. I am smaller than the other child."
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
var _default = App;
|
|
61
|
+
exports.default = _default;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _mui = require("tss-react/mui");
|
|
11
|
+
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
const useStyles = (0, _mui.makeStyles)()((theme, _params, classes) => ({
|
|
19
|
+
parent: {
|
|
20
|
+
padding: 30,
|
|
21
|
+
[`&:hover .${classes.child}`]: {
|
|
22
|
+
backgroundColor: 'red'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
small: {},
|
|
26
|
+
child: {
|
|
27
|
+
backgroundColor: 'blue',
|
|
28
|
+
height: 50,
|
|
29
|
+
[`&.${classes.small}`]: {
|
|
30
|
+
backgroundColor: 'lightblue',
|
|
31
|
+
height: 30
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}));
|
|
35
|
+
|
|
36
|
+
function App() {
|
|
37
|
+
const {
|
|
38
|
+
classes,
|
|
39
|
+
cx
|
|
40
|
+
} = useStyles();
|
|
41
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
42
|
+
className: classes.parent,
|
|
43
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
44
|
+
className: classes.child,
|
|
45
|
+
children: "Background turns red when the mouse hovers over the parent."
|
|
46
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
47
|
+
className: cx(classes.child, classes.small),
|
|
48
|
+
children: "Background turns red when the mouse hovers over the parent. I am smaller than the other child."
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
var _default = App;
|
|
54
|
+
exports.default = _default;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MergeClassesNoParams = MergeClassesNoParams;
|
|
7
|
+
exports.default = ComponentUsingStyles;
|
|
8
|
+
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
|
|
11
|
+
var _mui = require("tss-react/mui");
|
|
12
|
+
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
|
|
15
|
+
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); }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
Sandboxes for verifying correct behavior:
|
|
21
|
+
JSS - https://codesandbox.io/s/typescript-case-bt065c?file=/demo.tsx
|
|
22
|
+
TSS - https://codesandbox.io/s/typescript-case-7jwpms?file=/demo.tsx
|
|
23
|
+
*/
|
|
24
|
+
const useStyles = (0, _mui.makeStyles)()((theme, _params, classes) => ({
|
|
25
|
+
test: {
|
|
26
|
+
backgroundColor: "purple",
|
|
27
|
+
color: "white",
|
|
28
|
+
[`& .${classes.test2}`]: {
|
|
29
|
+
backgroundColor: "lime",
|
|
30
|
+
color: "blue"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
test2: {
|
|
34
|
+
backgroundColor: "blue",
|
|
35
|
+
color: "lime"
|
|
36
|
+
}
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
function MergeClassesNoParams({
|
|
40
|
+
classes: classesProp
|
|
41
|
+
}) {
|
|
42
|
+
const {
|
|
43
|
+
classes
|
|
44
|
+
} = useStyles(undefined, {
|
|
45
|
+
props: {
|
|
46
|
+
classes: classesProp
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
50
|
+
className: classes.test,
|
|
51
|
+
children: "Test useStyles without params but with classes prop"
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function InnerComponent({
|
|
56
|
+
classes
|
|
57
|
+
}) {
|
|
58
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
59
|
+
className: classes.test2,
|
|
60
|
+
children: "Inner Test2"
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function ComponentUsingStyles() {
|
|
65
|
+
const {
|
|
66
|
+
classes
|
|
67
|
+
} = useStyles();
|
|
68
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
69
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
70
|
+
className: classes.test,
|
|
71
|
+
children: ["Test", /*#__PURE__*/(0, _jsxRuntime.jsx)(InnerComponent, {
|
|
72
|
+
classes: classes
|
|
73
|
+
})]
|
|
74
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
75
|
+
className: classes.test2,
|
|
76
|
+
children: "Outer Test2"
|
|
77
|
+
})]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = App;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _mui = require("tss-react/mui");
|
|
13
|
+
|
|
14
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
15
|
+
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
18
|
+
var _StyledComp, _StyledComp2, _StyledComp3a, _StyledComp3b, _StyledComp3c;
|
|
19
|
+
|
|
20
|
+
const styles1 = {
|
|
21
|
+
test: {
|
|
22
|
+
backgroundColor: "purple",
|
|
23
|
+
color: "white"
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
function Comp1({
|
|
28
|
+
classes
|
|
29
|
+
}) {
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
31
|
+
className: classes.test,
|
|
32
|
+
children: "Comp1"
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const StyledComp1 = (0, _mui.withStyles)(Comp1, styles1);
|
|
37
|
+
|
|
38
|
+
const styles2 = (_theme, _params, classes) => ({
|
|
39
|
+
test: {
|
|
40
|
+
backgroundColor: "black",
|
|
41
|
+
color: "lime"
|
|
42
|
+
},
|
|
43
|
+
test2: {
|
|
44
|
+
backgroundColor: "white",
|
|
45
|
+
color: "purple",
|
|
46
|
+
[`&.${classes.test}`]: {
|
|
47
|
+
backgroundColor: "pink",
|
|
48
|
+
color: "blue"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
function Comp2({
|
|
54
|
+
classes
|
|
55
|
+
}) {
|
|
56
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
57
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
58
|
+
className: classes.test,
|
|
59
|
+
children: "Comp2 test"
|
|
60
|
+
}), _StyledComp || (_StyledComp = /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledComp1, {})), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
61
|
+
className: classes.test2,
|
|
62
|
+
children: "Comp2 test2"
|
|
63
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
64
|
+
className: (0, _clsx.default)(classes.test, classes.test2),
|
|
65
|
+
children: "Comp2 test and test2"
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const StyledComp2 = (0, _mui.withStyles)(Comp2, styles2);
|
|
71
|
+
|
|
72
|
+
function Comp3({
|
|
73
|
+
classes
|
|
74
|
+
}) {
|
|
75
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
76
|
+
className: classes.test,
|
|
77
|
+
children: ["Inline Styles", /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
78
|
+
className: classes.test2,
|
|
79
|
+
children: "Nested Inline Styles"
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const StyledComp3a = (0, _mui.withStyles)(Comp3, {
|
|
85
|
+
test: {
|
|
86
|
+
backgroundColor: "yellow"
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const StyledComp3b = (0, _mui.withStyles)(Comp3, (_theme, _params, classes) => ({
|
|
90
|
+
test: {
|
|
91
|
+
backgroundColor: "yellow",
|
|
92
|
+
color: "lime",
|
|
93
|
+
[`& .${classes.test2}`]: {
|
|
94
|
+
backgroundColor: "orange"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
test2: {}
|
|
98
|
+
}));
|
|
99
|
+
|
|
100
|
+
const styles3c = (theme, _params, classes) => {
|
|
101
|
+
const bgColor1 = theme.palette.primary.main;
|
|
102
|
+
const color1 = theme.palette.primary.contrastText;
|
|
103
|
+
const bgColor2 = theme.palette.secondary.main;
|
|
104
|
+
const color2 = theme.palette.secondary.contrastText;
|
|
105
|
+
return {
|
|
106
|
+
test: {
|
|
107
|
+
backgroundColor: bgColor1,
|
|
108
|
+
color: color1,
|
|
109
|
+
[`& .${classes.test2}`]: {
|
|
110
|
+
backgroundColor: bgColor2,
|
|
111
|
+
color: color2
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
test2: {}
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const StyledComp3c = (0, _mui.withStyles)(Comp3, styles3c);
|
|
119
|
+
|
|
120
|
+
function App() {
|
|
121
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
122
|
+
children: [_StyledComp2 || (_StyledComp2 = /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledComp2, {})), _StyledComp3a || (_StyledComp3a = /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledComp3a, {})), _StyledComp3b || (_StyledComp3b = /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledComp3b, {})), _StyledComp3c || (_StyledComp3c = /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledComp3c, {}))]
|
|
123
|
+
});
|
|
124
|
+
}
|
|
@@ -34,7 +34,7 @@ function transformer(file, api, options) {
|
|
|
34
34
|
}).toSource(printOptions);
|
|
35
35
|
|
|
36
36
|
if (hasDisableBackdropClick || hasDisableBackdropClick) {
|
|
37
|
-
source = source.replace(/(<Modal)([\s\S]*>)/gm, `$1// You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/
|
|
37
|
+
source = source.replace(/(<Modal)([\s\S]*>)/gm, `$1// You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#modal)${_os.EOL}$2`);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
if (hasDisableBackdropClick) {
|
|
@@ -5,7 +5,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
5
5
|
/*#__PURE__*/
|
|
6
6
|
(0, _jsxRuntime.jsx)(Modal // `handleOnEscapeKeyDown` is removed by codemod.
|
|
7
7
|
// `disableBackdropClick` is removed by codemod.
|
|
8
|
-
// You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/
|
|
8
|
+
// You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#modal)
|
|
9
9
|
, {
|
|
10
10
|
onClose: handleClose
|
|
11
11
|
});
|