import { _ as _extends } from '../extends-C4cduGrv.js';
import { _ as _objectWithoutProperties } from '../objectWithoutProperties-TXwlfNxG.js';
import React__default from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import { D as DialogContent, a as DialogOverlay } from '../dialog.esm-C1hoFD2p.js';
import { motion, AnimatePresence } from 'framer-motion';
import '../typeof-CgC7Bq6K.js';
import '../portal.esm-CuKGPwhL.js';
import '../utils.esm-CKyxlHOy.js';
import '../warning-s9zGJbnw.js';
import 'react-dom';
import '../setPrototypeOf-Bchah3-D.js';
import '../defineProperty-CEd-kZQW.js';

var _excluded = ["children", "label", "onClose", "className"];
var AnimatedDialogContent = motion.custom(DialogContent);
var DEFAULT = "p-0 bg-white font-sans rounded shadow w-4/5 max-w-2xl";

function Dialog(_ref) {
  var children = _ref.children,
      label = _ref.label,
      onClose = _ref.onClose,
      className = _ref.className,
      props = _objectWithoutProperties(_ref, _excluded);

  return /*#__PURE__*/React__default.createElement(DialogOverlay, _extends({
    onDismiss: onClose
  }, props), /*#__PURE__*/React__default.createElement(AnimatePresence, null, /*#__PURE__*/React__default.createElement(AnimatedDialogContent, {
    key: "modal-content",
    "aria-label": label,
    className: cx(className, DEFAULT),
    initial: {
      opacity: 0,
      y: -15
    },
    animate: {
      opacity: 1,
      y: 0
    },
    exit: {
      opacity: 0
    }
  }, /*#__PURE__*/React__default.createElement("div", null, children))));
}

Dialog.propTypes = {
  children: PropTypes.node,
  label: PropTypes.string,
  className: PropTypes.string,
  onClose: PropTypes.func.isRequired
};

export { Dialog as default };
