import { jsx } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import { c as cx } from './index-SvGbrGuT.js';
import { s as styles } from './Button.module-DwCq9XU0.js';
import { u as useLayoutPropsUtil } from './useLayoutPropsUtil-loxbyklF.js';
import { c as childrenToString } from './childrenToString-Bz9MqbHb.js';
import { useTrackingId } from './useTrackingId.js';

const ButtonCompound = forwardRef(
  (props, ref) => {
    const { layoutStyles, componentProps } = useLayoutPropsUtil(props);
    const {
      className,
      shape = "rounded",
      type,
      disabled,
      children,
      style,
      ...rest
    } = componentProps;
    const data = {
      children: childrenToString(props.children),
      shape,
      type
    };
    const trackingId = useTrackingId({
      name: "ButtonCompound",
      data,
      hasOverride: !!props["data-tracking-id"]
    });
    const buttonClassNames = cx(
      className,
      styles["button"],
      styles["button-compound"],
      {
        [styles["shape-pill"]]: shape === "pill",
        [styles["shape-circular"]]: shape === "circular",
        [styles["shape-rounded"]]: shape === "rounded"
      }
    );
    const styleCombined = {
      ...style,
      ...layoutStyles
    };
    return /* @__PURE__ */ jsx(
      "button",
      {
        "data-tracking-id": trackingId,
        className: buttonClassNames,
        type,
        disabled,
        "data-anv": "button-compound",
        ref,
        style: styleCombined,
        ...rest,
        children
      }
    );
  }
);
ButtonCompound.displayName = "ButtonCompound";

export { ButtonCompound as B };
//# sourceMappingURL=ButtonCompound-D9VTKcL4.js.map
