@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
package/Drawer/Drawer.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { CreateSlotsAndSlotProps, SlotProps } from "../utils/types.js";
|
|
|
6
6
|
import { ModalProps } from "../Modal/index.js";
|
|
7
7
|
import { BackdropProps } from "../Backdrop/index.js";
|
|
8
8
|
import { PaperProps } from "../Paper/index.js";
|
|
9
|
-
import { TransitionProps } from "../transitions/
|
|
9
|
+
import { TransitionProps } from "../transitions/types.js";
|
|
10
10
|
import { DrawerClasses } from "./drawerClasses.js";
|
|
11
11
|
export interface DrawerRootSlotPropsOverrides {}
|
|
12
12
|
export interface DrawerDockedSlotPropsOverrides {}
|
|
@@ -36,7 +36,7 @@ export interface DrawerSlots {
|
|
|
36
36
|
paper: React.ElementType;
|
|
37
37
|
/**
|
|
38
38
|
* The component used for the transition.
|
|
39
|
-
* [Follow this guide](
|
|
39
|
+
* [Follow this guide](/material-ui/transitions/#transition-slots) to learn more about the requirements for this component.
|
|
40
40
|
* @default Slide
|
|
41
41
|
*/
|
|
42
42
|
transition: React.ElementType;
|
package/Drawer/Drawer.js
CHANGED
|
@@ -23,8 +23,10 @@ var _rootShouldForwardProp = _interopRequireDefault(require("../styles/rootShoul
|
|
|
23
23
|
var _zeroStyled = require("../zero-styled");
|
|
24
24
|
var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
|
|
25
25
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
26
|
+
var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
|
|
26
27
|
var _drawerClasses = require("./drawerClasses");
|
|
27
28
|
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
29
|
+
var _focusable = require("../utils/focusable");
|
|
28
30
|
var _utils = require("../utils");
|
|
29
31
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
30
32
|
const overridesResolver = (props, styles) => {
|
|
@@ -203,9 +205,15 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
|
|
|
203
205
|
// We use this state is order to skip the appear transition during the
|
|
204
206
|
// initial mount of the component.
|
|
205
207
|
const mounted = React.useRef(false);
|
|
208
|
+
const rootRef = React.useRef(null);
|
|
209
|
+
const handleRef = (0, _useForkRef.default)(ref, rootRef);
|
|
206
210
|
React.useEffect(() => {
|
|
207
211
|
mounted.current = true;
|
|
208
212
|
}, []);
|
|
213
|
+
|
|
214
|
+
// Resolve the container lazily so Slide reads the mounted modal root
|
|
215
|
+
// after refs are assigned, rather than the initial null ref during render.
|
|
216
|
+
const resolveSlideContainer = React.useCallback(() => rootRef.current, []);
|
|
209
217
|
const anchorInvariant = getAnchor({
|
|
210
218
|
direction: isRtl ? 'rtl' : 'ltr'
|
|
211
219
|
}, anchorProp);
|
|
@@ -229,7 +237,7 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
|
|
|
229
237
|
}
|
|
230
238
|
};
|
|
231
239
|
const [RootSlot, rootSlotProps] = (0, _useSlot.default)('root', {
|
|
232
|
-
ref,
|
|
240
|
+
ref: handleRef,
|
|
233
241
|
elementType: DrawerRoot,
|
|
234
242
|
className: (0, _clsx.default)(classes.root, classes.modal, className),
|
|
235
243
|
shouldForwardComponentProp: true,
|
|
@@ -240,6 +248,7 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
|
|
|
240
248
|
...ModalProps
|
|
241
249
|
},
|
|
242
250
|
additionalProps: {
|
|
251
|
+
closeAfterTransition: true,
|
|
243
252
|
open,
|
|
244
253
|
onClose,
|
|
245
254
|
hideBackdrop,
|
|
@@ -262,13 +271,15 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
|
|
|
262
271
|
square: true,
|
|
263
272
|
...(variant === 'temporary' && {
|
|
264
273
|
role: 'dialog',
|
|
265
|
-
'aria-modal': 'true'
|
|
274
|
+
'aria-modal': 'true',
|
|
275
|
+
[_focusable.FOCUSABLE_ATTRIBUTE]: '',
|
|
276
|
+
tabIndex: -1
|
|
266
277
|
})
|
|
267
278
|
}
|
|
268
279
|
});
|
|
269
280
|
const [DockedSlot, dockedSlotProps] = (0, _useSlot.default)('docked', {
|
|
270
281
|
elementType: DrawerDockedRoot,
|
|
271
|
-
ref,
|
|
282
|
+
ref: handleRef,
|
|
272
283
|
className: (0, _clsx.default)(classes.root, classes.docked, className),
|
|
273
284
|
ownerState,
|
|
274
285
|
externalForwardedProps,
|
|
@@ -282,7 +293,10 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
|
|
|
282
293
|
in: open,
|
|
283
294
|
direction: oppositeDirection[anchorInvariant],
|
|
284
295
|
timeout: transitionDuration,
|
|
285
|
-
appear: mounted.current
|
|
296
|
+
appear: mounted.current,
|
|
297
|
+
...(variant === 'temporary' && (slots.transition == null || slots.transition === _Slide.default) && {
|
|
298
|
+
container: resolveSlideContainer
|
|
299
|
+
})
|
|
286
300
|
}
|
|
287
301
|
});
|
|
288
302
|
const drawer = /*#__PURE__*/(0, _jsxRuntime.jsx)(PaperSlot, {
|
package/Drawer/Drawer.mjs
CHANGED
|
@@ -14,8 +14,10 @@ import rootShouldForwardProp from "../styles/rootShouldForwardProp.mjs";
|
|
|
14
14
|
import { styled, useTheme } from "../zero-styled/index.mjs";
|
|
15
15
|
import memoTheme from "../utils/memoTheme.mjs";
|
|
16
16
|
import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
|
|
17
|
+
import useForkRef from "../utils/useForkRef.mjs";
|
|
17
18
|
import { getDrawerUtilityClass } from "./drawerClasses.mjs";
|
|
18
19
|
import useSlot from "../utils/useSlot.mjs";
|
|
20
|
+
import { FOCUSABLE_ATTRIBUTE } from "../utils/focusable.mjs";
|
|
19
21
|
import { mergeSlotProps } from "../utils/index.mjs";
|
|
20
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
23
|
const overridesResolver = (props, styles) => {
|
|
@@ -194,9 +196,15 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
|
|
|
194
196
|
// We use this state is order to skip the appear transition during the
|
|
195
197
|
// initial mount of the component.
|
|
196
198
|
const mounted = React.useRef(false);
|
|
199
|
+
const rootRef = React.useRef(null);
|
|
200
|
+
const handleRef = useForkRef(ref, rootRef);
|
|
197
201
|
React.useEffect(() => {
|
|
198
202
|
mounted.current = true;
|
|
199
203
|
}, []);
|
|
204
|
+
|
|
205
|
+
// Resolve the container lazily so Slide reads the mounted modal root
|
|
206
|
+
// after refs are assigned, rather than the initial null ref during render.
|
|
207
|
+
const resolveSlideContainer = React.useCallback(() => rootRef.current, []);
|
|
200
208
|
const anchorInvariant = getAnchor({
|
|
201
209
|
direction: isRtl ? 'rtl' : 'ltr'
|
|
202
210
|
}, anchorProp);
|
|
@@ -220,7 +228,7 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
|
|
|
220
228
|
}
|
|
221
229
|
};
|
|
222
230
|
const [RootSlot, rootSlotProps] = useSlot('root', {
|
|
223
|
-
ref,
|
|
231
|
+
ref: handleRef,
|
|
224
232
|
elementType: DrawerRoot,
|
|
225
233
|
className: clsx(classes.root, classes.modal, className),
|
|
226
234
|
shouldForwardComponentProp: true,
|
|
@@ -231,6 +239,7 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
|
|
|
231
239
|
...ModalProps
|
|
232
240
|
},
|
|
233
241
|
additionalProps: {
|
|
242
|
+
closeAfterTransition: true,
|
|
234
243
|
open,
|
|
235
244
|
onClose,
|
|
236
245
|
hideBackdrop,
|
|
@@ -253,13 +262,15 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
|
|
|
253
262
|
square: true,
|
|
254
263
|
...(variant === 'temporary' && {
|
|
255
264
|
role: 'dialog',
|
|
256
|
-
'aria-modal': 'true'
|
|
265
|
+
'aria-modal': 'true',
|
|
266
|
+
[FOCUSABLE_ATTRIBUTE]: '',
|
|
267
|
+
tabIndex: -1
|
|
257
268
|
})
|
|
258
269
|
}
|
|
259
270
|
});
|
|
260
271
|
const [DockedSlot, dockedSlotProps] = useSlot('docked', {
|
|
261
272
|
elementType: DrawerDockedRoot,
|
|
262
|
-
ref,
|
|
273
|
+
ref: handleRef,
|
|
263
274
|
className: clsx(classes.root, classes.docked, className),
|
|
264
275
|
ownerState,
|
|
265
276
|
externalForwardedProps,
|
|
@@ -273,7 +284,10 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
|
|
|
273
284
|
in: open,
|
|
274
285
|
direction: oppositeDirection[anchorInvariant],
|
|
275
286
|
timeout: transitionDuration,
|
|
276
|
-
appear: mounted.current
|
|
287
|
+
appear: mounted.current,
|
|
288
|
+
...(variant === 'temporary' && (slots.transition == null || slots.transition === Slide) && {
|
|
289
|
+
container: resolveSlideContainer
|
|
290
|
+
})
|
|
277
291
|
}
|
|
278
292
|
});
|
|
279
293
|
const drawer = /*#__PURE__*/_jsx(PaperSlot, {
|
package/Fab/Fab.js
CHANGED
|
@@ -19,6 +19,7 @@ var _zeroStyled = require("../zero-styled");
|
|
|
19
19
|
var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
|
|
20
20
|
var _createSimplePaletteValueFilter = _interopRequireDefault(require("../utils/createSimplePaletteValueFilter"));
|
|
21
21
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
22
|
+
var _utils = require("../transitions/utils");
|
|
22
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
24
|
const useUtilityClasses = ownerState => {
|
|
24
25
|
const {
|
|
@@ -52,7 +53,7 @@ const FabRoot = (0, _zeroStyled.styled)(_ButtonBase.default, {
|
|
|
52
53
|
}) => ({
|
|
53
54
|
...theme.typography.button,
|
|
54
55
|
minHeight: 36,
|
|
55
|
-
|
|
56
|
+
...(0, _utils.getTransitionStyles)(theme, ['background-color', 'box-shadow', 'border-color'], {
|
|
56
57
|
duration: theme.transitions.duration.short
|
|
57
58
|
}),
|
|
58
59
|
borderRadius: '50%',
|
|
@@ -194,6 +195,12 @@ const Fab = /*#__PURE__*/React.forwardRef(function Fab(inProps, ref) {
|
|
|
194
195
|
variant
|
|
195
196
|
};
|
|
196
197
|
const classes = useUtilityClasses(ownerState);
|
|
198
|
+
|
|
199
|
+
// Don't forward the 'root' class to the ButtonBase, as it will get duplicated with the one passed to the className prop.
|
|
200
|
+
const {
|
|
201
|
+
root,
|
|
202
|
+
...forwardedClasses
|
|
203
|
+
} = classes;
|
|
197
204
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FabRoot, {
|
|
198
205
|
className: (0, _clsx.default)(classes.root, className),
|
|
199
206
|
component: component,
|
|
@@ -204,7 +211,7 @@ const Fab = /*#__PURE__*/React.forwardRef(function Fab(inProps, ref) {
|
|
|
204
211
|
ownerState: ownerState,
|
|
205
212
|
ref: ref,
|
|
206
213
|
...other,
|
|
207
|
-
classes:
|
|
214
|
+
classes: forwardedClasses,
|
|
208
215
|
children: children
|
|
209
216
|
});
|
|
210
217
|
});
|
package/Fab/Fab.mjs
CHANGED
|
@@ -12,6 +12,7 @@ import { styled } from "../zero-styled/index.mjs";
|
|
|
12
12
|
import memoTheme from "../utils/memoTheme.mjs";
|
|
13
13
|
import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.mjs";
|
|
14
14
|
import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
|
|
15
|
+
import { getTransitionStyles } from "../transitions/utils.mjs";
|
|
15
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
17
|
const useUtilityClasses = ownerState => {
|
|
17
18
|
const {
|
|
@@ -45,7 +46,7 @@ const FabRoot = styled(ButtonBase, {
|
|
|
45
46
|
}) => ({
|
|
46
47
|
...theme.typography.button,
|
|
47
48
|
minHeight: 36,
|
|
48
|
-
|
|
49
|
+
...getTransitionStyles(theme, ['background-color', 'box-shadow', 'border-color'], {
|
|
49
50
|
duration: theme.transitions.duration.short
|
|
50
51
|
}),
|
|
51
52
|
borderRadius: '50%',
|
|
@@ -187,6 +188,12 @@ const Fab = /*#__PURE__*/React.forwardRef(function Fab(inProps, ref) {
|
|
|
187
188
|
variant
|
|
188
189
|
};
|
|
189
190
|
const classes = useUtilityClasses(ownerState);
|
|
191
|
+
|
|
192
|
+
// Don't forward the 'root' class to the ButtonBase, as it will get duplicated with the one passed to the className prop.
|
|
193
|
+
const {
|
|
194
|
+
root,
|
|
195
|
+
...forwardedClasses
|
|
196
|
+
} = classes;
|
|
190
197
|
return /*#__PURE__*/_jsx(FabRoot, {
|
|
191
198
|
className: clsx(classes.root, className),
|
|
192
199
|
component: component,
|
|
@@ -197,7 +204,7 @@ const Fab = /*#__PURE__*/React.forwardRef(function Fab(inProps, ref) {
|
|
|
197
204
|
ownerState: ownerState,
|
|
198
205
|
ref: ref,
|
|
199
206
|
...other,
|
|
200
|
-
classes:
|
|
207
|
+
classes: forwardedClasses,
|
|
201
208
|
children: children
|
|
202
209
|
});
|
|
203
210
|
});
|
package/Fade/Fade.d.mts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { TransitionProps } from "../transitions/
|
|
2
|
+
import { TransitionProps } from "../transitions/types.mjs";
|
|
3
3
|
export interface FadeProps extends Omit<TransitionProps, 'children'> {
|
|
4
|
+
/**
|
|
5
|
+
* Add a custom transition end trigger.
|
|
6
|
+
* Use it when you need custom logic to decide when the transition has ended.
|
|
7
|
+
* Note: Timeouts are still used as a fallback if provided.
|
|
8
|
+
*
|
|
9
|
+
* @param {HTMLElement} node The transitioning DOM node.
|
|
10
|
+
* @param {Function} done Call this when the transition has finished.
|
|
11
|
+
*/
|
|
12
|
+
addEndListener?: TransitionProps['addEndListener'] | undefined;
|
|
4
13
|
/**
|
|
5
14
|
* Perform the enter transition when it first mounts if `in` is also `true`.
|
|
6
15
|
* Set this to `false` to disable this behavior.
|
|
@@ -11,6 +20,11 @@ export interface FadeProps extends Omit<TransitionProps, 'children'> {
|
|
|
11
20
|
* A single child content element.
|
|
12
21
|
*/
|
|
13
22
|
children: React.ReactElement<unknown, any>;
|
|
23
|
+
/**
|
|
24
|
+
* If `true`, the transition ignores `theme.motion.reducedMotion` and keeps its normal timing.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
disablePrefersReducedMotion?: boolean | undefined;
|
|
14
28
|
/**
|
|
15
29
|
* The transition timing function.
|
|
16
30
|
* You may specify a single easing or a object containing enter and exit values.
|
|
@@ -34,7 +48,6 @@ export interface FadeProps extends Omit<TransitionProps, 'children'> {
|
|
|
34
48
|
|
|
35
49
|
/**
|
|
36
50
|
* The Fade transition is used by the [Modal](https://mui.com/material-ui/react-modal/) component.
|
|
37
|
-
* It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
|
|
38
51
|
*
|
|
39
52
|
* Demos:
|
|
40
53
|
*
|
package/Fade/Fade.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { TransitionProps } from "../transitions/
|
|
2
|
+
import { TransitionProps } from "../transitions/types.js";
|
|
3
3
|
export interface FadeProps extends Omit<TransitionProps, 'children'> {
|
|
4
|
+
/**
|
|
5
|
+
* Add a custom transition end trigger.
|
|
6
|
+
* Use it when you need custom logic to decide when the transition has ended.
|
|
7
|
+
* Note: Timeouts are still used as a fallback if provided.
|
|
8
|
+
*
|
|
9
|
+
* @param {HTMLElement} node The transitioning DOM node.
|
|
10
|
+
* @param {Function} done Call this when the transition has finished.
|
|
11
|
+
*/
|
|
12
|
+
addEndListener?: TransitionProps['addEndListener'] | undefined;
|
|
4
13
|
/**
|
|
5
14
|
* Perform the enter transition when it first mounts if `in` is also `true`.
|
|
6
15
|
* Set this to `false` to disable this behavior.
|
|
@@ -11,6 +20,11 @@ export interface FadeProps extends Omit<TransitionProps, 'children'> {
|
|
|
11
20
|
* A single child content element.
|
|
12
21
|
*/
|
|
13
22
|
children: React.ReactElement<unknown, any>;
|
|
23
|
+
/**
|
|
24
|
+
* If `true`, the transition ignores `theme.motion.reducedMotion` and keeps its normal timing.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
disablePrefersReducedMotion?: boolean | undefined;
|
|
14
28
|
/**
|
|
15
29
|
* The transition timing function.
|
|
16
30
|
* You may specify a single easing or a object containing enter and exit values.
|
|
@@ -34,7 +48,6 @@ export interface FadeProps extends Omit<TransitionProps, 'children'> {
|
|
|
34
48
|
|
|
35
49
|
/**
|
|
36
50
|
* The Fade transition is used by the [Modal](https://mui.com/material-ui/react-modal/) component.
|
|
37
|
-
* It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
|
|
38
51
|
*
|
|
39
52
|
* Demos:
|
|
40
53
|
*
|
package/Fade/Fade.js
CHANGED
|
@@ -9,9 +9,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var _reactTransitionGroup = require("react-transition-group");
|
|
13
12
|
var _elementAcceptingRef = _interopRequireDefault(require("@mui/utils/elementAcceptingRef"));
|
|
14
13
|
var _getReactElementRef = _interopRequireDefault(require("@mui/utils/getReactElementRef"));
|
|
14
|
+
var _Transition = _interopRequireDefault(require("../internal/Transition"));
|
|
15
|
+
var _useReducedMotion = _interopRequireDefault(require("../transitions/useReducedMotion"));
|
|
15
16
|
var _zeroStyled = require("../zero-styled");
|
|
16
17
|
var _utils = require("../transitions/utils");
|
|
17
18
|
var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
|
|
@@ -37,7 +38,6 @@ const hiddenStyles = {
|
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
40
|
* The Fade transition is used by the [Modal](/material-ui/react-modal/) component.
|
|
40
|
-
* It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
|
|
41
41
|
*/
|
|
42
42
|
const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
|
|
43
43
|
const theme = (0, _zeroStyled.useTheme)();
|
|
@@ -49,6 +49,7 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
|
|
|
49
49
|
addEndListener,
|
|
50
50
|
appear = true,
|
|
51
51
|
children,
|
|
52
|
+
disablePrefersReducedMotion = false,
|
|
52
53
|
easing,
|
|
53
54
|
in: inProp,
|
|
54
55
|
onEnter,
|
|
@@ -61,12 +62,14 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
|
|
|
61
62
|
timeout = defaultTimeout,
|
|
62
63
|
...other
|
|
63
64
|
} = props;
|
|
65
|
+
const reducedMotion = (0, _useReducedMotion.default)(theme.motion.reducedMotion, disablePrefersReducedMotion);
|
|
64
66
|
const nodeRef = React.useRef(null);
|
|
65
67
|
const handleRef = (0, _useForkRef.default)(nodeRef, (0, _getReactElementRef.default)(children), ref);
|
|
66
68
|
const handleEntering = (0, _utils.normalizedTransitionCallback)(nodeRef, onEntering);
|
|
67
69
|
const handleEnter = (0, _utils.normalizedTransitionCallback)(nodeRef, (node, isAppearing) => {
|
|
68
|
-
(
|
|
69
|
-
|
|
70
|
+
if (!reducedMotion.shouldReduceMotion) {
|
|
71
|
+
(0, _utils.reflow)(node); // Force layout so the animation starts from the initial styles.
|
|
72
|
+
}
|
|
70
73
|
const transitionProps = (0, _utils.getTransitionProps)({
|
|
71
74
|
style,
|
|
72
75
|
timeout,
|
|
@@ -74,7 +77,15 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
|
|
|
74
77
|
}, {
|
|
75
78
|
mode: 'enter'
|
|
76
79
|
});
|
|
77
|
-
|
|
80
|
+
const transitionTiming = reducedMotion.getTransitionTiming({
|
|
81
|
+
duration: transitionProps.duration,
|
|
82
|
+
delay: transitionProps.delay
|
|
83
|
+
});
|
|
84
|
+
node.style.transition = theme.transitions.create('opacity', {
|
|
85
|
+
duration: transitionTiming.duration,
|
|
86
|
+
easing: transitionProps.easing,
|
|
87
|
+
delay: transitionTiming.delay
|
|
88
|
+
});
|
|
78
89
|
if (onEnter) {
|
|
79
90
|
onEnter(node, isAppearing);
|
|
80
91
|
}
|
|
@@ -89,27 +100,32 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
|
|
|
89
100
|
}, {
|
|
90
101
|
mode: 'exit'
|
|
91
102
|
});
|
|
92
|
-
|
|
103
|
+
const transitionTiming = reducedMotion.getTransitionTiming({
|
|
104
|
+
duration: transitionProps.duration,
|
|
105
|
+
delay: transitionProps.delay
|
|
106
|
+
});
|
|
107
|
+
node.style.transition = theme.transitions.create('opacity', {
|
|
108
|
+
duration: transitionTiming.duration,
|
|
109
|
+
easing: transitionProps.easing,
|
|
110
|
+
delay: transitionTiming.delay
|
|
111
|
+
});
|
|
93
112
|
if (onExit) {
|
|
94
113
|
onExit(node);
|
|
95
114
|
}
|
|
96
115
|
});
|
|
97
116
|
const handleExited = (0, _utils.normalizedTransitionCallback)(nodeRef, node => {
|
|
98
|
-
// Clear
|
|
99
|
-
//
|
|
100
|
-
//
|
|
117
|
+
// Clear transition CSS after exit so fixed elements like Backdrop do not
|
|
118
|
+
// keep a compositor layer alive and cause idle CPU usage. handleEnter sets
|
|
119
|
+
// it again on next open.
|
|
101
120
|
node.style.transition = '';
|
|
102
121
|
if (onExited) {
|
|
103
122
|
onExited(node);
|
|
104
123
|
}
|
|
105
124
|
});
|
|
106
|
-
const handleAddEndListener = next => {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.Transition, {
|
|
125
|
+
const handleAddEndListener = addEndListener ? next => {
|
|
126
|
+
addEndListener(nodeRef.current, next);
|
|
127
|
+
} : undefined;
|
|
128
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Transition.default, {
|
|
113
129
|
appear: appear,
|
|
114
130
|
in: inProp,
|
|
115
131
|
nodeRef: nodeRef,
|
|
@@ -120,12 +136,15 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
|
|
|
120
136
|
onExited: handleExited,
|
|
121
137
|
onExiting: handleExiting,
|
|
122
138
|
addEndListener: handleAddEndListener,
|
|
139
|
+
reduceMotion: reducedMotion.shouldReduceMotion,
|
|
123
140
|
timeout: timeout,
|
|
124
141
|
...other,
|
|
125
142
|
children: (state, {
|
|
126
143
|
ownerState,
|
|
127
144
|
...restChildProps
|
|
128
145
|
}) => {
|
|
146
|
+
// Do not pass ownerState to a DOM child. ownerState is only for
|
|
147
|
+
// Material UI styling, and React would treat it as an invalid DOM attribute.
|
|
129
148
|
const childStyle = (0, _utils.getTransitionChildStyle)(state, inProp, styles, hiddenStyles, style, children.props.style);
|
|
130
149
|
return /*#__PURE__*/React.cloneElement(children, {
|
|
131
150
|
style: childStyle,
|
|
@@ -141,9 +160,12 @@ process.env.NODE_ENV !== "production" ? Fade.propTypes /* remove-proptypes */ =
|
|
|
141
160
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
142
161
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
143
162
|
/**
|
|
144
|
-
* Add a custom transition end trigger.
|
|
145
|
-
*
|
|
146
|
-
*
|
|
163
|
+
* Add a custom transition end trigger.
|
|
164
|
+
* Use it when you need custom logic to decide when the transition has ended.
|
|
165
|
+
* Note: Timeouts are still used as a fallback if provided.
|
|
166
|
+
*
|
|
167
|
+
* @param {HTMLElement} node The transitioning DOM node.
|
|
168
|
+
* @param {Function} done Call this when the transition has finished.
|
|
147
169
|
*/
|
|
148
170
|
addEndListener: _propTypes.default.func,
|
|
149
171
|
/**
|
|
@@ -156,6 +178,11 @@ process.env.NODE_ENV !== "production" ? Fade.propTypes /* remove-proptypes */ =
|
|
|
156
178
|
* A single child content element.
|
|
157
179
|
*/
|
|
158
180
|
children: _elementAcceptingRef.default.isRequired,
|
|
181
|
+
/**
|
|
182
|
+
* If `true`, the transition ignores `theme.motion.reducedMotion` and keeps its normal timing.
|
|
183
|
+
* @default false
|
|
184
|
+
*/
|
|
185
|
+
disablePrefersReducedMotion: _propTypes.default.bool,
|
|
159
186
|
/**
|
|
160
187
|
* The transition timing function.
|
|
161
188
|
* You may specify a single easing or a object containing enter and exit values.
|
package/Fade/Fade.mjs
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import { Transition } from 'react-transition-group';
|
|
6
5
|
import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
|
|
7
6
|
import getReactElementRef from '@mui/utils/getReactElementRef';
|
|
7
|
+
import Transition from "../internal/Transition.mjs";
|
|
8
|
+
import useReducedMotion from "../transitions/useReducedMotion.mjs";
|
|
8
9
|
import { useTheme } from "../zero-styled/index.mjs";
|
|
9
10
|
import { normalizedTransitionCallback, reflow, getTransitionProps, getTransitionChildStyle } from "../transitions/utils.mjs";
|
|
10
11
|
import useForkRef from "../utils/useForkRef.mjs";
|
|
@@ -30,7 +31,6 @@ const hiddenStyles = {
|
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* The Fade transition is used by the [Modal](/material-ui/react-modal/) component.
|
|
33
|
-
* It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
|
|
34
34
|
*/
|
|
35
35
|
const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
|
|
36
36
|
const theme = useTheme();
|
|
@@ -42,6 +42,7 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
|
|
|
42
42
|
addEndListener,
|
|
43
43
|
appear = true,
|
|
44
44
|
children,
|
|
45
|
+
disablePrefersReducedMotion = false,
|
|
45
46
|
easing,
|
|
46
47
|
in: inProp,
|
|
47
48
|
onEnter,
|
|
@@ -54,12 +55,14 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
|
|
|
54
55
|
timeout = defaultTimeout,
|
|
55
56
|
...other
|
|
56
57
|
} = props;
|
|
58
|
+
const reducedMotion = useReducedMotion(theme.motion.reducedMotion, disablePrefersReducedMotion);
|
|
57
59
|
const nodeRef = React.useRef(null);
|
|
58
60
|
const handleRef = useForkRef(nodeRef, getReactElementRef(children), ref);
|
|
59
61
|
const handleEntering = normalizedTransitionCallback(nodeRef, onEntering);
|
|
60
62
|
const handleEnter = normalizedTransitionCallback(nodeRef, (node, isAppearing) => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
if (!reducedMotion.shouldReduceMotion) {
|
|
64
|
+
reflow(node); // Force layout so the animation starts from the initial styles.
|
|
65
|
+
}
|
|
63
66
|
const transitionProps = getTransitionProps({
|
|
64
67
|
style,
|
|
65
68
|
timeout,
|
|
@@ -67,7 +70,15 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
|
|
|
67
70
|
}, {
|
|
68
71
|
mode: 'enter'
|
|
69
72
|
});
|
|
70
|
-
|
|
73
|
+
const transitionTiming = reducedMotion.getTransitionTiming({
|
|
74
|
+
duration: transitionProps.duration,
|
|
75
|
+
delay: transitionProps.delay
|
|
76
|
+
});
|
|
77
|
+
node.style.transition = theme.transitions.create('opacity', {
|
|
78
|
+
duration: transitionTiming.duration,
|
|
79
|
+
easing: transitionProps.easing,
|
|
80
|
+
delay: transitionTiming.delay
|
|
81
|
+
});
|
|
71
82
|
if (onEnter) {
|
|
72
83
|
onEnter(node, isAppearing);
|
|
73
84
|
}
|
|
@@ -82,26 +93,31 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
|
|
|
82
93
|
}, {
|
|
83
94
|
mode: 'exit'
|
|
84
95
|
});
|
|
85
|
-
|
|
96
|
+
const transitionTiming = reducedMotion.getTransitionTiming({
|
|
97
|
+
duration: transitionProps.duration,
|
|
98
|
+
delay: transitionProps.delay
|
|
99
|
+
});
|
|
100
|
+
node.style.transition = theme.transitions.create('opacity', {
|
|
101
|
+
duration: transitionTiming.duration,
|
|
102
|
+
easing: transitionProps.easing,
|
|
103
|
+
delay: transitionTiming.delay
|
|
104
|
+
});
|
|
86
105
|
if (onExit) {
|
|
87
106
|
onExit(node);
|
|
88
107
|
}
|
|
89
108
|
});
|
|
90
109
|
const handleExited = normalizedTransitionCallback(nodeRef, node => {
|
|
91
|
-
// Clear
|
|
92
|
-
//
|
|
93
|
-
//
|
|
110
|
+
// Clear transition CSS after exit so fixed elements like Backdrop do not
|
|
111
|
+
// keep a compositor layer alive and cause idle CPU usage. handleEnter sets
|
|
112
|
+
// it again on next open.
|
|
94
113
|
node.style.transition = '';
|
|
95
114
|
if (onExited) {
|
|
96
115
|
onExited(node);
|
|
97
116
|
}
|
|
98
117
|
});
|
|
99
|
-
const handleAddEndListener = next => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
addEndListener(nodeRef.current, next);
|
|
103
|
-
}
|
|
104
|
-
};
|
|
118
|
+
const handleAddEndListener = addEndListener ? next => {
|
|
119
|
+
addEndListener(nodeRef.current, next);
|
|
120
|
+
} : undefined;
|
|
105
121
|
return /*#__PURE__*/_jsx(Transition, {
|
|
106
122
|
appear: appear,
|
|
107
123
|
in: inProp,
|
|
@@ -113,12 +129,15 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
|
|
|
113
129
|
onExited: handleExited,
|
|
114
130
|
onExiting: handleExiting,
|
|
115
131
|
addEndListener: handleAddEndListener,
|
|
132
|
+
reduceMotion: reducedMotion.shouldReduceMotion,
|
|
116
133
|
timeout: timeout,
|
|
117
134
|
...other,
|
|
118
135
|
children: (state, {
|
|
119
136
|
ownerState,
|
|
120
137
|
...restChildProps
|
|
121
138
|
}) => {
|
|
139
|
+
// Do not pass ownerState to a DOM child. ownerState is only for
|
|
140
|
+
// Material UI styling, and React would treat it as an invalid DOM attribute.
|
|
122
141
|
const childStyle = getTransitionChildStyle(state, inProp, styles, hiddenStyles, style, children.props.style);
|
|
123
142
|
return /*#__PURE__*/React.cloneElement(children, {
|
|
124
143
|
style: childStyle,
|
|
@@ -134,9 +153,12 @@ process.env.NODE_ENV !== "production" ? Fade.propTypes /* remove-proptypes */ =
|
|
|
134
153
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
135
154
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
136
155
|
/**
|
|
137
|
-
* Add a custom transition end trigger.
|
|
138
|
-
*
|
|
139
|
-
*
|
|
156
|
+
* Add a custom transition end trigger.
|
|
157
|
+
* Use it when you need custom logic to decide when the transition has ended.
|
|
158
|
+
* Note: Timeouts are still used as a fallback if provided.
|
|
159
|
+
*
|
|
160
|
+
* @param {HTMLElement} node The transitioning DOM node.
|
|
161
|
+
* @param {Function} done Call this when the transition has finished.
|
|
140
162
|
*/
|
|
141
163
|
addEndListener: PropTypes.func,
|
|
142
164
|
/**
|
|
@@ -149,6 +171,11 @@ process.env.NODE_ENV !== "production" ? Fade.propTypes /* remove-proptypes */ =
|
|
|
149
171
|
* A single child content element.
|
|
150
172
|
*/
|
|
151
173
|
children: elementAcceptingRef.isRequired,
|
|
174
|
+
/**
|
|
175
|
+
* If `true`, the transition ignores `theme.motion.reducedMotion` and keeps its normal timing.
|
|
176
|
+
* @default false
|
|
177
|
+
*/
|
|
178
|
+
disablePrefersReducedMotion: PropTypes.bool,
|
|
152
179
|
/**
|
|
153
180
|
* The transition timing function.
|
|
154
181
|
* You may specify a single easing or a object containing enter and exit values.
|
|
@@ -20,6 +20,10 @@ export interface FilledInputProps extends StandardProps<InputBaseProps> {
|
|
|
20
20
|
* @default false
|
|
21
21
|
*/
|
|
22
22
|
disableUnderline?: boolean | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
notched?: boolean | undefined;
|
|
23
27
|
/**
|
|
24
28
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
25
29
|
*/
|
|
@@ -20,6 +20,10 @@ export interface FilledInputProps extends StandardProps<InputBaseProps> {
|
|
|
20
20
|
* @default false
|
|
21
21
|
*/
|
|
22
22
|
disableUnderline?: boolean | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
notched?: boolean | undefined;
|
|
23
27
|
/**
|
|
24
28
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
25
29
|
*/
|