From b8b6fc5433e81f13b560a867ff08f78ca4e32155 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 Aug 2025 20:48:01 +0000 Subject: [PATCH 1/4] Initial plan From 6271418fcb83306d60491b89c5976d1bbc05239e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 Aug 2025 20:54:51 +0000 Subject: [PATCH 2/4] Changes before error encountered Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com> --- .../notification/notification.lite.tsx | 2 ++ packages/components/src/utils/index.ts | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/packages/components/src/components/notification/notification.lite.tsx b/packages/components/src/components/notification/notification.lite.tsx index 88230387b838..749d883e7708 100644 --- a/packages/components/src/components/notification/notification.lite.tsx +++ b/packages/components/src/components/notification/notification.lite.tsx @@ -12,6 +12,7 @@ import { cls, getBoolean, getBooleanAsString, + getNotificationRole, stringPropVisible } from '../../utils'; import DBButton from '../button/button.lite'; @@ -41,6 +42,7 @@ export default function DBNotification(props: DBNotificationProps) { ref={_ref} id={props.id} class={cls('db-notification', props.className)} + role={getNotificationRole(props.semantic)} aria-live={props.ariaLive} data-semantic={props.semantic} data-variant={props.variant} diff --git a/packages/components/src/utils/index.ts b/packages/components/src/utils/index.ts index 683a0bdd9cf2..41a0bd0cf943 100644 --- a/packages/components/src/utils/index.ts +++ b/packages/components/src/utils/index.ts @@ -157,3 +157,21 @@ export const isKeyboardEvent = ( event?: ClickEvent | GeneralKeyboardEvent ): event is GeneralKeyboardEvent => (event as GeneralKeyboardEvent).key !== undefined; + +/** + * Maps semantic values to appropriate ARIA roles for notifications + * @param semantic - The semantic type of the notification + * @returns The appropriate ARIA role or undefined for default behavior + */ +export const getNotificationRole = (semantic?: string): string | undefined => { + switch (semantic) { + case 'critical': + case 'warning': + return 'alert'; + case 'informational': + case 'successful': + return 'status'; + default: + return undefined; + } +}; From 2e5fd19bcd2572bbbfcb7e410e31cf98cb99d0ac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 28 Sep 2025 18:13:37 +0000 Subject: [PATCH 3/4] auto update snapshots (#5078) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../DBNotification-should-have-same-aria-snapshot.yaml | 8 ++++---- .../DBNotification-should-have-same-aria-snapshot.yaml | 8 ++++---- .../DBNotification-should-have-same-aria-snapshot.yaml | 8 ++++---- .../DBNotification-should-have-same-aria-snapshot.yaml | 8 ++++---- .../DBNotification-should-have-same-aria-snapshot.yaml | 8 ++++---- .../DBNotification-should-have-same-aria-snapshot.yaml | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/__snapshots__/notification/showcase/chromium-highContrast/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml b/__snapshots__/notification/showcase/chromium-highContrast/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml index 0f3ce6c86138..f242847addfb 100644 --- a/__snapshots__/notification/showcase/chromium-highContrast/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml +++ b/__snapshots__/notification/showcase/chromium-highContrast/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml @@ -36,19 +36,19 @@ - text: Headline - paragraph: Neutral - button "Close" - - article: + - alert: - text: Headline - paragraph: Critical - button "Close" - - article: + - status: - text: Headline - paragraph: Informational - button "Close" - - article: + - status: - text: Headline - paragraph: Successful - button "Close" - - article: + - alert: - text: Headline - paragraph: Warning - button "Close" diff --git a/__snapshots__/notification/showcase/chromium/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml b/__snapshots__/notification/showcase/chromium/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml index 0f3ce6c86138..f242847addfb 100644 --- a/__snapshots__/notification/showcase/chromium/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml +++ b/__snapshots__/notification/showcase/chromium/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml @@ -36,19 +36,19 @@ - text: Headline - paragraph: Neutral - button "Close" - - article: + - alert: - text: Headline - paragraph: Critical - button "Close" - - article: + - status: - text: Headline - paragraph: Informational - button "Close" - - article: + - status: - text: Headline - paragraph: Successful - button "Close" - - article: + - alert: - text: Headline - paragraph: Warning - button "Close" diff --git a/__snapshots__/notification/showcase/firefox/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml b/__snapshots__/notification/showcase/firefox/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml index 0f3ce6c86138..f242847addfb 100644 --- a/__snapshots__/notification/showcase/firefox/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml +++ b/__snapshots__/notification/showcase/firefox/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml @@ -36,19 +36,19 @@ - text: Headline - paragraph: Neutral - button "Close" - - article: + - alert: - text: Headline - paragraph: Critical - button "Close" - - article: + - status: - text: Headline - paragraph: Informational - button "Close" - - article: + - status: - text: Headline - paragraph: Successful - button "Close" - - article: + - alert: - text: Headline - paragraph: Warning - button "Close" diff --git a/__snapshots__/notification/showcase/mobile-chrome/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml b/__snapshots__/notification/showcase/mobile-chrome/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml index 0f3ce6c86138..f242847addfb 100644 --- a/__snapshots__/notification/showcase/mobile-chrome/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml +++ b/__snapshots__/notification/showcase/mobile-chrome/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml @@ -36,19 +36,19 @@ - text: Headline - paragraph: Neutral - button "Close" - - article: + - alert: - text: Headline - paragraph: Critical - button "Close" - - article: + - status: - text: Headline - paragraph: Informational - button "Close" - - article: + - status: - text: Headline - paragraph: Successful - button "Close" - - article: + - alert: - text: Headline - paragraph: Warning - button "Close" diff --git a/__snapshots__/notification/showcase/mobile-safari/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml b/__snapshots__/notification/showcase/mobile-safari/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml index 0f3ce6c86138..f242847addfb 100644 --- a/__snapshots__/notification/showcase/mobile-safari/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml +++ b/__snapshots__/notification/showcase/mobile-safari/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml @@ -36,19 +36,19 @@ - text: Headline - paragraph: Neutral - button "Close" - - article: + - alert: - text: Headline - paragraph: Critical - button "Close" - - article: + - status: - text: Headline - paragraph: Informational - button "Close" - - article: + - status: - text: Headline - paragraph: Successful - button "Close" - - article: + - alert: - text: Headline - paragraph: Warning - button "Close" diff --git a/__snapshots__/notification/showcase/webkit/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml b/__snapshots__/notification/showcase/webkit/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml index 0f3ce6c86138..f242847addfb 100644 --- a/__snapshots__/notification/showcase/webkit/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml +++ b/__snapshots__/notification/showcase/webkit/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml @@ -36,19 +36,19 @@ - text: Headline - paragraph: Neutral - button "Close" - - article: + - alert: - text: Headline - paragraph: Critical - button "Close" - - article: + - status: - text: Headline - paragraph: Informational - button "Close" - - article: + - status: - text: Headline - paragraph: Successful - button "Close" - - article: + - alert: - text: Headline - paragraph: Warning - button "Close" From cd2b68f3c4e0664efed99efa8ed9ed23d682f7f6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 12:37:33 +0000 Subject: [PATCH 4/4] auto update snapshots (#5390) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../DBNotification-should-have-same-aria-snapshot.yaml | 4 ---- .../DBNotification-should-have-same-aria-snapshot.yaml | 4 ---- .../DBNotification-should-have-same-aria-snapshot.yaml | 4 ---- .../DBNotification-should-have-same-aria-snapshot.yaml | 4 ---- .../DBNotification-should-have-same-aria-snapshot.yaml | 4 ---- .../DBNotification-should-have-same-aria-snapshot.yaml | 4 ---- 6 files changed, 24 deletions(-) diff --git a/__snapshots__/notification/showcase/chromium-highContrast/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml b/__snapshots__/notification/showcase/chromium-highContrast/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml index f3d102be7a78..9311e42f39b2 100644 --- a/__snapshots__/notification/showcase/chromium-highContrast/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml +++ b/__snapshots__/notification/showcase/chromium-highContrast/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml @@ -27,19 +27,15 @@ - article: - text: Headline - paragraph: Neutral - - button "Close" - alert: - text: Headline - paragraph: Critical - - button "Close" - status: - text: Headline - paragraph: Informational - - button "Close" - status: - text: Headline - paragraph: Successful - - button "Close" - alert: - text: Headline - paragraph: Warning diff --git a/__snapshots__/notification/showcase/chromium/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml b/__snapshots__/notification/showcase/chromium/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml index f3d102be7a78..9311e42f39b2 100644 --- a/__snapshots__/notification/showcase/chromium/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml +++ b/__snapshots__/notification/showcase/chromium/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml @@ -27,19 +27,15 @@ - article: - text: Headline - paragraph: Neutral - - button "Close" - alert: - text: Headline - paragraph: Critical - - button "Close" - status: - text: Headline - paragraph: Informational - - button "Close" - status: - text: Headline - paragraph: Successful - - button "Close" - alert: - text: Headline - paragraph: Warning diff --git a/__snapshots__/notification/showcase/firefox/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml b/__snapshots__/notification/showcase/firefox/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml index f3d102be7a78..9311e42f39b2 100644 --- a/__snapshots__/notification/showcase/firefox/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml +++ b/__snapshots__/notification/showcase/firefox/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml @@ -27,19 +27,15 @@ - article: - text: Headline - paragraph: Neutral - - button "Close" - alert: - text: Headline - paragraph: Critical - - button "Close" - status: - text: Headline - paragraph: Informational - - button "Close" - status: - text: Headline - paragraph: Successful - - button "Close" - alert: - text: Headline - paragraph: Warning diff --git a/__snapshots__/notification/showcase/mobile-chrome/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml b/__snapshots__/notification/showcase/mobile-chrome/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml index f3d102be7a78..9311e42f39b2 100644 --- a/__snapshots__/notification/showcase/mobile-chrome/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml +++ b/__snapshots__/notification/showcase/mobile-chrome/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml @@ -27,19 +27,15 @@ - article: - text: Headline - paragraph: Neutral - - button "Close" - alert: - text: Headline - paragraph: Critical - - button "Close" - status: - text: Headline - paragraph: Informational - - button "Close" - status: - text: Headline - paragraph: Successful - - button "Close" - alert: - text: Headline - paragraph: Warning diff --git a/__snapshots__/notification/showcase/mobile-safari/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml b/__snapshots__/notification/showcase/mobile-safari/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml index f3d102be7a78..9311e42f39b2 100644 --- a/__snapshots__/notification/showcase/mobile-safari/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml +++ b/__snapshots__/notification/showcase/mobile-safari/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml @@ -27,19 +27,15 @@ - article: - text: Headline - paragraph: Neutral - - button "Close" - alert: - text: Headline - paragraph: Critical - - button "Close" - status: - text: Headline - paragraph: Informational - - button "Close" - status: - text: Headline - paragraph: Successful - - button "Close" - alert: - text: Headline - paragraph: Warning diff --git a/__snapshots__/notification/showcase/webkit/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml b/__snapshots__/notification/showcase/webkit/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml index f3d102be7a78..9311e42f39b2 100644 --- a/__snapshots__/notification/showcase/webkit/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml +++ b/__snapshots__/notification/showcase/webkit/should-have-same-aria-snapshot/DBNotification-should-have-same-aria-snapshot.yaml @@ -27,19 +27,15 @@ - article: - text: Headline - paragraph: Neutral - - button "Close" - alert: - text: Headline - paragraph: Critical - - button "Close" - status: - text: Headline - paragraph: Informational - - button "Close" - status: - text: Headline - paragraph: Successful - - button "Close" - alert: - text: Headline - paragraph: Warning