diff --git a/packages/ibm-products-styles/src/components/NotificationsPanel/_notifications-panel.scss b/packages/ibm-products-styles/src/components/NotificationsPanel/_notifications-panel.scss index dc495495c23..a59afa4411b 100644 --- a/packages/ibm-products-styles/src/components/NotificationsPanel/_notifications-panel.scss +++ b/packages/ibm-products-styles/src/components/NotificationsPanel/_notifications-panel.scss @@ -145,14 +145,15 @@ $block-size: 38.5rem; // stylelint-disable-next-line carbon/layout-use inset-block-start: 3.0625rem; } - .#{$block-class}__notification:hover, - .#{$block-class}__notification:focus { + .#{$block-class}__notification-content--wrapper:hover, + .#{$block-class}__notification-content--wrapper:focus { background-color: $layer-accent-01; - .#{$block-class}__dismiss-single-button { + + .#{c4p-settings.$carbon-prefix}--popover-container + .#{$block-class}__dismiss-single-button { opacity: 1; } } - .#{$block-class}__notification:focus { + .#{$block-class}__notification-content--wrapper:focus { border-color: $focus; box-shadow: inset 0 0 0 2px $focus, @@ -162,14 +163,8 @@ $block-size: 38.5rem; .#{$block-class}__notification { position: relative; display: flex; - align-items: flex-start; - padding: $spacing-05; border: 0; background-color: $layer-01; - cursor: pointer; - inline-size: 100%; - min-block-size: 6.25rem; - text-align: start; transition: background-color $duration-moderate-02 motion(standard); .#{$block-class}__notification-title { @include type.type-style('heading-01'); @@ -202,6 +197,19 @@ $block-size: 38.5rem; fill: $support-info; } } + .#{$block-class}__notification-content--wrapper { + display: flex; + align-items: flex-start; + padding: $spacing-05; + inline-size: 100%; + min-block-size: 6.25rem; + text-align: start; + } + .#{$block-class}__notification-content--wrapper--clickable { + @extend .#{$block-class}__notification-content--wrapper; + + cursor: pointer; + } .#{$block-class}__notification-content { .#{$block-class}__notification-time-label { margin-block-end: $spacing-03; @@ -282,7 +290,7 @@ $block-size: 38.5rem; .#{$block-class}__notification-yesterday:not(:first-of-type):before, .#{$block-class}__notification-previous:not(:first-of-type):before { position: absolute; - margin: 0 auto; + margin: 0 #{$spacing-05}; background-color: $border-subtle-01; block-size: 1px; content: ''; diff --git a/packages/ibm-products-web-components/src/components/notification-panel/notification-footer.ts b/packages/ibm-products-web-components/src/components/notification-panel/notification-footer.ts index a3f3bc69481..17848e35780 100644 --- a/packages/ibm-products-web-components/src/components/notification-panel/notification-footer.ts +++ b/packages/ibm-products-web-components/src/components/notification-panel/notification-footer.ts @@ -50,14 +50,16 @@ class CDSNotificationFooter extends HostListenerMixin(LitElement) { > ${viewAllLabel} - ${iconLoader(Settings16, { slot: 'icon' })} - + Settings + `; } diff --git a/packages/ibm-products-web-components/src/components/notification-panel/notification-panel.test.ts b/packages/ibm-products-web-components/src/components/notification-panel/notification-panel.test.ts index 8cb9f38dd77..06485a1e71d 100644 --- a/packages/ibm-products-web-components/src/components/notification-panel/notification-panel.test.ts +++ b/packages/ibm-products-web-components/src/components/notification-panel/notification-panel.test.ts @@ -7,6 +7,7 @@ import { describe, expect, it, vi } from 'vitest'; import { html, fixture, oneEvent, elementUpdated } from '@open-wc/testing'; +// import { expect as chaiExpect } from '@open-wc/testing'; import './index'; import CDSNotificationPanel from './notification-panel'; @@ -90,6 +91,16 @@ const template = (props: any = defaultProps) => { }; describe('c4p-notification-panel', () => { + // Currently, this test is failing because of an a11y violation in the carbon cds-toggle component. + // To rectify this, an issue (ID: 20106) has been logged with the carbon team. + // Once the mentioned issue is resolved, this test should be re-enabled. + + // it('should be accessible and have no axe violations', async () => { + // const el = (await fixture(template())) as CDSNotificationPanel; + // // Runs axe-core, checks for WCAG compliance + // await chaiExpect(el).to.be.accessible(); + // }); + it('should render the notification panel', async () => { const panel = (await fixture(template())) as CDSNotificationPanel; expect(panel?.open).toBeTruthy(); diff --git a/packages/ibm-products-web-components/src/components/notification-panel/notification-panel.ts b/packages/ibm-products-web-components/src/components/notification-panel/notification-panel.ts index ac1850067ce..a1b4b84626b 100644 --- a/packages/ibm-products-web-components/src/components/notification-panel/notification-panel.ts +++ b/packages/ibm-products-web-components/src/components/notification-panel/notification-panel.ts @@ -182,7 +182,12 @@ class CDSNotificationPanel extends HostListenerMixin(LitElement) { }); return html` -