import { j as t } from "../../_virtual/jsx-runtime.js";
import { SideSheetContainer as p, SideSheetContentWrapper as u, HeaderWrapper as C, TitleWrapper as S, CloseButton as k, BackDrop as W } from "./styles.js";
import { unitJSX as g } from "../../utils/index.js";
import { useOnClickOutside as B } from "../../hooks/useClickOutside.js";
function J({
  id: n,
  isOpen: e,
  width: s,
  title: o,
  onShowSideSheet: l,
  backdrop: d = !1,
  fixed: c = !1,
  hideHeader: r = !1,
  hideCloseButton: f = !1,
  hideOnOutsideClick: m = !1,
  orientation: x = "right",
  children: h,
  ...a
}) {
  const i = () => {
    l();
  }, { containerRef: j } = B(i);
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
    /* @__PURE__ */ t.jsx(
      p,
      {
        ref: m && e ? j : null,
        id: n,
        isOpen: e,
        width: s,
        fixed: c,
        orientation: x,
        "data-testid": a["data-testid"],
        "data-trackid": a["data-trackid"],
        children: /* @__PURE__ */ t.jsxs(u, { customContent: r, children: [
          !r && /* @__PURE__ */ t.jsxs(C, { children: [
            /* @__PURE__ */ t.jsx(S, { children: o }),
            !f && /* @__PURE__ */ t.jsx(k, { onClick: i })
          ] }),
          h
        ] })
      }
    ),
    d && e ? /* @__PURE__ */ t.jsx(W, {}) : g
  ] });
}
export {
  J as SideSheet
};
