import { jsx as _jsx } from "react/jsx-runtime";
import { CloseButton } from '../button';
import { useStyleConfig, vui } from '../core';
import { cs } from '../utils';
import { useDialogContext } from './context';
/** Shows a CloseButton in the Dialog Header, which by default closes the Dialog. */
export const DialogCloseButton = vui((props, ref) => {
    const { className, size = 'md', ...rest } = props;
    const { onClose } = useDialogContext() ?? {};
    const styles = useStyleConfig('Dialog', useDialogContext());
    return (_jsx(CloseButton, { className: cs('vui-dialogCloseButton', className), onClick: onClose, position: "absolute", ref: ref, right: 16, size: size, top: 16, variant: "tertiaryDark", ...styles.closeButton, ...rest }));
});
DialogCloseButton.displayName = 'DialogCloseButton';
export default DialogCloseButton;
//# sourceMappingURL=dialogCloseButton.js.map