UNPKG

@nex-ui/react

Version:

🎉 A beautiful, modern, and reliable React component library.

36 lines (33 loc) • 1.21 kB
"use client"; import { jsx } from 'react/jsx-runtime'; import { DialogProvider } from './DialogContext.mjs'; import { useDefaultProps } from '../utils/useDefaultProps.mjs'; import { Modal } from '../modal/Modal.mjs'; const Dialog = (inProps)=>{ const props = useDefaultProps({ name: 'Dialog', props: inProps }); const { open, children, restoreFocus, onOpenChange, defaultOpen, container, keepMounted, closeOnEscape, closeOnInteractBackdrop, preventScroll, onClose, hideBackdrop = false, ...remainingProps } = props; return /*#__PURE__*/ jsx(Modal, { open: open, container: container, restoreFocus: restoreFocus, onOpenChange: onOpenChange, defaultOpen: defaultOpen, keepMounted: keepMounted, preventScroll: preventScroll, closeOnEscape: closeOnEscape, onClose: onClose, closeOnInteractOutside: !hideBackdrop && closeOnInteractBackdrop, children: /*#__PURE__*/ jsx(DialogProvider, { value: { hideBackdrop, ...remainingProps }, children: children }) }); }; Dialog.displayName = 'Dialog'; export { Dialog };