diff --git a/docs/content/Heading.md b/docs/content/Heading.md index 3e71f224abf..c1efd4a7e84 100644 --- a/docs/content/Heading.md +++ b/docs/content/Heading.md @@ -19,4 +19,4 @@ Heading components get `TYPOGRAPHY` and `COMMON` system props. Read our [System | Prop name | Type | Description | | :-------- | :------ | :----------------------------------------------- | -| as | String | sets the HTML tag for the component | +| as | String or React element | sets the HTML tag for the component | diff --git a/index.d.ts b/index.d.ts index 61fbd30d03d..309e1b315b7 100644 --- a/index.d.ts +++ b/index.d.ts @@ -72,9 +72,7 @@ declare module '@primer/components' { extends BaseProps, CommonProps, TypographyProps, - Omit, 'color'> { - as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' - } + Omit, 'color'> { } export const Heading: React.FunctionComponent @@ -303,7 +301,7 @@ declare module '@primer/components' { export interface SelectMenuModalProps extends CommonProps, Omit, 'color'> {} export interface SelectMenuListProps extends CommonProps, Omit, 'color'> {} - + export interface SelectMenuItemProps extends Omit, Omit, 'color'> { selected?: boolean diff --git a/src/Heading.js b/src/Heading.js index 424d3327572..aaf63fa0856 100644 --- a/src/Heading.js +++ b/src/Heading.js @@ -15,7 +15,6 @@ Heading.defaultProps = { } Heading.propTypes = { - as: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']), theme: PropTypes.object, ...COMMON.propTypes, ...TYPOGRAPHY.propTypes diff --git a/src/__tests__/Heading.js b/src/__tests__/Heading.js index 2540da192c0..60ca1de6e64 100644 --- a/src/__tests__/Heading.js +++ b/src/__tests__/Heading.js @@ -46,7 +46,7 @@ describe('Heading', () => { expect(Heading).toSetDefaultTheme() }) - it('respects the is prop', () => { + it('respects the as prop', () => { expect(render().type).toEqual('h6') })