@material-ui/lab
Version:
Laboratory for new Material-UI modules.
48 lines (44 loc) • 1.34 kB
JavaScript
import * as React from 'react';
import clsx from 'clsx';
import Fade from '@material-ui/core/Fade';
import { styled } from '@material-ui/core/styles';
import { generateUtilityClasses } from '@material-ui/unstyled';
import { TransitionGroup } from 'react-transition-group';
import { jsx as _jsx } from "react/jsx-runtime";
var classes = generateUtilityClasses('PrivatePickersFadeTransitionGroup', ['root']);
var animationDuration = 500;
var PickersFadeTransitionGroupRoot = styled(TransitionGroup, {
skipSx: true
})(function () {
return {
display: 'block',
position: 'relative'
};
});
/**
* @ignore - do not document.
*/
var PickersFadeTransitionGroup = function PickersFadeTransitionGroup(_ref) {
var children = _ref.children,
className = _ref.className,
reduceAnimations = _ref.reduceAnimations,
transKey = _ref.transKey;
if (reduceAnimations) {
return children;
}
return /*#__PURE__*/_jsx(PickersFadeTransitionGroupRoot, {
className: clsx(classes.root, className),
children: /*#__PURE__*/_jsx(Fade, {
appear: false,
mountOnEnter: true,
unmountOnExit: true,
timeout: {
appear: animationDuration,
enter: animationDuration / 2,
exit: 0
},
children: children
}, transKey)
});
};
export default PickersFadeTransitionGroup;