[BpkFloatingNotification] [ISO-1654] Add critical floating notification type#4323
[BpkFloatingNotification] [ISO-1654] Add critical floating notification type#4323
Conversation
Co-authored-by: mariia-shyn <206853533+mariia-shyn@users.noreply.github.com> Agent-Logs-Url: https://github.com/Skyscanner/backpack/sessions/f174a053-ae89-4460-92e0-5ba588025df6
|
Visit https://backpack.github.io/storybook-prs/4323 to see this build running in a browser. |
…er-error-day Co-authored-by: mariia-shyn <206853533+mariia-shyn@users.noreply.github.com> Agent-Logs-Url: https://github.com/Skyscanner/backpack/sessions/8ecf1b22-dd87-4bbf-a8a5-6176ca2ba3d6
| } | ||
|
|
||
| &--critical { | ||
| background-color: tokens.$bpk-private-info-banner-error-day; |
There was a problem hiding this comment.
We should not use a component token from another component. When we do this it will make theming unpredictable.
There was a problem hiding this comment.
Copilot please use $bpk-status-danger-spot-day for the background color.
There was a problem hiding this comment.
Updated in b09f27b to use tokens.$bpk-status-danger-spot-day — a proper semantic status token rather than the cross-component private token.
Co-authored-by: gert-janvercauteren <728889+gert-janvercauteren@users.noreply.github.com> Agent-Logs-Url: https://github.com/Skyscanner/backpack/sessions/b87498a9-d2e1-4a93-bcb7-7fd55fb89daa
|
Visit https://backpack.github.io/storybook-prs/4323 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4323 to see this build running in a browser. |
|
Copilot add 2 more examples: critical with icon and critical with cta |
|
Visit https://backpack.github.io/storybook-prs/4323 to see this build running in a browser. |
There was a problem hiding this comment.
Pull request overview
Adds a new “critical” variant to BpkFloatingNotification, enabling consumers to render a more urgent-looking floating notification using a semantic status token.
Changes:
- Introduced
NOTIFICATION_TYPESand a newtypeprop (default/critical) to apply a critical modifier class. - Added
--criticalstyling usingtokens.$bpk-status-danger-spot-dayand updated snapshots/tests accordingly. - Added README usage plus new Storybook examples for critical (base, with icon, with CTA).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/bpk-component-floating-notification/src/BpkFloatingNotification.tsx | Adds NOTIFICATION_TYPES + type prop and applies the critical modifier class. |
| packages/bpk-component-floating-notification/src/BpkFloatingNotification.module.scss | Adds &--critical styling using semantic danger token. |
| packages/bpk-component-floating-notification/src/BpkFloatingNotification-test.tsx | Adds snapshot coverage for the critical type. |
| packages/bpk-component-floating-notification/src/snapshots/BpkFloatingNotification-test.tsx.snap | Stores new snapshot output for the critical type. |
| packages/bpk-component-floating-notification/index.ts | Re-exports NOTIFICATION_TYPES from the package entrypoint. |
| packages/bpk-component-floating-notification/README.md | Documents how to use the new critical type. |
| examples/bpk-component-floating-notification/examples.tsx | Adds critical examples (base, with icon, with CTA). |
| examples/bpk-component-floating-notification/stories.tsx | Exposes the new critical examples in Storybook. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/bpk-component-floating-notification/src/BpkFloatingNotification.tsx
Show resolved
Hide resolved
|
|
||
| import BpkIconHeart from '../../bpk-component-icon/sm/heart'; | ||
|
|
||
| import BpkFloatingNotification from './BpkFloatingNotification'; |
There was a problem hiding this comment.
could you help add an accessibility test for rendering critical style in packages/bpk-component-floating-notification/src/accessibility-test.tsx
There was a problem hiding this comment.
considering a critical notification may need interrupt, should we use assertive aria-live for BpkAriaLive when NOTIFICATION_TYPES.critical ? As-is, screen-reader users receive the same deferred announcement for critical and default variants.
|
Visit https://backpack.github.io/storybook-prs/4323 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4323 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4323 to see this build running in a browser. |
| <BpkAriaLive | ||
| aria-hidden | ||
| politenessSetting={ | ||
| type === NOTIFICATION_TYPES.critical ? 'assertive' : 'polite' |
There was a problem hiding this comment.
I supposed we could use POLITENESS_SETTINGS.assertive and POLITENESS_SETTINGS.polite here rather than hardcode
|
Visit https://backpack.github.io/storybook-prs/4323 to see this build running in a browser. |
| import { CSSTransition } from 'react-transition-group'; | ||
|
|
||
| import BpkAriaLive from '../../bpk-component-aria-live'; | ||
| import { POLITENESS_SETTINGS } from '../../bpk-component-aria-live/src/BpkAriaLive'; |
There was a problem hiding this comment.
| import { POLITENESS_SETTINGS } from '../../bpk-component-aria-live/src/BpkAriaLive'; | |
| import BpkAriaLive, { POLITENESS_SETTINGS } from '../../bpk-component-aria-live'; |
There was a problem hiding this comment.
Aha, sorry for the mistake, yes, you can use ARIA_LIVE_POLITENESS_SETTINGS
|
Visit https://backpack.github.io/storybook-prs/4323 to see this build running in a browser. |

$bpk-critical-background-day: #e70866;local variable fromBpkFloatingNotification.module.scssbackground-color: $bpk-critical-background-daywithbackground-color: tokens.$bpk-status-danger-spot-dayin the&--criticalblock (uses a proper semantic status token rather than a cross-component private token, to avoid unpredictable theming)CriticalWithIconStorybook example (critical notification with icon)CriticalWithCtaStorybook example (critical notification with CTA)Remember to include the following changes:
[Clover-123][BpkButton] Updating the colourREADME.md(If you have created a new component)README.md✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.