import { jsx } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import { l as linkStyles } from './Link.module-CZt9wvuD.js';
import { useTrackingId } from './useTrackingId.js';
import { c as cx } from './index-SvGbrGuT.js';
import { c as childrenToString } from './childrenToString-Bz9MqbHb.js';
import { u as useLayoutPropsUtil } from './useLayoutPropsUtil-loxbyklF.js';

import './LinkButton.css';const styles = {
	"link-button": "_link-button_rbbxj_1"
};

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(
      [linkStyles["link"]],
      styles["link-button"],
      className,
      {
        [linkStyles["ghost"]]: ghost,
        [linkStyles["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-D62f2os3.js.map
