@mui/codemod 7.0.2 → 7.1.1
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 +10 -0
- package/codemod.js +8 -0
- package/deprecations/accordion-props/accordion-props.js +2 -0
- package/deprecations/accordion-props/test-cases/package.actual.js +68 -0
- package/deprecations/accordion-props/test-cases/package.expected.js +74 -0
- package/deprecations/accordion-summary-classes/accordion-summary-classes.js +1 -1
- package/deprecations/accordion-summary-classes/test-cases/package.actual.js +54 -0
- package/deprecations/accordion-summary-classes/test-cases/package.expected.js +54 -0
- package/deprecations/alert-classes/alert-classes.js +1 -1
- package/deprecations/alert-classes/test-cases/package.actual.js +27 -0
- package/deprecations/alert-classes/test-cases/package.expected.js +27 -0
- package/deprecations/alert-props/alert-props.js +1 -0
- package/deprecations/alert-props/test-cases/package.actual.js +60 -0
- package/deprecations/alert-props/test-cases/package.expected.js +52 -0
- package/deprecations/autocomplete-props/autocomplete-props.js +7 -0
- package/deprecations/autocomplete-props/test-cases/package.actual.js +113 -0
- package/deprecations/autocomplete-props/test-cases/package.expected.js +125 -0
- package/deprecations/avatar-group-props/avatar-group-props.js +4 -2
- package/deprecations/avatar-group-props/test-cases/package.actual.js +56 -0
- package/deprecations/avatar-group-props/test-cases/package.expected.js +58 -0
- package/deprecations/avatar-props/avatar-props.js +2 -1
- package/deprecations/avatar-props/test-cases/package.actual.js +36 -0
- package/deprecations/avatar-props/test-cases/package.expected.js +42 -0
- package/deprecations/backdrop-props/backdrop-props.js +2 -0
- package/deprecations/backdrop-props/test-cases/package.actual.js +81 -0
- package/deprecations/backdrop-props/test-cases/package.expected.js +81 -0
- package/deprecations/badge-props/badge-props.js +2 -1
- package/deprecations/badge-props/test-cases/package.actual.js +59 -0
- package/deprecations/badge-props/test-cases/package.expected.js +51 -0
- package/deprecations/button-classes/button-classes.js +1 -1
- package/deprecations/button-classes/test-cases/package.actual.js +69 -0
- package/deprecations/button-classes/test-cases/package.expected.js +69 -0
- package/deprecations/button-group-classes/button-group-classes.js +1 -1
- package/deprecations/button-group-classes/test-cases/package.actual.js +37 -0
- package/deprecations/button-group-classes/test-cases/package.expected.js +37 -0
- package/deprecations/card-header-props/card-header-props.js +2 -0
- package/deprecations/card-header-props/test-cases/package.actual.js +66 -0
- package/deprecations/card-header-props/test-cases/package.expected.js +78 -0
- package/deprecations/chip-classes/chip-classes.js +1 -1
- package/deprecations/chip-classes/test-cases/package.actual.js +55 -0
- package/deprecations/chip-classes/test-cases/package.expected.js +55 -0
- package/deprecations/circular-progress-classes/circular-progress-classes.js +1 -1
- package/deprecations/circular-progress-classes/test-cases/package.actual.js +7 -0
- package/deprecations/circular-progress-classes/test-cases/package.expected.js +7 -0
- package/deprecations/dialog-classes/dialog-classes.js +1 -1
- package/deprecations/dialog-classes/test-cases/package.actual.js +7 -0
- package/deprecations/dialog-classes/test-cases/package.expected.js +7 -0
- package/deprecations/divider-props/divider-props.js +3 -1
- package/deprecations/divider-props/test-cases/package.actual.js +45 -0
- package/deprecations/divider-props/test-cases/package.expected.js +50 -0
- package/deprecations/drawer-classes/drawer-classes.js +1 -1
- package/deprecations/drawer-classes/test-cases/package.actual.js +19 -0
- package/deprecations/drawer-classes/test-cases/package.expected.js +19 -0
- package/deprecations/drawer-props/drawer-props.js +8 -0
- package/deprecations/drawer-props/test-cases/package.actual.js +73 -0
- package/deprecations/drawer-props/test-cases/package.expected.js +97 -0
- package/deprecations/filled-input-props/filled-input-props.js +1 -0
- package/deprecations/filled-input-props/test-cases/package.actual.js +60 -0
- package/deprecations/filled-input-props/test-cases/package.expected.js +52 -0
- package/deprecations/form-control-label-props/form-control-label-props.js +1 -0
- package/deprecations/form-control-label-props/test-cases/package.actual.js +21 -0
- package/deprecations/form-control-label-props/test-cases/package.expected.js +21 -0
- package/deprecations/image-list-item-bar-classes/image-list-item-bar-classes.js +1 -1
- package/deprecations/image-list-item-bar-classes/test-cases/package.actual.js +11 -0
- package/deprecations/image-list-item-bar-classes/test-cases/package.expected.js +11 -0
- package/deprecations/input-base-classes/input-base-classes.js +1 -1
- package/deprecations/input-base-classes/test-cases/package.actual.js +13 -0
- package/deprecations/input-base-classes/test-cases/package.expected.js +13 -0
- package/deprecations/input-base-props/input-base-props.js +1 -0
- package/deprecations/input-base-props/test-cases/package.actual.js +60 -0
- package/deprecations/input-base-props/test-cases/package.expected.js +52 -0
- package/deprecations/input-props/input-props.js +1 -0
- package/deprecations/input-props/test-cases/package.actual.js +60 -0
- package/deprecations/input-props/test-cases/package.expected.js +52 -0
- package/deprecations/linear-progress-classes/linear-progress-classes.js +1 -1
- package/deprecations/linear-progress-classes/test-cases/package.actual.js +21 -0
- package/deprecations/linear-progress-classes/test-cases/package.expected.js +21 -0
- package/deprecations/list-item-props/list-item-props.js +3 -0
- package/deprecations/list-item-props/test-cases/package.actual.js +49 -0
- package/deprecations/list-item-props/test-cases/package.expected.js +50 -0
- package/deprecations/list-item-text-props/list-item-text-props.js +3 -0
- package/deprecations/list-item-text-props/test-cases/package.actual.js +21 -0
- package/deprecations/list-item-text-props/test-cases/package.expected.js +27 -0
- package/deprecations/menu-props/menu-props.js +3 -0
- package/deprecations/menu-props/test-cases/package.actual.js +67 -0
- package/deprecations/menu-props/test-cases/package.expected.js +83 -0
- package/deprecations/mobile-stepper-props/mobile-stepper-props.js +1 -0
- package/deprecations/mobile-stepper-props/test-cases/package.actual.js +30 -0
- package/deprecations/mobile-stepper-props/test-cases/package.expected.js +34 -0
- package/deprecations/modal-props/modal-props.js +3 -0
- package/deprecations/modal-props/test-cases/package.actual.js +49 -0
- package/deprecations/modal-props/test-cases/package.expected.js +50 -0
- package/deprecations/outlined-input-props/outlined-input-props.js +1 -0
- package/deprecations/outlined-input-props/test-cases/package.actual.js +60 -0
- package/deprecations/outlined-input-props/test-cases/package.expected.js +52 -0
- package/deprecations/pagination-item-classes/pagination-item-classes.js +1 -1
- package/deprecations/pagination-item-classes/test-cases/package.actual.js +108 -0
- package/deprecations/pagination-item-classes/test-cases/package.expected.js +108 -0
- package/deprecations/pagination-item-props/pagination-item-props.js +1 -0
- package/deprecations/pagination-item-props/test-cases/package.actual.js +27 -0
- package/deprecations/pagination-item-props/test-cases/package.expected.js +21 -0
- package/deprecations/popover-props/popover-props.js +5 -0
- package/deprecations/popover-props/test-cases/package.actual.js +73 -0
- package/deprecations/popover-props/test-cases/package.expected.js +89 -0
- package/deprecations/popper-props/popper-props.js +1 -0
- package/deprecations/popper-props/test-cases/package.actual.js +27 -0
- package/deprecations/popper-props/test-cases/package.expected.js +24 -0
- package/deprecations/rating-props/rating-props.js +1 -0
- package/deprecations/rating-props/test-cases/package.actual.js +37 -0
- package/deprecations/rating-props/test-cases/package.expected.js +53 -0
- package/deprecations/select-classes/select-classes.js +1 -1
- package/deprecations/select-classes/test-cases/package.actual.js +9 -0
- package/deprecations/select-classes/test-cases/package.expected.js +9 -0
- package/deprecations/slider-classes/slider-classes.js +1 -1
- package/deprecations/slider-classes/test-cases/package.actual.js +19 -0
- package/deprecations/slider-classes/test-cases/package.expected.js +19 -0
- package/deprecations/slider-props/slider-props.js +1 -0
- package/deprecations/slider-props/test-cases/package.actual.js +60 -0
- package/deprecations/slider-props/test-cases/package.expected.js +52 -0
- package/deprecations/snackbar-props/snackbar-props.js +4 -0
- package/deprecations/snackbar-props/test-cases/package.actual.js +54 -0
- package/deprecations/snackbar-props/test-cases/package.expected.js +67 -0
- package/deprecations/speed-dial-action-props/speed-dial-action-props.js +5 -0
- package/deprecations/speed-dial-action-props/test-cases/package.actual.js +56 -0
- package/deprecations/speed-dial-action-props/test-cases/package.expected.js +104 -0
- package/deprecations/speed-dial-props/speed-dial-props.js +2 -0
- package/deprecations/speed-dial-props/test-cases/package.actual.js +41 -0
- package/deprecations/speed-dial-props/test-cases/package.expected.js +54 -0
- package/deprecations/step-connector-classes/step-connector-classes.js +1 -1
- package/deprecations/step-connector-classes/test-cases/package.actual.js +7 -0
- package/deprecations/step-connector-classes/test-cases/package.expected.js +7 -0
- package/deprecations/step-content-props/step-content-props.js +2 -0
- package/deprecations/step-content-props/test-cases/package.actual.js +65 -0
- package/deprecations/step-content-props/test-cases/package.expected.js +74 -0
- package/deprecations/step-label-props/step-label-props.js +3 -0
- package/deprecations/step-label-props/test-cases/package.actual.js +44 -0
- package/deprecations/step-label-props/test-cases/package.expected.js +48 -0
- package/deprecations/tab-classes/tab-classes.js +1 -1
- package/deprecations/tab-classes/test-cases/package.actual.js +5 -0
- package/deprecations/tab-classes/test-cases/package.expected.js +5 -0
- package/deprecations/table-pagination-props/table-pagination-props.js +2 -0
- package/deprecations/table-pagination-props/test-cases/package.actual.js +62 -0
- package/deprecations/table-pagination-props/test-cases/package.expected.js +72 -0
- package/deprecations/table-sort-label-classes/table-sort-label-classes.js +1 -1
- package/deprecations/table-sort-label-classes/test-cases/package.actual.js +7 -0
- package/deprecations/table-sort-label-classes/test-cases/package.expected.js +7 -0
- package/deprecations/tabs-classes/tabs-classes.js +1 -1
- package/deprecations/tabs-classes/test-cases/package.actual.js +7 -0
- package/deprecations/tabs-classes/test-cases/package.expected.js +7 -0
- package/deprecations/tabs-props/tabs-props.js +3 -0
- package/deprecations/tabs-props/test-cases/package.actual.js +33 -0
- package/deprecations/tabs-props/test-cases/package.expected.js +41 -0
- package/deprecations/text-field-props/test-cases/package.actual.js +27 -0
- package/deprecations/text-field-props/test-cases/package.expected.js +31 -0
- package/deprecations/text-field-props/text-field-props.js +5 -0
- package/deprecations/toggle-button-group-classes/test-cases/package.actual.js +7 -0
- package/deprecations/toggle-button-group-classes/test-cases/package.expected.js +7 -0
- package/deprecations/toggle-button-group-classes/toggle-button-group-classes.js +1 -1
- package/deprecations/tooltip-props/test-cases/package.actual.js +141 -0
- package/deprecations/tooltip-props/test-cases/package.expected.js +141 -0
- package/deprecations/tooltip-props/tooltip-props.js +5 -0
- package/deprecations/typography-props/test-cases/package.actual.js +88 -0
- package/deprecations/typography-props/test-cases/package.expected.js +98 -0
- package/deprecations/typography-props/typography-props.js +1 -0
- package/deprecations/utils/movePropIntoSlotProps.js +2 -10
- package/deprecations/utils/movePropIntoSlots.js +2 -10
- package/deprecations/utils/replaceComponentsWithSlots.js +3 -13
- package/package.json +6 -7
- package/util/findComponentJSX.js +4 -3
- package/v6.0.0/grid-v2-props/grid-v2-props.js +5 -0
- package/v6.0.0/grid-v2-props/test-cases/package.actual.js +91 -0
- package/v6.0.0/grid-v2-props/test-cases/package.expected.js +91 -0
- package/v6.0.0/list-item-button-prop/list-item-button-prop.js +8 -4
- package/v6.0.0/list-item-button-prop/test-cases/package.actual.js +31 -0
- package/v6.0.0/list-item-button-prop/test-cases/package.expected.js +20 -0
- package/v7.0.0/grid-props/grid-props.js +5 -0
- package/v7.0.0/grid-props/test-cases/package.actual.js +91 -0
- package/v7.0.0/grid-props/test-cases/package.expected.js +91 -0
package/README.md
CHANGED
|
@@ -40,6 +40,16 @@ Examples:
|
|
|
40
40
|
npx @mui/codemod@latest v5.0.0/preset-safe src --parser=flow
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
### package name
|
|
44
|
+
|
|
45
|
+
Use this flag if you have a custom package name that reexports Material UI components. For example:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx @mui/codemod@latest --packageName="@org/ui"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The snippet above will look for `@org/ui` instead of `@mui/material` in the codemod.
|
|
52
|
+
|
|
43
53
|
### jscodeshift options
|
|
44
54
|
|
|
45
55
|
To pass more options directly to jscodeshift, use `--jscodeshift="..."`. For example:
|
package/codemod.js
CHANGED
|
@@ -73,6 +73,9 @@ async function runJscodeshiftTransform(transform, files, flags, codemodFlags) {
|
|
|
73
73
|
if (flags.jscodeshift) {
|
|
74
74
|
args.push(flags.jscodeshift);
|
|
75
75
|
}
|
|
76
|
+
if (flags.packageName) {
|
|
77
|
+
args.push(`--packageName=${flags.packageName}`);
|
|
78
|
+
}
|
|
76
79
|
|
|
77
80
|
args.push(...files);
|
|
78
81
|
|
|
@@ -196,6 +199,11 @@ yargs
|
|
|
196
199
|
description: '(Advanced) Pass options directly to jscodeshift',
|
|
197
200
|
default: false,
|
|
198
201
|
type: 'string',
|
|
202
|
+
})
|
|
203
|
+
.option('packageName', {
|
|
204
|
+
description: 'The package name to look for in the import statements',
|
|
205
|
+
default: '@mui/material',
|
|
206
|
+
type: 'string',
|
|
199
207
|
});
|
|
200
208
|
},
|
|
201
209
|
handler: run,
|
|
@@ -17,12 +17,14 @@ function transformer(file, api, options) {
|
|
|
17
17
|
const printOptions = options.printOptions;
|
|
18
18
|
(0, _movePropIntoSlots.default)(j, {
|
|
19
19
|
root,
|
|
20
|
+
packageName: options.packageName,
|
|
20
21
|
componentName: 'Accordion',
|
|
21
22
|
propName: 'TransitionComponent',
|
|
22
23
|
slotName: 'transition'
|
|
23
24
|
});
|
|
24
25
|
(0, _movePropIntoSlotProps.default)(j, {
|
|
25
26
|
root,
|
|
27
|
+
packageName: options.packageName,
|
|
26
28
|
componentName: 'Accordion',
|
|
27
29
|
propName: 'TransitionProps',
|
|
28
30
|
slotName: 'transition'
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Accordion = _interopRequireDefault(require("@org/ui/material/Accordion"));
|
|
5
|
+
var _material = require("@org/ui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Accordion.default, {
|
|
8
|
+
TransitionProps: {
|
|
9
|
+
unmountOnExit: true
|
|
10
|
+
},
|
|
11
|
+
slots: {
|
|
12
|
+
transition: CustomTransition
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Accordion, {
|
|
16
|
+
TransitionProps: transitionVars,
|
|
17
|
+
slots: {
|
|
18
|
+
transition: CustomTransition
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Accordion.default, {
|
|
22
|
+
TransitionProps: {
|
|
23
|
+
unmountOnExit: true
|
|
24
|
+
},
|
|
25
|
+
slots: {
|
|
26
|
+
root: 'div',
|
|
27
|
+
transition: CustomTransition
|
|
28
|
+
},
|
|
29
|
+
slotProps: {
|
|
30
|
+
root: {
|
|
31
|
+
className: 'foo'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Accordion, {
|
|
36
|
+
TransitionProps: {
|
|
37
|
+
unmountOnExit: true
|
|
38
|
+
},
|
|
39
|
+
slots: {
|
|
40
|
+
...outerSlots,
|
|
41
|
+
transition: CustomTransition
|
|
42
|
+
},
|
|
43
|
+
slotProps: {
|
|
44
|
+
...outerSlotProps
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Accordion.default, {
|
|
48
|
+
slots: {
|
|
49
|
+
transition: SlotTransition
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Accordion.default, {
|
|
53
|
+
TransitionProps: {
|
|
54
|
+
unmountOnExit: true
|
|
55
|
+
},
|
|
56
|
+
slotProps: {
|
|
57
|
+
transition: {
|
|
58
|
+
id: 'test'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
// should skip non MUI components
|
|
63
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(NonMuiAccordion, {
|
|
64
|
+
TransitionComponent: CustomTransition,
|
|
65
|
+
TransitionProps: {
|
|
66
|
+
unmountOnExit: true
|
|
67
|
+
}
|
|
68
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Accordion = _interopRequireDefault(require("@org/ui/material/Accordion"));
|
|
5
|
+
var _material = require("@org/ui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Accordion.default, {
|
|
8
|
+
slots: {
|
|
9
|
+
transition: CustomTransition
|
|
10
|
+
},
|
|
11
|
+
slotProps: {
|
|
12
|
+
transition: {
|
|
13
|
+
unmountOnExit: true
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Accordion, {
|
|
18
|
+
slots: {
|
|
19
|
+
transition: CustomTransition
|
|
20
|
+
},
|
|
21
|
+
slotProps: {
|
|
22
|
+
transition: transitionVars
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Accordion.default, {
|
|
26
|
+
slots: {
|
|
27
|
+
root: 'div',
|
|
28
|
+
transition: CustomTransition
|
|
29
|
+
},
|
|
30
|
+
slotProps: {
|
|
31
|
+
root: {
|
|
32
|
+
className: 'foo'
|
|
33
|
+
},
|
|
34
|
+
transition: {
|
|
35
|
+
unmountOnExit: true
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Accordion, {
|
|
40
|
+
slots: {
|
|
41
|
+
...outerSlots,
|
|
42
|
+
transition: CustomTransition
|
|
43
|
+
},
|
|
44
|
+
slotProps: {
|
|
45
|
+
...outerSlotProps,
|
|
46
|
+
transition: {
|
|
47
|
+
unmountOnExit: true
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Accordion.default, {
|
|
52
|
+
slots: {
|
|
53
|
+
transition: SlotTransition
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Accordion.default, {
|
|
57
|
+
slotProps: {
|
|
58
|
+
transition: {
|
|
59
|
+
...{
|
|
60
|
+
unmountOnExit: true
|
|
61
|
+
},
|
|
62
|
+
...{
|
|
63
|
+
id: 'test'
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
// should skip non MUI components
|
|
69
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(NonMuiAccordion, {
|
|
70
|
+
TransitionComponent: CustomTransition,
|
|
71
|
+
TransitionProps: {
|
|
72
|
+
unmountOnExit: true
|
|
73
|
+
}
|
|
74
|
+
});
|
|
@@ -17,7 +17,7 @@ function transformer(file, api, options) {
|
|
|
17
17
|
// contentGutters is a special case as it's applied to the content child
|
|
18
18
|
// but gutters is applied to the parent element, so the gutter class needs to go on the parent
|
|
19
19
|
|
|
20
|
-
root.find(j.ImportDeclaration).filter(path => path.node.source.value.match(
|
|
20
|
+
root.find(j.ImportDeclaration).filter(path => path.node.source.value.match(new RegExp(`^${options.packageName || '@mui/material'}(/AccordionSummary)?$`))).forEach(path => {
|
|
21
21
|
path.node.specifiers.forEach(specifier => {
|
|
22
22
|
if (specifier.type === 'ImportSpecifier' && specifier.imported.name === 'accordionSummaryClasses') {
|
|
23
23
|
root.find(j.MemberExpression, {
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _AccordionSummary = require("@org/ui/material/AccordionSummary");
|
|
4
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
fn({
|
|
6
|
+
MuiAccordionSummary: {
|
|
7
|
+
styleOverrides: {
|
|
8
|
+
root: {
|
|
9
|
+
'& .MuiAccordionSummary-contentGutters': {
|
|
10
|
+
color: 'red'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
fn({
|
|
17
|
+
MuiAccordionSummary: {
|
|
18
|
+
styleOverrides: {
|
|
19
|
+
root: {
|
|
20
|
+
[`& .${_AccordionSummary.accordionSummaryClasses.contentGutters}`]: {
|
|
21
|
+
color: 'red'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
styled(Component)(() => {
|
|
28
|
+
return {
|
|
29
|
+
'& .MuiAccordionSummary-contentGutters': {
|
|
30
|
+
color: 'red'
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
styled(Component)(() => {
|
|
35
|
+
return {
|
|
36
|
+
[`& .${_AccordionSummary.accordionSummaryClasses.contentGutters}`]: {
|
|
37
|
+
color: 'red'
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(AccordionSummary, {
|
|
42
|
+
sx: {
|
|
43
|
+
'& .MuiAccordionSummary-contentGutters': {
|
|
44
|
+
color: 'red'
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(AccordionSummary, {
|
|
49
|
+
sx: {
|
|
50
|
+
[`& .${_AccordionSummary.accordionSummaryClasses.contentGutters}`]: {
|
|
51
|
+
color: 'red'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _AccordionSummary = require("@org/ui/material/AccordionSummary");
|
|
4
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
fn({
|
|
6
|
+
MuiAccordionSummary: {
|
|
7
|
+
styleOverrides: {
|
|
8
|
+
root: {
|
|
9
|
+
'&.MuiAccordionSummary-gutters .MuiAccordionSummary-content': {
|
|
10
|
+
color: 'red'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
fn({
|
|
17
|
+
MuiAccordionSummary: {
|
|
18
|
+
styleOverrides: {
|
|
19
|
+
root: {
|
|
20
|
+
[`&.${_AccordionSummary.accordionSummaryClasses.gutters} .${_AccordionSummary.accordionSummaryClasses.content}`]: {
|
|
21
|
+
color: 'red'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
styled(Component)(() => {
|
|
28
|
+
return {
|
|
29
|
+
'&.MuiAccordionSummary-gutters .MuiAccordionSummary-content': {
|
|
30
|
+
color: 'red'
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
styled(Component)(() => {
|
|
35
|
+
return {
|
|
36
|
+
[`&.${_AccordionSummary.accordionSummaryClasses.gutters} .${_AccordionSummary.accordionSummaryClasses.content}`]: {
|
|
37
|
+
color: 'red'
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(AccordionSummary, {
|
|
42
|
+
sx: {
|
|
43
|
+
'&.MuiAccordionSummary-gutters .MuiAccordionSummary-content': {
|
|
44
|
+
color: 'red'
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(AccordionSummary, {
|
|
49
|
+
sx: {
|
|
50
|
+
[`&.${_AccordionSummary.accordionSummaryClasses.gutters} .${_AccordionSummary.accordionSummaryClasses.content}`]: {
|
|
51
|
+
color: 'red'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
@@ -17,7 +17,7 @@ function transformer(file, api, options) {
|
|
|
17
17
|
deprecatedClass,
|
|
18
18
|
replacementSelector
|
|
19
19
|
}) => {
|
|
20
|
-
root.find(j.ImportDeclaration).filter(path => path.node.source.value.match(
|
|
20
|
+
root.find(j.ImportDeclaration).filter(path => path.node.source.value.match(new RegExp(`^${options.packageName || '@mui/material'}(/Alert)?$`))).forEach(path => {
|
|
21
21
|
path.node.specifiers.forEach(specifier => {
|
|
22
22
|
if (specifier.type === 'ImportSpecifier' && specifier.imported.name === 'alertClasses') {
|
|
23
23
|
const deprecatedAtomicClass = deprecatedClass.replace('.MuiAlert-', '');
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Alert = require("@org/ui/material/Alert");
|
|
4
|
+
'&.MuiAlert-standardSuccess';
|
|
5
|
+
'&.MuiAlert-standardInfo';
|
|
6
|
+
'&.MuiAlert-standardWarning';
|
|
7
|
+
'&.MuiAlert-standardError';
|
|
8
|
+
'&.MuiAlert-outlinedSuccess';
|
|
9
|
+
'&.MuiAlert-outlinedInfo';
|
|
10
|
+
'&.MuiAlert-outlinedWarning';
|
|
11
|
+
'&.MuiAlert-outlinedError';
|
|
12
|
+
'&.MuiAlert-filledSuccess';
|
|
13
|
+
'&.MuiAlert-filledInfo';
|
|
14
|
+
'&.MuiAlert-filledWarning';
|
|
15
|
+
'&.MuiAlert-filledError';
|
|
16
|
+
`&.${_Alert.alertClasses.standardSuccess}`;
|
|
17
|
+
`&.${_Alert.alertClasses.standardInfo}`;
|
|
18
|
+
`&.${_Alert.alertClasses.standardWarning}`;
|
|
19
|
+
`&.${_Alert.alertClasses.standardError}`;
|
|
20
|
+
`&.${_Alert.alertClasses.outlinedSuccess}`;
|
|
21
|
+
`&.${_Alert.alertClasses.outlinedInfo}`;
|
|
22
|
+
`&.${_Alert.alertClasses.outlinedWarning}`;
|
|
23
|
+
`&.${_Alert.alertClasses.outlinedError}`;
|
|
24
|
+
`&.${_Alert.alertClasses.filledSuccess}`;
|
|
25
|
+
`&.${_Alert.alertClasses.filledInfo}`;
|
|
26
|
+
`&.${_Alert.alertClasses.filledWarning}`;
|
|
27
|
+
`&.${_Alert.alertClasses.filledError}`;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Alert = require("@org/ui/material/Alert");
|
|
4
|
+
'&.MuiAlert-standard.MuiAlert-colorSuccess';
|
|
5
|
+
'&.MuiAlert-standard.MuiAlert-colorInfo';
|
|
6
|
+
'&.MuiAlert-standard.MuiAlert-colorWarning';
|
|
7
|
+
'&.MuiAlert-standard.MuiAlert-colorError';
|
|
8
|
+
'&.MuiAlert-outlined.MuiAlert-colorSuccess';
|
|
9
|
+
'&.MuiAlert-outlined.MuiAlert-colorInfo';
|
|
10
|
+
'&.MuiAlert-outlined.MuiAlert-colorWarning';
|
|
11
|
+
'&.MuiAlert-outlined.MuiAlert-colorError';
|
|
12
|
+
'&.MuiAlert-filled.MuiAlert-colorSuccess';
|
|
13
|
+
'&.MuiAlert-filled.MuiAlert-colorInfo';
|
|
14
|
+
'&.MuiAlert-filled.MuiAlert-colorWarning';
|
|
15
|
+
'&.MuiAlert-filled.MuiAlert-colorError';
|
|
16
|
+
`&.${_Alert.alertClasses.standard}.${_Alert.alertClasses.colorSuccess}`;
|
|
17
|
+
`&.${_Alert.alertClasses.standard}.${_Alert.alertClasses.colorInfo}`;
|
|
18
|
+
`&.${_Alert.alertClasses.standard}.${_Alert.alertClasses.colorWarning}`;
|
|
19
|
+
`&.${_Alert.alertClasses.standard}.${_Alert.alertClasses.colorError}`;
|
|
20
|
+
`&.${_Alert.alertClasses.outlined}.${_Alert.alertClasses.colorSuccess}`;
|
|
21
|
+
`&.${_Alert.alertClasses.outlined}.${_Alert.alertClasses.colorInfo}`;
|
|
22
|
+
`&.${_Alert.alertClasses.outlined}.${_Alert.alertClasses.colorWarning}`;
|
|
23
|
+
`&.${_Alert.alertClasses.outlined}.${_Alert.alertClasses.colorError}`;
|
|
24
|
+
`&.${_Alert.alertClasses.filled}.${_Alert.alertClasses.colorSuccess}`;
|
|
25
|
+
`&.${_Alert.alertClasses.filled}.${_Alert.alertClasses.colorInfo}`;
|
|
26
|
+
`&.${_Alert.alertClasses.filled}.${_Alert.alertClasses.colorWarning}`;
|
|
27
|
+
`&.${_Alert.alertClasses.filled}.${_Alert.alertClasses.colorError}`;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Alert = _interopRequireDefault(require("@org/ui/material/Alert"));
|
|
5
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.default, {
|
|
7
|
+
components: {
|
|
8
|
+
CloseButton: ComponentsButton
|
|
9
|
+
},
|
|
10
|
+
componentsProps: {
|
|
11
|
+
closeButton: componentsButtonProps
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.default, {
|
|
15
|
+
slots: {
|
|
16
|
+
closeIcon: SlotsIcon
|
|
17
|
+
},
|
|
18
|
+
components: {
|
|
19
|
+
CloseButton: ComponentsButton
|
|
20
|
+
},
|
|
21
|
+
slotProps: {
|
|
22
|
+
closeIcon: slotsIconProps
|
|
23
|
+
},
|
|
24
|
+
componentsProps: {
|
|
25
|
+
closeButton: componentsButtonProps
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.default, {
|
|
29
|
+
slots: {
|
|
30
|
+
closeIcon: SlotsIcon,
|
|
31
|
+
closeButton: SlotsButton
|
|
32
|
+
},
|
|
33
|
+
components: {
|
|
34
|
+
CloseButton: ComponentsButton
|
|
35
|
+
},
|
|
36
|
+
slotProps: {
|
|
37
|
+
closeIcon: slotsIconProps,
|
|
38
|
+
closeButton: slotsButtonProps
|
|
39
|
+
},
|
|
40
|
+
componentsProps: {
|
|
41
|
+
closeButton: componentsButtonProps
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.default, {
|
|
45
|
+
slots: {
|
|
46
|
+
closeIcon: SlotsIcon,
|
|
47
|
+
closeButton: SlotsButton
|
|
48
|
+
},
|
|
49
|
+
components: {
|
|
50
|
+
CloseButton: ComponentsButton
|
|
51
|
+
},
|
|
52
|
+
slotProps: {
|
|
53
|
+
closeIcon: slotsIconProps,
|
|
54
|
+
closeButton: slotsButtonProps
|
|
55
|
+
},
|
|
56
|
+
componentsProps: {
|
|
57
|
+
closeButton: componentsButtonProps,
|
|
58
|
+
closeIcon: componentsIconProps
|
|
59
|
+
}
|
|
60
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Alert = _interopRequireDefault(require("@org/ui/material/Alert"));
|
|
5
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.default, {
|
|
7
|
+
slots: {
|
|
8
|
+
closeButton: ComponentsButton
|
|
9
|
+
},
|
|
10
|
+
slotProps: {
|
|
11
|
+
closeButton: componentsButtonProps
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.default, {
|
|
15
|
+
slots: {
|
|
16
|
+
closeIcon: SlotsIcon,
|
|
17
|
+
closeButton: ComponentsButton
|
|
18
|
+
},
|
|
19
|
+
slotProps: {
|
|
20
|
+
closeIcon: slotsIconProps,
|
|
21
|
+
closeButton: componentsButtonProps
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.default, {
|
|
25
|
+
slots: {
|
|
26
|
+
closeIcon: SlotsIcon,
|
|
27
|
+
closeButton: SlotsButton
|
|
28
|
+
},
|
|
29
|
+
slotProps: {
|
|
30
|
+
closeIcon: slotsIconProps,
|
|
31
|
+
closeButton: {
|
|
32
|
+
...componentsButtonProps,
|
|
33
|
+
...slotsButtonProps
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.default, {
|
|
38
|
+
slots: {
|
|
39
|
+
closeIcon: SlotsIcon,
|
|
40
|
+
closeButton: SlotsButton
|
|
41
|
+
},
|
|
42
|
+
slotProps: {
|
|
43
|
+
closeButton: {
|
|
44
|
+
...componentsButtonProps,
|
|
45
|
+
...slotsButtonProps
|
|
46
|
+
},
|
|
47
|
+
closeIcon: {
|
|
48
|
+
...componentsIconProps,
|
|
49
|
+
...slotsIconProps
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
@@ -22,36 +22,42 @@ function transformer(file, api, options) {
|
|
|
22
22
|
const printOptions = options.printOptions;
|
|
23
23
|
(0, _movePropIntoSlots.default)(j, {
|
|
24
24
|
root,
|
|
25
|
+
packageName: options.packageName,
|
|
25
26
|
componentName: 'Autocomplete',
|
|
26
27
|
propName: 'PaperComponent',
|
|
27
28
|
slotName: 'paper'
|
|
28
29
|
});
|
|
29
30
|
(0, _movePropIntoSlots.default)(j, {
|
|
30
31
|
root,
|
|
32
|
+
packageName: options.packageName,
|
|
31
33
|
componentName: 'Autocomplete',
|
|
32
34
|
propName: 'PopperComponent',
|
|
33
35
|
slotName: 'popper'
|
|
34
36
|
});
|
|
35
37
|
(0, _movePropIntoSlotProps.default)(j, {
|
|
36
38
|
root,
|
|
39
|
+
packageName: options.packageName,
|
|
37
40
|
componentName: 'Autocomplete',
|
|
38
41
|
propName: 'ListboxProps',
|
|
39
42
|
slotName: 'listbox'
|
|
40
43
|
});
|
|
41
44
|
(0, _movePropIntoSlotProps.default)(j, {
|
|
42
45
|
root,
|
|
46
|
+
packageName: options.packageName,
|
|
43
47
|
componentName: 'Autocomplete',
|
|
44
48
|
propName: 'ChipProps',
|
|
45
49
|
slotName: 'chip'
|
|
46
50
|
});
|
|
47
51
|
(0, _replaceComponentsWithSlots.default)(j, {
|
|
48
52
|
root,
|
|
53
|
+
packageName: options.packageName,
|
|
49
54
|
componentName: 'Autocomplete'
|
|
50
55
|
});
|
|
51
56
|
|
|
52
57
|
// Move ListboxComponent JSX prop into slotProps.listbox.component
|
|
53
58
|
(0, _findComponentJSX.default)(j, {
|
|
54
59
|
root,
|
|
60
|
+
packageName: options.packageName,
|
|
55
61
|
componentName: 'Autocomplete'
|
|
56
62
|
}, elementPath => {
|
|
57
63
|
const element = elementPath.node;
|
|
@@ -93,6 +99,7 @@ function transformer(file, api, options) {
|
|
|
93
99
|
// Move ListboxComponent default prop into slotProps.listbox.component
|
|
94
100
|
const defaultPropsPathCollection = (0, _findComponentDefaultProps.default)(j, {
|
|
95
101
|
root,
|
|
102
|
+
packageName: options.packageName,
|
|
96
103
|
componentName: 'Autocomplete'
|
|
97
104
|
});
|
|
98
105
|
defaultPropsPathCollection.find(j.ObjectProperty, {
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Autocomplete = _interopRequireDefault(require("@org/ui/material/Autocomplete"));
|
|
5
|
+
var _material = require("@org/ui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Autocomplete.default, {
|
|
8
|
+
ChipProps: {
|
|
9
|
+
height: 10
|
|
10
|
+
},
|
|
11
|
+
PaperComponent: CustomPaper,
|
|
12
|
+
PopperComponent: CustomPopper,
|
|
13
|
+
ListboxComponent: CustomListbox,
|
|
14
|
+
ListboxProps: {
|
|
15
|
+
height: 12
|
|
16
|
+
},
|
|
17
|
+
componentsProps: {
|
|
18
|
+
clearIndicator: {
|
|
19
|
+
width: 10
|
|
20
|
+
},
|
|
21
|
+
paper: {
|
|
22
|
+
width: 12
|
|
23
|
+
},
|
|
24
|
+
popper: {
|
|
25
|
+
width: 14
|
|
26
|
+
},
|
|
27
|
+
popupIndicator: {
|
|
28
|
+
width: 16
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Autocomplete.default, {
|
|
33
|
+
ChipProps: {
|
|
34
|
+
height: 10
|
|
35
|
+
},
|
|
36
|
+
PaperComponent: CustomPaper,
|
|
37
|
+
PopperComponent: CustomPopper,
|
|
38
|
+
ListboxComponent: CustomListbox,
|
|
39
|
+
ListboxProps: {
|
|
40
|
+
height: 12
|
|
41
|
+
},
|
|
42
|
+
slotProps: {
|
|
43
|
+
popupIndicator: {
|
|
44
|
+
width: 20
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
componentsProps: {
|
|
48
|
+
clearIndicator: {
|
|
49
|
+
width: 10
|
|
50
|
+
},
|
|
51
|
+
paper: {
|
|
52
|
+
width: 12
|
|
53
|
+
},
|
|
54
|
+
popper: {
|
|
55
|
+
width: 14
|
|
56
|
+
},
|
|
57
|
+
popupIndicator: {
|
|
58
|
+
width: 16
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Autocomplete, {
|
|
63
|
+
ChipProps: {
|
|
64
|
+
height: 10
|
|
65
|
+
},
|
|
66
|
+
PaperComponent: CustomPaper,
|
|
67
|
+
PopperComponent: CustomPopper,
|
|
68
|
+
ListboxComponent: CustomListbox,
|
|
69
|
+
ListboxProps: {
|
|
70
|
+
height: 12
|
|
71
|
+
},
|
|
72
|
+
componentsProps: {
|
|
73
|
+
clearIndicator: {
|
|
74
|
+
width: 10
|
|
75
|
+
},
|
|
76
|
+
paper: {
|
|
77
|
+
width: 12
|
|
78
|
+
},
|
|
79
|
+
popper: {
|
|
80
|
+
width: 14
|
|
81
|
+
},
|
|
82
|
+
popupIndicator: {
|
|
83
|
+
width: 16
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(CustomAutocomplete, {
|
|
88
|
+
componentsProps: {
|
|
89
|
+
clearIndicator: {
|
|
90
|
+
width: 10
|
|
91
|
+
},
|
|
92
|
+
paper: {
|
|
93
|
+
width: 12
|
|
94
|
+
},
|
|
95
|
+
popper: {
|
|
96
|
+
width: 14
|
|
97
|
+
},
|
|
98
|
+
popupIndicator: {
|
|
99
|
+
width: 16
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(CustomAutocomplete, {
|
|
104
|
+
ChipProps: {
|
|
105
|
+
height: 10
|
|
106
|
+
},
|
|
107
|
+
PaperComponent: CustomPaper,
|
|
108
|
+
PopperComponent: CustomPopper,
|
|
109
|
+
ListboxComponent: CustomListbox,
|
|
110
|
+
ListboxProps: {
|
|
111
|
+
height: 12
|
|
112
|
+
}
|
|
113
|
+
});
|