var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React, { forwardRef } from "react";
import { cl } from "../utils/helpers/index.js";
import { typoClassNames } from "./util.js";
/**
 * Part of a set of components for displaying text with consistent typography.
 *
 * @see [📝 Documentation](https://aksel.nav.no/komponenter/core/typography)
 * @see 🏷️ {@link HeadingProps}
 * @see [🤖 OverridableComponent](https://aksel.nav.no/grunnleggende/kode/overridablecomponent) support
 *
 * @example
 * ```jsx
 * <Heading level="1" size="xlarge">
 *   Hva kan vi hjelpe deg med?
 * </Heading>
 * ```
 */
export const Heading = forwardRef((_a, ref) => {
    var { level = "1", size, className, as, spacing, align, visuallyHidden, textColor } = _a, rest = __rest(_a, ["level", "size", "className", "as", "spacing", "align", "visuallyHidden", "textColor"]);
    const HeadingTag = as !== null && as !== void 0 ? as : `h${level}`;
    return (React.createElement(HeadingTag, Object.assign({}, rest, { ref: ref, className: cl(className, "aksel-heading", `aksel-heading--${size}`, typoClassNames({
            spacing,
            align,
            visuallyHidden,
            textColor,
        })) })));
});
export default Heading;
//# sourceMappingURL=Heading.js.map