Skip to content

Commit

Permalink
[notice] removed critical notification label from notice with warning…
Browse files Browse the repository at this point in the history
… theme (#1471)

Co-authored-by: faisne <166654065+sheila-semrush@users.noreply.github.com>
  • Loading branch information
msereniti and sheila-semrush committed Jul 8, 2024
1 parent 56ca4ff commit 0b57abb
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 116 deletions.
230 changes: 118 additions & 112 deletions semcore/notice-global/CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion semcore/notice-global/src/NoticeGlobal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class NoticeGlobalRoot extends Component {
backgroundColor={color}
role='region'
aria-live={isAssertive ? 'assertive' : 'polite'}
aria-label={getI18nText(isAssertive ? 'criticalNotification' : 'notification')}
aria-label={getI18nText(theme === 'danger' ? 'criticalNotification' : 'notification')}
>
{advancedMode ? (
<Children />
Expand Down
6 changes: 6 additions & 0 deletions semcore/notice/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).

## [5.36.1] - 2024-06-27

### Fixed

- Notice only with `danger` theme has aria-label "Critical Notification" (`warning` theme gets "Notification" as all other themes).

## [5.36.0] - 2024-07-05

### Changed
Expand Down
2 changes: 1 addition & 1 deletion semcore/notice/src/Notice.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class RootNotice extends Component {
backgroundColor={color}
role='region'
aria-live={ariaLive}
aria-label={getI18nText(isAssertive ? 'criticalNotification' : 'notification')}
aria-label={getI18nText(theme === 'danger' ? 'criticalNotification' : 'notification')}
>
<Children />
</SNotice>,
Expand Down
3 changes: 2 additions & 1 deletion website/docs/components/notice-global/notice-global-a11y.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ Table: Roles & attributes
| Component | Attribute | Usage |
| ------------------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `NoticeGlobal` | `role="region"` | Defines an ARIA landmark and allows users to navigate to the component easily and to have it listed in a summary of the page. |
| `NoticeGlobal` | `aria-label` | Defines a default accessible name for the region: `"Notification"` for **info**, **success** and **warning** themes, and `"Critical notification"` for **danger** theme. |
| `NoticeGlobal` | `aria-live="polite"` | Defines a region which receives updates that are important for the user to receive, but not so rapid as to be annoying. The screen reader will speak changes whenever the user is idle. |
| `NoticeGlobal` | `aria-live="assertive"` (only for `warning` and `danger` themes) | Tells assistive technologies to interrupt other processes to provide users with immediate notification of container changes. |
| `NoticeGlobal.CloseIcon` | `aria-label="Close"` | Defines the default accessible name for the **Close** button. |
| `NoticeGlobal.CloseIcon` | `aria-label="Close notification"` | Defines the default accessible name for the **Close** button. |

## Considerations for developers

Expand Down
2 changes: 1 addition & 1 deletion website/docs/components/notice/notice-a11y.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Table: Roles & attributes
| Component | Attribute | Usage |
| ------------------ | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Notice` | `role="region"` | Defines an ARIA landmark and allows users to navigate to the component easily and to have it listed in a summary of the page. |
| `Notice` | `aria-label="Notification"` | Defines a default accessible name for the region. |
| `Notice` | `aria-label` | Defines a default accessible name for the region: `"Notification"` for **info**, **success** and **warning** themes, and `"Critical notification"` for **danger** theme. |
| `Notice` | `aria-live="polite"` | Defines a region which receives updates that are important for the user to receive, but not so rapid as to be annoying. The screen reader will speak changes whenever the user is idle. |
| `Notice` | `aria-live="assertive"` (only for `warning` and `danger` themes) | Tells assistive technologies to interrupt other processes to provide users with immediate notification of container changes. |
| `Notice.CloseIcon` | `aria-label="Close notification"` | Defines the default accessible name for the **Close** button. |
Expand Down

0 comments on commit 0b57abb

Please sign in to comment.