import { jsx, jsxs } from 'react/jsx-runtime';
import { useTranslation } from 'react-i18next';
import { c as cn } from './utils-DdHUxIdC.js';
import { B as Button } from './button-D6uWDFCs.js';
import { X } from './x-_o2T3n6D.js';
import { R as Root, P as Portal, O as Overlay, T as Title, D as Description, a as Close, b as Trigger, C as Content } from './index-9HvIbmnI.js';

function Dialog({ ...props }) {
    return jsx(Root, { "data-slot": "dialog", ...props });
}
function DialogTrigger({ ...props }) {
    return jsx(Trigger, { "data-slot": "dialog-trigger", ...props });
}
function DialogPortal({ ...props }) {
    return jsx(Portal, { "data-slot": "dialog-portal", ...props });
}
function DialogClose({ ...props }) {
    return jsx(Close, { "data-slot": "dialog-close", ...props });
}
function DialogOverlay({ className, ...props }) {
    return (jsx(Overlay, { "data-slot": "dialog-overlay", className: cn("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className), ...props }));
}
function DialogContent({ className, children, showCloseButton = true, ...props }) {
    const { t } = useTranslation();
    return (jsxs(DialogPortal, { children: [jsx(DialogOverlay, {}), jsxs(Content, { "data-slot": "dialog-content", className: cn("fixed top-1/2 start-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2 gap-5 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props, children: [children, showCloseButton && (jsx(Close, { "data-slot": "dialog-close", asChild: true, children: jsxs(Button, { variant: "ghost", className: "absolute top-2 end-2", size: "icon-sm", children: [jsx(X, {}), jsx("span", { className: "sr-only", children: t("neetoatoms.dialog.close", "Close") })] }) }))] })] }));
}
function DialogHeader({ className, ...props }) {
    return (jsx("div", { "data-slot": "dialog-header", className: cn("flex flex-col gap-3", className), ...props }));
}
function DialogFooter({ className, showCloseButton = false, children, ...props }) {
    return (jsxs("div", { "data-slot": "dialog-footer", className: cn("-mx-6 -mb-6 flex flex-col-reverse gap-2 rounded-b-xl bg-muted/50 px-6 py-4 sm:flex-row sm:justify-end", className), ...props, children: [children, showCloseButton && (jsx(Close, { asChild: true, children: jsx(Button, { variant: "outline", children: "Close" }) }))] }));
}
function DialogTitle({ className, ...props }) {
    return (jsx(Title, { "data-slot": "dialog-title", className: cn("text-base leading-none font-medium", className), ...props }));
}
function DialogDescription({ className, ...props }) {
    return (jsx(Description, { "data-slot": "dialog-description", className: cn("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className), ...props }));
}

export { Dialog as D, DialogPortal as a, DialogOverlay as b, DialogHeader as c, DialogTitle as d, DialogDescription as e, DialogFooter as f, DialogClose as g, DialogTrigger as h, DialogContent as i };
//# sourceMappingURL=dialog-DK71SlsS.js.map
