"use client";
import { j as t } from "../../../../node_modules/.pnpm/react@19.1.0/node_modules/react/jsx-runtime.mjs";
import { forwardRef as p } from "react";
import { Menu as i } from "@mantine/core";
import { useId as u } from "@mantine/hooks";
import f from "../../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.mjs";
import { ReactComponent as x } from "../../../assets/images/DownArrow.svg.mjs";
import j from "../../Button/index.mjs";
import n from "./GenericDropdown.module.scss.mjs";
const l = p(
  ({ className: o, divProps: s, ...e }, r) => /* @__PURE__ */ t.jsx(
    j,
    {
      htmlType: "button",
      type: "tertiary-neutral",
      rightIcon: /* @__PURE__ */ t.jsx(x, { fill: "var(--color-neutral-400)" }),
      className: `${n.genericButton} ${o}`,
      ...e,
      ref: r,
      children: /* @__PURE__ */ t.jsx("div", { className: "title-sm", style: { width: "100%" }, ...s, children: e.text })
    }
  )
);
l.displayName = "GenericButton";
const h = function({
  target: o,
  children: s,
  menuItemsGap: e,
  classNames: r = {},
  containerProps: m,
  targetProps: c,
  ...d
}) {
  const a = u();
  return (
    // we wrap in a div to make a single node
    /* @__PURE__ */ t.jsxs("div", { ...m, children: [
      /* @__PURE__ */ t.jsxs(
        i,
        {
          position: "bottom-start",
          width: "target",
          offset: 0,
          unstyled: !0,
          portalProps: {
            target: `#${a}`
          },
          classNames: {
            ...r,
            itemLabel: f(
              n.label,
              // ts doesn't detect classNames props intelisense
              r.itemLabel
            )
          },
          ...d,
          children: [
            /* @__PURE__ */ t.jsx(i.Target, { ...c, children: o }),
            /* @__PURE__ */ t.jsx(
              i.Dropdown,
              {
                className: n.menuDropdown,
                style: { margin: "0px" },
                children: /* @__PURE__ */ t.jsx("div", { style: { gap: e || "var(--space-md)" }, children: s })
              }
            )
          ]
        }
      ),
      /* @__PURE__ */ t.jsx("div", { id: a })
    ] })
  );
};
h.GenericButton = l;
export {
  h as default
};
//# sourceMappingURL=index.mjs.map
