Skip to content

Commit

Permalink
fix(redmine 1306613): fixed form elements accessibility errors
Browse files Browse the repository at this point in the history
  • Loading branch information
subraAntoine committed Aug 1, 2024
1 parent 4bed473 commit 4505b32
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/spotty-dryers-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@smile/haring-react': minor
---

Fixed form elements accessibility error
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { action } from '@storybook/addon-actions';

export const actionRowOverflowActionsMock: IThumbnailAction[] = [
{
ariaLabel: 'move in tree',

Check failure on line 10 in packages/haring-react/src/Components/ActionList/ActionList.mock.tsx

View workflow job for this annotation

GitHub Actions / test

Type '{ ariaLabel: string; icon: JSX.Element; id: string; isItemAction: false; isMassAction: true; label: string; onAction: HandlerFunction; }' is not assignable to type 'IThumbnailAction'.
icon: <FolderMove size={16} />,
id: 'move',
isItemAction: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const documentsMock: IDocument[] = [
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
</p>
<Button color="gray.8">
<DownloadSimple width={12} />
<DownloadSimple aria-label="download icon" width={12} />
<Space w={8} />
PDF, FR - 1Mo
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export function SelectableList(props: ISelectableListProps): ReactElement {
wrap="nowrap"
>
<Checkbox
aria-label="checkbox input"
checked={selectedIndexes.includes(index)}
className="selectableListCheckboxRef"
onChange={(e) => onSelectChange?.(index, e.currentTarget.checked)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,25 @@ export function getMenu(checked: boolean): IMenuItem<number>[] {
content: (
<>
<Group>
<Checkbox defaultChecked={checked} value="Dupont" /> Dupont
<Checkbox
aria-label="Dupont checkbox"
defaultChecked={checked}
value="Dupont"
/>{' '}
Dupont
</Group>
<br />
<Group>
<Checkbox defaultChecked={checked} value="Martin" /> Martin
<Checkbox
aria-label="Martin checkbox"
defaultChecked={checked}
value="Martin"
/>{' '}
Martin
</Group>
<br />
<Group>
<Checkbox value="André" /> Andrée
<Checkbox aria-label="André checkbox" value="André" /> Andrée
</Group>
</>
),
Expand All @@ -58,11 +68,16 @@ export function getMenu(checked: boolean): IMenuItem<number>[] {
content: (
<>
<Group>
<Checkbox defaultChecked={checked} value="CDI" /> CDI
<Checkbox
aria-label="CDI checkbox"
defaultChecked={checked}
value="CDI"
/>{' '}
CDI
</Group>
<br />
<Group>
<Checkbox value="CDD" /> CDD
<Checkbox aria-label="CDD checkbox" value="CDD" /> CDD
</Group>
</>
),
Expand All @@ -72,7 +87,12 @@ export function getMenu(checked: boolean): IMenuItem<number>[] {
{
content: (
<Group>
<Checkbox defaultChecked={checked} value="FREELANCE" /> Freelance
<Checkbox
aria-label="Freelance checkbox"
defaultChecked={checked}
value="FREELANCE"
/>{' '}
Freelance
</Group>
),
id: 11,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ export const viewMockC = (
export const viewsMock = [
{
dataView: viewMockA,
label: <ListBullets />,
label: <ListBullets aria-label="square icon" />,
value: 'a',
},
{
dataView: viewMockB,
label: <SquaresFour />,
label: <SquaresFour aria-label="square icon" />,
value: 'b',
},
{
dataView: viewMockC,
label: <Star />,
label: <Star aria-label="star icon" />,
value: 'c',
},
];

0 comments on commit 4505b32

Please sign in to comment.