@mui/codemod 6.0.0-alpha.8 → 6.0.0-alpha.9

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 (49) hide show
  1. package/README.md +219 -45
  2. package/node/deprecations/all/deprecations-all.js +4 -0
  3. package/node/deprecations/avatar-group-props/avatar-group-props.js +87 -0
  4. package/node/deprecations/avatar-group-props/index.js +13 -0
  5. package/node/deprecations/avatar-group-props/test-cases/actual.js +56 -0
  6. package/node/deprecations/avatar-group-props/test-cases/expected.js +58 -0
  7. package/node/deprecations/avatar-group-props/test-cases/theme.actual.js +48 -0
  8. package/node/deprecations/avatar-group-props/test-cases/theme.expected.js +50 -0
  9. package/node/deprecations/grid-props/grid-props.js +51 -0
  10. package/node/deprecations/grid-props/index.js +13 -0
  11. package/node/deprecations/grid-props/test-cases/actual.js +25 -0
  12. package/node/deprecations/grid-props/test-cases/expected.js +23 -0
  13. package/node/deprecations/grid-props/test-cases/theme.actual.js +24 -0
  14. package/node/deprecations/grid-props/test-cases/theme.expected.js +23 -0
  15. package/node/deprecations/list-item-props/index.js +13 -0
  16. package/node/deprecations/list-item-props/list-item-props.js +22 -0
  17. package/node/deprecations/list-item-props/test-cases/actual.js +43 -0
  18. package/node/deprecations/list-item-props/test-cases/expected.js +40 -0
  19. package/node/deprecations/list-item-props/test-cases/theme.actual.js +56 -0
  20. package/node/deprecations/list-item-props/test-cases/theme.expected.js +53 -0
  21. package/node/deprecations/popper-props/index.js +13 -0
  22. package/node/deprecations/popper-props/popper-props.js +22 -0
  23. package/node/deprecations/popper-props/test-cases/actual.js +27 -0
  24. package/node/deprecations/popper-props/test-cases/expected.js +24 -0
  25. package/node/deprecations/popper-props/test-cases/theme.actual.js +32 -0
  26. package/node/deprecations/popper-props/test-cases/theme.expected.js +29 -0
  27. package/node/deprecations/tooltip-props/index.js +13 -0
  28. package/node/deprecations/tooltip-props/test-cases/actual.js +92 -0
  29. package/node/deprecations/tooltip-props/test-cases/expected.js +84 -0
  30. package/node/deprecations/tooltip-props/test-cases/theme.actual.js +73 -0
  31. package/node/deprecations/tooltip-props/test-cases/theme.expected.js +65 -0
  32. package/node/deprecations/tooltip-props/tooltip-props.js +22 -0
  33. package/node/util/migrateToVariants.js +156 -98
  34. package/node/v6.0.0/sx-prop/index.js +13 -0
  35. package/node/v6.0.0/sx-prop/sx-v6.js +355 -0
  36. package/node/v6.0.0/sx-prop/test-cases/basic-sx.actual.js +36 -0
  37. package/node/v6.0.0/sx-prop/test-cases/basic-sx.expected.js +46 -0
  38. package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.actual.js +41 -0
  39. package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.expected.js +71 -0
  40. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.actual.js +87 -0
  41. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.expected.js +102 -0
  42. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic2.actual.js +49 -0
  43. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic2.expected.js +64 -0
  44. package/node/v6.0.0/system-props/index.js +13 -0
  45. package/node/v6.0.0/system-props/removeSystemProps.js +242 -0
  46. package/node/v6.0.0/system-props/test-cases/system-props.actual.js +79 -0
  47. package/node/v6.0.0/system-props/test-cases/system-props.expected.js +92 -0
  48. package/node/v6.0.0/theme-v6/theme-v6.js +2 -2
  49. package/package.json +4 -4
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+
3
+ var _jsxRuntime = require("react/jsx-runtime");
4
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
5
+ sx: theme => ({
6
+ mb: 1,
7
+ display: 'flex',
8
+ justifyContent: 'space-between',
9
+ alignItems: 'center',
10
+ gap: 2,
11
+ backgroundColor: theme.palette.grey[900],
12
+ borderBottom: `1px solid ${'grey.800'}`,
13
+ ...theme.applyStyles("light", {
14
+ backgroundColor: theme.palette.grey[100],
15
+ borderBottom: `1px solid ${'grey.200'}`
16
+ })
17
+ })
18
+ });
19
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Card, {
20
+ sx: [theme => ({
21
+ p: 2,
22
+ display: 'flex',
23
+ flexDirection: 'column',
24
+ gap: 4
25
+ }), tier.title === 'Professional' && (theme => ({
26
+ border: 'none',
27
+ boxShadow: `0 8px 12px hsla(0, 0%, 0%, 0.8)`,
28
+ background: 'radial-gradient(circle at 50% 0%, hsl(210, 98%, 35%), hsl(210, 100%, 16%))',
29
+ ...theme.applyStyles("light", {
30
+ boxShadow: `0 8px 12px hsla(210, 98%, 42%, 0.2)`
31
+ })
32
+ }))]
33
+ });
34
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Card, {
35
+ component: Button,
36
+ onClick: () => handleItemClick(index),
37
+ sx: [theme => ({
38
+ p: 3,
39
+ height: 'fit-content',
40
+ width: '100%',
41
+ background: 'none',
42
+ '&:hover': {
43
+ background: 'linear-gradient(to right bottom, hsla(210, 100%, 12%, 0.2) 25%, hsla(210, 100%, 16%, 0.2) 100%)',
44
+ borderColor: 'primary.dark',
45
+ boxShadow: '0px 1px 8px hsla(210, 100%, 25%, 0.5) ',
46
+ ...theme.applyStyles("light", {
47
+ background: 'linear-gradient(to bottom right, hsla(210, 100%, 97%, 0.5) 25%, hsla(210, 100%, 90%, 0.3) 100%)',
48
+ borderColor: 'primary.light',
49
+ boxShadow: '0px 2px 8px hsla(0, 0%, 0%, 0.1)'
50
+ })
51
+ }
52
+ }), selectedItemIndex === index && (theme => ({
53
+ backgroundColor: 'action.selected',
54
+ borderColor: 'primary.dark',
55
+ ...theme.applyStyles("light", {
56
+ borderColor: 'primary.light'
57
+ })
58
+ }))]
59
+ }, index);
60
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(CreditCardRoundedIcon, {
61
+ fontSize: "small",
62
+ sx: [theme => ({
63
+ color: 'grey.600',
64
+ ...theme.applyStyles("light", {
65
+ color: 'grey.400'
66
+ })
67
+ }), paymentType === 'creditCard' && {
68
+ color: 'primary.main'
69
+ }]
70
+ });
71
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(IconButton, {
72
+ edge: "start",
73
+ color: "inherit",
74
+ "aria-label": "open drawer",
75
+ onClick: toggleDrawer,
76
+ sx: [{
77
+ marginRight: '36px'
78
+ }, open && {
79
+ display: 'none'
80
+ }],
81
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(MenuIcon, {})
82
+ });
83
+ /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
84
+ sx: [selectedItemIndex === index && (theme => ({
85
+ backgroundColor: 'action.selected',
86
+ borderColor: 'primary.dark',
87
+ ...theme.applyStyles("light", {
88
+ borderColor: 'primary.light'
89
+ })
90
+ })), theme => ({
91
+ color: 'grey.600',
92
+ ...theme.applyStyles("light", {
93
+ color: 'grey.400'
94
+ })
95
+ }), paymentType === 'creditCard' && {
96
+ color: 'primary.main'
97
+ }, {
98
+ marginRight: '36px'
99
+ }, open && {
100
+ display: 'none'
101
+ }]
102
+ });
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ var _jsxRuntime = require("react/jsx-runtime");
4
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Accordion, {
5
+ expanded: expanded,
6
+ onChange: handleExpansion,
7
+ slotProps: {
8
+ transition: {
9
+ timeout: 400
10
+ }
11
+ },
12
+ sx: {
13
+ '& .MuiAccordion-region': {
14
+ height: expanded ? 'auto' : 0
15
+ },
16
+ '& .MuiAccordionDetails-root': {
17
+ display: expanded ? 'block' : 'none'
18
+ }
19
+ }
20
+ });
21
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
22
+ sx: {
23
+ display: 'flex',
24
+ flexDirection: {
25
+ xs: 'column-reverse',
26
+ sm: 'row'
27
+ },
28
+ justifyContent: activeStep !== 0 ? 'space-between' : 'flex-end',
29
+ alignItems: 'end',
30
+ flexGrow: 1,
31
+ gap: 1,
32
+ pb: {
33
+ xs: 12,
34
+ sm: 0
35
+ },
36
+ mt: {
37
+ xs: 2,
38
+ sm: 0
39
+ },
40
+ mb: '60px'
41
+ }
42
+ });
43
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
44
+ sx: {
45
+ display: 'flex',
46
+ alignItems: 'baseline',
47
+ color: tier.title === 'Professional' ? 'grey.50' : undefined
48
+ }
49
+ });
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+
3
+ var _jsxRuntime = require("react/jsx-runtime");
4
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Accordion, {
5
+ expanded: expanded,
6
+ onChange: handleExpansion,
7
+ slotProps: {
8
+ transition: {
9
+ timeout: 400
10
+ }
11
+ },
12
+ sx: [expanded ? {
13
+ '& .MuiAccordion-region': {
14
+ height: 'auto'
15
+ }
16
+ } : {
17
+ '& .MuiAccordion-region': {
18
+ height: 0
19
+ }
20
+ }, expanded ? {
21
+ '& .MuiAccordionDetails-root': {
22
+ display: 'block'
23
+ }
24
+ } : {
25
+ '& .MuiAccordionDetails-root': {
26
+ display: 'none'
27
+ }
28
+ }]
29
+ });
30
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
31
+ sx: [{
32
+ display: 'flex',
33
+ flexDirection: {
34
+ xs: 'column-reverse',
35
+ sm: 'row'
36
+ },
37
+ alignItems: 'end',
38
+ flexGrow: 1,
39
+ gap: 1,
40
+ pb: {
41
+ xs: 12,
42
+ sm: 0
43
+ },
44
+ mt: {
45
+ xs: 2,
46
+ sm: 0
47
+ },
48
+ mb: '60px'
49
+ }, activeStep !== 0 ? {
50
+ justifyContent: 'space-between'
51
+ } : {
52
+ justifyContent: 'flex-end'
53
+ }]
54
+ });
55
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
56
+ sx: [{
57
+ display: 'flex',
58
+ alignItems: 'baseline'
59
+ }, tier.title === 'Professional' ? {
60
+ color: 'grey.50'
61
+ } : {
62
+ color: null
63
+ }]
64
+ });
@@ -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 _removeSystemProps.default;
11
+ }
12
+ });
13
+ var _removeSystemProps = _interopRequireDefault(require("./removeSystemProps"));
@@ -0,0 +1,242 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = removeSystemProps;
7
+ // from `packages/mui-system/src/styleFunctionSx/defaultSxConfig.js`
8
+ const defaultSxConfig = {
9
+ // borders
10
+ border: {},
11
+ borderTop: {},
12
+ borderRight: {},
13
+ borderBottom: {},
14
+ borderLeft: {},
15
+ borderColor: {},
16
+ borderTopColor: {},
17
+ borderRightColor: {},
18
+ borderBottomColor: {},
19
+ borderLeftColor: {},
20
+ outline: {},
21
+ outlineColor: {},
22
+ borderRadius: {},
23
+ color: {},
24
+ bgcolor: {},
25
+ backgroundColor: {},
26
+ p: {},
27
+ pt: {},
28
+ pr: {},
29
+ pb: {},
30
+ pl: {},
31
+ px: {},
32
+ py: {},
33
+ padding: {},
34
+ paddingTop: {},
35
+ paddingRight: {},
36
+ paddingBottom: {},
37
+ paddingLeft: {},
38
+ paddingX: {},
39
+ paddingY: {},
40
+ paddingInline: {},
41
+ paddingInlineStart: {},
42
+ paddingInlineEnd: {},
43
+ paddingBlock: {},
44
+ paddingBlockStart: {},
45
+ paddingBlockEnd: {},
46
+ m: {},
47
+ mt: {},
48
+ mr: {},
49
+ mb: {},
50
+ ml: {},
51
+ mx: {},
52
+ my: {},
53
+ margin: {},
54
+ marginTop: {},
55
+ marginRight: {},
56
+ marginBottom: {},
57
+ marginLeft: {},
58
+ marginX: {},
59
+ marginY: {},
60
+ marginInline: {},
61
+ marginInlineStart: {},
62
+ marginInlineEnd: {},
63
+ marginBlock: {},
64
+ marginBlockStart: {},
65
+ marginBlockEnd: {},
66
+ // display
67
+ displayPrint: {},
68
+ display: {},
69
+ overflow: {},
70
+ textOverflow: {},
71
+ visibility: {},
72
+ whiteSpace: {},
73
+ // flexbox
74
+ flexBasis: {},
75
+ flexDirection: {},
76
+ flexWrap: {},
77
+ justifyContent: {},
78
+ alignItems: {},
79
+ alignContent: {},
80
+ order: {},
81
+ flex: {},
82
+ flexGrow: {},
83
+ flexShrink: {},
84
+ alignSelf: {},
85
+ justifyItems: {},
86
+ justifySelf: {},
87
+ // grid
88
+ gap: {},
89
+ rowGap: {},
90
+ columnGap: {},
91
+ gridColumn: {},
92
+ gridRow: {},
93
+ gridAutoFlow: {},
94
+ gridAutoColumns: {},
95
+ gridAutoRows: {},
96
+ gridTemplateColumns: {},
97
+ gridTemplateRows: {},
98
+ gridTemplateAreas: {},
99
+ gridArea: {},
100
+ // positions
101
+ position: {},
102
+ zIndex: {},
103
+ top: {},
104
+ right: {},
105
+ bottom: {},
106
+ left: {},
107
+ // shadows
108
+ boxShadow: {},
109
+ // sizing
110
+ width: {},
111
+ maxWidth: {},
112
+ minWidth: {},
113
+ height: {},
114
+ maxHeight: {},
115
+ minHeight: {},
116
+ boxSizing: {},
117
+ // typography
118
+ font: {},
119
+ fontFamily: {},
120
+ fontSize: {},
121
+ fontStyle: {},
122
+ fontWeight: {},
123
+ letterSpacing: {},
124
+ textTransform: {},
125
+ lineHeight: {},
126
+ textAlign: {},
127
+ typography: {}
128
+ };
129
+ const systemProps = Object.keys(defaultSxConfig);
130
+ const components = ['Box', 'Stack', 'Typography', 'Link', 'Grid'];
131
+
132
+ /**
133
+ * @param {import('jscodeshift').FileInfo} file
134
+ * @param {import('jscodeshift').API} api
135
+ */
136
+ function removeSystemProps(file, api, options) {
137
+ var _file$path, _file$path2;
138
+ if ((_file$path = file.path) != null && _file$path.endsWith('.json') || (_file$path2 = file.path) != null && _file$path2.endsWith('.d.ts')) {
139
+ return file.source;
140
+ }
141
+ const j = api.jscodeshift;
142
+ const root = j(file.source);
143
+ const printOptions = options.printOptions;
144
+ const deprecatedElements = [];
145
+ const customReplacement = {
146
+ Typography: {
147
+ matcher: (key, val) => {
148
+ var _val$value;
149
+ return key !== 'color' || ((_val$value = val.value) == null ? void 0 : _val$value.includes('.')) && val.value !== 'inherit' || val.value === 'divider';
150
+ }
151
+ },
152
+ Link: {
153
+ matcher: key => key !== 'color'
154
+ }
155
+ };
156
+ const elementReplacement = {};
157
+ root.find(j.ImportDeclaration, decl => decl.source.value.includes('@mui')).forEach(decl => {
158
+ decl.node.specifiers.forEach(spec => {
159
+ if (spec.type === 'ImportSpecifier') {
160
+ if (components.includes(spec.imported.name)) {
161
+ deprecatedElements.push(spec.local.name);
162
+ }
163
+ }
164
+ if (spec.type === 'ImportDefaultSpecifier') {
165
+ const name = decl.node.source.value.split('/').pop();
166
+ if (components.includes(name)) {
167
+ deprecatedElements.push(spec.local.name);
168
+ if (customReplacement[name]) {
169
+ elementReplacement[spec.local.name] = customReplacement[name];
170
+ }
171
+ }
172
+ }
173
+ });
174
+ });
175
+ root.find(j.JSXElement, {
176
+ openingElement: {
177
+ name: {
178
+ name: name => {
179
+ return deprecatedElements.includes(name);
180
+ }
181
+ }
182
+ }
183
+ }).forEach(el => {
184
+ var _el$value, _sxNodesArray$;
185
+ const sx = j.objectExpression([]);
186
+ const elementName = (_el$value = el.value) == null || (_el$value = _el$value.openingElement) == null || (_el$value = _el$value.name) == null ? void 0 : _el$value.name;
187
+ const sxNodes = j(el).find(j.JSXAttribute).filter(path => path.parent.parent.node === el.node && path.node.name.name === 'sx');
188
+ const sxNodesArray = sxNodes.nodes() || [];
189
+ const existingSxValue = (_sxNodesArray$ = sxNodesArray[0]) == null || (_sxNodesArray$ = _sxNodesArray$.value) == null ? void 0 : _sxNodesArray$.expression;
190
+ let spreadElement = null;
191
+ el.node.openingElement.attributes.forEach(attr => {
192
+ if (attr.type === 'JSXSpreadAttribute') {
193
+ spreadElement = attr;
194
+ }
195
+ });
196
+ const attrToPrune = ['sx'];
197
+ el.node.openingElement.attributes.forEach(attr => {
198
+ var _attr$name, _attr$name2;
199
+ if (attr.type === 'JSXSpreadAttribute' || !attr.value || !systemProps.includes(attr == null || (_attr$name = attr.name) == null ? void 0 : _attr$name.name)) {
200
+ return;
201
+ }
202
+ const key = attr == null || (_attr$name2 = attr.name) == null ? void 0 : _attr$name2.name;
203
+ const literal = attr == null ? void 0 : attr.value;
204
+ const val = literal.type === 'JSXExpressionContainer' ? literal.expression : literal;
205
+ const shouldPrune = !elementReplacement[elementName] || elementReplacement[elementName].matcher(key, val);
206
+ if (key && val) {
207
+ if (shouldPrune) {
208
+ sx.properties.push(j.property('init', j.identifier(key), val));
209
+ attrToPrune.push(key);
210
+ }
211
+ }
212
+ });
213
+ if (sx.properties.length) {
214
+ el.node.openingElement.attributes = el.node.openingElement.attributes.filter(attr => {
215
+ var _attr$name3;
216
+ return attr.type !== 'JSXAttribute' || !attrToPrune.includes(attr == null || (_attr$name3 = attr.name) == null ? void 0 : _attr$name3.name);
217
+ });
218
+ let finalSx;
219
+ if (!existingSxValue) {
220
+ finalSx = sx;
221
+ } else if ((existingSxValue == null ? void 0 : existingSxValue.type) === 'ObjectExpression') {
222
+ sx.properties.push(...existingSxValue.properties);
223
+ finalSx = sx;
224
+ } else if ((existingSxValue == null ? void 0 : existingSxValue.type) === 'ArrayExpression') {
225
+ existingSxValue.elements = [sx, ...existingSxValue.elements];
226
+ finalSx = existingSxValue;
227
+ } else {
228
+ finalSx = j.arrayExpression([sx, existingSxValue.type === 'Identifier' ? j.spreadElement(j.conditionalExpression(j.callExpression(j.memberExpression(j.identifier('Array'), j.identifier('isArray')), [existingSxValue]), existingSxValue, j.arrayExpression([existingSxValue]))) : existingSxValue]);
229
+ }
230
+ if (spreadElement && spreadElement.argument.type === 'Identifier') {
231
+ if (finalSx.type === 'ObjectExpression') {
232
+ const propSx = j.memberExpression(spreadElement.argument, j.identifier('sx'));
233
+ finalSx = j.arrayExpression([finalSx, j.spreadElement(j.conditionalExpression(j.callExpression(j.memberExpression(j.identifier('Array'), j.identifier('isArray')), [propSx]), propSx, j.arrayExpression([propSx])))]);
234
+ } else if (finalSx.type === 'ArrayExpression') {
235
+ finalSx.elements.push(j.memberExpression(spreadElement.argument, j.identifier('sx')));
236
+ }
237
+ }
238
+ el.node.openingElement.attributes.push(j.jsxAttribute(j.jsxIdentifier('sx'), j.jsxExpressionContainer(finalSx)));
239
+ }
240
+ });
241
+ return root.toSource(printOptions);
242
+ }
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _material = require("@mui/material");
5
+ var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
6
+ var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
7
+ var _jsxRuntime = require("react/jsx-runtime");
8
+ var _Link;
9
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
10
+ typography: "body1"
11
+ });
12
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
13
+ color: "palette.main",
14
+ sx: {
15
+ display: 'block'
16
+ }
17
+ });
18
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
19
+ container: true,
20
+ flexDirection: `column`
21
+ });
22
+ const sx = {
23
+ display: 'flex'
24
+ };
25
+ const ml = 2;
26
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
27
+ variant: "body1",
28
+ color: "primary.main",
29
+ ml: ml,
30
+ sx: sx
31
+ });
32
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
33
+ variant: "body1",
34
+ color: "divider",
35
+ ml: ml,
36
+ sx: sx
37
+ });
38
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
39
+ variant: "body1",
40
+ color: "inherit",
41
+ ml: ml,
42
+ sx: sx
43
+ });
44
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
45
+ fontSize: "xl4",
46
+ lineHeight: 1,
47
+ startDecorator: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
48
+ fontSize: "lg",
49
+ textColor: "text.secondary",
50
+ children: "$"
51
+ }),
52
+ sx: {
53
+ alignItems: 'flex-start'
54
+ },
55
+ children: "25"
56
+ });
57
+ function Copyright(props) {
58
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
59
+ variant: "body2",
60
+ color: "text.secondary",
61
+ align: "center",
62
+ ...props,
63
+ children: ['Copyright © ', _Link || (_Link = /*#__PURE__*/(0, _jsxRuntime.jsx)(Link, {
64
+ color: "inherit",
65
+ href: "https://mui.com/",
66
+ children: "Your Website"
67
+ })), ' ', new Date().getFullYear(), '.']
68
+ });
69
+ }
70
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Stack.default, {
71
+ flex: "1",
72
+ sx: [...(Array.isArray(sx) ? sx : [sx])]
73
+ });
74
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
75
+ typography: "body1",
76
+ sx: foo.bar ? {
77
+ opacity: 0
78
+ } : sx
79
+ });
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _material = require("@mui/material");
5
+ var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
6
+ var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
7
+ var _jsxRuntime = require("react/jsx-runtime");
8
+ var _Link;
9
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
10
+ sx: {
11
+ typography: "body1"
12
+ }
13
+ });
14
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
15
+ sx: {
16
+ color: "palette.main",
17
+ display: 'block'
18
+ }
19
+ });
20
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
21
+ container: true,
22
+ sx: {
23
+ flexDirection: `column`
24
+ }
25
+ });
26
+ const sx = {
27
+ display: 'flex'
28
+ };
29
+ const ml = 2;
30
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
31
+ variant: "body1",
32
+ sx: [{
33
+ color: "primary.main",
34
+ ml: ml
35
+ }, ...(Array.isArray(sx) ? sx : [sx])]
36
+ });
37
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
38
+ variant: "body1",
39
+ sx: [{
40
+ color: "divider",
41
+ ml: ml
42
+ }, ...(Array.isArray(sx) ? sx : [sx])]
43
+ });
44
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
45
+ variant: "body1",
46
+ color: "inherit",
47
+ sx: [{
48
+ ml: ml
49
+ }, ...(Array.isArray(sx) ? sx : [sx])]
50
+ });
51
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
52
+ startDecorator: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
53
+ textColor: "text.secondary",
54
+ sx: {
55
+ fontSize: "lg"
56
+ },
57
+ children: "$"
58
+ }),
59
+ sx: {
60
+ fontSize: "xl4",
61
+ lineHeight: 1,
62
+ alignItems: 'flex-start'
63
+ },
64
+ children: "25"
65
+ });
66
+ function Copyright(props) {
67
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
68
+ variant: "body2",
69
+ align: "center",
70
+ ...props,
71
+ sx: [{
72
+ color: "text.secondary"
73
+ }, ...(Array.isArray(props.sx) ? props.sx : [props.sx])],
74
+ children: ['Copyright © ', _Link || (_Link = /*#__PURE__*/(0, _jsxRuntime.jsx)(Link, {
75
+ color: "inherit",
76
+ href: "https://mui.com/",
77
+ children: "Your Website"
78
+ })), ' ', new Date().getFullYear(), '.']
79
+ });
80
+ }
81
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Stack.default, {
82
+ sx: [{
83
+ flex: "1"
84
+ }, ...(Array.isArray(sx) ? sx : [sx])]
85
+ });
86
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
87
+ sx: [{
88
+ typography: "body1"
89
+ }, foo.bar ? {
90
+ opacity: 0
91
+ } : sx]
92
+ });
@@ -4,14 +4,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = styledV6;
7
+ exports.default = themeV6;
8
8
  var _getReturnExpression = _interopRequireDefault(require("../../util/getReturnExpression"));
9
9
  var _migrateToVariants = _interopRequireDefault(require("../../util/migrateToVariants"));
10
10
  /**
11
11
  * @param {import('jscodeshift').FileInfo} file
12
12
  * @param {import('jscodeshift').API} api
13
13
  */
14
- function styledV6(file, api, options) {
14
+ function themeV6(file, api, options) {
15
15
  const j = api.jscodeshift;
16
16
  const root = j(file.source);
17
17
  const printOptions = options.printOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/codemod",
3
- "version": "6.0.0-alpha.8",
3
+ "version": "6.0.0-alpha.9",
4
4
  "bin": "./codemod.js",
5
5
  "private": false,
6
6
  "author": "MUI Team",
@@ -24,9 +24,9 @@
24
24
  "url": "https://opencollective.com/mui-org"
25
25
  },
26
26
  "dependencies": {
27
- "@babel/core": "^7.24.5",
28
- "@babel/runtime": "^7.24.5",
29
- "@babel/traverse": "^7.24.5",
27
+ "@babel/core": "^7.24.6",
28
+ "@babel/runtime": "^7.24.6",
29
+ "@babel/traverse": "^7.24.6",
30
30
  "jscodeshift": "^0.15.2",
31
31
  "jscodeshift-add-imports": "^1.0.10",
32
32
  "postcss": "^8.4.38",