import { jsx } from 'react/jsx-runtime';
import { c as cx } from './index-SvGbrGuT.js';
import { forwardRef } from 'react';
import { u as useLayoutPropsUtil } from './useLayoutPropsUtil-loxbyklF.js';

import './Text.css';const headline = "_headline_1rnzh_2";
const eyebrow = "_eyebrow_1rnzh_15";
const bodytext = "_bodytext_1rnzh_28";
const xlarge = "_xlarge_1rnzh_82";
const large = "_large_1rnzh_86";
const medium = "_medium_1rnzh_90";
const small = "_small_1rnzh_93";
const subdued = "_subdued_1rnzh_120";
const inline = "_inline_1rnzh_123";
const styles = {
	headline: headline,
	eyebrow: eyebrow,
	bodytext: bodytext,
	xlarge: xlarge,
	large: large,
	medium: medium,
	small: small,
	subdued: subdued,
	inline: inline
};

const Text = forwardRef((props, ref) => {
  const { layoutStyles, componentProps } = useLayoutPropsUtil(props);
  if (props.variant === "headline") {
    const {
      variant: _,
      children,
      className,
      el: HeadlineElement,
      size = "medium",
      style,
      ...rest
    } = componentProps;
    const TextClasses = cx(styles["headline"], className, {
      [styles[`${size}`]]: size
    });
    const styleCombined = { ...style, ...layoutStyles };
    return (
      // @ts-expect-error ts(2604) HeadlineElement will work as element tag
      /* @__PURE__ */ jsx(
        HeadlineElement,
        {
          ref,
          className: TextClasses,
          "data-anv": "text",
          style: styleCombined,
          ...rest,
          children
        }
      )
    );
  } else if (props.variant === "eyebrow") {
    const {
      variant: _,
      children,
      className,
      size = "medium",
      style,
      ...rest
    } = componentProps;
    const TextClasses = cx(styles["eyebrow"], className, {
      [styles[`${size}`]]: size
    });
    const styleCombined = { ...style, ...layoutStyles };
    return /* @__PURE__ */ jsx(
      "span",
      {
        ref,
        className: TextClasses,
        "data-anv": "text",
        style: styleCombined,
        ...rest,
        children
      }
    );
  } else {
    const {
      variant: _,
      children,
      className,
      subdued,
      inline,
      style,
      size = "medium",
      ...rest
    } = componentProps;
    const TextClasses = cx(styles["bodytext"], className, {
      [styles[`${size}`]]: size,
      [styles["subdued"]]: subdued,
      [styles["inline"]]: inline
    });
    const styleCombined = { ...style, ...layoutStyles };
    if (inline) {
      return /* @__PURE__ */ jsx(
        "span",
        {
          ref,
          className: TextClasses,
          "data-anv": "text",
          style: styleCombined,
          ...rest,
          children
        }
      );
    } else {
      return /* @__PURE__ */ jsx(
        "p",
        {
          ref,
          className: TextClasses,
          "data-anv": "text",
          style: styleCombined,
          ...rest,
          children
        }
      );
    }
  }
});
Text.displayName = "Text";

export { Text as T };
//# sourceMappingURL=Text-DhheKsns.js.map
