@mui/codemod 7.2.0 → 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 (26) hide show
  1. package/CHANGELOG.md +794 -0
  2. package/README.md +21 -0
  3. package/package.json +30 -16
  4. package/v5.0.0/top-level-imports.js +1 -1
  5. package/v5.0.0/top-level-imports.test/actual.js +2 -2
  6. package/v5.0.0/top-level-imports.test/expected.js +2 -0
  7. package/v7.0.0/theme-color-functions/index.js +13 -0
  8. package/v7.0.0/theme-color-functions/test-cases/actual.js +21 -0
  9. package/v7.0.0/theme-color-functions/test-cases/darken-basic.actual.js +20 -0
  10. package/v7.0.0/theme-color-functions/test-cases/darken-basic.expected.js +19 -0
  11. package/v7.0.0/theme-color-functions/test-cases/expected.js +20 -0
  12. package/v7.0.0/theme-color-functions/test-cases/lighten-basic.actual.js +13 -0
  13. package/v7.0.0/theme-color-functions/test-cases/lighten-basic.expected.js +12 -0
  14. package/v7.0.0/theme-color-functions/test-cases/mixed-functions.actual.js +17 -0
  15. package/v7.0.0/theme-color-functions/test-cases/mixed-functions.expected.js +16 -0
  16. package/v7.0.0/theme-color-functions/test-cases/mixed-imports.actual.js +19 -0
  17. package/v7.0.0/theme-color-functions/test-cases/mixed-imports.expected.js +18 -0
  18. package/v7.0.0/theme-color-functions/test-cases/mui-material-styles.actual.js +18 -0
  19. package/v7.0.0/theme-color-functions/test-cases/mui-material-styles.expected.js +17 -0
  20. package/v7.0.0/theme-color-functions/test-cases/no-import.actual.js +11 -0
  21. package/v7.0.0/theme-color-functions/test-cases/no-import.expected.js +11 -0
  22. package/v7.0.0/theme-color-functions/test-cases/opacity-calc.actual.js +57 -0
  23. package/v7.0.0/theme-color-functions/test-cases/opacity-calc.expected.js +56 -0
  24. package/v7.0.0/theme-color-functions/test-cases/opacity-var.actual.js +37 -0
  25. package/v7.0.0/theme-color-functions/test-cases/opacity-var.expected.js +36 -0
  26. package/v7.0.0/theme-color-functions/theme-color-functions.js +142 -0
package/README.md CHANGED
@@ -2156,6 +2156,27 @@ npx @mui/codemod@latest deprecations/typography-props <path>
2156
2156
 
2157
2157
  ### v7.0.0
2158
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
+
2159
2180
  #### `grid-props`
2160
2181
 
2161
2182
  <!-- #npm-tag-reference -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/codemod",
3
- "version": "7.2.0",
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.4",
27
- "@babel/runtime": "^7.27.6",
28
- "@babel/traverse": "^7.27.4",
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
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
+ }));
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ const ComplexComponent = styled('div')(({
4
+ theme
5
+ }) => ({
6
+ backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, 0.1),
7
+ border: `2px solid ${theme.lighten(theme.palette.primary.main, 0.5)}`,
8
+ '&:hover': {
9
+ backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, 0.2),
10
+ borderColor: theme.darken(theme.palette.primary.main, 0.2)
11
+ },
12
+ '&:active': {
13
+ backgroundColor: theme.darken(theme.palette.primary.dark, 0.1),
14
+ color: theme.lighten(theme.palette.primary.contrastText, 0.3)
15
+ }
16
+ }));
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Component = void 0;
7
+ var _colorManipulator = require("@mui/system/colorManipulator");
8
+ var _styles = require("@mui/material/styles");
9
+ const Component = exports.Component = (0, _styles.styled)('div')(({
10
+ theme
11
+ }) => ({
12
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / 0.5)` : (0, _colorManipulator.alpha)(theme.palette.primary.main, 0.5),
13
+ '&:hover': {
14
+ backgroundColor: (0, _styles.lighten)(theme.palette.primary.main, 0.2)
15
+ },
16
+ '&:active': {
17
+ backgroundColor: (0, _styles.darken)(theme.palette.primary.main, 0.2)
18
+ }
19
+ }));
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Component = void 0;
7
+ var _styles = require("@mui/material/styles");
8
+ const Component = exports.Component = (0, _styles.styled)('div')(({
9
+ theme
10
+ }) => ({
11
+ backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, 0.5),
12
+ '&:hover': {
13
+ backgroundColor: theme.lighten(theme.palette.primary.main, 0.2)
14
+ },
15
+ '&:active': {
16
+ backgroundColor: theme.darken(theme.palette.primary.main, 0.2)
17
+ }
18
+ }));
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Component = void 0;
7
+ var _styles = require("@mui/material/styles");
8
+ const Component = exports.Component = styled('div')(({
9
+ theme
10
+ }) => ({
11
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / 0.5)` : (0, _styles.alpha)(theme.palette.primary.main, 0.5),
12
+ '&:hover': {
13
+ backgroundColor: (0, _styles.lighten)(theme.palette.primary.main, 0.2)
14
+ },
15
+ '&:active': {
16
+ backgroundColor: (0, _styles.darken)(theme.palette.primary.main, 0.2)
17
+ }
18
+ }));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Component = void 0;
7
+ const Component = exports.Component = styled('div')(({
8
+ theme
9
+ }) => ({
10
+ backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, 0.5),
11
+ '&:hover': {
12
+ backgroundColor: theme.lighten(theme.palette.primary.main, 0.2)
13
+ },
14
+ '&:active': {
15
+ backgroundColor: theme.darken(theme.palette.primary.main, 0.2)
16
+ }
17
+ }));
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ // This file should not be transformed because it doesn't import from @mui/system/colorManipulator
4
+
5
+ const Component = styled('div')(({
6
+ theme
7
+ }) => ({
8
+ backgroundColor: alpha(theme.palette.primary.main, 0.1),
9
+ color: lighten(theme.palette.text.primary, 0.5),
10
+ border: `1px solid ${darken(theme.palette.divider, 0.2)}`
11
+ }));
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ // This file should not be transformed because it doesn't import from @mui/system/colorManipulator
4
+
5
+ const Component = styled('div')(({
6
+ theme
7
+ }) => ({
8
+ backgroundColor: alpha(theme.palette.primary.main, 0.1),
9
+ color: lighten(theme.palette.text.primary, 0.5),
10
+ border: `1px solid ${darken(theme.palette.divider, 0.2)}`
11
+ }));
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TreeItemContent = void 0;
7
+ var _colorManipulator = require("@mui/system/colorManipulator");
8
+ const TreeItemContent = exports.TreeItemContent = styled('div', {
9
+ name: 'MuiTreeItem',
10
+ slot: 'Content',
11
+ overridesResolver: (props, styles) => styles.content,
12
+ shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'status'
13
+ }) < {
14
+ status: UseTreeItemStatus
15
+ } > (({
16
+ theme
17
+ }) => ({
18
+ padding: theme.spacing(0.5, 1),
19
+ paddingLeft: `calc(${theme.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`,
20
+ borderRadius: theme.shape.borderRadius,
21
+ width: '100%',
22
+ boxSizing: 'border-box',
23
+ // prevent width + padding to overflow
24
+ position: 'relative',
25
+ display: 'flex',
26
+ alignItems: 'center',
27
+ gap: theme.spacing(1),
28
+ cursor: 'pointer',
29
+ WebkitTapHighlightColor: 'transparent',
30
+ '&:hover': {
31
+ backgroundColor: (theme.vars || theme).palette.action.hover,
32
+ // Reset on touch devices, it doesn't add specificity
33
+ '@media (hover: none)': {
34
+ backgroundColor: 'transparent'
35
+ }
36
+ },
37
+ '&[data-disabled]': {
38
+ opacity: (theme.vars || theme).palette.action.disabledOpacity,
39
+ backgroundColor: 'transparent'
40
+ },
41
+ '&[data-focused]': {
42
+ backgroundColor: (theme.vars || theme).palette.action.focus
43
+ },
44
+ '&[data-selected]': {
45
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : (0, _colorManipulator.alpha)(theme.palette.primary.main, theme.palette.action.selectedOpacity),
46
+ '&:hover': {
47
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / calc(${theme.vars.palette.action.selectedOpacity} + ${theme.vars.palette.action.hoverOpacity}))` : (0, _colorManipulator.alpha)(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity),
48
+ // Reset on touch devices, it doesn't add specificity
49
+ '@media (hover: none)': {
50
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : (0, _colorManipulator.alpha)(theme.palette.primary.main, theme.palette.action.selectedOpacity)
51
+ }
52
+ }
53
+ },
54
+ '&[data-selected][data-focused]': {
55
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / calc(${theme.vars.palette.action.selectedOpacity} + ${theme.vars.palette.action.focusOpacity}))` : (0, _colorManipulator.alpha)(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)
56
+ }
57
+ }));
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TreeItemContent = void 0;
7
+ const TreeItemContent = exports.TreeItemContent = styled('div', {
8
+ name: 'MuiTreeItem',
9
+ slot: 'Content',
10
+ overridesResolver: (props, styles) => styles.content,
11
+ shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'status'
12
+ }) < {
13
+ status: UseTreeItemStatus
14
+ } > (({
15
+ theme
16
+ }) => ({
17
+ padding: theme.spacing(0.5, 1),
18
+ paddingLeft: `calc(${theme.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`,
19
+ borderRadius: theme.shape.borderRadius,
20
+ width: '100%',
21
+ boxSizing: 'border-box',
22
+ // prevent width + padding to overflow
23
+ position: 'relative',
24
+ display: 'flex',
25
+ alignItems: 'center',
26
+ gap: theme.spacing(1),
27
+ cursor: 'pointer',
28
+ WebkitTapHighlightColor: 'transparent',
29
+ '&:hover': {
30
+ backgroundColor: (theme.vars || theme).palette.action.hover,
31
+ // Reset on touch devices, it doesn't add specificity
32
+ '@media (hover: none)': {
33
+ backgroundColor: 'transparent'
34
+ }
35
+ },
36
+ '&[data-disabled]': {
37
+ opacity: (theme.vars || theme).palette.action.disabledOpacity,
38
+ backgroundColor: 'transparent'
39
+ },
40
+ '&[data-focused]': {
41
+ backgroundColor: (theme.vars || theme).palette.action.focus
42
+ },
43
+ '&[data-selected]': {
44
+ backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, (theme.vars || theme).palette.action.selectedOpacity),
45
+ '&:hover': {
46
+ backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.hoverOpacity}`),
47
+ // Reset on touch devices, it doesn't add specificity
48
+ '@media (hover: none)': {
49
+ backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, (theme.vars || theme).palette.action.selectedOpacity)
50
+ }
51
+ }
52
+ },
53
+ '&[data-selected][data-focused]': {
54
+ backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.focusOpacity}`)
55
+ }
56
+ }));
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DigitalClockItem = void 0;
7
+ var _colorManipulator = require("@mui/system/colorManipulator");
8
+ const DigitalClockItem = exports.DigitalClockItem = styled(MenuItem, {
9
+ name: 'MuiDigitalClock',
10
+ slot: 'Item',
11
+ shouldForwardProp: prop => prop !== 'itemValue' && prop !== 'formattedValue',
12
+ overridesResolver: (props, styles) => styles.item
13
+ })(({
14
+ theme
15
+ }) => ({
16
+ padding: '8px 16px',
17
+ margin: '2px 4px',
18
+ '&:first-of-type': {
19
+ marginTop: 4
20
+ },
21
+ '&:hover': {
22
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)(theme.palette.primary.main, theme.palette.action.hoverOpacity)
23
+ },
24
+ '&.Mui-selected': {
25
+ backgroundColor: (theme.vars || theme).palette.primary.main,
26
+ color: (theme.vars || theme).palette.primary.contrastText,
27
+ '&:focus-visible, &:hover': {
28
+ backgroundColor: (theme.vars || theme).palette.primary.dark
29
+ }
30
+ },
31
+ '&.Mui-focusVisible': {
32
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.focusOpacity})` : (0, _colorManipulator.alpha)(theme.palette.primary.main, theme.palette.action.focusOpacity)
33
+ }
34
+ }));
35
+ function transform(t) {
36
+ const backgroundBackdrop = t.vars ? `rgba(${t.vars.palette.background.defaultChannel} / ${t.vars.palette.action.disabledOpacity})` : (0, _colorManipulator.alpha)(t.palette.background.default, t.palette.action.disabledOpacity);
37
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DigitalClockItem = void 0;
7
+ const DigitalClockItem = exports.DigitalClockItem = styled(MenuItem, {
8
+ name: 'MuiDigitalClock',
9
+ slot: 'Item',
10
+ shouldForwardProp: prop => prop !== 'itemValue' && prop !== 'formattedValue',
11
+ overridesResolver: (props, styles) => styles.item
12
+ })(({
13
+ theme
14
+ }) => ({
15
+ padding: '8px 16px',
16
+ margin: '2px 4px',
17
+ '&:first-of-type': {
18
+ marginTop: 4
19
+ },
20
+ '&:hover': {
21
+ backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, (theme.vars || theme).palette.action.hoverOpacity)
22
+ },
23
+ '&.Mui-selected': {
24
+ backgroundColor: (theme.vars || theme).palette.primary.main,
25
+ color: (theme.vars || theme).palette.primary.contrastText,
26
+ '&:focus-visible, &:hover': {
27
+ backgroundColor: (theme.vars || theme).palette.primary.dark
28
+ }
29
+ },
30
+ '&.Mui-focusVisible': {
31
+ backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, (theme.vars || theme).palette.action.focusOpacity)
32
+ }
33
+ }));
34
+ function transform(t) {
35
+ const backgroundBackdrop = t.alpha((t.vars || t).palette.background.default, (t.vars || t).palette.action.disabledOpacity);
36
+ }