@mui/material 5.3.1 → 5.4.3
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/Autocomplete/Autocomplete.d.ts +5 -0
- package/Autocomplete/Autocomplete.js +11 -3
- package/AvatarGroup/AvatarGroup.d.ts +10 -0
- package/AvatarGroup/AvatarGroup.js +19 -7
- package/Badge/Badge.js +3 -2
- package/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/ButtonBase/ButtonBase.d.ts +5 -1
- package/ButtonBase/ButtonBase.js +15 -2
- package/ButtonBase/TouchRipple.js +1 -2
- package/CHANGELOG.md +295 -27
- package/Dialog/Dialog.d.ts +4 -1
- package/Dialog/Dialog.js +10 -6
- package/Drawer/Drawer.d.ts +4 -1
- package/Drawer/Drawer.js +11 -9
- package/Fab/Fab.d.ts +4 -1
- package/Fab/Fab.js +8 -20
- package/Fab/fabClasses.js +1 -1
- package/Fade/Fade.d.ts +2 -2
- package/Fade/Fade.js +8 -8
- package/FormControlLabel/FormControlLabel.js +11 -3
- package/FormControlLabel/formControlLabelClasses.d.ts +2 -0
- package/FormControlLabel/formControlLabelClasses.js +1 -1
- package/FormGroup/FormGroup.js +14 -3
- package/FormGroup/formGroupClasses.d.ts +2 -0
- package/FormGroup/formGroupClasses.js +1 -1
- package/FormHelperText/FormHelperText.js +7 -9
- package/Grid/Grid.js +2 -4
- package/ImageList/ImageList.js +3 -1
- package/InputAdornment/InputAdornment.js +6 -9
- package/Modal/Modal.js +1 -1
- package/OutlinedInput/NotchedOutline.js +14 -16
- package/OutlinedInput/OutlinedInput.js +1 -1
- package/README.md +6 -6
- package/Radio/RadioButtonIcon.js +2 -6
- package/Rating/Rating.js +1 -1
- package/Select/Select.js +19 -7
- package/Select/SelectInput.js +12 -10
- package/Slide/Slide.d.ts +4 -4
- package/Slide/Slide.js +14 -14
- package/Slider/Slider.js +3 -1
- package/Snackbar/Snackbar.d.ts +2 -2
- package/Snackbar/Snackbar.js +12 -9
- package/SpeedDial/SpeedDial.d.ts +2 -2
- package/SpeedDial/SpeedDial.js +9 -7
- package/Step/StepContext.d.ts +20 -0
- package/Step/StepContext.js +10 -2
- package/Step/index.d.ts +3 -0
- package/Step/index.js +3 -1
- package/SwipeableDrawer/SwipeArea.js +1 -3
- package/SwipeableDrawer/SwipeableDrawer.js +8 -6
- package/TextField/TextField.js +1 -1
- package/ToggleButton/ToggleButton.d.ts +15 -0
- package/ToggleButton/ToggleButton.js +8 -2
- package/Zoom/Zoom.d.ts +2 -2
- package/Zoom/Zoom.js +8 -8
- package/index.d.ts +11 -3
- package/index.js +8 -3
- package/internal/SwitchBase.js +2 -6
- package/legacy/Autocomplete/Autocomplete.js +12 -3
- package/legacy/AvatarGroup/AvatarGroup.js +20 -7
- package/legacy/Badge/Badge.js +4 -2
- package/legacy/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/legacy/ButtonBase/ButtonBase.js +15 -2
- package/legacy/ButtonBase/TouchRipple.js +1 -2
- package/legacy/Dialog/Dialog.js +10 -6
- package/legacy/Drawer/Drawer.js +11 -9
- package/legacy/Fab/Fab.js +8 -20
- package/legacy/Fab/fabClasses.js +1 -1
- package/legacy/Fade/Fade.js +8 -8
- package/legacy/FormControlLabel/FormControlLabel.js +11 -3
- package/legacy/FormControlLabel/formControlLabelClasses.js +1 -1
- package/legacy/FormGroup/FormGroup.js +14 -3
- package/legacy/FormGroup/formGroupClasses.js +1 -1
- package/legacy/FormHelperText/FormHelperText.js +7 -9
- package/legacy/Grid/Grid.js +2 -4
- package/legacy/ImageList/ImageList.js +3 -1
- package/legacy/InputAdornment/InputAdornment.js +6 -9
- package/legacy/Modal/Modal.js +1 -1
- package/legacy/OutlinedInput/NotchedOutline.js +14 -16
- package/legacy/OutlinedInput/OutlinedInput.js +1 -1
- package/legacy/Radio/RadioButtonIcon.js +2 -6
- package/legacy/Rating/Rating.js +1 -1
- package/legacy/Select/Select.js +23 -7
- package/legacy/Select/SelectInput.js +12 -10
- package/legacy/Slide/Slide.js +14 -14
- package/legacy/Slider/Slider.js +3 -1
- package/legacy/Snackbar/Snackbar.js +12 -9
- package/legacy/SpeedDial/SpeedDial.js +9 -7
- package/legacy/Step/StepContext.js +10 -2
- package/legacy/Step/index.js +3 -1
- package/legacy/SwipeableDrawer/SwipeArea.js +1 -3
- package/legacy/SwipeableDrawer/SwipeableDrawer.js +8 -6
- package/legacy/TextField/TextField.js +1 -1
- package/legacy/ToggleButton/ToggleButton.js +8 -2
- package/legacy/Zoom/Zoom.js +8 -8
- package/legacy/index.js +8 -3
- package/legacy/internal/SwitchBase.js +2 -6
- package/legacy/locale/index.js +86 -78
- package/legacy/styles/makeStyles.js +1 -1
- package/legacy/styles/withStyles.js +1 -1
- package/legacy/styles/withTheme.js +1 -1
- package/legacy/useMediaQuery/useMediaQuery.js +87 -32
- package/locale/index.js +12 -6
- package/modern/Autocomplete/Autocomplete.js +11 -3
- package/modern/AvatarGroup/AvatarGroup.js +17 -7
- package/modern/Badge/Badge.js +3 -2
- package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/modern/ButtonBase/ButtonBase.js +15 -2
- package/modern/ButtonBase/TouchRipple.js +1 -2
- package/modern/Dialog/Dialog.js +10 -6
- package/modern/Drawer/Drawer.js +11 -9
- package/modern/Fab/Fab.js +8 -20
- package/modern/Fab/fabClasses.js +1 -1
- package/modern/Fade/Fade.js +8 -8
- package/modern/FormControlLabel/FormControlLabel.js +11 -3
- package/modern/FormControlLabel/formControlLabelClasses.js +1 -1
- package/modern/FormGroup/FormGroup.js +14 -3
- package/modern/FormGroup/formGroupClasses.js +1 -1
- package/modern/FormHelperText/FormHelperText.js +7 -9
- package/modern/Grid/Grid.js +2 -4
- package/modern/ImageList/ImageList.js +3 -1
- package/modern/InputAdornment/InputAdornment.js +6 -9
- package/modern/Modal/Modal.js +1 -1
- package/modern/OutlinedInput/NotchedOutline.js +14 -16
- package/modern/OutlinedInput/OutlinedInput.js +1 -1
- package/modern/Radio/RadioButtonIcon.js +2 -6
- package/modern/Rating/Rating.js +1 -1
- package/modern/Select/Select.js +19 -7
- package/modern/Select/SelectInput.js +12 -10
- package/modern/Slide/Slide.js +14 -14
- package/modern/Slider/Slider.js +3 -1
- package/modern/Snackbar/Snackbar.js +12 -9
- package/modern/SpeedDial/SpeedDial.js +9 -7
- package/modern/Step/StepContext.js +10 -2
- package/modern/Step/index.js +3 -1
- package/modern/SwipeableDrawer/SwipeArea.js +1 -3
- package/modern/SwipeableDrawer/SwipeableDrawer.js +8 -6
- package/modern/TextField/TextField.js +1 -1
- package/modern/ToggleButton/ToggleButton.js +8 -2
- package/modern/Zoom/Zoom.js +8 -8
- package/modern/index.js +8 -3
- package/modern/internal/SwitchBase.js +2 -6
- package/modern/locale/index.js +12 -6
- package/modern/styles/makeStyles.js +1 -1
- package/modern/styles/withStyles.js +1 -1
- package/modern/styles/withTheme.js +1 -1
- package/modern/useMediaQuery/useMediaQuery.js +69 -27
- package/node/Autocomplete/Autocomplete.js +11 -3
- package/node/AvatarGroup/AvatarGroup.js +19 -7
- package/node/Badge/Badge.js +3 -2
- package/node/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/node/ButtonBase/ButtonBase.js +15 -2
- package/node/ButtonBase/TouchRipple.js +1 -2
- package/node/Dialog/Dialog.js +11 -7
- package/node/Drawer/Drawer.js +11 -10
- package/node/Fab/Fab.js +8 -20
- package/node/Fab/fabClasses.js +1 -1
- package/node/Fade/Fade.js +7 -9
- package/node/FormControlLabel/FormControlLabel.js +12 -3
- package/node/FormControlLabel/formControlLabelClasses.js +1 -1
- package/node/FormGroup/FormGroup.js +15 -3
- package/node/FormGroup/formGroupClasses.js +1 -1
- package/node/FormHelperText/FormHelperText.js +6 -9
- package/node/Grid/Grid.js +2 -4
- package/node/ImageList/ImageList.js +3 -1
- package/node/InputAdornment/InputAdornment.js +5 -9
- package/node/Modal/Modal.js +1 -1
- package/node/OutlinedInput/NotchedOutline.js +12 -16
- package/node/OutlinedInput/OutlinedInput.js +1 -1
- package/node/Radio/RadioButtonIcon.js +2 -6
- package/node/Rating/Rating.js +1 -1
- package/node/Select/Select.js +22 -9
- package/node/Select/SelectInput.js +11 -10
- package/node/Slide/Slide.js +14 -16
- package/node/Slider/Slider.js +3 -1
- package/node/Snackbar/Snackbar.js +12 -10
- package/node/SpeedDial/SpeedDial.js +9 -7
- package/node/Step/StepContext.js +11 -1
- package/node/Step/index.js +22 -1
- package/node/SwipeableDrawer/SwipeArea.js +1 -3
- package/node/SwipeableDrawer/SwipeableDrawer.js +8 -7
- package/node/TextField/TextField.js +1 -1
- package/node/ToggleButton/ToggleButton.js +8 -2
- package/node/Zoom/Zoom.js +7 -9
- package/node/index.js +62 -16
- package/node/internal/SwitchBase.js +2 -6
- package/node/locale/index.js +12 -6
- package/node/styles/makeStyles.js +1 -1
- package/node/styles/withStyles.js +1 -1
- package/node/styles/withTheme.js +1 -1
- package/node/useMediaQuery/useMediaQuery.js +69 -27
- package/package.json +8 -8
- package/styles/ThemeProvider.d.ts +1 -1
- package/styles/index.d.ts +3 -0
- package/styles/makeStyles.js +1 -1
- package/styles/withStyles.js +1 -1
- package/styles/withTheme.js +1 -1
- package/umd/material-ui.development.js +5022 -7146
- package/umd/material-ui.production.min.js +21 -21
- package/useMediaQuery/useMediaQuery.d.ts +4 -0
- package/useMediaQuery/useMediaQuery.js +69 -27
package/legacy/Select/Select.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _StyledInput, _StyledFilledInput;
|
|
5
5
|
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -17,6 +17,7 @@ import FilledInput from '../FilledInput';
|
|
|
17
17
|
import OutlinedInput from '../OutlinedInput';
|
|
18
18
|
import useThemeProps from '../styles/useThemeProps';
|
|
19
19
|
import useForkRef from '../utils/useForkRef';
|
|
20
|
+
import styled, { rootShouldForwardProp } from '../styles/styled';
|
|
20
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
22
|
|
|
22
23
|
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
@@ -24,6 +25,19 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
|
24
25
|
return classes;
|
|
25
26
|
};
|
|
26
27
|
|
|
28
|
+
var styledRootConfig = {
|
|
29
|
+
name: 'MuiSelect',
|
|
30
|
+
overridesResolver: function overridesResolver(props, styles) {
|
|
31
|
+
return styles.root;
|
|
32
|
+
},
|
|
33
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
34
|
+
return rootShouldForwardProp(prop) && prop !== 'variant';
|
|
35
|
+
},
|
|
36
|
+
slot: 'Root'
|
|
37
|
+
};
|
|
38
|
+
var StyledInput = styled(Input, styledRootConfig)('');
|
|
39
|
+
var StyledOutlinedInput = styled(OutlinedInput, styledRootConfig)('');
|
|
40
|
+
var StyledFilledInput = styled(FilledInput, styledRootConfig)('');
|
|
27
41
|
var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
28
42
|
var props = useThemeProps({
|
|
29
43
|
name: 'MuiSelect',
|
|
@@ -58,7 +72,7 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
58
72
|
renderValue = props.renderValue,
|
|
59
73
|
SelectDisplayProps = props.SelectDisplayProps,
|
|
60
74
|
_props$variant = props.variant,
|
|
61
|
-
|
|
75
|
+
variantProp = _props$variant === void 0 ? 'outlined' : _props$variant,
|
|
62
76
|
other = _objectWithoutProperties(props, ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"]);
|
|
63
77
|
|
|
64
78
|
var inputComponent = native ? NativeSelectInput : SelectInput;
|
|
@@ -68,16 +82,17 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
68
82
|
muiFormControl: muiFormControl,
|
|
69
83
|
states: ['variant']
|
|
70
84
|
});
|
|
71
|
-
var variant = fcs.variant ||
|
|
85
|
+
var variant = fcs.variant || variantProp;
|
|
72
86
|
var InputComponent = input || {
|
|
73
|
-
standard:
|
|
74
|
-
outlined: /*#__PURE__*/_jsx(
|
|
87
|
+
standard: _StyledInput || (_StyledInput = /*#__PURE__*/_jsx(StyledInput, {})),
|
|
88
|
+
outlined: /*#__PURE__*/_jsx(StyledOutlinedInput, {
|
|
75
89
|
label: label
|
|
76
90
|
}),
|
|
77
|
-
filled:
|
|
91
|
+
filled: _StyledFilledInput || (_StyledFilledInput = /*#__PURE__*/_jsx(StyledFilledInput, {}))
|
|
78
92
|
}[variant];
|
|
79
93
|
|
|
80
94
|
var ownerState = _extends({}, props, {
|
|
95
|
+
variant: variant,
|
|
81
96
|
classes: classesProp
|
|
82
97
|
});
|
|
83
98
|
|
|
@@ -116,7 +131,8 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
116
131
|
notched: true
|
|
117
132
|
} : {}, {
|
|
118
133
|
ref: inputComponentRef,
|
|
119
|
-
className: clsx(InputComponent.props.className, className)
|
|
134
|
+
className: clsx(InputComponent.props.className, className),
|
|
135
|
+
variant: variant
|
|
120
136
|
}, other));
|
|
121
137
|
});
|
|
122
138
|
process.env.NODE_ENV !== "production" ? Select.propTypes
|
|
@@ -4,6 +4,9 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
4
4
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
5
5
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
6
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
7
|
+
|
|
8
|
+
var _span;
|
|
9
|
+
|
|
7
10
|
import * as React from 'react';
|
|
8
11
|
import { isFragment } from 'react-is';
|
|
9
12
|
import PropTypes from 'prop-types';
|
|
@@ -196,6 +199,10 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
196
199
|
}
|
|
197
200
|
}, [autoFocus]);
|
|
198
201
|
React.useEffect(function () {
|
|
202
|
+
if (!labelId) {
|
|
203
|
+
return undefined;
|
|
204
|
+
}
|
|
205
|
+
|
|
199
206
|
var label = ownerDocument(displayRef.current).getElementById(labelId);
|
|
200
207
|
|
|
201
208
|
if (label) {
|
|
@@ -295,7 +302,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
295
302
|
if (onChange) {
|
|
296
303
|
// Redefine target to allow name and value to be read.
|
|
297
304
|
// This allows seamless integration with the most popular form libraries.
|
|
298
|
-
// https://github.com/mui
|
|
305
|
+
// https://github.com/mui/material-ui/issues/13485#issuecomment-676048492
|
|
299
306
|
// Clone the event to not override `target` of the original event.
|
|
300
307
|
var nativeEvent = event.nativeEvent || event;
|
|
301
308
|
var clonedEvent = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
|
|
@@ -504,16 +511,11 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
504
511
|
className: clsx(classes.select, className, SelectDisplayProps.className) // The id is required for proper a11y
|
|
505
512
|
,
|
|
506
513
|
id: buttonId,
|
|
507
|
-
children: isEmpty(display) ?
|
|
508
|
-
/*#__PURE__*/
|
|
509
|
-
// notranslate needed while Google Translate will not fix zero-width space issue
|
|
510
|
-
// eslint-disable-next-line react/no-danger
|
|
511
|
-
_jsx("span", {
|
|
514
|
+
children: isEmpty(display) ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
515
|
+
_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
512
516
|
className: "notranslate",
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
}
|
|
516
|
-
}) : display
|
|
517
|
+
children: "\u200B"
|
|
518
|
+
})) : display
|
|
517
519
|
})), /*#__PURE__*/_jsx(SelectNativeInput, _extends({
|
|
518
520
|
value: Array.isArray(value) ? value.join(',') : value,
|
|
519
521
|
name: name,
|
package/legacy/Slide/Slide.js
CHANGED
|
@@ -7,7 +7,6 @@ import { elementAcceptingRef, HTMLElementType, chainPropTypes } from '@mui/utils
|
|
|
7
7
|
import debounce from '../utils/debounce';
|
|
8
8
|
import useForkRef from '../utils/useForkRef';
|
|
9
9
|
import useTheme from '../styles/useTheme';
|
|
10
|
-
import { duration, easing } from '../styles/createTransitions';
|
|
11
10
|
import { reflow, getTransitionProps } from '../transitions/utils';
|
|
12
11
|
import { ownerWindow } from '../utils'; // Translate the node so it can't be seen on the screen.
|
|
13
12
|
// Later, we're going to translate the node back to its original location with `none`.
|
|
@@ -81,20 +80,22 @@ export function setTranslateValue(direction, node, containerProp) {
|
|
|
81
80
|
node.style.transform = transform;
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
|
-
var defaultEasing = {
|
|
85
|
-
enter: easing.easeOut,
|
|
86
|
-
exit: easing.sharp
|
|
87
|
-
};
|
|
88
|
-
var defaultTimeout = {
|
|
89
|
-
enter: duration.enteringScreen,
|
|
90
|
-
exit: duration.leavingScreen
|
|
91
|
-
};
|
|
92
83
|
/**
|
|
93
84
|
* The Slide transition is used by the [Drawer](/components/drawers/) component.
|
|
94
85
|
* It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
|
|
95
86
|
*/
|
|
96
87
|
|
|
97
88
|
var Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {
|
|
89
|
+
var theme = useTheme();
|
|
90
|
+
var defaultEasing = {
|
|
91
|
+
enter: theme.transitions.easing.easeOut,
|
|
92
|
+
exit: theme.transitions.easing.sharp
|
|
93
|
+
};
|
|
94
|
+
var defaultTimeout = {
|
|
95
|
+
enter: theme.transitions.duration.enteringScreen,
|
|
96
|
+
exit: theme.transitions.duration.leavingScreen
|
|
97
|
+
};
|
|
98
|
+
|
|
98
99
|
var addEndListener = props.addEndListener,
|
|
99
100
|
_props$appear = props.appear,
|
|
100
101
|
appear = _props$appear === void 0 ? true : _props$appear,
|
|
@@ -118,7 +119,6 @@ var Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {
|
|
|
118
119
|
TransitionComponent = _props$TransitionComp === void 0 ? Transition : _props$TransitionComp,
|
|
119
120
|
other = _objectWithoutProperties(props, ["addEndListener", "appear", "children", "container", "direction", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"]);
|
|
120
121
|
|
|
121
|
-
var theme = useTheme();
|
|
122
122
|
var childrenRef = React.useRef(null);
|
|
123
123
|
var handleRefIntermediary = useForkRef(_children.ref, childrenRef);
|
|
124
124
|
var handleRef = useForkRef(handleRefIntermediary, ref);
|
|
@@ -308,8 +308,8 @@ process.env.NODE_ENV !== "production" ? Slide.propTypes
|
|
|
308
308
|
* The transition timing function.
|
|
309
309
|
* You may specify a single easing or a object containing enter and exit values.
|
|
310
310
|
* @default {
|
|
311
|
-
* enter: easing.easeOut,
|
|
312
|
-
* exit: easing.sharp,
|
|
311
|
+
* enter: theme.transitions.easing.easeOut,
|
|
312
|
+
* exit: theme.transitions.easing.sharp,
|
|
313
313
|
* }
|
|
314
314
|
*/
|
|
315
315
|
easing: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -361,8 +361,8 @@ process.env.NODE_ENV !== "production" ? Slide.propTypes
|
|
|
361
361
|
* The duration for the transition, in milliseconds.
|
|
362
362
|
* You may specify a single timeout for all transitions, or individually with an object.
|
|
363
363
|
* @default {
|
|
364
|
-
* enter: duration.enteringScreen,
|
|
365
|
-
* exit: duration.leavingScreen,
|
|
364
|
+
* enter: theme.transitions.duration.enteringScreen,
|
|
365
|
+
* exit: theme.transitions.duration.leavingScreen,
|
|
366
366
|
* }
|
|
367
367
|
*/
|
|
368
368
|
timeout: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
package/legacy/Slider/Slider.js
CHANGED
|
@@ -707,7 +707,9 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
707
707
|
* The size of the slider.
|
|
708
708
|
* @default 'medium'
|
|
709
709
|
*/
|
|
710
|
-
size: PropTypes
|
|
710
|
+
size: PropTypes
|
|
711
|
+
/* @typescript-to-proptypes-ignore */
|
|
712
|
+
.oneOfType([PropTypes.oneOf(['small', 'medium']), PropTypes.string]),
|
|
711
713
|
|
|
712
714
|
/**
|
|
713
715
|
* The granularity with which the slider can step through values. (A "discrete" slider.)
|
|
@@ -9,7 +9,6 @@ import ClickAwayListener from '@mui/base/ClickAwayListener';
|
|
|
9
9
|
import styled from '../styles/styled';
|
|
10
10
|
import useTheme from '../styles/useTheme';
|
|
11
11
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
|
-
import { duration } from '../styles/createTransitions';
|
|
13
12
|
import useEventCallback from '../utils/useEventCallback';
|
|
14
13
|
import capitalize from '../utils/capitalize';
|
|
15
14
|
import Grow from '../Grow';
|
|
@@ -86,6 +85,11 @@ var Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
86
85
|
props: inProps,
|
|
87
86
|
name: 'MuiSnackbar'
|
|
88
87
|
});
|
|
88
|
+
var theme = useTheme();
|
|
89
|
+
var defaultTransitionDuration = {
|
|
90
|
+
enter: theme.transitions.duration.enteringScreen,
|
|
91
|
+
exit: theme.transitions.duration.leavingScreen
|
|
92
|
+
};
|
|
89
93
|
var action = props.action,
|
|
90
94
|
_props$anchorOrigin = props.anchorOrigin;
|
|
91
95
|
_props$anchorOrigin = _props$anchorOrigin === void 0 ? {
|
|
@@ -113,10 +117,7 @@ var Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
113
117
|
_props$TransitionComp = props.TransitionComponent,
|
|
114
118
|
TransitionComponent = _props$TransitionComp === void 0 ? Grow : _props$TransitionComp,
|
|
115
119
|
_props$transitionDura = props.transitionDuration,
|
|
116
|
-
transitionDuration = _props$transitionDura === void 0 ?
|
|
117
|
-
enter: duration.enteringScreen,
|
|
118
|
-
exit: duration.leavingScreen
|
|
119
|
-
} : _props$transitionDura,
|
|
120
|
+
transitionDuration = _props$transitionDura === void 0 ? defaultTransitionDuration : _props$transitionDura,
|
|
120
121
|
_props$TransitionProp = props.TransitionProps;
|
|
121
122
|
_props$TransitionProp = _props$TransitionProp === void 0 ? {} : _props$TransitionProp;
|
|
122
123
|
|
|
@@ -125,7 +126,6 @@ var Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
125
126
|
TransitionProps = _objectWithoutProperties(_props$TransitionProp, ["onEnter", "onExited"]),
|
|
126
127
|
other = _objectWithoutProperties(props, ["action", "anchorOrigin", "autoHideDuration", "children", "className", "ClickAwayListenerProps", "ContentProps", "disableWindowBlurListener", "message", "onBlur", "onClose", "onFocus", "onMouseEnter", "onMouseLeave", "open", "resumeHideDuration", "TransitionComponent", "transitionDuration", "TransitionProps"]);
|
|
127
128
|
|
|
128
|
-
var theme = useTheme();
|
|
129
129
|
var isRtl = theme.direction === 'rtl';
|
|
130
130
|
|
|
131
131
|
var ownerState = _extends({}, props, {
|
|
@@ -289,7 +289,10 @@ var Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
289
289
|
onMouseEnter: handleMouseEnter,
|
|
290
290
|
onMouseLeave: handleMouseLeave,
|
|
291
291
|
ownerState: ownerState,
|
|
292
|
-
ref: ref
|
|
292
|
+
ref: ref // ClickAwayListener adds an `onClick` prop which results in the alert not being announced.
|
|
293
|
+
// See https://github.com/mui-org/material-ui/issues/29080
|
|
294
|
+
,
|
|
295
|
+
role: "presentation"
|
|
293
296
|
}, other, {
|
|
294
297
|
children: /*#__PURE__*/_jsx(TransitionComponent, _extends({
|
|
295
298
|
appear: true,
|
|
@@ -447,8 +450,8 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes
|
|
|
447
450
|
* The duration for the transition, in milliseconds.
|
|
448
451
|
* You may specify a single timeout for all transitions, or individually with an object.
|
|
449
452
|
* @default {
|
|
450
|
-
* enter: duration.enteringScreen,
|
|
451
|
-
* exit: duration.leavingScreen,
|
|
453
|
+
* enter: theme.transitions.duration.enteringScreen,
|
|
454
|
+
* exit: theme.transitions.duration.leavingScreen,
|
|
452
455
|
* }
|
|
453
456
|
*/
|
|
454
457
|
transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
@@ -9,7 +9,7 @@ import clsx from 'clsx';
|
|
|
9
9
|
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
10
10
|
import styled from '../styles/styled';
|
|
11
11
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
|
-
import
|
|
12
|
+
import useTheme from '../styles/useTheme';
|
|
13
13
|
import Zoom from '../Zoom';
|
|
14
14
|
import Fab from '../Fab';
|
|
15
15
|
import capitalize from '../utils/capitalize';
|
|
@@ -132,6 +132,11 @@ var SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref) {
|
|
|
132
132
|
props: inProps,
|
|
133
133
|
name: 'MuiSpeedDial'
|
|
134
134
|
});
|
|
135
|
+
var theme = useTheme();
|
|
136
|
+
var defaultTransitionDuration = {
|
|
137
|
+
enter: theme.transitions.duration.enteringScreen,
|
|
138
|
+
exit: theme.transitions.duration.leavingScreen
|
|
139
|
+
};
|
|
135
140
|
var ariaLabel = props.ariaLabel,
|
|
136
141
|
_props$FabProps = props.FabProps;
|
|
137
142
|
_props$FabProps = _props$FabProps === void 0 ? {} : _props$FabProps;
|
|
@@ -157,10 +162,7 @@ var SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref) {
|
|
|
157
162
|
_props$TransitionComp = props.TransitionComponent,
|
|
158
163
|
TransitionComponent = _props$TransitionComp === void 0 ? Zoom : _props$TransitionComp,
|
|
159
164
|
_props$transitionDura = props.transitionDuration,
|
|
160
|
-
transitionDuration = _props$transitionDura === void 0 ?
|
|
161
|
-
enter: duration.enteringScreen,
|
|
162
|
-
exit: duration.leavingScreen
|
|
163
|
-
} : _props$transitionDura,
|
|
165
|
+
transitionDuration = _props$transitionDura === void 0 ? defaultTransitionDuration : _props$transitionDura,
|
|
164
166
|
TransitionProps = props.TransitionProps,
|
|
165
167
|
other = _objectWithoutProperties(props, ["ariaLabel", "FabProps", "children", "className", "direction", "hidden", "icon", "onBlur", "onClose", "onFocus", "onKeyDown", "onMouseEnter", "onMouseLeave", "onOpen", "open", "openIcon", "TransitionComponent", "transitionDuration", "TransitionProps"]);
|
|
166
168
|
|
|
@@ -541,8 +543,8 @@ process.env.NODE_ENV !== "production" ? SpeedDial.propTypes
|
|
|
541
543
|
* The duration for the transition, in milliseconds.
|
|
542
544
|
* You may specify a single timeout for all transitions, or individually with an object.
|
|
543
545
|
* @default {
|
|
544
|
-
* enter: duration.enteringScreen,
|
|
545
|
-
* exit: duration.leavingScreen,
|
|
546
|
+
* enter: theme.transitions.duration.enteringScreen,
|
|
547
|
+
* exit: theme.transitions.duration.leavingScreen,
|
|
546
548
|
* }
|
|
547
549
|
*/
|
|
548
550
|
transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* Provides information about the current step in Stepper.
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
6
|
var StepContext = /*#__PURE__*/React.createContext({});
|
|
7
7
|
|
|
8
8
|
if (process.env.NODE_ENV !== 'production') {
|
|
9
9
|
StepContext.displayName = 'StepContext';
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Returns the current StepContext or an empty object if no StepContext
|
|
13
|
+
* has been defined in the component tree.
|
|
14
|
+
*/
|
|
15
|
+
|
|
11
16
|
|
|
17
|
+
export function useStepContext() {
|
|
18
|
+
return React.useContext(StepContext);
|
|
19
|
+
}
|
|
12
20
|
export default StepContext;
|
package/legacy/Step/index.js
CHANGED
|
@@ -8,9 +8,7 @@ import styled from '../styles/styled';
|
|
|
8
8
|
import capitalize from '../utils/capitalize';
|
|
9
9
|
import { isHorizontal } from '../Drawer/Drawer';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
var SwipeAreaRoot = styled('div'
|
|
12
|
-
skipSx: true
|
|
13
|
-
})(function (_ref) {
|
|
11
|
+
var SwipeAreaRoot = styled('div')(function (_ref) {
|
|
14
12
|
var theme = _ref.theme,
|
|
15
13
|
ownerState = _ref.ownerState;
|
|
16
14
|
return _extends({
|
|
@@ -10,7 +10,6 @@ import ownerDocument from '../utils/ownerDocument';
|
|
|
10
10
|
import ownerWindow from '../utils/ownerWindow';
|
|
11
11
|
import useEventCallback from '../utils/useEventCallback';
|
|
12
12
|
import useEnhancedEffect from '../utils/useEnhancedEffect';
|
|
13
|
-
import { duration } from '../styles/createTransitions';
|
|
14
13
|
import useTheme from '../styles/useTheme';
|
|
15
14
|
import { getTransitionProps } from '../transitions/utils';
|
|
16
15
|
import SwipeArea from './SwipeArea'; // This value is closed to what browsers are using internally to
|
|
@@ -122,16 +121,16 @@ function computeHasNativeHandler(_ref) {
|
|
|
122
121
|
}
|
|
123
122
|
|
|
124
123
|
var iOS = typeof navigator !== 'undefined' && /iPad|iPhone|iPod/.test(navigator.userAgent);
|
|
125
|
-
var transitionDurationDefault = {
|
|
126
|
-
enter: duration.enteringScreen,
|
|
127
|
-
exit: duration.leavingScreen
|
|
128
|
-
};
|
|
129
124
|
var SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(inProps, ref) {
|
|
130
125
|
var props = useThemeProps({
|
|
131
126
|
name: 'MuiSwipeableDrawer',
|
|
132
127
|
props: inProps
|
|
133
128
|
});
|
|
134
129
|
var theme = useTheme();
|
|
130
|
+
var transitionDurationDefault = {
|
|
131
|
+
enter: theme.transitions.duration.enteringScreen,
|
|
132
|
+
exit: theme.transitions.duration.leavingScreen
|
|
133
|
+
};
|
|
135
134
|
var _props$anchor = props.anchor,
|
|
136
135
|
anchor = _props$anchor === void 0 ? 'left' : _props$anchor,
|
|
137
136
|
_props$disableBackdro = props.disableBackdropTransition,
|
|
@@ -623,7 +622,10 @@ process.env.NODE_ENV !== "production" ? SwipeableDrawer.propTypes
|
|
|
623
622
|
/**
|
|
624
623
|
* The duration for the transition, in milliseconds.
|
|
625
624
|
* You may specify a single timeout for all transitions, or individually with an object.
|
|
626
|
-
* @default {
|
|
625
|
+
* @default {
|
|
626
|
+
* enter: theme.transitions.duration.enteringScreen,
|
|
627
|
+
* exit: theme.transitions.duration.leavingScreen,
|
|
628
|
+
* }
|
|
627
629
|
*/
|
|
628
630
|
transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
629
631
|
appear: PropTypes.number,
|
|
@@ -197,7 +197,7 @@ var TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref) {
|
|
|
197
197
|
variant: variant,
|
|
198
198
|
ownerState: ownerState
|
|
199
199
|
}, other, {
|
|
200
|
-
children: [label && /*#__PURE__*/_jsx(InputLabel, _extends({
|
|
200
|
+
children: [label != null && label !== '' && /*#__PURE__*/_jsx(InputLabel, _extends({
|
|
201
201
|
htmlFor: id,
|
|
202
202
|
id: inputLabelId
|
|
203
203
|
}, InputLabelProps, {
|
|
@@ -196,12 +196,18 @@ process.env.NODE_ENV !== "production" ? ToggleButton.propTypes
|
|
|
196
196
|
fullWidth: PropTypes.bool,
|
|
197
197
|
|
|
198
198
|
/**
|
|
199
|
-
*
|
|
199
|
+
* Callback fired when the state changes.
|
|
200
|
+
*
|
|
201
|
+
* @param {React.MouseEvent<HTMLElement>} event The event source of the callback.
|
|
202
|
+
* @param {any} value of the selected button.
|
|
200
203
|
*/
|
|
201
204
|
onChange: PropTypes.func,
|
|
202
205
|
|
|
203
206
|
/**
|
|
204
|
-
*
|
|
207
|
+
* Callback fired when the button is clicked.
|
|
208
|
+
*
|
|
209
|
+
* @param {React.MouseEvent<HTMLElement>} event The event source of the callback.
|
|
210
|
+
* @param {any} value of the selected button.
|
|
205
211
|
*/
|
|
206
212
|
onClick: PropTypes.func,
|
|
207
213
|
|
package/legacy/Zoom/Zoom.js
CHANGED
|
@@ -4,7 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { Transition } from 'react-transition-group';
|
|
6
6
|
import { elementAcceptingRef } from '@mui/utils';
|
|
7
|
-
import { duration } from '../styles/createTransitions';
|
|
8
7
|
import useTheme from '../styles/useTheme';
|
|
9
8
|
import { reflow, getTransitionProps } from '../transitions/utils';
|
|
10
9
|
import useForkRef from '../utils/useForkRef';
|
|
@@ -17,10 +16,6 @@ var styles = {
|
|
|
17
16
|
transform: 'none'
|
|
18
17
|
}
|
|
19
18
|
};
|
|
20
|
-
var defaultTimeout = {
|
|
21
|
-
enter: duration.enteringScreen,
|
|
22
|
-
exit: duration.leavingScreen
|
|
23
|
-
};
|
|
24
19
|
/**
|
|
25
20
|
* The Zoom transition can be used for the floating variant of the
|
|
26
21
|
* [Button](/components/buttons/#floating-action-buttons) component.
|
|
@@ -28,6 +23,12 @@ var defaultTimeout = {
|
|
|
28
23
|
*/
|
|
29
24
|
|
|
30
25
|
var Zoom = /*#__PURE__*/React.forwardRef(function Zoom(props, ref) {
|
|
26
|
+
var theme = useTheme();
|
|
27
|
+
var defaultTimeout = {
|
|
28
|
+
enter: theme.transitions.duration.enteringScreen,
|
|
29
|
+
exit: theme.transitions.duration.leavingScreen
|
|
30
|
+
};
|
|
31
|
+
|
|
31
32
|
var addEndListener = props.addEndListener,
|
|
32
33
|
_props$appear = props.appear,
|
|
33
34
|
appear = _props$appear === void 0 ? true : _props$appear,
|
|
@@ -47,7 +48,6 @@ var Zoom = /*#__PURE__*/React.forwardRef(function Zoom(props, ref) {
|
|
|
47
48
|
TransitionComponent = _props$TransitionComp === void 0 ? Transition : _props$TransitionComp,
|
|
48
49
|
other = _objectWithoutProperties(props, ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"]);
|
|
49
50
|
|
|
50
|
-
var theme = useTheme();
|
|
51
51
|
var nodeRef = React.useRef(null);
|
|
52
52
|
var foreignRef = useForkRef(_children.ref, ref);
|
|
53
53
|
var handleRef = useForkRef(nodeRef, foreignRef);
|
|
@@ -214,8 +214,8 @@ process.env.NODE_ENV !== "production" ? Zoom.propTypes
|
|
|
214
214
|
* The duration for the transition, in milliseconds.
|
|
215
215
|
* You may specify a single timeout for all transitions, or individually with an object.
|
|
216
216
|
* @default {
|
|
217
|
-
* enter: duration.enteringScreen,
|
|
218
|
-
* exit: duration.leavingScreen,
|
|
217
|
+
* enter: theme.transitions.duration.enteringScreen,
|
|
218
|
+
* exit: theme.transitions.duration.leavingScreen,
|
|
219
219
|
* }
|
|
220
220
|
*/
|
|
221
221
|
timeout: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
package/legacy/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.3
|
|
1
|
+
/** @license MUI v5.4.3
|
|
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.
|
|
@@ -8,7 +8,6 @@ import * as colors from './colors';
|
|
|
8
8
|
export { colors };
|
|
9
9
|
export * from './styles';
|
|
10
10
|
export * from './utils';
|
|
11
|
-
export * from '@mui/base';
|
|
12
11
|
export { default as Accordion } from './Accordion';
|
|
13
12
|
export * from './Accordion';
|
|
14
13
|
export { default as AccordionActions } from './AccordionActions';
|
|
@@ -175,6 +174,8 @@ export { default as Popover } from './Popover';
|
|
|
175
174
|
export * from './Popover';
|
|
176
175
|
export { default as Popper } from './Popper';
|
|
177
176
|
export * from './Popper';
|
|
177
|
+
export { default as Portal } from './Portal';
|
|
178
|
+
export * from './Portal';
|
|
178
179
|
export { default as Radio } from './Radio';
|
|
179
180
|
export * from './Radio';
|
|
180
181
|
export { default as RadioGroup } from './RadioGroup';
|
|
@@ -273,4 +274,8 @@ export * from './Zoom'; // createFilterOptions is exported from Autocomplete
|
|
|
273
274
|
export { default as useAutocomplete } from './useAutocomplete';
|
|
274
275
|
export { default as GlobalStyles } from './GlobalStyles';
|
|
275
276
|
export * from './GlobalStyles';
|
|
276
|
-
export { StyledEngineProvider } from './styles';
|
|
277
|
+
export { StyledEngineProvider } from './styles';
|
|
278
|
+
export { default as unstable_composeClasses } from '@mui/base/composeClasses';
|
|
279
|
+
export { default as generateUtilityClass } from '@mui/base/generateUtilityClass';
|
|
280
|
+
export * from '@mui/base/generateUtilityClass';
|
|
281
|
+
export { default as generateUtilityClasses } from '@mui/base/generateUtilityClasses';
|
|
@@ -27,9 +27,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
|
27
27
|
return composeClasses(slots, getSwitchBaseUtilityClass, classes);
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
var SwitchBaseRoot = styled(ButtonBase
|
|
31
|
-
skipSx: true
|
|
32
|
-
})(function (_ref) {
|
|
30
|
+
var SwitchBaseRoot = styled(ButtonBase)(function (_ref) {
|
|
33
31
|
var ownerState = _ref.ownerState;
|
|
34
32
|
return _extends({
|
|
35
33
|
padding: 9,
|
|
@@ -40,9 +38,7 @@ var SwitchBaseRoot = styled(ButtonBase, {
|
|
|
40
38
|
marginRight: ownerState.size === 'small' ? -3 : -12
|
|
41
39
|
});
|
|
42
40
|
});
|
|
43
|
-
var SwitchBaseInput = styled('input'
|
|
44
|
-
skipSx: true
|
|
45
|
-
})({
|
|
41
|
+
var SwitchBaseInput = styled('input')({
|
|
46
42
|
cursor: 'inherit',
|
|
47
43
|
position: 'absolute',
|
|
48
44
|
opacity: 0,
|