Skip to content

Commit 72cb92c

Browse files
Document the props not having a default value
1 parent be7e164 commit 72cb92c

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed

packages/css/src/components/heading/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
# Heading
44

5-
Describes the content that follows it.
6-
Use Headings to allow the user to grasp the structure of the page quickly.
5+
Introduces a page section and describes the following content.
76

87
## Guidelines
98

10-
- A heading describes the content beneath it.
11-
- Every page should contain one Heading with level 1.
12-
- Do not skip heading levels, e.g. a level 2 Heading should be followed by one with level 3, not level 4.
13-
- Do not use a Heading for formatting and styling, but to represent the page’s structure.
14-
Users of screen readers use headings to navigate the page – an incorrect hierarchy can confuse them.
9+
- All headings together represent the document’s structure. Users of screen readers may use headings to navigate the page – an incorrect hierarchy will confuse them.
10+
- Every page should contain one heading with level 1.
11+
The level of subsequent headings should be appropriate: a subsection must use one level higher than the section it belongs to.
12+
The `level` prop doesn’t have a default value; the correct level should be determined for each instance.
13+
- Search engines give more weight to text in headers.
14+
- Don’t use a Heading only to produce its appearance.
1515

1616
## Relevant WCAG requirements
1717

packages/react/src/Accordion/Accordion.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import type { HeadingProps } from '../Heading/Heading'
1212
import { useKeyboardFocus } from '../common/useKeyboardFocus'
1313

1414
export type AccordionProps = {
15-
/** The hierarchical level of the Accordion Section heading(s) within the document. */
15+
/**
16+
* The hierarchical level of this Accordion’s Section Headings within the document.
17+
* There is no default value; determine the correct level for each instance.
18+
**/
1619
headingLevel: HeadingProps['level']
1720
/** The HTML element to use for each Accordion Section. */
1821
sectionAs?: 'div' | 'section'

packages/react/src/Alert/Alert.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ export type AlertProps = {
2020
/** The text for the Heading. */
2121
heading?: string
2222
/**
23-
* The hierarchical level of the Heading within the document.
24-
* Note: this intentionally does not change the font size.
25-
*/
23+
* The hierarchical level of the Alert’s Heading within the document.
24+
* There is no default value; determine the correct level for each instance.
25+
**/
2626
headingLevel: HeadingProps['level']
2727
/** A function to run when dismissing. */
2828
onClose?: () => void

packages/react/src/FormErrorList/FormErrorList.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ export type FormErrorListProps = {
3434
*/
3535
heading?: string
3636
/**
37-
* The hierarchical level of the Heading within the document.
38-
* Note: this intentionally does not change the font size.
39-
* @default 2
40-
*/
37+
* The hierarchical level of the Form Error List’s Heading within the document.
38+
* There is no default value; determine the correct level for each instance.
39+
**/
4140
headingLevel: HeadingProps['level']
4241
} & HTMLAttributes<HTMLDivElement>
4342

storybook/src/components/Heading/Heading.stories.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,6 @@ export const Sizes: Story = {
6868
export const InverseColour: Story = {
6969
args: {
7070
inverseColor: true,
71+
level: 2,
7172
},
7273
}

0 commit comments

Comments
 (0)