import { jsxs as r, jsx as t } from "react/jsx-runtime";
import { cn as c } from "../../utils/cn.js";
import { Icon as d } from "../icon/icon.js";
const x = ({
  id: e,
  title: i,
  description: a,
  open: o,
  icon: n,
  topOffset: s = "-top-18"
}) => (
  // biome-ignore lint/a11y/useAriaPropsSupportedByRole: TODO
  /* @__PURE__ */ r(
    "summary",
    {
      "aria-controls": `${e}-accordion-children`,
      "aria-expanded": o,
      className: "not-prose relative flex w-full cursor-pointer list-none flex-row content-center items-center space-x-2 rounded-t-xl px-5 py-4 hover:bg-stone-100 hover:dark:bg-stone-800 [&::-webkit-details-marker]:hidden",
      "data-component-part": "accordion-button",
      id: `${e}-label`,
      children: [
        /* @__PURE__ */ t("div", { className: c("absolute", s), id: e }),
        /* @__PURE__ */ t("div", { className: "mr-2", "data-component-part": "accordion-caret-right", children: /* @__PURE__ */ t(
          d,
          {
            className: c(
              "bg-stone-700 transition dark:bg-stone-400",
              o && "-mt-1 rotate-90 duration-200",
              !o && "duration-75"
            ),
            icon: "caret-right",
            iconType: "solid",
            size: 12
          }
        ) }),
        !!n && /* @__PURE__ */ t(
          "div",
          {
            className: "flex size-4 items-center justify-center fill-stone-800 text-stone-800 dark:fill-stone-100 dark:text-stone-100",
            "data-component-part": "accordion-icon",
            children: n
          }
        ),
        /* @__PURE__ */ r(
          "div",
          {
            className: "w-full text-left leading-tight",
            contentEditable: !1,
            "data-component-part": "accordion-title-container",
            children: [
              /* @__PURE__ */ t(
                "p",
                {
                  className: "m-0 font-medium text-stone-900 dark:text-stone-200",
                  "data-component-part": "accordion-title",
                  children: i
                }
              ),
              !!a && /* @__PURE__ */ t(
                "p",
                {
                  className: "m-0 text-stone-900 dark:text-stone-200",
                  "data-component-part": "accordion-description",
                  children: a
                }
              )
            ]
          }
        )
      ]
    }
  )
);
export {
  x as AccordionCover
};
