@mui/codemod 6.0.0-alpha.6 → 6.0.0-alpha.8

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 (95) hide show
  1. package/README.md +125 -0
  2. package/node/deprecations/accordion-props/test-cases/actual.js +6 -3
  3. package/node/deprecations/accordion-props/test-cases/expected.js +14 -10
  4. package/node/deprecations/accordion-props/test-cases/theme.expected.js +8 -7
  5. package/node/deprecations/alert-props/test-cases/expected.js +12 -4
  6. package/node/deprecations/alert-props/test-cases/theme.expected.js +12 -5
  7. package/node/deprecations/all/deprecations-all.js +6 -0
  8. package/node/deprecations/all/postcss.config.js +4 -1
  9. package/node/deprecations/autocomplete-props/autocomplete-props.js +54 -0
  10. package/node/deprecations/autocomplete-props/index.js +13 -0
  11. package/node/deprecations/autocomplete-props/test-cases/actual.js +97 -0
  12. package/node/deprecations/autocomplete-props/test-cases/expected.js +103 -0
  13. package/node/deprecations/autocomplete-props/test-cases/theme.actual.js +65 -0
  14. package/node/deprecations/autocomplete-props/test-cases/theme.expected.js +69 -0
  15. package/node/deprecations/avatar-props/test-cases/expected.js +8 -6
  16. package/node/deprecations/avatar-props/test-cases/theme.expected.js +8 -7
  17. package/node/deprecations/backdrop-props/test-cases/actual.js +3 -2
  18. package/node/deprecations/backdrop-props/test-cases/expected.js +3 -3
  19. package/node/deprecations/badge-props/test-cases/expected.js +12 -5
  20. package/node/deprecations/badge-props/test-cases/theme.expected.js +12 -5
  21. package/node/deprecations/circular-progress-classes/circular-progress-classes.js +77 -0
  22. package/node/deprecations/circular-progress-classes/index.js +13 -0
  23. package/node/deprecations/circular-progress-classes/postcss-plugin.js +33 -0
  24. package/node/deprecations/circular-progress-classes/postcss.config.js +8 -0
  25. package/node/deprecations/circular-progress-classes/test-cases/actual.js +7 -0
  26. package/node/deprecations/circular-progress-classes/test-cases/expected.js +7 -0
  27. package/node/deprecations/divider-props/divider-props.js +36 -30
  28. package/node/deprecations/divider-props/test-cases/actual.js +3 -0
  29. package/node/deprecations/divider-props/test-cases/expected.js +3 -0
  30. package/node/deprecations/divider-props/test-cases/theme.actual.js +7 -0
  31. package/node/deprecations/divider-props/test-cases/theme.expected.js +7 -0
  32. package/node/deprecations/form-control-label-props/test-cases/expected.js +4 -2
  33. package/node/deprecations/form-control-label-props/test-cases/theme.expected.js +4 -3
  34. package/node/deprecations/slider-props/test-cases/expected.js +12 -4
  35. package/node/deprecations/slider-props/test-cases/theme.expected.js +12 -5
  36. package/node/deprecations/speed-dial-props/test-cases/actual.js +3 -2
  37. package/node/deprecations/speed-dial-props/test-cases/expected.js +3 -3
  38. package/node/deprecations/step-label-props/test-cases/expected.js +8 -3
  39. package/node/deprecations/step-label-props/test-cases/theme.expected.js +8 -4
  40. package/node/deprecations/text-field-props/index.js +13 -0
  41. package/node/deprecations/text-field-props/test-cases/actual.js +27 -0
  42. package/node/deprecations/text-field-props/test-cases/expected.js +31 -0
  43. package/node/deprecations/text-field-props/test-cases/theme.actual.js +13 -0
  44. package/node/deprecations/text-field-props/test-cases/theme.expected.js +15 -0
  45. package/node/deprecations/text-field-props/text-field-props.js +48 -0
  46. package/node/deprecations/utils/replaceComponentsWithSlots.js +29 -17
  47. package/node/util/migrateToVariants.js +50 -31
  48. package/node/v5.0.0/badge-overlap-value.test/actual.js +3 -4
  49. package/node/v5.0.0/badge-overlap-value.test/expected.js +3 -4
  50. package/node/v5.0.0/base-remove-component-prop.test/actual.js +4 -4
  51. package/node/v5.0.0/base-remove-component-prop.test/expected.js +4 -4
  52. package/node/v5.0.0/box-sx-prop.test/actual.js +4 -4
  53. package/node/v5.0.0/box-sx-prop.test/expected.js +3 -3
  54. package/node/v5.0.0/create-theme.test/custom-fn.actual.js +3 -4
  55. package/node/v5.0.0/create-theme.test/custom-fn.expected.js +3 -4
  56. package/node/v5.0.0/jss-to-styled.test/first.actual.js +11 -14
  57. package/node/v5.0.0/jss-to-styled.test/first.expected.js +11 -14
  58. package/node/v5.0.0/jss-to-styled.test/seventh.actual.js +4 -4
  59. package/node/v5.0.0/jss-to-styled.test/seventh.expected.js +4 -4
  60. package/node/v5.0.0/jss-to-styled.test/sixth.actual.js +3 -3
  61. package/node/v5.0.0/jss-to-styled.test/sixth.expected.js +3 -3
  62. package/node/v5.0.0/jss-to-styled.test/withCreateStyles.actual.js +3 -3
  63. package/node/v5.0.0/jss-to-styled.test/withCreateStyles.expected.js +3 -4
  64. package/node/v5.0.0/jss-to-styled.test/withCreateStyles1.actual.js +3 -3
  65. package/node/v5.0.0/jss-to-styled.test/withCreateStyles1.expected.js +3 -4
  66. package/node/v5.0.0/jss-to-styled.test/withCreateStyles2.actual.js +3 -3
  67. package/node/v5.0.0/jss-to-styled.test/withCreateStyles2.expected.js +3 -4
  68. package/node/v5.0.0/jss-to-styled.test/withCreateStyles3.actual.js +3 -3
  69. package/node/v5.0.0/jss-to-styled.test/withCreateStyles3.expected.js +3 -4
  70. package/node/v5.0.0/jss-to-tss-react.test/actual-mixins-pattern.js +6 -5
  71. package/node/v5.0.0/jss-to-tss-react.test/expected-mixins-pattern.js +6 -5
  72. package/node/v5.0.0/preset-safe.test/actual.js +6 -4
  73. package/node/v5.0.0/preset-safe.test/expected.js +9 -6
  74. package/node/v5.0.0/table-props.test/actual.js +4 -5
  75. package/node/v5.0.0/table-props.test/expected.js +4 -5
  76. package/node/v5.0.0/theme-spacing.test/large-actual.js +10 -10
  77. package/node/v5.0.0/theme-spacing.test/large-expected.js +10 -10
  78. package/node/v5.0.0/variant-prop.test/actual.js +12 -6
  79. package/node/v5.0.0/variant-prop.test/expected.js +15 -12
  80. package/node/v5.0.0/with-mobile-dialog.test/expected.js +6 -5
  81. package/node/v5.0.0/with-width.test/expected.js +6 -5
  82. package/node/v6.0.0/styled/test-cases/BasicStyled.actual.js +55 -44
  83. package/node/v6.0.0/styled/test-cases/BasicStyled.expected.js +5 -6
  84. package/node/v6.0.0/styled/test-cases/ConditionalStyled.actual.js +80 -70
  85. package/node/v6.0.0/styled/test-cases/ConditionalStyled.expected.js +7 -6
  86. package/node/v6.0.0/styled/test-cases/NestedSpread.actual.js +32 -26
  87. package/node/v6.0.0/styled/test-cases/NestedSpread.expected.js +7 -6
  88. package/node/v6.0.0/styled/test-cases/ThemePaletteMode.expected.js +28 -26
  89. package/node/v6.0.0/styled/test-cases/VariantAndModeStyled.actual.js +6 -5
  90. package/node/v6.0.0/styled/test-cases/VariantAndModeStyled.expected.js +8 -8
  91. package/node/v6.0.0/theme-v6/test-cases/basicTheme.actual.js +254 -225
  92. package/node/v6.0.0/theme-v6/test-cases/basicTheme.expected.js +180 -162
  93. package/node/v6.0.0/theme-v6/test-cases/themeVariants.actual.js +23 -21
  94. package/node/v6.0.0/theme-v6/test-cases/themeVariants.expected.js +20 -19
  95. package/package.json +5 -5
@@ -1,30 +1,30 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = getCheckoutTheme;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
7
  var _jsxRuntime = require("react/jsx-runtime");
10
8
  function getCheckoutTheme(mode) {
11
- return (0, _extends2.default)({}, getDesignTokens(mode), {
9
+ return {
10
+ ...getDesignTokens(mode),
12
11
  components: {
13
12
  MuiAlert: {
14
13
  styleOverrides: {
15
14
  root: ({
16
15
  theme
17
- }) => (0, _extends2.default)({
16
+ }) => ({
18
17
  borderRadius: 10,
19
18
  backgroundColor: orange[100],
20
19
  color: theme.palette.text.primary,
21
20
  border: `1px solid ${alpha(orange[300], 0.5)}`,
22
21
  '& .MuiAlert-icon': {
23
22
  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)}`
23
+ },
24
+ ...(theme.palette.mode === 'dark' && {
25
+ backgroundColor: `${alpha(orange[900], 0.5)}`,
26
+ border: `1px solid ${alpha(orange[800], 0.5)}`
27
+ })
28
28
  })
29
29
  }
30
30
  },
@@ -49,110 +49,123 @@ function getCheckoutTheme(mode) {
49
49
  root: ({
50
50
  theme,
51
51
  ownerState
52
- }) => (0, _extends2.default)({
52
+ }) => ({
53
53
  boxShadow: 'none',
54
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),
55
+ textTransform: 'none',
56
+ ...(ownerState.size === 'small' && {
57
+ height: '2rem',
58
+ // 32px
59
+ padding: '0 0.5rem'
60
+ }),
61
+ ...(ownerState.size === 'medium' && {
62
+ height: '2.5rem' // 40px
63
+ }),
64
+ ...(ownerState.variant === 'contained' && ownerState.color === 'primary' && {
65
+ color: 'white',
66
+ backgroundColor: brand[300],
67
+ backgroundImage: `linear-gradient(to bottom, ${alpha(brand[400], 0.8)}, ${brand[500]})`,
68
+ boxShadow: `inset 0 2px 0 ${alpha(brand[200], 0.2)}, inset 0 -2px 0 ${alpha(brand[700], 0.4)}`,
69
+ border: `1px solid ${brand[500]}`,
70
+ '&:hover': {
71
+ backgroundColor: brand[700],
72
+ boxShadow: 'none'
73
+ },
74
+ '&:active': {
75
+ backgroundColor: brand[700],
76
+ boxShadow: `inset 0 2.5px 0 ${alpha(brand[700], 0.4)}`
77
+ }
78
+ }),
79
+ ...(ownerState.variant === 'outlined' && {
80
+ color: brand[700],
81
+ backgroundColor: alpha(brand[300], 0.1),
82
+ borderColor: alpha(brand[200], 0.8),
83
+ boxShadow: `inset 0 2px ${alpha(brand[50], 0.5)}, inset 0 -2px ${alpha(brand[200], 0.2)}`,
84
+ '&:hover': {
85
+ backgroundColor: alpha(brand[300], 0.2),
86
+ borderColor: alpha(brand[300], 0.5),
87
+ boxShadow: 'none'
88
+ },
89
+ '&:active': {
90
+ backgroundColor: alpha(brand[300], 0.3),
91
+ boxShadow: `inset 0 2.5px 0 ${alpha(brand[400], 0.2)}`,
92
+ backgroundImage: 'none'
93
+ }
94
+ }),
95
+ ...(ownerState.variant === 'outlined' && ownerState.color === 'secondary' && {
96
+ backgroundColor: alpha(gray[300], 0.1),
97
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
- }))
98
+ color: gray[700],
99
+ '&:hover': {
100
+ backgroundColor: alpha(gray[300], 0.3),
101
+ borderColor: alpha(gray[300], 0.5),
102
+ boxShadow: 'none'
103
+ },
104
+ '&:active': {
105
+ backgroundColor: alpha(gray[300], 0.4),
106
+ boxShadow: `inset 0 2.5px 0 ${alpha(gray[400], 0.2)}`,
107
+ backgroundImage: 'none'
108
+ }
109
+ }),
110
+ ...(ownerState.variant === 'text' && ownerState.color === 'primary' && {
111
+ color: brand[700],
112
+ '&:hover': {
113
+ backgroundColor: alpha(brand[300], 0.3)
114
+ }
115
+ }),
116
+ ...(ownerState.variant === 'text' && ownerState.color === 'info' && {
117
+ color: gray[700],
118
+ '&:hover': {
119
+ backgroundColor: alpha(gray[300], 0.3)
120
+ }
121
+ }),
122
+ ...(theme.palette.mode === 'dark' && {
123
+ ...(ownerState.variant === 'outlined' && {
124
+ color: brand[200],
125
+ backgroundColor: alpha(brand[600], 0.1),
126
+ borderColor: alpha(brand[600], 0.6),
127
+ boxShadow: `inset 0 2.5px ${alpha(brand[400], 0.1)}, inset 0 -2px ${alpha(gray[900], 0.5)}`,
128
+ '&:hover': {
129
+ backgroundColor: alpha(brand[700], 0.2),
130
+ borderColor: alpha(brand[700], 0.5),
131
+ boxShadow: 'none'
132
+ },
133
+ '&:active': {
134
+ backgroundColor: alpha(brand[800], 0.2),
135
+ boxShadow: `inset 0 2.5px 0 ${alpha(brand[900], 0.4)}`,
136
+ backgroundImage: 'none'
137
+ }
138
+ }),
139
+ ...(ownerState.variant === 'text' && ownerState.color === 'info' && {
140
+ color: gray[200],
141
+ '&:hover': {
142
+ backgroundColor: alpha(gray[700], 0.3)
143
+ }
144
+ }),
145
+ ...(ownerState.variant === 'outlined' && ownerState.color === 'secondary' && {
146
+ color: gray[300],
147
+ backgroundColor: alpha(gray[600], 0.1),
148
+ borderColor: alpha(gray[700], 0.5),
149
+ boxShadow: `inset 0 2.5px ${alpha(gray[600], 0.1)}, inset 0 -2px ${alpha(gray[900], 0.5)}`,
150
+ '&:hover': {
151
+ backgroundColor: alpha(gray[700], 0.2),
152
+ borderColor: alpha(gray[700], 0.5),
153
+ boxShadow: 'none'
154
+ },
155
+ '&:active': {
156
+ backgroundColor: alpha(gray[800], 0.2),
157
+ boxShadow: `inset 0 2.5px 0 ${alpha(gray[900], 0.4)}`,
158
+ backgroundImage: 'none'
159
+ }
160
+ }),
161
+ ...(ownerState.variant === 'text' && ownerState.color === 'primary' && {
162
+ color: brand[200],
163
+ '&:hover': {
164
+ backgroundColor: alpha(brand[700], 0.3)
165
+ }
166
+ })
167
+ })
168
+ })
156
169
  }
157
170
  },
158
171
  MuiCard: {
@@ -160,24 +173,27 @@ function getCheckoutTheme(mode) {
160
173
  root: ({
161
174
  theme,
162
175
  ownerState
163
- }) => (0, _extends2.default)({
176
+ }) => ({
164
177
  transition: 'all 100ms ease',
165
178
  backgroundColor: gray[50],
166
179
  borderRadius: theme.shape.borderRadius,
167
180
  border: `1px solid ${alpha(gray[200], 0.5)}`,
168
- boxShadow: 'none'
169
- }, ownerState.variant === 'outlined' && {
170
- border: `1px solid ${gray[200]}`,
171
181
  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
- }))
182
+ ...(ownerState.variant === 'outlined' && {
183
+ border: `1px solid ${gray[200]}`,
184
+ boxShadow: 'none',
185
+ background: `linear-gradient(to bottom, hsl(0, 0%, 100%), ${gray[50]})`
186
+ }),
187
+ ...(theme.palette.mode === 'dark' && {
188
+ backgroundColor: alpha(gray[800], 0.6),
189
+ border: `1px solid ${alpha(gray[700], 0.3)}`,
190
+ ...(ownerState.variant === 'outlined' && {
191
+ border: `1px solid ${alpha(gray[700], 0.4)}`,
192
+ boxShadow: 'none',
193
+ background: `linear-gradient(to bottom, ${gray[900]}, ${alpha(gray[800], 0.5)})`
194
+ })
195
+ })
196
+ })
181
197
  }
182
198
  },
183
199
  MuiCheckbox: {
@@ -198,7 +214,7 @@ function getCheckoutTheme(mode) {
198
214
  styleOverrides: {
199
215
  root: ({
200
216
  theme
201
- }) => (0, _extends2.default)({
217
+ }) => ({
202
218
  margin: 10,
203
219
  height: 16,
204
220
  width: 16,
@@ -224,19 +240,20 @@ function getCheckoutTheme(mode) {
224
240
  '&:hover': {
225
241
  backgroundColor: brand[600]
226
242
  }
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
243
  },
235
- '&.Mui-focusVisible': {
236
- borderColor: brand[400],
237
- outline: `3px solid ${alpha(brand[500], 0.5)}`,
238
- outlineOffset: '2px'
239
- }
244
+ ...(theme.palette.mode === 'dark' && {
245
+ borderColor: alpha(gray[700], 0.5),
246
+ boxShadow: '0 0 0 1.5px hsl(210, 0%, 0%) inset',
247
+ backgroundColor: alpha(gray[900], 0.8),
248
+ '&:hover': {
249
+ borderColor: brand[300]
250
+ },
251
+ '&.Mui-focusVisible': {
252
+ borderColor: brand[400],
253
+ outline: `3px solid ${alpha(brand[500], 0.5)}`,
254
+ outlineOffset: '2px'
255
+ }
256
+ })
240
257
  })
241
258
  }
242
259
  },
@@ -244,10 +261,11 @@ function getCheckoutTheme(mode) {
244
261
  styleOverrides: {
245
262
  root: ({
246
263
  theme
247
- }) => (0, _extends2.default)({
248
- borderColor: `${alpha(gray[200], 0.8)}`
249
- }, theme.palette.mode === 'dark' && {
250
- borderColor: `${alpha(gray[700], 0.4)}`
264
+ }) => ({
265
+ borderColor: `${alpha(gray[200], 0.8)}`,
266
+ ...(theme.palette.mode === 'dark' && {
267
+ borderColor: `${alpha(gray[700], 0.4)}`
268
+ })
251
269
  })
252
270
  }
253
271
  },
@@ -266,24 +284,27 @@ function getCheckoutTheme(mode) {
266
284
  root: ({
267
285
  theme,
268
286
  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
- }, {
287
+ }) => ({
288
+ ...(ownerState.size === 'small' && {
289
+ height: '2rem',
290
+ width: '2rem'
291
+ }),
292
+ ...(ownerState.size === 'medium' && {
293
+ height: '2.5rem',
294
+ width: '2.5rem'
295
+ }),
276
296
  color: brand[500],
277
297
  '&:hover': {
278
298
  backgroundColor: alpha(brand[300], 0.3),
279
299
  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
- }
300
+ },
301
+ ...(theme.palette.mode === 'dark' && {
302
+ color: brand[200],
303
+ '&:hover': {
304
+ backgroundColor: alpha(brand[600], 0.3),
305
+ borderColor: brand[700]
306
+ }
307
+ })
287
308
  })
288
309
  }
289
310
  },
@@ -301,7 +322,7 @@ function getCheckoutTheme(mode) {
301
322
  styleOverrides: {
302
323
  root: ({
303
324
  theme
304
- }) => (0, _extends2.default)({
325
+ }) => ({
305
326
  color: brand[700],
306
327
  fontWeight: 500,
307
328
  position: 'relative',
@@ -325,9 +346,10 @@ function getCheckoutTheme(mode) {
325
346
  outline: `3px solid ${alpha(brand[500], 0.5)}`,
326
347
  outlineOffset: '4px',
327
348
  borderRadius: '2px'
328
- }
329
- }, theme.palette.mode === 'dark' && {
330
- color: brand[200]
349
+ },
350
+ ...(theme.palette.mode === 'dark' && {
351
+ color: brand[200]
352
+ })
331
353
  })
332
354
  }
333
355
  },
@@ -342,7 +364,7 @@ function getCheckoutTheme(mode) {
342
364
  root: ({
343
365
  theme,
344
366
  ownerState
345
- }) => (0, _extends2.default)({
367
+ }) => ({
346
368
  'input:-webkit-autofill': {
347
369
  WebkitBoxShadow: `0 0 0 1000px ${brand[100]} inset, 0 0 0 1px ${brand[200]}`,
348
370
  maxHeight: '4px',
@@ -371,45 +393,48 @@ function getCheckoutTheme(mode) {
371
393
  outline: `3px solid ${alpha(brand[500], 0.5)}`,
372
394
  outlineOffset: '2px',
373
395
  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
396
  },
387
- '& .MuiInputBase-input': {
388
- fontSize: '1rem',
389
- '&::placeholder': {
390
- opacity: 1,
391
- color: gray[500]
397
+ ...(ownerState.color === 'error' && {
398
+ borderColor: red[200],
399
+ color: red[500],
400
+ '& + .MuiFormHelperText-root': {
401
+ color: red[500]
392
402
  }
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
- }))
403
+ }),
404
+ ...(theme.palette.mode === 'dark' && {
405
+ 'input:-webkit-autofill': {
406
+ WebkitBoxShadow: `0 0 0 1000px ${brand[900]} inset, 0 0 0 1px ${brand[600]}`,
407
+ maxHeight: '6px',
408
+ borderRadius: '8px'
409
+ },
410
+ '& .MuiInputBase-input': {
411
+ fontSize: '1rem',
412
+ '&::placeholder': {
413
+ opacity: 1,
414
+ color: gray[500]
415
+ }
416
+ },
417
+ borderColor: alpha(gray[700], 0.5),
418
+ boxShadow: '0 0 0 1.5px hsl(210, 0%, 0%) inset',
419
+ backgroundColor: alpha(gray[900], 0.8),
420
+ transition: 'border-color 120ms ease-in',
421
+ '&:hover': {
422
+ borderColor: brand[300]
423
+ },
424
+ '&.Mui-focused': {
425
+ borderColor: brand[400],
426
+ outline: `3px solid ${alpha(brand[500], 0.5)}`,
427
+ outlineOffset: '2px'
428
+ },
429
+ ...(ownerState.color === 'error' && {
430
+ borderColor: red[700],
431
+ color: red[300],
432
+ '& + .MuiFormHelperText-root': {
433
+ color: red[300]
434
+ }
435
+ })
436
+ })
437
+ })
413
438
  }
414
439
  },
415
440
  MuiPaper: {
@@ -447,7 +472,7 @@ function getCheckoutTheme(mode) {
447
472
  styleOverrides: {
448
473
  root: ({
449
474
  theme
450
- }) => (0, _extends2.default)({
475
+ }) => ({
451
476
  color: 'transparent',
452
477
  border: `1px solid ${gray[400]}`,
453
478
  width: 12,
@@ -463,17 +488,18 @@ function getCheckoutTheme(mode) {
463
488
  '&.Mui-completed': {
464
489
  border: 'none',
465
490
  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
491
  },
473
- '&.Mui-completed': {
474
- border: 'none',
475
- color: theme.palette.success.light
476
- }
492
+ ...(theme.palette.mode === 'dark' && {
493
+ border: `1px solid ${gray[700]}`,
494
+ '&.Mui-active': {
495
+ border: 'none',
496
+ color: theme.palette.primary.light
497
+ },
498
+ '&.Mui-completed': {
499
+ border: 'none',
500
+ color: theme.palette.success.light
501
+ }
502
+ })
477
503
  })
478
504
  }
479
505
  },
@@ -482,11 +508,12 @@ function getCheckoutTheme(mode) {
482
508
  label: ({
483
509
  theme
484
510
  }) => ({
485
- '&.Mui-completed': (0, _extends2.default)({
486
- opacity: 0.6
487
- }, theme.palette.mode === 'dark' && {
488
- opacity: 0.5
489
- })
511
+ '&.Mui-completed': {
512
+ opacity: 0.6,
513
+ ...(theme.palette.mode === 'dark' && {
514
+ opacity: 0.5
515
+ })
516
+ }
490
517
  })
491
518
  }
492
519
  },
@@ -494,17 +521,18 @@ function getCheckoutTheme(mode) {
494
521
  styleOverrides: {
495
522
  root: ({
496
523
  theme
497
- }) => (0, _extends2.default)({
524
+ }) => ({
498
525
  borderRadius: theme.shape.borderRadius,
499
526
  boxShadow: `0 1px 2px hsla(210, 0%, 0%, 0.05), 0 2px 12px ${alpha(brand[200], 0.5)}`,
500
527
  '& .Mui-selected': {
501
528
  color: brand[500]
502
- }
503
- }, theme.palette.mode === 'dark' && {
504
- '& .Mui-selected': {
505
- color: 'hsl(0, 0%, 100%)'
506
529
  },
507
- boxShadow: `0 0 0 1px hsla(210, 0%, 0%, 0.5), 0 2px 12px ${alpha(brand[700], 0.5)}`
530
+ ...(theme.palette.mode === 'dark' && {
531
+ '& .Mui-selected': {
532
+ color: 'hsl(0, 0%, 100%)'
533
+ },
534
+ boxShadow: `0 0 0 1px hsla(210, 0%, 0%, 0.5), 0 2px 12px ${alpha(brand[700], 0.5)}`
535
+ })
508
536
  })
509
537
  }
510
538
  },
@@ -512,19 +540,20 @@ function getCheckoutTheme(mode) {
512
540
  styleOverrides: {
513
541
  root: ({
514
542
  theme
515
- }) => (0, _extends2.default)({
543
+ }) => ({
516
544
  padding: '12px 16px',
517
545
  textTransform: 'none',
518
546
  borderRadius: theme.shape.borderRadius,
519
- fontWeight: 500
520
- }, theme.palette.mode === 'dark' && {
521
- color: gray[400],
522
- '&.Mui-selected': {
523
- color: brand[300]
524
- }
547
+ fontWeight: 500,
548
+ ...(theme.palette.mode === 'dark' && {
549
+ color: gray[400],
550
+ '&.Mui-selected': {
551
+ color: brand[300]
552
+ }
553
+ })
525
554
  })
526
555
  }
527
556
  }
528
557
  }
529
- });
558
+ };
530
559
  }