import React, { HTMLAttributes } from 'react'; import { Colors } from '../../../constants/colors'; import { AppTheme } from '../../styles/Theme'; export declare type HeadingTags = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span'; export interface OptionalHeadingProps extends HTMLAttributes { /** * Override the default size assigned to the rendered HTML tag. * @default `as` */ size?: keyof AppTheme['typography']['heading']['sizes']; /** * Accepts a subset of the Zopa brand colors by default. Same as the ones accepted by ``. * @default `colors.greyDarkest` */ color?: Colors['white'] | Colors['grey'] | Colors['greyDarkest'] | string; /** * Where the rendered text should be aligned to. * @default 'inherit' */ align?: 'inherit' | 'left' | 'right' | 'center'; } interface HeadingPropsWithAs extends OptionalHeadingProps { children?: React.ReactNode; /** * The HTML5 tag you want to render your heading, it's used to determine the size of the heading as well. * @default 'required if 'forwardedAs' is not provided.' */ as: HeadingTags; } interface HeadingPropsWithForwardedAs extends OptionalHeadingProps { /** * The HTML5 tag you want to render your heading, it's used to determine the size of the heading as well. * To be used if Component has been wrapped in styled components. * @default 'required if 'as' is not provided.' */ forwardedAs: HeadingTags; } export declare type HeadingProps = HeadingPropsWithAs | HeadingPropsWithForwardedAs; export declare const Heading: (props: HeadingProps) => JSX.Element; export default Heading;