@mui/codemod 6.0.0-alpha.1 → 6.0.0-alpha.11
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 +713 -2
- package/codemod.js +0 -2
- package/node/deprecations/accordion-props/accordion-props.js +11 -71
- package/node/deprecations/accordion-props/test-cases/actual.js +22 -3
- package/node/deprecations/accordion-props/test-cases/expected.js +23 -5
- package/node/deprecations/accordion-props/test-cases/theme.actual.js +24 -0
- package/node/deprecations/accordion-props/test-cases/theme.expected.js +25 -0
- package/node/deprecations/alert-props/test-cases/expected.js +12 -4
- package/node/deprecations/alert-props/test-cases/theme.expected.js +12 -5
- package/node/deprecations/all/deprecations-all.js +36 -8
- package/node/deprecations/all/postcss.config.js +10 -1
- package/node/deprecations/autocomplete-props/autocomplete-props.js +54 -0
- package/node/deprecations/autocomplete-props/index.js +13 -0
- package/node/deprecations/autocomplete-props/test-cases/actual.js +97 -0
- package/node/deprecations/autocomplete-props/test-cases/expected.js +103 -0
- package/node/deprecations/autocomplete-props/test-cases/theme.actual.js +65 -0
- package/node/deprecations/autocomplete-props/test-cases/theme.expected.js +69 -0
- package/node/deprecations/avatar-group-props/avatar-group-props.js +87 -0
- package/node/deprecations/avatar-group-props/index.js +13 -0
- package/node/deprecations/avatar-group-props/test-cases/actual.js +56 -0
- package/node/deprecations/avatar-group-props/test-cases/expected.js +58 -0
- package/node/deprecations/avatar-group-props/test-cases/theme.actual.js +48 -0
- package/node/deprecations/avatar-group-props/test-cases/theme.expected.js +50 -0
- package/node/deprecations/avatar-props/avatar-props.js +5 -39
- package/node/deprecations/avatar-props/test-cases/actual.js +10 -0
- package/node/deprecations/avatar-props/test-cases/expected.js +12 -0
- package/node/deprecations/avatar-props/test-cases/theme.actual.js +14 -0
- package/node/deprecations/avatar-props/test-cases/theme.expected.js +16 -0
- package/node/deprecations/backdrop-props/backdrop-props.js +8 -59
- package/node/deprecations/backdrop-props/test-cases/actual.js +56 -8
- package/node/deprecations/backdrop-props/test-cases/expected.js +52 -9
- package/node/deprecations/backdrop-props/test-cases/theme.actual.js +65 -0
- package/node/deprecations/backdrop-props/test-cases/theme.expected.js +63 -2
- package/node/deprecations/badge-props/test-cases/expected.js +12 -5
- package/node/deprecations/badge-props/test-cases/theme.expected.js +12 -5
- package/node/deprecations/circular-progress-classes/circular-progress-classes.js +77 -0
- package/node/deprecations/circular-progress-classes/index.js +13 -0
- package/node/deprecations/circular-progress-classes/postcss-plugin.js +33 -0
- package/node/deprecations/circular-progress-classes/postcss.config.js +8 -0
- package/node/deprecations/circular-progress-classes/test-cases/actual.js +7 -0
- package/node/deprecations/circular-progress-classes/test-cases/expected.js +7 -0
- package/node/deprecations/divider-props/divider-props.js +36 -30
- package/node/deprecations/divider-props/test-cases/actual.js +3 -0
- package/node/deprecations/divider-props/test-cases/expected.js +3 -0
- package/node/deprecations/divider-props/test-cases/theme.actual.js +7 -0
- package/node/deprecations/divider-props/test-cases/theme.expected.js +7 -0
- package/node/deprecations/filled-input-props/filled-input-props.js +22 -0
- package/node/deprecations/filled-input-props/index.js +13 -0
- package/node/deprecations/filled-input-props/test-cases/actual.js +60 -0
- package/node/deprecations/filled-input-props/test-cases/expected.js +52 -0
- package/node/deprecations/filled-input-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/filled-input-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/form-control-label-props/form-control-label-props.js +22 -0
- package/node/deprecations/form-control-label-props/index.js +13 -0
- package/node/deprecations/form-control-label-props/test-cases/actual.js +21 -0
- package/node/deprecations/form-control-label-props/test-cases/expected.js +21 -0
- package/node/deprecations/form-control-label-props/test-cases/theme.actual.js +23 -0
- package/node/deprecations/form-control-label-props/test-cases/theme.expected.js +23 -0
- package/node/deprecations/grid-props/grid-props.js +51 -0
- package/node/deprecations/grid-props/index.js +13 -0
- package/node/deprecations/grid-props/test-cases/actual.js +25 -0
- package/node/deprecations/grid-props/test-cases/expected.js +23 -0
- package/node/deprecations/grid-props/test-cases/theme.actual.js +24 -0
- package/node/deprecations/grid-props/test-cases/theme.expected.js +23 -0
- package/node/deprecations/input-base-props/index.js +13 -0
- package/node/deprecations/input-base-props/input-base-props.js +22 -0
- package/node/deprecations/input-base-props/test-cases/actual.js +60 -0
- package/node/deprecations/input-base-props/test-cases/expected.js +52 -0
- package/node/deprecations/input-base-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/input-base-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/input-props/index.js +13 -0
- package/node/deprecations/input-props/input-props.js +22 -0
- package/node/deprecations/input-props/test-cases/actual.js +60 -0
- package/node/deprecations/input-props/test-cases/expected.js +52 -0
- package/node/deprecations/input-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/input-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/list-item-props/index.js +13 -0
- package/node/deprecations/list-item-props/list-item-props.js +22 -0
- package/node/deprecations/list-item-props/test-cases/actual.js +43 -0
- package/node/deprecations/list-item-props/test-cases/expected.js +40 -0
- package/node/deprecations/list-item-props/test-cases/theme.actual.js +56 -0
- package/node/deprecations/list-item-props/test-cases/theme.expected.js +53 -0
- package/node/deprecations/modal-props/index.js +13 -0
- package/node/deprecations/modal-props/modal-props.js +22 -0
- package/node/deprecations/modal-props/test-cases/actual.js +43 -0
- package/node/deprecations/modal-props/test-cases/expected.js +40 -0
- package/node/deprecations/modal-props/test-cases/theme.actual.js +56 -0
- package/node/deprecations/modal-props/test-cases/theme.expected.js +53 -0
- package/node/deprecations/outlined-input-props/index.js +13 -0
- package/node/deprecations/outlined-input-props/outlined-input-props.js +22 -0
- package/node/deprecations/outlined-input-props/test-cases/actual.js +60 -0
- package/node/deprecations/outlined-input-props/test-cases/expected.js +52 -0
- package/node/deprecations/outlined-input-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/outlined-input-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/pagination-item-props/index.js +13 -0
- package/node/deprecations/pagination-item-props/pagination-item-props.js +22 -0
- package/node/deprecations/pagination-item-props/test-cases/actual.js +27 -0
- package/node/deprecations/pagination-item-props/test-cases/expected.js +21 -0
- package/node/deprecations/pagination-item-props/test-cases/theme.actual.js +28 -0
- package/node/deprecations/pagination-item-props/test-cases/theme.expected.js +26 -0
- package/node/deprecations/popper-props/index.js +13 -0
- package/node/deprecations/popper-props/popper-props.js +22 -0
- package/node/deprecations/popper-props/test-cases/actual.js +27 -0
- package/node/deprecations/popper-props/test-cases/expected.js +24 -0
- package/node/deprecations/popper-props/test-cases/theme.actual.js +32 -0
- package/node/deprecations/popper-props/test-cases/theme.expected.js +29 -0
- package/node/deprecations/slider-props/test-cases/expected.js +12 -4
- package/node/deprecations/slider-props/test-cases/theme.expected.js +12 -5
- package/node/deprecations/speed-dial-props/index.js +13 -0
- package/node/deprecations/speed-dial-props/speed-dial-props.js +31 -0
- package/node/deprecations/speed-dial-props/test-cases/actual.js +41 -0
- package/node/deprecations/speed-dial-props/test-cases/expected.js +54 -0
- package/node/deprecations/speed-dial-props/test-cases/theme.actual.js +33 -0
- package/node/deprecations/speed-dial-props/test-cases/theme.expected.js +40 -0
- package/node/deprecations/step-connector-classes/index.js +13 -0
- package/node/deprecations/step-connector-classes/postcss-plugin.js +33 -0
- package/node/deprecations/step-connector-classes/postcss.config.js +8 -0
- package/node/deprecations/step-connector-classes/step-connector-classes.js +77 -0
- package/node/deprecations/step-connector-classes/test-cases/actual.js +7 -0
- package/node/deprecations/step-connector-classes/test-cases/expected.js +7 -0
- package/node/deprecations/step-label-props/step-label-props.js +14 -0
- package/node/deprecations/step-label-props/test-cases/actual.js +23 -0
- package/node/deprecations/step-label-props/test-cases/expected.js +31 -2
- package/node/deprecations/step-label-props/test-cases/theme.actual.js +22 -0
- package/node/deprecations/step-label-props/test-cases/theme.expected.js +32 -3
- package/node/deprecations/text-field-props/index.js +13 -0
- package/node/deprecations/text-field-props/test-cases/actual.js +27 -0
- package/node/deprecations/text-field-props/test-cases/expected.js +31 -0
- package/node/deprecations/text-field-props/test-cases/theme.actual.js +13 -0
- package/node/deprecations/text-field-props/test-cases/theme.expected.js +15 -0
- package/node/deprecations/text-field-props/text-field-props.js +48 -0
- package/node/deprecations/toggle-button-group-classes/index.js +13 -0
- package/node/deprecations/toggle-button-group-classes/postcss-plugin.js +33 -0
- package/node/deprecations/toggle-button-group-classes/postcss.config.js +8 -0
- package/node/deprecations/toggle-button-group-classes/test-cases/actual.js +7 -0
- package/node/deprecations/toggle-button-group-classes/test-cases/expected.js +7 -0
- package/node/deprecations/toggle-button-group-classes/toggle-button-group-classes.js +77 -0
- package/node/deprecations/tooltip-props/index.js +13 -0
- package/node/deprecations/tooltip-props/test-cases/actual.js +92 -0
- package/node/deprecations/tooltip-props/test-cases/expected.js +84 -0
- package/node/deprecations/tooltip-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/tooltip-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/tooltip-props/tooltip-props.js +22 -0
- package/node/deprecations/utils/movePropIntoSlotProps.js +111 -0
- package/node/deprecations/utils/movePropIntoSlots.js +101 -0
- package/node/deprecations/utils/replaceComponentsWithSlots.js +29 -17
- package/node/util/getReturnExpression.js +20 -0
- package/node/util/migrateToVariants.js +586 -0
- package/node/v5.0.0/badge-overlap-value.test/actual.js +3 -4
- package/node/v5.0.0/badge-overlap-value.test/expected.js +3 -4
- package/node/v5.0.0/base-remove-component-prop.test/actual.js +4 -4
- package/node/v5.0.0/base-remove-component-prop.test/expected.js +4 -4
- package/node/v5.0.0/base-remove-unstyled-suffix.js +4 -4
- package/node/v5.0.0/box-sx-prop.test/actual.js +4 -4
- package/node/v5.0.0/box-sx-prop.test/expected.js +3 -3
- package/node/v5.0.0/create-theme.test/custom-fn.actual.js +3 -4
- package/node/v5.0.0/create-theme.test/custom-fn.expected.js +3 -4
- package/node/v5.0.0/jss-to-styled.test/first.actual.js +11 -14
- package/node/v5.0.0/jss-to-styled.test/first.expected.js +11 -14
- package/node/v5.0.0/jss-to-styled.test/seventh.actual.js +4 -4
- package/node/v5.0.0/jss-to-styled.test/seventh.expected.js +4 -4
- package/node/v5.0.0/jss-to-styled.test/sixth.actual.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/sixth.expected.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles.actual.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles.expected.js +3 -4
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles1.actual.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles1.expected.js +3 -4
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles2.actual.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles2.expected.js +3 -4
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles3.actual.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles3.expected.js +3 -4
- package/node/v5.0.0/jss-to-tss-react.test/actual-mixins-pattern.js +6 -5
- package/node/v5.0.0/jss-to-tss-react.test/expected-mixins-pattern.js +6 -5
- package/node/v5.0.0/preset-safe.test/actual.js +6 -4
- package/node/v5.0.0/preset-safe.test/expected.js +9 -6
- package/node/v5.0.0/styled-engine-provider.test/theme-provider.expected.js +3 -3
- package/node/v5.0.0/table-props.test/actual.js +4 -5
- package/node/v5.0.0/table-props.test/expected.js +4 -5
- package/node/v5.0.0/theme-spacing.test/large-actual.js +10 -10
- package/node/v5.0.0/theme-spacing.test/large-expected.js +10 -10
- package/node/v5.0.0/variant-prop.test/actual.js +12 -6
- package/node/v5.0.0/variant-prop.test/expected.js +15 -12
- package/node/v5.0.0/with-mobile-dialog.test/expected.js +6 -5
- package/node/v5.0.0/with-width.test/expected.js +6 -5
- package/node/v6.0.0/styled/index.js +13 -0
- package/node/v6.0.0/styled/styled-v6.js +80 -0
- package/node/v6.0.0/styled/test-cases/BasicStyled.actual.js +89 -0
- package/node/v6.0.0/styled/test-cases/BasicStyled.expected.js +143 -0
- package/node/v6.0.0/styled/test-cases/ConditionalStyled.actual.js +152 -0
- package/node/v6.0.0/styled/test-cases/ConditionalStyled.expected.js +244 -0
- package/node/v6.0.0/styled/test-cases/LogicalStyled.actual.js +58 -0
- package/node/v6.0.0/styled/test-cases/LogicalStyled.expected.js +90 -0
- package/node/v6.0.0/styled/test-cases/NestedSpread.actual.js +48 -0
- package/node/v6.0.0/styled/test-cases/NestedSpread.expected.js +86 -0
- package/node/v6.0.0/styled/test-cases/ObjectMap.actual.js +36 -0
- package/node/v6.0.0/styled/test-cases/ObjectMap.expected.js +109 -0
- package/node/v6.0.0/styled/test-cases/ThemePaletteMode.actual.js +62 -0
- package/node/v6.0.0/styled/test-cases/ThemePaletteMode.expected.js +78 -0
- package/node/v6.0.0/styled/test-cases/VariantAndModeStyled.actual.js +12 -0
- package/node/v6.0.0/styled/test-cases/VariantAndModeStyled.expected.js +19 -0
- package/node/v6.0.0/sx-prop/index.js +13 -0
- package/node/v6.0.0/sx-prop/sx-v6.js +405 -0
- package/node/v6.0.0/sx-prop/test-cases/basic-sx.actual.js +36 -0
- package/node/v6.0.0/sx-prop/test-cases/basic-sx.expected.js +46 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.actual.js +55 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.expected.js +88 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.actual.js +107 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.expected.js +120 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-dynamic2.actual.js +49 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-dynamic2.expected.js +64 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-line-break.actual.js +69 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-line-break.expected.js +69 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-value-callback.actual.js +102 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-value-callback.expected.js +111 -0
- package/node/v6.0.0/system-props/index.js +13 -0
- package/node/v6.0.0/system-props/removeSystemProps.js +242 -0
- package/node/v6.0.0/system-props/test-cases/system-props.actual.js +79 -0
- package/node/v6.0.0/system-props/test-cases/system-props.expected.js +92 -0
- package/node/v6.0.0/theme-v6/index.js +13 -0
- package/node/v6.0.0/theme-v6/test-cases/basicTheme.actual.js +559 -0
- package/node/v6.0.0/theme-v6/test-cases/basicTheme.expected.js +644 -0
- package/node/v6.0.0/theme-v6/test-cases/themeVariants.actual.js +65 -0
- package/node/v6.0.0/theme-v6/test-cases/themeVariants.expected.js +74 -0
- package/node/v6.0.0/theme-v6/theme-v6.js +87 -0
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -259,6 +259,120 @@ npx @mui/codemod@next deprecations/alert-classes <path>
|
|
|
259
259
|
npx @mui/codemod@next deprecations/alert-props <path>
|
|
260
260
|
```
|
|
261
261
|
|
|
262
|
+
#### `autocomplete-props`
|
|
263
|
+
|
|
264
|
+
```diff
|
|
265
|
+
<Autocomplete
|
|
266
|
+
- ChipProps={{ height: 10 }}
|
|
267
|
+
- PaperComponent={CustomPaper}
|
|
268
|
+
- PopperComponent={CustomPopper}
|
|
269
|
+
- ListboxComponent={CustomListbox}
|
|
270
|
+
- ListboxProps={{ height: 12 }}
|
|
271
|
+
- componentsProps={{
|
|
272
|
+
- clearIndicator: { width: 10 },
|
|
273
|
+
- paper: { width: 12 },
|
|
274
|
+
- popper: { width: 14 },
|
|
275
|
+
- popupIndicator: { width: 16 },
|
|
276
|
+
- }}
|
|
277
|
+
+ slots={{
|
|
278
|
+
+ paper: CustomPaper,
|
|
279
|
+
+ popper: CustomPopper,
|
|
280
|
+
+ listbox: CustomListbox,
|
|
281
|
+
+ }}
|
|
282
|
+
+ slotProps={{
|
|
283
|
+
+ chip: { height: 10 },
|
|
284
|
+
+ listbox: { height: 12 },
|
|
285
|
+
+ clearIndicator: { width: 10 },
|
|
286
|
+
+ paper: { width: 12 },
|
|
287
|
+
+ popper: { width: 14 },
|
|
288
|
+
+ popupIndicator: { width: 16 },
|
|
289
|
+
+ }}
|
|
290
|
+
/>
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
```diff
|
|
294
|
+
MuiAutocomplete: {
|
|
295
|
+
defaultProps: {
|
|
296
|
+
- ChipProps: { height: 10 },
|
|
297
|
+
- PaperComponent: CustomPaper,
|
|
298
|
+
- PopperComponent: CustomPopper,
|
|
299
|
+
- ListboxComponent: CustomListbox,
|
|
300
|
+
- ListboxProps: { height: 12 },
|
|
301
|
+
- componentsProps: {
|
|
302
|
+
- clearIndicator: { width: 10 },
|
|
303
|
+
- paper: { width: 12 },
|
|
304
|
+
- popper: { width: 14 },
|
|
305
|
+
- popupIndicator: { width: 16 },
|
|
306
|
+
- }
|
|
307
|
+
+ slots: {
|
|
308
|
+
+ paper: CustomPaper,
|
|
309
|
+
+ popper: CustomPopper,
|
|
310
|
+
+ listbox: CustomListbox,
|
|
311
|
+
+ },
|
|
312
|
+
+ slotProps: {
|
|
313
|
+
+ chip: { height: 10 },
|
|
314
|
+
+ listbox: { height: 12 },
|
|
315
|
+
+ clearIndicator: { width: 10 },
|
|
316
|
+
+ paper: { width: 12 },
|
|
317
|
+
+ popper: { width: 14 },
|
|
318
|
+
+ popupIndicator: { width: 16 },
|
|
319
|
+
+ },
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
npx @mui/codemod@next deprecations/autocomplete-props <path>
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
#### `avatar-group-props`
|
|
329
|
+
|
|
330
|
+
```diff
|
|
331
|
+
<AvatarGroup
|
|
332
|
+
- componentsProps={{
|
|
333
|
+
- additionalAvatar: {color: "red"}
|
|
334
|
+
+ slotProps={{
|
|
335
|
+
+ surplus: {color: "red"}
|
|
336
|
+
}}
|
|
337
|
+
/>;
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
```diff
|
|
341
|
+
<AvatarGroup
|
|
342
|
+
slotProps={{
|
|
343
|
+
- additionalAvatar: {color: "red"}
|
|
344
|
+
+ surplus: {color: "red"}
|
|
345
|
+
}}
|
|
346
|
+
/>;
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
```diff
|
|
350
|
+
MuiAvatarGroup: {
|
|
351
|
+
defaultProps: {
|
|
352
|
+
- componentsProps: {
|
|
353
|
+
- additionalAvatar: {color: "red"}
|
|
354
|
+
+ slotProps: {
|
|
355
|
+
+ surplus: {color: "red"}
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
```diff
|
|
362
|
+
MuiAvatarGroup: {
|
|
363
|
+
defaultProps: {
|
|
364
|
+
slotProps: {
|
|
365
|
+
- additionalAvatar: {color: "red"}
|
|
366
|
+
+ surplus: {color: "red"}
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
npx @mui/codemod@next deprecations/avatar-group-props <path>
|
|
374
|
+
```
|
|
375
|
+
|
|
262
376
|
#### `avatar-props`
|
|
263
377
|
|
|
264
378
|
```diff
|
|
@@ -277,6 +391,26 @@ npx @mui/codemod@next deprecations/alert-props <path>
|
|
|
277
391
|
|
|
278
392
|
#### `backdrop-props`
|
|
279
393
|
|
|
394
|
+
```diff
|
|
395
|
+
<Backdrop
|
|
396
|
+
- components={{ Root: CustomRoot }}
|
|
397
|
+
+ slots={{ root: CustomRoot }}
|
|
398
|
+
- componentsProps={{ root: { testid: 'test-id' } }}
|
|
399
|
+
+ slotProps={{ root: { testid: 'test-id' } }}
|
|
400
|
+
/>
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
```diff
|
|
404
|
+
MuiBackdrop: {
|
|
405
|
+
defaultProps: {
|
|
406
|
+
- components: { Root: CustomRoot }
|
|
407
|
+
+ slots: { root: CustomRoot },
|
|
408
|
+
- componentsProps: { root: { testid: 'root-id' } }
|
|
409
|
+
+ slotProps: { root: { testid: 'root-id' } },
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
```
|
|
413
|
+
|
|
280
414
|
```diff
|
|
281
415
|
<Backdrop
|
|
282
416
|
- TransitionComponent={CustomTransition}
|
|
@@ -845,6 +979,42 @@ CSS transforms:
|
|
|
845
979
|
npx @mui/codemod@next deprecations/chip-classes <path>
|
|
846
980
|
```
|
|
847
981
|
|
|
982
|
+
#### `circular-progress-classes`
|
|
983
|
+
|
|
984
|
+
JS transforms:
|
|
985
|
+
|
|
986
|
+
```diff
|
|
987
|
+
import { circularProgressClasses } from '@mui/material/CircularProgress';
|
|
988
|
+
|
|
989
|
+
MuiCircularProgress: {
|
|
990
|
+
styleOverrides: {
|
|
991
|
+
root: {
|
|
992
|
+
- [`& .${circularProgressClasses.circleDeterminate}`]: {
|
|
993
|
+
+ [`&.${circularProgressClasses.determinate} > .${circularProgressClasses.circle}`]: {
|
|
994
|
+
color: 'red',
|
|
995
|
+
},
|
|
996
|
+
- [`& .${circularProgressClasses.circleIndeterminate}`]: {
|
|
997
|
+
+ [`&.${circularProgressClasses.indeterminate} > .${circularProgressClasses.circle}`]: {
|
|
998
|
+
color: 'red',
|
|
999
|
+
},
|
|
1000
|
+
},
|
|
1001
|
+
},
|
|
1002
|
+
},
|
|
1003
|
+
```
|
|
1004
|
+
|
|
1005
|
+
CSS transforms:
|
|
1006
|
+
|
|
1007
|
+
```diff
|
|
1008
|
+
- .MuiCircularProgress-circleDeterminate
|
|
1009
|
+
+.MuiCircularProgress-determinate > .MuiCircularProgress-circle
|
|
1010
|
+
- .MuiCircularProgress-circleIndeterminate
|
|
1011
|
+
+.MuiCircularProgress-indeterminate > .MuiCircularProgress-circle
|
|
1012
|
+
```
|
|
1013
|
+
|
|
1014
|
+
```bash
|
|
1015
|
+
npx @mui/codemod@next deprecations/circular-progress-classes <path>
|
|
1016
|
+
```
|
|
1017
|
+
|
|
848
1018
|
#### `divider-props`
|
|
849
1019
|
|
|
850
1020
|
```diff
|
|
@@ -858,6 +1028,172 @@ npx @mui/codemod@next deprecations/chip-classes <path>
|
|
|
858
1028
|
npx @mui/codemod@next deprecations/divider-props <path>
|
|
859
1029
|
```
|
|
860
1030
|
|
|
1031
|
+
#### `filled-input-props`
|
|
1032
|
+
|
|
1033
|
+
```diff
|
|
1034
|
+
<FilledInput
|
|
1035
|
+
- components={{ Input: CustomInput, Root: CustomRoot }}
|
|
1036
|
+
+ slots={{ input: CustomInput, root: CustomRoot }}
|
|
1037
|
+
- componentsProps={{ input: { id: 'test-input-id' }, root: { id: 'test-root-id' } }}
|
|
1038
|
+
+ slotProps={{ input: { id: 'test-input-id' }, root: { id: 'test-root-id' } }}
|
|
1039
|
+
/>
|
|
1040
|
+
```
|
|
1041
|
+
|
|
1042
|
+
```diff
|
|
1043
|
+
MuiFilledInput: {
|
|
1044
|
+
defaultProps: {
|
|
1045
|
+
- components: { Input: CustomInput, Root: CustomRoot }
|
|
1046
|
+
+ slots: { input: CustomInput, root: CustomRoot },
|
|
1047
|
+
- componentsProps: { input: { id: 'test-input-id' }, root: { id: 'test-root-id' } }
|
|
1048
|
+
+ slotProps: { input: { id: 'test-input-id' }, root: { id: 'test-root-id' } },
|
|
1049
|
+
},
|
|
1050
|
+
},
|
|
1051
|
+
```
|
|
1052
|
+
|
|
1053
|
+
```bash
|
|
1054
|
+
npx @mui/codemod@next deprecations/filled-input-props <path>
|
|
1055
|
+
```
|
|
1056
|
+
|
|
1057
|
+
#### `form-control-label-props`
|
|
1058
|
+
|
|
1059
|
+
```diff
|
|
1060
|
+
<FormControlLabel
|
|
1061
|
+
- componentsProps={{ typography: typographyProps }}
|
|
1062
|
+
+ slotProps={{ typography: typographyProps }}
|
|
1063
|
+
/>
|
|
1064
|
+
```
|
|
1065
|
+
|
|
1066
|
+
```diff
|
|
1067
|
+
MuiFormControlLabel: {
|
|
1068
|
+
defaultProps: {
|
|
1069
|
+
- componentsProps={{ typography: typographyProps }}
|
|
1070
|
+
+ slotProps={{ typography: typographyProps }}
|
|
1071
|
+
},
|
|
1072
|
+
},
|
|
1073
|
+
```
|
|
1074
|
+
|
|
1075
|
+
```bash
|
|
1076
|
+
npx @mui/codemod@next deprecations/form-control-label-props <path>
|
|
1077
|
+
|
|
1078
|
+
```
|
|
1079
|
+
|
|
1080
|
+
#### `list-item-props`
|
|
1081
|
+
|
|
1082
|
+
```diff
|
|
1083
|
+
<ListItem
|
|
1084
|
+
- components={{ Root: CustomRoot }}
|
|
1085
|
+
+ slots={{ root: CustomRoot }}
|
|
1086
|
+
- componentsProps={{ root: { testid: 'test-id' } }}
|
|
1087
|
+
+ slotProps={{ root: { testid: 'test-id' } }}
|
|
1088
|
+
/>
|
|
1089
|
+
```
|
|
1090
|
+
|
|
1091
|
+
```diff
|
|
1092
|
+
MuiListItem: {
|
|
1093
|
+
defaultProps: {
|
|
1094
|
+
- components: { Root: CustomRoot }
|
|
1095
|
+
+ slots: { root: CustomRoot },
|
|
1096
|
+
- componentsProps: { root: { testid: 'test-id' }}
|
|
1097
|
+
+ slotProps: { root: { testid: 'test-id' } },
|
|
1098
|
+
},
|
|
1099
|
+
},
|
|
1100
|
+
```
|
|
1101
|
+
|
|
1102
|
+
```bash
|
|
1103
|
+
npx @mui/codemod@next deprecations/list-item-props <path>
|
|
1104
|
+
```
|
|
1105
|
+
|
|
1106
|
+
#### `grid-props`
|
|
1107
|
+
|
|
1108
|
+
```diff
|
|
1109
|
+
<Grid
|
|
1110
|
+
- wrap="nowrap"
|
|
1111
|
+
+ flexWrap="nowrap"
|
|
1112
|
+
/>
|
|
1113
|
+
```
|
|
1114
|
+
|
|
1115
|
+
```bash
|
|
1116
|
+
npx @mui/codemod@next deprecations/grid-props <path>
|
|
1117
|
+
```
|
|
1118
|
+
|
|
1119
|
+
#### `input-base-props`
|
|
1120
|
+
|
|
1121
|
+
```diff
|
|
1122
|
+
<InputBase
|
|
1123
|
+
- components={{ Input: CustomInput, Root: CustomRoot }}
|
|
1124
|
+
+ slots={{ input: CustomInput, root: CustomRoot }}
|
|
1125
|
+
- componentsProps={{ input: { id: 'test-input-id' }, root: { id: 'test-root-id' } }}
|
|
1126
|
+
+ slotProps={{ input: { id: 'test-input-id' }, root: { id: 'test-root-id' } }}
|
|
1127
|
+
/>
|
|
1128
|
+
```
|
|
1129
|
+
|
|
1130
|
+
```diff
|
|
1131
|
+
MuiInputBase: {
|
|
1132
|
+
defaultProps: {
|
|
1133
|
+
- components: { Input: CustomInput, Root: CustomRoot }
|
|
1134
|
+
+ slots: { input: CustomInput, root: CustomRoot },
|
|
1135
|
+
- componentsProps: { input: { id: 'test-input-id' }, root: { id: 'test-root-id' } }
|
|
1136
|
+
+ slotProps: { input: { id: 'test-input-id' }, root: { id: 'test-root-id' } },
|
|
1137
|
+
},
|
|
1138
|
+
},
|
|
1139
|
+
```
|
|
1140
|
+
|
|
1141
|
+
```bash
|
|
1142
|
+
npx @mui/codemod@next deprecations/input-base-props <path>
|
|
1143
|
+
```
|
|
1144
|
+
|
|
1145
|
+
#### `input-props`
|
|
1146
|
+
|
|
1147
|
+
```diff
|
|
1148
|
+
<Input
|
|
1149
|
+
- components={{ Input: CustomInput, Root: CustomRoot }}
|
|
1150
|
+
+ slots={{ input: CustomInput, root: CustomRoot }}
|
|
1151
|
+
- componentsProps={{ input: { id: 'test-input-id' }, root: { id: 'test-root-id' } }}
|
|
1152
|
+
+ slotProps={{ input: { id: 'test-input-id' }, root: { id: 'test-root-id' } }}
|
|
1153
|
+
/>
|
|
1154
|
+
```
|
|
1155
|
+
|
|
1156
|
+
```diff
|
|
1157
|
+
MuiInput: {
|
|
1158
|
+
defaultProps: {
|
|
1159
|
+
- components: { Input: CustomInput, Root: CustomRoot }
|
|
1160
|
+
+ slots: { input: CustomInput, root: CustomRoot },
|
|
1161
|
+
- componentsProps: { input: { id: 'test-input-id' }, root: { id: 'test-root-id' } }
|
|
1162
|
+
+ slotProps: { input: { id: 'test-input-id' }, root: { id: 'test-root-id' } },
|
|
1163
|
+
},
|
|
1164
|
+
},
|
|
1165
|
+
```
|
|
1166
|
+
|
|
1167
|
+
```bash
|
|
1168
|
+
npx @mui/codemod@next deprecations/input-props <path>
|
|
1169
|
+
```
|
|
1170
|
+
|
|
1171
|
+
#### `modal-props`
|
|
1172
|
+
|
|
1173
|
+
```diff
|
|
1174
|
+
<Modal
|
|
1175
|
+
- components={{ Root: CustomRoot, Backdrop: CustomBackdrop }}
|
|
1176
|
+
+ slots={{ root: CustomRoot, backdrop: CustomBackdrop }}
|
|
1177
|
+
- componentsProps={{ root: { testid: 'root-id' }, backdrop: { testid: 'backdrop-id' } }}
|
|
1178
|
+
+ slotProps={{ root: { testid: 'root-id' }, backdrop: { testid: 'backdrop-id' } }}
|
|
1179
|
+
/>
|
|
1180
|
+
```
|
|
1181
|
+
|
|
1182
|
+
```diff
|
|
1183
|
+
MuiModal: {
|
|
1184
|
+
defaultProps: {
|
|
1185
|
+
- components: { Root: CustomRoot, Backdrop: CustomBackdrop }
|
|
1186
|
+
+ slots: { root: CustomRoot, backdrop: CustomBackdrop },
|
|
1187
|
+
- componentsProps: { root: { testid: 'root-id' }, backdrop: { testid: 'backdrop-id' }}
|
|
1188
|
+
+ slotProps: { root: { testid: 'root-id' }, backdrop: { testid: 'backdrop-id' } },
|
|
1189
|
+
},
|
|
1190
|
+
},
|
|
1191
|
+
```
|
|
1192
|
+
|
|
1193
|
+
```bash
|
|
1194
|
+
npx @mui/codemod@next deprecations/modal-props <path>
|
|
1195
|
+
```
|
|
1196
|
+
|
|
861
1197
|
#### `pagination-item-classes`
|
|
862
1198
|
|
|
863
1199
|
JS transforms:
|
|
@@ -922,6 +1258,80 @@ CSS transforms:
|
|
|
922
1258
|
npx @mui/codemod@next deprecations/pagination-item-classes <path>
|
|
923
1259
|
```
|
|
924
1260
|
|
|
1261
|
+
#### `pagination-item-props`
|
|
1262
|
+
|
|
1263
|
+
```diff
|
|
1264
|
+
<PaginationItem
|
|
1265
|
+
- components={{ first: FirstIcon, last: LastIcon, next: NextIcon, previous: PreviousIcons }}
|
|
1266
|
+
+ slots={{ first: FirstIcon, last: LastIcon, next: NextIcon, previous: PreviousIcons }}
|
|
1267
|
+
/>
|
|
1268
|
+
```
|
|
1269
|
+
|
|
1270
|
+
```diff
|
|
1271
|
+
MuiPaginationItem: {
|
|
1272
|
+
defaultProps: {
|
|
1273
|
+
- components: { first: FirstIcon, last: LastIcon, next: NextIcon, previous: PreviousIcons }
|
|
1274
|
+
+ slots: { first: FirstIcon, last: LastIcon, next: NextIcon, previous: PreviousIcons }
|
|
1275
|
+
},
|
|
1276
|
+
},
|
|
1277
|
+
```
|
|
1278
|
+
|
|
1279
|
+
```bash
|
|
1280
|
+
npx @mui/codemod@next deprecations/pagination-item-props <path>
|
|
1281
|
+
```
|
|
1282
|
+
|
|
1283
|
+
#### `popper-props`
|
|
1284
|
+
|
|
1285
|
+
```diff
|
|
1286
|
+
<Popper
|
|
1287
|
+
- components={{ Root: CustomRoot }}
|
|
1288
|
+
+ slots={{ root: CustomRoot }}
|
|
1289
|
+
- componentsProps={{ root: { testid: 'test-id' } }}
|
|
1290
|
+
+ slotProps={{ root: { testid: 'test-id' } }}
|
|
1291
|
+
/>
|
|
1292
|
+
```
|
|
1293
|
+
|
|
1294
|
+
```diff
|
|
1295
|
+
MuiPopper: {
|
|
1296
|
+
defaultProps: {
|
|
1297
|
+
- components: { Root: CustomRoot }
|
|
1298
|
+
+ slots: { root: CustomRoot },
|
|
1299
|
+
- componentsProps: { root: { testid: 'test-id' }}
|
|
1300
|
+
+ slotProps: { root: { testid: 'test-id' } },
|
|
1301
|
+
},
|
|
1302
|
+
},
|
|
1303
|
+
```
|
|
1304
|
+
|
|
1305
|
+
```bash
|
|
1306
|
+
npx @mui/codemod@next deprecations/popper-props <path>
|
|
1307
|
+
```
|
|
1308
|
+
|
|
1309
|
+
#### `outlined-input-props`
|
|
1310
|
+
|
|
1311
|
+
```diff
|
|
1312
|
+
<OutlinedInput
|
|
1313
|
+
- components={{ Input: CustomInput, Root: CustomRoot }}
|
|
1314
|
+
+ slots={{ input: CustomInput, root: CustomRoot }}
|
|
1315
|
+
- componentsProps={{ input: { id: 'test-input-id' }, root: { id: 'test-root-id' } }}
|
|
1316
|
+
+ slotProps={{ input: { id: 'test-input-id' }, root: { id: 'test-root-id' } }}
|
|
1317
|
+
/>
|
|
1318
|
+
```
|
|
1319
|
+
|
|
1320
|
+
```diff
|
|
1321
|
+
MuiOutlinedInput: {
|
|
1322
|
+
defaultProps: {
|
|
1323
|
+
- components: { Input: CustomInput, Root: CustomRoot }
|
|
1324
|
+
+ slots: { input: CustomInput, root: CustomRoot },
|
|
1325
|
+
- componentsProps: { input: { id: 'test-input-id' }, root: { id: 'test-root-id' } }
|
|
1326
|
+
+ slotProps: { input: { id: 'test-input-id' }, root: { id: 'test-root-id' } },
|
|
1327
|
+
},
|
|
1328
|
+
},
|
|
1329
|
+
```
|
|
1330
|
+
|
|
1331
|
+
```bash
|
|
1332
|
+
npx @mui/codemod@next deprecations/outlined-input-props <path>
|
|
1333
|
+
```
|
|
1334
|
+
|
|
925
1335
|
#### `slider-props`
|
|
926
1336
|
|
|
927
1337
|
```diff
|
|
@@ -948,31 +1358,332 @@ npx @mui/codemod@next deprecations/pagination-item-classes <path>
|
|
|
948
1358
|
npx @mui/codemod@next deprecations/slider-props <path>
|
|
949
1359
|
```
|
|
950
1360
|
|
|
1361
|
+
#### `tooltip-props`
|
|
1362
|
+
|
|
1363
|
+
```diff
|
|
1364
|
+
<Tooltip
|
|
1365
|
+
- components={{ Arrow: CustomArrow }}
|
|
1366
|
+
+ slots={{ arrow: CustomArrow }}
|
|
1367
|
+
- componentsProps={{ arrow: { testid: 'test-id' } }}
|
|
1368
|
+
+ slotProps={{ arrow: { testid: 'test-id' } }}
|
|
1369
|
+
/>
|
|
1370
|
+
```
|
|
1371
|
+
|
|
1372
|
+
```diff
|
|
1373
|
+
MuiTooltip: {
|
|
1374
|
+
defaultProps: {
|
|
1375
|
+
- components: { Arrow: CustomArrow }
|
|
1376
|
+
+ slots: { arrow: CustomArrow },
|
|
1377
|
+
- componentsProps: { arrow: { testid: 'test-id' }}
|
|
1378
|
+
+ slotProps: { arrow: { testid: 'test-id' } },
|
|
1379
|
+
},
|
|
1380
|
+
},
|
|
1381
|
+
```
|
|
1382
|
+
|
|
1383
|
+
```bash
|
|
1384
|
+
npx @mui/codemod@next deprecations/tooltip-props <path>
|
|
1385
|
+
```
|
|
1386
|
+
|
|
1387
|
+
#### `step-connector-classes`
|
|
1388
|
+
|
|
1389
|
+
JS transforms:
|
|
1390
|
+
|
|
1391
|
+
```diff
|
|
1392
|
+
import { stepConnectorClasses } from '@mui/material/StepConnector';
|
|
1393
|
+
|
|
1394
|
+
MuiStepConnector: {
|
|
1395
|
+
styleOverrides: {
|
|
1396
|
+
root: {
|
|
1397
|
+
- [`& .${stepConnectorClasses.lineHorizontal}`]: {
|
|
1398
|
+
+ [`&.${stepConnectorClasses.horizontal} > .${stepConnectorClasses.line}`]: {
|
|
1399
|
+
color: 'red',
|
|
1400
|
+
},
|
|
1401
|
+
- [`& .${stepConnectorClasses.lineVertical}`]: {
|
|
1402
|
+
+ [`&.${stepConnectorClasses.vertical} > .${stepConnectorClasses.line}`]: {
|
|
1403
|
+
color: 'red',
|
|
1404
|
+
},
|
|
1405
|
+
},
|
|
1406
|
+
},
|
|
1407
|
+
},
|
|
1408
|
+
```
|
|
1409
|
+
|
|
951
1410
|
#### `step-label-props`
|
|
952
1411
|
|
|
953
1412
|
```diff
|
|
954
1413
|
<StepLabel
|
|
955
1414
|
- componentsProps={{ label: labelProps }}
|
|
956
1415
|
+ slotProps={{ label: labelProps }}
|
|
1416
|
+
- StepIconComponent={StepIconComponent}
|
|
1417
|
+
+ slots={{ stepIcon: StepIconComponent }}
|
|
1418
|
+
- StepIconProps={StepIconProps}
|
|
1419
|
+
+ slotProps={{ stepIcon: StepIconProps }}
|
|
957
1420
|
/>
|
|
958
1421
|
```
|
|
959
1422
|
|
|
960
1423
|
```diff
|
|
961
1424
|
MuiStepLabel: {
|
|
962
1425
|
defaultProps: {
|
|
963
|
-
- componentsProps
|
|
964
|
-
+ slotProps
|
|
1426
|
+
- componentsProps:{ label: labelProps }
|
|
1427
|
+
+ slotProps:{ label: labelProps }
|
|
1428
|
+
- StepIconComponent:StepIconComponent
|
|
1429
|
+
+ slots:{ stepIcon: StepIconComponent }
|
|
1430
|
+
- StepIconProps:StepIconProps
|
|
1431
|
+
+ slotProps:{ stepIcon: StepIconProps }
|
|
965
1432
|
},
|
|
966
1433
|
},
|
|
967
1434
|
```
|
|
968
1435
|
|
|
969
1436
|
```bash
|
|
970
1437
|
npx @mui/codemod@latest deprecations/step-label-props <path>
|
|
1438
|
+
```
|
|
1439
|
+
|
|
1440
|
+
#### `text-field-props`
|
|
1441
|
+
|
|
1442
|
+
```diff
|
|
1443
|
+
<TextField
|
|
1444
|
+
- InputProps={CustomInputProps}
|
|
1445
|
+
- inputProps={CustomHtmlInputProps}
|
|
1446
|
+
- SelectProps={CustomSelectProps}
|
|
1447
|
+
- InputLabelProps={CustomInputLabelProps}
|
|
1448
|
+
- FormHelperTextProps={CustomFormHelperProps}
|
|
1449
|
+
+ slotProps={{
|
|
1450
|
+
+ input: CustomInputProps
|
|
1451
|
+
+ htmlInput: CustomHtmlInputProps
|
|
1452
|
+
+ select: CustomSelectProps
|
|
1453
|
+
+ inputLabel: CustomInputLabelProps
|
|
1454
|
+
+ formHelper: CustomFormHelperProps
|
|
1455
|
+
+ }}
|
|
1456
|
+
/>
|
|
1457
|
+
```
|
|
1458
|
+
|
|
1459
|
+
```bash
|
|
1460
|
+
npx @mui/codemod@next deprecations/text-field-props <path>
|
|
1461
|
+
```
|
|
1462
|
+
|
|
1463
|
+
#### `toggle-button-group-classes`
|
|
971
1464
|
|
|
1465
|
+
JS transforms:
|
|
1466
|
+
|
|
1467
|
+
```diff
|
|
1468
|
+
import { toggleButtonGroupClasses } from '@mui/material/ToggleButtonGroup';
|
|
1469
|
+
|
|
1470
|
+
MuiToggleButtonGroup: {
|
|
1471
|
+
styleOverrides: {
|
|
1472
|
+
root: {
|
|
1473
|
+
- [`& .${toggleButtonGroupClasses.groupedHorizontal}`]: {
|
|
1474
|
+
+ [`&.${toggleButtonGroupClasses.horizontal} > .${toggleButtonGroupClasses.grouped}`]: {
|
|
1475
|
+
color: 'red',
|
|
1476
|
+
},
|
|
1477
|
+
- [`& .${toggleButtonGroupClasses.groupedVertical}`]: {
|
|
1478
|
+
+ [`&.${toggleButtonGroupClasses.vertical} > .${toggleButtonGroupClasses.grouped}`]: {
|
|
1479
|
+
color: 'red',
|
|
1480
|
+
},
|
|
1481
|
+
},
|
|
1482
|
+
},
|
|
1483
|
+
},
|
|
1484
|
+
```
|
|
1485
|
+
|
|
1486
|
+
CSS transforms:
|
|
1487
|
+
|
|
1488
|
+
```diff
|
|
1489
|
+
-.MuiToggleButtonGroup-root .MuiToggleButtonGroup-groupedHorizontal
|
|
1490
|
+
+.MuiToggleButtonGroup-root.MuiToggleButtonGroup-horizontal > .MuiToggleButtonGroup-grouped
|
|
1491
|
+
-.MuiToggleButtonGroup-root .MuiToggleButtonGroup-groupedVertical
|
|
1492
|
+
+.MuiToggleButtonGroup-root.MuiToggleButtonGroup-vertical > .MuiToggleButtonGroup-grouped
|
|
1493
|
+
/>
|
|
1494
|
+
```
|
|
1495
|
+
|
|
1496
|
+
```bash
|
|
1497
|
+
npx @mui/codemod@latest deprecations/toggle-button-group-classes <path>
|
|
1498
|
+
```
|
|
1499
|
+
|
|
1500
|
+
CSS transforms:
|
|
1501
|
+
|
|
1502
|
+
```diff
|
|
1503
|
+
- .MuiStepConnector-lineHorizontal
|
|
1504
|
+
+.MuiStepConnector-horizontal > .MuiStepConnector-line
|
|
1505
|
+
- .MuiStepConnector-lineVertical
|
|
1506
|
+
+.MuiStepConnector-vertical > .MuiStepConnector-line
|
|
1507
|
+
```
|
|
1508
|
+
|
|
1509
|
+
```bash
|
|
1510
|
+
npx @mui/codemod@next deprecations/step-connector-classes <path>
|
|
972
1511
|
```
|
|
973
1512
|
|
|
974
1513
|
### v6.0.0
|
|
975
1514
|
|
|
1515
|
+
#### `sx-prop`
|
|
1516
|
+
|
|
1517
|
+
```bash
|
|
1518
|
+
npx @mui/codemod@next v6.0.0/sx-prop <path>
|
|
1519
|
+
```
|
|
1520
|
+
|
|
1521
|
+
Update the usage of the `sx` prop to be compatible with `@pigment-css/react`.
|
|
1522
|
+
|
|
1523
|
+
```diff
|
|
1524
|
+
<Box
|
|
1525
|
+
- sx={{
|
|
1526
|
+
- backgroundColor: (theme) =>
|
|
1527
|
+
- theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[900],
|
|
1528
|
+
- }}
|
|
1529
|
+
+ sx={theme => ({
|
|
1530
|
+
+ backgroundColor: theme.palette.grey[900],
|
|
1531
|
+
+ ...theme.applyStyles("light", {
|
|
1532
|
+
+ backgroundColor: theme.palette.grey[100]
|
|
1533
|
+
+ })
|
|
1534
|
+
+ })}
|
|
1535
|
+
/>
|
|
1536
|
+
```
|
|
1537
|
+
|
|
1538
|
+
#### `system-props`
|
|
1539
|
+
|
|
1540
|
+
```bash
|
|
1541
|
+
npx @mui/codemod@next v6.0.0/system-props <path>
|
|
1542
|
+
```
|
|
1543
|
+
|
|
1544
|
+
Remove system props and add them to the `sx` prop.
|
|
1545
|
+
|
|
1546
|
+
```diff
|
|
1547
|
+
- <Box ml="2px" py={1} color="primary.main" />
|
|
1548
|
+
+ <Box sx={{ ml: "2px", py: 1, color: 'primary.main' }} />
|
|
1549
|
+
```
|
|
1550
|
+
|
|
1551
|
+
#### `theme-v6`
|
|
1552
|
+
|
|
1553
|
+
```bash
|
|
1554
|
+
npx @mui/codemod@next v6.0.0/theme-v6 <path>
|
|
1555
|
+
```
|
|
1556
|
+
|
|
1557
|
+
Update the theme creation from `@mui/system@v5` to be compatible with `@pigment-css/react`.
|
|
1558
|
+
|
|
1559
|
+
- replace palette mode conditional with `theme.applyStyles()`
|
|
1560
|
+
- replace `ownerState` with `variants`
|
|
1561
|
+
- move theme variants to the root slot
|
|
1562
|
+
|
|
1563
|
+
```diff
|
|
1564
|
+
createTheme({
|
|
1565
|
+
components: {
|
|
1566
|
+
MuiButton: {
|
|
1567
|
+
- variants: [
|
|
1568
|
+
- {
|
|
1569
|
+
- props: { color: 'primary' },
|
|
1570
|
+
- style: {
|
|
1571
|
+
- color: 'red',
|
|
1572
|
+
- },
|
|
1573
|
+
- },
|
|
1574
|
+
- ],
|
|
1575
|
+
styleOverrides: {
|
|
1576
|
+
- root: ({ theme, ownerState }) => ({
|
|
1577
|
+
+ root: ({ theme }) => ({
|
|
1578
|
+
...ownerState.variant === 'contained' && {
|
|
1579
|
+
backgroundColor: alpha(theme.palette.primary.main, 0.8),
|
|
1580
|
+
...theme.palette.mode === 'dark' && {
|
|
1581
|
+
backgroundColor: alpha(theme.palette.primary.light, 0.9),
|
|
1582
|
+
}
|
|
1583
|
+
},
|
|
1584
|
+
+ variants: [
|
|
1585
|
+
+ {
|
|
1586
|
+
+ prop: { variant: 'contained' },
|
|
1587
|
+
+ style: {
|
|
1588
|
+
+ backgroundColor: alpha(theme.palette.primary.main, 0.8),
|
|
1589
|
+
+ },
|
|
1590
|
+
+ },
|
|
1591
|
+
+ {
|
|
1592
|
+
+ prop: { variant: 'contained' },
|
|
1593
|
+
+ style: {
|
|
1594
|
+
+ ...theme.applyStyles('dark', {
|
|
1595
|
+
+ backgroundColor: alpha(theme.palette.primary.light, 0.9),
|
|
1596
|
+
+ })
|
|
1597
|
+
+ },
|
|
1598
|
+
+ },
|
|
1599
|
+
+ {
|
|
1600
|
+
+ prop: { color: 'primary' },
|
|
1601
|
+
+ style: {
|
|
1602
|
+
+ color: 'red',
|
|
1603
|
+
+ },
|
|
1604
|
+
+ },
|
|
1605
|
+
+ ],
|
|
1606
|
+
})
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
})
|
|
1611
|
+
```
|
|
1612
|
+
|
|
1613
|
+
#### `styled`
|
|
1614
|
+
|
|
1615
|
+
```bash
|
|
1616
|
+
npx @mui/codemod@next v6.0.0/styled <path>
|
|
1617
|
+
```
|
|
1618
|
+
|
|
1619
|
+
Updates the usage of `styled` from `@mui/system@v5` to be compatible with `@pigment-css/react`.
|
|
1620
|
+
|
|
1621
|
+
This codemod transforms the styles based on props to `variants` by looking for `styled` calls:
|
|
1622
|
+
|
|
1623
|
+
```diff
|
|
1624
|
+
styled('div')(({ theme, disabled }) => ({
|
|
1625
|
+
color: theme.palette.primary.main,
|
|
1626
|
+
- ...(disabled && {
|
|
1627
|
+
- opacity: 0.5,
|
|
1628
|
+
- }),
|
|
1629
|
+
+ variants: [
|
|
1630
|
+
+ {
|
|
1631
|
+
+ prop: 'disabled',
|
|
1632
|
+
+ style: {
|
|
1633
|
+
+ opacity: 0.5,
|
|
1634
|
+
+ },
|
|
1635
|
+
+ },
|
|
1636
|
+
+ ],
|
|
1637
|
+
}));
|
|
1638
|
+
```
|
|
1639
|
+
|
|
1640
|
+
This codemod can handle complex styles with spread operators, ternary operators, and nested objects.
|
|
1641
|
+
|
|
1642
|
+
However, it has some **limitations**:
|
|
1643
|
+
|
|
1644
|
+
- It does not transform dynamic values as shown below:
|
|
1645
|
+
|
|
1646
|
+
```js
|
|
1647
|
+
const ResizableContainer = styled('div')(({ ownerState, theme }) => ({
|
|
1648
|
+
width: ownerState.width ?? '100%',
|
|
1649
|
+
height: ownerState.height ?? '100%',
|
|
1650
|
+
}));
|
|
1651
|
+
```
|
|
1652
|
+
|
|
1653
|
+
You need to manually declare a CSS variable and set the values using inline styles:
|
|
1654
|
+
|
|
1655
|
+
```js
|
|
1656
|
+
// ✅ Recommended way
|
|
1657
|
+
const ResizableContainer = styled('div')({
|
|
1658
|
+
width: 'var(--ResizableContainer-width, 100%)',
|
|
1659
|
+
height: 'var(--ResizableContainer-height, 100%)',
|
|
1660
|
+
});
|
|
1661
|
+
```
|
|
1662
|
+
|
|
1663
|
+
- It does not transform dynamic reference from the theme, for example color palette.
|
|
1664
|
+
|
|
1665
|
+
```js
|
|
1666
|
+
const Test = styled('div')(({ ownerState, theme }) => ({
|
|
1667
|
+
backgroundColor: (theme.vars || theme).palette[ownerState.color]?.main,
|
|
1668
|
+
}));
|
|
1669
|
+
```
|
|
1670
|
+
|
|
1671
|
+
You need to manually iterate the theme object and create `variants` for each color.
|
|
1672
|
+
|
|
1673
|
+
```js
|
|
1674
|
+
// ✅ Recommended way
|
|
1675
|
+
const Test = styled('div')(({ theme }) => ({
|
|
1676
|
+
variants: Object.entries(theme.palette)
|
|
1677
|
+
.filter(([color, value]) => value.main)
|
|
1678
|
+
.map(([color, value]) => ({
|
|
1679
|
+
props: { color },
|
|
1680
|
+
style: {
|
|
1681
|
+
backgroundColor: value.main,
|
|
1682
|
+
},
|
|
1683
|
+
})),
|
|
1684
|
+
}));
|
|
1685
|
+
```
|
|
1686
|
+
|
|
976
1687
|
### v5.0.0
|
|
977
1688
|
|
|
978
1689
|
#### `base-use-named-exports`
|