import { jsx as l } from "@emotion/react/jsx-runtime";
import { useMemo as b } from "react";
import { ActionsGroupRootStyled as f } from "./slots/ActionsGroupSlots.js";
import { ACTIONS_GROUP_CLASSES as u } from "./constants.js";
import S from "clsx";
import { ActionIconButton as v } from "./subcomponents/ActionIconButton/ActionIconButton.js";
const C = (s) => {
  const { actions: n, variant: a = "horizontal", disabled: o = !1, className: m, value: d, size: e, onChange: c, ariaLabel: i, ariaLabelledBy: p } = s, t = b(() => ({
    disabled: o,
    variant: a,
    size: e
  }), [o, e, a]);
  return /* @__PURE__ */ l(
    f,
    {
      className: S(m, u.root),
      ownerState: t,
      role: "toolbar",
      "aria-orientation": a === "vertical" ? "vertical" : "horizontal",
      "aria-disabled": o || void 0,
      "aria-label": i,
      "aria-labelledby": i ? void 0 : p,
      children: n.map((r) => /* @__PURE__ */ l(
        v,
        {
          action: r,
          selected: r.id === d,
          ownerState: t,
          onChange: c,
          groupDisabled: o
        },
        String(r.id ?? r.label)
      ))
    }
  );
};
export {
  C as ActionsGroup
};
