"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require('../../styles/components/heading.css');const jsxRuntime = require("react/jsx-runtime");
const classNames = require("classnames");
const utils = require("../utils/utils.cjs");
;/* empty css               */
const Heading = ({
  children,
  as,
  size,
  variant,
  spacing,
  className,
  ...rest
}) => {
  const HeadingElement = as || "h1";
  const usedVariant = variant ?? utils.getHeadingVariantFromSemanticType(HeadingElement);
  const shouldUseSize = size !== void 0;
  return /* @__PURE__ */ jsxRuntime.jsx(
    HeadingElement,
    {
      className: classNames(
        "eds-heading",
        // Only apply variant if size is not specified
        { [`eds-heading--${usedVariant}`]: !shouldUseSize },
        // Size takes precedence when specified
        { [`eds-heading--${size}`]: shouldUseSize && size },
        utils.getSpacingClasses(spacing, "eds-heading"),
        className
      ),
      ...rest,
      children
    }
  );
};
exports.Heading = Heading;
//# sourceMappingURL=Heading.cjs.map
