Skip to content

Conversation

@mukunku
Copy link
Collaborator

@mukunku mukunku commented Dec 19, 2025

Summary

This PR updates the Notice components according to the latest SHINE designs.

Additionally, the changes in this PR gets the Toast component 95% there. However I will open a follow-up PR's for the Toast and Banner components as they are separate tickets.

How to Test

As mentioned, only test the Notice component in Stacks Docs and Stacks Svelte:

@changeset-bot
Copy link

changeset-bot bot commented Dec 19, 2025

🦋 Changeset detected

Latest commit: bbaf531

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for stacks-svelte ready!

Name Link
🔨 Latest commit bbaf531
🔍 Latest deploy log https://app.netlify.com/projects/stacks-svelte/deploys/69457a608dac8700085d006c
😎 Deploy Preview https://deploy-preview-2109--stacks-svelte.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for stacks ready!

Name Link
🔨 Latest commit bbaf531
🔍 Latest deploy log https://app.netlify.com/projects/stacks/deploys/69457a60f7a5d300083f58ed
😎 Deploy Preview https://deploy-preview-2109--stacks.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment on lines -167 to +154
// TODO: decouple .s-notice--btn from .s-btn
button&--dismiss {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introduced s-notice--dismiss class here to make the dismiss button more explicit and style it accordingly.

Comment on lines 56 to 70
/**
* Whether to include a dismiss button on the notice or not
*/
dismissable: boolean;
/**
* Optional dismiss event handler
*/
onDismiss?: MouseEventHandler<HTMLButtonElement>;
/**
* Dismiss button label override
*/
i18nDismissButtonLabel?: string;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the dismiss button a boolean flag here with additional props instead of a special NoticeAction case like it was before. I think this make more sense and improves usability. Hopefully other folks agree 🙏🏾

align-items: center;
gap: var(--su4);

&--icon {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introduced the s-notice--icon class for the icons

Comment on lines +26 to +27
<button type="button" class="s-link s-link__underlined">Undo</button>
<button type="button" class="s-link s-notice--dismiss js-toast-close" aria-label="Dismiss" data-action="s-toast#hide">{% icon "ClearSm" %}</button>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted to style the buttons with s-link but not sure if I should've used s-btn s-btn__link instead like we do in the Svelte component for Notices.

Copy link
Collaborator

@CGuindon CGuindon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great, just noticing some weirdness when I resize the screen smaller:

  • the whole browser starts to shrink instead of resize when I go below 600px width — feels like a docs issue but not sure if the toast is affecting this somehow
  • Notices can wrap to multiple lines when needed:
    • Padding right should maintain a minimum of 12px (even when there's no X or under button, the description text shouldn't touch the right edge of the notice)
    • Links on the end shouldn't wrap within itself (keep as single line unless the whole description is wrapping)
    • Code snipets shouldn't wrap within itself either
Screenshot 2025-12-19 at 9 59 44 AM

Added an extra example in the variations section to make that a bit clearer

Screenshot 2025-12-19 at 10 02 32 AM

For the toast not banner (possibly for the other ticket):

  • I noticed when I add the s-notice__important to the toast example, the undo link and close icon stay black instead of turning white as well.
Screenshot 2025-12-19 at 9 52 18 AM

@mukunku mukunku marked this pull request as ready for review December 19, 2025 18:10
@CGuindon
Copy link
Collaborator

I also had a note to myself to write a warning note to add to the docs right below the Toast description text. Can you use a warning in-page notice there that says:

Usage Warning: We are phasing out Toasts due to significant accessibility barriers. Avoid this component for new features. Instead, prioritize integrated alternatives—such as component state changes or inline messages—to provide accessible feedback directly where the user is focused.

Screenshot 2025-12-19 at 10 13 57 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants