@mui/material 9.0.0 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion/Accordion.d.mts +2 -2
- package/Accordion/Accordion.d.ts +2 -2
- package/Accordion/Accordion.js +3 -2
- package/Accordion/Accordion.mjs +3 -2
- package/AccordionSummary/AccordionSummary.js +27 -29
- package/AccordionSummary/AccordionSummary.mjs +27 -29
- package/Autocomplete/Autocomplete.js +73 -17
- package/Autocomplete/Autocomplete.mjs +73 -17
- package/Avatar/Avatar.js +4 -0
- package/Avatar/Avatar.mjs +4 -0
- package/Backdrop/Backdrop.d.mts +2 -2
- package/Backdrop/Backdrop.d.ts +2 -2
- package/Badge/Badge.js +31 -24
- package/Badge/Badge.mjs +31 -24
- package/BottomNavigationAction/BottomNavigationAction.js +6 -2
- package/BottomNavigationAction/BottomNavigationAction.mjs +6 -2
- package/Button/Button.js +19 -6
- package/Button/Button.mjs +19 -6
- package/ButtonBase/ButtonBase.d.mts +7 -0
- package/ButtonBase/ButtonBase.d.ts +7 -0
- package/ButtonBase/ButtonBase.js +5 -2
- package/ButtonBase/ButtonBase.mjs +5 -2
- package/ButtonBase/Ripple.js +21 -11
- package/ButtonBase/Ripple.mjs +21 -11
- package/ButtonBase/TouchRipple.js +252 -116
- package/ButtonBase/TouchRipple.mjs +253 -117
- package/CHANGELOG.md +216 -1245
- package/CardActionArea/CardActionArea.js +2 -1
- package/CardActionArea/CardActionArea.mjs +2 -1
- package/Checkbox/Checkbox.js +2 -1
- package/Checkbox/Checkbox.mjs +2 -1
- package/Chip/Chip.js +2 -1
- package/Chip/Chip.mjs +2 -1
- package/CircularProgress/CircularProgress.d.mts +12 -2
- package/CircularProgress/CircularProgress.d.ts +12 -2
- package/CircularProgress/CircularProgress.js +115 -58
- package/CircularProgress/CircularProgress.mjs +114 -58
- package/ClickAwayListener/ClickAwayListener.js +3 -6
- package/ClickAwayListener/ClickAwayListener.mjs +3 -6
- package/Collapse/Collapse.d.mts +15 -3
- package/Collapse/Collapse.d.ts +15 -3
- package/Collapse/Collapse.js +44 -31
- package/Collapse/Collapse.mjs +43 -30
- package/Dialog/Dialog.d.mts +2 -2
- package/Dialog/Dialog.d.ts +2 -2
- package/Dialog/Dialog.js +13 -6
- package/Dialog/Dialog.mjs +13 -6
- package/Drawer/Drawer.d.mts +2 -2
- package/Drawer/Drawer.d.ts +2 -2
- package/Drawer/Drawer.js +18 -4
- package/Drawer/Drawer.mjs +18 -4
- package/Fab/Fab.js +9 -2
- package/Fab/Fab.mjs +9 -2
- package/Fade/Fade.d.mts +15 -2
- package/Fade/Fade.d.ts +15 -2
- package/Fade/Fade.js +46 -19
- package/Fade/Fade.mjs +45 -18
- package/FilledInput/FilledInput.d.mts +4 -0
- package/FilledInput/FilledInput.d.ts +4 -0
- package/FilledInput/FilledInput.js +22 -23
- package/FilledInput/FilledInput.mjs +22 -23
- package/FormControl/useFormControl.d.mts +12 -2
- package/FormControl/useFormControl.d.ts +12 -2
- package/FormControl/useFormControl.js +13 -0
- package/FormControl/useFormControl.mjs +12 -0
- package/FormControlLabel/FormControlLabel.js +5 -8
- package/FormControlLabel/FormControlLabel.mjs +5 -8
- package/FormGroup/FormGroup.js +2 -5
- package/FormGroup/FormGroup.mjs +2 -5
- package/FormHelperText/FormHelperText.js +2 -5
- package/FormHelperText/FormHelperText.mjs +2 -5
- package/FormLabel/FormLabel.js +2 -5
- package/FormLabel/FormLabel.mjs +2 -5
- package/Grow/Grow.d.mts +15 -2
- package/Grow/Grow.d.ts +15 -2
- package/Grow/Grow.js +45 -28
- package/Grow/Grow.mjs +44 -27
- package/IconButton/IconButton.js +3 -9
- package/IconButton/IconButton.mjs +3 -9
- package/Input/Input.d.mts +4 -0
- package/Input/Input.d.ts +4 -0
- package/Input/Input.js +9 -2
- package/Input/Input.mjs +9 -2
- package/InputBase/InputBase.d.mts +2 -1
- package/InputBase/InputBase.d.ts +2 -1
- package/InputBase/InputBase.js +52 -16
- package/InputBase/InputBase.mjs +52 -16
- package/InputLabel/InputLabel.js +7 -9
- package/InputLabel/InputLabel.mjs +7 -9
- package/LICENSE +1 -1
- package/LinearProgress/LinearProgress.d.mts +12 -2
- package/LinearProgress/LinearProgress.d.ts +12 -2
- package/LinearProgress/LinearProgress.js +225 -126
- package/LinearProgress/LinearProgress.mjs +224 -126
- package/List/List.js +2 -1
- package/List/List.mjs +2 -1
- package/ListItem/ListItem.js +2 -1
- package/ListItem/ListItem.mjs +2 -1
- package/ListItemButton/ListItemButton.js +9 -2
- package/ListItemButton/ListItemButton.mjs +9 -2
- package/Menu/Menu.d.mts +1 -1
- package/Menu/Menu.d.ts +1 -1
- package/MenuItem/MenuItem.js +7 -1
- package/MenuItem/MenuItem.mjs +7 -1
- package/MenuList/MenuList.js +2 -1
- package/MenuList/MenuList.mjs +2 -1
- package/MobileStepper/MobileStepper.js +2 -1
- package/MobileStepper/MobileStepper.mjs +2 -1
- package/NativeSelect/NativeSelect.js +2 -5
- package/NativeSelect/NativeSelect.mjs +2 -5
- package/OutlinedInput/NotchedOutline.js +4 -3
- package/OutlinedInput/NotchedOutline.mjs +4 -3
- package/OutlinedInput/OutlinedInput.js +13 -23
- package/OutlinedInput/OutlinedInput.mjs +13 -23
- package/PaginationItem/PaginationItem.js +2 -1
- package/PaginationItem/PaginationItem.mjs +2 -1
- package/Paper/Paper.js +2 -1
- package/Paper/Paper.mjs +2 -1
- package/PigmentContainer/PigmentContainer.js +0 -1
- package/PigmentContainer/PigmentContainer.mjs +0 -1
- package/Popover/Popover.d.mts +1 -1
- package/Popover/Popover.d.ts +1 -1
- package/Popper/BasePopper.js +23 -1
- package/Popper/BasePopper.mjs +23 -1
- package/README.md +3 -2
- package/Radio/RadioButtonIcon.js +3 -2
- package/Radio/RadioButtonIcon.mjs +3 -2
- package/Rating/Rating.js +2 -1
- package/Rating/Rating.mjs +2 -1
- package/Select/Select.js +2 -5
- package/Select/Select.mjs +2 -5
- package/Select/SelectInput.js +276 -24
- package/Select/SelectInput.mjs +276 -24
- package/Select/utils/closedTypeahead.js +73 -0
- package/Select/utils/closedTypeahead.mjs +63 -0
- package/Skeleton/Skeleton.js +22 -2
- package/Skeleton/Skeleton.mjs +22 -2
- package/Slide/Slide.d.mts +15 -2
- package/Slide/Slide.d.ts +15 -2
- package/Slide/Slide.js +97 -47
- package/Slide/Slide.mjs +97 -47
- package/Slider/Slider.js +14 -4
- package/Slider/Slider.mjs +14 -4
- package/Slider/useSlider.js +4 -3
- package/Slider/useSlider.mjs +4 -3
- package/Snackbar/Snackbar.d.mts +2 -2
- package/Snackbar/Snackbar.d.ts +2 -2
- package/SpeedDial/SpeedDial.d.mts +1 -1
- package/SpeedDial/SpeedDial.d.ts +1 -1
- package/SpeedDial/SpeedDial.js +6 -2
- package/SpeedDial/SpeedDial.mjs +6 -2
- package/SpeedDialAction/SpeedDialAction.js +11 -2
- package/SpeedDialAction/SpeedDialAction.mjs +12 -3
- package/SpeedDialIcon/SpeedDialIcon.js +40 -37
- package/SpeedDialIcon/SpeedDialIcon.mjs +40 -37
- package/Step/Step.js +47 -15
- package/Step/Step.mjs +47 -15
- package/StepButton/StepButton.js +9 -3
- package/StepButton/StepButton.mjs +9 -3
- package/StepConnector/StepConnector.js +10 -0
- package/StepConnector/StepConnector.mjs +10 -0
- package/StepContent/StepContent.d.mts +2 -2
- package/StepContent/StepContent.d.ts +2 -2
- package/StepContent/StepContent.js +26 -2
- package/StepContent/StepContent.mjs +26 -2
- package/StepIcon/StepIcon.js +2 -1
- package/StepIcon/StepIcon.mjs +2 -1
- package/StepLabel/StepLabel.js +52 -7
- package/StepLabel/StepLabel.mjs +52 -7
- package/Stepper/Stepper.d.mts +2 -0
- package/Stepper/Stepper.d.ts +2 -0
- package/Stepper/Stepper.js +18 -0
- package/Stepper/Stepper.mjs +18 -0
- package/SvgIcon/SvgIcon.js +2 -1
- package/SvgIcon/SvgIcon.mjs +2 -1
- package/SwipeableDrawer/SwipeableDrawer.js +21 -6
- package/SwipeableDrawer/SwipeableDrawer.mjs +21 -6
- package/Switch/Switch.js +10 -8
- package/Switch/Switch.mjs +10 -8
- package/TableSortLabel/TableSortLabel.js +2 -1
- package/TableSortLabel/TableSortLabel.mjs +2 -1
- package/Tabs/ScrollbarSize.js +2 -1
- package/Tabs/ScrollbarSize.mjs +2 -1
- package/Tabs/Tabs.js +16 -4
- package/Tabs/Tabs.mjs +16 -4
- package/Tooltip/Tooltip.d.mts +2 -2
- package/Tooltip/Tooltip.d.ts +2 -2
- package/Tooltip/Tooltip.js +29 -108
- package/Tooltip/Tooltip.mjs +29 -108
- package/Unstable_TrapFocus/FocusTrap.js +60 -22
- package/Unstable_TrapFocus/FocusTrap.mjs +60 -22
- package/Zoom/Zoom.d.mts +15 -2
- package/Zoom/Zoom.d.ts +15 -2
- package/Zoom/Zoom.js +43 -16
- package/Zoom/Zoom.mjs +42 -15
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internal/Transition.d.mts +34 -0
- package/internal/Transition.d.ts +34 -0
- package/internal/Transition.js +444 -0
- package/internal/Transition.mjs +436 -0
- package/internal/react-transition-group.d.mts +8 -0
- package/internal/react-transition-group.d.ts +8 -0
- package/package.json +50 -50
- package/styles/createMotion.d.mts +8 -0
- package/styles/createMotion.d.ts +8 -0
- package/styles/createMotion.js +13 -0
- package/styles/createMotion.mjs +7 -0
- package/styles/createThemeFoundation.d.mts +2 -0
- package/styles/createThemeFoundation.d.ts +2 -0
- package/styles/createThemeNoVars.d.mts +3 -0
- package/styles/createThemeNoVars.d.ts +3 -0
- package/styles/createThemeNoVars.js +5 -0
- package/styles/createThemeNoVars.mjs +5 -0
- package/styles/createTransitions.d.mts +6 -2
- package/styles/createTransitions.d.ts +6 -2
- package/styles/createTransitions.js +12 -4
- package/styles/createTransitions.mjs +12 -4
- package/styles/enhanceHighContrast.d.mts +70 -0
- package/styles/enhanceHighContrast.d.ts +70 -0
- package/styles/enhanceHighContrast.js +502 -0
- package/styles/enhanceHighContrast.mjs +495 -0
- package/styles/index.d.mts +2 -0
- package/styles/index.d.ts +2 -0
- package/styles/index.js +8 -0
- package/styles/index.mjs +1 -0
- package/styles/reducedMotion.d.mts +7 -0
- package/styles/reducedMotion.d.ts +7 -0
- package/styles/reducedMotion.js +21 -0
- package/styles/reducedMotion.mjs +14 -0
- package/styles/responsiveFontSizes.js +19 -8
- package/styles/responsiveFontSizes.mjs +19 -8
- package/styles/shouldSkipGeneratingVar.js +1 -1
- package/styles/shouldSkipGeneratingVar.mjs +1 -1
- package/styles/stringifyTheme.js +1 -0
- package/styles/stringifyTheme.mjs +1 -0
- package/styles/useThemeProps.d.mts +3 -3
- package/styles/useThemeProps.d.ts +3 -3
- package/transitions/index.d.mts +1 -1
- package/transitions/index.d.ts +1 -1
- package/transitions/index.js +0 -11
- package/transitions/index.mjs +1 -1
- package/transitions/transition.d.mts +1 -12
- package/transitions/transition.d.ts +1 -12
- package/transitions/types.d.mts +73 -0
- package/transitions/types.d.ts +73 -0
- package/transitions/useReducedMotion.d.mts +14 -0
- package/transitions/useReducedMotion.d.ts +14 -0
- package/transitions/useReducedMotion.js +117 -0
- package/transitions/useReducedMotion.mjs +110 -0
- package/transitions/utils.d.mts +51 -2
- package/transitions/utils.d.ts +51 -2
- package/transitions/utils.js +97 -4
- package/transitions/utils.mjs +94 -4
- package/useAutocomplete/useAutocomplete.d.mts +12 -6
- package/useAutocomplete/useAutocomplete.d.ts +12 -6
- package/useAutocomplete/useAutocomplete.js +230 -55
- package/useAutocomplete/useAutocomplete.mjs +230 -55
- package/utils/contains.d.mts +2 -0
- package/utils/contains.d.ts +2 -0
- package/utils/contains.js +9 -0
- package/utils/contains.mjs +2 -0
- package/utils/focusable.d.mts +7 -0
- package/utils/focusable.d.ts +7 -0
- package/utils/focusable.js +20 -0
- package/utils/focusable.mjs +13 -0
- package/utils/getEventTarget.d.mts +2 -0
- package/utils/getEventTarget.d.ts +2 -0
- package/utils/getEventTarget.js +9 -0
- package/utils/getEventTarget.mjs +2 -0
- package/utils/mergeSlotProps.js +2 -8
- package/utils/mergeSlotProps.mjs +1 -8
- package/version/index.js +2 -2
- package/version/index.mjs +2 -2
- package/FormControl/formControlState.js +0 -21
- package/FormControl/formControlState.mjs +0 -15
- /package/transitions/{transition.js → types.js} +0 -0
- /package/transitions/{transition.mjs → types.mjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps } from '@mui/system';
|
|
3
3
|
import { Theme } from "../styles/index.mjs";
|
|
4
|
-
import { TransitionProps } from "../transitions/
|
|
4
|
+
import { TransitionProps } from "../transitions/types.mjs";
|
|
5
5
|
import { AccordionClasses } from "./accordionClasses.mjs";
|
|
6
6
|
import { OverridableComponent, OverrideProps } from "../OverridableComponent/index.mjs";
|
|
7
7
|
import { ExtendPaperTypeMap, PaperProps } from "../Paper/Paper.mjs";
|
|
@@ -19,7 +19,7 @@ export interface AccordionSlots {
|
|
|
19
19
|
heading: React.ElementType;
|
|
20
20
|
/**
|
|
21
21
|
* The component that renders the transition.
|
|
22
|
-
* [Follow this guide](
|
|
22
|
+
* [Follow this guide](/material-ui/transitions/#transition-slots) to learn more about the requirements for this component.
|
|
23
23
|
* @default Collapse
|
|
24
24
|
*/
|
|
25
25
|
transition: React.ElementType;
|
package/Accordion/Accordion.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps } from '@mui/system';
|
|
3
3
|
import { Theme } from "../styles/index.js";
|
|
4
|
-
import { TransitionProps } from "../transitions/
|
|
4
|
+
import { TransitionProps } from "../transitions/types.js";
|
|
5
5
|
import { AccordionClasses } from "./accordionClasses.js";
|
|
6
6
|
import { OverridableComponent, OverrideProps } from "../OverridableComponent/index.js";
|
|
7
7
|
import { ExtendPaperTypeMap, PaperProps } from "../Paper/Paper.js";
|
|
@@ -19,7 +19,7 @@ export interface AccordionSlots {
|
|
|
19
19
|
heading: React.ElementType;
|
|
20
20
|
/**
|
|
21
21
|
* The component that renders the transition.
|
|
22
|
-
* [Follow this guide](
|
|
22
|
+
* [Follow this guide](/material-ui/transitions/#transition-slots) to learn more about the requirements for this component.
|
|
23
23
|
* @default Collapse
|
|
24
24
|
*/
|
|
25
25
|
transition: React.ElementType;
|
package/Accordion/Accordion.js
CHANGED
|
@@ -22,6 +22,7 @@ var _AccordionContext = _interopRequireDefault(require("./AccordionContext"));
|
|
|
22
22
|
var _useControlled = _interopRequireDefault(require("../utils/useControlled"));
|
|
23
23
|
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
24
24
|
var _accordionClasses = _interopRequireWildcard(require("./accordionClasses"));
|
|
25
|
+
var _utils = require("../transitions/utils");
|
|
25
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
27
|
const useUtilityClasses = ownerState => {
|
|
27
28
|
const {
|
|
@@ -57,7 +58,7 @@ const AccordionRoot = (0, _zeroStyled.styled)(_Paper.default, {
|
|
|
57
58
|
};
|
|
58
59
|
return {
|
|
59
60
|
position: 'relative',
|
|
60
|
-
|
|
61
|
+
...(0, _utils.getTransitionStyles)(theme, ['margin'], transition),
|
|
61
62
|
overflowAnchor: 'none',
|
|
62
63
|
// Keep the same scrolling position
|
|
63
64
|
'&::before': {
|
|
@@ -69,7 +70,7 @@ const AccordionRoot = (0, _zeroStyled.styled)(_Paper.default, {
|
|
|
69
70
|
content: '""',
|
|
70
71
|
opacity: 1,
|
|
71
72
|
backgroundColor: (theme.vars || theme).palette.divider,
|
|
72
|
-
|
|
73
|
+
...(0, _utils.getTransitionStyles)(theme, ['opacity', 'background-color'], transition)
|
|
73
74
|
},
|
|
74
75
|
'&:first-of-type': {
|
|
75
76
|
'&::before': {
|
package/Accordion/Accordion.mjs
CHANGED
|
@@ -15,6 +15,7 @@ import AccordionContext from "./AccordionContext.mjs";
|
|
|
15
15
|
import useControlled from "../utils/useControlled.mjs";
|
|
16
16
|
import useSlot from "../utils/useSlot.mjs";
|
|
17
17
|
import accordionClasses, { getAccordionUtilityClass } from "./accordionClasses.mjs";
|
|
18
|
+
import { getTransitionStyles } from "../transitions/utils.mjs";
|
|
18
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
20
|
const useUtilityClasses = ownerState => {
|
|
20
21
|
const {
|
|
@@ -50,7 +51,7 @@ const AccordionRoot = styled(Paper, {
|
|
|
50
51
|
};
|
|
51
52
|
return {
|
|
52
53
|
position: 'relative',
|
|
53
|
-
|
|
54
|
+
...getTransitionStyles(theme, ['margin'], transition),
|
|
54
55
|
overflowAnchor: 'none',
|
|
55
56
|
// Keep the same scrolling position
|
|
56
57
|
'&::before': {
|
|
@@ -62,7 +63,7 @@ const AccordionRoot = styled(Paper, {
|
|
|
62
63
|
content: '""',
|
|
63
64
|
opacity: 1,
|
|
64
65
|
backgroundColor: (theme.vars || theme).palette.divider,
|
|
65
|
-
|
|
66
|
+
...getTransitionStyles(theme, ['opacity', 'background-color'], transition)
|
|
66
67
|
},
|
|
67
68
|
'&:first-of-type': {
|
|
68
69
|
'&::before': {
|
|
@@ -16,6 +16,7 @@ var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
|
|
|
16
16
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
17
17
|
var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
|
|
18
18
|
var _AccordionContext = _interopRequireDefault(require("../Accordion/AccordionContext"));
|
|
19
|
+
var _utils = require("../transitions/utils");
|
|
19
20
|
var _accordionSummaryClasses = _interopRequireWildcard(require("./accordionSummaryClasses"));
|
|
20
21
|
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
21
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -39,35 +40,32 @@ const AccordionSummaryRoot = (0, _zeroStyled.styled)(_ButtonBase.default, {
|
|
|
39
40
|
slot: 'Root'
|
|
40
41
|
})((0, _memoTheme.default)(({
|
|
41
42
|
theme
|
|
42
|
-
}) => {
|
|
43
|
-
|
|
43
|
+
}) => ({
|
|
44
|
+
display: 'flex',
|
|
45
|
+
width: '100%',
|
|
46
|
+
minHeight: 48,
|
|
47
|
+
padding: theme.spacing(0, 2),
|
|
48
|
+
...(0, _utils.getTransitionStyles)(theme, ['min-height', 'background-color'], {
|
|
44
49
|
duration: theme.transitions.duration.shortest
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
variants: [{
|
|
62
|
-
props: props => !props.disableGutters,
|
|
63
|
-
style: {
|
|
64
|
-
[`&.${_accordionSummaryClasses.default.expanded}`]: {
|
|
65
|
-
minHeight: 64
|
|
66
|
-
}
|
|
50
|
+
}),
|
|
51
|
+
[`&.${_accordionSummaryClasses.default.focusVisible}`]: {
|
|
52
|
+
backgroundColor: (theme.vars || theme).palette.action.focus
|
|
53
|
+
},
|
|
54
|
+
[`&.${_accordionSummaryClasses.default.disabled}`]: {
|
|
55
|
+
opacity: (theme.vars || theme).palette.action.disabledOpacity
|
|
56
|
+
},
|
|
57
|
+
[`&:hover:not(.${_accordionSummaryClasses.default.disabled})`]: {
|
|
58
|
+
cursor: 'pointer'
|
|
59
|
+
},
|
|
60
|
+
variants: [{
|
|
61
|
+
props: props => !props.disableGutters,
|
|
62
|
+
style: {
|
|
63
|
+
[`&.${_accordionSummaryClasses.default.expanded}`]: {
|
|
64
|
+
minHeight: 64
|
|
67
65
|
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}));
|
|
66
|
+
}
|
|
67
|
+
}]
|
|
68
|
+
})));
|
|
71
69
|
const AccordionSummaryContent = (0, _zeroStyled.styled)('span', {
|
|
72
70
|
name: 'MuiAccordionSummary',
|
|
73
71
|
slot: 'Content'
|
|
@@ -81,7 +79,7 @@ const AccordionSummaryContent = (0, _zeroStyled.styled)('span', {
|
|
|
81
79
|
variants: [{
|
|
82
80
|
props: props => !props.disableGutters,
|
|
83
81
|
style: {
|
|
84
|
-
|
|
82
|
+
...(0, _utils.getTransitionStyles)(theme, ['margin'], {
|
|
85
83
|
duration: theme.transitions.duration.shortest
|
|
86
84
|
}),
|
|
87
85
|
[`&.${_accordionSummaryClasses.default.expanded}`]: {
|
|
@@ -99,7 +97,7 @@ const AccordionSummaryExpandIconWrapper = (0, _zeroStyled.styled)('span', {
|
|
|
99
97
|
display: 'flex',
|
|
100
98
|
color: (theme.vars || theme).palette.action.active,
|
|
101
99
|
transform: 'rotate(0deg)',
|
|
102
|
-
|
|
100
|
+
...(0, _utils.getTransitionStyles)(theme, 'transform', {
|
|
103
101
|
duration: theme.transitions.duration.shortest
|
|
104
102
|
}),
|
|
105
103
|
[`&.${_accordionSummaryClasses.default.expanded}`]: {
|
|
@@ -9,6 +9,7 @@ import memoTheme from "../utils/memoTheme.mjs";
|
|
|
9
9
|
import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
|
|
10
10
|
import ButtonBase from "../ButtonBase/index.mjs";
|
|
11
11
|
import AccordionContext from "../Accordion/AccordionContext.mjs";
|
|
12
|
+
import { getTransitionStyles } from "../transitions/utils.mjs";
|
|
12
13
|
import accordionSummaryClasses, { getAccordionSummaryUtilityClass } from "./accordionSummaryClasses.mjs";
|
|
13
14
|
import useSlot from "../utils/useSlot.mjs";
|
|
14
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -32,35 +33,32 @@ const AccordionSummaryRoot = styled(ButtonBase, {
|
|
|
32
33
|
slot: 'Root'
|
|
33
34
|
})(memoTheme(({
|
|
34
35
|
theme
|
|
35
|
-
}) => {
|
|
36
|
-
|
|
36
|
+
}) => ({
|
|
37
|
+
display: 'flex',
|
|
38
|
+
width: '100%',
|
|
39
|
+
minHeight: 48,
|
|
40
|
+
padding: theme.spacing(0, 2),
|
|
41
|
+
...getTransitionStyles(theme, ['min-height', 'background-color'], {
|
|
37
42
|
duration: theme.transitions.duration.shortest
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
variants: [{
|
|
55
|
-
props: props => !props.disableGutters,
|
|
56
|
-
style: {
|
|
57
|
-
[`&.${accordionSummaryClasses.expanded}`]: {
|
|
58
|
-
minHeight: 64
|
|
59
|
-
}
|
|
43
|
+
}),
|
|
44
|
+
[`&.${accordionSummaryClasses.focusVisible}`]: {
|
|
45
|
+
backgroundColor: (theme.vars || theme).palette.action.focus
|
|
46
|
+
},
|
|
47
|
+
[`&.${accordionSummaryClasses.disabled}`]: {
|
|
48
|
+
opacity: (theme.vars || theme).palette.action.disabledOpacity
|
|
49
|
+
},
|
|
50
|
+
[`&:hover:not(.${accordionSummaryClasses.disabled})`]: {
|
|
51
|
+
cursor: 'pointer'
|
|
52
|
+
},
|
|
53
|
+
variants: [{
|
|
54
|
+
props: props => !props.disableGutters,
|
|
55
|
+
style: {
|
|
56
|
+
[`&.${accordionSummaryClasses.expanded}`]: {
|
|
57
|
+
minHeight: 64
|
|
60
58
|
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}));
|
|
59
|
+
}
|
|
60
|
+
}]
|
|
61
|
+
})));
|
|
64
62
|
const AccordionSummaryContent = styled('span', {
|
|
65
63
|
name: 'MuiAccordionSummary',
|
|
66
64
|
slot: 'Content'
|
|
@@ -74,7 +72,7 @@ const AccordionSummaryContent = styled('span', {
|
|
|
74
72
|
variants: [{
|
|
75
73
|
props: props => !props.disableGutters,
|
|
76
74
|
style: {
|
|
77
|
-
|
|
75
|
+
...getTransitionStyles(theme, ['margin'], {
|
|
78
76
|
duration: theme.transitions.duration.shortest
|
|
79
77
|
}),
|
|
80
78
|
[`&.${accordionSummaryClasses.expanded}`]: {
|
|
@@ -92,7 +90,7 @@ const AccordionSummaryExpandIconWrapper = styled('span', {
|
|
|
92
90
|
display: 'flex',
|
|
93
91
|
color: (theme.vars || theme).palette.action.active,
|
|
94
92
|
transform: 'rotate(0deg)',
|
|
95
|
-
|
|
93
|
+
...getTransitionStyles(theme, 'transform', {
|
|
96
94
|
duration: theme.transitions.duration.shortest
|
|
97
95
|
}),
|
|
98
96
|
[`&.${accordionSummaryClasses.expanded}`]: {
|
|
@@ -18,6 +18,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
18
18
|
var _integerPropType = _interopRequireDefault(require("@mui/utils/integerPropType"));
|
|
19
19
|
var _chainPropTypes = _interopRequireDefault(require("@mui/utils/chainPropTypes"));
|
|
20
20
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
21
|
+
var _useForcedRerendering = _interopRequireDefault(require("@mui/utils/useForcedRerendering"));
|
|
22
|
+
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
21
23
|
var _useAutocomplete = _interopRequireWildcard(require("../useAutocomplete"));
|
|
22
24
|
var _Popper = _interopRequireDefault(require("../Popper"));
|
|
23
25
|
var _ListSubheader = _interopRequireDefault(require("../ListSubheader"));
|
|
@@ -340,6 +342,8 @@ const AutocompleteListbox = (0, _zeroStyled.styled)('ul', {
|
|
|
340
342
|
padding: '8px 0',
|
|
341
343
|
maxHeight: '40vh',
|
|
342
344
|
overflow: 'auto',
|
|
345
|
+
isolation: 'isolate',
|
|
346
|
+
// Prevent overlap with iOS overlay scrollbars.
|
|
343
347
|
position: 'relative',
|
|
344
348
|
[`& .${_autocompleteClasses.default.option}`]: {
|
|
345
349
|
minHeight: 48,
|
|
@@ -467,6 +471,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
467
471
|
renderInput,
|
|
468
472
|
renderOption: renderOptionProp,
|
|
469
473
|
renderValue,
|
|
474
|
+
resetHighlightOnMouseLeave = false,
|
|
470
475
|
selectOnFocus = !props.freeSolo,
|
|
471
476
|
size = 'medium',
|
|
472
477
|
slots = {},
|
|
@@ -500,15 +505,51 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
500
505
|
...props,
|
|
501
506
|
componentName: 'Autocomplete'
|
|
502
507
|
});
|
|
508
|
+
|
|
509
|
+
// Re-render when anchorEl resizes so the Popper width stays in sync.
|
|
510
|
+
// Width is always read synchronously from anchorEl.clientWidth during render
|
|
511
|
+
// (no stale cached value). The hook just triggers a re-render on resize.
|
|
512
|
+
const forceRenderOnResize = (0, _useForcedRerendering.default)();
|
|
513
|
+
React.useEffect(() => {
|
|
514
|
+
if (!popupOpen || !anchorEl || typeof ResizeObserver === 'undefined') {
|
|
515
|
+
return undefined;
|
|
516
|
+
}
|
|
517
|
+
let lastWidth = anchorEl.clientWidth;
|
|
518
|
+
const observer = new ResizeObserver(() => {
|
|
519
|
+
const newWidth = anchorEl.clientWidth;
|
|
520
|
+
if (lastWidth !== newWidth) {
|
|
521
|
+
lastWidth = newWidth;
|
|
522
|
+
forceRenderOnResize();
|
|
523
|
+
}
|
|
524
|
+
});
|
|
525
|
+
observer.observe(anchorEl);
|
|
526
|
+
return () => {
|
|
527
|
+
observer.disconnect();
|
|
528
|
+
};
|
|
529
|
+
}, [popupOpen, anchorEl, forceRenderOnResize]);
|
|
530
|
+
|
|
531
|
+
// When popupOpen becomes false, useAutocomplete returns [] for groupedOptions.
|
|
532
|
+
// Transitioned Poppers can remain mounted for their exit animation, so keep rendering
|
|
533
|
+
// the last open-state options instead of flashing "No options" or an empty Paper.
|
|
534
|
+
// These options are stale because they no longer reflect the hook's current
|
|
535
|
+
// groupedOptions, but they are non-interactive while closing and reset on next open.
|
|
536
|
+
const previousGroupedOptionsRef = React.useRef([]);
|
|
537
|
+
const prevPopupOpenRef = React.useRef(false);
|
|
538
|
+
const renderedOptions = popupOpen ? groupedOptions : previousGroupedOptionsRef.current;
|
|
539
|
+
(0, _useEnhancedEffect.default)(() => {
|
|
540
|
+
if (popupOpen && !prevPopupOpenRef.current) {
|
|
541
|
+
previousGroupedOptionsRef.current = [];
|
|
542
|
+
}
|
|
543
|
+
prevPopupOpenRef.current = popupOpen;
|
|
544
|
+
if (popupOpen && groupedOptions.length > 0) {
|
|
545
|
+
previousGroupedOptionsRef.current = groupedOptions;
|
|
546
|
+
}
|
|
547
|
+
}, [popupOpen, groupedOptions]);
|
|
503
548
|
const hasClearIcon = !disableClearable && !disabled && dirty && !readOnly;
|
|
504
549
|
const hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false;
|
|
505
550
|
const {
|
|
506
551
|
onMouseDown: handleInputMouseDown
|
|
507
552
|
} = getInputProps();
|
|
508
|
-
const {
|
|
509
|
-
ref: listboxRef,
|
|
510
|
-
...otherListboxProps
|
|
511
|
-
} = getListboxProps();
|
|
512
553
|
const defaultGetOptionLabel = option => option.label ?? option;
|
|
513
554
|
const getOptionLabel = getOptionLabelProp || defaultGetOptionLabel;
|
|
514
555
|
|
|
@@ -547,8 +588,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
547
588
|
externalForwardedProps,
|
|
548
589
|
ownerState,
|
|
549
590
|
className: classes.listbox,
|
|
550
|
-
|
|
551
|
-
ref: listboxRef
|
|
591
|
+
getSlotProps: getListboxProps
|
|
552
592
|
});
|
|
553
593
|
const [PaperSlot, paperProps] = (0, _useSlot.default)('paper', {
|
|
554
594
|
elementType: _Paper.default,
|
|
@@ -564,13 +604,24 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
564
604
|
additionalProps: {
|
|
565
605
|
disablePortal,
|
|
566
606
|
style: {
|
|
567
|
-
width: anchorEl ? anchorEl.clientWidth : null
|
|
607
|
+
width: anchorEl ? anchorEl.clientWidth : null,
|
|
608
|
+
// Prevent interaction with stale cached options during exit transitions.
|
|
609
|
+
// The hook's filteredOptions is [] when popupOpen=false, so clicks on stale
|
|
610
|
+
// rendered options would pass undefined to selectNewValue.
|
|
611
|
+
pointerEvents: popupOpen ? undefined : 'none'
|
|
568
612
|
},
|
|
569
613
|
role: 'presentation',
|
|
570
614
|
anchorEl,
|
|
571
615
|
open: popupOpen
|
|
572
616
|
}
|
|
573
617
|
});
|
|
618
|
+
|
|
619
|
+
// Don't render the Popper when there's no content to show.
|
|
620
|
+
// In freeSolo mode, "No options" text is suppressed, so if there are also no
|
|
621
|
+
// matching options and loading is false, the Paper would be empty.
|
|
622
|
+
// Uses renderedOptions (not groupedOptions) so Popper stays during exit transitions.
|
|
623
|
+
// Respect keepMounted from resolved popperProps (handles both object and callback slotProps forms).
|
|
624
|
+
const hasPopupContent = renderedOptions.length > 0 || loading || !freeSolo || popperProps.keepMounted === true;
|
|
574
625
|
const [ClearIndicatorSlot, clearIndicatorProps] = (0, _useSlot.default)('clearIndicator', {
|
|
575
626
|
elementType: AutocompleteClearIndicator,
|
|
576
627
|
externalForwardedProps,
|
|
@@ -716,17 +767,17 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
716
767
|
}
|
|
717
768
|
}
|
|
718
769
|
})
|
|
719
|
-
}), anchorEl ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AutocompletePopper, {
|
|
770
|
+
}), anchorEl && hasPopupContent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AutocompletePopper, {
|
|
720
771
|
as: PopperSlot,
|
|
721
772
|
...popperProps,
|
|
722
773
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(AutocompletePaper, {
|
|
723
774
|
as: PaperSlot,
|
|
724
775
|
...paperProps,
|
|
725
|
-
children: [loading &&
|
|
776
|
+
children: [loading && renderedOptions.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AutocompleteLoading, {
|
|
726
777
|
className: classes.loading,
|
|
727
778
|
ownerState: ownerState,
|
|
728
779
|
children: loadingText
|
|
729
|
-
}) : null,
|
|
780
|
+
}) : null, renderedOptions.length === 0 && !freeSolo && !loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AutocompleteNoOptions, {
|
|
730
781
|
className: classes.noOptions,
|
|
731
782
|
ownerState: ownerState,
|
|
732
783
|
role: "presentation",
|
|
@@ -735,9 +786,9 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
735
786
|
event.preventDefault();
|
|
736
787
|
},
|
|
737
788
|
children: noOptionsText
|
|
738
|
-
}) : null,
|
|
789
|
+
}) : null, renderedOptions.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ListboxSlot, {
|
|
739
790
|
...listboxProps,
|
|
740
|
-
children:
|
|
791
|
+
children: renderedOptions.map((option, index) => {
|
|
741
792
|
if (groupBy) {
|
|
742
793
|
return renderGroup({
|
|
743
794
|
key: option.key,
|
|
@@ -770,12 +821,11 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
770
821
|
*/
|
|
771
822
|
autoHighlight: _propTypes.default.bool,
|
|
772
823
|
/**
|
|
773
|
-
* If `true`, the
|
|
774
|
-
* when the Autocomplete loses focus unless the user chooses
|
|
775
|
-
* a different option or changes the character string in the input.
|
|
824
|
+
* If `true`, the value is updated when the input loses focus under one of these conditions:
|
|
776
825
|
*
|
|
777
|
-
*
|
|
778
|
-
*
|
|
826
|
+
* - An option highlighted via keyboard navigation or `autoHighlight` is selected.
|
|
827
|
+
* Hover and touch highlights are ignored.
|
|
828
|
+
* - Otherwise, in `freeSolo` mode, the typed text becomes the value.
|
|
779
829
|
* @default false
|
|
780
830
|
*/
|
|
781
831
|
autoSelect: _propTypes.default.bool,
|
|
@@ -1116,6 +1166,12 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
1116
1166
|
* @returns {ReactNode}
|
|
1117
1167
|
*/
|
|
1118
1168
|
renderValue: _propTypes.default.func,
|
|
1169
|
+
/**
|
|
1170
|
+
* If `true`, clears an option highlighted by mouse movement when the mouse leaves the listbox.
|
|
1171
|
+
* This behavior will be enabled by default in the next major version.
|
|
1172
|
+
* @default false
|
|
1173
|
+
*/
|
|
1174
|
+
resetHighlightOnMouseLeave: _propTypes.default.bool,
|
|
1119
1175
|
/**
|
|
1120
1176
|
* If `true`, the input's text is selected on focus.
|
|
1121
1177
|
* It helps the user clear the selected value.
|
|
@@ -6,6 +6,8 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import integerPropType from '@mui/utils/integerPropType';
|
|
7
7
|
import chainPropTypes from '@mui/utils/chainPropTypes';
|
|
8
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
9
|
+
import useForcedRerendering from '@mui/utils/useForcedRerendering';
|
|
10
|
+
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
9
11
|
import useAutocomplete, { createFilterOptions } from "../useAutocomplete/index.mjs";
|
|
10
12
|
import Popper from "../Popper/index.mjs";
|
|
11
13
|
import ListSubheader from "../ListSubheader/index.mjs";
|
|
@@ -327,6 +329,8 @@ const AutocompleteListbox = styled('ul', {
|
|
|
327
329
|
padding: '8px 0',
|
|
328
330
|
maxHeight: '40vh',
|
|
329
331
|
overflow: 'auto',
|
|
332
|
+
isolation: 'isolate',
|
|
333
|
+
// Prevent overlap with iOS overlay scrollbars.
|
|
330
334
|
position: 'relative',
|
|
331
335
|
[`& .${autocompleteClasses.option}`]: {
|
|
332
336
|
minHeight: 48,
|
|
@@ -455,6 +459,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
455
459
|
renderInput,
|
|
456
460
|
renderOption: renderOptionProp,
|
|
457
461
|
renderValue,
|
|
462
|
+
resetHighlightOnMouseLeave = false,
|
|
458
463
|
selectOnFocus = !props.freeSolo,
|
|
459
464
|
size = 'medium',
|
|
460
465
|
slots = {},
|
|
@@ -488,15 +493,51 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
488
493
|
...props,
|
|
489
494
|
componentName: 'Autocomplete'
|
|
490
495
|
});
|
|
496
|
+
|
|
497
|
+
// Re-render when anchorEl resizes so the Popper width stays in sync.
|
|
498
|
+
// Width is always read synchronously from anchorEl.clientWidth during render
|
|
499
|
+
// (no stale cached value). The hook just triggers a re-render on resize.
|
|
500
|
+
const forceRenderOnResize = useForcedRerendering();
|
|
501
|
+
React.useEffect(() => {
|
|
502
|
+
if (!popupOpen || !anchorEl || typeof ResizeObserver === 'undefined') {
|
|
503
|
+
return undefined;
|
|
504
|
+
}
|
|
505
|
+
let lastWidth = anchorEl.clientWidth;
|
|
506
|
+
const observer = new ResizeObserver(() => {
|
|
507
|
+
const newWidth = anchorEl.clientWidth;
|
|
508
|
+
if (lastWidth !== newWidth) {
|
|
509
|
+
lastWidth = newWidth;
|
|
510
|
+
forceRenderOnResize();
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
observer.observe(anchorEl);
|
|
514
|
+
return () => {
|
|
515
|
+
observer.disconnect();
|
|
516
|
+
};
|
|
517
|
+
}, [popupOpen, anchorEl, forceRenderOnResize]);
|
|
518
|
+
|
|
519
|
+
// When popupOpen becomes false, useAutocomplete returns [] for groupedOptions.
|
|
520
|
+
// Transitioned Poppers can remain mounted for their exit animation, so keep rendering
|
|
521
|
+
// the last open-state options instead of flashing "No options" or an empty Paper.
|
|
522
|
+
// These options are stale because they no longer reflect the hook's current
|
|
523
|
+
// groupedOptions, but they are non-interactive while closing and reset on next open.
|
|
524
|
+
const previousGroupedOptionsRef = React.useRef([]);
|
|
525
|
+
const prevPopupOpenRef = React.useRef(false);
|
|
526
|
+
const renderedOptions = popupOpen ? groupedOptions : previousGroupedOptionsRef.current;
|
|
527
|
+
useEnhancedEffect(() => {
|
|
528
|
+
if (popupOpen && !prevPopupOpenRef.current) {
|
|
529
|
+
previousGroupedOptionsRef.current = [];
|
|
530
|
+
}
|
|
531
|
+
prevPopupOpenRef.current = popupOpen;
|
|
532
|
+
if (popupOpen && groupedOptions.length > 0) {
|
|
533
|
+
previousGroupedOptionsRef.current = groupedOptions;
|
|
534
|
+
}
|
|
535
|
+
}, [popupOpen, groupedOptions]);
|
|
491
536
|
const hasClearIcon = !disableClearable && !disabled && dirty && !readOnly;
|
|
492
537
|
const hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false;
|
|
493
538
|
const {
|
|
494
539
|
onMouseDown: handleInputMouseDown
|
|
495
540
|
} = getInputProps();
|
|
496
|
-
const {
|
|
497
|
-
ref: listboxRef,
|
|
498
|
-
...otherListboxProps
|
|
499
|
-
} = getListboxProps();
|
|
500
541
|
const defaultGetOptionLabel = option => option.label ?? option;
|
|
501
542
|
const getOptionLabel = getOptionLabelProp || defaultGetOptionLabel;
|
|
502
543
|
|
|
@@ -535,8 +576,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
535
576
|
externalForwardedProps,
|
|
536
577
|
ownerState,
|
|
537
578
|
className: classes.listbox,
|
|
538
|
-
|
|
539
|
-
ref: listboxRef
|
|
579
|
+
getSlotProps: getListboxProps
|
|
540
580
|
});
|
|
541
581
|
const [PaperSlot, paperProps] = useSlot('paper', {
|
|
542
582
|
elementType: Paper,
|
|
@@ -552,13 +592,24 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
552
592
|
additionalProps: {
|
|
553
593
|
disablePortal,
|
|
554
594
|
style: {
|
|
555
|
-
width: anchorEl ? anchorEl.clientWidth : null
|
|
595
|
+
width: anchorEl ? anchorEl.clientWidth : null,
|
|
596
|
+
// Prevent interaction with stale cached options during exit transitions.
|
|
597
|
+
// The hook's filteredOptions is [] when popupOpen=false, so clicks on stale
|
|
598
|
+
// rendered options would pass undefined to selectNewValue.
|
|
599
|
+
pointerEvents: popupOpen ? undefined : 'none'
|
|
556
600
|
},
|
|
557
601
|
role: 'presentation',
|
|
558
602
|
anchorEl,
|
|
559
603
|
open: popupOpen
|
|
560
604
|
}
|
|
561
605
|
});
|
|
606
|
+
|
|
607
|
+
// Don't render the Popper when there's no content to show.
|
|
608
|
+
// In freeSolo mode, "No options" text is suppressed, so if there are also no
|
|
609
|
+
// matching options and loading is false, the Paper would be empty.
|
|
610
|
+
// Uses renderedOptions (not groupedOptions) so Popper stays during exit transitions.
|
|
611
|
+
// Respect keepMounted from resolved popperProps (handles both object and callback slotProps forms).
|
|
612
|
+
const hasPopupContent = renderedOptions.length > 0 || loading || !freeSolo || popperProps.keepMounted === true;
|
|
562
613
|
const [ClearIndicatorSlot, clearIndicatorProps] = useSlot('clearIndicator', {
|
|
563
614
|
elementType: AutocompleteClearIndicator,
|
|
564
615
|
externalForwardedProps,
|
|
@@ -704,17 +755,17 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
704
755
|
}
|
|
705
756
|
}
|
|
706
757
|
})
|
|
707
|
-
}), anchorEl ? /*#__PURE__*/_jsx(AutocompletePopper, {
|
|
758
|
+
}), anchorEl && hasPopupContent ? /*#__PURE__*/_jsx(AutocompletePopper, {
|
|
708
759
|
as: PopperSlot,
|
|
709
760
|
...popperProps,
|
|
710
761
|
children: /*#__PURE__*/_jsxs(AutocompletePaper, {
|
|
711
762
|
as: PaperSlot,
|
|
712
763
|
...paperProps,
|
|
713
|
-
children: [loading &&
|
|
764
|
+
children: [loading && renderedOptions.length === 0 ? /*#__PURE__*/_jsx(AutocompleteLoading, {
|
|
714
765
|
className: classes.loading,
|
|
715
766
|
ownerState: ownerState,
|
|
716
767
|
children: loadingText
|
|
717
|
-
}) : null,
|
|
768
|
+
}) : null, renderedOptions.length === 0 && !freeSolo && !loading ? /*#__PURE__*/_jsx(AutocompleteNoOptions, {
|
|
718
769
|
className: classes.noOptions,
|
|
719
770
|
ownerState: ownerState,
|
|
720
771
|
role: "presentation",
|
|
@@ -723,9 +774,9 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
723
774
|
event.preventDefault();
|
|
724
775
|
},
|
|
725
776
|
children: noOptionsText
|
|
726
|
-
}) : null,
|
|
777
|
+
}) : null, renderedOptions.length > 0 ? /*#__PURE__*/_jsx(ListboxSlot, {
|
|
727
778
|
...listboxProps,
|
|
728
|
-
children:
|
|
779
|
+
children: renderedOptions.map((option, index) => {
|
|
729
780
|
if (groupBy) {
|
|
730
781
|
return renderGroup({
|
|
731
782
|
key: option.key,
|
|
@@ -758,12 +809,11 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
758
809
|
*/
|
|
759
810
|
autoHighlight: PropTypes.bool,
|
|
760
811
|
/**
|
|
761
|
-
* If `true`, the
|
|
762
|
-
* when the Autocomplete loses focus unless the user chooses
|
|
763
|
-
* a different option or changes the character string in the input.
|
|
812
|
+
* If `true`, the value is updated when the input loses focus under one of these conditions:
|
|
764
813
|
*
|
|
765
|
-
*
|
|
766
|
-
*
|
|
814
|
+
* - An option highlighted via keyboard navigation or `autoHighlight` is selected.
|
|
815
|
+
* Hover and touch highlights are ignored.
|
|
816
|
+
* - Otherwise, in `freeSolo` mode, the typed text becomes the value.
|
|
767
817
|
* @default false
|
|
768
818
|
*/
|
|
769
819
|
autoSelect: PropTypes.bool,
|
|
@@ -1104,6 +1154,12 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
1104
1154
|
* @returns {ReactNode}
|
|
1105
1155
|
*/
|
|
1106
1156
|
renderValue: PropTypes.func,
|
|
1157
|
+
/**
|
|
1158
|
+
* If `true`, clears an option highlighted by mouse movement when the mouse leaves the listbox.
|
|
1159
|
+
* This behavior will be enabled by default in the next major version.
|
|
1160
|
+
* @default false
|
|
1161
|
+
*/
|
|
1162
|
+
resetHighlightOnMouseLeave: PropTypes.bool,
|
|
1107
1163
|
/**
|
|
1108
1164
|
* If `true`, the input's text is selected on focus.
|
|
1109
1165
|
* It helps the user clear the selected value.
|
package/Avatar/Avatar.js
CHANGED
|
@@ -76,6 +76,10 @@ const AvatarRoot = (0, _zeroStyled.styled)('div', {
|
|
|
76
76
|
},
|
|
77
77
|
style: {
|
|
78
78
|
color: (theme.vars || theme).palette.background.default,
|
|
79
|
+
'@media (forced-colors: active)': {
|
|
80
|
+
boxSizing: 'border-box',
|
|
81
|
+
border: '1px solid ButtonBorder'
|
|
82
|
+
},
|
|
79
83
|
...(theme.vars ? {
|
|
80
84
|
backgroundColor: theme.vars.palette.Avatar.defaultBg
|
|
81
85
|
} : {
|
package/Avatar/Avatar.mjs
CHANGED
|
@@ -69,6 +69,10 @@ const AvatarRoot = styled('div', {
|
|
|
69
69
|
},
|
|
70
70
|
style: {
|
|
71
71
|
color: (theme.vars || theme).palette.background.default,
|
|
72
|
+
'@media (forced-colors: active)': {
|
|
73
|
+
boxSizing: 'border-box',
|
|
74
|
+
border: '1px solid ButtonBorder'
|
|
75
|
+
},
|
|
72
76
|
...(theme.vars ? {
|
|
73
77
|
backgroundColor: theme.vars.palette.Avatar.defaultBg
|
|
74
78
|
} : {
|
package/Backdrop/Backdrop.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps } from '@mui/system';
|
|
3
3
|
import { FadeProps } from "../Fade/index.mjs";
|
|
4
|
-
import { TransitionProps } from "../transitions/
|
|
4
|
+
import { TransitionProps } from "../transitions/types.mjs";
|
|
5
5
|
import { Theme } from "../styles/index.mjs";
|
|
6
6
|
import { BackdropClasses } from "./backdropClasses.mjs";
|
|
7
7
|
import { OverridableComponent, OverrideProps } from "../OverridableComponent/index.mjs";
|
|
@@ -14,7 +14,7 @@ export interface BackdropSlots {
|
|
|
14
14
|
root: React.ElementType;
|
|
15
15
|
/**
|
|
16
16
|
* The component that renders the transition.
|
|
17
|
-
* [Follow this guide](
|
|
17
|
+
* [Follow this guide](/material-ui/transitions/#transition-slots) to learn more about the requirements for this component.
|
|
18
18
|
* @default Fade
|
|
19
19
|
*/
|
|
20
20
|
transition: React.ElementType;
|