@mui/codemod 7.0.0-alpha.2 → 7.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 +59 -10
- package/deprecations/all/deprecations-all.js +4 -0
- package/deprecations/menu-props/index.js +13 -0
- package/deprecations/menu-props/menu-props.js +37 -0
- package/deprecations/menu-props/test-cases/actual.js +67 -0
- package/deprecations/menu-props/test-cases/expected.js +83 -0
- package/deprecations/menu-props/test-cases/theme.actual.js +33 -0
- package/deprecations/menu-props/test-cases/theme.expected.js +39 -0
- package/deprecations/rating-props/index.js +13 -0
- package/deprecations/rating-props/rating-props.js +25 -0
- package/deprecations/rating-props/test-cases/actual.js +37 -0
- package/deprecations/rating-props/test-cases/expected.js +53 -0
- package/deprecations/rating-props/test-cases/theme.actual.js +31 -0
- package/deprecations/rating-props/test-cases/theme.expected.js +37 -0
- package/package.json +1 -1
- package/v7.0.0/all/v7-all.js +2 -0
- package/v7.0.0/grid-props/grid-props.js +150 -0
- package/v7.0.0/grid-props/index.js +13 -0
- package/v7.0.0/grid-props/test-cases/actual.js +107 -0
- package/v7.0.0/grid-props/test-cases/custom-breakpoints.actual.js +18 -0
- package/v7.0.0/grid-props/test-cases/custom-breakpoints.expected.js +22 -0
- package/v7.0.0/grid-props/test-cases/expected.js +107 -0
package/README.md
CHANGED
|
@@ -1606,6 +1606,21 @@ npx @mui/codemod@latest deprecations/popper-props <path>
|
|
|
1606
1606
|
npx @mui/codemod@latest deprecations/outlined-input-props <path>
|
|
1607
1607
|
```
|
|
1608
1608
|
|
|
1609
|
+
#### `rating-props`
|
|
1610
|
+
|
|
1611
|
+
```diff
|
|
1612
|
+
<Snackbar
|
|
1613
|
+
- IconContainerComponent={CustomContainer}
|
|
1614
|
+
+ slots={{
|
|
1615
|
+
+ icon: { component: CustomContainer }
|
|
1616
|
+
+ }}
|
|
1617
|
+
/>
|
|
1618
|
+
```
|
|
1619
|
+
|
|
1620
|
+
```bash
|
|
1621
|
+
npx @mui/codemod@next deprecations/snackbar-props <path>
|
|
1622
|
+
```
|
|
1623
|
+
|
|
1609
1624
|
#### `select-classes`
|
|
1610
1625
|
|
|
1611
1626
|
JS transforms:
|
|
@@ -1711,35 +1726,35 @@ JS transforms:
|
|
|
1711
1726
|
MuiSlider: {
|
|
1712
1727
|
styleOverrides: {
|
|
1713
1728
|
root: {
|
|
1714
|
-
- [
|
|
1729
|
+
- [`& .${sliderClasses.thumbSizeSmall}`]: {
|
|
1715
1730
|
+ [`&.${sliderClasses.sizeSmall} > .${sliderClasses.thumb}`]: {
|
|
1716
1731
|
color: 'red',
|
|
1717
1732
|
},
|
|
1718
|
-
- [
|
|
1733
|
+
- [`& .${sliderClasses.thumbSizeMedium}`]: {
|
|
1719
1734
|
+ [`&.${sliderClasses.sizeMedium} > .${sliderClasses.thumb}`]: {
|
|
1720
1735
|
color: 'red',
|
|
1721
1736
|
},
|
|
1722
|
-
- [
|
|
1737
|
+
- [`& .${sliderClasses.thumbColorPrimary}`]: {
|
|
1723
1738
|
+ [`&.${sliderClasses.colorPrimary} > .${sliderClasses.thumb}`]: {
|
|
1724
1739
|
color: 'red',
|
|
1725
1740
|
},
|
|
1726
|
-
- [
|
|
1741
|
+
- [`& .${sliderClasses.thumbColorSecondary}`]: {
|
|
1727
1742
|
+ [`&.${sliderClasses.colorSecondary} > .${sliderClasses.thumb}`]: {
|
|
1728
1743
|
color: 'red',
|
|
1729
1744
|
},
|
|
1730
|
-
- [
|
|
1745
|
+
- [`& .${sliderClasses.thumbColorError}`]: {
|
|
1731
1746
|
+ [`&.${sliderClasses.colorError} > .${sliderClasses.thumb}`]: {
|
|
1732
1747
|
color: 'red',
|
|
1733
1748
|
},
|
|
1734
|
-
- [
|
|
1735
|
-
+ [`&.${
|
|
1749
|
+
- [`& .${sliderClasses.thumbColorInfo}`]: {
|
|
1750
|
+
+ [`&.${sliderClasses.colorInfo} > .${sliderClasses.thumb}`]: {
|
|
1736
1751
|
color: 'red',
|
|
1737
1752
|
},
|
|
1738
|
-
- [
|
|
1753
|
+
- [`& .${sliderClasses.thumbColorSuccess}`]: {
|
|
1739
1754
|
+ [`&.${sliderClasses.colorSuccess} > .${sliderClasses.thumb}`]: {
|
|
1740
1755
|
color: 'red',
|
|
1741
1756
|
},
|
|
1742
|
-
- [
|
|
1757
|
+
- [`& .${sliderClasses.thumbColorWarning}`]: {
|
|
1743
1758
|
+ [`&.${sliderClasses.colorWarning} > .${sliderClasses.thumb}`]: {
|
|
1744
1759
|
color: 'red',
|
|
1745
1760
|
},
|
|
@@ -1770,7 +1785,7 @@ CSS transforms:
|
|
|
1770
1785
|
```
|
|
1771
1786
|
|
|
1772
1787
|
```bash
|
|
1773
|
-
npx @mui/codemod@latest deprecations/
|
|
1788
|
+
npx @mui/codemod@latest deprecations/slider-classes <path>
|
|
1774
1789
|
```
|
|
1775
1790
|
|
|
1776
1791
|
#### `tooltip-props`
|
|
@@ -2073,6 +2088,40 @@ npx @mui/codemod@latest deprecations/typography-props <path>
|
|
|
2073
2088
|
|
|
2074
2089
|
### v7.0.0
|
|
2075
2090
|
|
|
2091
|
+
#### `grid-props`
|
|
2092
|
+
|
|
2093
|
+
<!-- #npm-tag-reference -->
|
|
2094
|
+
|
|
2095
|
+
```bash
|
|
2096
|
+
npx @mui/codemod@next v7.0.0/grid-props <path>
|
|
2097
|
+
```
|
|
2098
|
+
|
|
2099
|
+
Updates the usage of the `@mui/material/Grid`, `@mui/system/Grid`, and `@mui/joy/Grid` components to their updated APIs.
|
|
2100
|
+
|
|
2101
|
+
```diff
|
|
2102
|
+
<Grid
|
|
2103
|
+
- xs={12}
|
|
2104
|
+
- sm={6}
|
|
2105
|
+
- xsOffset={2}
|
|
2106
|
+
- smOffset={3}
|
|
2107
|
+
+ size={{ xs: 12, sm: 6 }}
|
|
2108
|
+
+ offset={{ xs: 2, sm: 3 }}
|
|
2109
|
+
/>
|
|
2110
|
+
```
|
|
2111
|
+
|
|
2112
|
+
You can provide the theme breakpoints via options, for example, `--jscodeshift='--muiBreakpoints=mobile,desktop'`, to use your custom breakpoints in the transformation.
|
|
2113
|
+
|
|
2114
|
+
<!-- #npm-tag-reference -->
|
|
2115
|
+
|
|
2116
|
+
```bash
|
|
2117
|
+
npx @mui/codemod@next v7.0.0/grid-props <path> --jscodeshift='--muiBreakpoints=mobile,desktop'
|
|
2118
|
+
```
|
|
2119
|
+
|
|
2120
|
+
```diff
|
|
2121
|
+
- <Grid mobile={12} mobileOffset={2} desktop={6} desktopOffset={4} >
|
|
2122
|
+
+ <Grid size={{ mobile: 12, desktop: 6 }} offset={{ mobile: 2, desktop: 4 }} >
|
|
2123
|
+
```
|
|
2124
|
+
|
|
2076
2125
|
#### `lab-removed-components`
|
|
2077
2126
|
|
|
2078
2127
|
<!-- #npm-tag-reference -->
|
|
@@ -48,6 +48,8 @@ var _tabsProps = _interopRequireDefault(require("../tabs-props"));
|
|
|
48
48
|
var _tabsClasses = _interopRequireDefault(require("../tabs-classes"));
|
|
49
49
|
var _drawerProps = _interopRequireDefault(require("../drawer-props"));
|
|
50
50
|
var _mobileStepperProps = _interopRequireDefault(require("../mobile-stepper-props"));
|
|
51
|
+
var _menuProps = _interopRequireDefault(require("../menu-props"));
|
|
52
|
+
var _ratingProps = _interopRequireDefault(require("../rating-props"));
|
|
51
53
|
/**
|
|
52
54
|
* @param {import('jscodeshift').FileInfo} file
|
|
53
55
|
* @param {import('jscodeshift').API} api
|
|
@@ -96,5 +98,7 @@ function deprecationsAll(file, api, options) {
|
|
|
96
98
|
file.source = (0, _tabsClasses.default)(file, api, options);
|
|
97
99
|
file.source = (0, _drawerProps.default)(file, api, options);
|
|
98
100
|
file.source = (0, _mobileStepperProps.default)(file, api, options);
|
|
101
|
+
file.source = (0, _menuProps.default)(file, api, options);
|
|
102
|
+
file.source = (0, _ratingProps.default)(file, api, options);
|
|
99
103
|
return file.source;
|
|
100
104
|
}
|
|
@@ -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 _menuProps.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _menuProps = _interopRequireDefault(require("./menu-props"));
|
|
@@ -0,0 +1,37 @@
|
|
|
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, _movePropIntoSlotProps.default)(j, {
|
|
19
|
+
root,
|
|
20
|
+
componentName: 'Menu',
|
|
21
|
+
propName: 'MenuListProps',
|
|
22
|
+
slotName: 'list'
|
|
23
|
+
});
|
|
24
|
+
(0, _movePropIntoSlots.default)(j, {
|
|
25
|
+
root,
|
|
26
|
+
componentName: 'Menu',
|
|
27
|
+
propName: 'TransitionComponent',
|
|
28
|
+
slotName: 'transition'
|
|
29
|
+
});
|
|
30
|
+
(0, _movePropIntoSlotProps.default)(j, {
|
|
31
|
+
root,
|
|
32
|
+
componentName: 'Menu',
|
|
33
|
+
propName: 'TransitionProps',
|
|
34
|
+
slotName: 'transition'
|
|
35
|
+
});
|
|
36
|
+
return root.toSource(printOptions);
|
|
37
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Menu = _interopRequireDefault(require("@mui/material/Menu"));
|
|
5
|
+
var _material = require("@mui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {
|
|
8
|
+
TransitionComponent: CustomTransition,
|
|
9
|
+
MenuListProps: {
|
|
10
|
+
disablePadding: true
|
|
11
|
+
},
|
|
12
|
+
TransitionProps: {
|
|
13
|
+
timeout: 200
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {
|
|
17
|
+
TransitionComponent: CustomTransition,
|
|
18
|
+
MenuListProps: {
|
|
19
|
+
disablePadding: true
|
|
20
|
+
},
|
|
21
|
+
TransitionProps: {
|
|
22
|
+
timeout: 200
|
|
23
|
+
},
|
|
24
|
+
slotProps: {
|
|
25
|
+
root: {
|
|
26
|
+
disablePortal: true
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {
|
|
31
|
+
TransitionComponent: CustomTransition,
|
|
32
|
+
MenuListProps: {
|
|
33
|
+
disablePadding: true
|
|
34
|
+
},
|
|
35
|
+
TransitionProps: {
|
|
36
|
+
timeout: 200
|
|
37
|
+
},
|
|
38
|
+
slotProps: {
|
|
39
|
+
root: {
|
|
40
|
+
disablePortal: true
|
|
41
|
+
},
|
|
42
|
+
list: {
|
|
43
|
+
disableListWrap: true
|
|
44
|
+
},
|
|
45
|
+
transition: {
|
|
46
|
+
'aria-hidden': true
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Menu, {
|
|
51
|
+
TransitionComponent: CustomTransition,
|
|
52
|
+
MenuListProps: {
|
|
53
|
+
disablePadding: true
|
|
54
|
+
},
|
|
55
|
+
TransitionProps: {
|
|
56
|
+
timeout: 200
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(CustomMenu, {
|
|
60
|
+
TransitionComponent: CustomTransition,
|
|
61
|
+
MenuListProps: {
|
|
62
|
+
disablePadding: true
|
|
63
|
+
},
|
|
64
|
+
TransitionProps: {
|
|
65
|
+
timeout: 200
|
|
66
|
+
}
|
|
67
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Menu = _interopRequireDefault(require("@mui/material/Menu"));
|
|
5
|
+
var _material = require("@mui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {
|
|
8
|
+
slotProps: {
|
|
9
|
+
list: {
|
|
10
|
+
disablePadding: true
|
|
11
|
+
},
|
|
12
|
+
transition: {
|
|
13
|
+
timeout: 200
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
slots: {
|
|
17
|
+
transition: CustomTransition
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {
|
|
21
|
+
slotProps: {
|
|
22
|
+
root: {
|
|
23
|
+
disablePortal: true
|
|
24
|
+
},
|
|
25
|
+
list: {
|
|
26
|
+
disablePadding: true
|
|
27
|
+
},
|
|
28
|
+
transition: {
|
|
29
|
+
timeout: 200
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
slots: {
|
|
33
|
+
transition: CustomTransition
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {
|
|
37
|
+
slotProps: {
|
|
38
|
+
root: {
|
|
39
|
+
disablePortal: true
|
|
40
|
+
},
|
|
41
|
+
list: {
|
|
42
|
+
...{
|
|
43
|
+
disablePadding: true
|
|
44
|
+
},
|
|
45
|
+
...{
|
|
46
|
+
disableListWrap: true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
transition: {
|
|
50
|
+
...{
|
|
51
|
+
timeout: 200
|
|
52
|
+
},
|
|
53
|
+
...{
|
|
54
|
+
'aria-hidden': true
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
slots: {
|
|
59
|
+
transition: CustomTransition
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Menu, {
|
|
63
|
+
slotProps: {
|
|
64
|
+
list: {
|
|
65
|
+
disablePadding: true
|
|
66
|
+
},
|
|
67
|
+
transition: {
|
|
68
|
+
timeout: 200
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
slots: {
|
|
72
|
+
transition: CustomTransition
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(CustomMenu, {
|
|
76
|
+
TransitionComponent: CustomTransition,
|
|
77
|
+
MenuListProps: {
|
|
78
|
+
disablePadding: true
|
|
79
|
+
},
|
|
80
|
+
TransitionProps: {
|
|
81
|
+
timeout: 200
|
|
82
|
+
}
|
|
83
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiMenu: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
MenuListProps: {
|
|
7
|
+
disablePadding: true
|
|
8
|
+
},
|
|
9
|
+
TransitionComponent: CustomTransition,
|
|
10
|
+
TransitionProps: {
|
|
11
|
+
timeout: 200
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
fn({
|
|
17
|
+
MuiMenu: {
|
|
18
|
+
defaultProps: {
|
|
19
|
+
TransitionComponent: CustomTransition,
|
|
20
|
+
MenuListProps: {
|
|
21
|
+
disablePadding: true
|
|
22
|
+
},
|
|
23
|
+
TransitionProps: {
|
|
24
|
+
timeout: 200
|
|
25
|
+
},
|
|
26
|
+
slotProps: {
|
|
27
|
+
root: {
|
|
28
|
+
disablePortal: true
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiMenu: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
slotProps: {
|
|
7
|
+
list: {
|
|
8
|
+
disablePadding: true
|
|
9
|
+
},
|
|
10
|
+
transition: {
|
|
11
|
+
timeout: 200
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
slots: {
|
|
15
|
+
transition: CustomTransition
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
fn({
|
|
21
|
+
MuiMenu: {
|
|
22
|
+
defaultProps: {
|
|
23
|
+
slotProps: {
|
|
24
|
+
root: {
|
|
25
|
+
disablePortal: true
|
|
26
|
+
},
|
|
27
|
+
list: {
|
|
28
|
+
disablePadding: true
|
|
29
|
+
},
|
|
30
|
+
transition: {
|
|
31
|
+
timeout: 200
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
slots: {
|
|
35
|
+
transition: CustomTransition
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
@@ -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 _ratingProps.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _ratingProps = _interopRequireDefault(require("./rating-props"));
|
|
@@ -0,0 +1,25 @@
|
|
|
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 _movePropIntoSlotProps = _interopRequireDefault(require("../utils/movePropIntoSlotProps"));
|
|
9
|
+
/**
|
|
10
|
+
* @param {import('jscodeshift').FileInfo} file
|
|
11
|
+
* @param {import('jscodeshift').API} api
|
|
12
|
+
*/
|
|
13
|
+
function transformer(file, api, options) {
|
|
14
|
+
const j = api.jscodeshift;
|
|
15
|
+
const root = j(file.source);
|
|
16
|
+
const printOptions = options.printOptions;
|
|
17
|
+
(0, _movePropIntoSlotProps.default)(j, {
|
|
18
|
+
root,
|
|
19
|
+
componentName: 'Rating',
|
|
20
|
+
propName: 'IconContainerComponent',
|
|
21
|
+
slotName: 'icon',
|
|
22
|
+
slotPropName: 'component'
|
|
23
|
+
});
|
|
24
|
+
return root.toSource(printOptions);
|
|
25
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Rating = _interopRequireDefault(require("@mui/material/Rating"));
|
|
5
|
+
var _material = require("@mui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Rating.default, {
|
|
8
|
+
IconContainerComponent: CustomIconContainer
|
|
9
|
+
});
|
|
10
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Rating, {
|
|
11
|
+
IconContainerComponent: CustomIconContainer
|
|
12
|
+
});
|
|
13
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Rating.default, {
|
|
14
|
+
IconContainerComponent: CustomIconContainer,
|
|
15
|
+
slots: {
|
|
16
|
+
root: 'div'
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Rating, {
|
|
20
|
+
IconContainerComponent: CustomIconContainer,
|
|
21
|
+
slots: {
|
|
22
|
+
...outerSlots
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Rating.default, {
|
|
26
|
+
IconContainerComponent: CustomIconContainer,
|
|
27
|
+
slotProps: {
|
|
28
|
+
icon: {
|
|
29
|
+
id: 'my-rating-icon'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// should skip non MUI components
|
|
35
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(NonMuiRating, {
|
|
36
|
+
IconContainerComponent: CustomIconContainer
|
|
37
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Rating = _interopRequireDefault(require("@mui/material/Rating"));
|
|
5
|
+
var _material = require("@mui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Rating.default, {
|
|
8
|
+
slotProps: {
|
|
9
|
+
icon: {
|
|
10
|
+
component: CustomIconContainer
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Rating, {
|
|
15
|
+
slotProps: {
|
|
16
|
+
icon: {
|
|
17
|
+
component: CustomIconContainer
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Rating.default, {
|
|
22
|
+
slots: {
|
|
23
|
+
root: 'div'
|
|
24
|
+
},
|
|
25
|
+
slotProps: {
|
|
26
|
+
icon: {
|
|
27
|
+
component: CustomIconContainer
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Rating, {
|
|
32
|
+
slots: {
|
|
33
|
+
...outerSlots
|
|
34
|
+
},
|
|
35
|
+
slotProps: {
|
|
36
|
+
icon: {
|
|
37
|
+
component: CustomIconContainer
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Rating.default, {
|
|
42
|
+
slotProps: {
|
|
43
|
+
icon: {
|
|
44
|
+
id: 'my-rating-icon',
|
|
45
|
+
component: CustomIconContainer
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// should skip non MUI components
|
|
51
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(NonMuiRating, {
|
|
52
|
+
IconContainerComponent: CustomIconContainer
|
|
53
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiRating: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
IconContainerComponent: CustomContainer
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
fn({
|
|
11
|
+
MuiRating: {
|
|
12
|
+
defaultProps: {
|
|
13
|
+
IconContainerComponent: CustomContainer,
|
|
14
|
+
slotProps: {
|
|
15
|
+
root: {}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
fn({
|
|
21
|
+
MuiRating: {
|
|
22
|
+
defaultProps: {
|
|
23
|
+
IconContainerComponent: CustomContainer,
|
|
24
|
+
slotProps: {
|
|
25
|
+
icon: {
|
|
26
|
+
id: 'my-rating-icon'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiRating: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
slotProps: {
|
|
7
|
+
icon: {
|
|
8
|
+
component: CustomContainer
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
fn({
|
|
15
|
+
MuiRating: {
|
|
16
|
+
defaultProps: {
|
|
17
|
+
slotProps: {
|
|
18
|
+
root: {},
|
|
19
|
+
icon: {
|
|
20
|
+
component: CustomContainer
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
fn({
|
|
27
|
+
MuiRating: {
|
|
28
|
+
defaultProps: {
|
|
29
|
+
slotProps: {
|
|
30
|
+
icon: {
|
|
31
|
+
id: 'my-rating-icon',
|
|
32
|
+
component: CustomContainer
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
package/package.json
CHANGED
package/v7.0.0/all/v7-all.js
CHANGED
|
@@ -5,12 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = v7All;
|
|
8
|
+
var _gridProps = _interopRequireDefault(require("../grid-props"));
|
|
8
9
|
var _labRemovedComponents = _interopRequireDefault(require("../lab-removed-components"));
|
|
9
10
|
/**
|
|
10
11
|
* @param {import('jscodeshift').FileInfo} file
|
|
11
12
|
* @param {import('jscodeshift').API} api
|
|
12
13
|
*/
|
|
13
14
|
function v7All(file, api, options) {
|
|
15
|
+
(0, _gridProps.default)(file, api, options);
|
|
14
16
|
(0, _labRemovedComponents.default)(file, api, options);
|
|
15
17
|
return file.source;
|
|
16
18
|
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = gridV2Props;
|
|
7
|
+
const possibleDefaultImports = ['@mui/material/Grid', '@mui/system/Grid', '@mui/joy/Grid'];
|
|
8
|
+
const possibleNamedImports = {
|
|
9
|
+
'@mui/material': 'Grid',
|
|
10
|
+
'@mui/system': 'Grid',
|
|
11
|
+
'@mui/joy': 'Grid'
|
|
12
|
+
};
|
|
13
|
+
const defaultBreakpoints = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @param {import('jscodeshift').FileInfo} file
|
|
17
|
+
* @param {import('jscodeshift').API} api
|
|
18
|
+
*/
|
|
19
|
+
function gridV2Props(file, api, options) {
|
|
20
|
+
if (file.path?.endsWith('.json') || file.path?.endsWith('.d.ts')) {
|
|
21
|
+
return file.source;
|
|
22
|
+
}
|
|
23
|
+
const j = api.jscodeshift;
|
|
24
|
+
const root = j(file.source);
|
|
25
|
+
const breakpoints = options.muiBreakpoints?.split(',') || defaultBreakpoints;
|
|
26
|
+
const printOptions = options.printOptions;
|
|
27
|
+
const gridLocalNames = [];
|
|
28
|
+
root.find(j.ImportDeclaration, decl => possibleDefaultImports.includes(decl.source.value)).forEach(decl => {
|
|
29
|
+
decl.node.specifiers.forEach(spec => {
|
|
30
|
+
if (spec.type === 'ImportDefaultSpecifier') {
|
|
31
|
+
gridLocalNames.push(spec.local.name);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
root.find(j.ImportDeclaration, decl => Object.keys(possibleNamedImports).includes(decl.source.value)).forEach(decl => {
|
|
36
|
+
decl.node.specifiers.forEach(spec => {
|
|
37
|
+
if (spec.type === 'ImportSpecifier') {
|
|
38
|
+
if (possibleNamedImports[decl.node.source.value] === spec.imported.name) {
|
|
39
|
+
gridLocalNames.push(spec.local.name);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
root.find(j.JSXElement, {
|
|
45
|
+
openingElement: {
|
|
46
|
+
name: {
|
|
47
|
+
name: name => gridLocalNames.includes(name)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}).forEach(el => {
|
|
51
|
+
const size = j.objectExpression([]);
|
|
52
|
+
const spreadProps = [];
|
|
53
|
+
const attributesToPrune = [];
|
|
54
|
+
el.node.openingElement.attributes.forEach(attr => {
|
|
55
|
+
if (attr.type === 'JSXSpreadAttribute') {
|
|
56
|
+
spreadProps.push(attr);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const breakpointNodes = j(el).find(j.JSXAttribute).filter(path => path.parent.parent.node === el.node && breakpoints.includes(path.node.name.name));
|
|
60
|
+
breakpointNodes.nodes().forEach(node => {
|
|
61
|
+
const breakpoint = node.name.name;
|
|
62
|
+
const nodeValue = node.value;
|
|
63
|
+
let value;
|
|
64
|
+
if (nodeValue === null) {
|
|
65
|
+
value = j.stringLiteral('grow');
|
|
66
|
+
} else if (nodeValue.type === 'JSXExpressionContainer') {
|
|
67
|
+
if (nodeValue.expression.value === true) {
|
|
68
|
+
value = j.stringLiteral('grow');
|
|
69
|
+
} else {
|
|
70
|
+
value = nodeValue.expression;
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
value = nodeValue;
|
|
74
|
+
}
|
|
75
|
+
size.properties.push(j.property('init', j.identifier(breakpoint), value));
|
|
76
|
+
});
|
|
77
|
+
spreadProps.forEach(spreadProp => {
|
|
78
|
+
const spreadPropArgument = spreadProp.argument;
|
|
79
|
+
if (spreadPropArgument.type === 'ObjectExpression') {
|
|
80
|
+
const propertiesToPrune = [];
|
|
81
|
+
spreadPropArgument.properties.forEach(property => {
|
|
82
|
+
if (breakpoints.includes(property.key.name)) {
|
|
83
|
+
size.properties.push(j.property('init', property.key, property.value));
|
|
84
|
+
propertiesToPrune.push(property.key.name);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
spreadPropArgument.properties = spreadPropArgument.properties.filter(prop => !propertiesToPrune.includes(prop.key.name));
|
|
88
|
+
if (spreadPropArgument.properties.length === 0) {
|
|
89
|
+
attributesToPrune.push(spreadProp);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
if (size.properties.length) {
|
|
94
|
+
let sizePropValue = size;
|
|
95
|
+
if (size.properties.length === 1 && size.properties[0].key.name === 'xs') {
|
|
96
|
+
sizePropValue = size.properties[0].value;
|
|
97
|
+
}
|
|
98
|
+
if (sizePropValue.type !== 'StringLiteral') {
|
|
99
|
+
sizePropValue = j.jsxExpressionContainer(sizePropValue);
|
|
100
|
+
}
|
|
101
|
+
el.node.openingElement.attributes.push(j.jsxAttribute(j.jsxIdentifier('size'), sizePropValue));
|
|
102
|
+
}
|
|
103
|
+
el.node.openingElement.attributes = el.node.openingElement.attributes.filter(attr => !breakpoints.includes(attr?.name?.name));
|
|
104
|
+
const offset = j.objectExpression([]);
|
|
105
|
+
const offsetNodes = j(el).find(j.JSXAttribute).filter(path => path.parent.parent.node === el.node && path.node.name.name.endsWith('Offset') && breakpoints.includes(path.node.name.name.replace('Offset', '')));
|
|
106
|
+
offsetNodes.nodes().forEach(node => {
|
|
107
|
+
const breakpoint = node.name.name.replace('Offset', '');
|
|
108
|
+
const value = node.value.type === 'JSXExpressionContainer' ? node.value.expression : node.value;
|
|
109
|
+
offset.properties.push(j.property('init', j.identifier(breakpoint), value));
|
|
110
|
+
});
|
|
111
|
+
spreadProps.forEach(spreadProp => {
|
|
112
|
+
const spreadPropArgument = spreadProp.argument;
|
|
113
|
+
if (spreadPropArgument.type === 'ObjectExpression') {
|
|
114
|
+
const propertiesToPrune = [];
|
|
115
|
+
spreadPropArgument.properties.forEach(property => {
|
|
116
|
+
const breakpoint = property.key.name.replace('Offset', '');
|
|
117
|
+
if (property.key.name.endsWith('Offset') && breakpoints.includes(breakpoint)) {
|
|
118
|
+
offset.properties.push(j.property('init', j.identifier(breakpoint), property.value));
|
|
119
|
+
propertiesToPrune.push(property.key.name);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
spreadPropArgument.properties = spreadPropArgument.properties.filter(prop => !propertiesToPrune.includes(prop.key.name));
|
|
123
|
+
if (spreadPropArgument.properties.length === 0) {
|
|
124
|
+
attributesToPrune.push(spreadProp);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
if (offset.properties.length) {
|
|
129
|
+
let offsetPropValue = offset;
|
|
130
|
+
if (offset.properties.length === 1 && offset.properties[0].key.name === 'xs') {
|
|
131
|
+
offsetPropValue = offset.properties[0].value;
|
|
132
|
+
}
|
|
133
|
+
if (offsetPropValue.type !== 'StringLiteral') {
|
|
134
|
+
offsetPropValue = j.jsxExpressionContainer(offsetPropValue);
|
|
135
|
+
}
|
|
136
|
+
el.node.openingElement.attributes.push(j.jsxAttribute(j.jsxIdentifier('offset'), offsetPropValue));
|
|
137
|
+
}
|
|
138
|
+
el.node.openingElement.attributes = el.node.openingElement.attributes.filter(attr => !breakpoints.includes(attr?.name?.name.replace('Offset', '')));
|
|
139
|
+
el.node.openingElement.attributes = el.node.openingElement.attributes.filter(attr => !attributesToPrune.includes(attr));
|
|
140
|
+
const itemProp = el.node.openingElement.attributes.find(attr => attr.type === 'JSXAttribute' && attr.name.name === 'item');
|
|
141
|
+
if (itemProp) {
|
|
142
|
+
el.node.openingElement.attributes = el.node.openingElement.attributes.filter(attr => attr.type === 'JSXAttribute' && attr.name.name !== 'item');
|
|
143
|
+
}
|
|
144
|
+
const zeroMinWidthProp = el.node.openingElement.attributes.find(attr => attr.type === 'JSXAttribute' && attr.name.name === 'zeroMinWidth');
|
|
145
|
+
if (zeroMinWidthProp) {
|
|
146
|
+
el.node.openingElement.attributes = el.node.openingElement.attributes.filter(attr => attr.type === 'JSXAttribute' && attr.name.name !== 'zeroMinWidth');
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
return root.toSource(printOptions);
|
|
150
|
+
}
|
|
@@ -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 _gridProps.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _gridProps = _interopRequireDefault(require("./grid-props"));
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
5
|
+
var _GridLegacy = _interopRequireDefault(require("@mui/material/GridLegacy"));
|
|
6
|
+
var _Grid2 = _interopRequireDefault(require("@mui/system/Grid"));
|
|
7
|
+
var _Grid3 = _interopRequireDefault(require("@mui/joy/Grid"));
|
|
8
|
+
var _material = require("@mui/material");
|
|
9
|
+
var _system = require("@mui/system");
|
|
10
|
+
var _joy = require("@mui/joy");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
// Transforms on all the possible imports
|
|
13
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
14
|
+
xs: 2
|
|
15
|
+
});
|
|
16
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid2.default, {
|
|
17
|
+
xs: 2
|
|
18
|
+
});
|
|
19
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid3.default, {
|
|
20
|
+
xs: 2
|
|
21
|
+
});
|
|
22
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
23
|
+
xs: 2
|
|
24
|
+
});
|
|
25
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_system.Grid, {
|
|
26
|
+
xs: 2
|
|
27
|
+
});
|
|
28
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_joy.Grid, {
|
|
29
|
+
xs: 2
|
|
30
|
+
});
|
|
31
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
32
|
+
item: true
|
|
33
|
+
});
|
|
34
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
35
|
+
item: true
|
|
36
|
+
});
|
|
37
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
38
|
+
item: false
|
|
39
|
+
});
|
|
40
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
41
|
+
zeroMinWidth: true
|
|
42
|
+
});
|
|
43
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
44
|
+
zeroMinWidth: true
|
|
45
|
+
});
|
|
46
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
47
|
+
zeroMinWidth: false
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// Transforms responsive sizes
|
|
51
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
52
|
+
xs: 2,
|
|
53
|
+
sm: 4,
|
|
54
|
+
md: 6,
|
|
55
|
+
lg: 8,
|
|
56
|
+
xl: 10
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// Transforms all the possible size values
|
|
60
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
61
|
+
xs: true,
|
|
62
|
+
sm: "auto",
|
|
63
|
+
md: 2,
|
|
64
|
+
lg: true,
|
|
65
|
+
xl: false
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// Doesn't add jsx object expression for single string values
|
|
69
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
70
|
+
xs: "auto"
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// Transforms offset
|
|
74
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
75
|
+
xsOffset: 2
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Transforms responsive offset
|
|
79
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
80
|
+
xsOffset: 2,
|
|
81
|
+
smOffset: 4,
|
|
82
|
+
mdOffset: 6,
|
|
83
|
+
lgOffset: 8,
|
|
84
|
+
xlOffset: 10
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// Transforms all the possible offset values
|
|
88
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
89
|
+
xsOffset: 2,
|
|
90
|
+
smOffset: "auto"
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// Transforms spread props
|
|
94
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
95
|
+
xs: 2,
|
|
96
|
+
sm: 4,
|
|
97
|
+
xsOffset: 0,
|
|
98
|
+
smOffset: 2
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// Doesn't transform Grid v1
|
|
102
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_GridLegacy.default, {
|
|
103
|
+
xs: 2
|
|
104
|
+
});
|
|
105
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.GridLegacy, {
|
|
106
|
+
xs: 2
|
|
107
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
5
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
+
// Transforms custom breakpoints
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
8
|
+
customXs: 2,
|
|
9
|
+
customSm: 4,
|
|
10
|
+
customMd: 6
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
// Transforms custom breakpoints offset
|
|
14
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
15
|
+
customXsOffset: 2,
|
|
16
|
+
customSmOffset: 4,
|
|
17
|
+
customMdOffset: 6
|
|
18
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
5
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
+
// Transforms custom breakpoints
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
8
|
+
size: {
|
|
9
|
+
customXs: 2,
|
|
10
|
+
customSm: 4,
|
|
11
|
+
customMd: 6
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
// Transforms custom breakpoints offset
|
|
16
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
17
|
+
offset: {
|
|
18
|
+
customXs: 2,
|
|
19
|
+
customSm: 4,
|
|
20
|
+
customMd: 6
|
|
21
|
+
}
|
|
22
|
+
});
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
5
|
+
var _GridLegacy = _interopRequireDefault(require("@mui/material/GridLegacy"));
|
|
6
|
+
var _Grid2 = _interopRequireDefault(require("@mui/system/Grid"));
|
|
7
|
+
var _Grid3 = _interopRequireDefault(require("@mui/joy/Grid"));
|
|
8
|
+
var _material = require("@mui/material");
|
|
9
|
+
var _system = require("@mui/system");
|
|
10
|
+
var _joy = require("@mui/joy");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
// Transforms on all the possible imports
|
|
13
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
14
|
+
size: 2
|
|
15
|
+
});
|
|
16
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid2.default, {
|
|
17
|
+
size: 2
|
|
18
|
+
});
|
|
19
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid3.default, {
|
|
20
|
+
size: 2
|
|
21
|
+
});
|
|
22
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
23
|
+
size: 2
|
|
24
|
+
});
|
|
25
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_system.Grid, {
|
|
26
|
+
size: 2
|
|
27
|
+
});
|
|
28
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_joy.Grid, {
|
|
29
|
+
size: 2
|
|
30
|
+
});
|
|
31
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {});
|
|
32
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {});
|
|
33
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {});
|
|
34
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {});
|
|
35
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {});
|
|
36
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {});
|
|
37
|
+
|
|
38
|
+
// Transforms responsive sizes
|
|
39
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
40
|
+
size: {
|
|
41
|
+
xs: 2,
|
|
42
|
+
sm: 4,
|
|
43
|
+
md: 6,
|
|
44
|
+
lg: 8,
|
|
45
|
+
xl: 10
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// Transforms all the possible size values
|
|
50
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
51
|
+
size: {
|
|
52
|
+
xs: "grow",
|
|
53
|
+
sm: "auto",
|
|
54
|
+
md: 2,
|
|
55
|
+
lg: "grow",
|
|
56
|
+
xl: false
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Doesn't add jsx object expression for single string values
|
|
61
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
62
|
+
size: "auto"
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Transforms offset
|
|
66
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
67
|
+
offset: 2
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// Transforms responsive offset
|
|
71
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
72
|
+
offset: {
|
|
73
|
+
xs: 2,
|
|
74
|
+
sm: 4,
|
|
75
|
+
md: 6,
|
|
76
|
+
lg: 8,
|
|
77
|
+
xl: 10
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// Transforms all the possible offset values
|
|
82
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
83
|
+
offset: {
|
|
84
|
+
xs: 2,
|
|
85
|
+
sm: "auto"
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// Transforms spread props
|
|
90
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
91
|
+
size: {
|
|
92
|
+
xs: 2,
|
|
93
|
+
sm: 4
|
|
94
|
+
},
|
|
95
|
+
offset: {
|
|
96
|
+
xs: 0,
|
|
97
|
+
sm: 2
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// Doesn't transform Grid v1
|
|
102
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_GridLegacy.default, {
|
|
103
|
+
xs: 2
|
|
104
|
+
});
|
|
105
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.GridLegacy, {
|
|
106
|
+
xs: 2
|
|
107
|
+
});
|