@mui/codemod 6.0.0-alpha.10 → 6.0.0-alpha.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.
Files changed (33) hide show
  1. package/README.md +255 -180
  2. package/codemod.js +0 -2
  3. package/node/deprecations/all/deprecations-all.js +4 -0
  4. package/node/deprecations/all/postcss.config.js +7 -1
  5. package/node/deprecations/tab-classes/index.js +13 -0
  6. package/node/deprecations/tab-classes/postcss-plugin.js +30 -0
  7. package/node/deprecations/tab-classes/postcss.config.js +8 -0
  8. package/node/deprecations/tab-classes/tab-classes.js +53 -0
  9. package/node/deprecations/tab-classes/test-cases/actual.js +5 -0
  10. package/node/deprecations/tab-classes/test-cases/expected.js +5 -0
  11. package/node/deprecations/table-sort-label-classes/index.js +13 -0
  12. package/node/deprecations/table-sort-label-classes/postcss-plugin.js +33 -0
  13. package/node/deprecations/table-sort-label-classes/postcss.config.js +8 -0
  14. package/node/deprecations/table-sort-label-classes/table-sort-label-classes.js +77 -0
  15. package/node/deprecations/table-sort-label-classes/test-cases/actual.js +7 -0
  16. package/node/deprecations/table-sort-label-classes/test-cases/expected.js +7 -0
  17. package/node/util/migrateToVariants.js +91 -43
  18. package/node/v6.0.0/styled/test-cases/ConditionalStyled.expected.js +9 -22
  19. package/node/v6.0.0/styled/test-cases/DynamicPropsStyled.actual.js +39 -0
  20. package/node/v6.0.0/styled/test-cases/DynamicPropsStyled.expected.js +65 -0
  21. package/node/v6.0.0/styled/test-cases/LogicalStyled.actual.js +31 -1
  22. package/node/v6.0.0/styled/test-cases/LogicalStyled.expected.js +39 -1
  23. package/node/v6.0.0/styled/test-cases/NestedSpread.expected.js +11 -13
  24. package/node/v6.0.0/sx-prop/sx-v6.js +80 -30
  25. package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.actual.js +14 -0
  26. package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.expected.js +33 -16
  27. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.actual.js +21 -1
  28. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.expected.js +19 -1
  29. package/node/v6.0.0/sx-prop/test-cases/sx-line-break.actual.js +69 -0
  30. package/node/v6.0.0/sx-prop/test-cases/sx-line-break.expected.js +69 -0
  31. package/node/v6.0.0/sx-prop/test-cases/sx-value-callback.actual.js +102 -0
  32. package/node/v6.0.0/sx-prop/test-cases/sx-value-callback.expected.js +111 -0
  33. package/package.json +5 -5
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = EnableColorOnDarkAppBar;
8
+ var React = _interopRequireWildcard(require("react"));
9
+ var _AppBar = _interopRequireDefault(require("@mui/material/AppBar"));
10
+ var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
11
+ var _Toolbar = _interopRequireDefault(require("@mui/material/Toolbar"));
12
+ var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
13
+ var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
14
+ var _Menu = _interopRequireDefault(require("@mui/icons-material/Menu"));
15
+ var _styles = require("@mui/material/styles");
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+ var _MenuIcon;
18
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
19
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
+ function appBarLabel(label) {
21
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Toolbar.default, {
22
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
23
+ edge: "start",
24
+ color: "inherit",
25
+ "aria-label": "menu",
26
+ sx: {
27
+ mr: 2
28
+ },
29
+ children: _MenuIcon || (_MenuIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {}))
30
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
31
+ variant: "h6",
32
+ noWrap: true,
33
+ component: "div",
34
+ sx: {
35
+ flexGrow: 1
36
+ },
37
+ children: label
38
+ })]
39
+ });
40
+ }
41
+ const darkTheme = (0, _styles.createTheme)({
42
+ palette: {
43
+ mode: 'dark',
44
+ primary: {
45
+ main: '#1976d2'
46
+ }
47
+ }
48
+ });
49
+ function EnableColorOnDarkAppBar() {
50
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Stack.default, {
51
+ spacing: 2,
52
+ sx: {
53
+ flexGrow: 1
54
+ },
55
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ThemeProvider, {
56
+ theme: darkTheme,
57
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_AppBar.default, {
58
+ position: "static",
59
+ color: "primary",
60
+ enableColorOnDark: true,
61
+ children: appBarLabel('enableColorOnDark')
62
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_AppBar.default, {
63
+ position: "static",
64
+ color: "primary",
65
+ children: appBarLabel('default')
66
+ })]
67
+ })
68
+ });
69
+ }
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+
3
+ var _jsxRuntime = require("react/jsx-runtime");
4
+ function FacebookCircularProgress(props) {
5
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Box, {
6
+ sx: {
7
+ position: 'relative'
8
+ },
9
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(CircularProgress, {
10
+ variant: "determinate",
11
+ sx: {
12
+ color: theme => theme.palette.grey[theme.palette.mode === 'light' ? 200 : 800]
13
+ },
14
+ size: 40,
15
+ thickness: 4,
16
+ ...props,
17
+ value: 100
18
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(CircularProgress, {
19
+ variant: "indeterminate",
20
+ disableShrink: true,
21
+ sx: {
22
+ color: theme => theme.palette.mode === 'light' ? '#1a90ff' : '#308fe8',
23
+ animationDuration: '550ms',
24
+ position: 'absolute',
25
+ left: 0,
26
+ [`& .${circularProgressClasses.circle}`]: {
27
+ strokeLinecap: 'round'
28
+ }
29
+ },
30
+ size: 40,
31
+ thickness: 4,
32
+ ...props
33
+ })]
34
+ });
35
+ }
36
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Paper, {
37
+ elevation: 0,
38
+ sx: {
39
+ display: 'flex',
40
+ border: theme => `1px solid ${theme.palette.divider}`,
41
+ flexWrap: 'wrap'
42
+ }
43
+ });
44
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Divider, {
45
+ sx: {
46
+ border: theme => `1px solid ${theme.palette.mode === 'dark' ? '#fff' : '#000'}`
47
+ }
48
+ });
49
+ /*#__PURE__*/(0, _jsxRuntime.jsxs)(Typography, {
50
+ component: "span",
51
+ variant: "subtitle1",
52
+ color: "inherit",
53
+ sx: {
54
+ position: 'relative',
55
+ p: 4,
56
+ pt: 2,
57
+ pb: theme => `calc(${theme.spacing(1)} + 6px)`
58
+ },
59
+ children: [image.title, /*#__PURE__*/(0, _jsxRuntime.jsx)(ImageMarked, {
60
+ className: "MuiImageMarked-root"
61
+ })]
62
+ });
63
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Autocomplete, {
64
+ sx: {
65
+ display: 'inline-block',
66
+ '& input': {
67
+ width: 200,
68
+ bgcolor: 'background.paper',
69
+ color: theme => theme.palette.getContrastText(theme.palette.background.paper)
70
+ }
71
+ },
72
+ id: "custom-input-demo",
73
+ options: options,
74
+ renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
75
+ ref: params.InputProps.ref,
76
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
77
+ type: "text",
78
+ ...params.inputProps
79
+ })
80
+ })
81
+ });
82
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
83
+ sx: {
84
+ position: 'relative',
85
+ width: 400,
86
+ bgcolor: 'background.paper',
87
+ border: '2px solid #000',
88
+ boxShadow: theme => theme.shadows[5],
89
+ p: 4
90
+ }
91
+ });
92
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Backdrop, {
93
+ sx: {
94
+ color: '#fff',
95
+ zIndex: theme => theme.zIndex.drawer + 1
96
+ },
97
+ open: open,
98
+ onClick: handleClose,
99
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CircularProgress, {
100
+ color: "inherit"
101
+ })
102
+ });
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+
3
+ var _jsxRuntime = require("react/jsx-runtime");
4
+ function FacebookCircularProgress(props) {
5
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Box, {
6
+ sx: {
7
+ position: 'relative'
8
+ },
9
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(CircularProgress, {
10
+ variant: "determinate",
11
+ sx: theme => ({
12
+ color: theme.palette.grey[800],
13
+ ...theme.applyStyles("light", {
14
+ color: theme.palette.grey[200]
15
+ })
16
+ }),
17
+ size: 40,
18
+ thickness: 4,
19
+ ...props,
20
+ value: 100
21
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(CircularProgress, {
22
+ variant: "indeterminate",
23
+ disableShrink: true,
24
+ sx: theme => ({
25
+ color: '#308fe8',
26
+ animationDuration: '550ms',
27
+ position: 'absolute',
28
+ left: 0,
29
+ [`& .${circularProgressClasses.circle}`]: {
30
+ strokeLinecap: 'round'
31
+ },
32
+ ...theme.applyStyles("light", {
33
+ color: '#1a90ff'
34
+ })
35
+ }),
36
+ size: 40,
37
+ thickness: 4,
38
+ ...props
39
+ })]
40
+ });
41
+ }
42
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Paper, {
43
+ elevation: 0,
44
+ sx: theme => ({
45
+ display: 'flex',
46
+ border: `1px solid ${theme.palette.divider}`,
47
+ flexWrap: 'wrap'
48
+ })
49
+ });
50
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Divider, {
51
+ sx: theme => ({
52
+ border: `1px solid ${'#000'}`,
53
+ ...theme.applyStyles("dark", {
54
+ border: `1px solid ${'#fff'}`
55
+ })
56
+ })
57
+ });
58
+ /*#__PURE__*/(0, _jsxRuntime.jsxs)(Typography, {
59
+ component: "span",
60
+ variant: "subtitle1",
61
+ color: "inherit",
62
+ sx: theme => ({
63
+ position: 'relative',
64
+ p: 4,
65
+ pt: 2,
66
+ pb: `calc(${theme.spacing(1)} + 6px)`
67
+ }),
68
+ children: [image.title, /*#__PURE__*/(0, _jsxRuntime.jsx)(ImageMarked, {
69
+ className: "MuiImageMarked-root"
70
+ })]
71
+ });
72
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Autocomplete, {
73
+ sx: theme => ({
74
+ display: 'inline-block',
75
+ '& input': {
76
+ width: 200,
77
+ bgcolor: 'background.paper',
78
+ color: theme.palette.getContrastText(theme.palette.background.paper)
79
+ }
80
+ }),
81
+ id: "custom-input-demo",
82
+ options: options,
83
+ renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
84
+ ref: params.InputProps.ref,
85
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
86
+ type: "text",
87
+ ...params.inputProps
88
+ })
89
+ })
90
+ });
91
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
92
+ sx: theme => ({
93
+ position: 'relative',
94
+ width: 400,
95
+ bgcolor: 'background.paper',
96
+ border: '2px solid #000',
97
+ boxShadow: theme.shadows[5],
98
+ p: 4
99
+ })
100
+ });
101
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Backdrop, {
102
+ sx: theme => ({
103
+ color: '#fff',
104
+ zIndex: theme.zIndex.drawer + 1
105
+ }),
106
+ open: open,
107
+ onClick: handleClose,
108
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CircularProgress, {
109
+ color: "inherit"
110
+ })
111
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/codemod",
3
- "version": "6.0.0-alpha.10",
3
+ "version": "6.0.0-alpha.12",
4
4
  "bin": "./codemod.js",
5
5
  "private": false,
6
6
  "author": "MUI Team",
@@ -24,10 +24,10 @@
24
24
  "url": "https://opencollective.com/mui-org"
25
25
  },
26
26
  "dependencies": {
27
- "@babel/core": "^7.24.6",
28
- "@babel/runtime": "^7.24.6",
29
- "@babel/traverse": "^7.24.6",
30
- "jscodeshift": "^0.15.2",
27
+ "@babel/core": "^7.24.7",
28
+ "@babel/runtime": "^7.24.7",
29
+ "@babel/traverse": "^7.24.7",
30
+ "jscodeshift": "^0.16.0",
31
31
  "jscodeshift-add-imports": "^1.0.10",
32
32
  "postcss": "^8.4.38",
33
33
  "postcss-cli": "^11.0.0",