@mui/codemod 5.6.0 → 5.7.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.
package/README.md CHANGED
@@ -145,7 +145,7 @@ Imports and inserts `adaptV4Theme` into `createTheme` (or `createMuiTheme`)
145
145
  npx @mui/codemod v5.0.0/adapter-v4 <path>
146
146
  ```
147
147
 
148
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#theme).
148
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#theme).
149
149
 
150
150
  #### `autocomplete-rename-closeicon`
151
151
 
@@ -162,7 +162,7 @@ Renames `Autocomplete`'s `closeIcon` prop to `clearIcon`.
162
162
  npx @mui/codemod v5.0.0/autocomplete-rename-closeicon <path>
163
163
  ```
164
164
 
165
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#autocomplete).
165
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#autocomplete).
166
166
 
167
167
  #### `autocomplete-rename-option`
168
168
 
@@ -181,7 +181,7 @@ Renames `Autocomplete`'s `getOptionSelected` to `isOptionEqualToValue`.
181
181
  npx @mui/codemod v5.0.0/autocomplete-rename-option <path>
182
182
  ```
183
183
 
184
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#autocomplete).
184
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#autocomplete).
185
185
 
186
186
  #### `avatar-circle-circular`
187
187
 
@@ -200,7 +200,7 @@ Updates the `Avatar`'s `variant` value and `classes` key from 'circle' to 'circu
200
200
  npx @mui/codemod v5.0.0/avatar-circle-circular <path>
201
201
  ```
202
202
 
203
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#avatar).
203
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#avatar).
204
204
 
205
205
  #### `badge-overlap-value`
206
206
 
@@ -235,7 +235,7 @@ Renames the badge's props.
235
235
  npx @mui/codemod v5.0.0/badge-overlap-value <path>
236
236
  ```
237
237
 
238
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#badge).
238
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#badge).
239
239
 
240
240
  #### `box-borderradius-values`
241
241
 
@@ -254,7 +254,7 @@ Updates the Box API from separate system props to `sx`.
254
254
  npx @mui/codemod v5.0.0/box-borderradius-values <path>
255
255
  ```
256
256
 
257
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#box).
257
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#box).
258
258
 
259
259
  #### `box-rename-css`
260
260
 
@@ -269,7 +269,7 @@ Renames the Box `css` prop to `sx`
269
269
  npx @mui/codemod v5.0.0/box-rename-css <path>
270
270
  ```
271
271
 
272
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#box).
272
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#box).
273
273
 
274
274
  #### `box-rename-gap`
275
275
 
@@ -290,7 +290,7 @@ Renames the Box `grid*Gap` props.
290
290
  npx @mui/codemod v5.0.0/box-rename-gap <path>
291
291
  ```
292
292
 
293
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#box).
293
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#box).
294
294
 
295
295
  #### `button-color-prop`
296
296
 
@@ -307,7 +307,7 @@ Removes the outdated `color` prop values.
307
307
  npx @mui/codemod v5.0.0/button-color-prop <path>
308
308
  ```
309
309
 
310
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#button).
310
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#button).
311
311
 
312
312
  #### `chip-variant-prop`
313
313
 
@@ -324,7 +324,7 @@ Removes the Chip `variant` prop if the value is `"default"`.
324
324
  npx @mui/codemod v5.0.0/chip-variant-prop <path>
325
325
  ```
326
326
 
327
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#chip).
327
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#chip).
328
328
 
329
329
  #### `circularprogress-variant`
330
330
 
@@ -341,7 +341,7 @@ Renames the CircularProgress `static` variant to `determinate`.
341
341
  npx @mui/codemod v5.0.0/circularprogress-variant <path>
342
342
  ```
343
343
 
344
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#circularprogress).
344
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#circularprogress).
345
345
 
346
346
  #### `collapse-rename-collapsedheight`
347
347
 
@@ -360,7 +360,7 @@ Renames `Collapse`'s `collapsedHeight` prop to `collapsedSize`.
360
360
  npx @mui/codemod v5.0.0/collapse-rename-collapsedheight <path>
361
361
  ```
362
362
 
363
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#collapse).
363
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#collapse).
364
364
 
365
365
  #### `component-rename-prop`
366
366
 
@@ -418,7 +418,7 @@ Remove `disableBackdropClick` prop from `<Dialog>`
418
418
  npx @mui/codemod v5.0.0/dialog-props <path>
419
419
  ```
420
420
 
421
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#dialog).
421
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#dialog).
422
422
 
423
423
  #### `dialog-title-props`
424
424
 
@@ -433,7 +433,7 @@ Remove `disableTypography` prop from `<DialogTitle>`
433
433
  npx @mui/codemod v5.0.0/dialog-title-props <path>
434
434
  ```
435
435
 
436
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#dialog).
436
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#dialog).
437
437
 
438
438
  #### `emotion-prepend-cache`
439
439
 
@@ -458,7 +458,7 @@ Renames `ExpansionPanel*` to `Accordion*`
458
458
  npx @mui/codemod v5.0.0/expansion-panel-component <path>
459
459
  ```
460
460
 
461
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#expansionpanel).
461
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#expansionpanel).
462
462
 
463
463
  #### `fab-variant`
464
464
 
@@ -471,7 +471,7 @@ You can find more details about this breaking change in [the migration guide](ht
471
471
  npx @mui/codemod v5.0.0/fab-variant <path>
472
472
  ```
473
473
 
474
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#fab).
474
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#fab).
475
475
 
476
476
  #### `fade-rename-alpha`
477
477
 
@@ -491,7 +491,7 @@ Renames the `fade` style utility import and calls to `alpha`.
491
491
  npx @mui/codemod v5.0.0/fade-rename-alpha <path>
492
492
  ```
493
493
 
494
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#styles).
494
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#styles).
495
495
 
496
496
  #### `grid-justify-justifycontent`
497
497
 
@@ -508,7 +508,7 @@ Renames `Grid`'s `justify` prop to `justifyContent`.
508
508
  npx @mui/codemod v5.0.0/grid-justify-justifycontent <path>
509
509
  ```
510
510
 
511
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#grid).
511
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#grid).
512
512
 
513
513
  #### `grid-list-component`
514
514
 
@@ -518,7 +518,7 @@ Renames `GridList*` to `ImageList*`
518
518
  npx @mui/codemod v5.0.0/grid-list-component <path>
519
519
  ```
520
520
 
521
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#gridlist).
521
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#gridlist).
522
522
 
523
523
  #### `icon-button-size`
524
524
 
@@ -535,7 +535,7 @@ Adds `size="large"` if `size` is not defined to get the same appearance as v4.
535
535
  npx @mui/codemod v5.0.0/icon-button-size <path>
536
536
  ```
537
537
 
538
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#iconbutton).
538
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#iconbutton).
539
539
 
540
540
  #### `jss-to-styled`
541
541
 
@@ -600,10 +600,10 @@ export const MyCard = () => {
600
600
  npx @mui/codemod v5.0.0/jss-to-styled <path>
601
601
  ```
602
602
 
603
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#1-use-styled-or-sx-api).
603
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#1-use-styled-or-sx-api).
604
604
 
605
605
  > **Note:** This approach converts the first element in the return statement into styled component but also increases CSS specificity to override nested children.
606
- > This codemod should be adopted after handling all breaking changes, [check out the migration documentation](https://mui.com/guides/migration-v4/)
606
+ > This codemod should be adopted after handling all breaking changes, [check out the migration documentation](https://mui.com/material-ui/guides/migration-v4/)
607
607
 
608
608
  #### `link-underline-hover`
609
609
 
@@ -618,7 +618,7 @@ Apply `underline="hover"` to `<Link />` that does not define `underline` prop (t
618
618
  npx @mui/codemod v5.0.0/icon-button-size <path>
619
619
  ```
620
620
 
621
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#link).
621
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#link).
622
622
 
623
623
  #### `material-ui-styles`
624
624
 
@@ -669,7 +669,7 @@ Renames `Omit` import from `@material-ui/types` to `DistributiveOmit`
669
669
  npx @mui/codemod v5.0.0/material-ui-types <path>
670
670
  ```
671
671
 
672
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#material-ui-types).
672
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#material-ui-types).
673
673
 
674
674
  #### `modal-props`
675
675
 
@@ -686,7 +686,7 @@ Removes `disableBackdropClick` and `onEscapeKeyDown` from `<Modal>`
686
686
  npx @mui/codemod v5.0.0/modal-props <path>
687
687
  ```
688
688
 
689
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#modal).
689
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#modal).
690
690
 
691
691
  #### `moved-lab-modules`
692
692
 
@@ -712,13 +712,13 @@ npx @mui/codemod v5.0.0/moved-lab-modules <path>
712
712
 
713
713
  You can find more details about this breaking change in the migration guide.
714
714
 
715
- - [Alert](https://mui.com/guides/migration-v4/#alert)
716
- - [Autocomplete](https://mui.com/guides/migration-v4/#autocomplete)
717
- - [AvatarGroup](https://mui.com/guides/migration-v4/#avatar)
718
- - [Pagination](https://mui.com/guides/migration-v4/#pagination)
719
- - [Skeleton](https://mui.com/guides/migration-v4/#skeleton)
720
- - [SpeedDial](https://mui.com/guides/migration-v4/#speeddial)
721
- - [ToggleButton](https://mui.com/guides/migration-v4/#togglebutton)
715
+ - [Alert](https://mui.com/material-ui/guides/migration-v4/#alert)
716
+ - [Autocomplete](https://mui.com/material-ui/guides/migration-v4/#autocomplete)
717
+ - [AvatarGroup](https://mui.com/material-ui/guides/migration-v4/#avatar)
718
+ - [Pagination](https://mui.com/material-ui/guides/migration-v4/#pagination)
719
+ - [Skeleton](https://mui.com/material-ui/guides/migration-v4/#skeleton)
720
+ - [SpeedDial](https://mui.com/material-ui/guides/migration-v4/#speeddial)
721
+ - [ToggleButton](https://mui.com/material-ui/guides/migration-v4/#togglebutton)
722
722
 
723
723
  #### `pagination-round-circular`
724
724
 
@@ -735,7 +735,7 @@ Renames `Pagination*`'s `shape` values from 'round' to 'circular'.
735
735
  npx @mui/codemod v5.0.0/pagination-round-circular <path>
736
736
  ```
737
737
 
738
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#pagination).
738
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#pagination).
739
739
 
740
740
  #### `optimal-imports`
741
741
 
@@ -762,7 +762,7 @@ Removes `RootRef` from the codebase.
762
762
  npx @mui/codemod v5.0.0/root-ref <path>
763
763
  ```
764
764
 
765
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#rootref).
765
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#rootref).
766
766
 
767
767
  #### `skeleton-variant`
768
768
 
@@ -777,7 +777,7 @@ You can find more details about this breaking change in [the migration guide](ht
777
777
  npx @mui/codemod v5.0.0/skeleton-variant <path>
778
778
  ```
779
779
 
780
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#skeleton).
780
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#skeleton).
781
781
 
782
782
  #### `styled-engine-provider`
783
783
 
@@ -787,7 +787,7 @@ Applies `StyledEngineProvider` to the files that contains `ThemeProvider`.
787
787
  npx @mui/codemod v5.0.0/styled-engine-provider <path>
788
788
  ```
789
789
 
790
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#style-library).
790
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#style-library).
791
791
 
792
792
  #### `table-props`
793
793
 
@@ -813,7 +813,7 @@ Renames props in `Table*` components.
813
813
  npx @mui/codemod v5.0.0/table-props <path>
814
814
  ```
815
815
 
816
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#table).
816
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#table).
817
817
 
818
818
  #### `tabs-scroll-buttons`
819
819
 
@@ -832,7 +832,7 @@ Renames the `Tabs`'s `scrollButtons` prop values.
832
832
  npx @mui/codemod v5.0.0/tabs-scroll-buttons <path>
833
833
  ```
834
834
 
835
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#tabs).
835
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#tabs).
836
836
 
837
837
  #### `textarea-minmax-rows`
838
838
 
@@ -853,8 +853,8 @@ npx @mui/codemod v5.0.0/textarea-minmax-rows <path>
853
853
 
854
854
  You can find more details about this breaking change in the migration guide.
855
855
 
856
- - [TextareaAutosize](https://mui.com/guides/migration-v4/#textareaautoresize)
857
- - [TextField](https://mui.com/guides/migration-v4/#textfield)
856
+ - [TextareaAutosize](https://mui.com/material-ui/guides/migration-v4/#textareaautoresize)
857
+ - [TextField](https://mui.com/material-ui/guides/migration-v4/#textfield)
858
858
 
859
859
  #### `theme-augment`
860
860
 
@@ -864,7 +864,7 @@ Adds `DefaultTheme` module augmentation to typescript projects.
864
864
  npx @mui/codemod v5.0.0/theme-augment <path>
865
865
  ```
866
866
 
867
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#material-ui-styles).
867
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#material-ui-styles).
868
868
 
869
869
  #### `theme-breakpoints`
870
870
 
@@ -883,7 +883,7 @@ Updates breakpoint values to match new logic. ⚠️ This mod is not idempotent,
883
883
  npx @mui/codemod v5.0.0/theme-breakpoints <path>
884
884
  ```
885
885
 
886
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#theme).
886
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#theme).
887
887
 
888
888
  #### `theme-breakpoints-width`
889
889
 
@@ -893,7 +893,7 @@ Renames `theme.breakpoints.width('md')` to `theme.breakpoints.values.md`.
893
893
  npx @mui/codemod v5.0.0/theme-breakpoints-width <path>
894
894
  ```
895
895
 
896
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#theme).
896
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#theme).
897
897
 
898
898
  #### `theme-options`
899
899
 
@@ -921,7 +921,7 @@ Renames `type` to `mode`.
921
921
  npx @mui/codemod v5.0.0/theme-palette-mode <path>
922
922
  ```
923
923
 
924
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#theme).
924
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#theme).
925
925
 
926
926
  #### `theme-provider`
927
927
 
@@ -931,7 +931,7 @@ Renames `MuiThemeProvider` to `ThemeProvider`.
931
931
  npx @mui/codemod v5.0.0/theme-provider <path>
932
932
  ```
933
933
 
934
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#material-ui-core-styles).
934
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#material-ui-core-styles).
935
935
 
936
936
  #### `theme-spacing`
937
937
 
@@ -950,7 +950,7 @@ Removes the 'px' suffix from some template strings.
950
950
  npx @mui/codemod v5.0.0/theme-spacing <path>
951
951
  ```
952
952
 
953
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#theme).
953
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#theme).
954
954
 
955
955
  #### `theme-typography-round`
956
956
 
@@ -965,7 +965,7 @@ Renames `theme.typography.round($number)` to `Math.round($number * 1e5) / 1e5`.
965
965
  npx @mui/codemod v5.0.0/theme-typography-round <path>
966
966
  ```
967
967
 
968
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#theme).
968
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#theme).
969
969
 
970
970
  #### `top-level-imports`
971
971
 
@@ -1035,7 +1035,7 @@ Updates Dialog, Menu, Popover, and Snackbar to use the `TransitionProps` prop to
1035
1035
  npx @mui/codemod v5.0.0/use-transitionprops <path>
1036
1036
  ```
1037
1037
 
1038
- You can find more details about this breaking change in [the migration guide](/guides/migration-v4/#dialog).
1038
+ You can find more details about this breaking change in [the migration guide](/material-ui/guides/migration-v4/#dialog).
1039
1039
 
1040
1040
  #### `variant-prop`
1041
1041
 
@@ -1079,7 +1079,7 @@ Removes imported `withMobileDialog`, and inserts hardcoded version to prevent ap
1079
1079
  npx @mui/codemod v5.0.0/with-mobile-dialog <path>
1080
1080
  ```
1081
1081
 
1082
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#dialog).
1082
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#dialog).
1083
1083
 
1084
1084
  #### `with-width`
1085
1085
 
@@ -1095,7 +1095,7 @@ Removes `withWidth` import, and inserts hardcoded version to prevent application
1095
1095
  npx @mui/codemod v5.0.0/with-width <path>
1096
1096
  ```
1097
1097
 
1098
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#material-ui-core-styles).
1098
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#material-ui-core-styles).
1099
1099
 
1100
1100
  #### `mui-replace`
1101
1101
 
@@ -1156,7 +1156,7 @@ Replace every occurrence of `material-ui` related package with the new package n
1156
1156
  npx @mui/codemod v5.0.0/mui-replace <path>
1157
1157
  ```
1158
1158
 
1159
- You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#update-material-ui-version).
1159
+ You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#update-material-ui-version).
1160
1160
 
1161
1161
  ### v4.0.0
1162
1162
 
package/codemod.js CHANGED
File without changes
@@ -34,7 +34,7 @@ function transformer(file, api, options) {
34
34
  }).toSource(printOptions);
35
35
 
36
36
  if (hasDisableBackdropClick || hasDisableBackdropClick) {
37
- source = source.replace(/(<Modal)([\s\S]*>)/gm, `$1// You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#modal)${_os.EOL}$2`);
37
+ source = source.replace(/(<Modal)([\s\S]*>)/gm, `$1// You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#modal)${_os.EOL}$2`);
38
38
  }
39
39
 
40
40
  if (hasDisableBackdropClick) {
@@ -5,7 +5,7 @@ var _jsxRuntime = require("react/jsx-runtime");
5
5
  /*#__PURE__*/
6
6
  (0, _jsxRuntime.jsx)(Modal // `handleOnEscapeKeyDown` is removed by codemod.
7
7
  // `disableBackdropClick` is removed by codemod.
8
- // You can find more details about this breaking change in [the migration guide](https://mui.com/guides/migration-v4/#modal)
8
+ // You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/guides/migration-v4/#modal)
9
9
  , {
10
10
  onClose: handleClose
11
11
  });
@@ -37,7 +37,11 @@ function transformer(file, api, options) {
37
37
  }
38
38
  }).forEach(path => {
39
39
  path.node.arguments.forEach(node => {
40
- node.value = map[node.value];
40
+ const replacementValue = map[node.value];
41
+
42
+ if (replacementValue !== undefined) {
43
+ node.value = replacementValue;
44
+ }
41
45
  });
42
46
  });
43
47
  root.find(j.CallExpression, {
@@ -55,7 +59,11 @@ function transformer(file, api, options) {
55
59
  }
56
60
  }).forEach(path => {
57
61
  const node = path.node.arguments[1];
58
- node.value = map[node.value];
62
+ const replacementValue = map[node.value];
63
+
64
+ if (replacementValue !== undefined) {
65
+ node.value = replacementValue;
66
+ }
59
67
  });
60
68
  return root.toSource(printOptions);
61
69
  }
@@ -2,5 +2,6 @@
2
2
 
3
3
  theme.breakpoints.down('sm');
4
4
  theme.breakpoints.down('xl');
5
+ theme.breakpoints.down(360);
5
6
  theme.breakpoints.between('sm', 'md');
6
7
  theme.breakpoints.between('sm', 'xl');
@@ -2,5 +2,6 @@
2
2
 
3
3
  theme.breakpoints.down('md');
4
4
  theme.breakpoints.down('xl');
5
+ theme.breakpoints.down(360);
5
6
  theme.breakpoints.between('sm', 'lg');
6
7
  theme.breakpoints.between('sm', 'xl');
@@ -11,7 +11,7 @@ exports.default = transformer;
11
11
  function transformer(file) {
12
12
  return file.source // `${theme.spacing(2)}px` -> theme.spacing(2)
13
13
  .replace(/`(-?)\${(-?)(theme\.spacing|spacing)\(([^{}]*)\)}px`/gm, '$3($1$2$4)') // `${theme.spacing(2)}px ${theme.spacing(4)}px` -> `${theme.spacing(2)} ${theme.spacing(4)}`
14
- .replace(/(?<={(theme\.spacing|spacing)\(.*\)})px/gm, '').replace(/((theme\.spacing|spacing)\(.*\))\s*\+\s*'px'/gm, '$1').replace(/\${(theme.spacing|spacing)(\(.*\))\s*([+-])\s*([\d.]+)\s*}px/gm, // eslint-disable-next-line no-template-curly-in-string
14
+ .replace(/(?<={(theme\.spacing|spacing)\([^]*.*[^]*\)})px/gm, '').replace(/((theme\.spacing|spacing)\(.*\))\s*\+\s*'px'/gm, '$1').replace(/\${(theme.spacing|spacing)(\(.*\))\s*([+-])\s*([\d.]+)\s*}px/gm, // eslint-disable-next-line no-template-curly-in-string
15
15
  'calc(${$1$2} $3 $4px)').replace(/\${(theme.spacing|spacing)(\(.*\))\s*([*/])\s*([\d.]+)\s*}px/gm, // eslint-disable-next-line no-template-curly-in-string
16
16
  'calc(${$1$2} $3 $4)');
17
17
  }
@@ -4,4 +4,4 @@
4
4
  theme.spacing(gap) + 'px';
5
5
  spacing(gap) + 'px'`calc(100% - ${spacing(itemHorzPadding * 2)}px)``calc(100% - ${theme.spacing(itemHorzPadding * 2)}px)`;
6
6
 
7
- padding: `${theme.spacing(2) - 1}px 0``calc(100% - ${theme.spacing(itemHorzPadding) * 0.3}px)``${-theme.spacing(1)}px``-${theme.spacing(1)}px`;
7
+ padding: `${theme.spacing(2) - 1}px 0``calc(100% - ${theme.spacing(itemHorzPadding) * 0.3}px)``${-theme.spacing(1)}px``-${theme.spacing(1)}px``${theme.spacing(2)}px ${theme.spacing(1)}px ${theme.spacing(2)}px ${theme.spacing(2)}px`;
@@ -10,4 +10,4 @@ spacing(gap)`calc(100% - ${spacing(itemHorzPadding * 2)})``calc(100% - ${theme.s
10
10
  padding: `calc(${theme.spacing(2)} - 1px) 0``calc(100% - calc(${theme.spacing(itemHorzPadding)} * 0.3))`;
11
11
 
12
12
  theme.spacing(-1);
13
- theme.spacing(-1);
13
+ theme.spacing(-1)`${theme.spacing(2)} ${theme.spacing(1)} ${theme.spacing(2)} ${theme.spacing(2)}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/codemod",
3
- "version": "5.6.0",
3
+ "version": "5.7.0",
4
4
  "bin": "./codemod.js",
5
5
  "private": false,
6
6
  "author": "MUI Team",
@@ -35,10 +35,10 @@
35
35
  "@babel/traverse": "^7.17.3",
36
36
  "jscodeshift": "^0.13.1",
37
37
  "jscodeshift-add-imports": "^1.0.10",
38
- "yargs": "^17.4.0"
38
+ "yargs": "^17.4.1"
39
39
  },
40
40
  "devDependencies": {
41
- "@types/jscodeshift": "0.11.3"
41
+ "@types/jscodeshift": "0.11.5"
42
42
  },
43
43
  "sideEffects": false,
44
44
  "publishConfig": {