import { forwardRef } from "react"; import { ElementWrapper, RenderBaseProps } from "../../../types"; import { useContextProps } from "@hooks/useContextProps"; import { useRenderProps } from "@hooks/useRenderProps"; import { TypographyProps } from "@styles/typography"; import { DimensionsProps, MarginProps } from "@styles/layout"; import { TextColorProps } from "@styles/colors"; import { HeadingContext } from "./Heading.context"; import { HeadingWrapper } from "./Heading.styles"; export interface HeadingProps extends RenderBaseProps {} export interface HeadingProps extends RenderBaseProps, ElementWrapper, TypographyProps, MarginProps, TextColorProps, DimensionsProps { as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; } export const Heading = forwardRef( function Heading(props, ref) { [props, ref] = useContextProps(HeadingContext, props, ref); const { className, style, children, ...rest } = props; const renderProps = useRenderProps({ componentClassName: "aje-heading", className, style, children, }); return ( {renderProps.children} ); } ); Heading.displayName = "Heading";