Repository navigation
Conversation
da06727 to
90e3e6b
Compare
68d58d6 to
0a4a2fd
Compare
442b2dd to
3475255
Compare
PanchoutNathan
left a comment
There was a problem hiding this comment.
Hi! Thanks for the work! There are a few minor UX issues. Currently, I feel like the icons aren't quite right. The neutral variant is white. The info is labeled "brand," but I don't think we're actually using the brand. Is the notification's display direction configurable? The progress bar is now useless since we're no longer including it. The height of the Toast isn't consistent depending on whether there are buttons or not. I'm wondering if there should be some standardization between Alerts and Toasts, at least in terms of content.
50b96bf to
3cbb432
Compare
| <span className="c__toast-extended__item-status"> | ||
| {item.status === "completed" ? ( | ||
| <CircleCheckFilled size={16} /> | ||
| ) : ( | ||
| <Loader size={16} className="c__toast-extended__item-loader" /> | ||
| )} | ||
| </span> |
There was a problem hiding this comment.
The completed and loading states are represented only by unnamed SVGs. Chromium's accessibility tree exposes the file title and an unnamed image, but no transfer state. Please provide a localized status text, visually hidden if necessary, and make the icons decorative.
| @@ -0,0 +1,94 @@ | |||
| /** | |||
42bd471 to
a0f6cf2
Compare
4326494 to
6c01982
Compare
79eed8a to
2e9ab3a
Compare
2e9ab3a to
dfa25fd
Compare
Move the alert message row (icon, message, labelled buttons, close button) into an internal NotificationContent component, prefixed by the BEM block of the component embedding it. AlertProps now extends the exported NotificationProps. The markup, the buttons and the styles are unchanged, so the alert looks exactly the same.
Give the alert its new look: full tint, 8px radius, 24px icon, 14px text and
8px padding. The labelled buttons become borderless 32px buttons tinted with
the variant, info uses the brand palette and neutral gets its own variant.
The theme override in alert.scss is gone.
NotificationContent gains the props behind it: actions as a list of
{ label, onClick } descriptors, hideIcon, and an icon moved after the message
when it is interactive. On mobile, the actions wrap under the message,
centered, with the close button kept top-right.
Install react-toastify and rebuild the toast on it. The toast keeps the current call site and gains a position, live updates through updateToast and its own lifecycle when mounted alone. It renders its message row through NotificationContent, like the alert, and is centered on mobile whatever its position. The old ProgressBar exported by the toast goes away with it. Its replacement comes in the next commit.
Add a standalone ProgressBar, in the brand color, with its own tokens. It replaces the one the old toast used to export.
dfa25fd to
36aa923
Compare
4bf8f2b to
dfa61dd
Compare
Purpose
Adapt the existing Toast to the new Figma design, using
react-toastifyunder the hood.The public API stays the same (
useToastProvider,toast(message, type, options), current props). New features are additive (progress, structuredactions,toastExtended,updateToast,dismissToast).Two variants
Lien maquettes : ici
toast.mp4
Apps keep wrapping with
CunninghamProvider/ToastProviderand callingtoast()as today. Nothing to migrate.Proposal
react-toastifyuseToastProvider/ToastProviderand delegate the lifecycle toreact-toastifyprogress, structuredactions,toastExtended,updateToast,dismissToast