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

feat(Header, Cards, Hero, CoverHero): improve a11y #1292

Merged
merged 13 commits into from
Nov 26, 2024

Conversation

marcoskolodny
Copy link
Contributor

@marcoskolodny marcoskolodny commented Nov 11, 2024

Issues:

Copy link

github-actions bot commented Nov 11, 2024

Size stats

master this branch diff
Total JS 12.2 MB 12.2 MB +13.2 kB
JS without icons 2.01 MB 2.02 MB +13.2 kB
Lib overhead 69 kB 69 kB 0 B
Lib overhead (gzip) 16.9 kB 16.9 kB 0 B

Copy link

github-actions bot commented Nov 11, 2024

Accessibility report
✔️ No issues found

ℹ️ You can run this locally by executing yarn audit-accessibility.

Copy link

github-actions bot commented Nov 11, 2024

Deploy preview for mistica-web ready!

✅ Preview
https://mistica-d5eekf8xh-flows-projects-65bb050e.vercel.app

Built with commit 369bf37.
This pull request is being automatically deployed with vercel-action

Copy link

github-actions bot commented Nov 11, 2024

Screenshot tests report

✔️ All passing

@marcoskolodny marcoskolodny marked this pull request as ready for review November 13, 2024 14:20
src/utils/types.tsx Outdated Show resolved Hide resolved
src/utils/types.tsx Outdated Show resolved Hide resolved
@marcoskolodny marcoskolodny requested a review from atabel November 14, 2024 11:27
@marcoskolodny marcoskolodny changed the title feat(Header, Cards, Hero, CoverHero): improve headings a11y feat(Header, Cards, Hero, CoverHero): improve a11y Nov 22, 2024
>
{pretitle}
</Text2>
/** using flex instead of nested Stacks, this way we can rearrange texts so the DOM structure makes more sense for screen reader users */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AdvancedDataCard was missing the logic for the custom order of elements that other cards have

@@ -578,7 +638,7 @@ export const MediaCard = React.forwardRef<HTMLDivElement, MediaCardProps>(
aria-label={isTouchable ? ariaLabel : undefined}
>
{isTouchable && <div className={styles.touchableMediaCardOverlay} />}
<div className={styles.mediaCard}>
<div className={styles.mediaCard} aria-hidden={isTouchable}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All cards except PosterCard were missing this, and it's important in order to avoid Safari from reading all the texts inside a link as separate links (same thing we did in rows)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

@marcoskolodny marcoskolodny requested a review from atabel November 22, 2024 14:31
@@ -578,7 +638,7 @@ export const MediaCard = React.forwardRef<HTMLDivElement, MediaCardProps>(
aria-label={isTouchable ? ariaLabel : undefined}
>
{isTouchable && <div className={styles.touchableMediaCardOverlay} />}
<div className={styles.mediaCard}>
<div className={styles.mediaCard} aria-hidden={isTouchable}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

@aweell

This comment was marked as resolved.

@marcoskolodny
Copy link
Contributor Author

When the pretitleAs is modified in the header component (although some cases would be not correct) is happening that when the pretitle is h2 and title is h1, the spacing between elements seems to change?

Good catch @aweell ! It should be fixed now :)

@marcoskolodny marcoskolodny removed the request for review from yceballost November 25, 2024 17:44
Copy link
Contributor

@aweell aweell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job!

@marcoskolodny marcoskolodny added this pull request to the merge queue Nov 26, 2024
Merged via the queue into master with commit cdcf2fc Nov 26, 2024
11 checks passed
@marcoskolodny marcoskolodny deleted the WEB-2087-headings-a11y-in-components branch November 26, 2024 10:04
tuentisre pushed a commit that referenced this pull request Nov 26, 2024
# [16.6.0](v16.5.0...v16.6.0) (2024-11-26)

### Features

* **data-testid:** support for Callout, HighlightedCard, Hero, EmptyState and Headers ([#1296](#1296)) ([15b798c](15b798c))
* **Header, Cards, Hero, CoverHero:** improve a11y ([#1292](#1292)) ([cdcf2fc](cdcf2fc))
* **InfoSheet:** update styles and allow adding a button to the content ([#1294](#1294)) ([c4a0749](c4a0749))
* **Meter:** New component ([#1281](#1281)) ([1a061d8](1a061d8))
* **Sheet:** allow closing the sheet with the keyboard or a screen reader ([#1293](#1293)) ([42099fb](42099fb))
@tuentisre
Copy link
Collaborator

🎉 This PR is included in version 16.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants