Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): add aria-label to reference publish icons #4899

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,30 @@ const VALIDATION_COLORS: Record<'error' | 'warning' | 'info', string> = {
}

const VALIDATION_ICONS: Record<'error' | 'warning' | 'info', React.ReactElement> = {
error: <ErrorOutlineIcon data-testid="input-validation-icon-error" />,
warning: <WarningOutlineIcon data-testid="input-validation-icon-warning" />,
info: <InfoOutlineIcon data-testid="input-validation-icon-info" />,
error: (
<ErrorOutlineIcon
data-testid="input-validation-icon-error"
aria-label="Has error"
aria-hidden
role="presentation"
/>
),
warning: (
<WarningOutlineIcon
data-testid="input-validation-icon-warning"
aria-label="Has warning"
aria-hidden
role="presentation"
/>
),
info: (
<InfoOutlineIcon
data-testid="input-validation-icon-info"
aria-label="Has information"
aria-hidden
role="presentation"
/>
),
}

const StyledStack = styled(Stack)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function ReferencePreview(props: {
dimmed={!preview.published}
muted={!preview.published}
>
<PublishIcon />
<PublishIcon aria-label={preview.published ? 'Published' : 'Not published'} />
</TextWithTone>
</Tooltip>
</Box>
Expand Down Expand Up @@ -121,7 +121,7 @@ export function ReferencePreview(props: {
dimmed={!preview.draft}
muted={!preview.draft}
>
<EditIcon />
<EditIcon aria-label={preview.draft ? 'Edited' : 'No unpublished edits'} />
</TextWithTone>
</Tooltip>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function PresenceMenu(props: PresenceMenuProps) {
return (
<Button mode="bleed" padding={1}>
<AvatarStackCard>
<AvatarStack maxLength={MAX_AVATARS}>
<AvatarStack maxLength={MAX_AVATARS} aria-label="Who is here">
{presence.map((item) => (
<UserAvatar key={item.user.id} user={item.user} />
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function NotPublishedStatus() {
return (
<Tooltip content={<>Not published</>}>
<Text muted>
<UnpublishIcon />
<UnpublishIcon aria-label="Not published" />
</Text>
</Tooltip>
)
Expand Down