import { jsx } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import { useTrackingId } from './useTrackingId.js';
import { c as cx } from './index-De1g9FRV.js';
import { s as styles } from './Link.module-JgOOqNcL.js';
import { c as childrenToString } from './childrenToString-Bz9MqbHb.js';
import { u as useLayoutPropsUtil } from './useLayoutPropsUtil-DjqeAJZ9.js';

const LinkButton = forwardRef(
  (props, ref) => {
    const data = {
      appearance: props.appearance,
      ghost: props.ghost,
      children: childrenToString(props.children)
    };
    const trackingId = useTrackingId({
      name: "Link",
      data,
      hasOverride: !!props["data-tracking-id"]
    });
    const { layoutStyles, componentProps } = useLayoutPropsUtil(props);
    const {
      children,
      className,
      appearance = "primary",
      ghost,
      style,
      ...rest
    } = componentProps;
    const linkClassNames = cx([styles["link"]], className, {
      [styles["ghost"]]: ghost,
      [styles["secondary"]]: appearance === "secondary"
    });
    const styleCombined = {
      ...style,
      ...layoutStyles
    };
    return /* @__PURE__ */ jsx(
      "button",
      {
        className: linkClassNames,
        "data-anv": "link-button",
        ref,
        style: styleCombined,
        "data-tracking-id": trackingId,
        ...rest,
        children
      }
    );
  }
);
LinkButton.displayName = "LinkButton";

export { LinkButton as L };
//# sourceMappingURL=LinkButton-C0wps8r1.js.map
