@mui/codemod 9.0.0-alpha.1 → 9.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/CHANGELOG.md +288 -2
- package/README.md +393 -8
- package/deprecations/all/deprecations-all.js +6 -0
- package/deprecations/autocomplete-props/autocomplete-props.js +195 -0
- package/deprecations/autocomplete-props/test-cases/actual.js +31 -0
- package/deprecations/autocomplete-props/test-cases/expected.js +31 -0
- package/deprecations/autocomplete-props/test-cases/package.actual.js +11 -0
- package/deprecations/autocomplete-props/test-cases/package.expected.js +11 -0
- package/deprecations/autocomplete-props/test-cases/render-input-package.actual.js +34 -0
- package/deprecations/autocomplete-props/test-cases/render-input-package.expected.js +40 -0
- package/deprecations/autocomplete-props/test-cases/render-input.actual.js +81 -0
- package/deprecations/autocomplete-props/test-cases/render-input.expected.js +92 -0
- package/deprecations/autocomplete-props/test-cases/theme.actual.js +15 -0
- package/deprecations/autocomplete-props/test-cases/theme.expected.js +15 -0
- package/deprecations/checkbox-props/checkbox-props.js +33 -0
- package/deprecations/checkbox-props/index.js +13 -0
- package/deprecations/checkbox-props/test-cases/actual.js +45 -0
- package/deprecations/checkbox-props/test-cases/expected.js +61 -0
- package/deprecations/checkbox-props/test-cases/package.actual.js +34 -0
- package/deprecations/checkbox-props/test-cases/package.expected.js +50 -0
- package/deprecations/checkbox-props/test-cases/theme.actual.js +28 -0
- package/deprecations/checkbox-props/test-cases/theme.expected.js +36 -0
- package/deprecations/circular-progress-classes/circular-progress-classes.js +16 -1
- package/deprecations/circular-progress-classes/postcss-plugin.js +2 -2
- package/deprecations/circular-progress-classes/test-cases/expected.js +4 -4
- package/deprecations/circular-progress-classes/test-cases/package.expected.js +4 -4
- package/deprecations/dialog-props/dialog-props.js +14 -0
- package/deprecations/dialog-props/test-cases/actual.js +4 -0
- package/deprecations/dialog-props/test-cases/expected.js +4 -0
- package/deprecations/drawer-props/drawer-props.js +14 -0
- package/deprecations/drawer-props/test-cases/actual.js +10 -2
- package/deprecations/drawer-props/test-cases/expected.js +14 -2
- package/deprecations/radio-props/index.js +13 -0
- package/deprecations/radio-props/radio-props.js +33 -0
- package/deprecations/radio-props/test-cases/actual.js +45 -0
- package/deprecations/radio-props/test-cases/expected.js +61 -0
- package/deprecations/radio-props/test-cases/package.actual.js +34 -0
- package/deprecations/radio-props/test-cases/package.expected.js +50 -0
- package/deprecations/radio-props/test-cases/theme.actual.js +28 -0
- package/deprecations/radio-props/test-cases/theme.expected.js +36 -0
- package/deprecations/switch-props/index.js +13 -0
- package/deprecations/switch-props/switch-props.js +33 -0
- package/deprecations/switch-props/test-cases/actual.js +45 -0
- package/deprecations/switch-props/test-cases/expected.js +61 -0
- package/deprecations/switch-props/test-cases/package.actual.js +34 -0
- package/deprecations/switch-props/test-cases/package.expected.js +50 -0
- package/deprecations/switch-props/test-cases/theme.actual.js +28 -0
- package/deprecations/switch-props/test-cases/theme.expected.js +36 -0
- package/deprecations/tabs-props/tabs-props.js +44 -0
- package/deprecations/tabs-props/test-cases/actual.js +11 -0
- package/deprecations/tabs-props/test-cases/expected.js +11 -0
- package/deprecations/tabs-props/test-cases/package.actual.js +6 -0
- package/deprecations/tabs-props/test-cases/package.expected.js +6 -0
- package/deprecations/tabs-props/test-cases/theme.actual.js +10 -0
- package/deprecations/tabs-props/test-cases/theme.expected.js +10 -0
- package/package.json +3 -3
- package/v9.0.0/system-props/index.js +13 -0
- package/v9.0.0/system-props/removeSystemProps.js +243 -0
- package/v9.0.0/system-props/test-cases/system-props.actual.js +144 -0
- package/v9.0.0/system-props/test-cases/system-props.expected.js +175 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = removeSystemProps;
|
|
7
|
+
// from `packages/mui-system/src/styleFunctionSx/defaultSxConfig.js`
|
|
8
|
+
const defaultSxConfig = {
|
|
9
|
+
// borders
|
|
10
|
+
border: {},
|
|
11
|
+
borderTop: {},
|
|
12
|
+
borderRight: {},
|
|
13
|
+
borderBottom: {},
|
|
14
|
+
borderLeft: {},
|
|
15
|
+
borderColor: {},
|
|
16
|
+
borderTopColor: {},
|
|
17
|
+
borderRightColor: {},
|
|
18
|
+
borderBottomColor: {},
|
|
19
|
+
borderLeftColor: {},
|
|
20
|
+
outline: {},
|
|
21
|
+
outlineColor: {},
|
|
22
|
+
borderRadius: {},
|
|
23
|
+
color: {},
|
|
24
|
+
bgcolor: {},
|
|
25
|
+
backgroundColor: {},
|
|
26
|
+
p: {},
|
|
27
|
+
pt: {},
|
|
28
|
+
pr: {},
|
|
29
|
+
pb: {},
|
|
30
|
+
pl: {},
|
|
31
|
+
px: {},
|
|
32
|
+
py: {},
|
|
33
|
+
padding: {},
|
|
34
|
+
paddingTop: {},
|
|
35
|
+
paddingRight: {},
|
|
36
|
+
paddingBottom: {},
|
|
37
|
+
paddingLeft: {},
|
|
38
|
+
paddingX: {},
|
|
39
|
+
paddingY: {},
|
|
40
|
+
paddingInline: {},
|
|
41
|
+
paddingInlineStart: {},
|
|
42
|
+
paddingInlineEnd: {},
|
|
43
|
+
paddingBlock: {},
|
|
44
|
+
paddingBlockStart: {},
|
|
45
|
+
paddingBlockEnd: {},
|
|
46
|
+
m: {},
|
|
47
|
+
mt: {},
|
|
48
|
+
mr: {},
|
|
49
|
+
mb: {},
|
|
50
|
+
ml: {},
|
|
51
|
+
mx: {},
|
|
52
|
+
my: {},
|
|
53
|
+
margin: {},
|
|
54
|
+
marginTop: {},
|
|
55
|
+
marginRight: {},
|
|
56
|
+
marginBottom: {},
|
|
57
|
+
marginLeft: {},
|
|
58
|
+
marginX: {},
|
|
59
|
+
marginY: {},
|
|
60
|
+
marginInline: {},
|
|
61
|
+
marginInlineStart: {},
|
|
62
|
+
marginInlineEnd: {},
|
|
63
|
+
marginBlock: {},
|
|
64
|
+
marginBlockStart: {},
|
|
65
|
+
marginBlockEnd: {},
|
|
66
|
+
// display
|
|
67
|
+
displayPrint: {},
|
|
68
|
+
display: {},
|
|
69
|
+
overflow: {},
|
|
70
|
+
textOverflow: {},
|
|
71
|
+
visibility: {},
|
|
72
|
+
whiteSpace: {},
|
|
73
|
+
// flexbox
|
|
74
|
+
flexBasis: {},
|
|
75
|
+
flexDirection: {},
|
|
76
|
+
flexWrap: {},
|
|
77
|
+
justifyContent: {},
|
|
78
|
+
alignItems: {},
|
|
79
|
+
alignContent: {},
|
|
80
|
+
order: {},
|
|
81
|
+
flex: {},
|
|
82
|
+
flexGrow: {},
|
|
83
|
+
flexShrink: {},
|
|
84
|
+
alignSelf: {},
|
|
85
|
+
justifyItems: {},
|
|
86
|
+
justifySelf: {},
|
|
87
|
+
// grid
|
|
88
|
+
gap: {},
|
|
89
|
+
rowGap: {},
|
|
90
|
+
columnGap: {},
|
|
91
|
+
gridColumn: {},
|
|
92
|
+
gridRow: {},
|
|
93
|
+
gridAutoFlow: {},
|
|
94
|
+
gridAutoColumns: {},
|
|
95
|
+
gridAutoRows: {},
|
|
96
|
+
gridTemplateColumns: {},
|
|
97
|
+
gridTemplateRows: {},
|
|
98
|
+
gridTemplateAreas: {},
|
|
99
|
+
gridArea: {},
|
|
100
|
+
// positions
|
|
101
|
+
position: {},
|
|
102
|
+
zIndex: {},
|
|
103
|
+
top: {},
|
|
104
|
+
right: {},
|
|
105
|
+
bottom: {},
|
|
106
|
+
left: {},
|
|
107
|
+
// shadows
|
|
108
|
+
boxShadow: {},
|
|
109
|
+
// sizing
|
|
110
|
+
width: {},
|
|
111
|
+
maxWidth: {},
|
|
112
|
+
minWidth: {},
|
|
113
|
+
height: {},
|
|
114
|
+
maxHeight: {},
|
|
115
|
+
minHeight: {},
|
|
116
|
+
boxSizing: {},
|
|
117
|
+
// typography
|
|
118
|
+
font: {},
|
|
119
|
+
fontFamily: {},
|
|
120
|
+
fontSize: {},
|
|
121
|
+
fontStyle: {},
|
|
122
|
+
fontWeight: {},
|
|
123
|
+
letterSpacing: {},
|
|
124
|
+
textTransform: {},
|
|
125
|
+
lineHeight: {},
|
|
126
|
+
textAlign: {},
|
|
127
|
+
typography: {}
|
|
128
|
+
};
|
|
129
|
+
const systemProps = Object.keys(defaultSxConfig);
|
|
130
|
+
const components = ['Box', 'Stack', 'Typography', 'Link', 'Grid', 'Grid2', 'DialogContentText', 'TimelineContent', 'TimelineOppositeContent'];
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @param {import('jscodeshift').FileInfo} file
|
|
134
|
+
* @param {import('jscodeshift').API} api
|
|
135
|
+
*/
|
|
136
|
+
function removeSystemProps(file, api, options) {
|
|
137
|
+
if (file.path?.endsWith('.json') || file.path?.endsWith('.d.ts')) {
|
|
138
|
+
return file.source;
|
|
139
|
+
}
|
|
140
|
+
const j = api.jscodeshift;
|
|
141
|
+
const root = j(file.source);
|
|
142
|
+
const printOptions = options.printOptions;
|
|
143
|
+
const deprecatedElements = [];
|
|
144
|
+
const typographyColorMatcher = {
|
|
145
|
+
matcher: (key, val) => key !== 'color' || val.value === 'inherit' || val.value?.includes('.') || val.value === 'divider' || val.value?.startsWith('#') || val.value?.match(/\(.*\)/)
|
|
146
|
+
};
|
|
147
|
+
const customReplacement = {
|
|
148
|
+
Typography: typographyColorMatcher,
|
|
149
|
+
// These components extend Typography
|
|
150
|
+
DialogContentText: typographyColorMatcher,
|
|
151
|
+
TimelineContent: typographyColorMatcher,
|
|
152
|
+
TimelineOppositeContent: typographyColorMatcher,
|
|
153
|
+
Link: {
|
|
154
|
+
// Same as Typography but keep color="inherit" as a Link component prop (controls underline behavior)
|
|
155
|
+
matcher: (key, val) => key !== 'color' || val.value?.includes('.') || val.value === 'divider' || val.value?.startsWith('#') || val.value?.match(/\(.*\)/)
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
const elementReplacement = {};
|
|
159
|
+
root.find(j.ImportDeclaration, decl => decl.source.value.includes('@mui')).forEach(decl => {
|
|
160
|
+
decl.node.specifiers.forEach(spec => {
|
|
161
|
+
if (spec.type === 'ImportSpecifier') {
|
|
162
|
+
const name = spec.imported.name;
|
|
163
|
+
if (components.includes(name)) {
|
|
164
|
+
deprecatedElements.push(spec.local.name);
|
|
165
|
+
if (customReplacement[name]) {
|
|
166
|
+
elementReplacement[spec.local.name] = customReplacement[name];
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (spec.type === 'ImportDefaultSpecifier') {
|
|
171
|
+
const name = decl.node.source.value.split('/').pop();
|
|
172
|
+
if (components.includes(name)) {
|
|
173
|
+
deprecatedElements.push(spec.local.name);
|
|
174
|
+
if (customReplacement[name]) {
|
|
175
|
+
elementReplacement[spec.local.name] = customReplacement[name];
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
root.find(j.JSXElement, {
|
|
182
|
+
openingElement: {
|
|
183
|
+
name: {
|
|
184
|
+
name: name => {
|
|
185
|
+
return deprecatedElements.includes(name);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}).forEach(el => {
|
|
190
|
+
const sx = j.objectExpression([]);
|
|
191
|
+
const elementName = el.value?.openingElement?.name?.name;
|
|
192
|
+
const sxNodes = j(el).find(j.JSXAttribute).filter(path => path.parent.parent.node === el.node && path.node.name.name === 'sx');
|
|
193
|
+
const sxNodesArray = sxNodes.nodes() || [];
|
|
194
|
+
const existingSxValue = sxNodesArray[0]?.value?.expression;
|
|
195
|
+
let spreadElement = null;
|
|
196
|
+
el.node.openingElement.attributes.forEach(attr => {
|
|
197
|
+
if (attr.type === 'JSXSpreadAttribute') {
|
|
198
|
+
spreadElement = attr;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
const attrToPrune = ['sx'];
|
|
202
|
+
el.node.openingElement.attributes.forEach(attr => {
|
|
203
|
+
if (attr.type === 'JSXSpreadAttribute' || !attr.value || !systemProps.includes(attr?.name?.name)) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const key = attr?.name?.name;
|
|
207
|
+
const literal = attr?.value;
|
|
208
|
+
const val = literal.type === 'JSXExpressionContainer' ? literal.expression : literal;
|
|
209
|
+
const shouldPrune = !elementReplacement[elementName] || elementReplacement[elementName].matcher(key, val);
|
|
210
|
+
if (key && val) {
|
|
211
|
+
if (shouldPrune) {
|
|
212
|
+
sx.properties.push(j.property('init', j.identifier(key), val));
|
|
213
|
+
attrToPrune.push(key);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
if (sx.properties.length) {
|
|
218
|
+
el.node.openingElement.attributes = el.node.openingElement.attributes.filter(attr => attr.type !== 'JSXAttribute' || !attrToPrune.includes(attr?.name?.name));
|
|
219
|
+
let finalSx;
|
|
220
|
+
if (!existingSxValue) {
|
|
221
|
+
finalSx = sx;
|
|
222
|
+
} else if (existingSxValue?.type === 'ObjectExpression') {
|
|
223
|
+
sx.properties.push(...existingSxValue.properties);
|
|
224
|
+
finalSx = sx;
|
|
225
|
+
} else if (existingSxValue?.type === 'ArrayExpression') {
|
|
226
|
+
existingSxValue.elements = [sx, ...existingSxValue.elements];
|
|
227
|
+
finalSx = existingSxValue;
|
|
228
|
+
} else {
|
|
229
|
+
finalSx = j.arrayExpression([sx, existingSxValue.type === 'Identifier' ? j.spreadElement(j.conditionalExpression(j.callExpression(j.memberExpression(j.identifier('Array'), j.identifier('isArray')), [existingSxValue]), existingSxValue, j.arrayExpression([existingSxValue]))) : existingSxValue]);
|
|
230
|
+
}
|
|
231
|
+
if (spreadElement && spreadElement.argument.type === 'Identifier') {
|
|
232
|
+
if (finalSx.type === 'ObjectExpression') {
|
|
233
|
+
const propSx = j.memberExpression(spreadElement.argument, j.identifier('sx'));
|
|
234
|
+
finalSx = j.arrayExpression([finalSx, j.spreadElement(j.conditionalExpression(j.callExpression(j.memberExpression(j.identifier('Array'), j.identifier('isArray')), [propSx]), propSx, j.arrayExpression([propSx])))]);
|
|
235
|
+
} else if (finalSx.type === 'ArrayExpression') {
|
|
236
|
+
finalSx.elements.push(j.memberExpression(spreadElement.argument, j.identifier('sx')));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
el.node.openingElement.attributes.push(j.jsxAttribute(j.jsxIdentifier('sx'), j.jsxExpressionContainer(finalSx)));
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
return root.toSource(printOptions);
|
|
243
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _material = require("@mui/material");
|
|
5
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
6
|
+
var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
|
|
7
|
+
var _Link2 = _interopRequireDefault(require("@mui/material/Link"));
|
|
8
|
+
var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
|
|
9
|
+
var _TimelineContent = _interopRequireDefault(require("@mui/lab/TimelineContent"));
|
|
10
|
+
var _TimelineOppositeContent = _interopRequireDefault(require("@mui/lab/TimelineOppositeContent"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
var _Link;
|
|
13
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
14
|
+
typography: "body1"
|
|
15
|
+
});
|
|
16
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
17
|
+
color: "palette.main",
|
|
18
|
+
sx: {
|
|
19
|
+
display: 'block'
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
23
|
+
container: true,
|
|
24
|
+
flexDirection: `column`
|
|
25
|
+
});
|
|
26
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid2, {
|
|
27
|
+
container: true,
|
|
28
|
+
flexDirection: `column`
|
|
29
|
+
});
|
|
30
|
+
const sx = {
|
|
31
|
+
display: 'flex'
|
|
32
|
+
};
|
|
33
|
+
const ml = 2;
|
|
34
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
35
|
+
color: "#fff",
|
|
36
|
+
mb: 5
|
|
37
|
+
});
|
|
38
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
39
|
+
color: "hsl(200 30% 30%)",
|
|
40
|
+
mb: 5
|
|
41
|
+
});
|
|
42
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
43
|
+
variant: "body1",
|
|
44
|
+
color: "primary.main",
|
|
45
|
+
ml: ml,
|
|
46
|
+
sx: sx
|
|
47
|
+
});
|
|
48
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
49
|
+
variant: "body1",
|
|
50
|
+
color: "divider",
|
|
51
|
+
ml: ml,
|
|
52
|
+
sx: sx
|
|
53
|
+
});
|
|
54
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
55
|
+
variant: "body1",
|
|
56
|
+
color: "inherit",
|
|
57
|
+
ml: ml,
|
|
58
|
+
sx: sx
|
|
59
|
+
});
|
|
60
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
61
|
+
fontSize: "xl4",
|
|
62
|
+
lineHeight: 1,
|
|
63
|
+
startDecorator: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
64
|
+
fontSize: "lg",
|
|
65
|
+
textColor: "text.secondary",
|
|
66
|
+
children: "$"
|
|
67
|
+
}),
|
|
68
|
+
sx: {
|
|
69
|
+
alignItems: 'flex-start'
|
|
70
|
+
},
|
|
71
|
+
children: "25"
|
|
72
|
+
});
|
|
73
|
+
function Copyright(props) {
|
|
74
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
|
|
75
|
+
variant: "body2",
|
|
76
|
+
color: "text.secondary",
|
|
77
|
+
align: "center",
|
|
78
|
+
...props,
|
|
79
|
+
children: ['Copyright © ', _Link || (_Link = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Link2.default, {
|
|
80
|
+
color: "inherit",
|
|
81
|
+
href: "https://mui.com/",
|
|
82
|
+
children: "Your Website"
|
|
83
|
+
})), ' ', new Date().getFullYear(), '.']
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Stack.default, {
|
|
87
|
+
flex: "1",
|
|
88
|
+
sx: [...(Array.isArray(sx) ? sx : [sx])]
|
|
89
|
+
});
|
|
90
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
91
|
+
typography: "body1",
|
|
92
|
+
sx: foo.bar ? {
|
|
93
|
+
opacity: 0
|
|
94
|
+
} : sx
|
|
95
|
+
});
|
|
96
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Link2.default, {
|
|
97
|
+
color: "inherit",
|
|
98
|
+
href: "https://mui.com/",
|
|
99
|
+
children: "Sitemark"
|
|
100
|
+
});
|
|
101
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Link2.default, {
|
|
102
|
+
color: "text.secondary",
|
|
103
|
+
variant: "body2",
|
|
104
|
+
href: "#",
|
|
105
|
+
children: "Features"
|
|
106
|
+
});
|
|
107
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Link2.default, {
|
|
108
|
+
color: "primary",
|
|
109
|
+
href: "#",
|
|
110
|
+
children: "Primary Link"
|
|
111
|
+
});
|
|
112
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_DialogContentText.default, {
|
|
113
|
+
color: "text.secondary",
|
|
114
|
+
children: "Some content"
|
|
115
|
+
});
|
|
116
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_DialogContentText.default, {
|
|
117
|
+
color: "inherit",
|
|
118
|
+
mt: 2,
|
|
119
|
+
children: "Inherited"
|
|
120
|
+
});
|
|
121
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_DialogContentText.default, {
|
|
122
|
+
color: "primary",
|
|
123
|
+
children: "Primary"
|
|
124
|
+
});
|
|
125
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_TimelineOppositeContent.default, {
|
|
126
|
+
color: "text.secondary",
|
|
127
|
+
children: "09:30 am"
|
|
128
|
+
});
|
|
129
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_TimelineContent.default, {
|
|
130
|
+
color: "inherit",
|
|
131
|
+
children: "Eat"
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// Dynamic color values (expression, not string literal)
|
|
135
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
136
|
+
color: dynamicColor,
|
|
137
|
+
mb: 2,
|
|
138
|
+
children: "Dynamic"
|
|
139
|
+
});
|
|
140
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Link2.default, {
|
|
141
|
+
color: linkColor,
|
|
142
|
+
href: "#",
|
|
143
|
+
children: "Dynamic Link"
|
|
144
|
+
});
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _material = require("@mui/material");
|
|
5
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
6
|
+
var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
|
|
7
|
+
var _Link2 = _interopRequireDefault(require("@mui/material/Link"));
|
|
8
|
+
var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
|
|
9
|
+
var _TimelineContent = _interopRequireDefault(require("@mui/lab/TimelineContent"));
|
|
10
|
+
var _TimelineOppositeContent = _interopRequireDefault(require("@mui/lab/TimelineOppositeContent"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
var _Link;
|
|
13
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
14
|
+
sx: {
|
|
15
|
+
typography: "body1"
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
19
|
+
sx: {
|
|
20
|
+
color: "palette.main",
|
|
21
|
+
display: 'block'
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
25
|
+
container: true,
|
|
26
|
+
sx: {
|
|
27
|
+
flexDirection: `column`
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid2, {
|
|
31
|
+
container: true,
|
|
32
|
+
sx: {
|
|
33
|
+
flexDirection: `column`
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const sx = {
|
|
37
|
+
display: 'flex'
|
|
38
|
+
};
|
|
39
|
+
const ml = 2;
|
|
40
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
41
|
+
sx: {
|
|
42
|
+
color: "#fff",
|
|
43
|
+
mb: 5
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
47
|
+
sx: {
|
|
48
|
+
color: "hsl(200 30% 30%)",
|
|
49
|
+
mb: 5
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
53
|
+
variant: "body1",
|
|
54
|
+
sx: [{
|
|
55
|
+
color: "primary.main",
|
|
56
|
+
ml: ml
|
|
57
|
+
}, ...(Array.isArray(sx) ? sx : [sx])]
|
|
58
|
+
});
|
|
59
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
60
|
+
variant: "body1",
|
|
61
|
+
sx: [{
|
|
62
|
+
color: "divider",
|
|
63
|
+
ml: ml
|
|
64
|
+
}, ...(Array.isArray(sx) ? sx : [sx])]
|
|
65
|
+
});
|
|
66
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
67
|
+
variant: "body1",
|
|
68
|
+
sx: [{
|
|
69
|
+
color: "inherit",
|
|
70
|
+
ml: ml
|
|
71
|
+
}, ...(Array.isArray(sx) ? sx : [sx])]
|
|
72
|
+
});
|
|
73
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
74
|
+
startDecorator: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
75
|
+
textColor: "text.secondary",
|
|
76
|
+
sx: {
|
|
77
|
+
fontSize: "lg"
|
|
78
|
+
},
|
|
79
|
+
children: "$"
|
|
80
|
+
}),
|
|
81
|
+
sx: {
|
|
82
|
+
fontSize: "xl4",
|
|
83
|
+
lineHeight: 1,
|
|
84
|
+
alignItems: 'flex-start'
|
|
85
|
+
},
|
|
86
|
+
children: "25"
|
|
87
|
+
});
|
|
88
|
+
function Copyright(props) {
|
|
89
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
|
|
90
|
+
variant: "body2",
|
|
91
|
+
align: "center",
|
|
92
|
+
...props,
|
|
93
|
+
sx: [{
|
|
94
|
+
color: "text.secondary"
|
|
95
|
+
}, ...(Array.isArray(props.sx) ? props.sx : [props.sx])],
|
|
96
|
+
children: ['Copyright © ', _Link || (_Link = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Link2.default, {
|
|
97
|
+
color: "inherit",
|
|
98
|
+
href: "https://mui.com/",
|
|
99
|
+
children: "Your Website"
|
|
100
|
+
})), ' ', new Date().getFullYear(), '.']
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Stack.default, {
|
|
104
|
+
sx: [{
|
|
105
|
+
flex: "1"
|
|
106
|
+
}, ...(Array.isArray(sx) ? sx : [sx])]
|
|
107
|
+
});
|
|
108
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
109
|
+
sx: [{
|
|
110
|
+
typography: "body1"
|
|
111
|
+
}, foo.bar ? {
|
|
112
|
+
opacity: 0
|
|
113
|
+
} : sx]
|
|
114
|
+
});
|
|
115
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Link2.default, {
|
|
116
|
+
color: "inherit",
|
|
117
|
+
href: "https://mui.com/",
|
|
118
|
+
children: "Sitemark"
|
|
119
|
+
});
|
|
120
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Link2.default, {
|
|
121
|
+
variant: "body2",
|
|
122
|
+
href: "#",
|
|
123
|
+
sx: {
|
|
124
|
+
color: "text.secondary"
|
|
125
|
+
},
|
|
126
|
+
children: "Features"
|
|
127
|
+
});
|
|
128
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Link2.default, {
|
|
129
|
+
color: "primary",
|
|
130
|
+
href: "#",
|
|
131
|
+
children: "Primary Link"
|
|
132
|
+
});
|
|
133
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_DialogContentText.default, {
|
|
134
|
+
sx: {
|
|
135
|
+
color: "text.secondary"
|
|
136
|
+
},
|
|
137
|
+
children: "Some content"
|
|
138
|
+
});
|
|
139
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_DialogContentText.default, {
|
|
140
|
+
sx: {
|
|
141
|
+
color: "inherit",
|
|
142
|
+
mt: 2
|
|
143
|
+
},
|
|
144
|
+
children: "Inherited"
|
|
145
|
+
});
|
|
146
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_DialogContentText.default, {
|
|
147
|
+
color: "primary",
|
|
148
|
+
children: "Primary"
|
|
149
|
+
});
|
|
150
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_TimelineOppositeContent.default, {
|
|
151
|
+
sx: {
|
|
152
|
+
color: "text.secondary"
|
|
153
|
+
},
|
|
154
|
+
children: "09:30 am"
|
|
155
|
+
});
|
|
156
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_TimelineContent.default, {
|
|
157
|
+
sx: {
|
|
158
|
+
color: "inherit"
|
|
159
|
+
},
|
|
160
|
+
children: "Eat"
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// Dynamic color values (expression, not string literal)
|
|
164
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
165
|
+
color: dynamicColor,
|
|
166
|
+
sx: {
|
|
167
|
+
mb: 2
|
|
168
|
+
},
|
|
169
|
+
children: "Dynamic"
|
|
170
|
+
});
|
|
171
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Link2.default, {
|
|
172
|
+
color: linkColor,
|
|
173
|
+
href: "#",
|
|
174
|
+
children: "Dynamic Link"
|
|
175
|
+
});
|