import { jsxs as r, jsx as e } from "react/jsx-runtime";
import w from "../../foundation/Icon/Generated/IconCross.es.js";
import { FOCUS_VISIBLE_STYLE as p } from "../../utilities/focusStyle.es.js";
import { merge as i } from "../../utilities/merge.es.js";
import { dialogHeadingMap as f, dialogPaddingMap as b } from "../../types/dialog.es.js";
import { Box as o } from "../Box/Box.es.js";
import { Flex as h } from "../Flex/Flex.es.js";
const x = ({
  title: n,
  separator: d = !0,
  padding: a = "comfortable",
  onClose: l,
  icon: m,
  badge: s,
  children: c,
  "data-test-id": t = "fondue-dialog-header"
}) => /* @__PURE__ */ r(
  o,
  {
    "data-test-id": t,
    className: i([
      "tw-w-full tw-flex tw-items-center tw-border-b tw-border-b-line",
      b[a],
      !d && "tw-pb-0 tw-border-none"
    ]),
    children: [
      /* @__PURE__ */ r(h, { alignItems: "center", "data-test-id": `${t}-title`, children: [
        /* @__PURE__ */ r(o, { className: "tw-flex tw-items-center tw-text-box-neutral-mighty", children: [
          m && /* @__PURE__ */ e("span", { "data-test-id": `${t}-icon`, className: "tw-mr-1.5", children: m }),
          /* @__PURE__ */ e("p", { className: i([f[a], "tw-font-medium tw-whitespace-nowrap"]), children: n }),
          s && /* @__PURE__ */ e("div", { "data-test-id": `${t}-badge`, className: "tw-ml-1.5", children: s })
        ] }),
        /* @__PURE__ */ e(o, { className: "tw-flex-shrink tw-ml-1", children: c })
      ] }),
      l && /* @__PURE__ */ e(
        "button",
        {
          type: "button",
          "data-test-id": `${t}-close`,
          "aria-label": `${t}-close`,
          onClick: l,
          className: i([p, "tw-rounded tw-absolute tw-right-5 tw-text-text"]),
          children: /* @__PURE__ */ e(w, {})
        }
      )
    ]
  }
);
x.displayName = "FondueDialogHeader";
export {
  x as DialogHeader
};
//# sourceMappingURL=DialogHeader.es.js.map
