@mui/codemod 6.0.0-alpha.9 → 6.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +423 -168
- package/codemod.js +0 -2
- package/node/deprecations/all/deprecations-all.js +34 -26
- package/node/deprecations/all/postcss.config.js +7 -1
- package/node/deprecations/autocomplete-props/autocomplete-props.js +0 -32
- package/node/deprecations/autocomplete-props/test-cases/actual.js +13 -35
- package/node/deprecations/autocomplete-props/test-cases/expected.js +13 -41
- package/node/deprecations/autocomplete-props/test-cases/theme.actual.js +0 -18
- package/node/deprecations/autocomplete-props/test-cases/theme.expected.js +0 -22
- package/node/deprecations/backdrop-props/backdrop-props.js +3 -5
- package/node/deprecations/backdrop-props/test-cases/actual.js +30 -14
- package/node/deprecations/backdrop-props/test-cases/expected.js +23 -13
- package/node/deprecations/backdrop-props/test-cases/theme.actual.js +32 -6
- package/node/deprecations/backdrop-props/test-cases/theme.expected.js +27 -5
- package/node/deprecations/filled-input-props/filled-input-props.js +22 -0
- package/node/deprecations/filled-input-props/index.js +13 -0
- package/node/deprecations/filled-input-props/test-cases/actual.js +60 -0
- package/node/deprecations/filled-input-props/test-cases/expected.js +52 -0
- package/node/deprecations/filled-input-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/filled-input-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/input-base-props/index.js +13 -0
- package/node/deprecations/input-base-props/input-base-props.js +22 -0
- package/node/deprecations/input-base-props/test-cases/actual.js +60 -0
- package/node/deprecations/input-base-props/test-cases/expected.js +52 -0
- package/node/deprecations/input-base-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/input-base-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/input-props/index.js +13 -0
- package/node/deprecations/input-props/input-props.js +22 -0
- package/node/deprecations/input-props/test-cases/actual.js +60 -0
- package/node/deprecations/input-props/test-cases/expected.js +52 -0
- package/node/deprecations/input-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/input-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/modal-props/index.js +13 -0
- package/node/deprecations/modal-props/modal-props.js +22 -0
- package/node/deprecations/modal-props/test-cases/actual.js +43 -0
- package/node/deprecations/modal-props/test-cases/expected.js +40 -0
- package/node/deprecations/modal-props/test-cases/theme.actual.js +56 -0
- package/node/deprecations/modal-props/test-cases/theme.expected.js +53 -0
- package/node/deprecations/outlined-input-props/index.js +13 -0
- package/node/deprecations/outlined-input-props/outlined-input-props.js +22 -0
- package/node/deprecations/outlined-input-props/test-cases/actual.js +60 -0
- package/node/deprecations/outlined-input-props/test-cases/expected.js +52 -0
- package/node/deprecations/outlined-input-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/outlined-input-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/step-label-props/step-label-props.js +0 -14
- package/node/deprecations/step-label-props/test-cases/actual.js +0 -23
- package/node/deprecations/step-label-props/test-cases/expected.js +0 -27
- package/node/deprecations/step-label-props/test-cases/theme.actual.js +0 -22
- package/node/deprecations/step-label-props/test-cases/theme.expected.js +0 -28
- package/node/deprecations/tab-classes/index.js +13 -0
- package/node/deprecations/tab-classes/postcss-plugin.js +30 -0
- package/node/deprecations/tab-classes/postcss.config.js +8 -0
- package/node/deprecations/tab-classes/tab-classes.js +53 -0
- package/node/deprecations/tab-classes/test-cases/actual.js +5 -0
- package/node/deprecations/tab-classes/test-cases/expected.js +5 -0
- package/node/deprecations/table-sort-label-classes/index.js +13 -0
- package/node/deprecations/table-sort-label-classes/postcss-plugin.js +33 -0
- package/node/deprecations/table-sort-label-classes/postcss.config.js +8 -0
- package/node/deprecations/table-sort-label-classes/table-sort-label-classes.js +77 -0
- package/node/deprecations/table-sort-label-classes/test-cases/actual.js +7 -0
- package/node/deprecations/table-sort-label-classes/test-cases/expected.js +7 -0
- package/node/util/migrateToVariants.js +91 -43
- package/node/v5.0.0/theme-spacing.test/large-actual.js +1 -1
- package/node/v5.0.0/theme-spacing.test/large-expected.js +1 -1
- package/node/v6.0.0/grid-v2-props/grid-v2-props.js +149 -0
- package/node/v6.0.0/grid-v2-props/index.js +13 -0
- package/node/v6.0.0/grid-v2-props/test-cases/actual.js +85 -0
- package/node/v6.0.0/grid-v2-props/test-cases/custom-breakpoints.actual.js +18 -0
- package/node/v6.0.0/grid-v2-props/test-cases/custom-breakpoints.expected.js +22 -0
- package/node/v6.0.0/grid-v2-props/test-cases/expected.js +97 -0
- package/node/v6.0.0/styled/test-cases/ConditionalStyled.expected.js +9 -22
- package/node/v6.0.0/styled/test-cases/DynamicPropsStyled.actual.js +39 -0
- package/node/v6.0.0/styled/test-cases/DynamicPropsStyled.expected.js +65 -0
- package/node/v6.0.0/styled/test-cases/LogicalStyled.actual.js +31 -1
- package/node/v6.0.0/styled/test-cases/LogicalStyled.expected.js +39 -1
- package/node/v6.0.0/styled/test-cases/NestedSpread.expected.js +11 -13
- package/node/v6.0.0/sx-prop/sx-v6.js +80 -30
- package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.actual.js +14 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.expected.js +33 -16
- package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.actual.js +21 -1
- package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.expected.js +19 -1
- package/node/v6.0.0/sx-prop/test-cases/sx-line-break.actual.js +69 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-line-break.expected.js +69 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-value-callback.actual.js +102 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-value-callback.expected.js +111 -0
- package/package.json +7 -7
|
@@ -12,14 +12,18 @@ var _migrateToVariants = require("../../util/migrateToVariants");
|
|
|
12
12
|
* @param {import('jscodeshift').MemberExpression | import('jscodeshift').Identifier} node
|
|
13
13
|
*/
|
|
14
14
|
function getCssVarName(node) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
let varName = '-';
|
|
16
|
+
while (node.type === 'MemberExpression') {
|
|
17
|
+
var _node$object, _node$property;
|
|
18
|
+
varName += `-${((_node$object = node.object) == null ? void 0 : _node$object.name) || ((_node$property = node.property) == null ? void 0 : _node$property.name) || 'unknown'}`;
|
|
19
|
+
if (node.object.type === 'MemberExpression') {
|
|
20
|
+
node = node.object;
|
|
21
|
+
} else {
|
|
22
|
+
node = node.property;
|
|
23
|
+
}
|
|
21
24
|
}
|
|
22
|
-
|
|
25
|
+
varName += `-${node.name || 'unknown'}`;
|
|
26
|
+
return varName;
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
/**
|
|
@@ -112,6 +116,18 @@ function sxV6(file, api, options) {
|
|
|
112
116
|
conditionalExpressions.push([currentIndex, newElement]);
|
|
113
117
|
}
|
|
114
118
|
}
|
|
119
|
+
function rootThemeCallback(data) {
|
|
120
|
+
if (data.root.type === 'ObjectExpression') {
|
|
121
|
+
var _data$replaceRoot;
|
|
122
|
+
(_data$replaceRoot = data.replaceRoot) == null || _data$replaceRoot.call(data, buildArrowFunctionAST([j.identifier('theme')], data.root));
|
|
123
|
+
} else if (data.root.type === 'ArrayExpression') {
|
|
124
|
+
data.root.elements.forEach((item, index) => {
|
|
125
|
+
if (item === data.node) {
|
|
126
|
+
data.root.elements[index] = buildArrowFunctionAST([j.identifier('theme')], data.root);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
115
131
|
|
|
116
132
|
/**
|
|
117
133
|
*
|
|
@@ -121,10 +137,47 @@ function sxV6(file, api, options) {
|
|
|
121
137
|
if (data.node.type === 'ArrowFunctionExpression') {
|
|
122
138
|
const returnExpression = (0, _getReturnExpression.default)(data.node);
|
|
123
139
|
if (returnExpression) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
140
|
+
var _returnExpression$pro, _getObjectKey, _getObjectKey2, _getObjectKey3, _getObjectKey4;
|
|
141
|
+
if (returnExpression.type === 'MemberExpression' && ((_returnExpression$pro = returnExpression.property) == null ? void 0 : _returnExpression$pro.type) === 'ConditionalExpression') {
|
|
142
|
+
recurseObjectExpression({
|
|
143
|
+
...data,
|
|
144
|
+
node: j.conditionalExpression(returnExpression.property.test, {
|
|
145
|
+
...returnExpression,
|
|
146
|
+
property: returnExpression.property.consequent
|
|
147
|
+
}, {
|
|
148
|
+
...returnExpression,
|
|
149
|
+
property: returnExpression.property.alternate
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
} else if (returnExpression.type === 'TemplateLiteral') {
|
|
153
|
+
const firstExpression = returnExpression.expressions[0];
|
|
154
|
+
if ((firstExpression == null ? void 0 : firstExpression.type) === 'ConditionalExpression') {
|
|
155
|
+
recurseObjectExpression({
|
|
156
|
+
...data,
|
|
157
|
+
node: j.conditionalExpression(firstExpression.test, {
|
|
158
|
+
...returnExpression,
|
|
159
|
+
expressions: [firstExpression.consequent, ...(returnExpression.expressions || []).slice(1)]
|
|
160
|
+
}, {
|
|
161
|
+
...returnExpression,
|
|
162
|
+
expressions: [firstExpression.alternate, ...(returnExpression.expressions || []).slice(1)]
|
|
163
|
+
})
|
|
164
|
+
});
|
|
165
|
+
} else {
|
|
166
|
+
recurseObjectExpression({
|
|
167
|
+
...data,
|
|
168
|
+
node: returnExpression
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
} else if (returnExpression.type === 'CallExpression' && ((_getObjectKey = (0, _migrateToVariants.getObjectKey)(returnExpression.callee)) == null ? void 0 : _getObjectKey.name) === 'theme' || returnExpression.type === 'MemberExpression' && ((_getObjectKey2 = (0, _migrateToVariants.getObjectKey)(returnExpression)) == null ? void 0 : _getObjectKey2.name) === 'theme' || returnExpression.type === 'BinaryExpression' && (((_getObjectKey3 = (0, _migrateToVariants.getObjectKey)(returnExpression.left)) == null ? void 0 : _getObjectKey3.name) === 'theme' || ((_getObjectKey4 = (0, _migrateToVariants.getObjectKey)(returnExpression.right)) == null ? void 0 : _getObjectKey4.name) === 'theme')) {
|
|
172
|
+
var _data$replaceValue;
|
|
173
|
+
(_data$replaceValue = data.replaceValue) == null || _data$replaceValue.call(data, returnExpression);
|
|
174
|
+
rootThemeCallback(data);
|
|
175
|
+
} else {
|
|
176
|
+
recurseObjectExpression({
|
|
177
|
+
...data,
|
|
178
|
+
node: returnExpression
|
|
179
|
+
});
|
|
180
|
+
}
|
|
128
181
|
}
|
|
129
182
|
}
|
|
130
183
|
if (data.node.type === 'ObjectExpression') {
|
|
@@ -162,8 +215,8 @@ function sxV6(file, api, options) {
|
|
|
162
215
|
}
|
|
163
216
|
if (data.node.type === 'SpreadElement') {
|
|
164
217
|
if (data.node.argument.type === 'LogicalExpression') {
|
|
165
|
-
var
|
|
166
|
-
const paramName = data.node.argument.left.type === 'BinaryExpression' ? (
|
|
218
|
+
var _getObjectKey5, _getObjectKey6;
|
|
219
|
+
const paramName = data.node.argument.left.type === 'BinaryExpression' ? (_getObjectKey5 = (0, _migrateToVariants.getObjectKey)(data.node.argument.left.left)) == null ? void 0 : _getObjectKey5.name : (_getObjectKey6 = (0, _migrateToVariants.getObjectKey)(data.node.argument.left)) == null ? void 0 : _getObjectKey6.name;
|
|
167
220
|
if (paramName === 'theme' && data.node.argument.left.right.type === 'StringLiteral') {
|
|
168
221
|
if (data.node.argument.right.type === 'ObjectExpression') {
|
|
169
222
|
const mode = data.node.argument.left.right.value;
|
|
@@ -209,7 +262,7 @@ function sxV6(file, api, options) {
|
|
|
209
262
|
}
|
|
210
263
|
});
|
|
211
264
|
}
|
|
212
|
-
wrapSxInArray(j.logicalExpression(data.node.argument.operator, data.node.argument.left, data.node.argument.right));
|
|
265
|
+
wrapSxInArray(j.logicalExpression(data.node.argument.operator, data.node.argument.left, data.buildStyle(data.node.argument.right)));
|
|
213
266
|
if (data.deleteSelf) {
|
|
214
267
|
data.deleteSelf();
|
|
215
268
|
} else {
|
|
@@ -235,7 +288,7 @@ function sxV6(file, api, options) {
|
|
|
235
288
|
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
289
|
if (data.node.consequent.type !== 'ObjectExpression' && data.node.alternate.type !== 'ObjectExpression') {
|
|
237
290
|
if ((0, _migrateToVariants.isThemePaletteMode)(data.node.test.left)) {
|
|
238
|
-
var _data$
|
|
291
|
+
var _data$replaceValue2;
|
|
239
292
|
const consequentKey = (0, _migrateToVariants.getObjectKey)(data.node.consequent);
|
|
240
293
|
if (consequentKey.type === 'Identifier' && consequentKey.name !== 'theme') {
|
|
241
294
|
const varName = getCssVarName(data.node.consequent);
|
|
@@ -254,17 +307,8 @@ function sxV6(file, api, options) {
|
|
|
254
307
|
}
|
|
255
308
|
data.modeStyles[data.node.test.right.value].push(j.objectProperty(data.key, replaceUndefined(data.node.consequent)));
|
|
256
309
|
}
|
|
257
|
-
(_data$
|
|
258
|
-
|
|
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
|
-
}
|
|
310
|
+
(_data$replaceValue2 = data.replaceValue) == null || _data$replaceValue2.call(data, replaceUndefined(data.node.alternate));
|
|
311
|
+
rootThemeCallback(data);
|
|
268
312
|
} else {
|
|
269
313
|
var _data$buildStyle, _data$buildStyle2;
|
|
270
314
|
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))));
|
|
@@ -279,7 +323,7 @@ function sxV6(file, api, options) {
|
|
|
279
323
|
}
|
|
280
324
|
}
|
|
281
325
|
if (data.node.type === 'TemplateLiteral') {
|
|
282
|
-
var _data$parentNode2;
|
|
326
|
+
var _data$parentNode2, _data$node$expression;
|
|
283
327
|
if (((_data$parentNode2 = data.parentNode) == null ? void 0 : _data$parentNode2.type) === 'ObjectExpression') {
|
|
284
328
|
const modeStyles = {};
|
|
285
329
|
data.node.expressions.forEach((expression, index) => {
|
|
@@ -318,11 +362,17 @@ function sxV6(file, api, options) {
|
|
|
318
362
|
data.modeStyles[mode].push(j.objectProperty(data.key, clonedNode));
|
|
319
363
|
});
|
|
320
364
|
if (data.key) {
|
|
321
|
-
var _data$
|
|
322
|
-
(_data$
|
|
365
|
+
var _data$replaceValue3;
|
|
366
|
+
(_data$replaceValue3 = data.replaceValue) == null || _data$replaceValue3.call(data, data.node);
|
|
323
367
|
}
|
|
324
368
|
}
|
|
325
369
|
}
|
|
370
|
+
if ((_data$node$expression = data.node.expressions) != null && _data$node$expression.some(expression => {
|
|
371
|
+
var _getObjectKey7, _getObjectKey8;
|
|
372
|
+
return ((_getObjectKey7 = (0, _migrateToVariants.getObjectKey)(expression)) == null ? void 0 : _getObjectKey7.name) === 'theme' || expression.type === 'CallExpression' && ((_getObjectKey8 = (0, _migrateToVariants.getObjectKey)(expression.callee)) == null ? void 0 : _getObjectKey8.name) === 'theme';
|
|
373
|
+
})) {
|
|
374
|
+
rootThemeCallback(data);
|
|
375
|
+
}
|
|
326
376
|
}
|
|
327
377
|
}
|
|
328
378
|
});
|
|
@@ -344,7 +394,7 @@ function sxV6(file, api, options) {
|
|
|
344
394
|
}
|
|
345
395
|
lines.push(line);
|
|
346
396
|
}
|
|
347
|
-
if (line.includes('sx=')) {
|
|
397
|
+
if (line.includes('sx=') && !line.match(/sx=\{\{[^}]+\}\}/)) {
|
|
348
398
|
isInStyled = true;
|
|
349
399
|
spaceMatch = line.match(/^\s+/);
|
|
350
400
|
}
|
|
@@ -38,4 +38,18 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
38
38
|
backgroundPosition: 'center',
|
|
39
39
|
backgroundImage: `url(${post.image})`
|
|
40
40
|
}
|
|
41
|
+
});
|
|
42
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(Chip, {
|
|
43
|
+
size: "sm",
|
|
44
|
+
variant: "outlined",
|
|
45
|
+
color: colors[data.role],
|
|
46
|
+
sx: {
|
|
47
|
+
ml: 'auto',
|
|
48
|
+
borderRadius: '2px',
|
|
49
|
+
minHeight: '20px',
|
|
50
|
+
paddingInline: '4px',
|
|
51
|
+
fontSize: 'xs',
|
|
52
|
+
bgcolor: `${colors[data.role]}.softBg`
|
|
53
|
+
},
|
|
54
|
+
children: data.role
|
|
41
55
|
});
|
|
@@ -3,54 +3,54 @@
|
|
|
3
3
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
|
|
5
5
|
sx: theme => ({
|
|
6
|
-
backgroundImage: "var(--items-
|
|
6
|
+
backgroundImage: "var(--imageDark-items-selectedItemIndex)",
|
|
7
7
|
...theme.applyStyles("light", {
|
|
8
|
-
backgroundImage: "var(--items-
|
|
8
|
+
backgroundImage: "var(--imageLight-items-selectedItemIndex)"
|
|
9
9
|
})
|
|
10
10
|
}),
|
|
11
11
|
style: {
|
|
12
|
-
"--items-
|
|
13
|
-
"--items-
|
|
12
|
+
"--imageLight-items-selectedItemIndex": items[selectedItemIndex].imageLight,
|
|
13
|
+
"--imageDark-items-selectedItemIndex": items[selectedItemIndex].imageDark
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
|
|
17
17
|
style: {
|
|
18
|
-
"--items-
|
|
19
|
-
"--items-
|
|
18
|
+
"--imageLight-items-selectedItemIndex": items[selectedItemIndex].imageLight,
|
|
19
|
+
"--imageDark-items-selectedItemIndex": items[selectedItemIndex].imageDark,
|
|
20
20
|
...props.style
|
|
21
21
|
},
|
|
22
22
|
sx: theme => ({
|
|
23
|
-
backgroundImage: "var(--items-
|
|
23
|
+
backgroundImage: "var(--imageDark-items-selectedItemIndex)",
|
|
24
24
|
...theme.applyStyles("light", {
|
|
25
|
-
backgroundImage: "var(--items-
|
|
25
|
+
backgroundImage: "var(--imageLight-items-selectedItemIndex)"
|
|
26
26
|
})
|
|
27
27
|
})
|
|
28
28
|
});
|
|
29
29
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
|
|
30
30
|
style: {
|
|
31
|
-
"--items-
|
|
32
|
-
"--items-
|
|
31
|
+
"--imageLight-items-selectedItemIndex": items[selectedItemIndex].imageLight,
|
|
32
|
+
"--imageDark-items-selectedItemIndex": items[selectedItemIndex].imageDark,
|
|
33
33
|
color: 'red',
|
|
34
34
|
...props.style
|
|
35
35
|
},
|
|
36
36
|
sx: theme => ({
|
|
37
|
-
backgroundImage: "var(--items-
|
|
37
|
+
backgroundImage: "var(--imageDark-items-selectedItemIndex)",
|
|
38
38
|
...theme.applyStyles("light", {
|
|
39
|
-
backgroundImage: "var(--items-
|
|
39
|
+
backgroundImage: "var(--imageLight-items-selectedItemIndex)"
|
|
40
40
|
})
|
|
41
41
|
})
|
|
42
42
|
});
|
|
43
43
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
|
|
44
44
|
...props,
|
|
45
45
|
sx: theme => ({
|
|
46
|
-
backgroundImage: "var(--items-
|
|
46
|
+
backgroundImage: "var(--imageDark-items-selectedItemIndex)",
|
|
47
47
|
...theme.applyStyles("light", {
|
|
48
|
-
backgroundImage: "var(--items-
|
|
48
|
+
backgroundImage: "var(--imageLight-items-selectedItemIndex)"
|
|
49
49
|
})
|
|
50
50
|
}),
|
|
51
51
|
style: {
|
|
52
|
-
"--items-
|
|
53
|
-
"--items-
|
|
52
|
+
"--imageLight-items-selectedItemIndex": items[selectedItemIndex].imageLight,
|
|
53
|
+
"--imageDark-items-selectedItemIndex": items[selectedItemIndex].imageDark,
|
|
54
54
|
...props.style
|
|
55
55
|
}
|
|
56
56
|
});
|
|
@@ -68,4 +68,21 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
68
68
|
style: {
|
|
69
69
|
"--post-image": post.image
|
|
70
70
|
}
|
|
71
|
+
});
|
|
72
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(Chip, {
|
|
73
|
+
size: "sm",
|
|
74
|
+
variant: "outlined",
|
|
75
|
+
color: colors[data.role],
|
|
76
|
+
sx: {
|
|
77
|
+
ml: 'auto',
|
|
78
|
+
borderRadius: '2px',
|
|
79
|
+
minHeight: '20px',
|
|
80
|
+
paddingInline: '4px',
|
|
81
|
+
fontSize: 'xs',
|
|
82
|
+
bgcolor: `${"var(--colors-data-role)"}.softBg`
|
|
83
|
+
},
|
|
84
|
+
style: {
|
|
85
|
+
"--colors-data-role": colors[data.role]
|
|
86
|
+
},
|
|
87
|
+
children: data.role
|
|
71
88
|
});
|
|
@@ -84,4 +84,24 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
84
84
|
display: 'none'
|
|
85
85
|
})
|
|
86
86
|
}]
|
|
87
|
-
});
|
|
87
|
+
});
|
|
88
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(Step, {
|
|
89
|
+
indicator: /*#__PURE__*/(0, _jsxRuntime.jsx)(StepIndicator, {
|
|
90
|
+
variant: activeStep <= index ? 'soft' : 'solid',
|
|
91
|
+
color: activeStep < index ? 'neutral' : 'primary',
|
|
92
|
+
children: activeStep <= index ? index + 1 : /*#__PURE__*/(0, _jsxRuntime.jsx)(Check, {})
|
|
93
|
+
}),
|
|
94
|
+
sx: {
|
|
95
|
+
'&:not([data-active])': {
|
|
96
|
+
'&::after': {
|
|
97
|
+
...(activeStep > index && index !== 2 && {
|
|
98
|
+
bgcolor: 'primary.solidBg'
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StepButton, {
|
|
104
|
+
onClick: () => setActiveStep(index),
|
|
105
|
+
children: step
|
|
106
|
+
})
|
|
107
|
+
}, step);
|
|
@@ -99,4 +99,22 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
99
99
|
}, open && {
|
|
100
100
|
display: 'none'
|
|
101
101
|
}]
|
|
102
|
-
});
|
|
102
|
+
});
|
|
103
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(Step, {
|
|
104
|
+
indicator: /*#__PURE__*/(0, _jsxRuntime.jsx)(StepIndicator, {
|
|
105
|
+
variant: activeStep <= index ? 'soft' : 'solid',
|
|
106
|
+
color: activeStep < index ? 'neutral' : 'primary',
|
|
107
|
+
children: activeStep <= index ? index + 1 : /*#__PURE__*/(0, _jsxRuntime.jsx)(Check, {})
|
|
108
|
+
}),
|
|
109
|
+
sx: [activeStep > index && index !== 2 && {
|
|
110
|
+
'&:not([data-active])': {
|
|
111
|
+
'&::after': {
|
|
112
|
+
bgcolor: 'primary.solidBg'
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}],
|
|
116
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StepButton, {
|
|
117
|
+
onClick: () => setActiveStep(index),
|
|
118
|
+
children: step
|
|
119
|
+
})
|
|
120
|
+
}, step);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = EnableColorOnDarkAppBar;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _AppBar = _interopRequireDefault(require("@mui/material/AppBar"));
|
|
10
|
+
var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
|
|
11
|
+
var _Toolbar = _interopRequireDefault(require("@mui/material/Toolbar"));
|
|
12
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
13
|
+
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
14
|
+
var _Menu = _interopRequireDefault(require("@mui/icons-material/Menu"));
|
|
15
|
+
var _styles = require("@mui/material/styles");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
var _MenuIcon;
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
+
function appBarLabel(label) {
|
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Toolbar.default, {
|
|
22
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
23
|
+
edge: "start",
|
|
24
|
+
color: "inherit",
|
|
25
|
+
"aria-label": "menu",
|
|
26
|
+
sx: {
|
|
27
|
+
mr: 2
|
|
28
|
+
},
|
|
29
|
+
children: _MenuIcon || (_MenuIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {}))
|
|
30
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
31
|
+
variant: "h6",
|
|
32
|
+
noWrap: true,
|
|
33
|
+
component: "div",
|
|
34
|
+
sx: {
|
|
35
|
+
flexGrow: 1
|
|
36
|
+
},
|
|
37
|
+
children: label
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const darkTheme = (0, _styles.createTheme)({
|
|
42
|
+
palette: {
|
|
43
|
+
mode: 'dark',
|
|
44
|
+
primary: {
|
|
45
|
+
main: '#1976d2'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
function EnableColorOnDarkAppBar() {
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Stack.default, {
|
|
51
|
+
spacing: 2,
|
|
52
|
+
sx: {
|
|
53
|
+
flexGrow: 1
|
|
54
|
+
},
|
|
55
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ThemeProvider, {
|
|
56
|
+
theme: darkTheme,
|
|
57
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_AppBar.default, {
|
|
58
|
+
position: "static",
|
|
59
|
+
color: "primary",
|
|
60
|
+
enableColorOnDark: true,
|
|
61
|
+
children: appBarLabel('enableColorOnDark')
|
|
62
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_AppBar.default, {
|
|
63
|
+
position: "static",
|
|
64
|
+
color: "primary",
|
|
65
|
+
children: appBarLabel('default')
|
|
66
|
+
})]
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = EnableColorOnDarkAppBar;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _AppBar = _interopRequireDefault(require("@mui/material/AppBar"));
|
|
10
|
+
var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
|
|
11
|
+
var _Toolbar = _interopRequireDefault(require("@mui/material/Toolbar"));
|
|
12
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
13
|
+
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
14
|
+
var _Menu = _interopRequireDefault(require("@mui/icons-material/Menu"));
|
|
15
|
+
var _styles = require("@mui/material/styles");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
var _MenuIcon;
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
+
function appBarLabel(label) {
|
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Toolbar.default, {
|
|
22
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
23
|
+
edge: "start",
|
|
24
|
+
color: "inherit",
|
|
25
|
+
"aria-label": "menu",
|
|
26
|
+
sx: {
|
|
27
|
+
mr: 2
|
|
28
|
+
},
|
|
29
|
+
children: _MenuIcon || (_MenuIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {}))
|
|
30
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
31
|
+
variant: "h6",
|
|
32
|
+
noWrap: true,
|
|
33
|
+
component: "div",
|
|
34
|
+
sx: {
|
|
35
|
+
flexGrow: 1
|
|
36
|
+
},
|
|
37
|
+
children: label
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const darkTheme = (0, _styles.createTheme)({
|
|
42
|
+
palette: {
|
|
43
|
+
mode: 'dark',
|
|
44
|
+
primary: {
|
|
45
|
+
main: '#1976d2'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
function EnableColorOnDarkAppBar() {
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Stack.default, {
|
|
51
|
+
spacing: 2,
|
|
52
|
+
sx: {
|
|
53
|
+
flexGrow: 1
|
|
54
|
+
},
|
|
55
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ThemeProvider, {
|
|
56
|
+
theme: darkTheme,
|
|
57
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_AppBar.default, {
|
|
58
|
+
position: "static",
|
|
59
|
+
color: "primary",
|
|
60
|
+
enableColorOnDark: true,
|
|
61
|
+
children: appBarLabel('enableColorOnDark')
|
|
62
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_AppBar.default, {
|
|
63
|
+
position: "static",
|
|
64
|
+
color: "primary",
|
|
65
|
+
children: appBarLabel('default')
|
|
66
|
+
})]
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
function FacebookCircularProgress(props) {
|
|
5
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Box, {
|
|
6
|
+
sx: {
|
|
7
|
+
position: 'relative'
|
|
8
|
+
},
|
|
9
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(CircularProgress, {
|
|
10
|
+
variant: "determinate",
|
|
11
|
+
sx: {
|
|
12
|
+
color: theme => theme.palette.grey[theme.palette.mode === 'light' ? 200 : 800]
|
|
13
|
+
},
|
|
14
|
+
size: 40,
|
|
15
|
+
thickness: 4,
|
|
16
|
+
...props,
|
|
17
|
+
value: 100
|
|
18
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(CircularProgress, {
|
|
19
|
+
variant: "indeterminate",
|
|
20
|
+
disableShrink: true,
|
|
21
|
+
sx: {
|
|
22
|
+
color: theme => theme.palette.mode === 'light' ? '#1a90ff' : '#308fe8',
|
|
23
|
+
animationDuration: '550ms',
|
|
24
|
+
position: 'absolute',
|
|
25
|
+
left: 0,
|
|
26
|
+
[`& .${circularProgressClasses.circle}`]: {
|
|
27
|
+
strokeLinecap: 'round'
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
size: 40,
|
|
31
|
+
thickness: 4,
|
|
32
|
+
...props
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(Paper, {
|
|
37
|
+
elevation: 0,
|
|
38
|
+
sx: {
|
|
39
|
+
display: 'flex',
|
|
40
|
+
border: theme => `1px solid ${theme.palette.divider}`,
|
|
41
|
+
flexWrap: 'wrap'
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(Divider, {
|
|
45
|
+
sx: {
|
|
46
|
+
border: theme => `1px solid ${theme.palette.mode === 'dark' ? '#fff' : '#000'}`
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
/*#__PURE__*/(0, _jsxRuntime.jsxs)(Typography, {
|
|
50
|
+
component: "span",
|
|
51
|
+
variant: "subtitle1",
|
|
52
|
+
color: "inherit",
|
|
53
|
+
sx: {
|
|
54
|
+
position: 'relative',
|
|
55
|
+
p: 4,
|
|
56
|
+
pt: 2,
|
|
57
|
+
pb: theme => `calc(${theme.spacing(1)} + 6px)`
|
|
58
|
+
},
|
|
59
|
+
children: [image.title, /*#__PURE__*/(0, _jsxRuntime.jsx)(ImageMarked, {
|
|
60
|
+
className: "MuiImageMarked-root"
|
|
61
|
+
})]
|
|
62
|
+
});
|
|
63
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(Autocomplete, {
|
|
64
|
+
sx: {
|
|
65
|
+
display: 'inline-block',
|
|
66
|
+
'& input': {
|
|
67
|
+
width: 200,
|
|
68
|
+
bgcolor: 'background.paper',
|
|
69
|
+
color: theme => theme.palette.getContrastText(theme.palette.background.paper)
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
id: "custom-input-demo",
|
|
73
|
+
options: options,
|
|
74
|
+
renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
75
|
+
ref: params.InputProps.ref,
|
|
76
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
77
|
+
type: "text",
|
|
78
|
+
...params.inputProps
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
|
|
83
|
+
sx: {
|
|
84
|
+
position: 'relative',
|
|
85
|
+
width: 400,
|
|
86
|
+
bgcolor: 'background.paper',
|
|
87
|
+
border: '2px solid #000',
|
|
88
|
+
boxShadow: theme => theme.shadows[5],
|
|
89
|
+
p: 4
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(Backdrop, {
|
|
93
|
+
sx: {
|
|
94
|
+
color: '#fff',
|
|
95
|
+
zIndex: theme => theme.zIndex.drawer + 1
|
|
96
|
+
},
|
|
97
|
+
open: open,
|
|
98
|
+
onClick: handleClose,
|
|
99
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CircularProgress, {
|
|
100
|
+
color: "inherit"
|
|
101
|
+
})
|
|
102
|
+
});
|