Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5206 +/- ##
==========================================
+ Coverage 97.74% 97.76% +0.01%
==========================================
Files 1000 1003 +3
Lines 32346 32585 +239
Branches 11965 12120 +155
==========================================
+ Hits 31616 31856 +240
+ Misses 685 684 -1
Partials 45 45 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
The focus-ring example cannot be exercised by keyboard because its focus container has tabIndex={-1} and the static, non-dismissible item has no other focus trigger.
1 open issue
What changed in this PR
Adds internal Style API v2 support to Flashbar, allowing core-system consumers to customize message items and stacked notifications without adding props to the public interface.
Changes:
- Adds four styling slots:
item,icon,dismissButton, andnotificationBar, including per-item callbacks. - Integrates focus-ring tokens and notification-bar color inheritance.
- Adds slot-forwarding tests and a styled demo page.
| File | Description |
|---|---|
src/flashbar/styles.scss |
Declares item and icon slots, dismiss-button forwarding, and item focus-ring tokens. |
src/flashbar/non-collapsible-flashbar.tsx |
Resolves and forwards styling classes to individual messages. |
src/flashbar/internal-interfaces.ts |
Defines the internal styling-slot interface. |
src/flashbar/flash.tsx |
Applies classes to message elements and dismiss buttons. |
src/flashbar/collapsible.scss |
Adds notification-bar styling tokens and color inheritance. |
src/flashbar/collapsible-flashbar.tsx |
Applies classes to stacked messages, placeholders, and the notification bar. |
src/flashbar/__tests__/style-api.test.tsx |
Tests class forwarding, callbacks, unknown keys, and DOM prop filtering. |
pages/flashbar/style-api-v2.page.tsx |
Demonstrates styling slots and focus-ring customization. |
pages/flashbar/style-api-v2.page.scss |
Defines demo styles using generated styling mixins. |
Review effort: Balanced
66585c4 to
281ba31
Compare
| <div> | ||
| <Box variant="awsui-key-label" margin={{ bottom: 'xs' }}> | ||
| {label} | ||
| </Box> |
281ba31 to
2803b90
Compare
I don't understand this bit: core doesn't have access to internal props either |
@gethinwebster You're right. Fixed the description. |
| slot: | ||
| 'One flash message: its box and focus ring. Accepts a class name, or a function of `{ item }` that returns one, so each `type` can take its own class.', | ||
| properties: ( | ||
| box-shadow: 'Also replaces the shadow of the collapsed stack.', |
There was a problem hiding this comment.
Why is this description specific to box-shadow prop? Don't all item props also apply to the collapsed stack?


Description
Adds the internal Style API v2 to Flashbar:
item(per message, a class or({ item }) => string),icon,dismissButton(forwards to Button),notificationBar.Behaviour changes:
color: inherit. Default rendering is unchanged. The v1style.notificationBar.root.colorwas a no-op before and now takes effect; theflashbar/style-customVR baseline changes accordingly.--awsui-style-focus-ring-box-shadowproperty is removed. Computed rings are identical.The style-docs snapshot and the VR registration of the dev page follow in one PR for all components.
Tracker section: P3d34KdbCd6o.
Related links, issue #, if available: n/a
How has this been tested?
Unit tests for the four slots, dev page
flashbar/style-api-v2, build and lint green.Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.