Skip to content

Commit ce96eaa

Browse files
Change heading prop back to old name
1 parent 3709578 commit ce96eaa

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Enables external control of the expansion.
138138
139139
Class(es) to apply to the 'heading' element.
140140
141-
#### ariaLevel : `number` [*optional*, default: `3`]
141+
#### aria-level : `number` [*optional*, default: `3`]
142142
143143
Will determine which 'heading' element is used in the markup. A value of `1`
144144
would make your element an `<h1>` tag, and likewise a value of `6` would make it
@@ -200,7 +200,7 @@ spec-compliant:
200200
- Only ever use
201201
[phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content)
202202
inside of your `AccordionItemHeading` component. If in doubt, use text only.
203-
- Remember to provide an `ariaLevel` prop to your `AccordionItemHeading`
203+
- Remember to provide an `aria-level` prop to your `AccordionItemHeading`
204204
component, when you are nesting accordions. The levels are used by assistive
205205
technologies (eg. screenreaders) to infer structure, by default each heading
206206
uses `h3` .

Diff for: src/components/AccordionItemHeading.spec.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('AccordionItem', () => {
5959
});
6060
});
6161

62-
describe('ariaLevel prop', () => {
62+
describe('aria-level prop', () => {
6363
it('is h3 by default', () => {
6464
const { getByTestId } = render(
6565
<Accordion>
@@ -80,7 +80,7 @@ describe('AccordionItem', () => {
8080
<AccordionItem>
8181
<AccordionItemHeading
8282
data-testid={UUIDS.FOO}
83-
ariaLevel={4}
83+
aria-level={4}
8484
>
8585
<AccordionItemButton />
8686
</AccordionItemHeading>

Diff for: src/components/AccordionItemHeading.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { assertValidHtmlId } from '../helpers/uuid';
55

66
interface AccordianItemHeadingProps extends HeadingAttributes {
77
className?: string;
8-
ariaLevel?: number;
8+
'aria-level'?: number;
99
}
1010

1111
export const SPEC_ERROR = `AccordionItemButton may contain only one child element, which must be an instance of AccordionItemButton.
@@ -19,7 +19,7 @@ From the WAI-ARIA spec (https://www.w3.org/TR/wai-aria-practices-1.1/#accordion)
1919
const Heading = React.forwardRef<HTMLHeadingElement, AccordianItemHeadingProps>(
2020
(
2121
{
22-
ariaLevel = 3,
22+
'aria-level': ariaLevel = 3,
2323
className = 'accordion__heading',
2424
...props
2525
}: AccordianItemHeadingProps,

0 commit comments

Comments
 (0)