@mui/codemod 7.1.1 → 7.3.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +794 -0
  2. package/README.md +43 -0
  3. package/deprecations/all/deprecations-all.js +2 -0
  4. package/deprecations/dialog-props/dialog-props.js +40 -0
  5. package/deprecations/dialog-props/index.js +13 -0
  6. package/deprecations/dialog-props/test-cases/actual.js +47 -0
  7. package/deprecations/dialog-props/test-cases/expected.js +60 -0
  8. package/deprecations/dialog-props/test-cases/package.actual.js +47 -0
  9. package/deprecations/dialog-props/test-cases/package.expected.js +60 -0
  10. package/deprecations/dialog-props/test-cases/theme.actual.js +36 -0
  11. package/deprecations/dialog-props/test-cases/theme.expected.js +43 -0
  12. package/package.json +31 -17
  13. package/v5.0.0/top-level-imports.js +1 -1
  14. package/v5.0.0/top-level-imports.test/actual.js +2 -2
  15. package/v5.0.0/top-level-imports.test/expected.js +2 -0
  16. package/v7.0.0/theme-color-functions/index.js +13 -0
  17. package/v7.0.0/theme-color-functions/test-cases/actual.js +21 -0
  18. package/v7.0.0/theme-color-functions/test-cases/darken-basic.actual.js +20 -0
  19. package/v7.0.0/theme-color-functions/test-cases/darken-basic.expected.js +19 -0
  20. package/v7.0.0/theme-color-functions/test-cases/expected.js +20 -0
  21. package/v7.0.0/theme-color-functions/test-cases/lighten-basic.actual.js +13 -0
  22. package/v7.0.0/theme-color-functions/test-cases/lighten-basic.expected.js +12 -0
  23. package/v7.0.0/theme-color-functions/test-cases/mixed-functions.actual.js +17 -0
  24. package/v7.0.0/theme-color-functions/test-cases/mixed-functions.expected.js +16 -0
  25. package/v7.0.0/theme-color-functions/test-cases/mixed-imports.actual.js +19 -0
  26. package/v7.0.0/theme-color-functions/test-cases/mixed-imports.expected.js +18 -0
  27. package/v7.0.0/theme-color-functions/test-cases/mui-material-styles.actual.js +18 -0
  28. package/v7.0.0/theme-color-functions/test-cases/mui-material-styles.expected.js +17 -0
  29. package/v7.0.0/theme-color-functions/test-cases/no-import.actual.js +11 -0
  30. package/v7.0.0/theme-color-functions/test-cases/no-import.expected.js +11 -0
  31. package/v7.0.0/theme-color-functions/test-cases/opacity-calc.actual.js +57 -0
  32. package/v7.0.0/theme-color-functions/test-cases/opacity-calc.expected.js +56 -0
  33. package/v7.0.0/theme-color-functions/test-cases/opacity-var.actual.js +37 -0
  34. package/v7.0.0/theme-color-functions/test-cases/opacity-var.expected.js +36 -0
  35. package/v7.0.0/theme-color-functions/theme-color-functions.js +142 -0
package/README.md CHANGED
@@ -1083,6 +1083,28 @@ CSS transforms:
1083
1083
  npx @mui/codemod@latest deprecations/dialog-classes <path>
1084
1084
  ```
1085
1085
 
1086
+ #### `dialog-props`
1087
+
1088
+ JS transforms:
1089
+
1090
+ ```diff
1091
+ <Dialog
1092
+ - PaperProps={paperProps}
1093
+ + slotProps={{ paper: paperProps }}
1094
+ - TransitionComponent={CustomTransition}
1095
+ + slots={{ transition: CustomTransition }}
1096
+ - TransitionProps={CustomTransitionProps}
1097
+ + slotProps={{ transition: CustomTransitionProps }}
1098
+ />
1099
+ },
1100
+ },
1101
+ },
1102
+ ```
1103
+
1104
+ ```bash
1105
+ npx @mui/codemod@latest deprecations/dialog-props <path>
1106
+ ```
1107
+
1086
1108
  #### `drawer-classes`
1087
1109
 
1088
1110
  JS transforms:
@@ -2134,6 +2156,27 @@ npx @mui/codemod@latest deprecations/typography-props <path>
2134
2156
 
2135
2157
  ### v7.0.0
2136
2158
 
2159
+ #### `theme-color-functions`
2160
+
2161
+ ```bash
2162
+ npx @mui/codemod@latest v7.0.0/theme-color-functions <path>
2163
+ ```
2164
+
2165
+ Replace the usage of the `alpha()`, `lighten()`, and `darken()` functions from `@mui/system/colorManipulator` to use the `theme` object instead.
2166
+
2167
+ ```diff
2168
+ - import { alpha, lighten, darken } from '@mui/system/colorManipulator';
2169
+
2170
+ - alpha(theme.palette.primary.main, 0.8)
2171
+ + theme.alpha((theme.vars || theme).palette.primary.main, 0.8)
2172
+
2173
+ - lighten(theme.palette.primary.main, 0.1)
2174
+ + theme.lighten(theme.palette.primary.main, 0.1)
2175
+
2176
+ - darken(theme.palette.primary.main, 0.3)
2177
+ + theme.darken(theme.palette.primary.main, 0.3)
2178
+ ```
2179
+
2137
2180
  #### `grid-props`
2138
2181
 
2139
2182
  <!-- #npm-tag-reference -->
@@ -20,6 +20,7 @@ var _circularProgressClasses = _interopRequireDefault(require("../circular-progr
20
20
  var _dividerProps = _interopRequireDefault(require("../divider-props"));
21
21
  var _drawerClasses = _interopRequireDefault(require("../drawer-classes"));
22
22
  var _dialogClasses = _interopRequireDefault(require("../dialog-classes"));
23
+ var _dialogProps = _interopRequireDefault(require("../dialog-props"));
23
24
  var _filledInputProps = _interopRequireDefault(require("../filled-input-props"));
24
25
  var _formControlLabelProps = _interopRequireDefault(require("../form-control-label-props"));
25
26
  var _imageListItemBarClasses = _interopRequireDefault(require("../image-list-item-bar-classes"));
@@ -76,6 +77,7 @@ function deprecationsAll(file, api, options) {
76
77
  file.source = (0, _dividerProps.default)(file, api, options);
77
78
  file.source = (0, _drawerClasses.default)(file, api, options);
78
79
  file.source = (0, _dialogClasses.default)(file, api, options);
80
+ file.source = (0, _dialogProps.default)(file, api, options);
79
81
  file.source = (0, _filledInputProps.default)(file, api, options);
80
82
  file.source = (0, _formControlLabelProps.default)(file, api, options);
81
83
  file.source = (0, _imageListItemBarClasses.default)(file, api, options);
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = transformer;
8
+ var _movePropIntoSlots = _interopRequireDefault(require("../utils/movePropIntoSlots"));
9
+ var _movePropIntoSlotProps = _interopRequireDefault(require("../utils/movePropIntoSlotProps"));
10
+ /**
11
+ * @param {import('jscodeshift').FileInfo} file
12
+ * @param {import('jscodeshift').API} api
13
+ */
14
+ function transformer(file, api, options) {
15
+ const j = api.jscodeshift;
16
+ const root = j(file.source);
17
+ const printOptions = options.printOptions;
18
+ (0, _movePropIntoSlots.default)(j, {
19
+ root,
20
+ packageName: options.packageName,
21
+ componentName: 'Dialog',
22
+ propName: 'TransitionComponent',
23
+ slotName: 'transition'
24
+ });
25
+ (0, _movePropIntoSlotProps.default)(j, {
26
+ root,
27
+ packageName: options.packageName,
28
+ componentName: 'Dialog',
29
+ propName: 'TransitionProps',
30
+ slotName: 'transition'
31
+ });
32
+ (0, _movePropIntoSlotProps.default)(j, {
33
+ root,
34
+ packageName: options.packageName,
35
+ componentName: 'Dialog',
36
+ propName: 'PaperProps',
37
+ slotName: 'paper'
38
+ });
39
+ return root.toSource(printOptions);
40
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "default", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _dialogProps.default;
11
+ }
12
+ });
13
+ var _dialogProps = _interopRequireDefault(require("./dialog-props"));
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
5
+ var _material = require("@mui/material");
6
+ var _jsxRuntime = require("react/jsx-runtime");
7
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
8
+ TransitionComponent: CustomTransition,
9
+ TransitionProps: CustomTransitionProps,
10
+ PaperProps: PaperProps
11
+ });
12
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Dialog, {
13
+ TransitionComponent: CustomTransition,
14
+ TransitionProps: CustomTransitionProps,
15
+ PaperProps: PaperProps
16
+ });
17
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
18
+ TransitionComponent: CustomTransition,
19
+ TransitionProps: CustomTransitionProps,
20
+ slots: {
21
+ root: 'div'
22
+ },
23
+ PaperProps: PaperProps
24
+ });
25
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Dialog, {
26
+ TransitionComponent: CustomTransition,
27
+ TransitionProps: CustomTransitionProps,
28
+ slots: {
29
+ ...outerSlots
30
+ },
31
+ PaperProps: PaperProps
32
+ });
33
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
34
+ TransitionComponent: ComponentTransition,
35
+ TransitionProps: CustomTransitionProps,
36
+ slots: {
37
+ root: 'div',
38
+ transition: SlotTransition
39
+ },
40
+ PaperProps: PaperProps
41
+ });
42
+ // should skip non MUI components
43
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(NonMuiDialog, {
44
+ TransitionComponent: CustomTransition,
45
+ TransitionProps: CustomTransitionProps,
46
+ PaperProps: PaperProps
47
+ });
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
5
+ var _material = require("@mui/material");
6
+ var _jsxRuntime = require("react/jsx-runtime");
7
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
8
+ slots: {
9
+ transition: CustomTransition
10
+ },
11
+ slotProps: {
12
+ transition: CustomTransitionProps,
13
+ paper: PaperProps
14
+ }
15
+ });
16
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Dialog, {
17
+ slots: {
18
+ transition: CustomTransition
19
+ },
20
+ slotProps: {
21
+ transition: CustomTransitionProps,
22
+ paper: PaperProps
23
+ }
24
+ });
25
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
26
+ slots: {
27
+ root: 'div',
28
+ transition: CustomTransition
29
+ },
30
+ slotProps: {
31
+ transition: CustomTransitionProps,
32
+ paper: PaperProps
33
+ }
34
+ });
35
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Dialog, {
36
+ slots: {
37
+ ...outerSlots,
38
+ transition: CustomTransition
39
+ },
40
+ slotProps: {
41
+ transition: CustomTransitionProps,
42
+ paper: PaperProps
43
+ }
44
+ });
45
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
46
+ slots: {
47
+ root: 'div',
48
+ transition: SlotTransition
49
+ },
50
+ slotProps: {
51
+ transition: CustomTransitionProps,
52
+ paper: PaperProps
53
+ }
54
+ });
55
+ // should skip non MUI components
56
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(NonMuiDialog, {
57
+ TransitionComponent: CustomTransition,
58
+ TransitionProps: CustomTransitionProps,
59
+ PaperProps: PaperProps
60
+ });
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _Dialog = _interopRequireDefault(require("@org/ui/material/Dialog"));
5
+ var _material = require("@org/ui/material");
6
+ var _jsxRuntime = require("react/jsx-runtime");
7
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
8
+ TransitionComponent: CustomTransition,
9
+ TransitionProps: CustomTransitionProps,
10
+ PaperProps: PaperProps
11
+ });
12
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Dialog, {
13
+ TransitionComponent: CustomTransition,
14
+ TransitionProps: CustomTransitionProps,
15
+ PaperProps: PaperProps
16
+ });
17
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
18
+ TransitionComponent: CustomTransition,
19
+ TransitionProps: CustomTransitionProps,
20
+ slots: {
21
+ root: 'div'
22
+ },
23
+ PaperProps: PaperProps
24
+ });
25
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Dialog, {
26
+ TransitionComponent: CustomTransition,
27
+ TransitionProps: CustomTransitionProps,
28
+ slots: {
29
+ ...outerSlots
30
+ },
31
+ PaperProps: PaperProps
32
+ });
33
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
34
+ TransitionComponent: ComponentTransition,
35
+ TransitionProps: CustomTransitionProps,
36
+ slots: {
37
+ root: 'div',
38
+ transition: SlotTransition
39
+ },
40
+ PaperProps: PaperProps
41
+ });
42
+ // should skip non MUI components
43
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(NonMuiDialog, {
44
+ TransitionComponent: CustomTransition,
45
+ TransitionProps: CustomTransitionProps,
46
+ PaperProps: PaperProps
47
+ });
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _Dialog = _interopRequireDefault(require("@org/ui/material/Dialog"));
5
+ var _material = require("@org/ui/material");
6
+ var _jsxRuntime = require("react/jsx-runtime");
7
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
8
+ slots: {
9
+ transition: CustomTransition
10
+ },
11
+ slotProps: {
12
+ transition: CustomTransitionProps,
13
+ paper: PaperProps
14
+ }
15
+ });
16
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Dialog, {
17
+ slots: {
18
+ transition: CustomTransition
19
+ },
20
+ slotProps: {
21
+ transition: CustomTransitionProps,
22
+ paper: PaperProps
23
+ }
24
+ });
25
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
26
+ slots: {
27
+ root: 'div',
28
+ transition: CustomTransition
29
+ },
30
+ slotProps: {
31
+ transition: CustomTransitionProps,
32
+ paper: PaperProps
33
+ }
34
+ });
35
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Dialog, {
36
+ slots: {
37
+ ...outerSlots,
38
+ transition: CustomTransition
39
+ },
40
+ slotProps: {
41
+ transition: CustomTransitionProps,
42
+ paper: PaperProps
43
+ }
44
+ });
45
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
46
+ slots: {
47
+ root: 'div',
48
+ transition: SlotTransition
49
+ },
50
+ slotProps: {
51
+ transition: CustomTransitionProps,
52
+ paper: PaperProps
53
+ }
54
+ });
55
+ // should skip non MUI components
56
+ /*#__PURE__*/(0, _jsxRuntime.jsx)(NonMuiDialog, {
57
+ TransitionComponent: CustomTransition,
58
+ TransitionProps: CustomTransitionProps,
59
+ PaperProps: PaperProps
60
+ });
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ fn({
4
+ MuiDialog: {
5
+ defaultProps: {
6
+ TransitionComponent: CustomTransition,
7
+ TransitionProps: CustomTransitionProps,
8
+ PaperProps: PaperProps
9
+ }
10
+ }
11
+ });
12
+ fn({
13
+ MuiDialog: {
14
+ defaultProps: {
15
+ TransitionComponent: CustomTransition,
16
+ TransitionProps: CustomTransitionProps,
17
+ slots: {
18
+ root: 'div'
19
+ },
20
+ PaperProps: PaperProps
21
+ }
22
+ }
23
+ });
24
+ fn({
25
+ MuiDialog: {
26
+ defaultProps: {
27
+ TransitionComponent: ComponentTransition,
28
+ TransitionProps: CustomTransitionProps,
29
+ slots: {
30
+ root: 'div',
31
+ transition: SlotTransition
32
+ },
33
+ PaperProps: PaperProps
34
+ }
35
+ }
36
+ });
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ fn({
4
+ MuiDialog: {
5
+ defaultProps: {
6
+ slots: {
7
+ transition: CustomTransition
8
+ },
9
+ slotProps: {
10
+ transition: CustomTransitionProps,
11
+ paper: PaperProps
12
+ }
13
+ }
14
+ }
15
+ });
16
+ fn({
17
+ MuiDialog: {
18
+ defaultProps: {
19
+ slots: {
20
+ root: 'div',
21
+ transition: CustomTransition
22
+ },
23
+ slotProps: {
24
+ transition: CustomTransitionProps,
25
+ paper: PaperProps
26
+ }
27
+ }
28
+ }
29
+ });
30
+ fn({
31
+ MuiDialog: {
32
+ defaultProps: {
33
+ slots: {
34
+ root: 'div',
35
+ transition: SlotTransition
36
+ },
37
+ slotProps: {
38
+ transition: CustomTransitionProps,
39
+ paper: PaperProps
40
+ }
41
+ }
42
+ }
43
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/codemod",
3
- "version": "7.1.1",
3
+ "version": "7.3.0",
4
4
  "author": "MUI Team",
5
5
  "description": "Codemod scripts for Material UI.",
6
6
  "bin": "./codemod.js",
@@ -23,32 +23,46 @@
23
23
  "url": "https://opencollective.com/mui-org"
24
24
  },
25
25
  "dependencies": {
26
- "@babel/core": "^7.27.1",
27
- "@babel/runtime": "^7.27.1",
28
- "@babel/traverse": "^7.27.1",
26
+ "@babel/core": "^7.28.0",
27
+ "@babel/runtime": "^7.28.2",
28
+ "@babel/traverse": "^7.28.0",
29
29
  "jscodeshift": "^17.1.2",
30
30
  "jscodeshift-add-imports": "^1.0.11",
31
- "postcss": "^8.5.3",
31
+ "postcss": "^8.5.6",
32
32
  "postcss-cli": "^11.0.1",
33
33
  "yargs": "^17.7.2"
34
34
  },
35
- "devDependencies": {
36
- "@types/chai": "^4.3.20",
37
- "@types/jscodeshift": "0.12.0",
38
- "chai": "^4.5.0"
39
- },
40
35
  "sideEffects": false,
41
36
  "publishConfig": {
42
- "access": "public",
43
- "directory": "build"
37
+ "access": "public"
44
38
  },
45
39
  "engines": {
46
40
  "node": ">=14.0.0"
47
41
  },
48
- "scripts": {
49
- "test": "cd ../../ && cross-env NODE_ENV=test mocha 'packages/mui-codemod/**/*.test.?(c|m)[jt]s?(x)'",
50
- "prebuild": "rimraf build",
51
- "build": "node ../../scripts/build.mjs node --out-dir ./build && cpy README.md build && cpy package.json build && cpy codemod.js build",
52
- "release": "pnpm build && pnpm publish"
42
+ "private": false,
43
+ "exports": {
44
+ "./package.json": "./package.json",
45
+ ".": {
46
+ "require": {
47
+ "types": "./index.d.ts",
48
+ "default": "./index.js"
49
+ },
50
+ "import": {
51
+ "types": "./esm/index.d.ts",
52
+ "default": "./esm/index.js"
53
+ }
54
+ },
55
+ "./*": {
56
+ "require": {
57
+ "types": "./*/index.d.ts",
58
+ "default": "./*/index.js"
59
+ },
60
+ "import": {
61
+ "types": "./esm/*/index.d.ts",
62
+ "default": "./esm/*/index.js"
63
+ }
64
+ },
65
+ "./esm": null,
66
+ "./modern": null
53
67
  }
54
68
  }
@@ -62,7 +62,7 @@ function transformer(fileInfo, api, options) {
62
62
  break;
63
63
  }
64
64
  case 'ImportSpecifier':
65
- if (!whitelist.has(specifier.imported.name) == null && specifier.imported.name !== 'withStyles') {
65
+ if (!whitelist.has(specifier.imported.name) && specifier.imported.name !== 'withStyles') {
66
66
  return;
67
67
  }
68
68
  resultSpecifiers.push(specifier);
@@ -4,7 +4,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
5
  var React = _interopRequireWildcard(require("react"));
6
6
  var _styles = require("@mui/styles");
7
- var _material = require("@mui/material");
8
7
  var _styles2 = require("@mui/material/styles");
9
8
  var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
10
9
  var _Tab = _interopRequireDefault(require("@mui/material/Tab"));
@@ -59,4 +58,5 @@ var _Grow = _interopRequireDefault(require("@mui/material/Grow"));
59
58
  var _TableFooter = _interopRequireDefault(require("@mui/material/TableFooter"));
60
59
  var _Zoom = _interopRequireDefault(require("@mui/material/Zoom"));
61
60
  var _ClickAwayListener = _interopRequireDefault(require("@mui/material/ClickAwayListener"));
62
- var _ListSubheader = _interopRequireDefault(require("@mui/material/ListSubheader"));
61
+ var _ListSubheader = _interopRequireDefault(require("@mui/material/ListSubheader"));
62
+ var _colors = require("@mui/material/colors");
@@ -3,4 +3,6 @@
3
3
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
4
  var React = _interopRequireWildcard(require("react"));
5
5
  var _styles = require("@mui/styles");
6
+ var _styles2 = require("@mui/material/styles");
7
+ var _colors = require("@mui/material/colors");
6
8
  var _material = require("@mui/material");
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "default", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _themeColorFunctions.default;
11
+ }
12
+ });
13
+ var _themeColorFunctions = _interopRequireDefault(require("./theme-color-functions"));
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var _colorManipulator = require("@mui/system/colorManipulator");
4
+ const Value = styled('div')(({
5
+ theme
6
+ }) => ({
7
+ width: '100%',
8
+ height: '100%',
9
+ lineHeight: '100%',
10
+ paddingRight: 8,
11
+ fontVariantNumeric: 'tabular-nums',
12
+ display: 'flex',
13
+ alignItems: 'center',
14
+ justifyContent: 'flex-end',
15
+ '&.good': {
16
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.success.mainChannel} / 0.3)` : (0, _colorManipulator.alpha)(theme.palette.success.main, 0.3)
17
+ },
18
+ '&.bad': {
19
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.error.mainChannel} / 0.3)` : (0, _colorManipulator.alpha)(theme.palette.error.main, 0.3)
20
+ }
21
+ }));
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ var _colorManipulator = require("@mui/system/colorManipulator");
4
+ const Button = styled('button')(({
5
+ theme
6
+ }) => ({
7
+ backgroundColor: (0, _colorManipulator.darken)(theme.palette.primary.main, 0.1),
8
+ '&:active': {
9
+ backgroundColor: (0, _colorManipulator.darken)(theme.palette.primary.main, 0.3)
10
+ },
11
+ '&:disabled': {
12
+ backgroundColor: (0, _colorManipulator.darken)(theme.palette.action.disabled, 0.1)
13
+ }
14
+ }));
15
+ const Card = styled('div')(({
16
+ theme
17
+ }) => ({
18
+ boxShadow: `0 2px 4px ${(0, _colorManipulator.darken)(theme.palette.background.paper, 0.15)}`,
19
+ borderColor: (0, _colorManipulator.darken)(theme.palette.divider, 0.2)
20
+ }));
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ const Button = styled('button')(({
4
+ theme
5
+ }) => ({
6
+ backgroundColor: theme.darken(theme.palette.primary.main, 0.1),
7
+ '&:active': {
8
+ backgroundColor: theme.darken(theme.palette.primary.main, 0.3)
9
+ },
10
+ '&:disabled': {
11
+ backgroundColor: theme.darken(theme.palette.action.disabled, 0.1)
12
+ }
13
+ }));
14
+ const Card = styled('div')(({
15
+ theme
16
+ }) => ({
17
+ boxShadow: `0 2px 4px ${theme.darken(theme.palette.background.paper, 0.15)}`,
18
+ borderColor: theme.darken(theme.palette.divider, 0.2)
19
+ }));
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ const Value = styled('div')(({
4
+ theme
5
+ }) => ({
6
+ width: '100%',
7
+ height: '100%',
8
+ lineHeight: '100%',
9
+ paddingRight: 8,
10
+ fontVariantNumeric: 'tabular-nums',
11
+ display: 'flex',
12
+ alignItems: 'center',
13
+ justifyContent: 'flex-end',
14
+ '&.good': {
15
+ backgroundColor: theme.alpha((theme.vars || theme).palette.success.main, 0.3)
16
+ },
17
+ '&.bad': {
18
+ backgroundColor: theme.alpha((theme.vars || theme).palette.error.main, 0.3)
19
+ }
20
+ }));
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _colorManipulator = require("@mui/system/colorManipulator");
4
+ const Component = styled('div')(({
5
+ theme
6
+ }) => ({
7
+ backgroundColor: (0, _colorManipulator.lighten)(theme.palette.primary.main, 0.2),
8
+ color: (0, _colorManipulator.lighten)(theme.palette.text.primary, 0.5),
9
+ border: `1px solid ${(0, _colorManipulator.lighten)(theme.palette.divider, 0.1)}`,
10
+ '&:hover': {
11
+ backgroundColor: (0, _colorManipulator.lighten)(theme.palette.primary.dark, 0.3)
12
+ }
13
+ }));
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ const Component = styled('div')(({
4
+ theme
5
+ }) => ({
6
+ backgroundColor: theme.lighten(theme.palette.primary.main, 0.2),
7
+ color: theme.lighten(theme.palette.text.primary, 0.5),
8
+ border: `1px solid ${theme.lighten(theme.palette.divider, 0.1)}`,
9
+ '&:hover': {
10
+ backgroundColor: theme.lighten(theme.palette.primary.dark, 0.3)
11
+ }
12
+ }));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ var _colorManipulator = require("@mui/system/colorManipulator");
4
+ const ComplexComponent = styled('div')(({
5
+ theme
6
+ }) => ({
7
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / 0.1)` : (0, _colorManipulator.alpha)(theme.palette.primary.main, 0.1),
8
+ border: `2px solid ${(0, _colorManipulator.lighten)(theme.palette.primary.main, 0.5)}`,
9
+ '&:hover': {
10
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / 0.2)` : (0, _colorManipulator.alpha)(theme.palette.primary.main, 0.2),
11
+ borderColor: (0, _colorManipulator.darken)(theme.palette.primary.main, 0.2)
12
+ },
13
+ '&:active': {
14
+ backgroundColor: (0, _colorManipulator.darken)(theme.palette.primary.dark, 0.1),
15
+ color: (0, _colorManipulator.lighten)(theme.palette.primary.contrastText, 0.3)
16
+ }
17
+ }));