@mui/codemod 6.0.0-alpha.10 → 6.0.0-alpha.12

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 (33) hide show
  1. package/README.md +255 -180
  2. package/codemod.js +0 -2
  3. package/node/deprecations/all/deprecations-all.js +4 -0
  4. package/node/deprecations/all/postcss.config.js +7 -1
  5. package/node/deprecations/tab-classes/index.js +13 -0
  6. package/node/deprecations/tab-classes/postcss-plugin.js +30 -0
  7. package/node/deprecations/tab-classes/postcss.config.js +8 -0
  8. package/node/deprecations/tab-classes/tab-classes.js +53 -0
  9. package/node/deprecations/tab-classes/test-cases/actual.js +5 -0
  10. package/node/deprecations/tab-classes/test-cases/expected.js +5 -0
  11. package/node/deprecations/table-sort-label-classes/index.js +13 -0
  12. package/node/deprecations/table-sort-label-classes/postcss-plugin.js +33 -0
  13. package/node/deprecations/table-sort-label-classes/postcss.config.js +8 -0
  14. package/node/deprecations/table-sort-label-classes/table-sort-label-classes.js +77 -0
  15. package/node/deprecations/table-sort-label-classes/test-cases/actual.js +7 -0
  16. package/node/deprecations/table-sort-label-classes/test-cases/expected.js +7 -0
  17. package/node/util/migrateToVariants.js +91 -43
  18. package/node/v6.0.0/styled/test-cases/ConditionalStyled.expected.js +9 -22
  19. package/node/v6.0.0/styled/test-cases/DynamicPropsStyled.actual.js +39 -0
  20. package/node/v6.0.0/styled/test-cases/DynamicPropsStyled.expected.js +65 -0
  21. package/node/v6.0.0/styled/test-cases/LogicalStyled.actual.js +31 -1
  22. package/node/v6.0.0/styled/test-cases/LogicalStyled.expected.js +39 -1
  23. package/node/v6.0.0/styled/test-cases/NestedSpread.expected.js +11 -13
  24. package/node/v6.0.0/sx-prop/sx-v6.js +80 -30
  25. package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.actual.js +14 -0
  26. package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.expected.js +33 -16
  27. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.actual.js +21 -1
  28. package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.expected.js +19 -1
  29. package/node/v6.0.0/sx-prop/test-cases/sx-line-break.actual.js +69 -0
  30. package/node/v6.0.0/sx-prop/test-cases/sx-line-break.expected.js +69 -0
  31. package/node/v6.0.0/sx-prop/test-cases/sx-value-callback.actual.js +102 -0
  32. package/node/v6.0.0/sx-prop/test-cases/sx-value-callback.expected.js +111 -0
  33. package/package.json +5 -5
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _styles = require("@mui/material/styles");
8
+ const DemoToolbarRoot = (0, _styles.styled)('div', {
9
+ shouldForwardProp: prop => prop !== 'demoOptions' && prop !== 'openDemoSource'
10
+ })(({
11
+ theme
12
+ }) => [{
13
+ display: 'none',
14
+ [theme.breakpoints.up('sm')]: {
15
+ top: 0,
16
+ maxHeight: 50,
17
+ display: 'block',
18
+ marginTop: -1,
19
+ padding: theme.spacing(0.5, 1),
20
+ border: `1px solid ${(theme.vars || theme).palette.divider}`,
21
+ borderTopWidth: 0,
22
+ backgroundColor: (0, _styles.alpha)(theme.palette.grey[50], 0.2),
23
+ borderRadius: '0 0 12px 12px',
24
+ transition: theme.transitions.create('border-radius'),
25
+ ...theme.applyStyles("rtl", {
26
+ left: theme.spacing(1)
27
+ }),
28
+ ...theme.applyStyles("rtl", {
29
+ right: theme.spacing(1)
30
+ })
31
+ },
32
+ variants: [{
33
+ props: {
34
+ bg: 'inline'
35
+ },
36
+ style: {
37
+ [theme.breakpoints.up('sm')]: {
38
+ marginTop: theme.spacing(1)
39
+ }
40
+ }
41
+ }, {
42
+ props: {
43
+ bg: 'inline'
44
+ },
45
+ style: {
46
+ [theme.breakpoints.up('sm')]: {
47
+ borderTopWidth: 1
48
+ }
49
+ }
50
+ }, {
51
+ props: ({
52
+ openDemoSource
53
+ }) => openDemoSource,
54
+ style: {
55
+ [theme.breakpoints.up('sm')]: {
56
+ borderRadius: 0
57
+ }
58
+ }
59
+ }]
60
+ }, theme.applyDarkStyles({
61
+ [theme.breakpoints.up('sm')]: {
62
+ backgroundColor: (0, _styles.alpha)(theme.palette.primaryDark[800], 0.2)
63
+ }
64
+ })]);
65
+ var _default = exports.default = DemoToolbarRoot;
@@ -25,4 +25,34 @@ const ToolbarRoot = styled('div', {
25
25
  disabled
26
26
  }) => ownerState.variant !== 'regular' && !disabled && theme.mixins.toolbar4, ({
27
27
  theme
28
- }) => theme.vars && theme.mixins.toolbar5);
28
+ }) => theme.vars && theme.mixins.toolbar5);
29
+ const ToggleButton = styled('button')(({
30
+ theme,
31
+ 'aria-pressed': pressed = 'false'
32
+ }) => ({
33
+ padding: '0.5rem 1rem',
34
+ borderRadius: theme.vars.radius.sm,
35
+ display: 'inline-flex',
36
+ justifyContent: 'center',
37
+ gap: '8px',
38
+ minHeight: 40,
39
+ fontFamily: theme.vars.fontFamily.body,
40
+ fontSize: theme.vars.fontSize.md,
41
+ fontWeight: theme.vars.fontWeight.md,
42
+ alignItems: 'center',
43
+ border: '1px solid',
44
+ borderColor: theme.vars.palette.neutral.outlinedBorder,
45
+ backgroundColor: theme.vars.palette.background.body,
46
+ boxShadow: theme.vars.shadow.md,
47
+ [theme.focus.selector]: theme.focus.default,
48
+ ...theme.variants.plain.neutral,
49
+ ...(pressed === 'false' && {
50
+ '&:hover': theme.variants.plainHover.neutral,
51
+ '&:active': theme.variants.plainActive.neutral
52
+ }),
53
+ ...(pressed === 'true' && {
54
+ color: theme.vars.palette.danger.plainColor,
55
+ backgroundColor: theme.vars.palette.background.body,
56
+ boxShadow: theme.shadow.sm.replace(/,/g, ', inset')
57
+ })
58
+ }));
@@ -49,4 +49,42 @@ const ToolbarRoot = styled('div', {
49
49
  }]
50
50
  }), ({
51
51
  theme
52
- }) => theme.vars && theme.mixins.toolbar5);
52
+ }) => theme.vars && theme.mixins.toolbar5);
53
+ const ToggleButton = styled('button')(({
54
+ theme
55
+ }) => ({
56
+ padding: '0.5rem 1rem',
57
+ borderRadius: theme.vars.radius.sm,
58
+ display: 'inline-flex',
59
+ justifyContent: 'center',
60
+ gap: '8px',
61
+ minHeight: 40,
62
+ fontFamily: theme.vars.fontFamily.body,
63
+ fontSize: theme.vars.fontSize.md,
64
+ fontWeight: theme.vars.fontWeight.md,
65
+ alignItems: 'center',
66
+ border: '1px solid',
67
+ borderColor: theme.vars.palette.neutral.outlinedBorder,
68
+ backgroundColor: theme.vars.palette.background.body,
69
+ boxShadow: theme.vars.shadow.md,
70
+ [theme.focus.selector]: theme.focus.default,
71
+ ...theme.variants.plain.neutral,
72
+ variants: [{
73
+ props: {
74
+ "aria-pressed": 'false'
75
+ },
76
+ style: {
77
+ '&:hover': theme.variants.plainHover.neutral,
78
+ '&:active': theme.variants.plainActive.neutral
79
+ }
80
+ }, {
81
+ props: {
82
+ "aria-pressed": 'true'
83
+ },
84
+ style: {
85
+ color: theme.vars.palette.danger.plainColor,
86
+ backgroundColor: theme.vars.palette.background.body,
87
+ boxShadow: theme.shadow.sm.replace(/,/g, ', inset')
88
+ }
89
+ }]
90
+ }));
@@ -25,6 +25,13 @@ const Component = styled('div')(({
25
25
  }
26
26
  }
27
27
  }
28
+ }, {
29
+ props: {
30
+ edge: 'start'
31
+ },
32
+ style: {
33
+ marginLeft: -12
34
+ }
28
35
  }, {
29
36
  props: {
30
37
  edge: 'start',
@@ -34,12 +41,11 @@ const Component = styled('div')(({
34
41
  marginLeft: -3
35
42
  }
36
43
  }, {
37
- props: ({
38
- edge,
39
- ownerState
40
- }) => edge === 'start' && ownerState.size !== 'small',
44
+ props: {
45
+ edge: 'end'
46
+ },
41
47
  style: {
42
- marginLeft: -12
48
+ marginRight: -12
43
49
  }
44
50
  }, {
45
51
  props: {
@@ -49,14 +55,6 @@ const Component = styled('div')(({
49
55
  style: {
50
56
  marginRight: -3
51
57
  }
52
- }, {
53
- props: ({
54
- edge,
55
- ownerState
56
- }) => edge === 'end' && ownerState.size !== 'small',
57
- style: {
58
- marginRight: -12
59
- }
60
58
  }, {
61
59
  props: ({
62
60
  ownerState
@@ -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
- 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}`;
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
- return '';
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
- recurseObjectExpression({
125
- ...data,
126
- node: returnExpression
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 _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;
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$replaceValue;
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$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
- }
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$replaceValue2;
322
- (_data$replaceValue2 = data.replaceValue) == null || _data$replaceValue2.call(data, data.node);
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-imageDark)",
6
+ backgroundImage: "var(--imageDark-items-selectedItemIndex)",
7
7
  ...theme.applyStyles("light", {
8
- backgroundImage: "var(--items-imageLight)"
8
+ backgroundImage: "var(--imageLight-items-selectedItemIndex)"
9
9
  })
10
10
  }),
11
11
  style: {
12
- "--items-imageLight": items[selectedItemIndex].imageLight,
13
- "--items-imageDark": items[selectedItemIndex].imageDark
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-imageLight": items[selectedItemIndex].imageLight,
19
- "--items-imageDark": items[selectedItemIndex].imageDark,
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-imageDark)",
23
+ backgroundImage: "var(--imageDark-items-selectedItemIndex)",
24
24
  ...theme.applyStyles("light", {
25
- backgroundImage: "var(--items-imageLight)"
25
+ backgroundImage: "var(--imageLight-items-selectedItemIndex)"
26
26
  })
27
27
  })
28
28
  });
29
29
  /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
30
30
  style: {
31
- "--items-imageLight": items[selectedItemIndex].imageLight,
32
- "--items-imageDark": items[selectedItemIndex].imageDark,
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-imageDark)",
37
+ backgroundImage: "var(--imageDark-items-selectedItemIndex)",
38
38
  ...theme.applyStyles("light", {
39
- backgroundImage: "var(--items-imageLight)"
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-imageDark)",
46
+ backgroundImage: "var(--imageDark-items-selectedItemIndex)",
47
47
  ...theme.applyStyles("light", {
48
- backgroundImage: "var(--items-imageLight)"
48
+ backgroundImage: "var(--imageLight-items-selectedItemIndex)"
49
49
  })
50
50
  }),
51
51
  style: {
52
- "--items-imageLight": items[selectedItemIndex].imageLight,
53
- "--items-imageDark": items[selectedItemIndex].imageDark,
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
+ }