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

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 (49) hide show
  1. package/README.md +219 -45
  2. package/node/deprecations/all/deprecations-all.js +4 -0
  3. package/node/deprecations/avatar-group-props/avatar-group-props.js +87 -0
  4. package/node/deprecations/avatar-group-props/index.js +13 -0
  5. package/node/deprecations/avatar-group-props/test-cases/actual.js +56 -0
  6. package/node/deprecations/avatar-group-props/test-cases/expected.js +58 -0
  7. package/node/deprecations/avatar-group-props/test-cases/theme.actual.js +48 -0
  8. package/node/deprecations/avatar-group-props/test-cases/theme.expected.js +50 -0
  9. package/node/deprecations/grid-props/grid-props.js +51 -0
  10. package/node/deprecations/grid-props/index.js +13 -0
  11. package/node/deprecations/grid-props/test-cases/actual.js +25 -0
  12. package/node/deprecations/grid-props/test-cases/expected.js +23 -0
  13. package/node/deprecations/grid-props/test-cases/theme.actual.js +24 -0
  14. package/node/deprecations/grid-props/test-cases/theme.expected.js +23 -0
  15. package/node/deprecations/list-item-props/index.js +13 -0
  16. package/node/deprecations/list-item-props/list-item-props.js +22 -0
  17. package/node/deprecations/list-item-props/test-cases/actual.js +43 -0
  18. package/node/deprecations/list-item-props/test-cases/expected.js +40 -0
  19. package/node/deprecations/list-item-props/test-cases/theme.actual.js +56 -0
  20. package/node/deprecations/list-item-props/test-cases/theme.expected.js +53 -0
  21. package/node/deprecations/popper-props/index.js +13 -0
  22. package/node/deprecations/popper-props/popper-props.js +22 -0
  23. package/node/deprecations/popper-props/test-cases/actual.js +27 -0
  24. package/node/deprecations/popper-props/test-cases/expected.js +24 -0
  25. package/node/deprecations/popper-props/test-cases/theme.actual.js +32 -0
  26. package/node/deprecations/popper-props/test-cases/theme.expected.js +29 -0
  27. package/node/deprecations/tooltip-props/index.js +13 -0
  28. package/node/deprecations/tooltip-props/test-cases/actual.js +92 -0
  29. package/node/deprecations/tooltip-props/test-cases/expected.js +84 -0
  30. package/node/deprecations/tooltip-props/test-cases/theme.actual.js +73 -0
  31. package/node/deprecations/tooltip-props/test-cases/theme.expected.js +65 -0
  32. package/node/deprecations/tooltip-props/tooltip-props.js +22 -0
  33. package/node/util/migrateToVariants.js +156 -98
  34. package/node/v6.0.0/sx-prop/index.js +13 -0
  35. package/node/v6.0.0/sx-prop/sx-v6.js +355 -0
  36. package/node/v6.0.0/sx-prop/test-cases/basic-sx.actual.js +36 -0
  37. package/node/v6.0.0/sx-prop/test-cases/basic-sx.expected.js +46 -0
  38. package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.actual.js +41 -0
  39. package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.expected.js +71 -0
  40. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.actual.js +87 -0
  41. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.expected.js +102 -0
  42. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic2.actual.js +49 -0
  43. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic2.expected.js +64 -0
  44. package/node/v6.0.0/system-props/index.js +13 -0
  45. package/node/v6.0.0/system-props/removeSystemProps.js +242 -0
  46. package/node/v6.0.0/system-props/test-cases/system-props.actual.js +79 -0
  47. package/node/v6.0.0/system-props/test-cases/system-props.expected.js +92 -0
  48. package/node/v6.0.0/theme-v6/theme-v6.js +2 -2
  49. package/package.json +4 -4
@@ -0,0 +1,355 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = sxV6;
8
+ var _getReturnExpression = _interopRequireDefault(require("../../util/getReturnExpression"));
9
+ var _migrateToVariants = require("../../util/migrateToVariants");
10
+ /**
11
+ *
12
+ * @param {import('jscodeshift').MemberExpression | import('jscodeshift').Identifier} node
13
+ */
14
+ function getCssVarName(node) {
15
+ if (node.type === 'MemberExpression') {
16
+ var _getObjectKey;
17
+ return `--${(_getObjectKey = (0, _migrateToVariants.getObjectKey)(node)) == null ? void 0 : _getObjectKey.name}-${node.property.name}`;
18
+ }
19
+ if (node.type === 'Identifier') {
20
+ return `--${node.name}`;
21
+ }
22
+ return '';
23
+ }
24
+
25
+ /**
26
+ * @param {import('jscodeshift').FileInfo} file
27
+ * @param {import('jscodeshift').API} api
28
+ */
29
+ function sxV6(file, api, options) {
30
+ const j = api.jscodeshift;
31
+ const root = j(file.source);
32
+ const printOptions = options.printOptions;
33
+ const createBuildStyle = (0, _migrateToVariants.getCreateBuildStyle)(j);
34
+ const appendPaletteModeStyles = (0, _migrateToVariants.getAppendPaletteModeStyles)(j);
35
+ const buildArrowFunctionAST = (0, _migrateToVariants.getBuildArrowFunctionAST)(j);
36
+
37
+ /**
38
+ *
39
+ * @param {import('jscodeshift').Identifier} node
40
+ */
41
+ function replaceUndefined(node, replacement = j.nullLiteral()) {
42
+ if ((node == null ? void 0 : node.type) === 'Identifier' && node.name === 'undefined') {
43
+ return replacement;
44
+ }
45
+ return node;
46
+ }
47
+ let shouldTransform = false;
48
+ root.find(j.JSXAttribute, {
49
+ name: {
50
+ name: 'sx'
51
+ },
52
+ value: {
53
+ type: 'JSXExpressionContainer'
54
+ }
55
+ }).forEach(path => {
56
+ /**
57
+ * @type {[import('jscodeshift').StringLiteral, import('jscodeshift').Expression][]}
58
+ */
59
+ const cssVars = [];
60
+ const conditionalExpressions = []; // for ensuring the sequence of styles
61
+ let currentIndex = 0;
62
+ const sxContainer = path.node.value;
63
+ if (['ArrowFunctionExpression', 'ObjectExpression', 'ArrayExpression'].includes(sxContainer.expression.type)) {
64
+ shouldTransform = true;
65
+ (sxContainer.expression.type === 'ArrayExpression' ? sxContainer.expression.elements : [sxContainer.expression]).forEach((item, index) => {
66
+ currentIndex = index;
67
+ recurseObjectExpression({
68
+ root: item,
69
+ replaceRoot: newRoot => {
70
+ sxContainer.expression = newRoot;
71
+ },
72
+ node: item,
73
+ buildStyle: createBuildStyle()
74
+ });
75
+ });
76
+ if (cssVars.length) {
77
+ const cssVarsObject = j.objectExpression(cssVars.map(([varName, value]) => j.objectProperty(varName, value)));
78
+ if (path.parent.node.type === 'JSXOpeningElement') {
79
+ const styleAttribute = path.parent.node.attributes.find(attribute => attribute.type === 'JSXAttribute' && attribute.name.name === 'style');
80
+ const spreadAttribute = path.parent.node.attributes.find(attribute => attribute.type === 'JSXSpreadAttribute');
81
+ if (styleAttribute) {
82
+ if (styleAttribute.value.expression.type === 'ObjectExpression') {
83
+ styleAttribute.value.expression.properties = [...cssVarsObject.properties, ...styleAttribute.value.expression.properties];
84
+ } else if (styleAttribute.value.expression.type === 'Identifier' || styleAttribute.value.expression.type === 'MemberExpression') {
85
+ styleAttribute.value.expression = j.objectExpression([...cssVarsObject.properties, j.spreadElement(styleAttribute.value.expression)]);
86
+ }
87
+ } else if (spreadAttribute) {
88
+ path.parent.node.attributes.push(j.jsxAttribute(j.jsxIdentifier('style'), j.jsxExpressionContainer(j.objectExpression([...cssVarsObject.properties, j.spreadElement(j.memberExpression(spreadAttribute.argument, j.identifier('style')))]))));
89
+ } else {
90
+ path.parent.node.attributes.push(j.jsxAttribute(j.jsxIdentifier('style'), j.jsxExpressionContainer(cssVarsObject)));
91
+ }
92
+ }
93
+ }
94
+ if (conditionalExpressions.length && sxContainer.expression.type === 'ArrayExpression') {
95
+ // insert the conditional expressions in the correct order
96
+ let cumulativeIndex = 0;
97
+ conditionalExpressions.forEach(([index, newElement]) => {
98
+ sxContainer.expression.elements.splice(index + 1 + cumulativeIndex, 0, newElement);
99
+ cumulativeIndex += 1;
100
+ });
101
+ }
102
+ if (sxContainer.expression.type === 'ArrayExpression') {
103
+ sxContainer.expression.elements = sxContainer.expression.elements.filter(item => item.type !== 'ObjectExpression' || item.properties.length > 0);
104
+ }
105
+ }
106
+ function wrapSxInArray(newElement) {
107
+ if (sxContainer.expression.type === 'ObjectExpression' || sxContainer.expression.type === 'ArrowFunctionExpression') {
108
+ sxContainer.expression = j.arrayExpression([sxContainer.expression]);
109
+ }
110
+ if (sxContainer.expression.type === 'ArrayExpression') {
111
+ // store in a list to be added later to ensure the sequence of styles
112
+ conditionalExpressions.push([currentIndex, newElement]);
113
+ }
114
+ }
115
+
116
+ /**
117
+ *
118
+ * @param {{ node: import('jscodeshift').Expression }} data
119
+ */
120
+ function recurseObjectExpression(data) {
121
+ if (data.node.type === 'ArrowFunctionExpression') {
122
+ const returnExpression = (0, _getReturnExpression.default)(data.node);
123
+ if (returnExpression) {
124
+ recurseObjectExpression({
125
+ ...data,
126
+ node: returnExpression
127
+ });
128
+ }
129
+ }
130
+ if (data.node.type === 'ObjectExpression') {
131
+ const modeStyles = {}; // to collect styles from `theme.palette.mode === '...'`
132
+ data.node.properties.forEach(prop => {
133
+ if (prop.type === 'ObjectProperty') {
134
+ recurseObjectExpression({
135
+ ...data,
136
+ node: prop.value,
137
+ parentNode: data.node,
138
+ key: prop.key,
139
+ buildStyle: createBuildStyle(prop.key, data.buildStyle),
140
+ replaceValue: newValue => {
141
+ prop.value = newValue;
142
+ },
143
+ deleteSelf: () => {
144
+ (0, _migrateToVariants.removeProperty)(data.node, prop);
145
+ if (data.node.properties.length === 0) {
146
+ var _data$deleteSelf;
147
+ (_data$deleteSelf = data.deleteSelf) == null || _data$deleteSelf.call(data);
148
+ }
149
+ },
150
+ modeStyles
151
+ });
152
+ } else {
153
+ recurseObjectExpression({
154
+ ...data,
155
+ node: prop,
156
+ parentNode: data.node,
157
+ buildStyle: createBuildStyle(prop.key, data.buildStyle)
158
+ });
159
+ }
160
+ });
161
+ appendPaletteModeStyles(data.node, modeStyles);
162
+ }
163
+ if (data.node.type === 'SpreadElement') {
164
+ if (data.node.argument.type === 'LogicalExpression') {
165
+ var _getObjectKey2, _getObjectKey3;
166
+ const paramName = data.node.argument.left.type === 'BinaryExpression' ? (_getObjectKey2 = (0, _migrateToVariants.getObjectKey)(data.node.argument.left.left)) == null ? void 0 : _getObjectKey2.name : (_getObjectKey3 = (0, _migrateToVariants.getObjectKey)(data.node.argument.left)) == null ? void 0 : _getObjectKey3.name;
167
+ if (paramName === 'theme' && data.node.argument.left.right.type === 'StringLiteral') {
168
+ if (data.node.argument.right.type === 'ObjectExpression') {
169
+ const mode = data.node.argument.left.right.value;
170
+ data.node.argument.right.properties.forEach(prop => {
171
+ if (prop.type === 'ObjectProperty') {
172
+ recurseObjectExpression({
173
+ ...data,
174
+ node: prop.value,
175
+ parentNode: data.node.argument.right,
176
+ key: prop.key,
177
+ buildStyle: createBuildStyle(prop.key, data.buildStyle, mode),
178
+ replaceValue: newValue => {
179
+ prop.value = newValue;
180
+ }
181
+ });
182
+ } else {
183
+ recurseObjectExpression({
184
+ ...data,
185
+ node: prop,
186
+ parentNode: data.node.argument.right,
187
+ buildStyle: createBuildStyle(prop.key, data.buildStyle, mode)
188
+ });
189
+ }
190
+ });
191
+ appendPaletteModeStyles(data.parentNode, {
192
+ [mode]: data.node.argument.right
193
+ });
194
+ }
195
+ if (data.deleteSelf) {
196
+ data.deleteSelf();
197
+ } else {
198
+ (0, _migrateToVariants.removeProperty)(data.parentNode, data.node);
199
+ }
200
+ return;
201
+ }
202
+ if (data.node.argument.right.type === 'ObjectExpression') {
203
+ recurseObjectExpression({
204
+ ...data,
205
+ node: data.node.argument.right,
206
+ root: data.node.argument.right,
207
+ replaceRoot: newRoot => {
208
+ data.node.argument.right = newRoot;
209
+ }
210
+ });
211
+ }
212
+ wrapSxInArray(j.logicalExpression(data.node.argument.operator, data.node.argument.left, data.node.argument.right));
213
+ if (data.deleteSelf) {
214
+ data.deleteSelf();
215
+ } else {
216
+ (0, _migrateToVariants.removeProperty)(data.parentNode, data.node);
217
+ }
218
+ }
219
+ if (data.node.argument.type === 'ConditionalExpression') {
220
+ recurseObjectExpression({
221
+ ...data,
222
+ node: data.node.argument,
223
+ parentNode: data.node
224
+ });
225
+ if (data.deleteSelf) {
226
+ data.deleteSelf();
227
+ } else {
228
+ (0, _migrateToVariants.removeProperty)(data.parentNode, data.node);
229
+ }
230
+ }
231
+ }
232
+ if (data.node.type === 'ConditionalExpression') {
233
+ if (data.node.test.type === 'BinaryExpression' || data.node.test.type === 'UnaryExpression' || data.node.test.type === 'Identifier' || data.node.test.type === 'MemberExpression') {
234
+ var _data$parentNode, _data$node$test, _data$node$test2;
235
+ if (((_data$parentNode = data.parentNode) == null ? void 0 : _data$parentNode.type) === 'ObjectExpression' && (((_data$node$test = data.node.test) == null ? void 0 : _data$node$test.type) === 'BinaryExpression' || ((_data$node$test2 = data.node.test) == null ? void 0 : _data$node$test2.type) === 'Identifier')) {
236
+ if (data.node.consequent.type !== 'ObjectExpression' && data.node.alternate.type !== 'ObjectExpression') {
237
+ if ((0, _migrateToVariants.isThemePaletteMode)(data.node.test.left)) {
238
+ var _data$replaceValue;
239
+ const consequentKey = (0, _migrateToVariants.getObjectKey)(data.node.consequent);
240
+ if (consequentKey.type === 'Identifier' && consequentKey.name !== 'theme') {
241
+ const varName = getCssVarName(data.node.consequent);
242
+ cssVars.push([j.stringLiteral(varName), data.node.consequent]);
243
+ data.node.consequent = j.stringLiteral(`var(${varName})`);
244
+ }
245
+ const alternateKey = (0, _migrateToVariants.getObjectKey)(data.node.alternate);
246
+ if (alternateKey.type === 'Identifier' && alternateKey.name !== 'theme') {
247
+ const varName = getCssVarName(data.node.alternate);
248
+ cssVars.push([j.stringLiteral(varName), data.node.alternate]);
249
+ data.node.alternate = j.stringLiteral(`var(${varName})`);
250
+ }
251
+ if (data.modeStyles) {
252
+ if (!data.modeStyles[data.node.test.right.value]) {
253
+ data.modeStyles[data.node.test.right.value] = [];
254
+ }
255
+ data.modeStyles[data.node.test.right.value].push(j.objectProperty(data.key, replaceUndefined(data.node.consequent)));
256
+ }
257
+ (_data$replaceValue = data.replaceValue) == null || _data$replaceValue.call(data, replaceUndefined(data.node.alternate));
258
+ if (data.root.type === 'ObjectExpression') {
259
+ var _data$replaceRoot;
260
+ (_data$replaceRoot = data.replaceRoot) == null || _data$replaceRoot.call(data, buildArrowFunctionAST([j.identifier('theme')], data.root));
261
+ } else if (data.root.type === 'ArrayExpression') {
262
+ data.root.elements.forEach((item, index) => {
263
+ if (item === data.node) {
264
+ data.root.elements[index] = buildArrowFunctionAST([j.identifier('theme')], data.root);
265
+ }
266
+ });
267
+ }
268
+ } else {
269
+ var _data$buildStyle, _data$buildStyle2;
270
+ wrapSxInArray(j.conditionalExpression(data.node.test, (_data$buildStyle = data.buildStyle) == null ? void 0 : _data$buildStyle.call(data, replaceUndefined(data.node.consequent)), (_data$buildStyle2 = data.buildStyle) == null ? void 0 : _data$buildStyle2.call(data, replaceUndefined(data.node.alternate))));
271
+ if (data.deleteSelf) {
272
+ data.deleteSelf();
273
+ } else {
274
+ (0, _migrateToVariants.removeProperty)(data.parentNode, data.node);
275
+ }
276
+ }
277
+ }
278
+ }
279
+ }
280
+ }
281
+ if (data.node.type === 'TemplateLiteral') {
282
+ var _data$parentNode2;
283
+ if (((_data$parentNode2 = data.parentNode) == null ? void 0 : _data$parentNode2.type) === 'ObjectExpression') {
284
+ const modeStyles = {};
285
+ data.node.expressions.forEach((expression, index) => {
286
+ if (expression.type === 'MemberExpression') {
287
+ const memberKey = (0, _migrateToVariants.getObjectKey)(expression);
288
+ if (memberKey.type === 'Identifier' && memberKey.name !== 'theme') {
289
+ const varName = getCssVarName(expression);
290
+ cssVars.push([j.stringLiteral(varName), expression]);
291
+ data.node.expressions[index] = j.stringLiteral(`var(${varName})`);
292
+ }
293
+ } else {
294
+ recurseObjectExpression({
295
+ ...data,
296
+ node: expression,
297
+ parentNode: data.parentNode,
298
+ buildStyle: createBuildStyle(data.key, data.buildStyle),
299
+ replaceValue: newValue => {
300
+ data.node.expressions[index] = newValue;
301
+ },
302
+ modeStyles
303
+ });
304
+ }
305
+ });
306
+ if (data.modeStyles) {
307
+ Object.entries(modeStyles).forEach(([mode, objectStyles]) => {
308
+ const clonedNode = {
309
+ ...data.node,
310
+ expressions: data.node.expressions.map(expression => ({
311
+ ...expression
312
+ }))
313
+ };
314
+ clonedNode.expressions = objectStyles.map(item => item.value);
315
+ if (!data.modeStyles[mode]) {
316
+ data.modeStyles[mode] = [];
317
+ }
318
+ data.modeStyles[mode].push(j.objectProperty(data.key, clonedNode));
319
+ });
320
+ if (data.key) {
321
+ var _data$replaceValue2;
322
+ (_data$replaceValue2 = data.replaceValue) == null || _data$replaceValue2.call(data, data.node);
323
+ }
324
+ }
325
+ }
326
+ }
327
+ }
328
+ });
329
+ const transformed = root.toSource(printOptions);
330
+ if (shouldTransform) {
331
+ // recast adds extra newlines that we don't want, https://github.com/facebook/jscodeshift/issues/249
332
+ // need to remove them manually
333
+ const lines = [];
334
+ let isInStyled = false;
335
+ let spaceMatch;
336
+ transformed.split('\n').forEach(line => {
337
+ if (!isInStyled) {
338
+ lines.push(line);
339
+ } else if (line !== '') {
340
+ var _line$match, _spaceMatch;
341
+ if (spaceMatch && ((_line$match = line.match(/^\s+/)) == null ? void 0 : _line$match[0]) === ((_spaceMatch = spaceMatch) == null ? void 0 : _spaceMatch[0]) && line.endsWith('}')) {
342
+ isInStyled = false;
343
+ spaceMatch = null;
344
+ }
345
+ lines.push(line);
346
+ }
347
+ if (line.includes('sx=')) {
348
+ isInStyled = true;
349
+ spaceMatch = line.match(/^\s+/);
350
+ }
351
+ });
352
+ return lines.join('\n');
353
+ }
354
+ return transformed;
355
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ var _jsxRuntime = require("react/jsx-runtime");
4
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, {
5
+ variant: "regular",
6
+ sx: theme => ({
7
+ display: 'flex',
8
+ alignItems: 'center',
9
+ justifyContent: 'space-between',
10
+ flexShrink: 0,
11
+ borderRadius: '999px',
12
+ bgcolor: theme.palette.mode === 'light' ? 'hsla(220, 60%, 99%, 0.6)' : 'hsla(220, 0%, 0%, 0.7)',
13
+ backdropFilter: 'blur(24px)',
14
+ maxHeight: 40,
15
+ border: '1px solid',
16
+ borderColor: 'divider',
17
+ boxShadow: theme.palette.mode === 'light' ? '0 1px 2px hsla(210, 0%, 0%, 0.05), 0 2px 12px hsla(210, 100%, 80%, 0.5)' : '0 1px 2px hsla(210, 0%, 0%, 0.5), 0 2px 12px hsla(210, 100%, 25%, 0.3)'
18
+ })
19
+ });
20
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
21
+ component: "main",
22
+ sx: {
23
+ backgroundColor: theme => theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[900],
24
+ flexGrow: 1,
25
+ height: '100vh',
26
+ overflow: 'auto'
27
+ }
28
+ });
29
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
30
+ sx: {
31
+ borderBottom: theme => `1px solid ${theme.palette.mode === 'light' ? 'grey.200' : 'grey.800'}`,
32
+ backgroundSize: 'cover',
33
+ backgroundPosition: 'center',
34
+ minHeight: 280
35
+ }
36
+ });
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ var _jsxRuntime = require("react/jsx-runtime");
4
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, {
5
+ variant: "regular",
6
+ sx: theme => ({
7
+ display: 'flex',
8
+ alignItems: 'center',
9
+ justifyContent: 'space-between',
10
+ flexShrink: 0,
11
+ borderRadius: '999px',
12
+ bgcolor: 'hsla(220, 0%, 0%, 0.7)',
13
+ backdropFilter: 'blur(24px)',
14
+ maxHeight: 40,
15
+ border: '1px solid',
16
+ borderColor: 'divider',
17
+ boxShadow: '0 1px 2px hsla(210, 0%, 0%, 0.5), 0 2px 12px hsla(210, 100%, 25%, 0.3)',
18
+ ...theme.applyStyles("light", {
19
+ bgcolor: 'hsla(220, 60%, 99%, 0.6)',
20
+ boxShadow: '0 1px 2px hsla(210, 0%, 0%, 0.05), 0 2px 12px hsla(210, 100%, 80%, 0.5)'
21
+ })
22
+ })
23
+ });
24
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
25
+ component: "main",
26
+ sx: theme => ({
27
+ backgroundColor: theme.palette.grey[900],
28
+ flexGrow: 1,
29
+ height: '100vh',
30
+ overflow: 'auto',
31
+ ...theme.applyStyles("light", {
32
+ backgroundColor: theme.palette.grey[100]
33
+ })
34
+ })
35
+ });
36
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
37
+ sx: theme => ({
38
+ borderBottom: `1px solid ${'grey.800'}`,
39
+ backgroundSize: 'cover',
40
+ backgroundPosition: 'center',
41
+ minHeight: 280,
42
+ ...theme.applyStyles("light", {
43
+ borderBottom: `1px solid ${'grey.200'}`
44
+ })
45
+ })
46
+ });
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ var _jsxRuntime = require("react/jsx-runtime");
4
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
5
+ sx: {
6
+ backgroundImage: theme => theme.palette.mode === 'light' ? items[selectedItemIndex].imageLight : items[selectedItemIndex].imageDark
7
+ }
8
+ });
9
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
10
+ style: props.style,
11
+ sx: {
12
+ backgroundImage: theme => theme.palette.mode === 'light' ? items[selectedItemIndex].imageLight : items[selectedItemIndex].imageDark
13
+ }
14
+ });
15
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
16
+ style: {
17
+ color: 'red',
18
+ ...props.style
19
+ },
20
+ sx: {
21
+ backgroundImage: theme => theme.palette.mode === 'light' ? items[selectedItemIndex].imageLight : items[selectedItemIndex].imageDark
22
+ }
23
+ });
24
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
25
+ ...props,
26
+ sx: {
27
+ backgroundImage: theme => theme.palette.mode === 'light' ? items[selectedItemIndex].imageLight : items[selectedItemIndex].imageDark
28
+ }
29
+ });
30
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Paper, {
31
+ sx: {
32
+ position: 'relative',
33
+ backgroundColor: 'grey.800',
34
+ color: '#fff',
35
+ mb: 4,
36
+ backgroundSize: 'cover',
37
+ backgroundRepeat: 'no-repeat',
38
+ backgroundPosition: 'center',
39
+ backgroundImage: `url(${post.image})`
40
+ }
41
+ });
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ var _jsxRuntime = require("react/jsx-runtime");
4
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
5
+ sx: theme => ({
6
+ backgroundImage: "var(--items-imageDark)",
7
+ ...theme.applyStyles("light", {
8
+ backgroundImage: "var(--items-imageLight)"
9
+ })
10
+ }),
11
+ style: {
12
+ "--items-imageLight": items[selectedItemIndex].imageLight,
13
+ "--items-imageDark": items[selectedItemIndex].imageDark
14
+ }
15
+ });
16
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
17
+ style: {
18
+ "--items-imageLight": items[selectedItemIndex].imageLight,
19
+ "--items-imageDark": items[selectedItemIndex].imageDark,
20
+ ...props.style
21
+ },
22
+ sx: theme => ({
23
+ backgroundImage: "var(--items-imageDark)",
24
+ ...theme.applyStyles("light", {
25
+ backgroundImage: "var(--items-imageLight)"
26
+ })
27
+ })
28
+ });
29
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
30
+ style: {
31
+ "--items-imageLight": items[selectedItemIndex].imageLight,
32
+ "--items-imageDark": items[selectedItemIndex].imageDark,
33
+ color: 'red',
34
+ ...props.style
35
+ },
36
+ sx: theme => ({
37
+ backgroundImage: "var(--items-imageDark)",
38
+ ...theme.applyStyles("light", {
39
+ backgroundImage: "var(--items-imageLight)"
40
+ })
41
+ })
42
+ });
43
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
44
+ ...props,
45
+ sx: theme => ({
46
+ backgroundImage: "var(--items-imageDark)",
47
+ ...theme.applyStyles("light", {
48
+ backgroundImage: "var(--items-imageLight)"
49
+ })
50
+ }),
51
+ style: {
52
+ "--items-imageLight": items[selectedItemIndex].imageLight,
53
+ "--items-imageDark": items[selectedItemIndex].imageDark,
54
+ ...props.style
55
+ }
56
+ });
57
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Paper, {
58
+ sx: {
59
+ position: 'relative',
60
+ backgroundColor: 'grey.800',
61
+ color: '#fff',
62
+ mb: 4,
63
+ backgroundSize: 'cover',
64
+ backgroundRepeat: 'no-repeat',
65
+ backgroundPosition: 'center',
66
+ backgroundImage: `url(${"var(--post-image)"})`
67
+ },
68
+ style: {
69
+ "--post-image": post.image
70
+ }
71
+ });
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+
3
+ var _jsxRuntime = require("react/jsx-runtime");
4
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
5
+ sx: {
6
+ mb: 1,
7
+ display: 'flex',
8
+ justifyContent: 'space-between',
9
+ alignItems: 'center',
10
+ gap: 2,
11
+ color: tier.title === 'Professional' ? 'grey.100' : '',
12
+ backgroundColor: theme => theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[900],
13
+ borderBottom: theme => `1px solid ${theme.palette.mode === 'light' ? 'grey.200' : 'grey.800'}`
14
+ }
15
+ });
16
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Card, {
17
+ sx: theme => ({
18
+ p: 2,
19
+ display: 'flex',
20
+ flexDirection: 'column',
21
+ gap: 4,
22
+ ...(tier.title === 'Professional' && {
23
+ border: 'none',
24
+ boxShadow: theme.palette.mode === 'light' ? `0 8px 12px hsla(210, 98%, 42%, 0.2)` : `0 8px 12px hsla(0, 0%, 0%, 0.8)`,
25
+ background: 'radial-gradient(circle at 50% 0%, hsl(210, 98%, 35%), hsl(210, 100%, 16%))'
26
+ })
27
+ })
28
+ });
29
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(Card, {
30
+ component: Button,
31
+ onClick: () => handleItemClick(index),
32
+ sx: theme => ({
33
+ p: 3,
34
+ height: 'fit-content',
35
+ width: '100%',
36
+ background: 'none',
37
+ ...(selectedItemIndex === index && {
38
+ backgroundColor: 'action.selected',
39
+ borderColor: theme.palette.mode === 'light' ? 'primary.light' : 'primary.dark'
40
+ }),
41
+ '&:hover': {
42
+ background: theme.palette.mode === 'light' ? 'linear-gradient(to bottom right, hsla(210, 100%, 97%, 0.5) 25%, hsla(210, 100%, 90%, 0.3) 100%)' : 'linear-gradient(to right bottom, hsla(210, 100%, 12%, 0.2) 25%, hsla(210, 100%, 16%, 0.2) 100%)',
43
+ borderColor: theme.palette.mode === 'light' ? 'primary.light' : 'primary.dark',
44
+ boxShadow: theme.palette.mode === 'light' ? '0px 2px 8px hsla(0, 0%, 0%, 0.1)' : '0px 1px 8px hsla(210, 100%, 25%, 0.5) '
45
+ }
46
+ })
47
+ }, index);
48
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(CreditCardRoundedIcon, {
49
+ fontSize: "small",
50
+ sx: theme => ({
51
+ color: theme.palette.mode === 'light' ? 'grey.400' : 'grey.600',
52
+ ...(paymentType === 'creditCard' && {
53
+ color: 'primary.main'
54
+ })
55
+ })
56
+ });
57
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(IconButton, {
58
+ edge: "start",
59
+ color: "inherit",
60
+ "aria-label": "open drawer",
61
+ onClick: toggleDrawer,
62
+ sx: {
63
+ marginRight: '36px',
64
+ ...(open && {
65
+ display: 'none'
66
+ })
67
+ },
68
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(MenuIcon, {})
69
+ });
70
+ /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
71
+ sx: [{
72
+ ...(selectedItemIndex === index && {
73
+ backgroundColor: 'action.selected',
74
+ borderColor: theme.palette.mode === 'light' ? 'primary.light' : 'primary.dark'
75
+ })
76
+ }, theme => ({
77
+ color: theme.palette.mode === 'light' ? 'grey.400' : 'grey.600',
78
+ ...(paymentType === 'creditCard' && {
79
+ color: 'primary.main'
80
+ })
81
+ }), {
82
+ marginRight: '36px',
83
+ ...(open && {
84
+ display: 'none'
85
+ })
86
+ }]
87
+ });