-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
refactor(notification): improve accessibility #8560
refactor(notification): improve accessibility #8560
Conversation
✔️ Deploy Preview for carbon-elements ready! 🔨 Explore the source changes: 75c700a 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-elements/deploys/60ad77313c01930008f231d2 😎 Browse the preview: https://deploy-preview-8560--carbon-elements.netlify.app |
✔️ Deploy Preview for carbon-components-react ready! 🔨 Explore the source changes: 75c700a 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-components-react/deploys/60ad77314eb663000845e0db 😎 Browse the preview: https://deploy-preview-8560--carbon-components-react.netlify.app/iframe |
This comment has been minimized.
This comment has been minimized.
…06-notification-refactor
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…arbon into 8406-notification-refactor
…06-notification-refactor
…06-notification-refactor
packages/react/src/components/Notification/next/Notification.js
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from the CI log it looks like the themes tests need to be updated to handle custom properties
@emyarod I temporarily set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me! 💥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@emyarod I can flip the v11 flag off to get CI passing if you think these changes look good 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep changes look good outside of just the CI issue mentioned previously
All of this should be behind the v11 flag now. I set it back to I opened an issue to do a docs pass later after all the various v11 Notification changes land, #8761 |
) * chore(wip): push up work * chore(wip): push up work * fix(notification): remove unused import from new test file * fix(notification): remove unused export * chore(wip): refactor toast notification, ensure no interactive children * chore(wip): refactor inline notification to have correct aria role * chore(wip): high contrast fix for toast notification content * chore(wip): check in persistent notification work * chore(wip): revert incorrect resolution from merge conflict with main * fix(notification): improve inline/toast a11y, add persistent variant * fix(notification): apply feedback from IBMa team * test(notification): rewrite tests for newly refactored notifications * chore: include yarn cache for updated user-event dep * fix(notification): remove persistent variant * chore: update snaps * fix(notification): remove unecessary notificationType prop * fix(notification): include margin bottom for toast * fix(notification): remove additional references to unecessary notificationType prop * chore(notification): revert development examples Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Closes #8406
This PR clarifies the API and intention of our notifications to guide consumers towards more accessible notifications out of the box.
This restricts Toast notifications to not allow interactive children (actions). InlineNotification is improved to use the appropriate aria-role and focus interaction when actions are present.
The test suite will fail because In order to view the changes in storybook, I had to flip the 2021 feature flag. So before merging I'll need to flip the 2021 release feature flag back to false.
Changelog
New
next/Notification.js
that is conditionally exported behind the 2021 release flagnotificationType
propChanged (all behind 2021 release flag)
role
can bealert
,log
, orstatus
. Default isstatus
.alertdialog
when actions are presentRemoved (all behind 2021 release flag)
caption
,notificationType
,title
,subtitle
caption
,title
,subtitle
should now usechildren
insteadnotificationType
is now handled internally and is not configurablenotificationType
,title
,subtitle
title
,subtitle
should now usechildren
insteadnotificationType
is now handled internally and is not configurableTesting / Reviewing