@mui/codemod 5.15.10 → 5.15.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.
- package/README.md +670 -7
- package/codemod.js +80 -7
- package/node/deprecations/accordion-summary-classes/accordion-summary-classes.js +55 -0
- package/node/deprecations/accordion-summary-classes/index.js +13 -0
- package/node/deprecations/accordion-summary-classes/postcss-plugin.js +28 -0
- package/node/deprecations/accordion-summary-classes/postcss.config.js +8 -0
- package/node/deprecations/accordion-summary-classes/test-cases/actual.js +54 -0
- package/node/deprecations/accordion-summary-classes/test-cases/expected.js +54 -0
- package/node/deprecations/alert-classes/alert-classes.js +58 -0
- package/node/deprecations/alert-classes/index.js +13 -0
- package/node/deprecations/alert-classes/postcss-plugin.js +38 -0
- package/node/deprecations/alert-classes/postcss.config.js +8 -0
- package/node/deprecations/alert-classes/test-cases/actual.js +27 -0
- package/node/deprecations/alert-classes/test-cases/expected.js +27 -0
- package/node/deprecations/alert-props/alert-props.js +22 -0
- package/node/deprecations/alert-props/index.js +13 -0
- package/node/deprecations/alert-props/test-cases/actual.js +43 -0
- package/node/deprecations/alert-props/test-cases/expected.js +33 -0
- package/node/deprecations/alert-props/test-cases/theme.actual.js +52 -0
- package/node/deprecations/alert-props/test-cases/theme.expected.js +42 -0
- package/node/deprecations/all/deprecations-all.js +10 -0
- package/node/deprecations/all/postcss.config.js +20 -0
- package/node/deprecations/button-classes/button-classes.js +69 -0
- package/node/deprecations/button-classes/index.js +13 -0
- package/node/deprecations/button-classes/postcss-plugin.js +126 -0
- package/node/deprecations/button-classes/postcss.config.js +8 -0
- package/node/deprecations/button-classes/test-cases/actual.js +69 -0
- package/node/deprecations/button-classes/test-cases/expected.js +69 -0
- package/node/deprecations/chip-classes/chip-classes.js +77 -0
- package/node/deprecations/chip-classes/index.js +13 -0
- package/node/deprecations/chip-classes/postcss-plugin.js +105 -0
- package/node/deprecations/chip-classes/postcss.config.js +8 -0
- package/node/deprecations/chip-classes/test-cases/actual.js +55 -0
- package/node/deprecations/chip-classes/test-cases/expected.js +55 -0
- package/node/deprecations/pagination-item-classes/index.js +13 -0
- package/node/deprecations/pagination-item-classes/pagination-item-classes.js +58 -0
- package/node/deprecations/pagination-item-classes/postcss-plugin.js +39 -0
- package/node/deprecations/pagination-item-classes/postcss.config.js +8 -0
- package/node/deprecations/pagination-item-classes/test-cases/actual.js +108 -0
- package/node/deprecations/pagination-item-classes/test-cases/expected.js +108 -0
- package/node/deprecations/slider-props/index.js +13 -0
- package/node/deprecations/slider-props/slider-props.js +22 -0
- package/node/deprecations/slider-props/test-cases/actual.js +43 -0
- package/node/deprecations/slider-props/test-cases/expected.js +33 -0
- package/node/deprecations/slider-props/test-cases/theme.actual.js +52 -0
- package/node/deprecations/slider-props/test-cases/theme.expected.js +42 -0
- package/node/deprecations/utils/replaceComponentsWithSlots.js +184 -0
- package/node/util/findComponentDefaultProps.js +30 -0
- package/package.json +4 -2
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Chip = require("@mui/material/Chip");
|
|
4
|
+
'&.MuiChip-clickableColorPrimary';
|
|
5
|
+
'&.MuiChip-clickableColorSecondary';
|
|
6
|
+
'&.MuiChip-deletableColorPrimary';
|
|
7
|
+
'&.MuiChip-deletableColorSecondary';
|
|
8
|
+
'&.MuiChip-outlinedPrimary';
|
|
9
|
+
'&.MuiChip-outlinedSecondary';
|
|
10
|
+
'&.MuiChip-filledPrimary';
|
|
11
|
+
'&.MuiChip-filledSecondary';
|
|
12
|
+
'& .MuiChip-avatarSmall';
|
|
13
|
+
'& .MuiChip-avatarMedium';
|
|
14
|
+
'& .MuiChip-avatarColorPrimary';
|
|
15
|
+
'& .MuiChip-avatarColorSecondary';
|
|
16
|
+
'& .MuiChip-iconSmall';
|
|
17
|
+
'& .MuiChip-iconMedium';
|
|
18
|
+
'& .MuiChip-iconColorPrimary';
|
|
19
|
+
'& .MuiChip-iconColorSecondary';
|
|
20
|
+
'& .MuiChip-labelSmall';
|
|
21
|
+
'& .MuiChip-labelMedium';
|
|
22
|
+
'& .MuiChip-deleteIconSmall';
|
|
23
|
+
'& .MuiChip-deleteIconMedium';
|
|
24
|
+
'& .MuiChip-deleteIconColorPrimary';
|
|
25
|
+
'& .MuiChip-deleteIconColorSecondary';
|
|
26
|
+
'& .MuiChip-deleteIconFilledColorPrimary';
|
|
27
|
+
'& .MuiChip-deleteIconFilledColorSecondary';
|
|
28
|
+
'& .MuiChip-deleteIconOutlinedColorPrimary';
|
|
29
|
+
'& .MuiChip-deleteIconOutlinedColorSecondary';
|
|
30
|
+
`&.${_Chip.chipClasses.clickableColorPrimary}`;
|
|
31
|
+
`&.${_Chip.chipClasses.clickableColorSecondary}`;
|
|
32
|
+
`&.${_Chip.chipClasses.deletableColorPrimary}`;
|
|
33
|
+
`&.${_Chip.chipClasses.deletableColorSecondary}`;
|
|
34
|
+
`&.${_Chip.chipClasses.outlinedPrimary}`;
|
|
35
|
+
`&.${_Chip.chipClasses.outlinedSecondary}`;
|
|
36
|
+
`&.${_Chip.chipClasses.filledPrimary}`;
|
|
37
|
+
`&.${_Chip.chipClasses.filledSecondary}`;
|
|
38
|
+
`& .${_Chip.chipClasses.avatarSmall}`;
|
|
39
|
+
`& .${_Chip.chipClasses.avatarMedium}`;
|
|
40
|
+
`& .${_Chip.chipClasses.avatarColorPrimary}`;
|
|
41
|
+
`& .${_Chip.chipClasses.avatarColorSecondary}`;
|
|
42
|
+
`& .${_Chip.chipClasses.iconSmall}`;
|
|
43
|
+
`& .${_Chip.chipClasses.iconMedium}`;
|
|
44
|
+
`& .${_Chip.chipClasses.iconColorPrimary}`;
|
|
45
|
+
`& .${_Chip.chipClasses.iconColorSecondary}`;
|
|
46
|
+
`& .${_Chip.chipClasses.labelSmall}`;
|
|
47
|
+
`& .${_Chip.chipClasses.labelMedium}`;
|
|
48
|
+
`& .${_Chip.chipClasses.deleteIconSmall}`;
|
|
49
|
+
`& .${_Chip.chipClasses.deleteIconMedium}`;
|
|
50
|
+
`& .${_Chip.chipClasses.deleteIconColorPrimary}`;
|
|
51
|
+
`& .${_Chip.chipClasses.deleteIconColorSecondary}`;
|
|
52
|
+
`& .${_Chip.chipClasses.deleteIconFilledColorPrimary}`;
|
|
53
|
+
`& .${_Chip.chipClasses.deleteIconFilledColorSecondary}`;
|
|
54
|
+
`& .${_Chip.chipClasses.deleteIconOutlinedColorPrimary}`;
|
|
55
|
+
`& .${_Chip.chipClasses.deleteIconOutlinedColorSecondary}`;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Chip = require("@mui/material/Chip");
|
|
4
|
+
"&.MuiChip-clickable.MuiChip-colorPrimary";
|
|
5
|
+
"&.MuiChip-clickable.MuiChip-colorSecondary";
|
|
6
|
+
"&.MuiChip-deletable.MuiChip-colorPrimary";
|
|
7
|
+
"&.MuiChip-deletable.MuiChip-colorSecondary";
|
|
8
|
+
"&.MuiChip-outlined.MuiChip-colorPrimary";
|
|
9
|
+
"&.MuiChip-outlined.MuiChip-colorSecondary";
|
|
10
|
+
"&.MuiChip-filled.MuiChip-colorPrimary";
|
|
11
|
+
"&.MuiChip-filled.MuiChip-colorSecondary";
|
|
12
|
+
"&.MuiChip-sizeSmall > .MuiChip-avatar";
|
|
13
|
+
"&.MuiChip-sizeMedium > .MuiChip-avatar";
|
|
14
|
+
"&.MuiChip-colorPrimary > .MuiChip-avatar";
|
|
15
|
+
"&.MuiChip-colorSecondary > .MuiChip-avatar";
|
|
16
|
+
"&.MuiChip-sizeSmall > .MuiChip-icon";
|
|
17
|
+
"&.MuiChip-sizeMedium > .MuiChip-icon";
|
|
18
|
+
"&.MuiChip-colorPrimary > .MuiChip-icon";
|
|
19
|
+
"&.MuiChip-colorSecondary > .MuiChip-icon";
|
|
20
|
+
"&.MuiChip-sizeSmall > .MuiChip-label";
|
|
21
|
+
"&.MuiChip-sizeMedium > .MuiChip-label";
|
|
22
|
+
"&.MuiChip-sizeSmall > .MuiChip-deleteIcon";
|
|
23
|
+
"&.MuiChip-sizeMedium > .MuiChip-deleteIcon";
|
|
24
|
+
"&.MuiChip-colorPrimary > .MuiChip-deleteIcon";
|
|
25
|
+
"&.MuiChip-colorSecondary > .MuiChip-deleteIcon";
|
|
26
|
+
"&.MuiChip-filled.MuiChip-colorPrimary > .MuiChip-deleteIcon";
|
|
27
|
+
"&.MuiChip-filled.MuiChip-colorSecondary > .MuiChip-deleteIcon";
|
|
28
|
+
"&.MuiChip-outlined.MuiChip-colorPrimary > .MuiChip-deleteIcon";
|
|
29
|
+
"&.MuiChip-outlined.MuiChip-colorSecondary > .MuiChip-deleteIcon";
|
|
30
|
+
`&.${_Chip.chipClasses.clickable}.${_Chip.chipClasses.colorPrimary}`;
|
|
31
|
+
`&.${_Chip.chipClasses.clickable}.${_Chip.chipClasses.colorSecondary}`;
|
|
32
|
+
`&.${_Chip.chipClasses.deletable}.${_Chip.chipClasses.colorPrimary}`;
|
|
33
|
+
`&.${_Chip.chipClasses.deletable}.${_Chip.chipClasses.colorSecondary}`;
|
|
34
|
+
`&.${_Chip.chipClasses.outlined}.${_Chip.chipClasses.colorPrimary}`;
|
|
35
|
+
`&.${_Chip.chipClasses.outlined}.${_Chip.chipClasses.colorSecondary}`;
|
|
36
|
+
`&.${_Chip.chipClasses.filled}.${_Chip.chipClasses.colorPrimary}`;
|
|
37
|
+
`&.${_Chip.chipClasses.filled}.${_Chip.chipClasses.colorSecondary}`;
|
|
38
|
+
`&.${_Chip.chipClasses.sizeSmall} > .${_Chip.chipClasses.avatar}`;
|
|
39
|
+
`&.${_Chip.chipClasses.sizeMedium} > .${_Chip.chipClasses.avatar}`;
|
|
40
|
+
`&.${_Chip.chipClasses.colorPrimary} > .${_Chip.chipClasses.avatar}`;
|
|
41
|
+
`&.${_Chip.chipClasses.colorSecondary} > .${_Chip.chipClasses.avatar}`;
|
|
42
|
+
`&.${_Chip.chipClasses.sizeSmall} > .${_Chip.chipClasses.icon}`;
|
|
43
|
+
`&.${_Chip.chipClasses.sizeMedium} > .${_Chip.chipClasses.icon}`;
|
|
44
|
+
`&.${_Chip.chipClasses.colorPrimary} > .${_Chip.chipClasses.icon}`;
|
|
45
|
+
`&.${_Chip.chipClasses.colorSecondary} > .${_Chip.chipClasses.icon}`;
|
|
46
|
+
`&.${_Chip.chipClasses.sizeSmall} > .${_Chip.chipClasses.label}`;
|
|
47
|
+
`&.${_Chip.chipClasses.sizeMedium} > .${_Chip.chipClasses.label}`;
|
|
48
|
+
`&.${_Chip.chipClasses.sizeSmall} > .${_Chip.chipClasses.deleteIcon}`;
|
|
49
|
+
`&.${_Chip.chipClasses.sizeMedium} > .${_Chip.chipClasses.deleteIcon}`;
|
|
50
|
+
`&.${_Chip.chipClasses.colorPrimary} > .${_Chip.chipClasses.deleteIcon}`;
|
|
51
|
+
`&.${_Chip.chipClasses.colorSecondary} > .${_Chip.chipClasses.deleteIcon}`;
|
|
52
|
+
`&.${_Chip.chipClasses.filled}.${_Chip.chipClasses.colorPrimary} > .${_Chip.chipClasses.deleteIcon}`;
|
|
53
|
+
`&.${_Chip.chipClasses.filled}.${_Chip.chipClasses.colorSecondary} > .${_Chip.chipClasses.deleteIcon}`;
|
|
54
|
+
`&.${_Chip.chipClasses.outlined}.${_Chip.chipClasses.colorPrimary} > .${_Chip.chipClasses.deleteIcon}`;
|
|
55
|
+
`&.${_Chip.chipClasses.outlined}.${_Chip.chipClasses.colorSecondary} > .${_Chip.chipClasses.deleteIcon}`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _paginationItemClasses.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _paginationItemClasses = _interopRequireDefault(require("./pagination-item-classes"));
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = transformer;
|
|
7
|
+
var _postcssPlugin = require("./postcss-plugin");
|
|
8
|
+
/**
|
|
9
|
+
* @param {import('jscodeshift').FileInfo} file
|
|
10
|
+
* @param {import('jscodeshift').API} api
|
|
11
|
+
*/
|
|
12
|
+
function transformer(file, api, options) {
|
|
13
|
+
const j = api.jscodeshift;
|
|
14
|
+
const root = j(file.source);
|
|
15
|
+
const printOptions = options.printOptions;
|
|
16
|
+
_postcssPlugin.classes.forEach(({
|
|
17
|
+
deprecatedClass,
|
|
18
|
+
replacementSelector
|
|
19
|
+
}) => {
|
|
20
|
+
root.find(j.ImportDeclaration).filter(path => path.node.source.value.match(/^@mui\/material\/PaginationItem$/)).forEach(path => {
|
|
21
|
+
path.node.specifiers.forEach(specifier => {
|
|
22
|
+
if (specifier.type === 'ImportSpecifier' && specifier.imported.name === 'paginationItemClasses') {
|
|
23
|
+
const deprecatedAtomicClass = deprecatedClass.replace('.MuiPaginationItem-', '');
|
|
24
|
+
root.find(j.MemberExpression, {
|
|
25
|
+
object: {
|
|
26
|
+
name: specifier.local.name
|
|
27
|
+
},
|
|
28
|
+
property: {
|
|
29
|
+
name: deprecatedAtomicClass
|
|
30
|
+
}
|
|
31
|
+
}).forEach(memberExpression => {
|
|
32
|
+
const parent = memberExpression.parentPath.parentPath.value;
|
|
33
|
+
if (parent.type === j.TemplateLiteral.name) {
|
|
34
|
+
const memberExpressionIndex = parent.expressions.findIndex(expression => expression === memberExpression.value);
|
|
35
|
+
const precedingTemplateElement = parent.quasis[memberExpressionIndex];
|
|
36
|
+
const atomicClasses = replacementSelector.replaceAll('MuiPaginationItem-', '').replaceAll('&.', '').split('.').filter(Boolean);
|
|
37
|
+
if (precedingTemplateElement.value.raw.endsWith('&.')) {
|
|
38
|
+
parent.expressions.splice(memberExpressionIndex, 1, j.memberExpression(memberExpression.value.object, j.identifier(atomicClasses[0])), j.memberExpression(memberExpression.value.object, j.identifier(atomicClasses[1])));
|
|
39
|
+
parent.quasis.splice(memberExpressionIndex, 1, j.templateElement({
|
|
40
|
+
raw: precedingTemplateElement.value.raw,
|
|
41
|
+
cooked: precedingTemplateElement.value.cooked
|
|
42
|
+
}, false), j.templateElement({
|
|
43
|
+
raw: '.',
|
|
44
|
+
cooked: '.'
|
|
45
|
+
}, false));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
const selectorRegex = new RegExp(`^&${deprecatedClass}`);
|
|
53
|
+
root.find(j.Literal, literal => typeof literal.value === 'string' && literal.value.match(selectorRegex)).forEach(path => {
|
|
54
|
+
path.replace(j.literal(path.value.value.replace(selectorRegex, `&${replacementSelector}`)));
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
return root.toSource(printOptions);
|
|
58
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const classes = [{
|
|
4
|
+
deprecatedClass: '.MuiPaginationItem-textPrimary',
|
|
5
|
+
replacementSelector: '.MuiPaginationItem-text.MuiPaginationItem-colorPrimary'
|
|
6
|
+
}, {
|
|
7
|
+
deprecatedClass: '.MuiPaginationItem-textSecondary',
|
|
8
|
+
replacementSelector: '.MuiPaginationItem-text.MuiPaginationItem-colorSecondary'
|
|
9
|
+
}, {
|
|
10
|
+
deprecatedClass: '.MuiPaginationItem-outlinedPrimary',
|
|
11
|
+
replacementSelector: '.MuiPaginationItem-outlined.MuiPaginationItem-colorPrimary'
|
|
12
|
+
}, {
|
|
13
|
+
deprecatedClass: '.MuiPaginationItem-outlinedSecondary',
|
|
14
|
+
replacementSelector: '.MuiPaginationItem-outlined.MuiPaginationItem-colorSecondary'
|
|
15
|
+
}];
|
|
16
|
+
const plugin = () => {
|
|
17
|
+
return {
|
|
18
|
+
postcssPlugin: `Replace deperecated PaginationItem classes with new classes`,
|
|
19
|
+
Rule(rule) {
|
|
20
|
+
const {
|
|
21
|
+
selector
|
|
22
|
+
} = rule;
|
|
23
|
+
classes.forEach(({
|
|
24
|
+
deprecatedClass,
|
|
25
|
+
replacementSelector
|
|
26
|
+
}) => {
|
|
27
|
+
const selectorRegex = new RegExp(`${deprecatedClass}`);
|
|
28
|
+
if (selector.match(selectorRegex)) {
|
|
29
|
+
rule.selector = selector.replace(selectorRegex, replacementSelector);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
plugin.postcss = true;
|
|
36
|
+
module.exports = {
|
|
37
|
+
plugin,
|
|
38
|
+
classes
|
|
39
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _PaginationItem = require("@mui/material/PaginationItem");
|
|
4
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
fn({
|
|
6
|
+
MuiPaginationItem: {
|
|
7
|
+
styleOverrides: {
|
|
8
|
+
root: {
|
|
9
|
+
'&.MuiPaginationItem-textPrimary': {
|
|
10
|
+
color: 'red'
|
|
11
|
+
},
|
|
12
|
+
'&.MuiPaginationItem-textSecondary': {
|
|
13
|
+
color: 'red'
|
|
14
|
+
},
|
|
15
|
+
'&.MuiPaginationItem-outlinedPrimary': {
|
|
16
|
+
color: 'red'
|
|
17
|
+
},
|
|
18
|
+
'&.MuiPaginationItem-outlinedSecondary': {
|
|
19
|
+
color: 'red'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
fn({
|
|
26
|
+
MuiPaginationItem: {
|
|
27
|
+
styleOverrides: {
|
|
28
|
+
root: {
|
|
29
|
+
[`&.${_PaginationItem.paginationItemClasses.textPrimary}`]: {
|
|
30
|
+
color: 'red'
|
|
31
|
+
},
|
|
32
|
+
[`&.${_PaginationItem.paginationItemClasses.textSecondary}`]: {
|
|
33
|
+
color: 'red'
|
|
34
|
+
},
|
|
35
|
+
[`&.${_PaginationItem.paginationItemClasses.outlinedPrimary}`]: {
|
|
36
|
+
color: 'red'
|
|
37
|
+
},
|
|
38
|
+
[`&.${_PaginationItem.paginationItemClasses.outlinedSecondary}`]: {
|
|
39
|
+
color: 'red'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
styled(Component)(() => {
|
|
46
|
+
return {
|
|
47
|
+
'&.MuiPaginationItem-textPrimary': {
|
|
48
|
+
color: 'red'
|
|
49
|
+
},
|
|
50
|
+
'&.MuiPaginationItem-textSecondary': {
|
|
51
|
+
color: 'red'
|
|
52
|
+
},
|
|
53
|
+
'&.MuiPaginationItem-outlinedPrimary': {
|
|
54
|
+
color: 'red'
|
|
55
|
+
},
|
|
56
|
+
'&.MuiPaginationItem-outlinedSecondary': {
|
|
57
|
+
color: 'red'
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
styled(Component)(() => {
|
|
62
|
+
return {
|
|
63
|
+
[`&.${_PaginationItem.paginationItemClasses.textPrimary}`]: {
|
|
64
|
+
color: 'red'
|
|
65
|
+
},
|
|
66
|
+
[`&.${_PaginationItem.paginationItemClasses.textSecondary}`]: {
|
|
67
|
+
color: 'red'
|
|
68
|
+
},
|
|
69
|
+
[`&.${_PaginationItem.paginationItemClasses.outlinedPrimary}`]: {
|
|
70
|
+
color: 'red'
|
|
71
|
+
},
|
|
72
|
+
[`&.${_PaginationItem.paginationItemClasses.outlinedSecondary}`]: {
|
|
73
|
+
color: 'red'
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(PaginationItem, {
|
|
78
|
+
sx: {
|
|
79
|
+
'&.MuiPaginationItem-textPrimary': {
|
|
80
|
+
color: 'red'
|
|
81
|
+
},
|
|
82
|
+
'&.MuiPaginationItem-textSecondary': {
|
|
83
|
+
color: 'red'
|
|
84
|
+
},
|
|
85
|
+
'&.MuiPaginationItem-outlinedPrimary': {
|
|
86
|
+
color: 'red'
|
|
87
|
+
},
|
|
88
|
+
'&.MuiPaginationItem-outlinedSecondary': {
|
|
89
|
+
color: 'red'
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(PaginationItem, {
|
|
94
|
+
sx: {
|
|
95
|
+
[`&.${_PaginationItem.paginationItemClasses.textPrimary}`]: {
|
|
96
|
+
color: 'red'
|
|
97
|
+
},
|
|
98
|
+
[`&.${_PaginationItem.paginationItemClasses.textSecondary}`]: {
|
|
99
|
+
color: 'red'
|
|
100
|
+
},
|
|
101
|
+
[`&.${_PaginationItem.paginationItemClasses.outlinedPrimary}`]: {
|
|
102
|
+
color: 'red'
|
|
103
|
+
},
|
|
104
|
+
[`&.${_PaginationItem.paginationItemClasses.outlinedSecondary}`]: {
|
|
105
|
+
color: 'red'
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
});
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _PaginationItem = require("@mui/material/PaginationItem");
|
|
4
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
fn({
|
|
6
|
+
MuiPaginationItem: {
|
|
7
|
+
styleOverrides: {
|
|
8
|
+
root: {
|
|
9
|
+
"&.MuiPaginationItem-text.MuiPaginationItem-colorPrimary": {
|
|
10
|
+
color: 'red'
|
|
11
|
+
},
|
|
12
|
+
"&.MuiPaginationItem-text.MuiPaginationItem-colorSecondary": {
|
|
13
|
+
color: 'red'
|
|
14
|
+
},
|
|
15
|
+
"&.MuiPaginationItem-outlined.MuiPaginationItem-colorPrimary": {
|
|
16
|
+
color: 'red'
|
|
17
|
+
},
|
|
18
|
+
"&.MuiPaginationItem-outlined.MuiPaginationItem-colorSecondary": {
|
|
19
|
+
color: 'red'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
fn({
|
|
26
|
+
MuiPaginationItem: {
|
|
27
|
+
styleOverrides: {
|
|
28
|
+
root: {
|
|
29
|
+
[`&.${_PaginationItem.paginationItemClasses.text}.${_PaginationItem.paginationItemClasses.colorPrimary}`]: {
|
|
30
|
+
color: 'red'
|
|
31
|
+
},
|
|
32
|
+
[`&.${_PaginationItem.paginationItemClasses.text}.${_PaginationItem.paginationItemClasses.colorSecondary}`]: {
|
|
33
|
+
color: 'red'
|
|
34
|
+
},
|
|
35
|
+
[`&.${_PaginationItem.paginationItemClasses.outlined}.${_PaginationItem.paginationItemClasses.colorPrimary}`]: {
|
|
36
|
+
color: 'red'
|
|
37
|
+
},
|
|
38
|
+
[`&.${_PaginationItem.paginationItemClasses.outlined}.${_PaginationItem.paginationItemClasses.colorSecondary}`]: {
|
|
39
|
+
color: 'red'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
styled(Component)(() => {
|
|
46
|
+
return {
|
|
47
|
+
"&.MuiPaginationItem-text.MuiPaginationItem-colorPrimary": {
|
|
48
|
+
color: 'red'
|
|
49
|
+
},
|
|
50
|
+
"&.MuiPaginationItem-text.MuiPaginationItem-colorSecondary": {
|
|
51
|
+
color: 'red'
|
|
52
|
+
},
|
|
53
|
+
"&.MuiPaginationItem-outlined.MuiPaginationItem-colorPrimary": {
|
|
54
|
+
color: 'red'
|
|
55
|
+
},
|
|
56
|
+
"&.MuiPaginationItem-outlined.MuiPaginationItem-colorSecondary": {
|
|
57
|
+
color: 'red'
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
styled(Component)(() => {
|
|
62
|
+
return {
|
|
63
|
+
[`&.${_PaginationItem.paginationItemClasses.text}.${_PaginationItem.paginationItemClasses.colorPrimary}`]: {
|
|
64
|
+
color: 'red'
|
|
65
|
+
},
|
|
66
|
+
[`&.${_PaginationItem.paginationItemClasses.text}.${_PaginationItem.paginationItemClasses.colorSecondary}`]: {
|
|
67
|
+
color: 'red'
|
|
68
|
+
},
|
|
69
|
+
[`&.${_PaginationItem.paginationItemClasses.outlined}.${_PaginationItem.paginationItemClasses.colorPrimary}`]: {
|
|
70
|
+
color: 'red'
|
|
71
|
+
},
|
|
72
|
+
[`&.${_PaginationItem.paginationItemClasses.outlined}.${_PaginationItem.paginationItemClasses.colorSecondary}`]: {
|
|
73
|
+
color: 'red'
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(PaginationItem, {
|
|
78
|
+
sx: {
|
|
79
|
+
"&.MuiPaginationItem-text.MuiPaginationItem-colorPrimary": {
|
|
80
|
+
color: 'red'
|
|
81
|
+
},
|
|
82
|
+
"&.MuiPaginationItem-text.MuiPaginationItem-colorSecondary": {
|
|
83
|
+
color: 'red'
|
|
84
|
+
},
|
|
85
|
+
"&.MuiPaginationItem-outlined.MuiPaginationItem-colorPrimary": {
|
|
86
|
+
color: 'red'
|
|
87
|
+
},
|
|
88
|
+
"&.MuiPaginationItem-outlined.MuiPaginationItem-colorSecondary": {
|
|
89
|
+
color: 'red'
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(PaginationItem, {
|
|
94
|
+
sx: {
|
|
95
|
+
[`&.${_PaginationItem.paginationItemClasses.text}.${_PaginationItem.paginationItemClasses.colorPrimary}`]: {
|
|
96
|
+
color: 'red'
|
|
97
|
+
},
|
|
98
|
+
[`&.${_PaginationItem.paginationItemClasses.text}.${_PaginationItem.paginationItemClasses.colorSecondary}`]: {
|
|
99
|
+
color: 'red'
|
|
100
|
+
},
|
|
101
|
+
[`&.${_PaginationItem.paginationItemClasses.outlined}.${_PaginationItem.paginationItemClasses.colorPrimary}`]: {
|
|
102
|
+
color: 'red'
|
|
103
|
+
},
|
|
104
|
+
[`&.${_PaginationItem.paginationItemClasses.outlined}.${_PaginationItem.paginationItemClasses.colorSecondary}`]: {
|
|
105
|
+
color: 'red'
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _sliderProps.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _sliderProps = _interopRequireDefault(require("./slider-props"));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = transformer;
|
|
8
|
+
var _replaceComponentsWithSlots = _interopRequireDefault(require("../utils/replaceComponentsWithSlots"));
|
|
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, _replaceComponentsWithSlots.default)(j, {
|
|
18
|
+
root,
|
|
19
|
+
componentName: 'Slider'
|
|
20
|
+
});
|
|
21
|
+
return root.toSource(printOptions);
|
|
22
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _Slider = _interopRequireDefault(require("@mui/material/Slider"));
|
|
5
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Slider.default, {
|
|
7
|
+
components: {
|
|
8
|
+
Track: ComponentsTrack
|
|
9
|
+
},
|
|
10
|
+
componentsProps: {
|
|
11
|
+
track: componentsTrackProps
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Slider.default, {
|
|
15
|
+
slots: {
|
|
16
|
+
rail: SlotsRail
|
|
17
|
+
},
|
|
18
|
+
components: {
|
|
19
|
+
Track: ComponentsTrack
|
|
20
|
+
},
|
|
21
|
+
slotProps: {
|
|
22
|
+
rail: slotsRailProps
|
|
23
|
+
},
|
|
24
|
+
componentsProps: {
|
|
25
|
+
track: componentsTrackProps
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Slider.default, {
|
|
29
|
+
slots: {
|
|
30
|
+
rail: SlotsRail,
|
|
31
|
+
track: SlotsTrack
|
|
32
|
+
},
|
|
33
|
+
components: {
|
|
34
|
+
Track: ComponentsTrack
|
|
35
|
+
},
|
|
36
|
+
slotProps: {
|
|
37
|
+
rail: slotsRailProps,
|
|
38
|
+
track: slotsTrackProps
|
|
39
|
+
},
|
|
40
|
+
componentsProps: {
|
|
41
|
+
track: componentsTrackProps
|
|
42
|
+
}
|
|
43
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _Slider = _interopRequireDefault(require("@mui/material/Slider"));
|
|
5
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Slider.default, {
|
|
7
|
+
slots: {
|
|
8
|
+
track: ComponentsTrack
|
|
9
|
+
},
|
|
10
|
+
slotProps: {
|
|
11
|
+
track: componentsTrackProps
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Slider.default, {
|
|
15
|
+
slots: {
|
|
16
|
+
rail: SlotsRail,
|
|
17
|
+
track: ComponentsTrack
|
|
18
|
+
},
|
|
19
|
+
slotProps: {
|
|
20
|
+
rail: slotsRailProps,
|
|
21
|
+
track: componentsTrackProps
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Slider.default, {
|
|
25
|
+
slots: {
|
|
26
|
+
rail: SlotsRail,
|
|
27
|
+
track: SlotsTrack
|
|
28
|
+
},
|
|
29
|
+
slotProps: {
|
|
30
|
+
rail: slotsRailProps,
|
|
31
|
+
track: slotsTrackProps
|
|
32
|
+
}
|
|
33
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiSlider: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
components: {
|
|
7
|
+
Track: ComponentsTrack
|
|
8
|
+
},
|
|
9
|
+
componentsProps: {
|
|
10
|
+
track: componentsTrackProps
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
fn({
|
|
16
|
+
MuiSlider: {
|
|
17
|
+
defaultProps: {
|
|
18
|
+
components: {
|
|
19
|
+
Track: ComponentsTrack
|
|
20
|
+
},
|
|
21
|
+
slots: {
|
|
22
|
+
rail: SlotsRail
|
|
23
|
+
},
|
|
24
|
+
componentsProps: {
|
|
25
|
+
track: componentsTrackProps
|
|
26
|
+
},
|
|
27
|
+
slotProps: {
|
|
28
|
+
rail: slotsRailProps
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
fn({
|
|
34
|
+
MuiSlider: {
|
|
35
|
+
defaultProps: {
|
|
36
|
+
components: {
|
|
37
|
+
Track: ComponentsTrack
|
|
38
|
+
},
|
|
39
|
+
slots: {
|
|
40
|
+
rail: SlotsRail,
|
|
41
|
+
track: SlotsTrack
|
|
42
|
+
},
|
|
43
|
+
componentsProps: {
|
|
44
|
+
track: componentsTrackProps
|
|
45
|
+
},
|
|
46
|
+
slotProps: {
|
|
47
|
+
rail: slotsRailProps,
|
|
48
|
+
track: slotsTrackProps
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiSlider: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
slots: {
|
|
7
|
+
track: ComponentsTrack
|
|
8
|
+
},
|
|
9
|
+
slotProps: {
|
|
10
|
+
track: componentsTrackProps
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
fn({
|
|
16
|
+
MuiSlider: {
|
|
17
|
+
defaultProps: {
|
|
18
|
+
slots: {
|
|
19
|
+
track: ComponentsTrack,
|
|
20
|
+
rail: SlotsRail
|
|
21
|
+
},
|
|
22
|
+
slotProps: {
|
|
23
|
+
track: componentsTrackProps,
|
|
24
|
+
rail: slotsRailProps
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
fn({
|
|
30
|
+
MuiSlider: {
|
|
31
|
+
defaultProps: {
|
|
32
|
+
slots: {
|
|
33
|
+
track: SlotsTrack,
|
|
34
|
+
rail: SlotsRail
|
|
35
|
+
},
|
|
36
|
+
slotProps: {
|
|
37
|
+
track: slotsTrackProps,
|
|
38
|
+
rail: slotsRailProps
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|