@mui/codemod 6.0.0-alpha.5 → 6.0.0-alpha.7

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 (38) hide show
  1. package/README.md +168 -0
  2. package/node/deprecations/all/deprecations-all.js +6 -0
  3. package/node/deprecations/all/postcss.config.js +4 -1
  4. package/node/deprecations/autocomplete-props/autocomplete-props.js +54 -0
  5. package/node/deprecations/autocomplete-props/index.js +13 -0
  6. package/node/deprecations/autocomplete-props/test-cases/actual.js +97 -0
  7. package/node/deprecations/autocomplete-props/test-cases/expected.js +101 -0
  8. package/node/deprecations/autocomplete-props/test-cases/theme.actual.js +65 -0
  9. package/node/deprecations/autocomplete-props/test-cases/theme.expected.js +68 -0
  10. package/node/deprecations/circular-progress-classes/circular-progress-classes.js +77 -0
  11. package/node/deprecations/circular-progress-classes/index.js +13 -0
  12. package/node/deprecations/circular-progress-classes/postcss-plugin.js +33 -0
  13. package/node/deprecations/circular-progress-classes/postcss.config.js +8 -0
  14. package/node/deprecations/circular-progress-classes/test-cases/actual.js +7 -0
  15. package/node/deprecations/circular-progress-classes/test-cases/expected.js +7 -0
  16. package/node/deprecations/divider-props/divider-props.js +36 -30
  17. package/node/deprecations/divider-props/test-cases/actual.js +3 -0
  18. package/node/deprecations/divider-props/test-cases/expected.js +3 -0
  19. package/node/deprecations/divider-props/test-cases/theme.actual.js +7 -0
  20. package/node/deprecations/divider-props/test-cases/theme.expected.js +7 -0
  21. package/node/deprecations/speed-dial-props/index.js +13 -0
  22. package/node/deprecations/speed-dial-props/speed-dial-props.js +31 -0
  23. package/node/deprecations/speed-dial-props/test-cases/actual.js +40 -0
  24. package/node/deprecations/speed-dial-props/test-cases/expected.js +54 -0
  25. package/node/deprecations/speed-dial-props/test-cases/theme.actual.js +33 -0
  26. package/node/deprecations/speed-dial-props/test-cases/theme.expected.js +40 -0
  27. package/node/util/getReturnExpression.js +20 -0
  28. package/node/util/migrateToVariants.js +472 -0
  29. package/node/v6.0.0/styled/styled-v6.js +2 -415
  30. package/node/v6.0.0/styled/test-cases/ConditionalStyled.actual.js +28 -1
  31. package/node/v6.0.0/styled/test-cases/ConditionalStyled.expected.js +38 -1
  32. package/node/v6.0.0/theme-v6/index.js +13 -0
  33. package/node/v6.0.0/theme-v6/test-cases/basicTheme.actual.js +530 -0
  34. package/node/v6.0.0/theme-v6/test-cases/basicTheme.expected.js +626 -0
  35. package/node/v6.0.0/theme-v6/test-cases/themeVariants.actual.js +63 -0
  36. package/node/v6.0.0/theme-v6/test-cases/themeVariants.expected.js +73 -0
  37. package/node/v6.0.0/theme-v6/theme-v6.js +87 -0
  38. package/package.json +5 -5
@@ -0,0 +1,530 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = getCheckoutTheme;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ function getCheckoutTheme(mode) {
11
+ return (0, _extends2.default)({}, getDesignTokens(mode), {
12
+ components: {
13
+ MuiAlert: {
14
+ styleOverrides: {
15
+ root: ({
16
+ theme
17
+ }) => (0, _extends2.default)({
18
+ borderRadius: 10,
19
+ backgroundColor: orange[100],
20
+ color: theme.palette.text.primary,
21
+ border: `1px solid ${alpha(orange[300], 0.5)}`,
22
+ '& .MuiAlert-icon': {
23
+ color: orange[500]
24
+ }
25
+ }, theme.palette.mode === 'dark' && {
26
+ backgroundColor: `${alpha(orange[900], 0.5)}`,
27
+ border: `1px solid ${alpha(orange[800], 0.5)}`
28
+ })
29
+ }
30
+ },
31
+ MuiButtonBase: {
32
+ defaultProps: {
33
+ disableTouchRipple: true,
34
+ disableRipple: true
35
+ },
36
+ styleOverrides: {
37
+ root: {
38
+ boxSizing: 'border-box',
39
+ transition: 'all 100ms ease',
40
+ '&:focus-visible': {
41
+ outline: `3px solid ${alpha(brand[400], 0.5)}`,
42
+ outlineOffset: '2px'
43
+ }
44
+ }
45
+ }
46
+ },
47
+ MuiButton: {
48
+ styleOverrides: {
49
+ root: ({
50
+ theme,
51
+ ownerState
52
+ }) => (0, _extends2.default)({
53
+ boxShadow: 'none',
54
+ borderRadius: theme.shape.borderRadius,
55
+ textTransform: 'none'
56
+ }, ownerState.size === 'small' && {
57
+ height: '2rem',
58
+ // 32px
59
+ padding: '0 0.5rem'
60
+ }, ownerState.size === 'medium' && {
61
+ height: '2.5rem' // 40px
62
+ }, ownerState.variant === 'contained' && ownerState.color === 'primary' && {
63
+ color: 'white',
64
+ backgroundColor: brand[300],
65
+ backgroundImage: `linear-gradient(to bottom, ${alpha(brand[400], 0.8)}, ${brand[500]})`,
66
+ boxShadow: `inset 0 2px 0 ${alpha(brand[200], 0.2)}, inset 0 -2px 0 ${alpha(brand[700], 0.4)}`,
67
+ border: `1px solid ${brand[500]}`,
68
+ '&:hover': {
69
+ backgroundColor: brand[700],
70
+ boxShadow: 'none'
71
+ },
72
+ '&:active': {
73
+ backgroundColor: brand[700],
74
+ boxShadow: `inset 0 2.5px 0 ${alpha(brand[700], 0.4)}`
75
+ }
76
+ }, ownerState.variant === 'outlined' && {
77
+ color: brand[700],
78
+ backgroundColor: alpha(brand[300], 0.1),
79
+ borderColor: alpha(brand[200], 0.8),
80
+ boxShadow: `inset 0 2px ${alpha(brand[50], 0.5)}, inset 0 -2px ${alpha(brand[200], 0.2)}`,
81
+ '&:hover': {
82
+ backgroundColor: alpha(brand[300], 0.2),
83
+ borderColor: alpha(brand[300], 0.5),
84
+ boxShadow: 'none'
85
+ },
86
+ '&:active': {
87
+ backgroundColor: alpha(brand[300], 0.3),
88
+ boxShadow: `inset 0 2.5px 0 ${alpha(brand[400], 0.2)}`,
89
+ backgroundImage: 'none'
90
+ }
91
+ }, ownerState.variant === 'outlined' && ownerState.color === 'secondary' && {
92
+ backgroundColor: alpha(gray[300], 0.1),
93
+ borderColor: alpha(gray[300], 0.5),
94
+ color: gray[700],
95
+ '&:hover': {
96
+ backgroundColor: alpha(gray[300], 0.3),
97
+ borderColor: alpha(gray[300], 0.5),
98
+ boxShadow: 'none'
99
+ },
100
+ '&:active': {
101
+ backgroundColor: alpha(gray[300], 0.4),
102
+ boxShadow: `inset 0 2.5px 0 ${alpha(gray[400], 0.2)}`,
103
+ backgroundImage: 'none'
104
+ }
105
+ }, ownerState.variant === 'text' && ownerState.color === 'primary' && {
106
+ color: brand[700],
107
+ '&:hover': {
108
+ backgroundColor: alpha(brand[300], 0.3)
109
+ }
110
+ }, ownerState.variant === 'text' && ownerState.color === 'info' && {
111
+ color: gray[700],
112
+ '&:hover': {
113
+ backgroundColor: alpha(gray[300], 0.3)
114
+ }
115
+ }, theme.palette.mode === 'dark' && (0, _extends2.default)({}, ownerState.variant === 'outlined' && {
116
+ color: brand[200],
117
+ backgroundColor: alpha(brand[600], 0.1),
118
+ borderColor: alpha(brand[600], 0.6),
119
+ boxShadow: `inset 0 2.5px ${alpha(brand[400], 0.1)}, inset 0 -2px ${alpha(gray[900], 0.5)}`,
120
+ '&:hover': {
121
+ backgroundColor: alpha(brand[700], 0.2),
122
+ borderColor: alpha(brand[700], 0.5),
123
+ boxShadow: 'none'
124
+ },
125
+ '&:active': {
126
+ backgroundColor: alpha(brand[800], 0.2),
127
+ boxShadow: `inset 0 2.5px 0 ${alpha(brand[900], 0.4)}`,
128
+ backgroundImage: 'none'
129
+ }
130
+ }, ownerState.variant === 'text' && ownerState.color === 'info' && {
131
+ color: gray[200],
132
+ '&:hover': {
133
+ backgroundColor: alpha(gray[700], 0.3)
134
+ }
135
+ }, ownerState.variant === 'outlined' && ownerState.color === 'secondary' && {
136
+ color: gray[300],
137
+ backgroundColor: alpha(gray[600], 0.1),
138
+ borderColor: alpha(gray[700], 0.5),
139
+ boxShadow: `inset 0 2.5px ${alpha(gray[600], 0.1)}, inset 0 -2px ${alpha(gray[900], 0.5)}`,
140
+ '&:hover': {
141
+ backgroundColor: alpha(gray[700], 0.2),
142
+ borderColor: alpha(gray[700], 0.5),
143
+ boxShadow: 'none'
144
+ },
145
+ '&:active': {
146
+ backgroundColor: alpha(gray[800], 0.2),
147
+ boxShadow: `inset 0 2.5px 0 ${alpha(gray[900], 0.4)}`,
148
+ backgroundImage: 'none'
149
+ }
150
+ }, ownerState.variant === 'text' && ownerState.color === 'primary' && {
151
+ color: brand[200],
152
+ '&:hover': {
153
+ backgroundColor: alpha(brand[700], 0.3)
154
+ }
155
+ }))
156
+ }
157
+ },
158
+ MuiCard: {
159
+ styleOverrides: {
160
+ root: ({
161
+ theme,
162
+ ownerState
163
+ }) => (0, _extends2.default)({
164
+ transition: 'all 100ms ease',
165
+ backgroundColor: gray[50],
166
+ borderRadius: theme.shape.borderRadius,
167
+ border: `1px solid ${alpha(gray[200], 0.5)}`,
168
+ boxShadow: 'none'
169
+ }, ownerState.variant === 'outlined' && {
170
+ border: `1px solid ${gray[200]}`,
171
+ boxShadow: 'none',
172
+ background: `linear-gradient(to bottom, hsl(0, 0%, 100%), ${gray[50]})`
173
+ }, theme.palette.mode === 'dark' && (0, _extends2.default)({
174
+ backgroundColor: alpha(gray[800], 0.6),
175
+ border: `1px solid ${alpha(gray[700], 0.3)}`
176
+ }, ownerState.variant === 'outlined' && {
177
+ border: `1px solid ${alpha(gray[700], 0.4)}`,
178
+ boxShadow: 'none',
179
+ background: `linear-gradient(to bottom, ${gray[900]}, ${alpha(gray[800], 0.5)})`
180
+ }))
181
+ }
182
+ },
183
+ MuiCheckbox: {
184
+ defaultProps: {
185
+ disableRipple: true,
186
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(CheckBoxOutlineBlankRoundedIcon, {
187
+ sx: {
188
+ color: 'hsla(210, 0%, 0%, 0.0)'
189
+ }
190
+ }),
191
+ checkedIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(CheckRoundedIcon, {
192
+ sx: {
193
+ height: 14,
194
+ width: 14
195
+ }
196
+ })
197
+ },
198
+ styleOverrides: {
199
+ root: ({
200
+ theme
201
+ }) => (0, _extends2.default)({
202
+ margin: 10,
203
+ height: 16,
204
+ width: 16,
205
+ borderRadius: 5,
206
+ border: '1px solid ',
207
+ borderColor: alpha(gray[300], 0.8),
208
+ boxShadow: '0 0 0 1.5px hsla(210, 0%, 0%, 0.04) inset',
209
+ transition: 'border-color 120ms ease-in',
210
+ backgroundColor: alpha(gray[100], 0.4),
211
+ '&:hover': {
212
+ borderColor: brand[300]
213
+ },
214
+ '&.Mui-focusVisible': {
215
+ outline: `3px solid ${alpha(brand[500], 0.5)}`,
216
+ outlineOffset: '2px',
217
+ borderColor: brand[400]
218
+ },
219
+ '&.Mui-checked': {
220
+ color: 'white',
221
+ backgroundColor: brand[500],
222
+ borderColor: brand[500],
223
+ boxShadow: `none`,
224
+ '&:hover': {
225
+ backgroundColor: brand[600]
226
+ }
227
+ }
228
+ }, theme.palette.mode === 'dark' && {
229
+ borderColor: alpha(gray[700], 0.5),
230
+ boxShadow: '0 0 0 1.5px hsl(210, 0%, 0%) inset',
231
+ backgroundColor: alpha(gray[900], 0.8),
232
+ '&:hover': {
233
+ borderColor: brand[300]
234
+ },
235
+ '&.Mui-focusVisible': {
236
+ borderColor: brand[400],
237
+ outline: `3px solid ${alpha(brand[500], 0.5)}`,
238
+ outlineOffset: '2px'
239
+ }
240
+ })
241
+ }
242
+ },
243
+ MuiDivider: {
244
+ styleOverrides: {
245
+ root: ({
246
+ theme
247
+ }) => (0, _extends2.default)({
248
+ borderColor: `${alpha(gray[200], 0.8)}`
249
+ }, theme.palette.mode === 'dark' && {
250
+ borderColor: `${alpha(gray[700], 0.4)}`
251
+ })
252
+ }
253
+ },
254
+ MuiFormLabel: {
255
+ styleOverrides: {
256
+ root: ({
257
+ theme
258
+ }) => ({
259
+ typography: theme.typography.caption,
260
+ marginBottom: 8
261
+ })
262
+ }
263
+ },
264
+ MuiIconButton: {
265
+ styleOverrides: {
266
+ root: ({
267
+ theme,
268
+ ownerState
269
+ }) => (0, _extends2.default)({}, ownerState.size === 'small' && {
270
+ height: '2rem',
271
+ width: '2rem'
272
+ }, ownerState.size === 'medium' && {
273
+ height: '2.5rem',
274
+ width: '2.5rem'
275
+ }, {
276
+ color: brand[500],
277
+ '&:hover': {
278
+ backgroundColor: alpha(brand[300], 0.3),
279
+ borderColor: brand[200]
280
+ }
281
+ }, theme.palette.mode === 'dark' && {
282
+ color: brand[200],
283
+ '&:hover': {
284
+ backgroundColor: alpha(brand[600], 0.3),
285
+ borderColor: brand[700]
286
+ }
287
+ })
288
+ }
289
+ },
290
+ MuiInputBase: {
291
+ styleOverrides: {
292
+ root: {
293
+ border: 'none'
294
+ }
295
+ }
296
+ },
297
+ MuiLink: {
298
+ defaultProps: {
299
+ underline: 'none'
300
+ },
301
+ styleOverrides: {
302
+ root: ({
303
+ theme
304
+ }) => (0, _extends2.default)({
305
+ color: brand[700],
306
+ fontWeight: 500,
307
+ position: 'relative',
308
+ textDecoration: 'none',
309
+ '&::before': {
310
+ content: '""',
311
+ position: 'absolute',
312
+ width: 0,
313
+ height: '1px',
314
+ bottom: 0,
315
+ left: 0,
316
+ backgroundColor: brand[200],
317
+ opacity: 0.7,
318
+ transition: 'width 0.3s ease, opacity 0.3s ease'
319
+ },
320
+ '&:hover::before': {
321
+ width: '100%',
322
+ opacity: 1
323
+ },
324
+ '&:focus-visible': {
325
+ outline: `3px solid ${alpha(brand[500], 0.5)}`,
326
+ outlineOffset: '4px',
327
+ borderRadius: '2px'
328
+ }
329
+ }, theme.palette.mode === 'dark' && {
330
+ color: brand[200]
331
+ })
332
+ }
333
+ },
334
+ MuiOutlinedInput: {
335
+ styleOverrides: {
336
+ notchedOutline: {
337
+ border: 'none'
338
+ },
339
+ input: {
340
+ paddingLeft: 10
341
+ },
342
+ root: ({
343
+ theme,
344
+ ownerState
345
+ }) => (0, _extends2.default)({
346
+ 'input:-webkit-autofill': {
347
+ WebkitBoxShadow: `0 0 0 1000px ${brand[100]} inset, 0 0 0 1px ${brand[200]}`,
348
+ maxHeight: '4px',
349
+ borderRadius: '8px'
350
+ },
351
+ '& .MuiInputBase-input': {
352
+ fontSize: '1rem',
353
+ '&::placeholder': {
354
+ opacity: 0.7,
355
+ color: gray[500]
356
+ }
357
+ },
358
+ boxSizing: 'border-box',
359
+ flexGrow: 1,
360
+ height: '40px',
361
+ borderRadius: theme.shape.borderRadius,
362
+ border: '1px solid',
363
+ borderColor: alpha(gray[300], 0.8),
364
+ boxShadow: '0 0 0 1.5px hsla(210, 0%, 0%, 0.02) inset',
365
+ transition: 'border-color 120ms ease-in',
366
+ backgroundColor: alpha(gray[100], 0.4),
367
+ '&:hover': {
368
+ borderColor: brand[300]
369
+ },
370
+ '&.Mui-focused': {
371
+ outline: `3px solid ${alpha(brand[500], 0.5)}`,
372
+ outlineOffset: '2px',
373
+ borderColor: brand[400]
374
+ }
375
+ }, ownerState.color === 'error' && {
376
+ borderColor: red[200],
377
+ color: red[500],
378
+ '& + .MuiFormHelperText-root': {
379
+ color: red[500]
380
+ }
381
+ }, theme.palette.mode === 'dark' && (0, _extends2.default)({
382
+ 'input:-webkit-autofill': {
383
+ WebkitBoxShadow: `0 0 0 1000px ${brand[900]} inset, 0 0 0 1px ${brand[600]}`,
384
+ maxHeight: '6px',
385
+ borderRadius: '8px'
386
+ },
387
+ '& .MuiInputBase-input': {
388
+ fontSize: '1rem',
389
+ '&::placeholder': {
390
+ opacity: 1,
391
+ color: gray[500]
392
+ }
393
+ },
394
+ borderColor: alpha(gray[700], 0.5),
395
+ boxShadow: '0 0 0 1.5px hsl(210, 0%, 0%) inset',
396
+ backgroundColor: alpha(gray[900], 0.8),
397
+ transition: 'border-color 120ms ease-in',
398
+ '&:hover': {
399
+ borderColor: brand[300]
400
+ },
401
+ '&.Mui-focused': {
402
+ borderColor: brand[400],
403
+ outline: `3px solid ${alpha(brand[500], 0.5)}`,
404
+ outlineOffset: '2px'
405
+ }
406
+ }, ownerState.color === 'error' && {
407
+ borderColor: red[700],
408
+ color: red[300],
409
+ '& + .MuiFormHelperText-root': {
410
+ color: red[300]
411
+ }
412
+ }))
413
+ }
414
+ },
415
+ MuiPaper: {
416
+ defaultProps: {
417
+ elevation: 0
418
+ }
419
+ },
420
+ MuiStack: {
421
+ defaultProps: {
422
+ useFlexGap: true
423
+ }
424
+ },
425
+ MuiStepConnector: {
426
+ styleOverrides: {
427
+ line: ({
428
+ theme
429
+ }) => ({
430
+ borderTop: '1px solid',
431
+ borderColor: theme.palette.divider,
432
+ flex: 1,
433
+ borderRadius: '99px'
434
+ })
435
+ }
436
+ },
437
+ MuiStepIcon: {
438
+ variants: [{
439
+ props: {
440
+ completed: true
441
+ },
442
+ style: () => ({
443
+ width: 12,
444
+ height: 12
445
+ })
446
+ }],
447
+ styleOverrides: {
448
+ root: ({
449
+ theme
450
+ }) => (0, _extends2.default)({
451
+ color: 'transparent',
452
+ border: `1px solid ${gray[400]}`,
453
+ width: 12,
454
+ height: 12,
455
+ borderRadius: '50%',
456
+ '& text': {
457
+ display: 'none'
458
+ },
459
+ '&.Mui-active': {
460
+ border: 'none',
461
+ color: theme.palette.primary.main
462
+ },
463
+ '&.Mui-completed': {
464
+ border: 'none',
465
+ color: theme.palette.success.main
466
+ }
467
+ }, theme.palette.mode === 'dark' && {
468
+ border: `1px solid ${gray[700]}`,
469
+ '&.Mui-active': {
470
+ border: 'none',
471
+ color: theme.palette.primary.light
472
+ },
473
+ '&.Mui-completed': {
474
+ border: 'none',
475
+ color: theme.palette.success.light
476
+ }
477
+ })
478
+ }
479
+ },
480
+ MuiStepLabel: {
481
+ styleOverrides: {
482
+ label: ({
483
+ theme
484
+ }) => ({
485
+ '&.Mui-completed': (0, _extends2.default)({
486
+ opacity: 0.6
487
+ }, theme.palette.mode === 'dark' && {
488
+ opacity: 0.5
489
+ })
490
+ })
491
+ }
492
+ },
493
+ MuiToggleButtonGroup: {
494
+ styleOverrides: {
495
+ root: ({
496
+ theme
497
+ }) => (0, _extends2.default)({
498
+ borderRadius: theme.shape.borderRadius,
499
+ boxShadow: `0 1px 2px hsla(210, 0%, 0%, 0.05), 0 2px 12px ${alpha(brand[200], 0.5)}`,
500
+ '& .Mui-selected': {
501
+ color: brand[500]
502
+ }
503
+ }, theme.palette.mode === 'dark' && {
504
+ '& .Mui-selected': {
505
+ color: 'hsl(0, 0%, 100%)'
506
+ },
507
+ boxShadow: `0 0 0 1px hsla(210, 0%, 0%, 0.5), 0 2px 12px ${alpha(brand[700], 0.5)}`
508
+ })
509
+ }
510
+ },
511
+ MuiToggleButton: {
512
+ styleOverrides: {
513
+ root: ({
514
+ theme
515
+ }) => (0, _extends2.default)({
516
+ padding: '12px 16px',
517
+ textTransform: 'none',
518
+ borderRadius: theme.shape.borderRadius,
519
+ fontWeight: 500
520
+ }, theme.palette.mode === 'dark' && {
521
+ color: gray[400],
522
+ '&.Mui-selected': {
523
+ color: brand[300]
524
+ }
525
+ })
526
+ }
527
+ }
528
+ }
529
+ });
530
+ }