import { jsxs, jsx } from 'react/jsx-runtime';
import { Cross1Icon } from '../../node_modules/.pnpm/@radix-ui_react-icons@1.3.2_react@19.1.1/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js';
import { cx, cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
import { forwardRef } from 'react';
import { Flex } from '../flex/flex.js';
import styles from './dialog.module.css.js';
import { Portal, Overlay, Content, Root, Trigger, Close, Title, Description } from '../../node_modules/.pnpm/@radix-ui_react-dialog@1.1.14_@types_react-dom@19.1.7_@types_react@19.1.9__@types_react@19.1._i7gyttlqowrnok6rwi63tbbmni/node_modules/@radix-ui/react-dialog/dist/index.js';

const dialogContent = cva(styles.dialogContent);
const DialogContent = forwardRef(({ className, children, ariaLabel, ariaDescription, overlayBlur = false, overlayClassName, overlayStyle, width, ...props }, ref) => (jsxs(Portal, { children: [jsx(Overlay, { className: cx(styles.dialogOverlay, overlayClassName, overlayBlur && styles.overlayBlur), style: overlayStyle, "aria-hidden": 'true', role: 'presentation' }), jsx(Content, { ref: ref, className: dialogContent({ className }), style: { width, ...props.style }, "aria-label": ariaLabel, "aria-describedby": ariaDescription ? 'dialog-description' : undefined, ...props, children: children })] })));
DialogContent.displayName = Content.displayName;
const DialogHeader = ({ children, className }) => (jsx(Flex, { justify: 'between', align: 'center', className: cx(styles.header, className), children: children }));
const DialogFooter = ({ children, className }) => (jsx(Flex, { gap: 5, justify: 'end', className: cx(styles.footer, className), children: children }));
const DialogBody = ({ children, className }) => (jsx(Flex, { direction: 'column', gap: 3, className: cx(styles.body, className), children: children }));
function CloseButton({ className, ...props }) {
    return (jsx(Close, { className: cx(styles.close, className), "aria-label": 'Close dialog', ...props, children: jsx(Cross1Icon, {}) }));
}
function DialogTitle({ children, className, ...props }) {
    return (jsx(Title, { ...props, role: 'heading', "aria-level": 1, className: cx(styles.title, className), children: children }));
}
function DialogDescription({ children, className, ...props }) {
    return (jsx(Description, { ...props, className: cx(styles.description, className), id: 'dialog-description', role: 'document', children: children }));
}
const Dialog = Object.assign(Root, {
    Trigger: Trigger,
    Content: DialogContent,
    Header: DialogHeader,
    Footer: DialogFooter,
    Body: DialogBody,
    Close: Close,
    CloseButton: CloseButton,
    Title: DialogTitle,
    Description: DialogDescription
});

export { CloseButton, Dialog };
//# sourceMappingURL=dialog.js.map
