UNPKG

@coreui/react-pro

Version:

UI Components Library for React.js

25 lines (22 loc) 1.12 kB
import { __rest } from '../../node_modules/tslib/tslib.es6.js'; import React, { forwardRef, useRef } from 'react'; import PropTypes from 'prop-types'; import classNames from '../../_virtual/index.js'; import '@popperjs/core'; import { useForkedRef } from '../../hooks/useForkedRef.js'; import Transition from '../../node_modules/react-transition-group/esm/Transition.js'; const CBackdrop = forwardRef((_a, ref) => { var { className = 'modal-backdrop', visible } = _a, rest = __rest(_a, ["className", "visible"]); const backdropRef = useRef(null); const forkedRef = useForkedRef(ref, backdropRef); return (React.createElement(Transition, { in: visible, mountOnEnter: true, nodeRef: backdropRef, timeout: 150, unmountOnExit: true }, (state) => (React.createElement("div", Object.assign({ className: classNames(className, 'fade', { show: state === 'entered', }) }, rest, { ref: forkedRef }))))); }); CBackdrop.propTypes = { className: PropTypes.string, visible: PropTypes.bool, }; CBackdrop.displayName = 'CBackdrop'; export { CBackdrop }; //# sourceMappingURL=CBackdrop.js.map