import { _ as _extends } from '../extends-e61fd370.js';
import { _ as _objectWithoutProperties } from '../objectWithoutProperties-72d23964.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-cde5d438.js';
import { motion, AnimatePresence } from 'framer-motion';
import '../typeof-6c6d8d7a.js';
import '../portal.esm-613949dc.js';
import '../utils.esm-514fad91.js';
import '../warning-ed2bf294.js';
import 'react-dom';
import '../setPrototypeOf-38804714.js';
import '../defineProperty-18999f8e.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 };
