Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/content/Heading.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
6 changes: 2 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ declare module '@primer/components' {
extends BaseProps,
CommonProps,
TypographyProps,
Omit<React.HTMLAttributes<HTMLHeadingElement>, 'color'> {
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
}
Omit<React.HTMLAttributes<HTMLHeadingElement>, 'color'> { }

export const Heading: React.FunctionComponent<HeadingProps>

Expand Down Expand Up @@ -303,7 +301,7 @@ declare module '@primer/components' {
export interface SelectMenuModalProps extends CommonProps, Omit<React.HTMLAttributes<HTMLDivElement>, 'color'> {}

export interface SelectMenuListProps extends CommonProps, Omit<React.HTMLAttributes<HTMLDivElement>, 'color'> {}

export interface SelectMenuItemProps extends Omit<CommonProps, 'as'>,
Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'color'> {
selected?: boolean
Expand Down
1 change: 0 additions & 1 deletion src/Heading.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Heading.defaultProps = {
}

Heading.propTypes = {
as: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']),
theme: PropTypes.object,
...COMMON.propTypes,
...TYPOGRAPHY.propTypes
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/Heading.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('Heading', () => {
expect(Heading).toSetDefaultTheme()
})

it('respects the is prop', () => {
it('respects the as prop', () => {
expect(render(<Heading as="h6" />).type).toEqual('h6')
})

Expand Down