"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import "react";
import { cn } from "../../lib/utils.js";
import { Button } from "./button.js";
import X from "../../node_modules/lucide-react/dist/esm/icons/x.js";
import { DialogRoot } from "../../node_modules/@base-ui/react/esm/dialog/root/DialogRoot.js";
import { DialogClose as DialogClose$1 } from "../../node_modules/@base-ui/react/esm/dialog/close/DialogClose.js";
import { DialogPopup } from "../../node_modules/@base-ui/react/esm/dialog/popup/DialogPopup.js";
import { DialogDescription as DialogDescription$1 } from "../../node_modules/@base-ui/react/esm/dialog/description/DialogDescription.js";
import { DialogBackdrop } from "../../node_modules/@base-ui/react/esm/dialog/backdrop/DialogBackdrop.js";
import { DialogPortal as DialogPortal$1 } from "../../node_modules/@base-ui/react/esm/dialog/portal/DialogPortal.js";
import { DialogTitle as DialogTitle$1 } from "../../node_modules/@base-ui/react/esm/dialog/title/DialogTitle.js";
import { DialogTrigger as DialogTrigger$1 } from "../../node_modules/@base-ui/react/esm/dialog/trigger/DialogTrigger.js";
function Dialog({ ...props }) {
  return /* @__PURE__ */ jsx(DialogRoot, { "data-slot": "dialog", ...props });
}
function DialogTrigger({ ...props }) {
  return /* @__PURE__ */ jsx(DialogTrigger$1, { "data-slot": "dialog-trigger", ...props });
}
function DialogPortal({ ...props }) {
  return /* @__PURE__ */ jsx(DialogPortal$1, { "data-slot": "dialog-portal", ...props });
}
function DialogClose({ ...props }) {
  return /* @__PURE__ */ jsx(DialogClose$1, { "data-slot": "dialog-close", ...props });
}
function DialogOverlay({ className, ...props }) {
  return /* @__PURE__ */ jsx(
    DialogBackdrop,
    {
      "data-slot": "dialog-overlay",
      className: cn(
        "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",
        className
      ),
      ...props
    }
  );
}
function DialogContent({
  className,
  children,
  showCloseButton = true,
  ...props
}) {
  return /* @__PURE__ */ jsxs(DialogPortal, { children: [
    /* @__PURE__ */ jsx(DialogOverlay, {}),
    /* @__PURE__ */ jsxs(
      DialogPopup,
      {
        "data-slot": "dialog-content",
        className: cn(
          "bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-border grid max-w-[calc(100%-2rem)] gap-6 rounded-xl p-6 text-sm ring-1 duration-100 sm:max-w-md fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",
          className
        ),
        ...props,
        children: [
          children,
          showCloseButton && /* @__PURE__ */ jsxs(
            DialogClose$1,
            {
              "data-slot": "dialog-close",
              render: /* @__PURE__ */ jsx(
                Button,
                {
                  variant: "ghost",
                  className: "absolute top-4 right-4",
                  size: "icon-sm"
                }
              ),
              children: [
                /* @__PURE__ */ jsx(X, {}),
                /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
              ]
            }
          )
        ]
      }
    )
  ] });
}
function DialogHeader({ className, ...props }) {
  return /* @__PURE__ */ jsx(
    "div",
    {
      "data-slot": "dialog-header",
      className: cn("gap-2 flex flex-col", className),
      ...props
    }
  );
}
function DialogFooter({
  className,
  showCloseButton = false,
  children,
  ...props
}) {
  return /* @__PURE__ */ jsxs(
    "div",
    {
      "data-slot": "dialog-footer",
      className: cn(
        "gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
        className
      ),
      ...props,
      children: [
        children,
        showCloseButton && /* @__PURE__ */ jsx(DialogClose$1, { render: /* @__PURE__ */ jsx(Button, { variant: "outline" }), children: "Close" })
      ]
    }
  );
}
function DialogTitle({ className, ...props }) {
  return /* @__PURE__ */ jsx(
    DialogTitle$1,
    {
      "data-slot": "dialog-title",
      className: cn("leading-none font-medium", className),
      ...props
    }
  );
}
function DialogDescription({ className, ...props }) {
  return /* @__PURE__ */ jsx(
    DialogDescription$1,
    {
      "data-slot": "dialog-description",
      className: cn(
        "text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",
        className
      ),
      ...props
    }
  );
}
export {
  Dialog,
  DialogClose,
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogHeader,
  DialogOverlay,
  DialogPortal,
  DialogTitle,
  DialogTrigger
};
//# sourceMappingURL=dialog.js.map
