@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.
Files changed (225) hide show
  1. package/README.md +713 -2
  2. package/codemod.js +0 -2
  3. package/node/deprecations/accordion-props/accordion-props.js +11 -71
  4. package/node/deprecations/accordion-props/test-cases/actual.js +22 -3
  5. package/node/deprecations/accordion-props/test-cases/expected.js +23 -5
  6. package/node/deprecations/accordion-props/test-cases/theme.actual.js +24 -0
  7. package/node/deprecations/accordion-props/test-cases/theme.expected.js +25 -0
  8. package/node/deprecations/alert-props/test-cases/expected.js +12 -4
  9. package/node/deprecations/alert-props/test-cases/theme.expected.js +12 -5
  10. package/node/deprecations/all/deprecations-all.js +36 -8
  11. package/node/deprecations/all/postcss.config.js +10 -1
  12. package/node/deprecations/autocomplete-props/autocomplete-props.js +54 -0
  13. package/node/deprecations/autocomplete-props/index.js +13 -0
  14. package/node/deprecations/autocomplete-props/test-cases/actual.js +97 -0
  15. package/node/deprecations/autocomplete-props/test-cases/expected.js +103 -0
  16. package/node/deprecations/autocomplete-props/test-cases/theme.actual.js +65 -0
  17. package/node/deprecations/autocomplete-props/test-cases/theme.expected.js +69 -0
  18. package/node/deprecations/avatar-group-props/avatar-group-props.js +87 -0
  19. package/node/deprecations/avatar-group-props/index.js +13 -0
  20. package/node/deprecations/avatar-group-props/test-cases/actual.js +56 -0
  21. package/node/deprecations/avatar-group-props/test-cases/expected.js +58 -0
  22. package/node/deprecations/avatar-group-props/test-cases/theme.actual.js +48 -0
  23. package/node/deprecations/avatar-group-props/test-cases/theme.expected.js +50 -0
  24. package/node/deprecations/avatar-props/avatar-props.js +5 -39
  25. package/node/deprecations/avatar-props/test-cases/actual.js +10 -0
  26. package/node/deprecations/avatar-props/test-cases/expected.js +12 -0
  27. package/node/deprecations/avatar-props/test-cases/theme.actual.js +14 -0
  28. package/node/deprecations/avatar-props/test-cases/theme.expected.js +16 -0
  29. package/node/deprecations/backdrop-props/backdrop-props.js +8 -59
  30. package/node/deprecations/backdrop-props/test-cases/actual.js +56 -8
  31. package/node/deprecations/backdrop-props/test-cases/expected.js +52 -9
  32. package/node/deprecations/backdrop-props/test-cases/theme.actual.js +65 -0
  33. package/node/deprecations/backdrop-props/test-cases/theme.expected.js +63 -2
  34. package/node/deprecations/badge-props/test-cases/expected.js +12 -5
  35. package/node/deprecations/badge-props/test-cases/theme.expected.js +12 -5
  36. package/node/deprecations/circular-progress-classes/circular-progress-classes.js +77 -0
  37. package/node/deprecations/circular-progress-classes/index.js +13 -0
  38. package/node/deprecations/circular-progress-classes/postcss-plugin.js +33 -0
  39. package/node/deprecations/circular-progress-classes/postcss.config.js +8 -0
  40. package/node/deprecations/circular-progress-classes/test-cases/actual.js +7 -0
  41. package/node/deprecations/circular-progress-classes/test-cases/expected.js +7 -0
  42. package/node/deprecations/divider-props/divider-props.js +36 -30
  43. package/node/deprecations/divider-props/test-cases/actual.js +3 -0
  44. package/node/deprecations/divider-props/test-cases/expected.js +3 -0
  45. package/node/deprecations/divider-props/test-cases/theme.actual.js +7 -0
  46. package/node/deprecations/divider-props/test-cases/theme.expected.js +7 -0
  47. package/node/deprecations/filled-input-props/filled-input-props.js +22 -0
  48. package/node/deprecations/filled-input-props/index.js +13 -0
  49. package/node/deprecations/filled-input-props/test-cases/actual.js +60 -0
  50. package/node/deprecations/filled-input-props/test-cases/expected.js +52 -0
  51. package/node/deprecations/filled-input-props/test-cases/theme.actual.js +73 -0
  52. package/node/deprecations/filled-input-props/test-cases/theme.expected.js +65 -0
  53. package/node/deprecations/form-control-label-props/form-control-label-props.js +22 -0
  54. package/node/deprecations/form-control-label-props/index.js +13 -0
  55. package/node/deprecations/form-control-label-props/test-cases/actual.js +21 -0
  56. package/node/deprecations/form-control-label-props/test-cases/expected.js +21 -0
  57. package/node/deprecations/form-control-label-props/test-cases/theme.actual.js +23 -0
  58. package/node/deprecations/form-control-label-props/test-cases/theme.expected.js +23 -0
  59. package/node/deprecations/grid-props/grid-props.js +51 -0
  60. package/node/deprecations/grid-props/index.js +13 -0
  61. package/node/deprecations/grid-props/test-cases/actual.js +25 -0
  62. package/node/deprecations/grid-props/test-cases/expected.js +23 -0
  63. package/node/deprecations/grid-props/test-cases/theme.actual.js +24 -0
  64. package/node/deprecations/grid-props/test-cases/theme.expected.js +23 -0
  65. package/node/deprecations/input-base-props/index.js +13 -0
  66. package/node/deprecations/input-base-props/input-base-props.js +22 -0
  67. package/node/deprecations/input-base-props/test-cases/actual.js +60 -0
  68. package/node/deprecations/input-base-props/test-cases/expected.js +52 -0
  69. package/node/deprecations/input-base-props/test-cases/theme.actual.js +73 -0
  70. package/node/deprecations/input-base-props/test-cases/theme.expected.js +65 -0
  71. package/node/deprecations/input-props/index.js +13 -0
  72. package/node/deprecations/input-props/input-props.js +22 -0
  73. package/node/deprecations/input-props/test-cases/actual.js +60 -0
  74. package/node/deprecations/input-props/test-cases/expected.js +52 -0
  75. package/node/deprecations/input-props/test-cases/theme.actual.js +73 -0
  76. package/node/deprecations/input-props/test-cases/theme.expected.js +65 -0
  77. package/node/deprecations/list-item-props/index.js +13 -0
  78. package/node/deprecations/list-item-props/list-item-props.js +22 -0
  79. package/node/deprecations/list-item-props/test-cases/actual.js +43 -0
  80. package/node/deprecations/list-item-props/test-cases/expected.js +40 -0
  81. package/node/deprecations/list-item-props/test-cases/theme.actual.js +56 -0
  82. package/node/deprecations/list-item-props/test-cases/theme.expected.js +53 -0
  83. package/node/deprecations/modal-props/index.js +13 -0
  84. package/node/deprecations/modal-props/modal-props.js +22 -0
  85. package/node/deprecations/modal-props/test-cases/actual.js +43 -0
  86. package/node/deprecations/modal-props/test-cases/expected.js +40 -0
  87. package/node/deprecations/modal-props/test-cases/theme.actual.js +56 -0
  88. package/node/deprecations/modal-props/test-cases/theme.expected.js +53 -0
  89. package/node/deprecations/outlined-input-props/index.js +13 -0
  90. package/node/deprecations/outlined-input-props/outlined-input-props.js +22 -0
  91. package/node/deprecations/outlined-input-props/test-cases/actual.js +60 -0
  92. package/node/deprecations/outlined-input-props/test-cases/expected.js +52 -0
  93. package/node/deprecations/outlined-input-props/test-cases/theme.actual.js +73 -0
  94. package/node/deprecations/outlined-input-props/test-cases/theme.expected.js +65 -0
  95. package/node/deprecations/pagination-item-props/index.js +13 -0
  96. package/node/deprecations/pagination-item-props/pagination-item-props.js +22 -0
  97. package/node/deprecations/pagination-item-props/test-cases/actual.js +27 -0
  98. package/node/deprecations/pagination-item-props/test-cases/expected.js +21 -0
  99. package/node/deprecations/pagination-item-props/test-cases/theme.actual.js +28 -0
  100. package/node/deprecations/pagination-item-props/test-cases/theme.expected.js +26 -0
  101. package/node/deprecations/popper-props/index.js +13 -0
  102. package/node/deprecations/popper-props/popper-props.js +22 -0
  103. package/node/deprecations/popper-props/test-cases/actual.js +27 -0
  104. package/node/deprecations/popper-props/test-cases/expected.js +24 -0
  105. package/node/deprecations/popper-props/test-cases/theme.actual.js +32 -0
  106. package/node/deprecations/popper-props/test-cases/theme.expected.js +29 -0
  107. package/node/deprecations/slider-props/test-cases/expected.js +12 -4
  108. package/node/deprecations/slider-props/test-cases/theme.expected.js +12 -5
  109. package/node/deprecations/speed-dial-props/index.js +13 -0
  110. package/node/deprecations/speed-dial-props/speed-dial-props.js +31 -0
  111. package/node/deprecations/speed-dial-props/test-cases/actual.js +41 -0
  112. package/node/deprecations/speed-dial-props/test-cases/expected.js +54 -0
  113. package/node/deprecations/speed-dial-props/test-cases/theme.actual.js +33 -0
  114. package/node/deprecations/speed-dial-props/test-cases/theme.expected.js +40 -0
  115. package/node/deprecations/step-connector-classes/index.js +13 -0
  116. package/node/deprecations/step-connector-classes/postcss-plugin.js +33 -0
  117. package/node/deprecations/step-connector-classes/postcss.config.js +8 -0
  118. package/node/deprecations/step-connector-classes/step-connector-classes.js +77 -0
  119. package/node/deprecations/step-connector-classes/test-cases/actual.js +7 -0
  120. package/node/deprecations/step-connector-classes/test-cases/expected.js +7 -0
  121. package/node/deprecations/step-label-props/step-label-props.js +14 -0
  122. package/node/deprecations/step-label-props/test-cases/actual.js +23 -0
  123. package/node/deprecations/step-label-props/test-cases/expected.js +31 -2
  124. package/node/deprecations/step-label-props/test-cases/theme.actual.js +22 -0
  125. package/node/deprecations/step-label-props/test-cases/theme.expected.js +32 -3
  126. package/node/deprecations/text-field-props/index.js +13 -0
  127. package/node/deprecations/text-field-props/test-cases/actual.js +27 -0
  128. package/node/deprecations/text-field-props/test-cases/expected.js +31 -0
  129. package/node/deprecations/text-field-props/test-cases/theme.actual.js +13 -0
  130. package/node/deprecations/text-field-props/test-cases/theme.expected.js +15 -0
  131. package/node/deprecations/text-field-props/text-field-props.js +48 -0
  132. package/node/deprecations/toggle-button-group-classes/index.js +13 -0
  133. package/node/deprecations/toggle-button-group-classes/postcss-plugin.js +33 -0
  134. package/node/deprecations/toggle-button-group-classes/postcss.config.js +8 -0
  135. package/node/deprecations/toggle-button-group-classes/test-cases/actual.js +7 -0
  136. package/node/deprecations/toggle-button-group-classes/test-cases/expected.js +7 -0
  137. package/node/deprecations/toggle-button-group-classes/toggle-button-group-classes.js +77 -0
  138. package/node/deprecations/tooltip-props/index.js +13 -0
  139. package/node/deprecations/tooltip-props/test-cases/actual.js +92 -0
  140. package/node/deprecations/tooltip-props/test-cases/expected.js +84 -0
  141. package/node/deprecations/tooltip-props/test-cases/theme.actual.js +73 -0
  142. package/node/deprecations/tooltip-props/test-cases/theme.expected.js +65 -0
  143. package/node/deprecations/tooltip-props/tooltip-props.js +22 -0
  144. package/node/deprecations/utils/movePropIntoSlotProps.js +111 -0
  145. package/node/deprecations/utils/movePropIntoSlots.js +101 -0
  146. package/node/deprecations/utils/replaceComponentsWithSlots.js +29 -17
  147. package/node/util/getReturnExpression.js +20 -0
  148. package/node/util/migrateToVariants.js +586 -0
  149. package/node/v5.0.0/badge-overlap-value.test/actual.js +3 -4
  150. package/node/v5.0.0/badge-overlap-value.test/expected.js +3 -4
  151. package/node/v5.0.0/base-remove-component-prop.test/actual.js +4 -4
  152. package/node/v5.0.0/base-remove-component-prop.test/expected.js +4 -4
  153. package/node/v5.0.0/base-remove-unstyled-suffix.js +4 -4
  154. package/node/v5.0.0/box-sx-prop.test/actual.js +4 -4
  155. package/node/v5.0.0/box-sx-prop.test/expected.js +3 -3
  156. package/node/v5.0.0/create-theme.test/custom-fn.actual.js +3 -4
  157. package/node/v5.0.0/create-theme.test/custom-fn.expected.js +3 -4
  158. package/node/v5.0.0/jss-to-styled.test/first.actual.js +11 -14
  159. package/node/v5.0.0/jss-to-styled.test/first.expected.js +11 -14
  160. package/node/v5.0.0/jss-to-styled.test/seventh.actual.js +4 -4
  161. package/node/v5.0.0/jss-to-styled.test/seventh.expected.js +4 -4
  162. package/node/v5.0.0/jss-to-styled.test/sixth.actual.js +3 -3
  163. package/node/v5.0.0/jss-to-styled.test/sixth.expected.js +3 -3
  164. package/node/v5.0.0/jss-to-styled.test/withCreateStyles.actual.js +3 -3
  165. package/node/v5.0.0/jss-to-styled.test/withCreateStyles.expected.js +3 -4
  166. package/node/v5.0.0/jss-to-styled.test/withCreateStyles1.actual.js +3 -3
  167. package/node/v5.0.0/jss-to-styled.test/withCreateStyles1.expected.js +3 -4
  168. package/node/v5.0.0/jss-to-styled.test/withCreateStyles2.actual.js +3 -3
  169. package/node/v5.0.0/jss-to-styled.test/withCreateStyles2.expected.js +3 -4
  170. package/node/v5.0.0/jss-to-styled.test/withCreateStyles3.actual.js +3 -3
  171. package/node/v5.0.0/jss-to-styled.test/withCreateStyles3.expected.js +3 -4
  172. package/node/v5.0.0/jss-to-tss-react.test/actual-mixins-pattern.js +6 -5
  173. package/node/v5.0.0/jss-to-tss-react.test/expected-mixins-pattern.js +6 -5
  174. package/node/v5.0.0/preset-safe.test/actual.js +6 -4
  175. package/node/v5.0.0/preset-safe.test/expected.js +9 -6
  176. package/node/v5.0.0/styled-engine-provider.test/theme-provider.expected.js +3 -3
  177. package/node/v5.0.0/table-props.test/actual.js +4 -5
  178. package/node/v5.0.0/table-props.test/expected.js +4 -5
  179. package/node/v5.0.0/theme-spacing.test/large-actual.js +10 -10
  180. package/node/v5.0.0/theme-spacing.test/large-expected.js +10 -10
  181. package/node/v5.0.0/variant-prop.test/actual.js +12 -6
  182. package/node/v5.0.0/variant-prop.test/expected.js +15 -12
  183. package/node/v5.0.0/with-mobile-dialog.test/expected.js +6 -5
  184. package/node/v5.0.0/with-width.test/expected.js +6 -5
  185. package/node/v6.0.0/styled/index.js +13 -0
  186. package/node/v6.0.0/styled/styled-v6.js +80 -0
  187. package/node/v6.0.0/styled/test-cases/BasicStyled.actual.js +89 -0
  188. package/node/v6.0.0/styled/test-cases/BasicStyled.expected.js +143 -0
  189. package/node/v6.0.0/styled/test-cases/ConditionalStyled.actual.js +152 -0
  190. package/node/v6.0.0/styled/test-cases/ConditionalStyled.expected.js +244 -0
  191. package/node/v6.0.0/styled/test-cases/LogicalStyled.actual.js +58 -0
  192. package/node/v6.0.0/styled/test-cases/LogicalStyled.expected.js +90 -0
  193. package/node/v6.0.0/styled/test-cases/NestedSpread.actual.js +48 -0
  194. package/node/v6.0.0/styled/test-cases/NestedSpread.expected.js +86 -0
  195. package/node/v6.0.0/styled/test-cases/ObjectMap.actual.js +36 -0
  196. package/node/v6.0.0/styled/test-cases/ObjectMap.expected.js +109 -0
  197. package/node/v6.0.0/styled/test-cases/ThemePaletteMode.actual.js +62 -0
  198. package/node/v6.0.0/styled/test-cases/ThemePaletteMode.expected.js +78 -0
  199. package/node/v6.0.0/styled/test-cases/VariantAndModeStyled.actual.js +12 -0
  200. package/node/v6.0.0/styled/test-cases/VariantAndModeStyled.expected.js +19 -0
  201. package/node/v6.0.0/sx-prop/index.js +13 -0
  202. package/node/v6.0.0/sx-prop/sx-v6.js +405 -0
  203. package/node/v6.0.0/sx-prop/test-cases/basic-sx.actual.js +36 -0
  204. package/node/v6.0.0/sx-prop/test-cases/basic-sx.expected.js +46 -0
  205. package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.actual.js +55 -0
  206. package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.expected.js +88 -0
  207. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.actual.js +107 -0
  208. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.expected.js +120 -0
  209. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic2.actual.js +49 -0
  210. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic2.expected.js +64 -0
  211. package/node/v6.0.0/sx-prop/test-cases/sx-line-break.actual.js +69 -0
  212. package/node/v6.0.0/sx-prop/test-cases/sx-line-break.expected.js +69 -0
  213. package/node/v6.0.0/sx-prop/test-cases/sx-value-callback.actual.js +102 -0
  214. package/node/v6.0.0/sx-prop/test-cases/sx-value-callback.expected.js +111 -0
  215. package/node/v6.0.0/system-props/index.js +13 -0
  216. package/node/v6.0.0/system-props/removeSystemProps.js +242 -0
  217. package/node/v6.0.0/system-props/test-cases/system-props.actual.js +79 -0
  218. package/node/v6.0.0/system-props/test-cases/system-props.expected.js +92 -0
  219. package/node/v6.0.0/theme-v6/index.js +13 -0
  220. package/node/v6.0.0/theme-v6/test-cases/basicTheme.actual.js +559 -0
  221. package/node/v6.0.0/theme-v6/test-cases/basicTheme.expected.js +644 -0
  222. package/node/v6.0.0/theme-v6/test-cases/themeVariants.actual.js +65 -0
  223. package/node/v6.0.0/theme-v6/test-cases/themeVariants.expected.js +74 -0
  224. package/node/v6.0.0/theme-v6/theme-v6.js +87 -0
  225. package/package.json +8 -8
@@ -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
+ });
@@ -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 _themeV.default;
11
+ }
12
+ });
13
+ var _themeV = _interopRequireDefault(require("./theme-v6"));