Skip to content

Commit

Permalink
refactor: change aria-label to use hyphen after code review
Browse files Browse the repository at this point in the history
Co-authored-by: Diana Nanyanzi <[email protected]>
  • Loading branch information
kabaros and d-rita committed Mar 18, 2024
1 parent a127b43 commit d523821
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Circular Loader', () => {
const wrapper = mount(
<CircularLoader
dataTest={'circular-loader-test'}
ariaLabel="Circular Loader"
aria-label="Circular Loader"
/>
)
const actual = wrapper.find({ 'data-test': 'circular-loader-test' })
Expand Down
4 changes: 2 additions & 2 deletions components/loader/src/circular-loader/circular-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const CircularLoader = ({
invert,
className,
dataTest,
ariaLabel,
'aria-label': ariaLabel,
}) => (
<div
role="progressbar"
Expand Down Expand Up @@ -69,7 +69,7 @@ CircularLoader.defaultProps = {
}

CircularLoader.propTypes = {
ariaLabel: PropTypes.string,
'aria-label': PropTypes.string,
className: PropTypes.string,
dataTest: PropTypes.string,
extrasmall: sharedPropTypes.sizePropType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ export default {
const Template = (args) => <CircularLoader {...args} />

export const Default = Template.bind({})
Default.args = { ariaLabel: 'Default Loader' }
Default.args = { 'aria-label': 'Default Loader' }

export const Small = Template.bind({})
Small.args = { small: true, ariaLabel: 'Small Loader' }
Small.args = { small: true, 'aria-label': 'Small Loader' }

export const Large = Template.bind({})
Large.args = { large: true, ariaLabel: 'Large Loader' }
Large.args = { large: true, 'aria-label': 'Large Loader' }

export const ExtraSmall = Template.bind({})
ExtraSmall.args = { extrasmall: true, ariaLabel: 'ExtraSmall Loader' }
ExtraSmall.args = { extrasmall: true, 'aria-label': 'ExtraSmall Loader' }
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Linear Loader', () => {
const wrapper = mount(
<LinearLoader
dataTest={'linear-loader-test'}
ariaLabel="Linear Loader"
aria-label="Linear Loader"
amount={15}
/>
)
Expand Down
4 changes: 2 additions & 2 deletions components/loader/src/linear-loader/linear-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const LinearLoader = ({
invert,
className,
dataTest,
ariaLabel,
'aria-label': ariaLabel,
}) => {
return (
<div
Expand Down Expand Up @@ -81,7 +81,7 @@ LinearLoader.defaultProps = {
LinearLoader.propTypes = {
/** The progression in percent without the '%' sign */
amount: PropTypes.number.isRequired,
ariaLabel: PropTypes.string,
'aria-label': PropTypes.string,
className: PropTypes.string,
dataTest: PropTypes.string,
/** Use inverted color scheme */
Expand Down
6 changes: 3 additions & 3 deletions components/loader/src/linear-loader/linear-loader.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
export const Determinate = (args) => <LinearLoader {...args} />
Determinate.args = {
amount: 60,
ariaLabel: 'Determinate Loader',
'aria-label': 'Determinate Loader',
}

export const OverlayPage = (args) => (
Expand All @@ -42,7 +42,7 @@ export const OverlayPage = (args) => (
</Center>
</Layer>
)
OverlayPage.args = { amount: 30, ariaLabel: 'Loader with Overlay Page' }
OverlayPage.args = { amount: 30, 'aria-label': 'Loader with Overlay Page' }
OverlayPage.parameters = { docs: { inlineStories: false } }

export const OverlayComponent = (args) => (
Expand All @@ -54,7 +54,7 @@ export const OverlayComponent = (args) => (
</Cover>
</div>
)
OverlayComponent.args = { amount: 80, ariaLabel: 'Loader with Overlay Component', }
OverlayComponent.args = { amount: 80, 'aria-label': 'Loader with Overlay Component', }

export const RTL = (args) => (
<div dir="rtl">
Expand Down
4 changes: 2 additions & 2 deletions components/loader/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface CircularLoaderProps {
invert?: boolean
large?: boolean
small?: boolean
ariaLabel?: string
'aria-label'?: string
}

export const CircularLoader: React.FC<CircularLoaderProps>
Expand All @@ -31,7 +31,7 @@ export interface LinearLoaderProps {
* The width of the entire indicator
*/
width?: string
ariaLabel?: string
'aria-label'?: string
}

export const LinearLoader: React.FC<LinearLoaderProps>

0 comments on commit d523821

Please sign in to comment.