@mui/codemod 6.0.0-alpha.8 → 6.0.0-beta.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 (126) hide show
  1. package/README.md +609 -180
  2. package/codemod.js +0 -2
  3. package/node/deprecations/all/deprecations-all.js +34 -22
  4. package/node/deprecations/all/postcss.config.js +7 -1
  5. package/node/deprecations/autocomplete-props/autocomplete-props.js +0 -32
  6. package/node/deprecations/autocomplete-props/test-cases/actual.js +13 -35
  7. package/node/deprecations/autocomplete-props/test-cases/expected.js +13 -41
  8. package/node/deprecations/autocomplete-props/test-cases/theme.actual.js +0 -18
  9. package/node/deprecations/autocomplete-props/test-cases/theme.expected.js +0 -22
  10. package/node/deprecations/avatar-group-props/avatar-group-props.js +87 -0
  11. package/node/deprecations/avatar-group-props/index.js +13 -0
  12. package/node/deprecations/avatar-group-props/test-cases/actual.js +56 -0
  13. package/node/deprecations/avatar-group-props/test-cases/expected.js +58 -0
  14. package/node/deprecations/avatar-group-props/test-cases/theme.actual.js +48 -0
  15. package/node/deprecations/avatar-group-props/test-cases/theme.expected.js +50 -0
  16. package/node/deprecations/backdrop-props/backdrop-props.js +3 -5
  17. package/node/deprecations/backdrop-props/test-cases/actual.js +30 -14
  18. package/node/deprecations/backdrop-props/test-cases/expected.js +23 -13
  19. package/node/deprecations/backdrop-props/test-cases/theme.actual.js +32 -6
  20. package/node/deprecations/backdrop-props/test-cases/theme.expected.js +27 -5
  21. package/node/deprecations/filled-input-props/filled-input-props.js +22 -0
  22. package/node/deprecations/filled-input-props/index.js +13 -0
  23. package/node/deprecations/filled-input-props/test-cases/actual.js +60 -0
  24. package/node/deprecations/filled-input-props/test-cases/expected.js +52 -0
  25. package/node/deprecations/filled-input-props/test-cases/theme.actual.js +73 -0
  26. package/node/deprecations/filled-input-props/test-cases/theme.expected.js +65 -0
  27. package/node/deprecations/grid-props/grid-props.js +51 -0
  28. package/node/deprecations/grid-props/index.js +13 -0
  29. package/node/deprecations/grid-props/test-cases/actual.js +25 -0
  30. package/node/deprecations/grid-props/test-cases/expected.js +23 -0
  31. package/node/deprecations/grid-props/test-cases/theme.actual.js +24 -0
  32. package/node/deprecations/grid-props/test-cases/theme.expected.js +23 -0
  33. package/node/deprecations/input-base-props/index.js +13 -0
  34. package/node/deprecations/input-base-props/input-base-props.js +22 -0
  35. package/node/deprecations/input-base-props/test-cases/actual.js +60 -0
  36. package/node/deprecations/input-base-props/test-cases/expected.js +52 -0
  37. package/node/deprecations/input-base-props/test-cases/theme.actual.js +73 -0
  38. package/node/deprecations/input-base-props/test-cases/theme.expected.js +65 -0
  39. package/node/deprecations/input-props/index.js +13 -0
  40. package/node/deprecations/input-props/input-props.js +22 -0
  41. package/node/deprecations/input-props/test-cases/actual.js +60 -0
  42. package/node/deprecations/input-props/test-cases/expected.js +52 -0
  43. package/node/deprecations/input-props/test-cases/theme.actual.js +73 -0
  44. package/node/deprecations/input-props/test-cases/theme.expected.js +65 -0
  45. package/node/deprecations/list-item-props/index.js +13 -0
  46. package/node/deprecations/list-item-props/list-item-props.js +22 -0
  47. package/node/deprecations/list-item-props/test-cases/actual.js +43 -0
  48. package/node/deprecations/list-item-props/test-cases/expected.js +40 -0
  49. package/node/deprecations/list-item-props/test-cases/theme.actual.js +56 -0
  50. package/node/deprecations/list-item-props/test-cases/theme.expected.js +53 -0
  51. package/node/deprecations/modal-props/index.js +13 -0
  52. package/node/deprecations/modal-props/modal-props.js +22 -0
  53. package/node/deprecations/modal-props/test-cases/actual.js +43 -0
  54. package/node/deprecations/modal-props/test-cases/expected.js +40 -0
  55. package/node/deprecations/modal-props/test-cases/theme.actual.js +56 -0
  56. package/node/deprecations/modal-props/test-cases/theme.expected.js +53 -0
  57. package/node/deprecations/outlined-input-props/index.js +13 -0
  58. package/node/deprecations/outlined-input-props/outlined-input-props.js +22 -0
  59. package/node/deprecations/outlined-input-props/test-cases/actual.js +60 -0
  60. package/node/deprecations/outlined-input-props/test-cases/expected.js +52 -0
  61. package/node/deprecations/outlined-input-props/test-cases/theme.actual.js +73 -0
  62. package/node/deprecations/outlined-input-props/test-cases/theme.expected.js +65 -0
  63. package/node/deprecations/popper-props/index.js +13 -0
  64. package/node/deprecations/popper-props/popper-props.js +22 -0
  65. package/node/deprecations/popper-props/test-cases/actual.js +27 -0
  66. package/node/deprecations/popper-props/test-cases/expected.js +24 -0
  67. package/node/deprecations/popper-props/test-cases/theme.actual.js +32 -0
  68. package/node/deprecations/popper-props/test-cases/theme.expected.js +29 -0
  69. package/node/deprecations/step-label-props/step-label-props.js +0 -14
  70. package/node/deprecations/step-label-props/test-cases/actual.js +0 -23
  71. package/node/deprecations/step-label-props/test-cases/expected.js +0 -27
  72. package/node/deprecations/step-label-props/test-cases/theme.actual.js +0 -22
  73. package/node/deprecations/step-label-props/test-cases/theme.expected.js +0 -28
  74. package/node/deprecations/tab-classes/index.js +13 -0
  75. package/node/deprecations/tab-classes/postcss-plugin.js +30 -0
  76. package/node/deprecations/tab-classes/postcss.config.js +8 -0
  77. package/node/deprecations/tab-classes/tab-classes.js +53 -0
  78. package/node/deprecations/tab-classes/test-cases/actual.js +5 -0
  79. package/node/deprecations/tab-classes/test-cases/expected.js +5 -0
  80. package/node/deprecations/table-sort-label-classes/index.js +13 -0
  81. package/node/deprecations/table-sort-label-classes/postcss-plugin.js +33 -0
  82. package/node/deprecations/table-sort-label-classes/postcss.config.js +8 -0
  83. package/node/deprecations/table-sort-label-classes/table-sort-label-classes.js +77 -0
  84. package/node/deprecations/table-sort-label-classes/test-cases/actual.js +7 -0
  85. package/node/deprecations/table-sort-label-classes/test-cases/expected.js +7 -0
  86. package/node/deprecations/tooltip-props/index.js +13 -0
  87. package/node/deprecations/tooltip-props/test-cases/actual.js +92 -0
  88. package/node/deprecations/tooltip-props/test-cases/expected.js +84 -0
  89. package/node/deprecations/tooltip-props/test-cases/theme.actual.js +73 -0
  90. package/node/deprecations/tooltip-props/test-cases/theme.expected.js +65 -0
  91. package/node/deprecations/tooltip-props/tooltip-props.js +22 -0
  92. package/node/util/migrateToVariants.js +244 -138
  93. package/node/v5.0.0/theme-spacing.test/large-actual.js +1 -1
  94. package/node/v5.0.0/theme-spacing.test/large-expected.js +1 -1
  95. package/node/v6.0.0/grid-v2-props/grid-v2-props.js +149 -0
  96. package/node/v6.0.0/grid-v2-props/index.js +13 -0
  97. package/node/v6.0.0/grid-v2-props/test-cases/actual.js +85 -0
  98. package/node/v6.0.0/grid-v2-props/test-cases/custom-breakpoints.actual.js +18 -0
  99. package/node/v6.0.0/grid-v2-props/test-cases/custom-breakpoints.expected.js +22 -0
  100. package/node/v6.0.0/grid-v2-props/test-cases/expected.js +97 -0
  101. package/node/v6.0.0/styled/test-cases/ConditionalStyled.expected.js +9 -22
  102. package/node/v6.0.0/styled/test-cases/DynamicPropsStyled.actual.js +39 -0
  103. package/node/v6.0.0/styled/test-cases/DynamicPropsStyled.expected.js +65 -0
  104. package/node/v6.0.0/styled/test-cases/LogicalStyled.actual.js +31 -1
  105. package/node/v6.0.0/styled/test-cases/LogicalStyled.expected.js +39 -1
  106. package/node/v6.0.0/styled/test-cases/NestedSpread.expected.js +11 -13
  107. package/node/v6.0.0/sx-prop/index.js +13 -0
  108. package/node/v6.0.0/sx-prop/sx-v6.js +405 -0
  109. package/node/v6.0.0/sx-prop/test-cases/basic-sx.actual.js +36 -0
  110. package/node/v6.0.0/sx-prop/test-cases/basic-sx.expected.js +46 -0
  111. package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.actual.js +55 -0
  112. package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.expected.js +88 -0
  113. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.actual.js +107 -0
  114. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.expected.js +120 -0
  115. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic2.actual.js +49 -0
  116. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic2.expected.js +64 -0
  117. package/node/v6.0.0/sx-prop/test-cases/sx-line-break.actual.js +69 -0
  118. package/node/v6.0.0/sx-prop/test-cases/sx-line-break.expected.js +69 -0
  119. package/node/v6.0.0/sx-prop/test-cases/sx-value-callback.actual.js +102 -0
  120. package/node/v6.0.0/sx-prop/test-cases/sx-value-callback.expected.js +111 -0
  121. package/node/v6.0.0/system-props/index.js +13 -0
  122. package/node/v6.0.0/system-props/removeSystemProps.js +242 -0
  123. package/node/v6.0.0/system-props/test-cases/system-props.actual.js +79 -0
  124. package/node/v6.0.0/system-props/test-cases/system-props.expected.js +92 -0
  125. package/node/v6.0.0/theme-v6/theme-v6.js +2 -2
  126. package/package.json +7 -7
@@ -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-beta.0",
4
4
  "bin": "./codemod.js",
5
5
  "private": false,
6
6
  "author": "MUI Team",
@@ -24,13 +24,13 @@
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",
30
- "jscodeshift": "^0.15.2",
27
+ "@babel/core": "^7.24.7",
28
+ "@babel/runtime": "^7.24.7",
29
+ "@babel/traverse": "^7.24.7",
30
+ "jscodeshift": "^0.16.1",
31
31
  "jscodeshift-add-imports": "^1.0.10",
32
- "postcss": "^8.4.38",
33
- "postcss-cli": "^8.3.1",
32
+ "postcss": "^8.4.39",
33
+ "postcss-cli": "^11.0.0",
34
34
  "yargs": "^17.7.2"
35
35
  },
36
36
  "devDependencies": {