import { jsxs as l, jsx as r } from "react/jsx-runtime";
import { forwardRef as h, Children as p } from "react";
import { cx as f } from "../../utils/classNames.js";
import { useArrowTheme as g } from "../../hooks/useArrowTheme.js";
import { ButtonStyledAsLink as v } from "../button-styled-as-link/ButtonStyledAsLink.js";
import { ButtonGroup as _ } from "../button-group/ButtonGroup.js";
const b = h(
  ({
    children: o,
    supplementaryAction: t,
    supplementaryContent: e,
    inlineStyles: d,
    hasDivider: s = !1,
    inverse: i,
    className: m
  }, u) => {
    const c = g(), n = i ?? c.inverse, a = p.toArray(o);
    return a.length === 0 ? null : /* @__PURE__ */ l(
      "div",
      {
        ref: u,
        className: f("tdds-button-tray", m),
        role: "group",
        style: d,
        "data-has-divider": s || void 0,
        "data-has-supplementary": t || e ? "true" : void 0,
        ...n ? { "data-inverse": "true" } : {},
        children: [
          t ? /* @__PURE__ */ r("div", { className: "tdds-button-tray__supplementary-wrapper", children: /* @__PURE__ */ r("div", { className: "tdds-button-tray__supplementary-action-inner", children: /* @__PURE__ */ l("p", { className: "tdds-button-tray__supplementary-text", children: [
            t.leadingText ? t.leadingText + " " : null,
            t.linkUrl ? /* @__PURE__ */ r(
              "a",
              {
                className: "tdds-button-tray__supplementary-action",
                href: t.linkUrl,
                "data-monochrome": "true",
                children: t.linkLabel
              }
            ) : /* @__PURE__ */ r(
              v,
              {
                label: t.linkLabel,
                inline: !0,
                monochrome: !0
              }
            )
          ] }) }) }) : null,
          e ? /* @__PURE__ */ r("div", { className: "tdds-button-tray__supplementary-wrapper", children: /* @__PURE__ */ r("div", { className: "tdds-button-tray__supplementary-content", children: e }) }) : null,
          /* @__PURE__ */ r(
            _,
            {
              inverse: n,
              arrangement: "column",
              buttonSpan: "fill",
              smallButtonSpan: "fill",
              mediumButtonSpan: "hug",
              largeButtonSpan: "hug",
              smallButtonArrangement: "column",
              mediumButtonArrangement: "row",
              largeButtonArrangement: "row",
              children: a
            }
          )
        ]
      }
    );
  }
);
b.displayName = "ButtonTray";
export {
  b as ButtonTray
};
//# sourceMappingURL=ButtonTray.js.map
