import { jsx as o } from "react/jsx-runtime";
import { useMemo as d } from "react";
import g from "../../hooks/useInputGroupAddonContext.js";
import { c as p } from "../../../../index-BtlgVD4m.js";
import h from "../../../jtl-dropdown/types/DropdownItem.js";
import w from "../../../jtl-dropdown/JTLDropdown.js";
import D from "../../../button/Button.js";
import x from "../input-group-button/InputGroupButton.js";
const v = ({ label: t, menuItems: r, disabled: n = !1, onClose: s, width: m }) => {
  const { side: e, inline: i } = g(), u = p(e === "left" && "[&_button]:border-r-0", e === "right" && "[&_button]:border-l-0"), c = p("flex items-center justify-center", "bg-transparent", "cursor-pointer"), a = i ? /* @__PURE__ */ o(D, { variant: "ghost", size: "xs", label: t, icon: "ChevronDown", iconPosition: "right", disabled: n }) : /* @__PURE__ */ o(x, { variant: "outline", label: t, icon: "ChevronDown", iconPosition: "right", disabled: n }), f = d(() => r.map((l) => ({ type: h.Default, ...l })), [r]);
  return /* @__PURE__ */ o("div", { className: i ? c : u, children: /* @__PURE__ */ o(w, { menuItems: f, onClose: s, width: m, children: a }) });
};
v.displayName = "InputGroupDropdown";
export {
  v as default
};
//# sourceMappingURL=InputGroupDropdown.js.map
