import {
  Heading
} from "./chunk-HK224ADT.js";
import {
  ToastContainer
} from "./chunk-CYYWMYE7.js";
import {
  IconButton
} from "./chunk-O3DNDMV3.js";
import {
  __objRest,
  __spreadProps,
  __spreadValues
} from "./chunk-N552FDTV.js";

// src/atoms/dialog.tsx
import * as RadixDialog from "@radix-ui/react-dialog";
import { Cross1Icon } from "@radix-ui/react-icons";
import { Flex, Theme } from "@radix-ui/themes";
import { jsx, jsxs } from "react/jsx-runtime";
var preventDefault = (e) => {
  e.preventDefault();
};
function Content2(props) {
  const _a = props, {
    children,
    style = {},
    width,
    maxWidth,
    minWidth,
    maxHeight,
    height,
    minHeight,
    title,
    buttons,
    hideCloseButton,
    className
  } = _a, rest = __objRest(_a, [
    "children",
    "style",
    "width",
    "maxWidth",
    "minWidth",
    "maxHeight",
    "height",
    "minHeight",
    "title",
    "buttons",
    "hideCloseButton",
    "className"
  ]);
  return /* @__PURE__ */ jsx(RadixDialog.Portal, { children: /* @__PURE__ */ jsx(Theme, { asChild: true, children: /* @__PURE__ */ jsxs(RadixDialog.Overlay, { className: "DialogOverlay", children: [
    /* @__PURE__ */ jsxs(
      RadixDialog.Content,
      __spreadProps(__spreadValues({
        className: `DialogContent ${className || ""}`,
        onPointerDownOutside: preventDefault,
        style: __spreadValues({
          width,
          maxWidth,
          minWidth,
          maxHeight,
          height,
          minHeight
        }, style)
      }, rest), {
        children: [
          /* @__PURE__ */ jsxs(Flex, { gap: "2", justify: "between", children: [
            /* @__PURE__ */ jsx(RadixDialog.Title, { asChild: true, children: typeof title === "string" ? /* @__PURE__ */ jsx(Heading, { align: "center", mb: "2", variant: "heading3", children: title }) : title }),
            !hideCloseButton && /* @__PURE__ */ jsx(RadixDialog.Close, { asChild: true, className: "DialogClose", children: /* @__PURE__ */ jsx(IconButton, { color: "gray", variant: "ghost", children: /* @__PURE__ */ jsx(Cross1Icon, {}) }) })
          ] }),
          children,
          buttons ? /* @__PURE__ */ jsx(Flex, { gap: "3", justify: "end", mt: "3", children: buttons }) : null
        ]
      })
    ),
    /* @__PURE__ */ jsx(ToastContainer, {})
  ] }) }) });
}
function Close2(_a) {
  var _b = _a, {
    children
  } = _b, rest = __objRest(_b, [
    "children"
  ]);
  return /* @__PURE__ */ jsx(RadixDialog.Close, __spreadProps(__spreadValues({ asChild: true }, rest), { children }));
}
function Trigger2(_a) {
  var _b = _a, {
    children
  } = _b, rest = __objRest(_b, [
    "children"
  ]);
  return /* @__PURE__ */ jsx(RadixDialog.Trigger, __spreadProps(__spreadValues({ asChild: true }, rest), { children }));
}
var Dialog = {
  Root: RadixDialog.Root,
  Trigger: Trigger2,
  Content: Content2,
  Close: Close2,
  Description: RadixDialog.Description,
  Title: RadixDialog.Title
};

export {
  Dialog
};
//# sourceMappingURL=chunk-K2NYPATN.js.map