@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
|
@@ -5,32 +5,8 @@ import useEnhancedEffect from '../utils/useEnhancedEffect';
|
|
|
5
5
|
* @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
const theme = useTheme(); // Wait for jsdom to support the match media feature.
|
|
10
|
-
// All the browsers MUI support have this built-in.
|
|
11
|
-
// This defensive check is here for simplicity.
|
|
12
|
-
// Most of the time, the match media logic isn't central to people tests.
|
|
13
|
-
|
|
8
|
+
function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
|
|
14
9
|
const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
|
|
15
|
-
const {
|
|
16
|
-
defaultMatches = false,
|
|
17
|
-
matchMedia = supportMatchMedia ? window.matchMedia : null,
|
|
18
|
-
noSsr = false,
|
|
19
|
-
ssrMatchMedia = null
|
|
20
|
-
} = getThemeProps({
|
|
21
|
-
name: 'MuiUseMediaQuery',
|
|
22
|
-
props: options,
|
|
23
|
-
theme
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
27
|
-
if (typeof queryInput === 'function' && theme === null) {
|
|
28
|
-
console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\n'));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
let query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
|
|
33
|
-
query = query.replace(/^@media( ?)/m, '');
|
|
34
10
|
const [match, setMatch] = React.useState(() => {
|
|
35
11
|
if (noSsr && supportMatchMedia) {
|
|
36
12
|
return matchMedia(query).matches;
|
|
@@ -56,19 +32,85 @@ export default function useMediaQuery(queryInput, options = {}) {
|
|
|
56
32
|
const updateMatch = () => {
|
|
57
33
|
// Workaround Safari wrong implementation of matchMedia
|
|
58
34
|
// TODO can we remove it?
|
|
59
|
-
// https://github.com/mui
|
|
35
|
+
// https://github.com/mui/material-ui/pull/17315#issuecomment-528286677
|
|
60
36
|
if (active) {
|
|
61
37
|
setMatch(queryList.matches);
|
|
62
38
|
}
|
|
63
39
|
};
|
|
64
40
|
|
|
65
|
-
updateMatch();
|
|
41
|
+
updateMatch(); // TODO: Use `addEventListener` once support for Safari < 14 is dropped
|
|
42
|
+
|
|
66
43
|
queryList.addListener(updateMatch);
|
|
67
44
|
return () => {
|
|
68
45
|
active = false;
|
|
69
46
|
queryList.removeListener(updateMatch);
|
|
70
47
|
};
|
|
71
48
|
}, [query, matchMedia, supportMatchMedia]);
|
|
49
|
+
return match;
|
|
50
|
+
} // eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
const maybeReactUseSyncExternalStore = React['useSyncExternalStore' + ''];
|
|
54
|
+
|
|
55
|
+
function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {
|
|
56
|
+
const getDefaultSnapshot = React.useCallback(() => defaultMatches, [defaultMatches]);
|
|
57
|
+
const getServerSnapshot = React.useMemo(() => {
|
|
58
|
+
if (ssrMatchMedia !== null) {
|
|
59
|
+
const {
|
|
60
|
+
matches
|
|
61
|
+
} = ssrMatchMedia(query);
|
|
62
|
+
return () => matches;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return getDefaultSnapshot;
|
|
66
|
+
}, [getDefaultSnapshot, query, ssrMatchMedia]);
|
|
67
|
+
const [getSnapshot, subscribe] = React.useMemo(() => {
|
|
68
|
+
if (matchMedia === null) {
|
|
69
|
+
return [getDefaultSnapshot, () => () => {}];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const mediaQueryList = matchMedia(query);
|
|
73
|
+
return [() => mediaQueryList.matches, notify => {
|
|
74
|
+
// TODO: Use `addEventListener` once support for Safari < 14 is dropped
|
|
75
|
+
mediaQueryList.addListener(notify);
|
|
76
|
+
return () => {
|
|
77
|
+
mediaQueryList.removeListener(notify);
|
|
78
|
+
};
|
|
79
|
+
}];
|
|
80
|
+
}, [getDefaultSnapshot, matchMedia, query]);
|
|
81
|
+
const match = maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
82
|
+
return match;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export default function useMediaQuery(queryInput, options = {}) {
|
|
86
|
+
const theme = useTheme(); // Wait for jsdom to support the match media feature.
|
|
87
|
+
// All the browsers MUI support have this built-in.
|
|
88
|
+
// This defensive check is here for simplicity.
|
|
89
|
+
// Most of the time, the match media logic isn't central to people tests.
|
|
90
|
+
|
|
91
|
+
const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
|
|
92
|
+
const {
|
|
93
|
+
defaultMatches = false,
|
|
94
|
+
matchMedia = supportMatchMedia ? window.matchMedia : null,
|
|
95
|
+
ssrMatchMedia = null,
|
|
96
|
+
noSsr
|
|
97
|
+
} = getThemeProps({
|
|
98
|
+
name: 'MuiUseMediaQuery',
|
|
99
|
+
props: options,
|
|
100
|
+
theme
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
104
|
+
if (typeof queryInput === 'function' && theme === null) {
|
|
105
|
+
console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\n'));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
let query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
|
|
110
|
+
query = query.replace(/^@media( ?)/m, ''); // TODO: Drop `useMediaQueryOld` and use `use-sync-external-store` shim in `useMediaQueryNew` once the package is stable
|
|
111
|
+
|
|
112
|
+
const useMediaQueryImplementation = maybeReactUseSyncExternalStore !== undefined ? useMediaQueryNew : useMediaQueryOld;
|
|
113
|
+
const match = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr);
|
|
72
114
|
|
|
73
115
|
if (process.env.NODE_ENV !== 'production') {
|
|
74
116
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -63,7 +63,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
63
63
|
|
|
64
64
|
var _ClearIcon, _ArrowDropDownIcon;
|
|
65
65
|
|
|
66
|
-
const _excluded = ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "value"];
|
|
66
|
+
const _excluded = ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "readOnly", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "value"];
|
|
67
67
|
|
|
68
68
|
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); }
|
|
69
69
|
|
|
@@ -444,6 +444,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
444
444
|
PaperComponent = _Paper.default,
|
|
445
445
|
PopperComponent = _Popper.default,
|
|
446
446
|
popupIcon = _ArrowDropDownIcon || (_ArrowDropDownIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_ArrowDropDown.default, {})),
|
|
447
|
+
readOnly = false,
|
|
447
448
|
renderGroup: renderGroupProp,
|
|
448
449
|
renderInput,
|
|
449
450
|
renderOption: renderOptionProp,
|
|
@@ -476,7 +477,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
476
477
|
} = (0, _base.useAutocomplete)((0, _extends2.default)({}, props, {
|
|
477
478
|
componentName: 'Autocomplete'
|
|
478
479
|
}));
|
|
479
|
-
const hasClearIcon = !disableClearable && !disabled && dirty;
|
|
480
|
+
const hasClearIcon = !disableClearable && !disabled && dirty && !readOnly;
|
|
480
481
|
const hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false;
|
|
481
482
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
482
483
|
disablePortal,
|
|
@@ -593,7 +594,8 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
593
594
|
},
|
|
594
595
|
inputProps: (0, _extends2.default)({
|
|
595
596
|
className: (0, _clsx.default)(classes.input),
|
|
596
|
-
disabled
|
|
597
|
+
disabled,
|
|
598
|
+
readOnly
|
|
597
599
|
}, getInputProps())
|
|
598
600
|
})
|
|
599
601
|
})), popupOpen && anchorEl ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AutocompletePopper, {
|
|
@@ -1034,6 +1036,12 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
1034
1036
|
*/
|
|
1035
1037
|
popupIcon: _propTypes.default.node,
|
|
1036
1038
|
|
|
1039
|
+
/**
|
|
1040
|
+
* If `true`, the component becomes readonly. It is also supported for multiple tags where the tag cannot be deleted.
|
|
1041
|
+
* @default false
|
|
1042
|
+
*/
|
|
1043
|
+
readOnly: _propTypes.default.bool,
|
|
1044
|
+
|
|
1037
1045
|
/**
|
|
1038
1046
|
* Render the group.
|
|
1039
1047
|
*
|
|
@@ -33,7 +33,7 @@ var _avatarGroupClasses = _interopRequireWildcard(require("./avatarGroupClasses"
|
|
|
33
33
|
|
|
34
34
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
35
35
|
|
|
36
|
-
const _excluded = ["children", "className", "max", "spacing", "total", "variant"];
|
|
36
|
+
const _excluded = ["children", "className", "componentsProps", "max", "spacing", "total", "variant"];
|
|
37
37
|
|
|
38
38
|
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); }
|
|
39
39
|
|
|
@@ -90,6 +90,8 @@ const AvatarGroupAvatar = (0, _styled.default)(_Avatar.default, {
|
|
|
90
90
|
}
|
|
91
91
|
}));
|
|
92
92
|
const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, ref) {
|
|
93
|
+
var _componentsProps$addi, _componentsProps$addi2;
|
|
94
|
+
|
|
93
95
|
const props = (0, _useThemeProps.default)({
|
|
94
96
|
props: inProps,
|
|
95
97
|
name: 'MuiAvatarGroup'
|
|
@@ -97,6 +99,7 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
|
|
|
97
99
|
const {
|
|
98
100
|
children: childrenProp,
|
|
99
101
|
className,
|
|
102
|
+
componentsProps = {},
|
|
100
103
|
max = 5,
|
|
101
104
|
spacing = 'medium',
|
|
102
105
|
total,
|
|
@@ -134,15 +137,16 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
|
|
|
134
137
|
className: (0, _clsx.default)(classes.root, className),
|
|
135
138
|
ref: ref
|
|
136
139
|
}, other, {
|
|
137
|
-
children: [extraAvatars ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(AvatarGroupAvatar, {
|
|
140
|
+
children: [extraAvatars ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(AvatarGroupAvatar, (0, _extends2.default)({
|
|
138
141
|
ownerState: ownerState,
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
variant: variant
|
|
143
|
+
}, componentsProps.additionalAvatar, {
|
|
144
|
+
className: (0, _clsx.default)(classes.avatar, (_componentsProps$addi = componentsProps.additionalAvatar) == null ? void 0 : _componentsProps$addi.className),
|
|
145
|
+
style: (0, _extends2.default)({
|
|
141
146
|
marginLeft
|
|
142
|
-
},
|
|
143
|
-
variant: variant,
|
|
147
|
+
}, (_componentsProps$addi2 = componentsProps.additionalAvatar) == null ? void 0 : _componentsProps$addi2.style),
|
|
144
148
|
children: ["+", extraAvatars]
|
|
145
|
-
}) : null, children.slice(0, maxAvatars).reverse().map(child => {
|
|
149
|
+
})) : null, children.slice(0, maxAvatars).reverse().map(child => {
|
|
146
150
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
147
151
|
className: (0, _clsx.default)(child.props.className, classes.avatar),
|
|
148
152
|
style: (0, _extends2.default)({
|
|
@@ -176,6 +180,14 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
|
|
|
176
180
|
*/
|
|
177
181
|
className: _propTypes.default.string,
|
|
178
182
|
|
|
183
|
+
/**
|
|
184
|
+
* The props used for each slot inside the AvatarGroup.
|
|
185
|
+
* @default {}
|
|
186
|
+
*/
|
|
187
|
+
componentsProps: _propTypes.default.shape({
|
|
188
|
+
additionalAvatar: _propTypes.default.object
|
|
189
|
+
}),
|
|
190
|
+
|
|
179
191
|
/**
|
|
180
192
|
* Max avatars to show before +x.
|
|
181
193
|
* @default 5
|
package/node/Badge/Badge.js
CHANGED
|
@@ -198,7 +198,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
198
198
|
componentsProps = {},
|
|
199
199
|
overlap: overlapProp = 'rectangular',
|
|
200
200
|
color: colorProp = 'default',
|
|
201
|
-
invisible: invisibleProp,
|
|
201
|
+
invisible: invisibleProp = false,
|
|
202
202
|
badgeContent: badgeContentProp,
|
|
203
203
|
showZero = false,
|
|
204
204
|
variant: variantProp = 'standard'
|
|
@@ -211,7 +211,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
211
211
|
});
|
|
212
212
|
let invisible = invisibleProp;
|
|
213
213
|
|
|
214
|
-
if (invisibleProp
|
|
214
|
+
if (invisibleProp === false && (badgeContentProp === 0 && !showZero || badgeContentProp == null && variantProp !== 'dot')) {
|
|
215
215
|
invisible = true;
|
|
216
216
|
}
|
|
217
217
|
|
|
@@ -327,6 +327,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
327
327
|
|
|
328
328
|
/**
|
|
329
329
|
* If `true`, the badge is invisible.
|
|
330
|
+
* @default false
|
|
330
331
|
*/
|
|
331
332
|
invisible: _propTypes.default.bool,
|
|
332
333
|
|
|
@@ -27,9 +27,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
27
27
|
|
|
28
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
29
|
|
|
30
|
-
const BreadcrumbCollapsedButton = (0, _styled.default)(_ButtonBase.default
|
|
31
|
-
skipSx: true
|
|
32
|
-
})(({
|
|
30
|
+
const BreadcrumbCollapsedButton = (0, _styled.default)(_ButtonBase.default)(({
|
|
33
31
|
theme
|
|
34
32
|
}) => (0, _extends2.default)({
|
|
35
33
|
display: 'flex',
|
|
@@ -37,7 +37,7 @@ var _buttonBaseClasses = _interopRequireWildcard(require("./buttonBaseClasses"))
|
|
|
37
37
|
|
|
38
38
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
39
39
|
|
|
40
|
-
const _excluded = ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "type"];
|
|
40
|
+
const _excluded = ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "touchRippleRef", "type"];
|
|
41
41
|
|
|
42
42
|
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); }
|
|
43
43
|
|
|
@@ -145,11 +145,13 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
145
145
|
onTouchStart,
|
|
146
146
|
tabIndex = 0,
|
|
147
147
|
TouchRippleProps,
|
|
148
|
+
touchRippleRef,
|
|
148
149
|
type
|
|
149
150
|
} = props,
|
|
150
151
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
151
152
|
const buttonRef = React.useRef(null);
|
|
152
153
|
const rippleRef = React.useRef(null);
|
|
154
|
+
const handleRippleRef = (0, _useForkRef.default)(rippleRef, touchRippleRef);
|
|
153
155
|
const {
|
|
154
156
|
isFocusVisibleRef,
|
|
155
157
|
onFocus: handleFocusVisible,
|
|
@@ -368,7 +370,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
368
370
|
|
|
369
371
|
/* TouchRipple is only needed client-side, x2 boost on the server. */
|
|
370
372
|
(0, _jsxRuntime.jsx)(_TouchRipple.default, (0, _extends2.default)({
|
|
371
|
-
ref:
|
|
373
|
+
ref: handleRippleRef,
|
|
372
374
|
center: centerRipple
|
|
373
375
|
}, TouchRippleProps)) : null]
|
|
374
376
|
}));
|
|
@@ -551,6 +553,17 @@ process.env.NODE_ENV !== "production" ? ButtonBase.propTypes
|
|
|
551
553
|
*/
|
|
552
554
|
TouchRippleProps: _propTypes.default.object,
|
|
553
555
|
|
|
556
|
+
/**
|
|
557
|
+
* A ref that points to the `TouchRipple` element.
|
|
558
|
+
*/
|
|
559
|
+
touchRippleRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
|
|
560
|
+
current: _propTypes.default.shape({
|
|
561
|
+
pulsate: _propTypes.default.func.isRequired,
|
|
562
|
+
start: _propTypes.default.func.isRequired,
|
|
563
|
+
stop: _propTypes.default.func.isRequired
|
|
564
|
+
})
|
|
565
|
+
})]),
|
|
566
|
+
|
|
554
567
|
/**
|
|
555
568
|
* @ignore
|
|
556
569
|
*/
|
package/node/Dialog/Dialog.js
CHANGED
|
@@ -27,8 +27,6 @@ var _Modal = _interopRequireDefault(require("../Modal"));
|
|
|
27
27
|
|
|
28
28
|
var _Fade = _interopRequireDefault(require("../Fade"));
|
|
29
29
|
|
|
30
|
-
var _createTransitions = require("../styles/createTransitions");
|
|
31
|
-
|
|
32
30
|
var _Paper = _interopRequireDefault(require("../Paper"));
|
|
33
31
|
|
|
34
32
|
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
@@ -41,6 +39,8 @@ var _DialogContext = _interopRequireDefault(require("./DialogContext"));
|
|
|
41
39
|
|
|
42
40
|
var _Backdrop = _interopRequireDefault(require("../Backdrop"));
|
|
43
41
|
|
|
42
|
+
var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
|
|
43
|
+
|
|
44
44
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
45
45
|
|
|
46
46
|
const _excluded = ["aria-describedby", "aria-labelledby", "BackdropComponent", "BackdropProps", "children", "className", "disableEscapeKeyDown", "fullScreen", "fullWidth", "maxWidth", "onBackdropClick", "onClose", "open", "PaperComponent", "PaperProps", "scroll", "TransitionComponent", "transitionDuration", "TransitionProps"];
|
|
@@ -178,10 +178,6 @@ const DialogPaper = (0, _styled.default)(_Paper.default, {
|
|
|
178
178
|
maxWidth: '100%'
|
|
179
179
|
}
|
|
180
180
|
}));
|
|
181
|
-
const defaultTransitionDuration = {
|
|
182
|
-
enter: _createTransitions.duration.enteringScreen,
|
|
183
|
-
exit: _createTransitions.duration.leavingScreen
|
|
184
|
-
};
|
|
185
181
|
/**
|
|
186
182
|
* Dialogs are overlaid modal paper based components with a backdrop.
|
|
187
183
|
*/
|
|
@@ -191,6 +187,11 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
|
|
|
191
187
|
props: inProps,
|
|
192
188
|
name: 'MuiDialog'
|
|
193
189
|
});
|
|
190
|
+
const theme = (0, _useTheme.default)();
|
|
191
|
+
const defaultTransitionDuration = {
|
|
192
|
+
enter: theme.transitions.duration.enteringScreen,
|
|
193
|
+
exit: theme.transitions.duration.leavingScreen
|
|
194
|
+
};
|
|
194
195
|
const {
|
|
195
196
|
'aria-describedby': ariaDescribedby,
|
|
196
197
|
'aria-labelledby': ariaLabelledbyProp,
|
|
@@ -428,7 +429,10 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes
|
|
|
428
429
|
/**
|
|
429
430
|
* The duration for the transition, in milliseconds.
|
|
430
431
|
* You may specify a single timeout for all transitions, or individually with an object.
|
|
431
|
-
* @default {
|
|
432
|
+
* @default {
|
|
433
|
+
* enter: theme.transitions.duration.enteringScreen,
|
|
434
|
+
* exit: theme.transitions.duration.leavingScreen,
|
|
435
|
+
* }
|
|
432
436
|
*/
|
|
433
437
|
transitionDuration: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
|
|
434
438
|
appear: _propTypes.default.number,
|
package/node/Drawer/Drawer.js
CHANGED
|
@@ -31,8 +31,6 @@ var _Paper = _interopRequireDefault(require("../Paper"));
|
|
|
31
31
|
|
|
32
32
|
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
33
33
|
|
|
34
|
-
var _createTransitions = require("../styles/createTransitions");
|
|
35
|
-
|
|
36
34
|
var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
|
|
37
35
|
|
|
38
36
|
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
@@ -158,21 +156,22 @@ function isHorizontal(anchor) {
|
|
|
158
156
|
function getAnchor(theme, anchor) {
|
|
159
157
|
return theme.direction === 'rtl' && isHorizontal(anchor) ? oppositeDirection[anchor] : anchor;
|
|
160
158
|
}
|
|
161
|
-
|
|
162
|
-
const defaultTransitionDuration = {
|
|
163
|
-
enter: _createTransitions.duration.enteringScreen,
|
|
164
|
-
exit: _createTransitions.duration.leavingScreen
|
|
165
|
-
};
|
|
166
159
|
/**
|
|
167
160
|
* The props of the [Modal](/api/modal/) component are available
|
|
168
161
|
* when `variant="temporary"` is set.
|
|
169
162
|
*/
|
|
170
163
|
|
|
164
|
+
|
|
171
165
|
const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
|
|
172
166
|
const props = (0, _useThemeProps.default)({
|
|
173
167
|
props: inProps,
|
|
174
168
|
name: 'MuiDrawer'
|
|
175
169
|
});
|
|
170
|
+
const theme = (0, _useTheme.default)();
|
|
171
|
+
const defaultTransitionDuration = {
|
|
172
|
+
enter: theme.transitions.duration.enteringScreen,
|
|
173
|
+
exit: theme.transitions.duration.leavingScreen
|
|
174
|
+
};
|
|
176
175
|
const {
|
|
177
176
|
anchor: anchorProp = 'left',
|
|
178
177
|
BackdropProps,
|
|
@@ -193,8 +192,7 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
|
|
|
193
192
|
variant = 'temporary'
|
|
194
193
|
} = props,
|
|
195
194
|
ModalProps = (0, _objectWithoutPropertiesLoose2.default)(props.ModalProps, _excluded),
|
|
196
|
-
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
|
|
197
|
-
const theme = (0, _useTheme.default)(); // Let's assume that the Drawer will always be rendered on user space.
|
|
195
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2); // Let's assume that the Drawer will always be rendered on user space.
|
|
198
196
|
// We use this state is order to skip the appear transition during the
|
|
199
197
|
// initial mount of the component.
|
|
200
198
|
|
|
@@ -348,7 +346,10 @@ process.env.NODE_ENV !== "production" ? Drawer.propTypes
|
|
|
348
346
|
/**
|
|
349
347
|
* The duration for the transition, in milliseconds.
|
|
350
348
|
* You may specify a single timeout for all transitions, or individually with an object.
|
|
351
|
-
* @default {
|
|
349
|
+
* @default {
|
|
350
|
+
* enter: theme.transitions.duration.enteringScreen,
|
|
351
|
+
* exit: theme.transitions.duration.leavingScreen,
|
|
352
|
+
* }
|
|
352
353
|
*/
|
|
353
354
|
transitionDuration: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
|
|
354
355
|
appear: _propTypes.default.number,
|
package/node/Fab/Fab.js
CHANGED
|
@@ -45,7 +45,7 @@ const useUtilityClasses = ownerState => {
|
|
|
45
45
|
size
|
|
46
46
|
} = ownerState;
|
|
47
47
|
const slots = {
|
|
48
|
-
root: ['root', variant, `size${(0, _capitalize.default)(size)}`, color === 'inherit'
|
|
48
|
+
root: ['root', variant, `size${(0, _capitalize.default)(size)}`, color === 'inherit' ? 'colorInherit' : color]
|
|
49
49
|
};
|
|
50
50
|
return (0, _base.unstable_composeClasses)(slots, _fabClasses.getFabUtilityClass, classes);
|
|
51
51
|
};
|
|
@@ -57,7 +57,7 @@ const FabRoot = (0, _styled.default)(_ButtonBase.default, {
|
|
|
57
57
|
const {
|
|
58
58
|
ownerState
|
|
59
59
|
} = props;
|
|
60
|
-
return [styles.root, styles[ownerState.variant], styles[`size${(0, _capitalize.default)(ownerState.size)}`], ownerState.color === 'inherit' && styles.colorInherit,
|
|
60
|
+
return [styles.root, styles[ownerState.variant], styles[`size${(0, _capitalize.default)(ownerState.size)}`], ownerState.color === 'inherit' && styles.colorInherit, styles[(0, _capitalize.default)(ownerState.size)], styles[ownerState.color]];
|
|
61
61
|
}
|
|
62
62
|
})(({
|
|
63
63
|
theme,
|
|
@@ -124,24 +124,14 @@ const FabRoot = (0, _styled.default)(_ButtonBase.default, {
|
|
|
124
124
|
}), ({
|
|
125
125
|
theme,
|
|
126
126
|
ownerState
|
|
127
|
-
}) => (0, _extends2.default)({}, ownerState.color
|
|
128
|
-
color: theme.palette.
|
|
129
|
-
backgroundColor: theme.palette.
|
|
127
|
+
}) => (0, _extends2.default)({}, ownerState.color !== 'inherit' && ownerState.color !== 'default' && theme.palette[ownerState.color] != null && {
|
|
128
|
+
color: theme.palette[ownerState.color].contrastText,
|
|
129
|
+
backgroundColor: theme.palette[ownerState.color].main,
|
|
130
130
|
'&:hover': {
|
|
131
|
-
backgroundColor: theme.palette.
|
|
131
|
+
backgroundColor: theme.palette[ownerState.color].dark,
|
|
132
132
|
// Reset on touch devices, it doesn't add specificity
|
|
133
133
|
'@media (hover: none)': {
|
|
134
|
-
backgroundColor: theme.palette.
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}, ownerState.color === 'secondary' && {
|
|
138
|
-
color: theme.palette.secondary.contrastText,
|
|
139
|
-
backgroundColor: theme.palette.secondary.main,
|
|
140
|
-
'&:hover': {
|
|
141
|
-
backgroundColor: theme.palette.secondary.dark,
|
|
142
|
-
// Reset on touch devices, it doesn't add specificity
|
|
143
|
-
'@media (hover: none)': {
|
|
144
|
-
backgroundColor: theme.palette.secondary.main
|
|
134
|
+
backgroundColor: theme.palette[ownerState.color].main
|
|
145
135
|
}
|
|
146
136
|
}
|
|
147
137
|
}));
|
|
@@ -210,9 +200,7 @@ process.env.NODE_ENV !== "production" ? Fab.propTypes
|
|
|
210
200
|
* The color of the component. It supports those theme colors that make sense for this component.
|
|
211
201
|
* @default 'default'
|
|
212
202
|
*/
|
|
213
|
-
color: _propTypes.default
|
|
214
|
-
/* @typescript-to-proptypes-ignore */
|
|
215
|
-
.oneOfType([_propTypes.default.oneOf(['default', 'inherit', 'primary', 'secondary']), _propTypes.default.string]),
|
|
203
|
+
color: _propTypes.default.oneOf(['default', 'error', 'info', 'inherit', 'primary', 'secondary', 'success', 'warning']),
|
|
216
204
|
|
|
217
205
|
/**
|
|
218
206
|
* The component used for the root node.
|
package/node/Fab/fabClasses.js
CHANGED
|
@@ -12,6 +12,6 @@ function getFabUtilityClass(slot) {
|
|
|
12
12
|
return (0, _base.generateUtilityClass)('MuiFab', slot);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const fabClasses = (0, _base.generateUtilityClasses)('MuiFab', ['root', 'primary', 'secondary', 'extended', 'circular', 'focusVisible', 'disabled', 'colorInherit', 'sizeSmall', 'sizeMedium', 'sizeLarge']);
|
|
15
|
+
const fabClasses = (0, _base.generateUtilityClasses)('MuiFab', ['root', 'primary', 'secondary', 'extended', 'circular', 'focusVisible', 'disabled', 'colorInherit', 'sizeSmall', 'sizeMedium', 'sizeLarge', 'info', 'error', 'warning', 'success']);
|
|
16
16
|
var _default = fabClasses;
|
|
17
17
|
exports.default = _default;
|
package/node/Fade/Fade.js
CHANGED
|
@@ -19,8 +19,6 @@ var _reactTransitionGroup = require("react-transition-group");
|
|
|
19
19
|
|
|
20
20
|
var _utils = require("@mui/utils");
|
|
21
21
|
|
|
22
|
-
var _createTransitions = require("../styles/createTransitions");
|
|
23
|
-
|
|
24
22
|
var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
|
|
25
23
|
|
|
26
24
|
var _utils2 = require("../transitions/utils");
|
|
@@ -43,16 +41,17 @@ const styles = {
|
|
|
43
41
|
opacity: 1
|
|
44
42
|
}
|
|
45
43
|
};
|
|
46
|
-
const defaultTimeout = {
|
|
47
|
-
enter: _createTransitions.duration.enteringScreen,
|
|
48
|
-
exit: _createTransitions.duration.leavingScreen
|
|
49
|
-
};
|
|
50
44
|
/**
|
|
51
45
|
* The Fade transition is used by the [Modal](/components/modal/) component.
|
|
52
46
|
* It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
|
|
53
47
|
*/
|
|
54
48
|
|
|
55
49
|
const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
|
|
50
|
+
const theme = (0, _useTheme.default)();
|
|
51
|
+
const defaultTimeout = {
|
|
52
|
+
enter: theme.transitions.duration.enteringScreen,
|
|
53
|
+
exit: theme.transitions.duration.leavingScreen
|
|
54
|
+
};
|
|
56
55
|
const {
|
|
57
56
|
addEndListener,
|
|
58
57
|
appear = true,
|
|
@@ -71,7 +70,6 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
|
|
|
71
70
|
TransitionComponent = _reactTransitionGroup.Transition
|
|
72
71
|
} = props,
|
|
73
72
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
74
|
-
const theme = (0, _useTheme.default)();
|
|
75
73
|
const enableStrictModeCompat = true;
|
|
76
74
|
const nodeRef = React.useRef(null);
|
|
77
75
|
const foreignRef = (0, _useForkRef.default)(children.ref, ref);
|
|
@@ -237,8 +235,8 @@ process.env.NODE_ENV !== "production" ? Fade.propTypes
|
|
|
237
235
|
* The duration for the transition, in milliseconds.
|
|
238
236
|
* You may specify a single timeout for all transitions, or individually with an object.
|
|
239
237
|
* @default {
|
|
240
|
-
* enter: duration.enteringScreen,
|
|
241
|
-
* exit: duration.leavingScreen,
|
|
238
|
+
* enter: theme.transitions.duration.enteringScreen,
|
|
239
|
+
* exit: theme.transitions.duration.leavingScreen,
|
|
242
240
|
* }
|
|
243
241
|
*/
|
|
244
242
|
timeout: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
|
|
@@ -33,6 +33,8 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
|
33
33
|
|
|
34
34
|
var _formControlLabelClasses = _interopRequireWildcard(require("./formControlLabelClasses"));
|
|
35
35
|
|
|
36
|
+
var _formControlState = _interopRequireDefault(require("../FormControl/formControlState"));
|
|
37
|
+
|
|
36
38
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
37
39
|
|
|
38
40
|
const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "value"];
|
|
@@ -45,10 +47,11 @@ const useUtilityClasses = ownerState => {
|
|
|
45
47
|
const {
|
|
46
48
|
classes,
|
|
47
49
|
disabled,
|
|
48
|
-
labelPlacement
|
|
50
|
+
labelPlacement,
|
|
51
|
+
error
|
|
49
52
|
} = ownerState;
|
|
50
53
|
const slots = {
|
|
51
|
-
root: ['root', disabled && 'disabled', `labelPlacement${(0, _capitalize.default)(labelPlacement)}
|
|
54
|
+
root: ['root', disabled && 'disabled', `labelPlacement${(0, _capitalize.default)(labelPlacement)}`, error && 'error'],
|
|
52
55
|
label: ['label', disabled && 'disabled']
|
|
53
56
|
};
|
|
54
57
|
return (0, _base.unstable_composeClasses)(slots, _formControlLabelClasses.getFormControlLabelUtilityClasses, classes);
|
|
@@ -139,10 +142,16 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
|
|
|
139
142
|
controlProps[key] = props[key];
|
|
140
143
|
}
|
|
141
144
|
});
|
|
145
|
+
const fcs = (0, _formControlState.default)({
|
|
146
|
+
props,
|
|
147
|
+
muiFormControl,
|
|
148
|
+
states: ['error']
|
|
149
|
+
});
|
|
142
150
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
143
151
|
disabled,
|
|
144
152
|
label,
|
|
145
|
-
labelPlacement
|
|
153
|
+
labelPlacement,
|
|
154
|
+
error: fcs.error
|
|
146
155
|
});
|
|
147
156
|
const classes = useUtilityClasses(ownerState);
|
|
148
157
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(FormControlLabelRoot, (0, _extends2.default)({
|
|
@@ -12,6 +12,6 @@ function getFormControlLabelUtilityClasses(slot) {
|
|
|
12
12
|
return (0, _base.generateUtilityClass)('MuiFormControlLabel', slot);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const formControlLabelClasses = (0, _base.generateUtilityClasses)('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label']);
|
|
15
|
+
const formControlLabelClasses = (0, _base.generateUtilityClasses)('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label', 'error']);
|
|
16
16
|
var _default = formControlLabelClasses;
|
|
17
17
|
exports.default = _default;
|
|
@@ -25,6 +25,10 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
|
25
25
|
|
|
26
26
|
var _formGroupClasses = require("./formGroupClasses");
|
|
27
27
|
|
|
28
|
+
var _useFormControl = _interopRequireDefault(require("../FormControl/useFormControl"));
|
|
29
|
+
|
|
30
|
+
var _formControlState = _interopRequireDefault(require("../FormControl/formControlState"));
|
|
31
|
+
|
|
28
32
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
33
|
|
|
30
34
|
const _excluded = ["className", "row"];
|
|
@@ -36,10 +40,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
36
40
|
const useUtilityClasses = ownerState => {
|
|
37
41
|
const {
|
|
38
42
|
classes,
|
|
39
|
-
row
|
|
43
|
+
row,
|
|
44
|
+
error
|
|
40
45
|
} = ownerState;
|
|
41
46
|
const slots = {
|
|
42
|
-
root: ['root', row && 'row']
|
|
47
|
+
root: ['root', row && 'row', error && 'error']
|
|
43
48
|
};
|
|
44
49
|
return (0, _base.unstable_composeClasses)(slots, _formGroupClasses.getFormGroupUtilityClass, classes);
|
|
45
50
|
};
|
|
@@ -78,8 +83,15 @@ const FormGroup = /*#__PURE__*/React.forwardRef(function FormGroup(inProps, ref)
|
|
|
78
83
|
row = false
|
|
79
84
|
} = props,
|
|
80
85
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
86
|
+
const muiFormControl = (0, _useFormControl.default)();
|
|
87
|
+
const fcs = (0, _formControlState.default)({
|
|
88
|
+
props,
|
|
89
|
+
muiFormControl,
|
|
90
|
+
states: ['error']
|
|
91
|
+
});
|
|
81
92
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
82
|
-
row
|
|
93
|
+
row,
|
|
94
|
+
error: fcs.error
|
|
83
95
|
});
|
|
84
96
|
const classes = useUtilityClasses(ownerState);
|
|
85
97
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FormGroupRoot, (0, _extends2.default)({
|