UNPKG

@mskcc/carbon-react

Version:

Carbon react components for the MSKCC DSM

49 lines (48 loc) 1.7 kB
/** * MSKCC DSM 2021, 2023 */ import PropTypes from 'prop-types'; import { type ElementType } from 'react'; import type { PolymorphicProps } from '../../types/common'; type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6; type SectionBaseProps = { level?: HeadingLevel; }; type SectionProps<E extends ElementType> = PolymorphicProps<E, SectionBaseProps>; export declare function Section<E extends ElementType = 'section'>({ as: BaseComponent, level: levelOverride, ...rest }: SectionProps<E>): JSX.Element; export declare namespace Section { var propTypes: { /** * Provide an alternative tag or component to use instead of the default * <section> element */ as: PropTypes.Requireable<PropTypes.ReactComponentLike>; /** * Specify the content that will be placed in the component */ children: PropTypes.Requireable<PropTypes.ReactNodeLike>; /** * Specify a class name for the outermost node of the component */ className: PropTypes.Requireable<string>; /** * Overrides the level of the section */ level: PropTypes.Requireable<number>; }; } type HeadingProps = JSX.IntrinsicElements[`h${HeadingLevel}`]; export declare function Heading(props: HeadingProps): JSX.Element; export declare namespace Heading { var propTypes: { /** * Specify the content that will be placed in the component */ children: PropTypes.Requireable<PropTypes.ReactNodeLike>; /** * Specify a class name for the outermost node of the component */ className: PropTypes.Requireable<string>; }; } export {};