@mui/codemod 9.0.0-alpha.4 → 9.0.0

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 (40) hide show
  1. package/CHANGELOG.md +147 -4
  2. package/README.md +399 -147
  3. package/deprecations/all/deprecations-all.js +6 -0
  4. package/deprecations/checkbox-props/checkbox-props.js +33 -0
  5. package/deprecations/checkbox-props/index.js +13 -0
  6. package/deprecations/checkbox-props/test-cases/actual.js +45 -0
  7. package/deprecations/checkbox-props/test-cases/expected.js +61 -0
  8. package/deprecations/checkbox-props/test-cases/package.actual.js +34 -0
  9. package/deprecations/checkbox-props/test-cases/package.expected.js +50 -0
  10. package/deprecations/checkbox-props/test-cases/theme.actual.js +28 -0
  11. package/deprecations/checkbox-props/test-cases/theme.expected.js +36 -0
  12. package/deprecations/dialog-props/dialog-props.js +14 -0
  13. package/deprecations/dialog-props/test-cases/actual.js +4 -0
  14. package/deprecations/dialog-props/test-cases/expected.js +4 -0
  15. package/deprecations/drawer-props/drawer-props.js +14 -0
  16. package/deprecations/drawer-props/test-cases/actual.js +10 -2
  17. package/deprecations/drawer-props/test-cases/expected.js +14 -2
  18. package/deprecations/radio-props/index.js +13 -0
  19. package/deprecations/radio-props/radio-props.js +33 -0
  20. package/deprecations/radio-props/test-cases/actual.js +45 -0
  21. package/deprecations/radio-props/test-cases/expected.js +61 -0
  22. package/deprecations/radio-props/test-cases/package.actual.js +34 -0
  23. package/deprecations/radio-props/test-cases/package.expected.js +50 -0
  24. package/deprecations/radio-props/test-cases/theme.actual.js +28 -0
  25. package/deprecations/radio-props/test-cases/theme.expected.js +36 -0
  26. package/deprecations/switch-props/index.js +13 -0
  27. package/deprecations/switch-props/switch-props.js +33 -0
  28. package/deprecations/switch-props/test-cases/actual.js +45 -0
  29. package/deprecations/switch-props/test-cases/expected.js +61 -0
  30. package/deprecations/switch-props/test-cases/package.actual.js +34 -0
  31. package/deprecations/switch-props/test-cases/package.expected.js +50 -0
  32. package/deprecations/switch-props/test-cases/theme.actual.js +28 -0
  33. package/deprecations/switch-props/test-cases/theme.expected.js +36 -0
  34. package/package.json +3 -3
  35. package/v5.0.0/theme-spacing.test/large-actual.js +1 -1
  36. package/v5.0.0/theme-spacing.test/large-expected.js +1 -1
  37. package/v9.0.0/system-props/index.js +13 -0
  38. package/v9.0.0/system-props/removeSystemProps.js +243 -0
  39. package/v9.0.0/system-props/test-cases/system-props.actual.js +144 -0
  40. package/v9.0.0/system-props/test-cases/system-props.expected.js +175 -0
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _Radio = _interopRequireDefault(require("@org/ui/material/Radio"));
5
+ var _material = require("@org/ui/material");
6
+ var _jsxRuntime = require("react/jsx-runtime");
7
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Radio.default, {
8
+ slotProps: {
9
+ input: {
10
+ 'aria-label': 'Radio'
11
+ }
12
+ }
13
+ });
14
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Radio.default, {
15
+ slotProps: {
16
+ input: {
17
+ ref: ref
18
+ }
19
+ }
20
+ });
21
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Radio.default, {
22
+ slotProps: {
23
+ input: {
24
+ 'aria-label': 'Radio',
25
+ ref: ref
26
+ }
27
+ }
28
+ });
29
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {
30
+ slotProps: {
31
+ input: {
32
+ 'aria-label': 'Radio'
33
+ }
34
+ }
35
+ });
36
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {
37
+ slotProps: {
38
+ input: {
39
+ ref: ref
40
+ }
41
+ }
42
+ });
43
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {
44
+ slotProps: {
45
+ input: {
46
+ 'aria-label': 'Radio',
47
+ ref: ref
48
+ }
49
+ }
50
+ });
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ fn({
4
+ MuiRadio: {
5
+ defaultProps: {
6
+ inputProps: {
7
+ 'aria-label': 'Radio'
8
+ }
9
+ }
10
+ }
11
+ });
12
+ fn({
13
+ MuiRadio: {
14
+ defaultProps: {
15
+ inputRef: ref
16
+ }
17
+ }
18
+ });
19
+ fn({
20
+ MuiRadio: {
21
+ defaultProps: {
22
+ inputProps: {
23
+ 'aria-label': 'Radio'
24
+ },
25
+ inputRef: ref
26
+ }
27
+ }
28
+ });
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ fn({
4
+ MuiRadio: {
5
+ defaultProps: {
6
+ slotProps: {
7
+ input: {
8
+ 'aria-label': 'Radio'
9
+ }
10
+ }
11
+ }
12
+ }
13
+ });
14
+ fn({
15
+ MuiRadio: {
16
+ defaultProps: {
17
+ slotProps: {
18
+ input: {
19
+ ref: ref
20
+ }
21
+ }
22
+ }
23
+ }
24
+ });
25
+ fn({
26
+ MuiRadio: {
27
+ defaultProps: {
28
+ slotProps: {
29
+ input: {
30
+ 'aria-label': 'Radio',
31
+ ref: ref
32
+ }
33
+ }
34
+ }
35
+ }
36
+ });
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "default", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _switchProps.default;
11
+ }
12
+ });
13
+ var _switchProps = _interopRequireDefault(require("./switch-props"));
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = transformer;
8
+ var _movePropIntoSlotProps = _interopRequireDefault(require("../utils/movePropIntoSlotProps"));
9
+ /**
10
+ * @param {import('jscodeshift').FileInfo} file
11
+ * @param {import('jscodeshift').API} api
12
+ */
13
+ function transformer(file, api, options) {
14
+ const j = api.jscodeshift;
15
+ const root = j(file.source);
16
+ const printOptions = options.printOptions;
17
+ (0, _movePropIntoSlotProps.default)(j, {
18
+ root,
19
+ packageName: options.packageName,
20
+ componentName: 'Switch',
21
+ propName: 'inputProps',
22
+ slotName: 'input'
23
+ });
24
+ (0, _movePropIntoSlotProps.default)(j, {
25
+ root,
26
+ packageName: options.packageName,
27
+ componentName: 'Switch',
28
+ propName: 'inputRef',
29
+ slotName: 'input',
30
+ slotPropName: 'ref'
31
+ });
32
+ return root.toSource(printOptions);
33
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _Switch = _interopRequireDefault(require("@mui/material/Switch"));
5
+ var _material = require("@mui/material");
6
+ var _jsxRuntime = require("react/jsx-runtime");
7
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
8
+ inputProps: {
9
+ 'aria-label': 'Switch'
10
+ }
11
+ });
12
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
13
+ inputRef: ref
14
+ });
15
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
16
+ inputProps: {
17
+ 'aria-label': 'Switch'
18
+ },
19
+ inputRef: ref
20
+ });
21
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
22
+ inputProps: {
23
+ 'aria-label': 'Switch'
24
+ },
25
+ inputRef: ref,
26
+ slotProps: {
27
+ root: {
28
+ id: 'test'
29
+ }
30
+ }
31
+ });
32
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
33
+ inputProps: {
34
+ 'aria-label': 'Switch'
35
+ }
36
+ });
37
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
38
+ inputRef: ref
39
+ });
40
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
41
+ inputProps: {
42
+ 'aria-label': 'Switch'
43
+ },
44
+ inputRef: ref
45
+ });
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _Switch = _interopRequireDefault(require("@mui/material/Switch"));
5
+ var _material = require("@mui/material");
6
+ var _jsxRuntime = require("react/jsx-runtime");
7
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
8
+ slotProps: {
9
+ input: {
10
+ 'aria-label': 'Switch'
11
+ }
12
+ }
13
+ });
14
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
15
+ slotProps: {
16
+ input: {
17
+ ref: ref
18
+ }
19
+ }
20
+ });
21
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
22
+ slotProps: {
23
+ input: {
24
+ 'aria-label': 'Switch',
25
+ ref: ref
26
+ }
27
+ }
28
+ });
29
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
30
+ slotProps: {
31
+ root: {
32
+ id: 'test'
33
+ },
34
+ input: {
35
+ 'aria-label': 'Switch',
36
+ ref: ref
37
+ }
38
+ }
39
+ });
40
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
41
+ slotProps: {
42
+ input: {
43
+ 'aria-label': 'Switch'
44
+ }
45
+ }
46
+ });
47
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
48
+ slotProps: {
49
+ input: {
50
+ ref: ref
51
+ }
52
+ }
53
+ });
54
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
55
+ slotProps: {
56
+ input: {
57
+ 'aria-label': 'Switch',
58
+ ref: ref
59
+ }
60
+ }
61
+ });
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _Switch = _interopRequireDefault(require("@org/ui/material/Switch"));
5
+ var _material = require("@org/ui/material");
6
+ var _jsxRuntime = require("react/jsx-runtime");
7
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
8
+ inputProps: {
9
+ 'aria-label': 'Switch'
10
+ }
11
+ });
12
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
13
+ inputRef: ref
14
+ });
15
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
16
+ inputProps: {
17
+ 'aria-label': 'Switch'
18
+ },
19
+ inputRef: ref
20
+ });
21
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
22
+ inputProps: {
23
+ 'aria-label': 'Switch'
24
+ }
25
+ });
26
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
27
+ inputRef: ref
28
+ });
29
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
30
+ inputProps: {
31
+ 'aria-label': 'Switch'
32
+ },
33
+ inputRef: ref
34
+ });
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _Switch = _interopRequireDefault(require("@org/ui/material/Switch"));
5
+ var _material = require("@org/ui/material");
6
+ var _jsxRuntime = require("react/jsx-runtime");
7
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
8
+ slotProps: {
9
+ input: {
10
+ 'aria-label': 'Switch'
11
+ }
12
+ }
13
+ });
14
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
15
+ slotProps: {
16
+ input: {
17
+ ref: ref
18
+ }
19
+ }
20
+ });
21
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
22
+ slotProps: {
23
+ input: {
24
+ 'aria-label': 'Switch',
25
+ ref: ref
26
+ }
27
+ }
28
+ });
29
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
30
+ slotProps: {
31
+ input: {
32
+ 'aria-label': 'Switch'
33
+ }
34
+ }
35
+ });
36
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
37
+ slotProps: {
38
+ input: {
39
+ ref: ref
40
+ }
41
+ }
42
+ });
43
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
44
+ slotProps: {
45
+ input: {
46
+ 'aria-label': 'Switch',
47
+ ref: ref
48
+ }
49
+ }
50
+ });
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ fn({
4
+ MuiSwitch: {
5
+ defaultProps: {
6
+ inputProps: {
7
+ 'aria-label': 'Switch'
8
+ }
9
+ }
10
+ }
11
+ });
12
+ fn({
13
+ MuiSwitch: {
14
+ defaultProps: {
15
+ inputRef: ref
16
+ }
17
+ }
18
+ });
19
+ fn({
20
+ MuiSwitch: {
21
+ defaultProps: {
22
+ inputProps: {
23
+ 'aria-label': 'Switch'
24
+ },
25
+ inputRef: ref
26
+ }
27
+ }
28
+ });
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ fn({
4
+ MuiSwitch: {
5
+ defaultProps: {
6
+ slotProps: {
7
+ input: {
8
+ 'aria-label': 'Switch'
9
+ }
10
+ }
11
+ }
12
+ }
13
+ });
14
+ fn({
15
+ MuiSwitch: {
16
+ defaultProps: {
17
+ slotProps: {
18
+ input: {
19
+ ref: ref
20
+ }
21
+ }
22
+ }
23
+ }
24
+ });
25
+ fn({
26
+ MuiSwitch: {
27
+ defaultProps: {
28
+ slotProps: {
29
+ input: {
30
+ 'aria-label': 'Switch',
31
+ ref: ref
32
+ }
33
+ }
34
+ }
35
+ }
36
+ });
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@mui/codemod",
3
- "version": "9.0.0-alpha.4",
3
+ "version": "9.0.0",
4
4
  "author": "MUI Team",
5
5
  "description": "Codemod scripts for Material UI.",
6
+ "license": "MIT",
6
7
  "keywords": [
7
8
  "react",
8
9
  "react-component",
@@ -15,7 +16,6 @@
15
16
  "url": "git+https://github.com/mui/material-ui.git",
16
17
  "directory": "packages/mui-codemod"
17
18
  },
18
- "license": "MIT",
19
19
  "homepage": "https://github.com/mui/material-ui/tree/master/packages/mui-codemod",
20
20
  "funding": {
21
21
  "type": "opencollective",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@babel/core": "^7.29.0",
26
- "@babel/runtime": "^7.28.6",
26
+ "@babel/runtime": "^7.29.2",
27
27
  "@babel/traverse": "^7.29.0",
28
28
  "@mui/material-v5": "npm:@mui/material@5.18.0",
29
29
  "jscodeshift": "^17.1.2",
@@ -25,7 +25,7 @@ var _GlobalStyles = _interopRequireDefault(require("@mui/material/GlobalStyles")
25
25
  var _styles = require("@mui/material/styles");
26
26
  var _config = require("docs/config");
27
27
  var _Link = _interopRequireDefault(require("docs/src/modules/components/Link"));
28
- var _i18n = require("@mui/docs/i18n");
28
+ var _i18n = require("@mui/internal-core-docs/i18n");
29
29
  var _useLazyCSS = _interopRequireDefault(require("docs/src/modules/utils/useLazyCSS"));
30
30
  var _getUrlProduct = _interopRequireDefault(require("docs/src/modules/utils/getUrlProduct"));
31
31
  var _jsxRuntime = require("react/jsx-runtime");
@@ -25,7 +25,7 @@ var _GlobalStyles = _interopRequireDefault(require("@mui/material/GlobalStyles")
25
25
  var _styles = require("@mui/material/styles");
26
26
  var _config = require("docs/config");
27
27
  var _Link = _interopRequireDefault(require("docs/src/modules/components/Link"));
28
- var _i18n = require("@mui/docs/i18n");
28
+ var _i18n = require("@mui/internal-core-docs/i18n");
29
29
  var _useLazyCSS = _interopRequireDefault(require("docs/src/modules/utils/useLazyCSS"));
30
30
  var _getUrlProduct = _interopRequireDefault(require("docs/src/modules/utils/getUrlProduct"));
31
31
  var _jsxRuntime = require("react/jsx-runtime");
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "default", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _removeSystemProps.default;
11
+ }
12
+ });
13
+ var _removeSystemProps = _interopRequireDefault(require("./removeSystemProps"));