Skip to content

Commit 69dca48

Browse files
add aria-label type
1 parent 430c40d commit 69dca48

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/UnderlineNav2/UnderlineNav.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const ResponsiveUnderlineNav = ({
5454
{navigation: 'Security', icon: ShieldLockIcon}
5555
]
5656
return (
57-
<UnderlineNav ariaLabel="Repository" loadingCounters={loadingCounters}>
57+
<UnderlineNav aria-label="Repository" loadingCounters={loadingCounters}>
5858
{items.map(item => (
5959
<UnderlineNav.Item
6060
key={item.navigation}
@@ -91,7 +91,7 @@ describe('UnderlineNav', () => {
9191
it('fires onSelect on click and keypress', async () => {
9292
const onSelect = jest.fn()
9393
const {getByText} = render(
94-
<UnderlineNav ariaLabel="Test Navigation">
94+
<UnderlineNav aria-label="Test Navigation">
9595
<UnderlineNav.Item onSelect={onSelect}>Item 1</UnderlineNav.Item>
9696
<UnderlineNav.Item onSelect={onSelect}>Item 2</UnderlineNav.Item>
9797
<UnderlineNav.Item onSelect={onSelect}>Item 3</UnderlineNav.Item>

src/UnderlineNav2/UnderlineNav.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import styled from 'styled-components'
2626
import {LoadingCounter} from './LoadingCounter'
2727

2828
export type UnderlineNavProps = {
29-
ariaLabel?: string
29+
'aria-label'?: React.AriaAttributes['aria-label']
3030
as?: React.ElementType
3131
align?: 'right'
3232
sx?: SxProp
@@ -157,7 +157,7 @@ export const UnderlineNav = forwardRef(
157157
{
158158
as = 'nav',
159159
align,
160-
ariaLabel = 'Navigation',
160+
'aria-label': ariaLabel = 'Navigation',
161161
sx: sxProp = {},
162162
afterSelect,
163163
variant = 'default',

src/UnderlineNav2/examples.stories.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default {
3333

3434
export const DefaultNav = () => {
3535
return (
36-
<UnderlineNav ariaLabel="Repository">
36+
<UnderlineNav aria-label="Repository">
3737
<UnderlineNav.Item selected>Code</UnderlineNav.Item>
3838
<UnderlineNav.Item>Issues</UnderlineNav.Item>
3939
<UnderlineNav.Item>Pull Requests</UnderlineNav.Item>
@@ -43,7 +43,7 @@ export const DefaultNav = () => {
4343

4444
export const withIcons = () => {
4545
return (
46-
<UnderlineNav ariaLabel="Repository with icons">
46+
<UnderlineNav aria-label="Repository with icons">
4747
<UnderlineNav.Item icon={CodeIcon}>Code</UnderlineNav.Item>
4848
<UnderlineNav.Item icon={EyeIcon} counter={6}>
4949
Issues
@@ -61,7 +61,7 @@ export const withIcons = () => {
6161

6262
export const withCounterLabels = () => {
6363
return (
64-
<UnderlineNav ariaLabel="Repository with counters">
64+
<UnderlineNav aria-label="Repository with counters">
6565
<UnderlineNav.Item selected icon={CodeIcon}>
6666
Code
6767
</UnderlineNav.Item>
@@ -88,7 +88,7 @@ export const InternalResponsiveNav = () => {
8888
const [selectedIndex, setSelectedIndex] = React.useState<number | null>(1)
8989

9090
return (
91-
<UnderlineNav ariaLabel="Repository">
91+
<UnderlineNav aria-label="Repository">
9292
{items.map((item, index) => (
9393
<UnderlineNav.Item
9494
key={item.navigation}
@@ -108,7 +108,7 @@ export const CountersLoadingState = () => {
108108
const [selectedIndex, setSelectedIndex] = React.useState<number | null>(1)
109109

110110
return (
111-
<UnderlineNav ariaLabel="Repository with loading counters" loadingCounters={true}>
111+
<UnderlineNav aria-label="Repository with loading counters" loadingCounters={true}>
112112
{items.map((item, index) => (
113113
<UnderlineNav.Item
114114
key={item.navigation}

0 commit comments

Comments
 (0)