"use client";
import { jsx as e, jsxs as C } from "react/jsx-runtime";
import { createContext as P, useContext as v } from "react";
import { L as h } from "./layer-card-m6h85dpadvee39h2.js";
import { r as A } from "./resolve-variant-gw6eh7fa4st8ej7m.js";
import { u as b } from "./portal-provider-hwmkdmkpvct0cb76.js";
import { c as x } from "./vendor-styling-ofvnbcuht98q88oo.js";
import { at as N, au as R, av as z, aw as L, ax as d, ay as p, az as m, aA as u, aB as D, aC as f } from "./vendor-base-ui-elpbzr8xeffrz4h2.js";
const O = {
  size: {
    base: {
      classes: "sm:w-96",
      description: "Default dialog width (384px)"
    },
    sm: {
      classes: "sm:w-72",
      description: "Small dialog for simple confirmations (288px)"
    },
    lg: {
      classes: "sm:w-[32rem]",
      description: "Large dialog for complex content (512px)"
    },
    xl: {
      classes: "sm:w-[48rem]",
      description: "Extra large dialog for detailed views (768px)"
    }
  }
}, s = {
  size: "base",
  role: "dialog"
}, g = P("dialog");
function l() {
  return v(g);
}
function _({
  size: a = s.size
} = {}) {
  return x(
    // Base styles
    "shadow-m ring ring-kumo-line fixed top-1/2 left-1/2 w-full max-w-[calc(100vw-2rem)] -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-xl bg-kumo-base text-kumo-default duration-150 data-ending-style:scale-90 data-ending-style:opacity-0 data-starting-style:scale-90 data-starting-style:opacity-0",
    // Apply size from KUMO_DIALOG_VARIANTS
    A(O.size, a, s.size).classes
  );
}
function $({
  className: a,
  children: o,
  style: i,
  size: t = s.size,
  container: n
}) {
  const r = l(), c = b();
  return /* @__PURE__ */ C(r === "alertdialog" ? u : u, { container: n ?? c ?? void 0, children: [
    /* @__PURE__ */ e(r === "alertdialog" ? D : D, { className: "fixed inset-0 bg-kumo-recessed opacity-80 transition-all duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0" }),
    /* @__PURE__ */ e(
      h,
      {
        render: /* @__PURE__ */ e(r === "alertdialog" ? f : f, {}),
        className: x(_({ size: t }), a),
        style: {
          transitionProperty: "scale, opacity",
          transitionTimingFunction: "var(--default-transition-timing-function)",
          "--tw-shadow": "0 20px 25px -5px rgb(0 0 0 / 0.03), 0 8px 10px -6px rgb(0 0 0 / 0.03)",
          ...i
        },
        children: o
      }
    )
  ] });
}
function y(a) {
  if (a.role === "alertdialog") {
    const { children: n, role: r, ...c } = a;
    return /* @__PURE__ */ e(g.Provider, { value: r, children: /* @__PURE__ */ e(N, { ...c, children: n }) });
  }
  const {
    children: o,
    role: i = s.role,
    ...t
  } = a;
  return /* @__PURE__ */ e(g.Provider, { value: i, children: /* @__PURE__ */ e(R, { ...t, children: o }) });
}
y.displayName = "Dialog.Root";
function w({ children: a, ...o }) {
  return l() === "alertdialog" ? /* @__PURE__ */ e(
    z,
    {
      "data-kumo-component": "Dialog",
      "data-kumo-part": "trigger",
      ...o,
      children: a
    }
  ) : /* @__PURE__ */ e(
    L,
    {
      "data-kumo-component": "Dialog",
      "data-kumo-part": "trigger",
      ...o,
      children: a
    }
  );
}
w.displayName = "Dialog.Trigger";
function T({ className: a, ...o }) {
  const t = l() === "alertdialog" ? d : d;
  return /* @__PURE__ */ e(t, { className: a, ...o });
}
T.displayName = "Dialog.Title";
function k({ className: a, ...o }) {
  const t = l() === "alertdialog" ? p : p;
  return /* @__PURE__ */ e(t, { className: a, ...o });
}
k.displayName = "Dialog.Description";
function B({ children: a, ...o }) {
  const t = l() === "alertdialog" ? m : m;
  return /* @__PURE__ */ e(t, { "data-kumo-component": "Dialog", "data-kumo-part": "close", ...o, children: a });
}
B.displayName = "Dialog.Close";
const H = Object.assign($, {
  Root: y,
  Trigger: w,
  Title: T,
  Description: k,
  Close: B
});
export {
  H as D,
  y as a,
  w as b,
  T as c,
  k as d,
  B as e
};
//# sourceMappingURL=dialog-ovhmzfuppr5xix0e.js.map
