// src/components/Text/Text.tsx
import classNames from "classnames/dedupe";
import "@simplybusiness/mobius/src/components/Text/Text.css";
import { jsx } from "react/jsx-runtime";
var getElementType = (variant, elementType) => {
  if (elementType) {
    return elementType;
  }
  if (variant && ["h1", "h2", "h3", "h4"].includes(variant)) {
    return variant;
  }
  return "p";
};
var Text = ({ ref, elementType, ...props }) => {
  const { variant, className, spacing, ...otherProps } = props;
  const Element = getElementType(variant, elementType);
  const variantType = variant || Element;
  const classes = classNames(
    "mobius",
    "mobius-text",
    { [`--is-${variantType}`]: variantType },
    { [`--has-line-height-${spacing}`]: spacing },
    className
  );
  return /* @__PURE__ */ jsx(Element, { ref, ...otherProps, className: classes });
};
Text.displayName = "Text";

export {
  getElementType,
  Text
};
//# sourceMappingURL=chunk-A66R42LG.js.map
