@mui/material 5.2.1 → 5.2.2
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 +65 -1
- package/CssBaseline/CssBaseline.d.ts +1 -1
- package/CssBaseline/CssBaseline.js +1 -1
- package/List/List.d.ts +12 -2
- package/MenuList/MenuList.d.ts +47 -36
- package/README.md +2 -0
- package/ScopedCssBaseline/ScopedCssBaseline.d.ts +1 -1
- package/ScopedCssBaseline/ScopedCssBaseline.js +1 -1
- package/Snackbar/Snackbar.d.ts +4 -4
- package/Snackbar/Snackbar.js +60 -4
- package/TextField/TextField.js +3 -2
- package/index.js +1 -1
- package/legacy/CssBaseline/CssBaseline.js +1 -1
- package/legacy/ScopedCssBaseline/ScopedCssBaseline.js +1 -1
- package/legacy/Snackbar/Snackbar.js +60 -4
- package/legacy/TextField/TextField.js +3 -2
- package/legacy/index.js +1 -1
- package/legacy/styles/adaptV4Theme.js +1 -1
- package/legacy/styles/responsiveFontSizes.js +1 -1
- package/modern/CssBaseline/CssBaseline.js +1 -1
- package/modern/ScopedCssBaseline/ScopedCssBaseline.js +1 -1
- package/modern/Snackbar/Snackbar.js +60 -4
- package/modern/TextField/TextField.js +3 -2
- package/modern/index.js +1 -1
- package/modern/styles/adaptV4Theme.js +1 -1
- package/modern/styles/responsiveFontSizes.js +1 -1
- package/node/CssBaseline/CssBaseline.js +1 -1
- package/node/ScopedCssBaseline/ScopedCssBaseline.js +1 -1
- package/node/Snackbar/Snackbar.js +60 -4
- package/node/TextField/TextField.js +2 -1
- package/node/index.js +1 -1
- package/node/styles/adaptV4Theme.js +1 -1
- package/node/styles/responsiveFontSizes.js +1 -1
- package/package.json +4 -4
- package/styles/adaptV4Theme.js +1 -1
- package/styles/index.d.ts +2 -1
- package/styles/responsiveFontSizes.js +1 -1
- package/umd/material-ui.development.js +74 -14
- package/umd/material-ui.production.min.js +20 -20
|
@@ -92,7 +92,7 @@ process.env.NODE_ENV !== "production" ? ScopedCssBaseline.propTypes
|
|
|
92
92
|
component: PropTypes.elementType,
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
|
-
* Enable `color-scheme`
|
|
95
|
+
* Enable `color-scheme` CSS property to use `theme.palette.mode`.
|
|
96
96
|
* For more details, check out https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
|
|
97
97
|
* For browser support, check out https://caniuse.com/?search=color-scheme
|
|
98
98
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
const _excluded = ["onEnter", "onExited"],
|
|
4
|
-
_excluded2 = ["action", "anchorOrigin", "autoHideDuration", "children", "className", "ClickAwayListenerProps", "ContentProps", "disableWindowBlurListener", "message", "onClose", "onMouseEnter", "onMouseLeave", "open", "resumeHideDuration", "TransitionComponent", "transitionDuration", "TransitionProps"];
|
|
4
|
+
_excluded2 = ["action", "anchorOrigin", "autoHideDuration", "children", "className", "ClickAwayListenerProps", "ContentProps", "disableWindowBlurListener", "message", "onBlur", "onClose", "onFocus", "onMouseEnter", "onMouseLeave", "open", "resumeHideDuration", "TransitionComponent", "transitionDuration", "TransitionProps"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import clsx from 'clsx';
|
|
@@ -110,7 +110,9 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
110
110
|
ContentProps,
|
|
111
111
|
disableWindowBlurListener = false,
|
|
112
112
|
message,
|
|
113
|
+
onBlur,
|
|
113
114
|
onClose,
|
|
115
|
+
onFocus,
|
|
114
116
|
onMouseEnter,
|
|
115
117
|
onMouseLeave,
|
|
116
118
|
open,
|
|
@@ -180,6 +182,14 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
180
182
|
}
|
|
181
183
|
}, [autoHideDuration, resumeHideDuration, setAutoHideTimer]);
|
|
182
184
|
|
|
185
|
+
const handleFocus = event => {
|
|
186
|
+
if (onFocus) {
|
|
187
|
+
onFocus(event);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
handlePause();
|
|
191
|
+
};
|
|
192
|
+
|
|
183
193
|
const handleMouseEnter = event => {
|
|
184
194
|
if (onMouseEnter) {
|
|
185
195
|
onMouseEnter(event);
|
|
@@ -188,6 +198,14 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
188
198
|
handlePause();
|
|
189
199
|
};
|
|
190
200
|
|
|
201
|
+
const handleBlur = event => {
|
|
202
|
+
if (onBlur) {
|
|
203
|
+
onBlur(event);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
handleResume();
|
|
207
|
+
};
|
|
208
|
+
|
|
191
209
|
const handleMouseLeave = event => {
|
|
192
210
|
if (onMouseLeave) {
|
|
193
211
|
onMouseLeave(event);
|
|
@@ -230,7 +248,33 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
230
248
|
}
|
|
231
249
|
|
|
232
250
|
return undefined;
|
|
233
|
-
}, [disableWindowBlurListener, handleResume, open]);
|
|
251
|
+
}, [disableWindowBlurListener, handleResume, open]);
|
|
252
|
+
React.useEffect(() => {
|
|
253
|
+
if (!open) {
|
|
254
|
+
return undefined;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* @param {KeyboardEvent} nativeEvent
|
|
258
|
+
*/
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
function handleKeyDown(nativeEvent) {
|
|
262
|
+
if (!nativeEvent.defaultPrevented) {
|
|
263
|
+
// IE11, Edge (prior to using Bink?) use 'Esc'
|
|
264
|
+
if (nativeEvent.key === 'Escape' || nativeEvent.key === 'Esc') {
|
|
265
|
+
// not calling `preventDefault` since we don't know if people may ignore this event e.g. a permanently open snackbar
|
|
266
|
+
if (onClose) {
|
|
267
|
+
onClose(nativeEvent, 'escapeKeyDown');
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
274
|
+
return () => {
|
|
275
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
276
|
+
};
|
|
277
|
+
}, [exited, open, onClose]); // So we only render active snackbars.
|
|
234
278
|
|
|
235
279
|
if (!open && exited) {
|
|
236
280
|
return null;
|
|
@@ -241,6 +285,8 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
241
285
|
}, ClickAwayListenerProps, {
|
|
242
286
|
children: /*#__PURE__*/_jsx(SnackbarRoot, _extends({
|
|
243
287
|
className: clsx(classes.root, className),
|
|
288
|
+
onBlur: handleBlur,
|
|
289
|
+
onFocus: handleFocus,
|
|
244
290
|
onMouseEnter: handleMouseEnter,
|
|
245
291
|
onMouseLeave: handleMouseLeave,
|
|
246
292
|
ownerState: ownerState,
|
|
@@ -339,6 +385,11 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes
|
|
|
339
385
|
*/
|
|
340
386
|
message: PropTypes.node,
|
|
341
387
|
|
|
388
|
+
/**
|
|
389
|
+
* @ignore
|
|
390
|
+
*/
|
|
391
|
+
onBlur: PropTypes.func,
|
|
392
|
+
|
|
342
393
|
/**
|
|
343
394
|
* Callback fired when the component requests to be closed.
|
|
344
395
|
* Typically `onClose` is used to set state in the parent component,
|
|
@@ -346,11 +397,16 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes
|
|
|
346
397
|
* The `reason` parameter can optionally be used to control the response to `onClose`,
|
|
347
398
|
* for example ignoring `clickaway`.
|
|
348
399
|
*
|
|
349
|
-
* @param {React.SyntheticEvent<any>} event The event source of the callback.
|
|
350
|
-
* @param {string} reason Can be: `"timeout"` (`autoHideDuration` expired), `"clickaway"`.
|
|
400
|
+
* @param {React.SyntheticEvent<any> | Event} event The event source of the callback.
|
|
401
|
+
* @param {string} reason Can be: `"timeout"` (`autoHideDuration` expired), `"clickaway"`, or `"escapeKeyDown"`.
|
|
351
402
|
*/
|
|
352
403
|
onClose: PropTypes.func,
|
|
353
404
|
|
|
405
|
+
/**
|
|
406
|
+
* @ignore
|
|
407
|
+
*/
|
|
408
|
+
onFocus: PropTypes.func,
|
|
409
|
+
|
|
354
410
|
/**
|
|
355
411
|
* @ignore
|
|
356
412
|
*/
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
8
|
-
import { refType } from '@mui/utils';
|
|
8
|
+
import { refType, unstable_useId as useId } from '@mui/utils';
|
|
9
9
|
import styled from '../styles/styled';
|
|
10
10
|
import useThemeProps from '../styles/useThemeProps';
|
|
11
11
|
import Input from '../Input';
|
|
@@ -90,7 +90,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
90
90
|
FormHelperTextProps,
|
|
91
91
|
fullWidth = false,
|
|
92
92
|
helperText,
|
|
93
|
-
id,
|
|
93
|
+
id: idOverride,
|
|
94
94
|
InputLabelProps,
|
|
95
95
|
inputProps,
|
|
96
96
|
InputProps,
|
|
@@ -158,6 +158,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
158
158
|
InputMore['aria-describedby'] = undefined;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
const id = useId(idOverride);
|
|
161
162
|
const helperTextId = helperText && id ? `${id}-helper-text` : undefined;
|
|
162
163
|
const inputLabelId = label && id ? `${id}-label` : undefined;
|
|
163
164
|
const InputComponent = variantComponent[variant];
|
package/modern/index.js
CHANGED
|
@@ -32,7 +32,7 @@ export default function adaptV4Theme(inputTheme) {
|
|
|
32
32
|
const componentValue = theme.components[component] || {};
|
|
33
33
|
componentValue.defaultProps = props[component];
|
|
34
34
|
theme.components[component] = componentValue;
|
|
35
|
-
}); //
|
|
35
|
+
}); // CSS overrides
|
|
36
36
|
|
|
37
37
|
Object.keys(styleOverrides).forEach(component => {
|
|
38
38
|
const componentValue = theme.components[component] || {};
|
|
@@ -12,7 +12,7 @@ export default function responsiveFontSizes(themeInput, options = {}) {
|
|
|
12
12
|
const theme = _extends({}, themeInput);
|
|
13
13
|
|
|
14
14
|
theme.typography = _extends({}, theme.typography);
|
|
15
|
-
const typography = theme.typography; // Convert between
|
|
15
|
+
const typography = theme.typography; // Convert between CSS lengths e.g. em->px or px->rem
|
|
16
16
|
// Set the baseFontSize for your project. Defaults to 16px (also the browser default).
|
|
17
17
|
|
|
18
18
|
const convert = convertLength(typography.htmlFontSize);
|
|
@@ -117,7 +117,7 @@ process.env.NODE_ENV !== "production" ? CssBaseline.propTypes
|
|
|
117
117
|
children: _propTypes.default.node,
|
|
118
118
|
|
|
119
119
|
/**
|
|
120
|
-
* Enable `color-scheme`
|
|
120
|
+
* Enable `color-scheme` CSS property to use `theme.palette.mode`.
|
|
121
121
|
* For more details, check out https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
|
|
122
122
|
* For browser support, check out https://caniuse.com/?search=color-scheme
|
|
123
123
|
* @default false
|
|
@@ -113,7 +113,7 @@ process.env.NODE_ENV !== "production" ? ScopedCssBaseline.propTypes
|
|
|
113
113
|
component: _propTypes.default.elementType,
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
|
-
* Enable `color-scheme`
|
|
116
|
+
* Enable `color-scheme` CSS property to use `theme.palette.mode`.
|
|
117
117
|
* For more details, check out https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
|
|
118
118
|
* For browser support, check out https://caniuse.com/?search=color-scheme
|
|
119
119
|
*/
|
|
@@ -42,7 +42,7 @@ var _snackbarClasses = require("./snackbarClasses");
|
|
|
42
42
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
43
43
|
|
|
44
44
|
const _excluded = ["onEnter", "onExited"],
|
|
45
|
-
_excluded2 = ["action", "anchorOrigin", "autoHideDuration", "children", "className", "ClickAwayListenerProps", "ContentProps", "disableWindowBlurListener", "message", "onClose", "onMouseEnter", "onMouseLeave", "open", "resumeHideDuration", "TransitionComponent", "transitionDuration", "TransitionProps"];
|
|
45
|
+
_excluded2 = ["action", "anchorOrigin", "autoHideDuration", "children", "className", "ClickAwayListenerProps", "ContentProps", "disableWindowBlurListener", "message", "onBlur", "onClose", "onFocus", "onMouseEnter", "onMouseLeave", "open", "resumeHideDuration", "TransitionComponent", "transitionDuration", "TransitionProps"];
|
|
46
46
|
|
|
47
47
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
48
48
|
|
|
@@ -138,7 +138,9 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
138
138
|
ContentProps,
|
|
139
139
|
disableWindowBlurListener = false,
|
|
140
140
|
message,
|
|
141
|
+
onBlur,
|
|
141
142
|
onClose,
|
|
143
|
+
onFocus,
|
|
142
144
|
onMouseEnter,
|
|
143
145
|
onMouseLeave,
|
|
144
146
|
open,
|
|
@@ -205,6 +207,14 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
205
207
|
}
|
|
206
208
|
}, [autoHideDuration, resumeHideDuration, setAutoHideTimer]);
|
|
207
209
|
|
|
210
|
+
const handleFocus = event => {
|
|
211
|
+
if (onFocus) {
|
|
212
|
+
onFocus(event);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
handlePause();
|
|
216
|
+
};
|
|
217
|
+
|
|
208
218
|
const handleMouseEnter = event => {
|
|
209
219
|
if (onMouseEnter) {
|
|
210
220
|
onMouseEnter(event);
|
|
@@ -213,6 +223,14 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
213
223
|
handlePause();
|
|
214
224
|
};
|
|
215
225
|
|
|
226
|
+
const handleBlur = event => {
|
|
227
|
+
if (onBlur) {
|
|
228
|
+
onBlur(event);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
handleResume();
|
|
232
|
+
};
|
|
233
|
+
|
|
216
234
|
const handleMouseLeave = event => {
|
|
217
235
|
if (onMouseLeave) {
|
|
218
236
|
onMouseLeave(event);
|
|
@@ -255,7 +273,33 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
255
273
|
}
|
|
256
274
|
|
|
257
275
|
return undefined;
|
|
258
|
-
}, [disableWindowBlurListener, handleResume, open]);
|
|
276
|
+
}, [disableWindowBlurListener, handleResume, open]);
|
|
277
|
+
React.useEffect(() => {
|
|
278
|
+
if (!open) {
|
|
279
|
+
return undefined;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* @param {KeyboardEvent} nativeEvent
|
|
283
|
+
*/
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
function handleKeyDown(nativeEvent) {
|
|
287
|
+
if (!nativeEvent.defaultPrevented) {
|
|
288
|
+
// IE11, Edge (prior to using Bink?) use 'Esc'
|
|
289
|
+
if (nativeEvent.key === 'Escape' || nativeEvent.key === 'Esc') {
|
|
290
|
+
// not calling `preventDefault` since we don't know if people may ignore this event e.g. a permanently open snackbar
|
|
291
|
+
if (onClose) {
|
|
292
|
+
onClose(nativeEvent, 'escapeKeyDown');
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
299
|
+
return () => {
|
|
300
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
301
|
+
};
|
|
302
|
+
}, [exited, open, onClose]); // So we only render active snackbars.
|
|
259
303
|
|
|
260
304
|
if (!open && exited) {
|
|
261
305
|
return null;
|
|
@@ -266,6 +310,8 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
266
310
|
}, ClickAwayListenerProps, {
|
|
267
311
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(SnackbarRoot, (0, _extends2.default)({
|
|
268
312
|
className: (0, _clsx.default)(classes.root, className),
|
|
313
|
+
onBlur: handleBlur,
|
|
314
|
+
onFocus: handleFocus,
|
|
269
315
|
onMouseEnter: handleMouseEnter,
|
|
270
316
|
onMouseLeave: handleMouseLeave,
|
|
271
317
|
ownerState: ownerState,
|
|
@@ -364,6 +410,11 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes
|
|
|
364
410
|
*/
|
|
365
411
|
message: _propTypes.default.node,
|
|
366
412
|
|
|
413
|
+
/**
|
|
414
|
+
* @ignore
|
|
415
|
+
*/
|
|
416
|
+
onBlur: _propTypes.default.func,
|
|
417
|
+
|
|
367
418
|
/**
|
|
368
419
|
* Callback fired when the component requests to be closed.
|
|
369
420
|
* Typically `onClose` is used to set state in the parent component,
|
|
@@ -371,11 +422,16 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes
|
|
|
371
422
|
* The `reason` parameter can optionally be used to control the response to `onClose`,
|
|
372
423
|
* for example ignoring `clickaway`.
|
|
373
424
|
*
|
|
374
|
-
* @param {React.SyntheticEvent<any>} event The event source of the callback.
|
|
375
|
-
* @param {string} reason Can be: `"timeout"` (`autoHideDuration` expired), `"clickaway"`.
|
|
425
|
+
* @param {React.SyntheticEvent<any> | Event} event The event source of the callback.
|
|
426
|
+
* @param {string} reason Can be: `"timeout"` (`autoHideDuration` expired), `"clickaway"`, or `"escapeKeyDown"`.
|
|
376
427
|
*/
|
|
377
428
|
onClose: _propTypes.default.func,
|
|
378
429
|
|
|
430
|
+
/**
|
|
431
|
+
* @ignore
|
|
432
|
+
*/
|
|
433
|
+
onFocus: _propTypes.default.func,
|
|
434
|
+
|
|
379
435
|
/**
|
|
380
436
|
* @ignore
|
|
381
437
|
*/
|
|
@@ -120,7 +120,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
120
120
|
FormHelperTextProps,
|
|
121
121
|
fullWidth = false,
|
|
122
122
|
helperText,
|
|
123
|
-
id,
|
|
123
|
+
id: idOverride,
|
|
124
124
|
InputLabelProps,
|
|
125
125
|
inputProps,
|
|
126
126
|
InputProps,
|
|
@@ -188,6 +188,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
188
188
|
InputMore['aria-describedby'] = undefined;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
const id = (0, _utils.unstable_useId)(idOverride);
|
|
191
192
|
const helperTextId = helperText && id ? `${id}-helper-text` : undefined;
|
|
192
193
|
const inputLabelId = label && id ? `${id}-label` : undefined;
|
|
193
194
|
const InputComponent = variantComponent[variant];
|
package/node/index.js
CHANGED
|
@@ -43,7 +43,7 @@ function adaptV4Theme(inputTheme) {
|
|
|
43
43
|
const componentValue = theme.components[component] || {};
|
|
44
44
|
componentValue.defaultProps = props[component];
|
|
45
45
|
theme.components[component] = componentValue;
|
|
46
|
-
}); //
|
|
46
|
+
}); // CSS overrides
|
|
47
47
|
|
|
48
48
|
Object.keys(styleOverrides).forEach(component => {
|
|
49
49
|
const componentValue = theme.components[component] || {};
|
|
@@ -22,7 +22,7 @@ function responsiveFontSizes(themeInput, options = {}) {
|
|
|
22
22
|
} = options;
|
|
23
23
|
const theme = (0, _extends2.default)({}, themeInput);
|
|
24
24
|
theme.typography = (0, _extends2.default)({}, theme.typography);
|
|
25
|
-
const typography = theme.typography; // Convert between
|
|
25
|
+
const typography = theme.typography; // Convert between CSS lengths e.g. em->px or px->rem
|
|
26
26
|
// Set the baseFontSize for your project. Defaults to 16px (also the browser default).
|
|
27
27
|
|
|
28
28
|
const convert = (0, _cssUtils.convertLength)(typography.htmlFontSize);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "Quickly build beautiful React apps. MUI is a simple and customizable component library to build faster, beautiful, and more accessible React applications. Follow your own design system, or start with Material Design.",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@babel/runtime": "^7.16.3",
|
|
49
|
-
"@mui/base": "5.0.0-alpha.
|
|
50
|
-
"@mui/system": "^5.2.
|
|
49
|
+
"@mui/base": "5.0.0-alpha.58",
|
|
50
|
+
"@mui/system": "^5.2.2",
|
|
51
51
|
"@mui/types": "^7.1.0",
|
|
52
|
-
"@mui/utils": "^5.2.
|
|
52
|
+
"@mui/utils": "^5.2.2",
|
|
53
53
|
"@types/react-transition-group": "^4.4.4",
|
|
54
54
|
"clsx": "^1.1.1",
|
|
55
55
|
"csstype": "^3.0.10",
|
package/styles/adaptV4Theme.js
CHANGED
|
@@ -32,7 +32,7 @@ export default function adaptV4Theme(inputTheme) {
|
|
|
32
32
|
const componentValue = theme.components[component] || {};
|
|
33
33
|
componentValue.defaultProps = props[component];
|
|
34
34
|
theme.components[component] = componentValue;
|
|
35
|
-
}); //
|
|
35
|
+
}); // CSS overrides
|
|
36
36
|
|
|
37
37
|
Object.keys(styleOverrides).forEach(component => {
|
|
38
38
|
const componentValue = theme.components[component] || {};
|
package/styles/index.d.ts
CHANGED
|
@@ -55,6 +55,8 @@ export {
|
|
|
55
55
|
lighten,
|
|
56
56
|
ColorFormat,
|
|
57
57
|
ColorObject,
|
|
58
|
+
StyledEngineProvider,
|
|
59
|
+
SxProps,
|
|
58
60
|
experimental_sx,
|
|
59
61
|
} from '@mui/system';
|
|
60
62
|
export { default as useTheme } from './useTheme';
|
|
@@ -70,7 +72,6 @@ export { ComponentsProps, ComponentsPropsList } from './props';
|
|
|
70
72
|
export { ComponentsVariants } from './variants';
|
|
71
73
|
export { ComponentsOverrides, ComponentNameToClassKey } from './overrides';
|
|
72
74
|
export { Components } from './components';
|
|
73
|
-
export { StyledEngineProvider } from '@mui/system';
|
|
74
75
|
|
|
75
76
|
export type ClassNameMap<ClassKey extends string = string> = Record<ClassKey, string>;
|
|
76
77
|
|
|
@@ -12,7 +12,7 @@ export default function responsiveFontSizes(themeInput, options = {}) {
|
|
|
12
12
|
const theme = _extends({}, themeInput);
|
|
13
13
|
|
|
14
14
|
theme.typography = _extends({}, theme.typography);
|
|
15
|
-
const typography = theme.typography; // Convert between
|
|
15
|
+
const typography = theme.typography; // Convert between CSS lengths e.g. em->px or px->rem
|
|
16
16
|
// Set the baseFontSize for your project. Defaults to 16px (also the browser default).
|
|
17
17
|
|
|
18
18
|
const convert = convertLength(typography.htmlFontSize);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.2.
|
|
1
|
+
/** @license MUI v5.2.2
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -2008,7 +2008,7 @@
|
|
|
2008
2008
|
|
|
2009
2009
|
var pkg = {
|
|
2010
2010
|
name: "@emotion/react",
|
|
2011
|
-
version: "11.
|
|
2011
|
+
version: "11.7.0",
|
|
2012
2012
|
main: "dist/emotion-react.cjs.js",
|
|
2013
2013
|
module: "dist/emotion-react.esm.js",
|
|
2014
2014
|
browser: {
|
|
@@ -4998,15 +4998,18 @@
|
|
|
4998
4998
|
const useEnhancedEffect = typeof window !== 'undefined' ? React__namespace.useLayoutEffect : React__namespace.useEffect;
|
|
4999
4999
|
var useEnhancedEffect$1 = useEnhancedEffect;
|
|
5000
5000
|
|
|
5001
|
+
let globalId = 0;
|
|
5001
5002
|
function useId(idOverride) {
|
|
5002
5003
|
const [defaultId, setDefaultId] = React__namespace.useState(idOverride);
|
|
5003
5004
|
const id = idOverride || defaultId;
|
|
5004
5005
|
React__namespace.useEffect(() => {
|
|
5005
5006
|
if (defaultId == null) {
|
|
5006
5007
|
// Fallback to this default id when possible.
|
|
5007
|
-
// Use the
|
|
5008
|
+
// Use the incrementing value for client-side rendering only.
|
|
5008
5009
|
// We can't use it server-side.
|
|
5009
|
-
|
|
5010
|
+
// If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem
|
|
5011
|
+
globalId += 1;
|
|
5012
|
+
setDefaultId(`mui-${globalId}`);
|
|
5010
5013
|
}
|
|
5011
5014
|
}, [defaultId]);
|
|
5012
5015
|
return id;
|
|
@@ -5095,7 +5098,7 @@
|
|
|
5095
5098
|
// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js
|
|
5096
5099
|
let hadKeyboardEvent = true;
|
|
5097
5100
|
let hadFocusVisibleRecently = false;
|
|
5098
|
-
let hadFocusVisibleRecentlyTimeout
|
|
5101
|
+
let hadFocusVisibleRecentlyTimeout;
|
|
5099
5102
|
const inputTypesWhitelist = {
|
|
5100
5103
|
text: true,
|
|
5101
5104
|
search: true,
|
|
@@ -7317,7 +7320,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
7317
7320
|
const componentValue = theme.components[component] || {};
|
|
7318
7321
|
componentValue.defaultProps = props[component];
|
|
7319
7322
|
theme.components[component] = componentValue;
|
|
7320
|
-
}); //
|
|
7323
|
+
}); // CSS overrides
|
|
7321
7324
|
|
|
7322
7325
|
Object.keys(styleOverrides).forEach(component => {
|
|
7323
7326
|
const componentValue = theme.components[component] || {};
|
|
@@ -16430,7 +16433,7 @@ const theme2 = createTheme({ palette: {
|
|
|
16430
16433
|
const theme = _extends({}, themeInput);
|
|
16431
16434
|
|
|
16432
16435
|
theme.typography = _extends({}, theme.typography);
|
|
16433
|
-
const typography = theme.typography; // Convert between
|
|
16436
|
+
const typography = theme.typography; // Convert between CSS lengths e.g. em->px or px->rem
|
|
16434
16437
|
// Set the baseFontSize for your project. Defaults to 16px (also the browser default).
|
|
16435
16438
|
|
|
16436
16439
|
const convert = convertLength(typography.htmlFontSize);
|
|
@@ -27208,7 +27211,7 @@ See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` )
|
|
|
27208
27211
|
children: propTypes.node,
|
|
27209
27212
|
|
|
27210
27213
|
/**
|
|
27211
|
-
* Enable `color-scheme`
|
|
27214
|
+
* Enable `color-scheme` CSS property to use `theme.palette.mode`.
|
|
27212
27215
|
* For more details, check out https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
|
|
27213
27216
|
* For browser support, check out https://caniuse.com/?search=color-scheme
|
|
27214
27217
|
* @default false
|
|
@@ -40753,7 +40756,7 @@ See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` )
|
|
|
40753
40756
|
component: propTypes.elementType,
|
|
40754
40757
|
|
|
40755
40758
|
/**
|
|
40756
|
-
* Enable `color-scheme`
|
|
40759
|
+
* Enable `color-scheme` CSS property to use `theme.palette.mode`.
|
|
40757
40760
|
* For more details, check out https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
|
|
40758
40761
|
* For browser support, check out https://caniuse.com/?search=color-scheme
|
|
40759
40762
|
*/
|
|
@@ -42733,7 +42736,7 @@ See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` )
|
|
|
42733
42736
|
var snackbarClasses$1 = snackbarClasses;
|
|
42734
42737
|
|
|
42735
42738
|
const _excluded$z = ["onEnter", "onExited"],
|
|
42736
|
-
_excluded2$2 = ["action", "anchorOrigin", "autoHideDuration", "children", "className", "ClickAwayListenerProps", "ContentProps", "disableWindowBlurListener", "message", "onClose", "onMouseEnter", "onMouseLeave", "open", "resumeHideDuration", "TransitionComponent", "transitionDuration", "TransitionProps"];
|
|
42739
|
+
_excluded2$2 = ["action", "anchorOrigin", "autoHideDuration", "children", "className", "ClickAwayListenerProps", "ContentProps", "disableWindowBlurListener", "message", "onBlur", "onClose", "onFocus", "onMouseEnter", "onMouseLeave", "open", "resumeHideDuration", "TransitionComponent", "transitionDuration", "TransitionProps"];
|
|
42737
42740
|
|
|
42738
42741
|
const useUtilityClasses$s = ownerState => {
|
|
42739
42742
|
const {
|
|
@@ -42827,7 +42830,9 @@ See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` )
|
|
|
42827
42830
|
ContentProps,
|
|
42828
42831
|
disableWindowBlurListener = false,
|
|
42829
42832
|
message,
|
|
42833
|
+
onBlur,
|
|
42830
42834
|
onClose,
|
|
42835
|
+
onFocus,
|
|
42831
42836
|
onMouseEnter,
|
|
42832
42837
|
onMouseLeave,
|
|
42833
42838
|
open,
|
|
@@ -42897,6 +42902,14 @@ See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` )
|
|
|
42897
42902
|
}
|
|
42898
42903
|
}, [autoHideDuration, resumeHideDuration, setAutoHideTimer]);
|
|
42899
42904
|
|
|
42905
|
+
const handleFocus = event => {
|
|
42906
|
+
if (onFocus) {
|
|
42907
|
+
onFocus(event);
|
|
42908
|
+
}
|
|
42909
|
+
|
|
42910
|
+
handlePause();
|
|
42911
|
+
};
|
|
42912
|
+
|
|
42900
42913
|
const handleMouseEnter = event => {
|
|
42901
42914
|
if (onMouseEnter) {
|
|
42902
42915
|
onMouseEnter(event);
|
|
@@ -42905,6 +42918,14 @@ See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` )
|
|
|
42905
42918
|
handlePause();
|
|
42906
42919
|
};
|
|
42907
42920
|
|
|
42921
|
+
const handleBlur = event => {
|
|
42922
|
+
if (onBlur) {
|
|
42923
|
+
onBlur(event);
|
|
42924
|
+
}
|
|
42925
|
+
|
|
42926
|
+
handleResume();
|
|
42927
|
+
};
|
|
42928
|
+
|
|
42908
42929
|
const handleMouseLeave = event => {
|
|
42909
42930
|
if (onMouseLeave) {
|
|
42910
42931
|
onMouseLeave(event);
|
|
@@ -42947,7 +42968,33 @@ See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` )
|
|
|
42947
42968
|
}
|
|
42948
42969
|
|
|
42949
42970
|
return undefined;
|
|
42950
|
-
}, [disableWindowBlurListener, handleResume, open]);
|
|
42971
|
+
}, [disableWindowBlurListener, handleResume, open]);
|
|
42972
|
+
React__namespace.useEffect(() => {
|
|
42973
|
+
if (!open) {
|
|
42974
|
+
return undefined;
|
|
42975
|
+
}
|
|
42976
|
+
/**
|
|
42977
|
+
* @param {KeyboardEvent} nativeEvent
|
|
42978
|
+
*/
|
|
42979
|
+
|
|
42980
|
+
|
|
42981
|
+
function handleKeyDown(nativeEvent) {
|
|
42982
|
+
if (!nativeEvent.defaultPrevented) {
|
|
42983
|
+
// IE11, Edge (prior to using Bink?) use 'Esc'
|
|
42984
|
+
if (nativeEvent.key === 'Escape' || nativeEvent.key === 'Esc') {
|
|
42985
|
+
// not calling `preventDefault` since we don't know if people may ignore this event e.g. a permanently open snackbar
|
|
42986
|
+
if (onClose) {
|
|
42987
|
+
onClose(nativeEvent, 'escapeKeyDown');
|
|
42988
|
+
}
|
|
42989
|
+
}
|
|
42990
|
+
}
|
|
42991
|
+
}
|
|
42992
|
+
|
|
42993
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
42994
|
+
return () => {
|
|
42995
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
42996
|
+
};
|
|
42997
|
+
}, [exited, open, onClose]); // So we only render active snackbars.
|
|
42951
42998
|
|
|
42952
42999
|
if (!open && exited) {
|
|
42953
43000
|
return null;
|
|
@@ -42958,6 +43005,8 @@ See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` )
|
|
|
42958
43005
|
}, ClickAwayListenerProps, {
|
|
42959
43006
|
children: /*#__PURE__*/jsxRuntime_1(SnackbarRoot, _extends({
|
|
42960
43007
|
className: clsx(classes.root, className),
|
|
43008
|
+
onBlur: handleBlur,
|
|
43009
|
+
onFocus: handleFocus,
|
|
42961
43010
|
onMouseEnter: handleMouseEnter,
|
|
42962
43011
|
onMouseLeave: handleMouseLeave,
|
|
42963
43012
|
ownerState: ownerState,
|
|
@@ -43056,6 +43105,11 @@ See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` )
|
|
|
43056
43105
|
*/
|
|
43057
43106
|
message: propTypes.node,
|
|
43058
43107
|
|
|
43108
|
+
/**
|
|
43109
|
+
* @ignore
|
|
43110
|
+
*/
|
|
43111
|
+
onBlur: propTypes.func,
|
|
43112
|
+
|
|
43059
43113
|
/**
|
|
43060
43114
|
* Callback fired when the component requests to be closed.
|
|
43061
43115
|
* Typically `onClose` is used to set state in the parent component,
|
|
@@ -43063,11 +43117,16 @@ See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` )
|
|
|
43063
43117
|
* The `reason` parameter can optionally be used to control the response to `onClose`,
|
|
43064
43118
|
* for example ignoring `clickaway`.
|
|
43065
43119
|
*
|
|
43066
|
-
* @param {React.SyntheticEvent<any>} event The event source of the callback.
|
|
43067
|
-
* @param {string} reason Can be: `"timeout"` (`autoHideDuration` expired), `"clickaway"`.
|
|
43120
|
+
* @param {React.SyntheticEvent<any> | Event} event The event source of the callback.
|
|
43121
|
+
* @param {string} reason Can be: `"timeout"` (`autoHideDuration` expired), `"clickaway"`, or `"escapeKeyDown"`.
|
|
43068
43122
|
*/
|
|
43069
43123
|
onClose: propTypes.func,
|
|
43070
43124
|
|
|
43125
|
+
/**
|
|
43126
|
+
* @ignore
|
|
43127
|
+
*/
|
|
43128
|
+
onFocus: propTypes.func,
|
|
43129
|
+
|
|
43071
43130
|
/**
|
|
43072
43131
|
* @ignore
|
|
43073
43132
|
*/
|
|
@@ -50648,7 +50707,7 @@ See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` )
|
|
|
50648
50707
|
FormHelperTextProps,
|
|
50649
50708
|
fullWidth = false,
|
|
50650
50709
|
helperText,
|
|
50651
|
-
id,
|
|
50710
|
+
id: idOverride,
|
|
50652
50711
|
InputLabelProps,
|
|
50653
50712
|
inputProps,
|
|
50654
50713
|
InputProps,
|
|
@@ -50718,6 +50777,7 @@ See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` )
|
|
|
50718
50777
|
InputMore['aria-describedby'] = undefined;
|
|
50719
50778
|
}
|
|
50720
50779
|
|
|
50780
|
+
const id = useId(idOverride);
|
|
50721
50781
|
const helperTextId = helperText && id ? `${id}-helper-text` : undefined;
|
|
50722
50782
|
const inputLabelId = label && id ? `${id}-label` : undefined;
|
|
50723
50783
|
const InputComponent = variantComponent[variant];
|